Skip to content

Commit aec4724

Browse files
authored
Merge pull request #52 from Proskynete/dev
Dev
2 parents 9e73e6c + cdece8f commit aec4724

File tree

57 files changed

+1021
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1021
-230
lines changed

.github/funding.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
github: Proskynete
2-
custom: https://donate.eduardoalvarez.dev
2+
custom: https://thanks.eduardoalvarez.dev/donate

.github/pull_request_template.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Description
1+
# 📚 Description
22

33
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
44

55
Fixes # (issue)
66

7-
## Type of change
7+
## 👾 Type of change
88

99
Please delete options that are not relevant.
1010

@@ -14,14 +14,14 @@ Please delete options that are not relevant.
1414
- [ ] This change requires a documentation update
1515
- [ ] Other (If yes, please write one phrase about this update)
1616

17-
# How Has This Been Tested?
17+
# 👀 How Has This Been Tested?
1818

1919
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
2020

2121
- [ ] Test A
2222
- [ ] Test B
2323

24-
# Checklist
24+
# Checklist
2525

2626
- [ ] My code follows the style guidelines of this project
2727
- [ ] I have performed a self-review of my code

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: '👾 CI'
22

33
on:
44
push:
5-
branches: [master, dev]
5+
branches: [dev]
66
pull_request:
7-
branches: [master,dev]
7+
branches: [dev]
88

99
jobs:
1010
build:

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: '🦊 Coverage'
22

33
on:
44
push:
5-
branches: [master,dev]
5+
branches: [dev]
66
pull_request:
7-
branches: [master,dev]
7+
branches: [dev]
88

99
jobs:
1010
build:

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,50 @@ on:
77
branches: [master]
88

99
jobs:
10+
coverage:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: 📚 Checkout git repository
15+
uses: actions/checkout@v2
16+
- name: 🟢 Setup Node.js
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: 16
20+
- name: 🛠 Install dependencies
21+
run: npm install
22+
- name: ⚙️ Create coverage
23+
run: npm run test:coveralls
24+
env:
25+
COVERALLS_REPO_TOKEN: ${{secrets.COVERALLS_REPO_TOKEN}}
26+
- name: 📨 Send report to Coveralls
27+
uses: coverallsapp/github-action@master
28+
with:
29+
github-token: ${{secrets.GITHUB_TOKEN}}
30+
31+
ci:
32+
runs-on: ${{matrix.os}}
33+
needs: coverage
34+
strategy:
35+
max-parallel: 24
36+
matrix:
37+
os: [ubuntu-latest, macos-latest, windows-latest]
38+
node-version: [14.x, 16.x]
39+
steps:
40+
- name: 📚 Checkout git repository
41+
uses: actions/checkout@v2
42+
- name: 🟢 Setup Node.js ${{matrix.node-version}}
43+
uses: actions/setup-node@v1
44+
with:
45+
node-version: ${{matrix.node-version}}
46+
- name: 🛠 Install Node.js dependencies
47+
run: npm install
48+
- name: 🤖 Run tests
49+
run: npm run test
50+
1051
publish:
1152
name: '🚀 Publish'
53+
needs: [coverage, ci]
1254
runs-on: ubuntu-latest
1355
steps:
1456
- name: 📚 Checkout git repository

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ This is the wrapper component that creates the vertical timeline.
6262
| theme | object | false | colors | { yearColor: "#888888", lineColor: "#c5c5c5", dotColor: "#c5c5c5", borderDotColor: "#ffffff", titleColor: "#cccccc", subtitleColor: "#888888", textColor: "#cccccc" } | Set colors in all components |
6363
| lang | string | false | `en`, `es`, `de`, `tr` or `zh` | `en` | Change the language `from` and `to` texts and change the format in the dates |
6464
| dateFormat | string | false | `only-number`, `short`, `with-weekday` or `full` | `only-number` | Change the presentation format of dates |
65-
| collapse | boolean | false | `true` or `false` | `false` | Allow collapse the description of Content component |
65+
| collapse | boolean | false | `true` or `false` | `false` | Allow collapsing description of all Content components |
66+
| withoutDay | boolean | false | `true` or `false` | `false` | Will hide the day of the dates of all Content components |
6667

6768
`dateFormat`: The next table shows the different formats that can be used in the `dateFormat` prop and the result that will be displayed.
6869

@@ -80,6 +81,12 @@ This is the wrapper component that creates the vertical timeline.
8081

8182
This component is the container of the content of each year. It is required to have at least one `Container` component as a child of the `Timeline` component. It can have as many `Container` components as you want.
8283

84+
- Childrens
85+
86+
| Number of children | Required | Value Allowed |
87+
| ------------------ | ---------------------------------------------------- | --------------------------- |
88+
| Many | At least the first `Content` component is required | Only `Content` components |
89+
8390
- Props
8491

8592
| Name | Type | Required | Values Allowed | default values | Description |
@@ -88,6 +95,8 @@ This component is the container of the content of each year. It is required to h
8895
| startDate | string | true | `YYYY/MM/DD` - `YYYY/MM` - `YYYY` | does not apply | The date of the start of the content or contents |
8996
| endDate | string | false | `YYYY/MM/DD` - `YYYY/MM` - `YYYY` | does not apply | The date of the end of the content or contents |
9097
| today | boolean | false | `true` or `false` | current year | The value is the current year, it is recommended to use it in the last Container |
98+
| collapse | boolean | false | `true` or `false` | `false` | Allow collapsing description for this component only |
99+
| withoutDay | boolean | false | `true` or `false` | `false` | Will hide the day of the dates for this component only |
91100

92101
<p align="right"><a href="#top">🔝</a></p>
93102

@@ -126,7 +135,7 @@ const customTheme = {
126135
class Main extends Component {
127136
render() {
128137
return (
129-
<Timeline lang="en" theme={customTheme} dateFormat="only-number" collapse>
138+
<Timeline lang="en" theme={customTheme} dateFormat="only-number" collapse withoutDay>
130139
<Container title="What is lorem Ipsum?" startDate="2020/12/02" today>
131140
<Content
132141
title="Lorem Ipsum"
@@ -166,7 +175,7 @@ const Main = () => {
166175
};
167176

168177
return (
169-
<Timeline lang="en" theme={customTheme} dateFormat="only-number" collapse>
178+
<Timeline lang="en" theme={customTheme} dateFormat="only-number" collapse withoutDay>
170179
<Container title="What is lorem Ipsum?" startDate="2020/12/02" today>
171180
<Content
172181
title="Lorem Ipsum"
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
import { PropsWithChildren } from 'react';
2-
interface ContainerProps {
3-
title: string;
4-
startDate: string;
5-
endDate?: string;
6-
today?: boolean;
7-
}
8-
declare const Container: ({ title, startDate, endDate, today, children, }: PropsWithChildren<ContainerProps>) => JSX.Element;
1+
import { ContainerProps } from '../../interfaces';
2+
declare const Container: ({ title, startDate, endDate, today, withoutDay, children }: ContainerProps) => JSX.Element;
93
export { Container };

lib/cjs/components/container/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ exports.Container = void 0;
77
var react_1 = __importDefault(require("react"));
88
var useConfig_1 = require("../../hooks/useConfig");
99
var main_1 = require("../../styles/main");
10+
var content_1 = require("../content");
11+
var validate_1 = require("../validate");
1012
var year_content_1 = __importDefault(require("../year-content"));
1113
var Container = function (_a) {
1214
var _b;
13-
var title = _a.title, startDate = _a.startDate, endDate = _a.endDate, today = _a.today, children = _a.children;
15+
var title = _a.title, startDate = _a.startDate, endDate = _a.endDate, today = _a.today, withoutDay = _a.withoutDay, children = _a.children;
1416
var config = (0, useConfig_1.useConfig)().config;
1517
return (react_1.default.createElement(main_1.ContainerWrapper, null,
16-
react_1.default.createElement(year_content_1.default, { startDate: startDate, endDate: endDate, today: today }),
18+
react_1.default.createElement(year_content_1.default, { startDate: startDate, endDate: endDate, today: today, withoutDay: withoutDay }),
1719
react_1.default.createElement(main_1.BodyWrapper, null,
1820
react_1.default.createElement(main_1.Title, { style: (_b = config.customStyles) === null || _b === void 0 ? void 0 : _b.title }, title),
19-
react_1.default.createElement(main_1.BodyInner, null, children))));
21+
react_1.default.createElement(main_1.BodyInner, null,
22+
react_1.default.createElement(validate_1.Validate, { componentToValidate: content_1.Content }, children)))));
2023
};
2124
exports.Container = Container;
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
interface ContentProps {
2-
title: string;
3-
description: string[];
4-
collapse?: boolean;
5-
}
1+
import { ContentProps } from '../../interfaces';
62
declare const Content: ({ title, description, collapse }: ContentProps) => JSX.Element;
73
export { Content };
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
interface ErrorMessageProps {
2+
type: 'atLeast' | 'onlySupports';
3+
component: string;
4+
}
5+
declare const ErrorMessage: ({ type, component }: ErrorMessageProps) => JSX.Element;
6+
export { ErrorMessage };

0 commit comments

Comments
 (0)