@mcf/lib-ui 2.0.169 → 2.0.179
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/README.md +1 -0
- package/dist/@types/Component/Button/Button.d.ts +5 -5
- package/dist/@types/Component/Button/ButtonConstants.d.ts +5 -5
- package/dist/@types/Component/CheckboxGroup/CheckboxGroup.d.ts +15 -0
- package/dist/@types/Component/CheckboxNew/CheckboxNew.d.ts +16 -0
- package/dist/@types/Component/InfoBox/InfoBox.d.ts +9 -0
- package/dist/@types/Component/MessageBar/MessageBar.d.ts +12 -0
- package/dist/@types/Component/MessageBar/index.d.ts +1 -0
- package/dist/@types/Component/TextInputNew/TextInputNew.d.ts +12 -0
- package/dist/main.css +7 -1
- package/jest.config.js +0 -5
- package/package.json +5 -4
- package/tsconfig.json +1 -1
- package/dist/@types/stories/Button.stories.d.ts +0 -12
- package/dist/@types/stories/Typography.stories.d.ts +0 -38
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@ User Interface (UI) components for use in the MCF project.
|
|
|
3
3
|
|
|
4
4
|
> **WIP**: we're working on open-sourcing this!
|
|
5
5
|
|
|
6
|
+
View the Storybook here: <https://wog.sgts.gitlab-dedicated.site/wsg/mycareersfuture/wsg-mycareersfuture/lib-ui/>
|
|
6
7
|
## Usage
|
|
7
8
|
Install this package through NPM:
|
|
8
9
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { FC, ButtonHTMLAttributes, DetailedHTMLProps } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ButtonCategory, ButtonColor, ButtonIconPosition, ButtonSize } from './ButtonConstants';
|
|
3
3
|
import { IconProps } from '../Icon/Icon';
|
|
4
4
|
interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
5
|
-
category?:
|
|
6
|
-
color:
|
|
7
|
-
size?:
|
|
5
|
+
category?: ButtonCategory;
|
|
6
|
+
color: ButtonColor;
|
|
7
|
+
size?: ButtonSize;
|
|
8
8
|
rounded?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
onClick?: () => void;
|
|
11
|
-
iconPosition?:
|
|
11
|
+
iconPosition?: ButtonIconPosition;
|
|
12
12
|
iconProps?: IconProps;
|
|
13
13
|
}
|
|
14
14
|
declare const Button: FC<ButtonProps>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export declare enum
|
|
1
|
+
export declare enum ButtonColor {
|
|
2
2
|
Primary = "Primary",
|
|
3
|
-
Generic = "
|
|
3
|
+
Generic = "Generic",
|
|
4
4
|
Danger = "Danger"
|
|
5
5
|
}
|
|
6
|
-
export declare enum
|
|
6
|
+
export declare enum ButtonCategory {
|
|
7
7
|
Solid = "Solid",
|
|
8
8
|
Outline = "Outline",
|
|
9
9
|
Transparent = "Transparent",
|
|
10
10
|
Text = "Text"
|
|
11
11
|
}
|
|
12
|
-
export declare enum
|
|
12
|
+
export declare enum ButtonSize {
|
|
13
13
|
Small = "Small",
|
|
14
14
|
Large = "Large"
|
|
15
15
|
}
|
|
16
|
-
export declare enum
|
|
16
|
+
export declare enum ButtonIconPosition {
|
|
17
17
|
Left = "Left",
|
|
18
18
|
Right = "Right"
|
|
19
19
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ICheckboxProps } from '../CheckboxNew/CheckboxNew';
|
|
3
|
+
export declare enum Orientation {
|
|
4
|
+
Horizontal = "Horizontal",
|
|
5
|
+
Vertical = "Vertical"
|
|
6
|
+
}
|
|
7
|
+
interface ICheckboxGroupProps {
|
|
8
|
+
orientation?: Orientation;
|
|
9
|
+
primaryLabel?: string;
|
|
10
|
+
secondaryLabel?: string;
|
|
11
|
+
checkboxInformation: ICheckboxProps[];
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const CheckboxGroup: ({ orientation, primaryLabel, secondaryLabel, checkboxInformation, error, }: ICheckboxGroupProps) => JSX.Element;
|
|
15
|
+
export default CheckboxGroup;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { InputHTMLAttributes } from 'react';
|
|
2
|
+
export declare enum CheckboxState {
|
|
3
|
+
Selected = "Selected",
|
|
4
|
+
Unselected = "Unselected",
|
|
5
|
+
Indeterminate = "Indeterminate"
|
|
6
|
+
}
|
|
7
|
+
export interface ICheckboxProps extends React.DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
8
|
+
header?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
descriptionLink?: string;
|
|
12
|
+
state?: CheckboxState;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const Checkbox: (props: ICheckboxProps) => JSX.Element;
|
|
16
|
+
export default Checkbox;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { HTMLProps, CSSProperties } from 'react';
|
|
2
|
+
interface IMessageBarProps extends HTMLProps<HTMLDivElement> {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
textColor: string;
|
|
5
|
+
children?: JSX.Element;
|
|
6
|
+
showCloseIcon?: boolean;
|
|
7
|
+
closeIconColor?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
handleClose?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const MessageBar: React.FC<IMessageBarProps>;
|
|
12
|
+
export default MessageBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MessageBar';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { InputHTMLAttributes } from 'react';
|
|
2
|
+
interface ITextInputNewProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
primaryLabel?: string;
|
|
4
|
+
secondaryLabel?: string;
|
|
5
|
+
additionalInfo?: string;
|
|
6
|
+
errorMessage?: string;
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
clearable?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const TextInputNew: React.FC<ITextInputNewProps>;
|
|
12
|
+
export default TextInputNew;
|
package/dist/main.css
CHANGED
|
@@ -10,15 +10,21 @@
|
|
|
10
10
|
--active-generic: #00449E;
|
|
11
11
|
--gray: gray;
|
|
12
12
|
--white: white;
|
|
13
|
+
--lighter-primary: #EFEAF6; /* lightness(90%)) */
|
|
14
|
+
--light-primary: #E3D7F4;
|
|
15
|
+
--dark-primary: #552895; /* shade(10%) */
|
|
16
|
+
--generic: #1263CB;
|
|
13
17
|
--secondary: #D6008F;
|
|
14
18
|
--dark-secondary: #C10081; /* shade(10%) */
|
|
15
|
-
--danger
|
|
19
|
+
--danger: #CE030D;
|
|
16
20
|
--bright-danger: #EB142A;
|
|
17
21
|
--dark-danger: #B0030B;
|
|
18
22
|
--light-danger: #FFDFDF;
|
|
19
23
|
--light-danger: var(--red-washed-red, #FFDFDF);
|
|
20
24
|
--lighter-danger: #FFEFEF;
|
|
21
25
|
--green: #118159;
|
|
26
|
+
--gray-50: #F2F2F2;
|
|
27
|
+
--washed-yellow: #fffceb;
|
|
22
28
|
}:root {
|
|
23
29
|
--borderstyle: 1px solid var(--black-20);
|
|
24
30
|
--borderstyle: 1px solid var(--black-20)
|
package/jest.config.js
CHANGED
|
@@ -55,11 +55,6 @@ module.exports = {
|
|
|
55
55
|
// globalTeardown: null,
|
|
56
56
|
|
|
57
57
|
// A set of global variables that need to be available in all test environments
|
|
58
|
-
globals: {
|
|
59
|
-
'ts-jest': {
|
|
60
|
-
tsConfigFile: 'tsconfig.jest.json',
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
58
|
|
|
64
59
|
// An array of directory names to be searched recursively up from the requiring module's location
|
|
65
60
|
// moduleDirectories: [
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcf/lib-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.179",
|
|
4
4
|
"description": "User Interface (UI) components for use in the MCF project.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/@types/Component/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build-bundle": "cross-env NODE_ENV=production webpack --mode production",
|
|
9
9
|
"build-css": "cross-env NODE_ENV=production postcss src/style/main.scss --dir dist/ --ext css",
|
|
10
|
+
"build-storybook-pages": "storybook build -o ./public",
|
|
10
11
|
"build-storybook": "storybook build -o ./static",
|
|
11
12
|
"build-types": "tsc --module es6 --declaration --emitDeclarationOnly --outDir dist/@types",
|
|
12
13
|
"build-watch": "yarn build-bundle --watch & yarn build-types --watch",
|
|
13
14
|
"build": "yarn clean && yarn build-bundle && yarn build-types && yarn build-css",
|
|
14
|
-
"coverage": "jest --coverage",
|
|
15
|
+
"coverage": "jest --coverage --runInBand",
|
|
15
16
|
"clean": "rm -rf dist",
|
|
16
17
|
"deploy": "node serve-static.js",
|
|
17
18
|
"eslint": "eslint .",
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
"css-loader": "0.28.11",
|
|
75
76
|
"cssnano": "4.1.11",
|
|
76
77
|
"enzyme": "3.11.0",
|
|
77
|
-
"enzyme-adapter-react-16": "1.15.
|
|
78
|
+
"enzyme-adapter-react-16": "1.15.8",
|
|
78
79
|
"enzyme-to-json": "3.6.2",
|
|
79
80
|
"eslint": "^8.53.0",
|
|
80
81
|
"eslint-config-google": "0.9.1",
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
"eslint-plugin-prettier": "^5.0.1",
|
|
90
91
|
"eslint-plugin-react": "^7.33.2",
|
|
91
92
|
"eslint-plugin-storybook": "^0.6.15",
|
|
92
|
-
"express": "4.18.
|
|
93
|
+
"express": "4.18.3",
|
|
93
94
|
"identity-obj-proxy": "3.0.0",
|
|
94
95
|
"jest": "^29.7.0",
|
|
95
96
|
"jest-environment-jsdom": "^29.7.0",
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
-
import Button from '../Component/Button/Button';
|
|
3
|
-
declare const meta: Meta<typeof Button>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Button>;
|
|
6
|
-
export declare const PrimaryButton: Story;
|
|
7
|
-
export declare const GenericButton: Story;
|
|
8
|
-
export declare const DangerButton: Story;
|
|
9
|
-
export declare const OutlinedButton: Story;
|
|
10
|
-
export declare const TransparentButton: Story;
|
|
11
|
-
export declare const TextButton: Story;
|
|
12
|
-
export declare const IconButton: Story;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
-
import Typography from '../Component/Typography/Typography';
|
|
3
|
-
declare const meta: Meta<typeof Typography>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Typography>;
|
|
6
|
-
export declare const Display01: Story;
|
|
7
|
-
export declare const Display02: Story;
|
|
8
|
-
export declare const Display03: Story;
|
|
9
|
-
export declare const Display03SB: Story;
|
|
10
|
-
export declare const Display04: Story;
|
|
11
|
-
export declare const Display05: Story;
|
|
12
|
-
export declare const Body01: Story;
|
|
13
|
-
export declare const Body01Italic: Story;
|
|
14
|
-
export declare const Body01Underline: Story;
|
|
15
|
-
export declare const Body02: Story;
|
|
16
|
-
export declare const Body02Italic: Story;
|
|
17
|
-
export declare const Body02Underline: Story;
|
|
18
|
-
export declare const Body03: Story;
|
|
19
|
-
export declare const Body03Tight: Story;
|
|
20
|
-
export declare const Body03Italic: Story;
|
|
21
|
-
export declare const Body03Underline: Story;
|
|
22
|
-
export declare const Body04: Story;
|
|
23
|
-
export declare const Body04Italic: Story;
|
|
24
|
-
export declare const Heading01: Story;
|
|
25
|
-
export declare const Heading02: Story;
|
|
26
|
-
export declare const Heading02Tight: Story;
|
|
27
|
-
export declare const Heading03: Story;
|
|
28
|
-
export declare const Heading04: Story;
|
|
29
|
-
export declare const Heading05: Story;
|
|
30
|
-
export declare const Heading06: Story;
|
|
31
|
-
export declare const Heading07: Story;
|
|
32
|
-
export declare const Heading08: Story;
|
|
33
|
-
export declare const Field01: Story;
|
|
34
|
-
export declare const Button01: Story;
|
|
35
|
-
export declare const Button02: Story;
|
|
36
|
-
export declare const Button03: Story;
|
|
37
|
-
export declare const Pill01: Story;
|
|
38
|
-
export declare const Pill02: Story;
|