Skip to content

Commit dd30e76

Browse files
committed
chore: Change Readme file and fix some visual bugs
1 parent a9f71e9 commit dd30e76

File tree

19 files changed

+86
-75
lines changed

19 files changed

+86
-75
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,20 @@ This is the wrapper component that creates the vertical timeline.
6060

6161
- Props
6262

63-
| name | Type | Required | Values Allowed | default values | Description |
64-
| ---------- | ------ | -------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
65-
| theme | object | false | colors | { yearColor: "#888888", lineColor: "#c5c5c5", dotColor: "#c5c5c5", borderDotColor: "#ffffff", titleColor: "#cccccc", subtitleColor: "#888888", textColor: "#cccccc" } | Set colors in all components |
66-
| lang | node | false | `en`, `es`, `de` or `zh_CN` | `en` | Change the language `from` and `to` texts and change the format in the dates |
67-
| dateFormat | string | false | `L`, `l` or `ll` | `L` | Change the presentation format of dates |
63+
| name | Type | Required | Values Allowed | default values | Description |
64+
| ---------- | ------ | -------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
65+
| theme | object | false | colors | { yearColor: "#888888", lineColor: "#c5c5c5", dotColor: "#c5c5c5", borderDotColor: "#ffffff", titleColor: "#cccccc", subtitleColor: "#888888", textColor: "#cccccc" } | Set colors in all components |
66+
| lang | string | false | `en`, `es`, `de` or `zh_CN` | `en` | Change the language `from` and `to` texts and change the format in the dates |
67+
| dateFormat | string | false | `only-number`, `short`, `with-weekday` or `full` | `only-number` | Change the presentation format of dates |
6868

69-
`dateFormat`: Receive only one of three options. (The options are same the [moment.js](https://momentjs.com/) using).
69+
`dateFormat`: Receive only one of four options (The options are same the [moment.js](https://momentjs.com/) using)
7070

71-
| | `L` | `l` | `ll` |
72-
| :-------------------------: | --------------------- | ------------------- | ------------------ |
73-
| English(`en`) | `MM/DD/YYYY` | `M/D/YYYY` | `MMM DD, YYYY` |
74-
| Spanish(`es`) | `DD/MM/YYYY` | `D/M/YYYY` | `DD de MMM, YYYY` |
75-
| German(`de`) | `DD.MM.YYYY` | `D.M.YYYY` | `DD. MMM YYYY` |
76-
| Simplified Chinese(`zh_CN`) | `YYYY 年 MM 月 DD 日` | `YYYY 年 M 月 D 日` | `YYYY 年MMM DD 日` |
71+
| | `only-number` | `short` | `with-weekday` | `full` |
72+
| :-------------------------: | ------------- | ---------------- | ----------------------- | ------------------------------ |
73+
| English(`en`) | `MM/D/YYYY` | `MMM DD, YYYY` | `ddd, MMM DD, YYYY` | `dddd, MMMM DD, YYYY` |
74+
| Spanish(`es`) | `D/MM/YYYY` | `DD MMM YYYY` | `ddd, DD [de] MMM YYYY` | `dddd, DD [de] MMMM [de] YYYY` |
75+
| German(`de`) | `D.MM.YYYY` | `DD.MMM.YYYY` | `ddd., DD. MMM. YYYY` | `dddd, DD. MMMM YYYY` |
76+
| Simplified Chinese(`zh_CN`) | `YYYY/MM/D` | `YYYY年MM月DD日` | `YYYY年MMM月DD日` | `YYYY年MM月DD日dddd` |
7777

7878
<h3 id="container">Container</h3>
7979

@@ -87,7 +87,7 @@ Each event in the timeline will be represented by the `Content` component. This
8787

8888
<h3 id="year-content">YearContent</h3>
8989

90-
For each `Container` you need `YearContent` (like firts children) since with this component you mark the events in the given year.
90+
For each `Container` you need `YearContent` (like first children) since with this component you mark the events in the given year.
9191

9292
- Props
9393

@@ -165,7 +165,7 @@ const customTheme = {
165165
class Main extends Component {
166166
render() {
167167
return(
168-
<Timeline theme={customTheme} dateFormat='ll'>
168+
<Timeline theme={customTheme} dateFormat='full'>
169169
<Container>
170170
<YearContent startDate='2020/07/01' currentYear />
171171
<BodyContent>
@@ -211,7 +211,7 @@ const Main = () => {
211211
};
212212

213213
return (
214-
<Timeline theme={customTheme} dateFormat='ll'>
214+
<Timeline theme={customTheme} dateFormat='full'>
215215
<Container>
216216
<YearContent startDate='2020/07/01' currentYear />
217217
<BodyContent>

lib/cjs/components/timeline/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PropsWithChildren } from 'react';
2-
import { DateFormat, Theme } from '../../config';
2+
import { DateFormat, Theme } from '../../interfaces';
33
interface TimelineProps {
44
theme?: Theme;
55
lang?: string;

lib/cjs/config/index.d.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
export interface Theme {
2-
yearColor: string;
3-
lineColor: string;
4-
dotColor: string;
5-
borderDotColor: string;
6-
titleColor: string;
7-
subtitleColor: string;
8-
textColor: string;
9-
}
10-
export declare type DateFormat = 'only-number' | 'short' | 'with-weekday' | 'full';
11-
export interface DefaultValues {
12-
theme?: Theme;
13-
lang: string;
14-
dateFormat: DateFormat;
15-
}
1+
import { DefaultValues } from '../interfaces';
162
export declare const defaultValues: DefaultValues;
173
export declare const mapText: {
184
en: {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import { DefaultValues } from '../config';
1+
import { DefaultValues } from '../interfaces';
22
export declare const ConfigContext: import("react").Context<DefaultValues>;

lib/cjs/helpers/transform-date.helper.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DateFormat } from '../config/index';
1+
import { DateFormat } from '../interfaces';
22
interface ITransformDate {
33
date: string;
44
lang: string;

lib/cjs/interfaces/index.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export interface Theme {
2+
yearColor: string;
3+
lineColor: string;
4+
dotColor: string;
5+
borderDotColor: string;
6+
titleColor: string;
7+
subtitleColor: string;
8+
textColor: string;
9+
}
10+
export declare type DateFormat = 'only-number' | 'short' | 'with-weekday' | 'full';
11+
export interface DefaultValues {
12+
theme?: Theme;
13+
lang: string;
14+
dateFormat: DateFormat;
15+
}

lib/cjs/interfaces/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });

lib/cjs/styles/main.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DateFormat } from '../config';
1+
import { DateFormat } from '../interfaces';
22
export declare const TimelineWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
33
export declare const TimelineWrapperInner: import("styled-components").StyledComponent<"div", any, {}, never>;
44
export declare const ContainerWrapper: import("styled-components").StyledComponent<"section", any, {}, never>;

lib/cjs/styles/main.js

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/esm/components/timeline/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PropsWithChildren } from 'react';
2-
import { DateFormat, Theme } from '../../config';
2+
import { DateFormat, Theme } from '../../interfaces';
33
interface TimelineProps {
44
theme?: Theme;
55
lang?: string;

0 commit comments

Comments
 (0)