@veracity/vui 0.3.2 → 0.5.0
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/avatar/avatar.js +1 -1
- package/button/button.d.ts +15 -1
- package/button/button.js +3 -3
- package/button/button.types.d.ts +4 -4
- package/button/consts.js +2 -2
- package/button/theme.d.ts +2 -0
- package/button/theme.js +3 -2
- package/buttonGroup/buttonGroup.d.ts +1 -1
- package/buttonGroup/buttonGroup.js +1 -1
- package/buttonGroup/helpers.js +3 -1
- package/checkbox/checkbox.d.ts +1 -1
- package/core/consts.d.ts +7 -0
- package/core/consts.js +8 -1
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/links.d.ts +20 -0
- package/core/links.js +173 -0
- package/dialog/consts.d.ts +3 -0
- package/dialog/consts.js +30 -0
- package/dialog/context.d.ts +4 -0
- package/dialog/context.js +23 -0
- package/dialog/dialog.d.ts +26 -0
- package/dialog/dialog.js +122 -0
- package/dialog/dialog.types.d.ts +47 -0
- package/dialog/dialogBody.d.ts +9 -0
- package/dialog/dialogBody.js +85 -0
- package/dialog/dialogCancelButton.d.ts +4 -0
- package/dialog/dialogCancelButton.js +30 -0
- package/dialog/dialogCloseButton.d.ts +4 -0
- package/dialog/dialogCloseButton.js +30 -0
- package/dialog/dialogFooter.d.ts +4 -0
- package/dialog/dialogFooter.js +45 -0
- package/dialog/dialogHeader.d.ts +4 -0
- package/dialog/dialogHeader.js +53 -0
- package/dialog/dialogIcon.d.ts +4 -0
- package/dialog/dialogIcon.js +32 -0
- package/dialog/dialogSubmitButton.d.ts +4 -0
- package/dialog/dialogSubmitButton.js +28 -0
- package/dialog/dialogTitle.d.ts +4 -0
- package/dialog/dialogTitle.js +30 -0
- package/dialog/index.d.ts +13 -0
- package/dialog/index.js +30 -0
- package/dialog/theme.d.ts +22 -0
- package/dialog/theme.js +28 -0
- package/footer/context.d.ts +4 -0
- package/footer/context.js +23 -0
- package/footer/footer.d.ts +2 -0
- package/footer/footer.js +11 -29
- package/footer/footer.types.d.ts +19 -16
- package/footer/footerColumn.d.ts +2 -218
- package/footer/footerColumn.js +16 -2
- package/footer/footerContent.d.ts +3 -0
- package/footer/footerContent.js +28 -0
- package/footer/footerHeading.js +2 -1
- package/footer/footerLink.js +2 -1
- package/footer/footerRow.js +2 -1
- package/footer/footerSection.js +4 -3
- package/footer/footerTrademark.d.ts +3 -5
- package/footer/footerTrademark.js +23 -6
- package/footer/helpers.d.ts +7 -10
- package/footer/helpers.js +91 -33
- package/footer/index.d.ts +1 -1
- package/footer/index.js +1 -1
- package/footer/theme.js +1 -1
- package/grid/grid.d.ts +5 -0
- package/{header/headerLink.js → grid/grid.js} +17 -13
- package/grid/grid.types.d.ts +3 -0
- package/grid/grid.types.js +2 -0
- package/grid/index.d.ts +3 -0
- package/grid/index.js +20 -0
- package/grid/theme.d.ts +7 -0
- package/grid/theme.js +12 -0
- package/header/context.d.ts +2 -2
- package/header/context.js +3 -3
- package/header/header.d.ts +11 -10
- package/header/header.js +36 -21
- package/header/header.types.d.ts +54 -39
- package/header/headerAccount.d.ts +8 -0
- package/header/{headerProfile.js → headerAccount.js} +32 -45
- package/header/headerAccount.types.d.ts +35 -0
- package/header/headerAccount.types.js +2 -0
- package/header/headerAccountUserInfo.d.ts +4 -0
- package/header/headerAccountUserInfo.js +46 -0
- package/header/headerContent.d.ts +2 -3
- package/header/headerContent.js +3 -3
- package/header/headerCreateAccount.js +8 -5
- package/header/headerDivider.js +2 -2
- package/header/headerLinkItem.d.ts +4 -0
- package/header/headerLinkItem.js +53 -0
- package/header/headerLogo.js +8 -10
- package/header/headerMainLinks.d.ts +4 -0
- package/header/{headerLinks.js → headerMainLinks.js} +10 -7
- package/header/headerMobileContent.js +4 -3
- package/header/headerMobileToggle.d.ts +2 -2
- package/header/headerMobileToggle.js +6 -7
- package/header/headerNotifications.js +8 -8
- package/header/headerServices.d.ts +5 -1
- package/header/headerServices.js +23 -14
- package/header/headerServicesMessage.d.ts +4 -0
- package/header/headerServicesMessage.js +49 -0
- package/header/headerSignIn.js +5 -3
- package/header/helpers.d.ts +8 -0
- package/header/helpers.js +115 -0
- package/header/index.d.ts +8 -3
- package/header/index.js +8 -3
- package/header/loggedInHeader.d.ts +1 -1
- package/header/loggedInHeader.js +16 -12
- package/header/loggedOutHeader.js +15 -12
- package/header/theme.d.ts +62 -7
- package/header/theme.js +53 -12
- package/icons/baseIcons/fas/fasCalendarAlt.js +1 -1
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/input/consts.js +2 -2
- package/input/input.js +1 -1
- package/input/input.types.d.ts +3 -3
- package/link/link.types.d.ts +4 -4
- package/link/linkText.js +1 -1
- package/list/listHeading.js +1 -1
- package/list/listItem.js +2 -2
- package/list/theme.d.ts +2 -4
- package/list/theme.js +2 -4
- package/menu/menuItem.js +7 -22
- package/menu/menuList.js +1 -1
- package/modal/ModalBackdrop.d.ts +4 -0
- package/modal/ModalBackdrop.js +37 -0
- package/modal/ModalContent.d.ts +4 -0
- package/modal/ModalContent.js +38 -0
- package/modal/context.d.ts +4 -0
- package/modal/context.js +23 -0
- package/modal/focusLock.d.ts +9 -0
- package/modal/focusLock.js +47 -0
- package/modal/focusLock.types.d.ts +28 -0
- package/modal/focusLock.types.js +2 -0
- package/modal/index.d.ts +9 -0
- package/modal/index.js +26 -0
- package/modal/modal.d.ts +15 -0
- package/modal/modal.js +113 -0
- package/modal/modal.types.d.ts +46 -0
- package/modal/modal.types.js +2 -0
- package/modal/modalManager.d.ts +12 -0
- package/modal/modalManager.js +33 -0
- package/modal/theme.d.ts +8 -0
- package/modal/theme.js +14 -0
- package/notification/consts.js +2 -2
- package/notification/notification.types.d.ts +1 -2
- package/notification/theme.js +1 -1
- package/package.json +3 -1
- package/popover/popover.d.ts +1 -1
- package/popover/popover.js +5 -4
- package/popover/popoverContent.js +1 -1
- package/popover/popoverTrigger.js +7 -2
- package/popover/usePopover.js +7 -9
- package/popover/usePopover.types.d.ts +1 -1
- package/portal/index.d.ts +3 -0
- package/portal/index.js +20 -0
- package/portal/portal.d.ts +5 -0
- package/portal/portal.js +56 -0
- package/portal/portal.types.d.ts +7 -0
- package/portal/portal.types.js +2 -0
- package/radio/radio.d.ts +1 -1
- package/radio/radioGroup.js +1 -1
- package/svg/svg.js +9 -7
- package/svg/svg.types.d.ts +2 -2
- package/system/custom.d.ts +0 -4
- package/system/custom.js +1 -15
- package/system/effects.d.ts +4 -4
- package/system/grids.d.ts +5 -3
- package/system/system.d.ts +2 -2
- package/system/system.js +1 -1
- package/system/transitions.d.ts +1 -1
- package/tag/tag.js +1 -2
- package/tag/tag.types.d.ts +3 -4
- package/tag/theme.d.ts +1 -0
- package/tag/theme.js +2 -1
- package/textarea/textarea.js +2 -2
- package/theme/components.d.ts +101 -11
- package/theme/components.js +48 -42
- package/theme/defaultTheme.d.ts +130 -12
- package/theme/foundations/gridTemplateColumns.d.ts +15 -0
- package/theme/foundations/gridTemplateColumns.js +16 -0
- package/theme/foundations/gridTemplateRows.d.ts +9 -0
- package/theme/foundations/gridTemplateRows.js +10 -0
- package/theme/foundations/index.d.ts +29 -1
- package/theme/foundations/index.js +6 -0
- package/theme/foundations/timingFunctions.d.ts +2 -0
- package/theme/foundations/timingFunctions.js +3 -0
- package/theme/foundations/zIndices.d.ts +6 -1
- package/theme/foundations/zIndices.js +6 -1
- package/theme/types.d.ts +9 -1
- package/utils/assertion.d.ts +2 -0
- package/utils/assertion.js +6 -1
- package/utils/function.d.ts +4 -0
- package/utils/function.js +19 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/number.d.ts +2 -0
- package/utils/number.js +10 -0
- package/utils/object.js +9 -17
- package/utils/react.d.ts +12 -5
- package/utils/react.js +69 -9
- package/utils/types.d.ts +4 -2
- package/footer/consts.d.ts +0 -72
- package/footer/consts.js +0 -132
- package/header/headerLink.d.ts +0 -4
- package/header/headerLinks.d.ts +0 -4
- package/header/headerProfile.d.ts +0 -4
- package/header/headerProfile.types.d.ts +0 -35
- /package/{header/headerProfile.types.js → dialog/dialog.types.js} +0 -0
package/avatar/avatar.js
CHANGED
|
@@ -36,7 +36,7 @@ var icon_1 = __importDefault(require("../icon"));
|
|
|
36
36
|
var image_1 = __importDefault(require("../image"));
|
|
37
37
|
var utils_1 = require("../utils");
|
|
38
38
|
var helpers_1 = require("./helpers");
|
|
39
|
-
exports.AvatarBase = core_1.styled.spanBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tfont-weight: medium;\n\tjustify-content: center;\n\tline-height: normal;\n\toutline: none;\n\ttransition-duration: fast;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tfont-weight: medium;\n\tjustify-content: center;\n\tline-height: normal;\n\toutline: none;\n\ttransition-duration: fast;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n"
|
|
39
|
+
exports.AvatarBase = core_1.styled.spanBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tfont-weight: medium;\n\tjustify-content: center;\n\tline-height: normal;\n\toutline: none;\n\toverflow: hidden;\n\ttransition-duration: fast;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tfont-weight: medium;\n\tjustify-content: center;\n\tline-height: normal;\n\toutline: none;\n\toverflow: hidden;\n\ttransition-duration: fast;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n"
|
|
40
40
|
/** Displays user data, such as name initials or profile image. */
|
|
41
41
|
])));
|
|
42
42
|
/** Displays user data, such as name initials or profile image. */
|
package/button/button.d.ts
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { VuiComponent } from '../core';
|
|
2
3
|
import { ButtonProps } from './button.types';
|
|
3
4
|
import ButtonIcon from './buttonIcon';
|
|
4
5
|
import ButtonText from './buttonText';
|
|
5
|
-
export declare const ButtonBase: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, import("..").
|
|
6
|
+
export declare const ButtonBase: import("styled-components").StyledComponent<"button", 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<"Button"> & {
|
|
7
|
+
colorScheme?: "prussian" | "green" | "red" | "blue" | "pink" | undefined;
|
|
8
|
+
icon?: JSX.Element | import("..").IconProp | undefined;
|
|
9
|
+
iconLeft?: JSX.Element | import("..").IconProp | undefined;
|
|
10
|
+
iconRight?: JSX.Element | import("..").IconProp | undefined;
|
|
11
|
+
isElevated?: boolean | undefined;
|
|
12
|
+
isFullWidth?: boolean | undefined;
|
|
13
|
+
isLoading?: boolean | undefined;
|
|
14
|
+
isRound?: boolean | undefined;
|
|
15
|
+
isSplit?: boolean | undefined;
|
|
16
|
+
state?: import("./button.types").ButtonState | undefined;
|
|
17
|
+
stateMapping?: import("./button.types").ButtonStateMapping | undefined;
|
|
18
|
+
text?: React.ReactNode;
|
|
19
|
+
}, never>;
|
|
6
20
|
/**
|
|
7
21
|
* Triggers given actions on click. Supports multiple states, sizes and variant.
|
|
8
22
|
* Comes with additional props for extra behavior, like loading, disabled or elevated.
|
package/button/button.js
CHANGED
|
@@ -59,13 +59,13 @@ var consts_1 = require("./consts");
|
|
|
59
59
|
var context_2 = require("./context");
|
|
60
60
|
var ContentWrapper = core_1.styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tvisibility: hidden;\n"], ["\n\tvisibility: hidden;\n"])));
|
|
61
61
|
var StateWrapper = core_1.styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tbottom: 0;\n\tdisplay: flex;\n\tleft: 0;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n"], ["\n\tbottom: 0;\n\tdisplay: flex;\n\tleft: 0;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n"])));
|
|
62
|
-
exports.ButtonBase = core_1.styled.buttonBox(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\talign-items: center;\n\tborder-radius: md;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tfont-weight: medium;\n\tjustify-content: center;\n\tline-height: normal;\n\toverflow: hidden;\n\tposition: relative;\n\ttransition-duration: fast;\n\tuser-select: none;\n\twidth: fit-content;\n\n\t&:focus,\n\t&:focus:hover {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t\tz-index: 1;\n\t}\n\n\t&[aria-disabled='true'],\n\t&[aria-disabled='true']:hover {\n\t\tbackground-color: disabled.bg;\n\t\tborder-color:
|
|
62
|
+
exports.ButtonBase = core_1.styled.buttonBox(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\talign-items: center;\n\tborder-radius: md;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tfont-weight: medium;\n\tjustify-content: center;\n\tline-height: normal;\n\toverflow: hidden;\n\tposition: relative;\n\ttransition-duration: fast;\n\tuser-select: none;\n\twidth: fit-content;\n\n\t&:focus,\n\t&:focus:hover {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t\tz-index: 1;\n\t}\n\n\t&[aria-disabled='true'],\n\t&[aria-disabled='true']:hover {\n\t\tbackground-color: disabled.bg;\n\t\tborder-color: ", ";\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t}\n"], ["\n\talign-items: center;\n\tborder-radius: md;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tfont-weight: medium;\n\tjustify-content: center;\n\tline-height: normal;\n\toverflow: hidden;\n\tposition: relative;\n\ttransition-duration: fast;\n\tuser-select: none;\n\twidth: fit-content;\n\n\t&:focus,\n\t&:focus:hover {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t\tz-index: 1;\n\t}\n\n\t&[aria-disabled='true'],\n\t&[aria-disabled='true']:hover {\n\t\tbackground-color: disabled.bg;\n\t\tborder-color: ", ";\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t}\n"
|
|
63
63
|
/**
|
|
64
64
|
* Triggers given actions on click. Supports multiple states, sizes and variant.
|
|
65
65
|
* Comes with additional props for extra behavior, like loading, disabled or elevated.
|
|
66
66
|
* Exposes some props to the children via context.
|
|
67
67
|
*/
|
|
68
|
-
])));
|
|
68
|
+
])), function (p) { return (p.variant === 'outlined' ? core_1.th.color('disabled.border') : core_1.th.color('disabled.bg')); });
|
|
69
69
|
/**
|
|
70
70
|
* Triggers given actions on click. Supports multiple states, sizes and variant.
|
|
71
71
|
* Comes with additional props for extra behavior, like loading, disabled or elevated.
|
|
@@ -104,7 +104,7 @@ exports.Button = (0, core_1.vui)(function (props, ref) {
|
|
|
104
104
|
w: isFullWidth ? '100%' : undefined
|
|
105
105
|
});
|
|
106
106
|
return (react_1.default.createElement(context_2.ButtonProvider, { value: context },
|
|
107
|
-
react_1.default.createElement(exports.ButtonBase, __assign({ borderWidth: border, className: (0, utils_1.cs)('vui-button', className), disabled: disabled, focusRing: 3, h: h, pl: pl, pr: pr, ref: ref, type: "button" }, buttonStyles, aliasedProps, rest),
|
|
107
|
+
react_1.default.createElement(exports.ButtonBase, __assign({ borderWidth: border, className: (0, utils_1.cs)('vui-button', className), disabled: disabled, focusRing: 3, h: h, pl: pl, pr: pr, ref: ref, type: "button", variant: variant }, buttonStyles, aliasedProps, rest),
|
|
108
108
|
hasState && (react_1.default.createElement(StateWrapper, __assign({ onClick: function (e) { return e.stopPropagation(); } }, stateProps),
|
|
109
109
|
react_1.default.createElement(buttonIcon_1.default, __assign({ m: "auto" }, stateIconProps)))),
|
|
110
110
|
react_1.default.createElement(Content, null,
|
package/button/button.types.d.ts
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import { IconProp, IconProps } from '../icon';
|
|
3
3
|
import { SystemProps } from '../system';
|
|
4
4
|
import { ThemingProps } from '../theme';
|
|
5
|
-
import {
|
|
5
|
+
import { AnyString } from '../utils';
|
|
6
6
|
export declare type ButtonProps = SystemProps & ThemingProps<'Button'> & {
|
|
7
7
|
/** Available theme colors for this component. @default prussian */
|
|
8
8
|
colorScheme?: 'blue' | 'green' | 'pink' | 'prussian' | 'red';
|
|
9
9
|
/** Icon that replaces any other content. */
|
|
10
|
-
icon?: IconProp |
|
|
10
|
+
icon?: IconProp | JSX.Element;
|
|
11
11
|
/** Socket displaying icon on the left side. */
|
|
12
|
-
iconLeft?: IconProp |
|
|
12
|
+
iconLeft?: IconProp | JSX.Element;
|
|
13
13
|
/** Socket displaying icon on the right side. */
|
|
14
|
-
iconRight?: IconProp |
|
|
14
|
+
iconRight?: IconProp | JSX.Element;
|
|
15
15
|
/** Adds box shadow style. @default false */
|
|
16
16
|
isElevated?: boolean;
|
|
17
17
|
/** Makes the button take full width of the container. @deprecated */
|
package/button/consts.js
CHANGED
|
@@ -13,8 +13,8 @@ exports.buttonStateMapping = {
|
|
|
13
13
|
colorScheme: 'blue',
|
|
14
14
|
iconProps: {
|
|
15
15
|
animation: 'vui-spin 0.6s linear infinite',
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
name: 'fadSpinnerThird',
|
|
17
|
+
pathFill: ['', 'transparent']
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
success: {
|
package/button/theme.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare function variantOutlined(props: Dict): {
|
|
|
3
3
|
container: {
|
|
4
4
|
borderColor: string;
|
|
5
5
|
hoverBorderColor: string;
|
|
6
|
+
focusRing: number;
|
|
6
7
|
hoverBg: string;
|
|
7
8
|
activeBg: string;
|
|
8
9
|
bg: string;
|
|
@@ -41,6 +42,7 @@ declare function variantText(props: Dict): {
|
|
|
41
42
|
borderColor: string;
|
|
42
43
|
borderWidth: number;
|
|
43
44
|
color: string;
|
|
45
|
+
focusRing: number;
|
|
44
46
|
};
|
|
45
47
|
};
|
|
46
48
|
declare const _default: {
|
package/button/theme.js
CHANGED
|
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
function variantOutlined(props) {
|
|
15
15
|
var _a;
|
|
16
16
|
var c = props.colorScheme;
|
|
17
|
-
var container = __assign(__assign({}, (_a = variantText(props)) === null || _a === void 0 ? void 0 : _a.container), { borderColor: c + ".80", hoverBorderColor: c + ".80" });
|
|
17
|
+
var container = __assign(__assign({}, (_a = variantText(props)) === null || _a === void 0 ? void 0 : _a.container), { borderColor: c + ".80", hoverBorderColor: c + ".80", focusRing: 3 });
|
|
18
18
|
return { container: container };
|
|
19
19
|
}
|
|
20
20
|
function variantSolid(props) {
|
|
@@ -66,7 +66,8 @@ function variantText(props) {
|
|
|
66
66
|
bg: 'transparent',
|
|
67
67
|
borderColor: 'transparent',
|
|
68
68
|
borderWidth: 1,
|
|
69
|
-
color: c + ".80"
|
|
69
|
+
color: c + ".80",
|
|
70
|
+
focusRing: 2
|
|
70
71
|
};
|
|
71
72
|
// Special cases
|
|
72
73
|
if (c === 'prussian') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ButtonGroupProps } from './buttonGroup.types';
|
|
2
|
-
export declare const ButtonGroupBase: 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("
|
|
2
|
+
export declare const ButtonGroupBase: 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 & {
|
|
3
3
|
innerBorderColor: string;
|
|
4
4
|
}, never>;
|
|
5
5
|
/**
|
|
@@ -51,7 +51,7 @@ var core_1 = require("../core");
|
|
|
51
51
|
var utils_1 = require("../utils");
|
|
52
52
|
var context_1 = require("./context");
|
|
53
53
|
var helpers_1 = require("./helpers");
|
|
54
|
-
exports.ButtonGroupBase = core_1.styled.divBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\n\t// Border color between Buttons\n\t> *:not(:last-of-type):not(
|
|
54
|
+
exports.ButtonGroupBase = core_1.styled.divBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\n\t// Border color between Buttons\n\t> *:not(:last-of-type):not(:focus) {\n\t\tborder-right-color: ", ";\n\t}\n\n\t// First Button\n\t> *:first-of-type:not(:last-of-type) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right-width: 1px;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t// Middle Buttons\n\t> *:not(:first-of-type):not(:last-of-type) {\n\t\tborder-left-width: 0px;\n\t\tborder-radius: 0;\n\t\tborder-right-width: 1px;\n\t}\n\n\t// Last Button\n\t> *:not(:first-of-type):last-of-type {\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left-width: 0px;\n\t\tborder-top-left-radius: 0;\n\t}\n"], ["\n\tdisplay: flex;\n\n\t// Border color between Buttons\n\t> *:not(:last-of-type):not(:focus) {\n\t\tborder-right-color: ", ";\n\t}\n\n\t// First Button\n\t> *:first-of-type:not(:last-of-type) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right-width: 1px;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t// Middle Buttons\n\t> *:not(:first-of-type):not(:last-of-type) {\n\t\tborder-left-width: 0px;\n\t\tborder-radius: 0;\n\t\tborder-right-width: 1px;\n\t}\n\n\t// Last Button\n\t> *:not(:first-of-type):last-of-type {\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left-width: 0px;\n\t\tborder-top-left-radius: 0;\n\t}\n"
|
|
55
55
|
/**
|
|
56
56
|
* Organizes layout and display of multiple buttons. Controls border visual around and between the buttons.
|
|
57
57
|
* Exposes some props to the children via context.
|
package/buttonGroup/helpers.js
CHANGED
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getInnerBorderColor = void 0;
|
|
4
4
|
/** Returns appropriate color for the border between the buttons. */
|
|
5
5
|
function getInnerBorderColor(props) {
|
|
6
|
-
var _a = props.colorScheme, colorScheme = _a === void 0 ? 'prussian' : _a, _b = props.variant, variant = _b === void 0 ? 'solid' : _b;
|
|
6
|
+
var _a = props.colorScheme, colorScheme = _a === void 0 ? 'prussian' : _a, disabled = props.disabled, _b = props.variant, variant = _b === void 0 ? 'solid' : _b;
|
|
7
|
+
if (disabled)
|
|
8
|
+
return 'disabled.border';
|
|
7
9
|
var shade = variant === 'solid' ? '100' : '80';
|
|
8
10
|
return colorScheme + "." + shade;
|
|
9
11
|
}
|
package/checkbox/checkbox.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CheckboxProps, CheckboxStyleProps } from './checkbox.types';
|
|
2
|
-
export declare const CheckboxBase: import("styled-components").StyledComponent<"label", 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("
|
|
2
|
+
export declare const CheckboxBase: import("styled-components").StyledComponent<"label", 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 & CheckboxStyleProps, never>;
|
|
3
3
|
/**
|
|
4
4
|
* Allows selection of one or more choices from a set of items. Handles controlled and uncontrolled modes.
|
|
5
5
|
* Uses icons to display itself in different states. Can be indeterminate when selecting some nested items.
|
package/core/consts.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
1
|
export declare const cdnUrl = "https://cdn.veracity.com";
|
|
2
|
+
export declare const cdnStagUrl = "https://cdnstag.veracity.com";
|
|
3
|
+
export declare const cdnTestUrl = "https://cdntest.veracity.com";
|
|
4
|
+
export declare const cdnUrls: {
|
|
5
|
+
readonly Prod: "https://cdn.veracity.com";
|
|
6
|
+
readonly Stag: "https://cdnstag.veracity.com";
|
|
7
|
+
readonly Test: "https://cdntest.veracity.com";
|
|
8
|
+
};
|
package/core/consts.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cdnUrl = void 0;
|
|
3
|
+
exports.cdnUrls = exports.cdnTestUrl = exports.cdnStagUrl = exports.cdnUrl = void 0;
|
|
4
4
|
exports.cdnUrl = 'https://cdn.veracity.com';
|
|
5
|
+
exports.cdnStagUrl = 'https://cdnstag.veracity.com';
|
|
6
|
+
exports.cdnTestUrl = 'https://cdntest.veracity.com';
|
|
7
|
+
exports.cdnUrls = {
|
|
8
|
+
Prod: exports.cdnUrl,
|
|
9
|
+
Stag: exports.cdnStagUrl,
|
|
10
|
+
Test: exports.cdnTestUrl
|
|
11
|
+
};
|
package/core/index.d.ts
CHANGED
package/core/index.js
CHANGED
|
@@ -11,6 +11,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./consts"), exports);
|
|
14
|
+
__exportStar(require("./links"), exports);
|
|
14
15
|
__exportStar(require("./media"), exports);
|
|
15
16
|
__exportStar(require("./styled"), exports);
|
|
16
17
|
__exportStar(require("./theme"), exports);
|
package/core/links.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { Dict, Environment } from '../utils';
|
|
3
|
+
export declare type LinksDict = Dict<string>;
|
|
4
|
+
declare type LinksContextType = [LinksDict, Dispatch<SetStateAction<LinksDict>>];
|
|
5
|
+
/**
|
|
6
|
+
* Adds loggedIn=1 parameter to the URL if isLoggedIn flag is true, which means the user is logged in.
|
|
7
|
+
* This is supposed to aid login flow when navigating between Veracity applications.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getLoggedInLink(link: string, isLoggedIn?: boolean): string;
|
|
10
|
+
export declare function LinksProvider(props: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}): JSX.Element;
|
|
13
|
+
/** Returns links and setLinks from LinksContext. */
|
|
14
|
+
export declare function useLinks(): LinksContextType;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves the links from CDN for the given environment and appends them with loggedin=1 parameter
|
|
17
|
+
* if user is logged in. Links will be reloaded or updated whenever 'env' or 'isLoggedIn' change.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useLoadLinks(env?: Environment, isLoggedIn?: boolean): void;
|
|
20
|
+
export {};
|
package/core/links.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
36
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
37
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
38
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
42
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
43
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
44
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
|
+
function step(op) {
|
|
46
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
47
|
+
while (_) try {
|
|
48
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
49
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
50
|
+
switch (op[0]) {
|
|
51
|
+
case 0: case 1: t = op; break;
|
|
52
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
53
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
54
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
55
|
+
default:
|
|
56
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
57
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
58
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
59
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
60
|
+
if (t[2]) _.ops.pop();
|
|
61
|
+
_.trys.pop(); continue;
|
|
62
|
+
}
|
|
63
|
+
op = body.call(thisArg, _);
|
|
64
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
65
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
69
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
70
|
+
if (!m) return o;
|
|
71
|
+
var i = m.call(o), r, ar = [], e;
|
|
72
|
+
try {
|
|
73
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
74
|
+
}
|
|
75
|
+
catch (error) { e = { error: error }; }
|
|
76
|
+
finally {
|
|
77
|
+
try {
|
|
78
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
79
|
+
}
|
|
80
|
+
finally { if (e) throw e.error; }
|
|
81
|
+
}
|
|
82
|
+
return ar;
|
|
83
|
+
};
|
|
84
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
85
|
+
exports.useLoadLinks = exports.useLinks = exports.LinksProvider = exports.getLoggedInLink = void 0;
|
|
86
|
+
var react_1 = __importStar(require("react"));
|
|
87
|
+
var utils_1 = require("../utils");
|
|
88
|
+
var consts_1 = require("./consts");
|
|
89
|
+
var LinksContext = (0, react_1.createContext)(undefined);
|
|
90
|
+
/**
|
|
91
|
+
* Adds loggedIn=1 parameter to the URL if isLoggedIn flag is true, which means the user is logged in.
|
|
92
|
+
* This is supposed to aid login flow when navigating between Veracity applications.
|
|
93
|
+
*/
|
|
94
|
+
function getLoggedInLink(link, isLoggedIn) {
|
|
95
|
+
try {
|
|
96
|
+
var url = new URL(link);
|
|
97
|
+
if (isLoggedIn)
|
|
98
|
+
url.searchParams.append('loggedin', '1');
|
|
99
|
+
return url.toString();
|
|
100
|
+
}
|
|
101
|
+
catch (_a) {
|
|
102
|
+
return link;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.getLoggedInLink = getLoggedInLink;
|
|
106
|
+
function LinksProvider(props) {
|
|
107
|
+
var linksState = (0, react_1.useState)({});
|
|
108
|
+
return react_1.default.createElement(LinksContext.Provider, __assign({ value: linksState }, props));
|
|
109
|
+
}
|
|
110
|
+
exports.LinksProvider = LinksProvider;
|
|
111
|
+
/** Returns links and setLinks from LinksContext. */
|
|
112
|
+
function useLinks() {
|
|
113
|
+
var context = (0, react_1.useContext)(LinksContext);
|
|
114
|
+
if (context === undefined) {
|
|
115
|
+
console.error('useLinks must be used within a LinksContext.');
|
|
116
|
+
return [{}, utils_1.noop];
|
|
117
|
+
}
|
|
118
|
+
return context;
|
|
119
|
+
}
|
|
120
|
+
exports.useLinks = useLinks;
|
|
121
|
+
/**
|
|
122
|
+
* Retrieves the links from CDN for the given environment and appends them with loggedin=1 parameter
|
|
123
|
+
* if user is logged in. Links will be reloaded or updated whenever 'env' or 'isLoggedIn' change.
|
|
124
|
+
*/
|
|
125
|
+
function useLoadLinks(env, isLoggedIn) {
|
|
126
|
+
var _a = __read(useLinks(), 2), setLinks = _a[1];
|
|
127
|
+
(0, react_1.useEffect)(function () {
|
|
128
|
+
if (!env)
|
|
129
|
+
return;
|
|
130
|
+
loadLinks(env);
|
|
131
|
+
}, [env]);
|
|
132
|
+
(0, react_1.useEffect)(function () {
|
|
133
|
+
appendLoggedInParam(isLoggedIn);
|
|
134
|
+
}, [isLoggedIn]);
|
|
135
|
+
// Adds loggedin=1 param to each link if user is logged in.
|
|
136
|
+
function appendLoggedInParam(isLoggedIn) {
|
|
137
|
+
setLinks(function (state) {
|
|
138
|
+
return Object.keys(state).reduce(function (links, key) {
|
|
139
|
+
links[key] = getLoggedInLink(state[key], isLoggedIn);
|
|
140
|
+
return links;
|
|
141
|
+
}, {});
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// Load links from the CDN for the given environment.
|
|
145
|
+
function loadLinks(env) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
147
|
+
var response, data, _a;
|
|
148
|
+
return __generator(this, function (_b) {
|
|
149
|
+
switch (_b.label) {
|
|
150
|
+
case 0:
|
|
151
|
+
_b.trys.push([0, 3, , 4]);
|
|
152
|
+
return [4 /*yield*/, fetch(consts_1.cdnUrls[env] + "/common/data/links/base.json")];
|
|
153
|
+
case 1:
|
|
154
|
+
response = _b.sent();
|
|
155
|
+
if (!response.ok)
|
|
156
|
+
return [2 /*return*/];
|
|
157
|
+
return [4 /*yield*/, response.json()];
|
|
158
|
+
case 2:
|
|
159
|
+
data = _b.sent();
|
|
160
|
+
if ((0, utils_1.isObject)(data))
|
|
161
|
+
setLinks(data);
|
|
162
|
+
return [3 /*break*/, 4];
|
|
163
|
+
case 3:
|
|
164
|
+
_a = _b.sent();
|
|
165
|
+
console.error('Failed to retrieve links');
|
|
166
|
+
return [3 /*break*/, 4];
|
|
167
|
+
case 4: return [2 /*return*/];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
exports.useLoadLinks = useLoadLinks;
|
package/dialog/consts.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dialogStatusMapping = void 0;
|
|
4
|
+
/** Defines icon visuals for each Dialog status. */
|
|
5
|
+
exports.dialogStatusMapping = {
|
|
6
|
+
danger: {
|
|
7
|
+
iconProps: {
|
|
8
|
+
color: 'red.80',
|
|
9
|
+
name: 'falExclamationTriangle'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
error: {
|
|
13
|
+
iconProps: {
|
|
14
|
+
color: 'red.80',
|
|
15
|
+
name: 'falTimesCircle'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
info: {
|
|
19
|
+
iconProps: {
|
|
20
|
+
color: 'blue.80',
|
|
21
|
+
name: 'falInfoCircle'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
warning: {
|
|
25
|
+
iconProps: {
|
|
26
|
+
color: 'yellow.90',
|
|
27
|
+
name: 'falExclamationTriangle'
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.useDialogContext = exports.DialogProvider = void 0;
|
|
20
|
+
var utils_1 = require("../utils");
|
|
21
|
+
var _a = __read((0, utils_1.createContext)({ isOptional: true }), 2), DialogProvider = _a[0], useDialogContext = _a[1];
|
|
22
|
+
exports.DialogProvider = DialogProvider;
|
|
23
|
+
exports.useDialogContext = useDialogContext;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { VuiComponent } from '../core';
|
|
2
|
+
import { DialogProps } from './dialog.types';
|
|
3
|
+
import DialogBody from './dialogBody';
|
|
4
|
+
import DialogCancelButton from './dialogCancelButton';
|
|
5
|
+
import DialogCloseButton from './dialogCloseButton';
|
|
6
|
+
import DialogFooter from './dialogFooter';
|
|
7
|
+
import DialogHeader from './dialogHeader';
|
|
8
|
+
import DialogIcon from './dialogIcon';
|
|
9
|
+
import DialogSubmitButton from './dialogSubmitButton';
|
|
10
|
+
import DialogTitle from './dialogTitle';
|
|
11
|
+
export declare const DialogBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
12
|
+
/**
|
|
13
|
+
* Displays content in a Modal window. Includes required accessibility configuration.
|
|
14
|
+
* Used for alert messages, small forms or prompts.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Dialog: VuiComponent<"div", DialogProps> & {
|
|
17
|
+
Body: typeof DialogBody;
|
|
18
|
+
CancelButton: typeof DialogCancelButton;
|
|
19
|
+
CloseButton: typeof DialogCloseButton;
|
|
20
|
+
Footer: typeof DialogFooter;
|
|
21
|
+
Header: typeof DialogHeader;
|
|
22
|
+
Icon: typeof DialogIcon;
|
|
23
|
+
SubmitButton: typeof DialogSubmitButton;
|
|
24
|
+
Title: typeof DialogTitle;
|
|
25
|
+
};
|
|
26
|
+
export default Dialog;
|