@typeolymp/ui-components 1.17.8 → 1.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/build/components/organisms/Chart/Accuracy/data.d.ts +5 -0
- package/build/components/organisms/Chart/Accuracy/index.d.ts +4 -0
- package/build/components/organisms/Chart/ExerciseResults/data.d.ts +6 -0
- package/build/components/organisms/Chart/ExerciseResults/index.d.ts +11 -0
- package/build/components/organisms/Chart/Hits/index.d.ts +4 -0
- package/build/components/organisms/Chart/Keystrokes/data.d.ts +6 -0
- package/build/components/organisms/Chart/Keystrokes/index.d.ts +11 -0
- package/build/components/organisms/Chart/KeystrokesPerMinute/data.d.ts +5 -0
- package/build/components/organisms/Chart/KeystrokesPerMinute/index.d.ts +10 -0
- package/build/components/organisms/Chart/Progress/index.d.ts +6 -0
- package/build/components/organisms/Chart/ProgressPercentage/data.d.ts +5 -0
- package/build/components/organisms/Chart/ProgressPercentage/index.d.ts +10 -0
- package/build/components/organisms/Chart/Results/index.d.ts +4 -0
- package/build/components/organisms/Chart/Speed/index.d.ts +4 -0
- package/build/components/organisms/Chart/Time/index.d.ts +4 -0
- package/build/components/organisms/Chart/TimePractised/data.d.ts +5 -0
- package/build/components/organisms/Chart/TimePractised/index.d.ts +10 -0
- package/build/components/organisms/Chart/Tooltip/index.d.ts +12 -0
- package/build/components/organisms/Chart/Tooltip/styles.d.ts +3 -0
- package/build/components/organisms/Chart/data.d.ts +30 -0
- package/build/components/organisms/Chart/index.d.ts +16 -0
- package/build/components/organisms/Chart/stories.d.ts +12 -0
- package/build/components/organisms/Chart/utils/enums.d.ts +7 -0
- package/build/components/organisms/Chart/utils/helpers.d.ts +13 -0
- package/build/components/organisms/Chart/utils/index.d.ts +56 -0
- package/build/components/organisms/Chart/utils/types.d.ts +20 -0
- package/build/index.d.ts +2 -1
- package/build/index.es.js +39008 -5857
- package/build/index.es.js.map +1 -1
- package/build/index.js +39008 -5856
- package/build/index.js.map +1 -1
- package/build/utils/types/TranslationType.d.ts +23 -5
- package/package.json +3 -3
- package/build/components/atoms/Input/translations.d.ts +0 -11
- package/build/components/molecules/Key/translations.d.ts +0 -5
- package/build/components/molecules/PasswordInputField/translations.d.ts +0 -11
- package/build/components/molecules/Tabs/styles.d.ts +0 -2
- package/build/lib/enums.d.ts +0 -4
- package/build/lib/helpers.d.ts +0 -1
- package/build/lib/theme/index.d.ts +0 -3
- package/build/lib/theme/types.d.ts +0 -72
- package/build/lib/translations/index.d.ts +0 -6
- package/build/lib/types/TranslationType.d.ts +0 -7
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 💅🏼 ui-components
|
|
2
|
+
The `ui-components` repository is a collection of [React](https://react.dev/) components, crafted with [Typescript](https://www.typescriptlang.org/) and [Styled Components](https://styled-components.com/). The components are organized according to the [Atomic Design system](https://bradfrost.com/blog/post/atomic-web-design/) and provides a versatile set of building blocks to create beautiful and consistent user interfaces.
|
|
3
|
+
|
|
4
|
+
## 📖 Table of Contents
|
|
5
|
+
- [Development](https://github.com/TypeOlymp/ui-components/tree/main#-development)
|
|
6
|
+
- [Contributing](https://github.com/TypeOlymp/ui-components/tree/main#-contributing)
|
|
7
|
+
|
|
8
|
+
## 👨🏻💻 Development
|
|
9
|
+
To get started with this project, follow these step:
|
|
10
|
+
1. **Clone the repository:** Clone the [repository](https://github.com/TypeOlymp/ui-components) to your local machine.
|
|
11
|
+
3. **Install dependencies:** Install the dependencies using `yarn install`
|
|
12
|
+
4. **Run Storybook:** Run storybook with `yarn storybook`
|
|
13
|
+
|
|
14
|
+
Open [http://localhost:6006](http://localhost:6006) with your browser to see the result.
|
|
15
|
+
|
|
16
|
+
## 👫 Contributing
|
|
17
|
+
To contribute to the `ui-components` package, follow these step:
|
|
18
|
+
1. **Clone the Repository:** Clone the [repository](https://github.com/TypeOlymp/ui-components) to your local machine.
|
|
19
|
+
3. **Create a Branch:** Create a new branch for your changes using a descriptive name: `git checkout -b feature/my-new-feature`.
|
|
20
|
+
4. **Make Changes:** Make your desired changes and improvements to the codebase.
|
|
21
|
+
5. **Commit Changes:** Commit your changes with a clear and concise commit message: `git commit -m "Add a new feature"`.
|
|
22
|
+
6. **Push Changes:** Push your changes to your development branch: `git push origin feature/my-new-feature`.
|
|
23
|
+
7. **Update the CHANGELOG:** Update the `CHANGELOG.md` file with the new changes.
|
|
24
|
+
8. **Open a Pull Request:** Visit the [repository](https://github.com/TypeOlymp/ui-components) and open a Pull Request. Describe your changes, and submit the pull request.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { BasePropsType } from "../";
|
|
3
|
+
export declare type PropsType = BasePropsType & {
|
|
4
|
+
data?: Array<{
|
|
5
|
+
xAxis: string;
|
|
6
|
+
failed: number;
|
|
7
|
+
passed: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
declare const ExerciseResultsChart: FC<PropsType>;
|
|
11
|
+
export default ExerciseResultsChart;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { BasePropsType } from "../";
|
|
3
|
+
export declare type PropsType = BasePropsType & {
|
|
4
|
+
data?: Array<{
|
|
5
|
+
xAxis: string;
|
|
6
|
+
correct: number;
|
|
7
|
+
wrong: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
declare const KeystrokesChart: FC<PropsType>;
|
|
11
|
+
export default KeystrokesChart;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { BasePropsType } from "../";
|
|
3
|
+
export declare type PropsType = BasePropsType & {
|
|
4
|
+
data?: Array<{
|
|
5
|
+
xAxis: string;
|
|
6
|
+
kpm: number;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
declare const KeystrokesPerMinuteChart: FC<PropsType>;
|
|
10
|
+
export default KeystrokesPerMinuteChart;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { BasePropsType } from "../";
|
|
3
|
+
export declare type PropsType = BasePropsType & {
|
|
4
|
+
data?: Array<{
|
|
5
|
+
xAxis: string;
|
|
6
|
+
progress: number;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
declare const ProgressPercentageChart: FC<PropsType>;
|
|
10
|
+
export default ProgressPercentageChart;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { BasePropsType } from "../";
|
|
3
|
+
export declare type PropsType = BasePropsType & {
|
|
4
|
+
data?: Array<{
|
|
5
|
+
xAxis: string;
|
|
6
|
+
timePractised: number;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
declare const TimePractisedChart: FC<PropsType>;
|
|
10
|
+
export default TimePractisedChart;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { TooltipProps } from "recharts";
|
|
3
|
+
import { NameType, ValueType } from "recharts/types/component/DefaultTooltipContent";
|
|
4
|
+
import { Locale } from "@typeolymp/utils/enums";
|
|
5
|
+
import { Period } from "../utils";
|
|
6
|
+
export declare type PropsType = TooltipProps<ValueType, NameType> & {
|
|
7
|
+
locale: Locale;
|
|
8
|
+
period: Period;
|
|
9
|
+
valueFormatter?: (value: number) => string;
|
|
10
|
+
};
|
|
11
|
+
declare const Tooltip: FC<PropsType>;
|
|
12
|
+
export default Tooltip;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const _default: ({
|
|
2
|
+
_id: string;
|
|
3
|
+
student: string;
|
|
4
|
+
exercise: string;
|
|
5
|
+
passed: boolean;
|
|
6
|
+
medal: string;
|
|
7
|
+
accuracy: number;
|
|
8
|
+
kpm: number;
|
|
9
|
+
hits: {
|
|
10
|
+
correct: number;
|
|
11
|
+
wrong: number;
|
|
12
|
+
};
|
|
13
|
+
seconds: number;
|
|
14
|
+
date: string;
|
|
15
|
+
} | {
|
|
16
|
+
_id: string;
|
|
17
|
+
student: string;
|
|
18
|
+
exercise: string;
|
|
19
|
+
passed: boolean;
|
|
20
|
+
accuracy: number;
|
|
21
|
+
kpm: number;
|
|
22
|
+
hits: {
|
|
23
|
+
correct: number;
|
|
24
|
+
wrong: number;
|
|
25
|
+
};
|
|
26
|
+
seconds: number;
|
|
27
|
+
date: string;
|
|
28
|
+
medal?: undefined;
|
|
29
|
+
})[];
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { Locale } from "@typeolymp/utils/enums";
|
|
3
|
+
import { ExerciseResult } from "./utils";
|
|
4
|
+
declare type BasePropsType = {
|
|
5
|
+
exerciseResults: ExerciseResult[];
|
|
6
|
+
locale: Locale;
|
|
7
|
+
};
|
|
8
|
+
export declare type PropsType = (BasePropsType & {
|
|
9
|
+
type: "accuracy" | "hits" | "results" | "speed" | "time";
|
|
10
|
+
nExercisesInCourse?: never;
|
|
11
|
+
}) | (BasePropsType & {
|
|
12
|
+
type: "progress";
|
|
13
|
+
nExercisesInCourse: number;
|
|
14
|
+
});
|
|
15
|
+
declare const Chart: FC<PropsType>;
|
|
16
|
+
export default Chart;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.FC<import(".").PropsType>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Accuracy: () => JSX.Element;
|
|
8
|
+
export declare const Hits: () => JSX.Element;
|
|
9
|
+
export declare const Progress: () => JSX.Element;
|
|
10
|
+
export declare const Results: () => JSX.Element;
|
|
11
|
+
export declare const Speed: () => JSX.Element;
|
|
12
|
+
export declare const Time: () => JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Locale } from "@typeolymp/utils/enums";
|
|
2
|
+
import { ExerciseResult } from "./types";
|
|
3
|
+
import { Period } from "./enums";
|
|
4
|
+
export declare const getInterval: (period: Period) => {
|
|
5
|
+
start: any;
|
|
6
|
+
end: Date;
|
|
7
|
+
};
|
|
8
|
+
export declare const groupByIntervals: (intervals: Date[], results: ExerciseResult[]) => ExerciseResult[][];
|
|
9
|
+
export declare const prepareData: (period: Period, results: ExerciseResult[]) => {
|
|
10
|
+
resultsByInterval: ExerciseResult[][];
|
|
11
|
+
xAxisTicks: number[];
|
|
12
|
+
};
|
|
13
|
+
export declare const tickFormatter: (value: number, period: Period, locale: Locale) => string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export * from "./enums";
|
|
2
|
+
export * from "./helpers";
|
|
3
|
+
export * from "./types";
|
|
4
|
+
export declare const margin: {
|
|
5
|
+
top: number;
|
|
6
|
+
right: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const cartesianGrid: {
|
|
9
|
+
stroke: string;
|
|
10
|
+
vertical: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const cursor: {
|
|
13
|
+
fill: string;
|
|
14
|
+
stroke: string;
|
|
15
|
+
strokeWidth: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const area: (color: any) => {
|
|
18
|
+
fill: string;
|
|
19
|
+
stroke: any;
|
|
20
|
+
strokeWidth: number;
|
|
21
|
+
activeDot: {
|
|
22
|
+
strokeWidth: number;
|
|
23
|
+
r: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const bar: (color: any) => {
|
|
27
|
+
strokeWidth: number;
|
|
28
|
+
stroke: any;
|
|
29
|
+
fill: any;
|
|
30
|
+
};
|
|
31
|
+
export declare const yAxis: {
|
|
32
|
+
width: number;
|
|
33
|
+
axisLine: boolean;
|
|
34
|
+
tickLine: boolean;
|
|
35
|
+
tickMargin: number;
|
|
36
|
+
tick: {
|
|
37
|
+
fontFamily: string;
|
|
38
|
+
fontSize: number;
|
|
39
|
+
fontWeight: number;
|
|
40
|
+
fill: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export declare const xAxis: {
|
|
44
|
+
dataKey: string;
|
|
45
|
+
height: number;
|
|
46
|
+
axisLine: boolean;
|
|
47
|
+
tickLine: boolean;
|
|
48
|
+
tick: {
|
|
49
|
+
fontFamily: string;
|
|
50
|
+
fontSize: number;
|
|
51
|
+
fontWeight: number;
|
|
52
|
+
fill: string;
|
|
53
|
+
};
|
|
54
|
+
tickMargin: number;
|
|
55
|
+
domain: string[];
|
|
56
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Locale } from "@typeolymp/utils/enums";
|
|
2
|
+
import { Period } from "./enums";
|
|
3
|
+
export declare type ExerciseResult = {
|
|
4
|
+
_id: string;
|
|
5
|
+
exercise: string;
|
|
6
|
+
accuracy: number;
|
|
7
|
+
passed: boolean;
|
|
8
|
+
kpm: number;
|
|
9
|
+
hits: {
|
|
10
|
+
correct: number;
|
|
11
|
+
wrong: number;
|
|
12
|
+
};
|
|
13
|
+
seconds: number;
|
|
14
|
+
date: string;
|
|
15
|
+
};
|
|
16
|
+
export declare type ChartPropsType = {
|
|
17
|
+
exerciseResults: ExerciseResult[];
|
|
18
|
+
locale: Locale;
|
|
19
|
+
period: Period;
|
|
20
|
+
};
|
package/build/index.d.ts
CHANGED
|
@@ -44,10 +44,11 @@ import RadioGroup from "./components/molecules/RadioGroup";
|
|
|
44
44
|
import SelectField from "./components/molecules/SelectField";
|
|
45
45
|
import ToggleField from "./components/molecules/ToggleField";
|
|
46
46
|
import Tooltip from "./components/molecules/Tooltip";
|
|
47
|
+
import Chart from "./components/organisms/Chart";
|
|
47
48
|
import Form from "./components/organisms/Form";
|
|
48
49
|
import Keyboard from "./components/organisms/Keyboard";
|
|
49
50
|
import Modal from "./components/organisms/Modal";
|
|
50
51
|
import Result from "./components/organisms/Result";
|
|
51
52
|
import Table from "./components/organisms/Table";
|
|
52
53
|
import Transfer from "./components/organisms/Transfer";
|
|
53
|
-
export { theme, Button, Checkbox, Flag, Heading, Icon, Illustration, Input, Logo, Medal, Number, Paragraph, Radio, Range, Select, Spacer, Subheading, Tag, Toggle, Trophy, Alert, Card, Checkboxes, Collapse, Countdown, DateInputField, Dropdown, FileUpload, IconButton, InputField, Key, Link, Loading, LocaleSelect, Medals, Notification, NumberField, PasswordInputField, Popup, ProgressBar, Steps, Tabs, RadioGroup, SelectField, ToggleField, Tooltip, Form, Keyboard, Modal, Result, Table, Transfer, };
|
|
54
|
+
export { theme, Button, Checkbox, Flag, Heading, Icon, Illustration, Input, Logo, Medal, Number, Paragraph, Radio, Range, Select, Spacer, Subheading, Tag, Toggle, Trophy, Alert, Card, Checkboxes, Collapse, Countdown, DateInputField, Dropdown, FileUpload, IconButton, InputField, Key, Link, Loading, LocaleSelect, Medals, Notification, NumberField, PasswordInputField, Popup, ProgressBar, Steps, Tabs, RadioGroup, SelectField, ToggleField, Tooltip, Chart, Form, Keyboard, Modal, Result, Table, Transfer, };
|