@databiosphere/findable-ui 23.0.0 → 24.0.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/.release-please-manifest.json +1 -1
- package/.storybook/preview.js +4 -37
- package/CHANGELOG.md +25 -0
- package/jest.config.js +1 -0
- package/lib/components/Export/components/ExportForm/exportForm.styles.d.ts +2 -2
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/Button/button.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/Button/button.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
- package/lib/components/Loading/loading.stories.d.ts +3 -31
- package/lib/components/Login/components/Button/button.styles.d.ts +1 -1
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.js +7 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.styles.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepContent/stepContent.styles.js +17 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.js +8 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.d.ts +5 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.js +15 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.js +4 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/constants.d.ts +1 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/constants.js +1 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.js +27 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.d.ts +9 -0
- package/lib/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.js +38 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.js +11 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.js +9 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.js +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.d.ts +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.js +20 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.d.ts +7 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.js +1 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/constants.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.d.ts +5 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.js +7 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.d.ts +7 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.js +21 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.js +5 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/constants.js +8 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.d.ts +2 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.js +6 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.d.ts +3 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.js +12 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/contants.d.ts +4 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/contants.js +15 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.d.ts +8 -0
- package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.js +37 -0
- package/lib/components/Stepper/components/Step/constants.d.ts +2 -0
- package/lib/components/Stepper/components/Step/constants.js +4 -0
- package/lib/components/Stepper/components/Step/step.d.ts +3 -0
- package/lib/components/Stepper/components/Step/step.js +6 -0
- package/lib/components/Stepper/components/Step/step.styles.d.ts +5 -0
- package/lib/components/Stepper/components/Step/step.styles.js +31 -0
- package/lib/components/Stepper/components/Step/stories/contants.d.ts +4 -0
- package/lib/components/Stepper/components/Step/stories/contants.js +14 -0
- package/lib/components/Stepper/components/Step/stories/step.stories.d.ts +8 -0
- package/lib/components/Stepper/components/Step/stories/step.stories.js +62 -0
- package/lib/components/common/Form/components/Input/input.styles.d.ts +1 -1
- package/lib/components/common/Form/components/Select/select.js +2 -1
- package/lib/components/common/Form/components/Select/select.styles.d.ts +1 -1
- package/lib/components/common/Input/input.styles.d.ts +1 -1
- package/lib/components/common/KeyValuePairs/components/KeyElType/keyElType.d.ts +2 -5
- package/lib/components/common/KeyValuePairs/components/KeyElType/keyElType.js +6 -2
- package/lib/components/common/KeyValuePairs/components/ValueElType/valueElType.d.ts +2 -5
- package/lib/components/common/KeyValuePairs/components/ValueElType/valueElType.js +6 -2
- package/lib/storybook/controls/constants.d.ts +4 -0
- package/lib/storybook/controls/constants.js +6 -0
- package/lib/storybook/controls/types.d.ts +4 -0
- package/lib/storybook/controls/types.js +5 -0
- package/lib/storybook/controls/utils.d.ts +9 -0
- package/lib/storybook/controls/utils.js +10 -0
- package/lib/storybook/decorators.d.ts +2 -0
- package/lib/storybook/decorators.js +11 -0
- package/lib/storybook/loremIpsum.d.ts +4 -0
- package/lib/storybook/loremIpsum.js +4 -0
- package/lib/storybook/parameters.d.ts +2 -0
- package/lib/storybook/parameters.js +12 -0
- package/lib/styles/common/mui/stepper.d.ts +7 -0
- package/lib/styles/common/mui/stepper.js +7 -0
- package/lib/styles/common/mui/svgIcon.d.ts +9 -0
- package/lib/styles/common/mui/svgIcon.js +26 -0
- package/lib/styles/common/mui/typography.js +1 -0
- package/lib/tests/mui/constants.d.ts +4 -0
- package/lib/tests/mui/constants.js +4 -0
- package/lib/theme/common/components.js +0 -4
- package/lib/theme/common/typography.d.ts +5 -1
- package/lib/theme/common/typography.js +10 -1
- package/lib/theme/theme.js +1 -0
- package/lib/utils/tests.d.ts +12 -0
- package/lib/utils/tests.js +20 -0
- package/package.json +1 -1
- package/src/components/Loading/loading.stories.tsx +2 -2
- package/src/components/Stepper/components/Step/components/StepContent/stepContent.styles.ts +18 -0
- package/src/components/Stepper/components/Step/components/StepContent/stepContent.tsx +16 -0
- package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.ts +19 -0
- package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.tsx +20 -0
- package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.ts +6 -0
- package/src/components/Stepper/components/Step/components/StepIcon/constants.ts +1 -0
- package/src/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.ts +32 -0
- package/src/components/Stepper/components/Step/components/StepIcon/stepIcon.tsx +21 -0
- package/src/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.tsx +52 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.ts +14 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.tsx +13 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.ts +6 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.tsx +30 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.ts +8 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/constants.ts +8 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.ts +8 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/label.tsx +10 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.tsx +31 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.ts +7 -0
- package/src/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.tsx +9 -0
- package/src/components/Stepper/components/Step/components/StepLabel/constants.ts +10 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.ts +13 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stepLabel.tsx +10 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stories/contants.ts +19 -0
- package/src/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.tsx +48 -0
- package/src/components/Stepper/components/Step/constants.ts +6 -0
- package/src/components/Stepper/components/Step/step.styles.ts +33 -0
- package/src/components/Stepper/components/Step/step.tsx +12 -0
- package/src/components/Stepper/components/Step/stories/contants.ts +18 -0
- package/src/components/Stepper/components/Step/stories/step.stories.tsx +87 -0
- package/src/components/common/Form/components/Select/select.tsx +8 -1
- package/src/components/common/KeyValuePairs/components/KeyElType/keyElType.tsx +14 -9
- package/src/components/common/KeyValuePairs/components/ValueElType/valueElType.tsx +8 -9
- package/src/storybook/controls/constants.ts +12 -0
- package/src/storybook/controls/types.ts +4 -0
- package/src/storybook/controls/utils.ts +18 -0
- package/src/storybook/decorators.tsx +17 -0
- package/src/storybook/loremIpsum.ts +5 -0
- package/src/storybook/parameters.ts +14 -0
- package/src/styles/common/mui/stepper.ts +14 -0
- package/src/styles/common/mui/svgIcon.ts +35 -0
- package/src/styles/common/mui/typography.ts +1 -0
- package/src/tests/mui/constants.ts +4 -0
- package/src/theme/common/components.ts +0 -4
- package/src/theme/common/typography.ts +11 -0
- package/src/theme/theme.ts +1 -0
- package/src/utils/tests.ts +20 -0
- package/tests/setup.ts +6 -0
- package/tests/stepIcon.test.tsx +42 -0
- package/types/data-explorer-ui.d.ts +3 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { STEP_LABEL_PROPS } from "./constants";
|
|
3
|
+
import { StyledStepLabel } from "./stepLabel.styles";
|
|
4
|
+
export const StepLabel = ({ ...props /* MuiStepLabelProps */ }) => {
|
|
5
|
+
return React.createElement(StyledStepLabel, { ...STEP_LABEL_PROPS, ...props });
|
|
6
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { StepLabel } from "@mui/material";
|
|
3
|
+
export const StyledStepLabel = styled(StepLabel) `
|
|
4
|
+
.MuiStepLabel-iconContainer {
|
|
5
|
+
padding-right: 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.MuiStepLabel-labelContainer {
|
|
9
|
+
display: grid;
|
|
10
|
+
gap: 4px;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MUI_CONTROLS } from "../../../../../../../storybook/controls/constants";
|
|
2
|
+
export const DISABLED_CONTROLS = [
|
|
3
|
+
...MUI_CONTROLS,
|
|
4
|
+
"children",
|
|
5
|
+
"error",
|
|
6
|
+
"icon",
|
|
7
|
+
"optional",
|
|
8
|
+
"slotProps",
|
|
9
|
+
"slots",
|
|
10
|
+
];
|
|
11
|
+
export const EXCLUDED_CONTROLS = [
|
|
12
|
+
"componentsProps", // deprecated
|
|
13
|
+
"StepIconComponent", // deprecated
|
|
14
|
+
"StepIconProps", // deprecated
|
|
15
|
+
];
|
package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { StepLabel } from "../stepLabel";
|
|
3
|
+
declare const meta: Meta<typeof StepLabel>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Active: Story;
|
|
7
|
+
export declare const Completed: Story;
|
|
8
|
+
export declare const Default: Story;
|
package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { composeStories } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { CONTROL_TYPE } from "../../../../../../../storybook/controls/types";
|
|
4
|
+
import { configureControls } from "../../../../../../../storybook/controls/utils";
|
|
5
|
+
import * as stories from "../components/Label/stories/label.stories";
|
|
6
|
+
import { Optional } from "../components/Optional/optional";
|
|
7
|
+
import { StepLabel } from "../stepLabel";
|
|
8
|
+
import { DISABLED_CONTROLS, EXCLUDED_CONTROLS } from "./contants";
|
|
9
|
+
const { Default: Label, WithIcon: LabelWithIcon } = composeStories(stories);
|
|
10
|
+
const meta = {
|
|
11
|
+
argTypes: configureControls(DISABLED_CONTROLS, CONTROL_TYPE.DISABLED),
|
|
12
|
+
component: StepLabel,
|
|
13
|
+
parameters: { controls: { exclude: EXCLUDED_CONTROLS } },
|
|
14
|
+
title: "Components/Stepper/StepLabel",
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
export const Active = {
|
|
18
|
+
args: {
|
|
19
|
+
children: React.createElement(LabelWithIcon, null),
|
|
20
|
+
icon: 1,
|
|
21
|
+
slotProps: { stepIcon: { active: true } },
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export const Completed = {
|
|
25
|
+
args: {
|
|
26
|
+
children: React.createElement(LabelWithIcon, null),
|
|
27
|
+
icon: 1,
|
|
28
|
+
optional: React.createElement(Optional, null, "3 files selected"),
|
|
29
|
+
slotProps: { stepIcon: { completed: true } },
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export const Default = {
|
|
33
|
+
args: {
|
|
34
|
+
children: React.createElement(Label, null),
|
|
35
|
+
icon: 1,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { STEP_PROPS } from "./constants";
|
|
3
|
+
import { StyledStep } from "./step.styles";
|
|
4
|
+
export const Step = ({ className, ...props /* MuiStepProps */ }) => {
|
|
5
|
+
return React.createElement(StyledStep, { ...STEP_PROPS, className: className, ...props });
|
|
6
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const StyledStep: import("@emotion/styled").StyledComponent<import("@mui/material").StepOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
3
|
+
}, "style" | "className" | "classes" | "children" | "sx" | "disabled" | "expanded" | "active" | "last" | "completed" | "index"> & {
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { css } from "@emotion/react";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Step } from "@mui/material";
|
|
4
|
+
import { smokeLightest, white } from "../../../../styles/common/mixins/colors";
|
|
5
|
+
import { sectionPadding } from "../../../common/Section/section.styles";
|
|
6
|
+
export const StyledStep = styled(Step) `
|
|
7
|
+
&.MuiStep-root {
|
|
8
|
+
&.MuiStep-vertical {
|
|
9
|
+
background-color: ${smokeLightest};
|
|
10
|
+
|
|
11
|
+
.MuiStepLabel-root {
|
|
12
|
+
${sectionPadding};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.MuiStepContent-root {
|
|
16
|
+
border: none;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.Mui-completed {
|
|
22
|
+
background-color: ${white};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
${(props) => props.active &&
|
|
26
|
+
css `
|
|
27
|
+
background-color: ${white(props)};
|
|
28
|
+
`};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MUI_CONTROLS } from "../../../../../storybook/controls/constants";
|
|
2
|
+
export const BOOLEAN_CONTROLS = [
|
|
3
|
+
"active",
|
|
4
|
+
"completed",
|
|
5
|
+
"disabled",
|
|
6
|
+
"expanded",
|
|
7
|
+
"last",
|
|
8
|
+
];
|
|
9
|
+
export const DISABLED_CONTROLS = [
|
|
10
|
+
...MUI_CONTROLS,
|
|
11
|
+
"children",
|
|
12
|
+
"component",
|
|
13
|
+
"style",
|
|
14
|
+
];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Step } from "../step";
|
|
3
|
+
declare const meta: Meta<typeof Step>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Active: Story;
|
|
7
|
+
export declare const Completed: Story;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Stepper } from "@mui/material";
|
|
2
|
+
import { composeStories } from "@storybook/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { CONTROL_TYPE } from "../../../../../storybook/controls/types";
|
|
5
|
+
import { configureControls } from "../../../../../storybook/controls/utils";
|
|
6
|
+
import { LOREM_IPSUM } from "../../../../../storybook/loremIpsum";
|
|
7
|
+
import { STEPPER_PROPS } from "../../../../../styles/common/mui/stepper";
|
|
8
|
+
import { StepContent } from "../components/StepContent/stepContent";
|
|
9
|
+
import * as stories from "../components/StepLabel/stories/stepLabel.stories";
|
|
10
|
+
import { Step } from "../step";
|
|
11
|
+
import { BOOLEAN_CONTROLS, DISABLED_CONTROLS } from "./contants";
|
|
12
|
+
const { Active: ActiveStepLabel, Completed: CompletedStepLabel, Default: StepLabel, } = composeStories(stories);
|
|
13
|
+
const meta = {
|
|
14
|
+
argTypes: {
|
|
15
|
+
...configureControls(DISABLED_CONTROLS, CONTROL_TYPE.DISABLED),
|
|
16
|
+
...configureControls(BOOLEAN_CONTROLS, CONTROL_TYPE.BOOLEAN),
|
|
17
|
+
index: { control: { type: "number" } },
|
|
18
|
+
},
|
|
19
|
+
component: Step,
|
|
20
|
+
decorators: [
|
|
21
|
+
(Story, context) => (React.createElement(Stepper, { connector: null, orientation: STEPPER_PROPS.ORIENTATION.VERTICAL, sx: {
|
|
22
|
+
display: "grid",
|
|
23
|
+
gridTemplateColumns: "minmax(auto, 816px)",
|
|
24
|
+
height: "100vh",
|
|
25
|
+
placeContent: "center center",
|
|
26
|
+
} },
|
|
27
|
+
React.createElement(Story, { ...context }))),
|
|
28
|
+
],
|
|
29
|
+
parameters: { layout: "fullscreen" },
|
|
30
|
+
title: "Components/Stepper/Step",
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
export const Active = {
|
|
34
|
+
args: {
|
|
35
|
+
active: true,
|
|
36
|
+
children: [
|
|
37
|
+
React.createElement(ActiveStepLabel, { key: "label" }),
|
|
38
|
+
React.createElement(StepContent, { key: "step-content" }, LOREM_IPSUM.LONG),
|
|
39
|
+
],
|
|
40
|
+
completed: false,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
export const Completed = {
|
|
44
|
+
args: {
|
|
45
|
+
active: false,
|
|
46
|
+
children: [
|
|
47
|
+
React.createElement(CompletedStepLabel, { key: "label" }),
|
|
48
|
+
React.createElement(StepContent, { key: "step-content" }, LOREM_IPSUM.LONG),
|
|
49
|
+
],
|
|
50
|
+
completed: true,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
export const Default = {
|
|
54
|
+
args: {
|
|
55
|
+
active: false,
|
|
56
|
+
children: [
|
|
57
|
+
React.createElement(StepLabel, { key: "label" }),
|
|
58
|
+
React.createElement(StepContent, { key: "step-content" }, LOREM_IPSUM.LONG),
|
|
59
|
+
],
|
|
60
|
+
completed: false,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -3,7 +3,7 @@ interface Props {
|
|
|
3
3
|
}
|
|
4
4
|
export declare const InputFormControl: import("@emotion/styled").StyledComponent<import("@mui/material").FormControlOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
5
5
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
6
|
-
}, "style" | "className" | "classes" | "color" | "children" | "margin" | "sx" | "variant" | "error" | "disabled" | "required" | "size" | "
|
|
6
|
+
}, "style" | "className" | "classes" | "color" | "children" | "margin" | "sx" | "variant" | "error" | "disabled" | "required" | "size" | "focused" | "fullWidth" | "hiddenLabel"> & {
|
|
7
7
|
theme?: import("@emotion/react").Theme;
|
|
8
8
|
} & Props, {}, {}>;
|
|
9
9
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Select as MSelect, Typography, } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { TEXT_BODY_400 } from "../../../../../theme/common/typography";
|
|
4
|
+
import { DropDownIcon } from "./components/DropDownIcon/dropDownIcon";
|
|
4
5
|
import { InputFormControl } from "./select.styles";
|
|
5
6
|
export const Select = ({ children, className, isFilled, label, onBlur, ...props /* Spread props to allow for Mui SelectProps specific prop overrides e.g. "disabled". */ }) => {
|
|
6
7
|
return (React.createElement(InputFormControl, { className: className, isFilled: isFilled },
|
|
7
8
|
label && React.createElement(Typography, { variant: TEXT_BODY_400 }, label),
|
|
8
|
-
React.createElement(MSelect, { fullWidth: true, inputProps: { onBlur }, size: "small", ...props }, children)));
|
|
9
|
+
React.createElement(MSelect, { fullWidth: true, IconComponent: DropDownIcon, inputProps: { onBlur }, size: "small", ...props }, children)));
|
|
9
10
|
};
|
|
@@ -3,7 +3,7 @@ interface Props {
|
|
|
3
3
|
}
|
|
4
4
|
export declare const InputFormControl: import("@emotion/styled").StyledComponent<import("@mui/material").FormControlOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
5
5
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
6
|
-
}, "style" | "className" | "classes" | "color" | "children" | "margin" | "sx" | "variant" | "error" | "disabled" | "required" | "size" | "
|
|
6
|
+
}, "style" | "className" | "classes" | "color" | "children" | "margin" | "sx" | "variant" | "error" | "disabled" | "required" | "size" | "focused" | "fullWidth" | "hiddenLabel"> & {
|
|
7
7
|
theme?: import("@emotion/react").Theme;
|
|
8
8
|
} & Props, {}, {}>;
|
|
9
9
|
export {};
|
|
@@ -3,7 +3,7 @@ interface Props {
|
|
|
3
3
|
}
|
|
4
4
|
export declare const InputFormControl: import("@emotion/styled").StyledComponent<import("@mui/material").FormControlOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
5
5
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
6
|
-
}, "style" | "className" | "classes" | "color" | "children" | "margin" | "sx" | "variant" | "error" | "disabled" | "required" | "size" | "
|
|
6
|
+
}, "style" | "className" | "classes" | "color" | "children" | "margin" | "sx" | "variant" | "error" | "disabled" | "required" | "size" | "focused" | "fullWidth" | "hiddenLabel"> & {
|
|
7
7
|
theme?: import("@emotion/react").Theme;
|
|
8
8
|
}, {}, {}>;
|
|
9
9
|
export declare const InputField: import("@emotion/styled").StyledComponent<import("@mui/material").OutlinedInputProps & {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypographyProps } from "@mui/material";
|
|
2
2
|
/**
|
|
3
3
|
* Basic KeyValuePairs "key" wrapper component.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export declare const KeyElType: ({ children, ...props }: KeyElTypeProps) => JSX.Element;
|
|
5
|
+
export declare const KeyElType: ({ children, color, component, variant, ...props }: TypographyProps) => JSX.Element;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Typography } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { TYPOGRAPHY_PROPS } from "../../../../../styles/common/mui/typography";
|
|
4
|
+
/**
|
|
5
|
+
* Basic KeyValuePairs "key" wrapper component.
|
|
6
|
+
*/
|
|
7
|
+
export const KeyElType = ({ children, color = TYPOGRAPHY_PROPS.COLOR.INK_LIGHT, component = "div", variant = TYPOGRAPHY_PROPS.VARIANT.TEXT_BODY_400_2_LINES, ...props /* MuiTypographyProps */ }) => {
|
|
8
|
+
return (React.createElement(Typography, { color: color, component: component, variant: variant, ...props }, children));
|
|
5
9
|
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypographyProps } from "@mui/material";
|
|
2
2
|
/**
|
|
3
3
|
* Basic KeyValuePairs "value" wrapper component.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export declare const ValueElType: ({ children, ...props }: ValueElTypeProps) => JSX.Element;
|
|
5
|
+
export declare const ValueElType: ({ children, component, variant, ...props }: TypographyProps) => JSX.Element;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Typography } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { TYPOGRAPHY_PROPS } from "../../../../../styles/common/mui/typography";
|
|
4
|
+
/**
|
|
5
|
+
* Basic KeyValuePairs "value" wrapper component.
|
|
6
|
+
*/
|
|
7
|
+
export const ValueElType = ({ children, component = "div", variant = TYPOGRAPHY_PROPS.VARIANT.TEXT_BODY_400_2_LINES, ...props /* MuiTypographyProps */ }) => {
|
|
8
|
+
return (React.createElement(Typography, { component: component, variant: variant, ...props }, children));
|
|
5
9
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Args, ArgTypes } from "@storybook/react";
|
|
2
|
+
import { CONTROL_TYPE } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Configures controls for specified keys with the given control type.
|
|
5
|
+
* @param keys - ArgType keys.
|
|
6
|
+
* @param controlType - The type of control to apply (from CONTROL_TYPE enum).
|
|
7
|
+
* @returns An object of ArgTypes with the specified control configuration.
|
|
8
|
+
*/
|
|
9
|
+
export declare function configureControls<TArg = Args>(keys: (keyof TArg)[], controlType: CONTROL_TYPE): Partial<ArgTypes<TArg>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CONTROL_CONFIG_MAP } from "./constants";
|
|
2
|
+
/**
|
|
3
|
+
* Configures controls for specified keys with the given control type.
|
|
4
|
+
* @param keys - ArgType keys.
|
|
5
|
+
* @param controlType - The type of control to apply (from CONTROL_TYPE enum).
|
|
6
|
+
* @returns An object of ArgTypes with the specified control configuration.
|
|
7
|
+
*/
|
|
8
|
+
export function configureControls(keys, controlType) {
|
|
9
|
+
return Object.fromEntries(keys.map((key) => [key, { control: CONTROL_CONFIG_MAP[controlType] }]));
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
2
|
+
import { CssBaseline, ThemeProvider } from "@mui/material";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { createAppTheme } from "../theme/theme";
|
|
5
|
+
export const decorators = (Story, context) => {
|
|
6
|
+
const theme = createAppTheme();
|
|
7
|
+
return (React.createElement(EmotionThemeProvider, { theme: theme },
|
|
8
|
+
React.createElement(ThemeProvider, { theme: theme },
|
|
9
|
+
React.createElement(CssBaseline, null),
|
|
10
|
+
React.createElement(Story, { ...context }))));
|
|
11
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const LOREM_IPSUM = {
|
|
2
|
+
LONG: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.",
|
|
3
|
+
SHORT: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.",
|
|
4
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SvgIconProps } from "@mui/material";
|
|
2
|
+
type SvgIconPropsOptions = {
|
|
3
|
+
COLOR: typeof COLOR;
|
|
4
|
+
FONT_SIZE: typeof FONT_SIZE;
|
|
5
|
+
};
|
|
6
|
+
declare const COLOR: Record<string, SvgIconProps["color"]>;
|
|
7
|
+
declare const FONT_SIZE: Record<string, SvgIconProps["fontSize"]>;
|
|
8
|
+
export declare const SVG_ICON_PROPS: SvgIconPropsOptions;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const COLOR = {
|
|
2
|
+
ACTION: "action",
|
|
3
|
+
DISABLED: "disabled",
|
|
4
|
+
ERROR: "error",
|
|
5
|
+
INFO: "info",
|
|
6
|
+
INHERIT: "inherit",
|
|
7
|
+
INK_LIGHT: "inkLight",
|
|
8
|
+
INK_MAIN: "inkMain",
|
|
9
|
+
PRIMARY: "primary",
|
|
10
|
+
SECONDARY: "secondary",
|
|
11
|
+
SUCCESS: "success",
|
|
12
|
+
WARNING: "warning",
|
|
13
|
+
};
|
|
14
|
+
const FONT_SIZE = {
|
|
15
|
+
INHERIT: "inherit",
|
|
16
|
+
LARGE: "large",
|
|
17
|
+
MEDIUM: "medium",
|
|
18
|
+
SMALL: "small",
|
|
19
|
+
XSMALL: "xsmall",
|
|
20
|
+
XXLARGE: "xxlarge",
|
|
21
|
+
XXSMALL: "xxsmall",
|
|
22
|
+
};
|
|
23
|
+
export const SVG_ICON_PROPS = {
|
|
24
|
+
COLOR,
|
|
25
|
+
FONT_SIZE,
|
|
26
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DropDownIcon } from "../../components/common/Form/components/Select/components/DropDownIcon/dropDownIcon";
|
|
2
1
|
import { CHIP_PROPS } from "../../styles/common/mui/chip";
|
|
3
2
|
import { desktopUp, mobileUp, tabletUp } from "./breakpoints";
|
|
4
3
|
import { alpha32, alpha60, alpha64, alpha80, black04, black08, white, } from "./palette";
|
|
@@ -1114,9 +1113,6 @@ export const MuiRadio = (theme) => {
|
|
|
1114
1113
|
* MuiSelect Component
|
|
1115
1114
|
*/
|
|
1116
1115
|
export const MuiSelect = {
|
|
1117
|
-
defaultProps: {
|
|
1118
|
-
IconComponent: DropDownIcon,
|
|
1119
|
-
},
|
|
1120
1116
|
styleOverrides: {
|
|
1121
1117
|
select: {
|
|
1122
1118
|
minHeight: "unset",
|
|
@@ -3,7 +3,7 @@ import { CSSProperties } from "@mui/material/styles/createTypography";
|
|
|
3
3
|
* Typography constants.
|
|
4
4
|
*/
|
|
5
5
|
export declare const fontFamily = "Inter";
|
|
6
|
-
export declare const TEXT_BODY_400: "text-body-400", TEXT_BODY_400_2_LINES: "text-body-400-2lines", TEXT_BODY_500: "text-body-500", TEXT_BODY_500_2_LINES: "text-body-500-2lines", TEXT_BODY_LARGE_400: "text-body-large-400", TEXT_BODY_LARGE_400_2_LINES: "text-body-large-400-2lines", TEXT_BODY_LARGE_500: "text-body-large-500", TEXT_BODY_SMALL_400: "text-body-small-400", TEXT_BODY_SMALL_400_2_LINES: "text-body-small-400-2lines", TEXT_BODY_SMALL_500: "text-body-small-500", TEXT_HEADING: "text-heading", TEXT_HEADING_LARGE: "text-heading-large", TEXT_HEADING_SMALL: "text-heading-small", TEXT_HEADING_XLARGE: "text-heading-xlarge", TEXT_UPPERCASE_500: "text-uppercase-500";
|
|
6
|
+
export declare const TEXT_BODY_400: "text-body-400", TEXT_BODY_400_2_LINES: "text-body-400-2lines", TEXT_BODY_500: "text-body-500", TEXT_BODY_500_2_LINES: "text-body-500-2lines", TEXT_BODY_LARGE_400: "text-body-large-400", TEXT_BODY_LARGE_400_2_LINES: "text-body-large-400-2lines", TEXT_BODY_LARGE_500: "text-body-large-500", TEXT_BODY_SMALL_400: "text-body-small-400", TEXT_BODY_SMALL_400_2_LINES: "text-body-small-400-2lines", TEXT_BODY_SMALL_500: "text-body-small-500", TEXT_HEADING: "text-heading", TEXT_HEADING_LARGE: "text-heading-large", TEXT_HEADING_SMALL: "text-heading-small", TEXT_HEADING_XLARGE: "text-heading-xlarge", TEXT_HEADING_XSMALL: "text-heading-xsmall", TEXT_UPPERCASE_500: "text-uppercase-500";
|
|
7
7
|
/**
|
|
8
8
|
* Typography Option "text-body-400"
|
|
9
9
|
*/
|
|
@@ -60,6 +60,10 @@ export declare const textHeadingSmall: CSSProperties;
|
|
|
60
60
|
* Typography Option "text-heading-xlarge"
|
|
61
61
|
*/
|
|
62
62
|
export declare const textHeadingXLarge: CSSProperties;
|
|
63
|
+
/**
|
|
64
|
+
* Typography Option "text-heading-xsmall"
|
|
65
|
+
*/
|
|
66
|
+
export declare const textHeadingXSmall: CSSProperties;
|
|
63
67
|
/**
|
|
64
68
|
* Typography Option "text-uppercase-500"
|
|
65
69
|
*/
|
|
@@ -18,9 +18,10 @@ const TYPOGRAPHY = {
|
|
|
18
18
|
TEXT_HEADING_LARGE: "text-heading-large",
|
|
19
19
|
TEXT_HEADING_SMALL: "text-heading-small",
|
|
20
20
|
TEXT_HEADING_XLARGE: "text-heading-xlarge",
|
|
21
|
+
TEXT_HEADING_XSMALL: "text-heading-xsmall",
|
|
21
22
|
TEXT_UPPERCASE_500: "text-uppercase-500",
|
|
22
23
|
};
|
|
23
|
-
export const { TEXT_BODY_400, TEXT_BODY_400_2_LINES, TEXT_BODY_500, TEXT_BODY_500_2_LINES, TEXT_BODY_LARGE_400, TEXT_BODY_LARGE_400_2_LINES, TEXT_BODY_LARGE_500, TEXT_BODY_SMALL_400, TEXT_BODY_SMALL_400_2_LINES, TEXT_BODY_SMALL_500, TEXT_HEADING, TEXT_HEADING_LARGE, TEXT_HEADING_SMALL, TEXT_HEADING_XLARGE, TEXT_UPPERCASE_500, } = TYPOGRAPHY;
|
|
24
|
+
export const { TEXT_BODY_400, TEXT_BODY_400_2_LINES, TEXT_BODY_500, TEXT_BODY_500_2_LINES, TEXT_BODY_LARGE_400, TEXT_BODY_LARGE_400_2_LINES, TEXT_BODY_LARGE_500, TEXT_BODY_SMALL_400, TEXT_BODY_SMALL_400_2_LINES, TEXT_BODY_SMALL_500, TEXT_HEADING, TEXT_HEADING_LARGE, TEXT_HEADING_SMALL, TEXT_HEADING_XLARGE, TEXT_HEADING_XSMALL, TEXT_UPPERCASE_500, } = TYPOGRAPHY;
|
|
24
25
|
/**
|
|
25
26
|
* Typography Option "text-body-400"
|
|
26
27
|
*/
|
|
@@ -156,6 +157,14 @@ export const textHeadingXLarge = {
|
|
|
156
157
|
lineHeight: "56px",
|
|
157
158
|
},
|
|
158
159
|
};
|
|
160
|
+
/**
|
|
161
|
+
* Typography Option "text-heading-xsmall"
|
|
162
|
+
*/
|
|
163
|
+
export const textHeadingXSmall = {
|
|
164
|
+
fontSize: 16,
|
|
165
|
+
fontWeight: 500,
|
|
166
|
+
lineHeight: "24px",
|
|
167
|
+
};
|
|
159
168
|
/**
|
|
160
169
|
* Typography Option "text-uppercase-500"
|
|
161
170
|
*/
|
package/lib/theme/theme.js
CHANGED
|
@@ -49,6 +49,7 @@ export function createAppTheme(customOptions) {
|
|
|
49
49
|
[T.TEXT_HEADING_LARGE]: T.textHeadingLarge,
|
|
50
50
|
[T.TEXT_HEADING_SMALL]: T.textHeadingSmall,
|
|
51
51
|
[T.TEXT_HEADING_XLARGE]: T.textHeadingXLarge,
|
|
52
|
+
[T.TEXT_HEADING_XSMALL]: T.textHeadingXSmall,
|
|
52
53
|
[T.TEXT_UPPERCASE_500]: T.textUppercase500,
|
|
53
54
|
fontFamily: T.fontFamily,
|
|
54
55
|
},
|