Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relase #15

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .github/workflows/build-ui.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: UI Component Build
name: release build

on:
push:
Expand Down Expand Up @@ -39,16 +39,6 @@ jobs:
- name: Building UI Component
run: npm run build-storybook

- uses: shallwefootball/s3-upload-action@master
name: Upload S3
id: S3
with:
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ secrets.AWS_BUCKET }}
source_dir: "storybook-static"
destination_dir: ""

- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
Expand Down
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

### How to make a clean pull request

Look for a project's contribution instructions. If there are any, follow them.

- Create a personal fork of the project on Github.
- Clone the fork on your local machine. Your remote repo on Github is called `origin`.
- Add the original repository as a remote called `upstream`.
- If you created your fork a while ago be sure to pull upstream changes into your local repository.
- Create a new branch to work on! Branch from `develop` if it exists, else from `master`.
- Implement/fix your feature, comment your code.
- Follow the code style of the project, including indentation.
- If the project has tests run them!
- Write or adapt tests as needed.
- Add or change the documentation as needed.
- Squash your commits into a single commit with git's [interactive rebase](https://help.github.com/articles/interactive-rebase). Create a new branch if necessary.
- Push your branch to your fork on Github, the remote `origin`.
- From your fork open a pull request in the correct branch. Target the project's `develop` branch if there is one, else go for `master`!
- If the maintainer requests further changes just push them to your branch. The PR will be updated automatically.
- Once the pull request is approved and merged you can pull the changes from `upstream` to your local repo and delete
your extra branch(es).

And last but not least: Always write your commit messages in the present tense. Your commit message should describe what the commit, when applied, does to the code – not what you did to the code.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 linkube

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ React Admin Template UI

![UI Component Build](https://github.com/linkube-team/keobee-ui/workflows/UI%20Component%20Build/badge.svg)
![dev test](https://github.com/linkube-team/keobee-ui/workflows/dev%20test/badge.svg)
[![Netlify Status](https://api.netlify.com/api/v1/badges/e1d36418-7aaa-4781-981f-bed4d44081bf/deploy-status)](https://app.netlify.com/sites/keobee-ui/deploys)

## Getting Start

Expand Down
22 changes: 22 additions & 0 deletions lib/atoms/Badge/Badge.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@import "../../style/import";

.#{$prefix}__badge {
@include size;
font-size: 9px;
padding: 3px 6px;
display: inline-block;
vertical-align: middle;

&--primary {
border: 1px solid transparent;
background-color: map-get($colors, "primary");
color: #ffffff;
}

&--disabled {
border: 1px solid transparent;
background-color: map-get($colors, "disabled");
color: #ffffff;
cursor: not-allowed;
}
}
25 changes: 25 additions & 0 deletions lib/atoms/Badge/Badge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, { HTMLAttributes } from "react"
import cx from "classnames"
import { useUi } from "@lib/hooks"

import "./Badge.scss"

export type BadgeProps = HTMLAttributes<HTMLSpanElement> & {
variant?: "primary" | "disabled"
}

export const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(
({ children, className, variant = "primary", ...props }, ref) => {
const { getPrefix } = useUi()

const prefix = getPrefix("badge")

const classes = cx([prefix, className, `${prefix}--${variant}`])

return (
<span {...props} className={classes} ref={ref}>
{children}
</span>
)
},
)
1 change: 1 addition & 0 deletions lib/atoms/Badge/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Badge"
19 changes: 18 additions & 1 deletion lib/atoms/Button/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,32 @@
@include size;

cursor: pointer;
border: 1px solid transparent;

&--primary {
border: 1px solid transparent;
background-color: map-get($colors, "primary");
color: #ffffff;
}

&--success {
background-color: map-get($colors, "success");
color: #ffffff;
}

&--danger {
background-color: map-get($colors, "danger");
color: #ffffff;
}

&--warning {
background-color: map-get($colors, "warning");
color: #ffffff;
}

&:disabled {
background-color: map-get($colors, "disabled");
color: map-get($colors, "disabled-dark");
border: 1px solid map-get($colors, "disabled-dark");
cursor: not-allowed;
}
}
3 changes: 2 additions & 1 deletion lib/atoms/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cx from "classnames"
import "./Button.scss"

export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
variant?: "primary"
variant?: "primary" | "success" | "danger" | "warning"
size?: "small" | "medium" | "large" | "xlarge"
disabled?: boolean
}
Expand All @@ -17,6 +17,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
variant = "primary",
type = "button",
disabled = false,
size = "medium",
className,
...rest
},
Expand Down
7 changes: 7 additions & 0 deletions lib/atoms/CheckBox/CheckBox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,12 @@
color: #ffffff;
}
}

&:disabled + span {
background-color: map-get($colors, "disabled");
color: map-get($colors, "disabled-dark");
border: 1px solid map-get($colors, "disabled-dark");
cursor: not-allowed;
}
}
}
9 changes: 8 additions & 1 deletion lib/atoms/Input/Input.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../style/import.scss";
@import "../../style/import";

.#{$prefix}__input {
@include base;
Expand All @@ -7,4 +7,11 @@
&--primary {
border: 1px solid map-get($colors, "primary");
}

&:disabled {
background-color: #{map-get($map: $colors, $key: "disabled")};
border: 1px solid map-get($colors, "disabled-dark");
cursor: not-allowed;
color: map-get($colors, "disabled-dark");
}
}
2 changes: 2 additions & 0 deletions lib/atoms/TextArea/TextArea.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
}
&:disabled {
background-color: map-get($colors, "disabled");
color: map-get($colors, "disabled-dark");
border: 1px solid map-get($colors, "disabled-dark");
cursor: not-allowed;
}
}
2 changes: 2 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ export * from "./atoms/CheckBox"
export * from "./atoms/Radio"
export * from "./atoms/Select"
export * from "./atoms/TextArea"
export * from "./atoms/Badge"

export * from "./molecules/ButtonGroup"
export * from "./molecules/Panel"

export * from "./organisms/Modal"
export * from "./organisms/DatePicker"
13 changes: 13 additions & 0 deletions lib/molecules/FormInput/FormInput.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@import "../../style/import";

.#{$prefix}__form-input {
&__form-group {
display: inline-block;
}

&__title {
display: block;
font-size: 13px;
margin-bottom: 5px;
}
}
28 changes: 28 additions & 0 deletions lib/molecules/FormInput/FormInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react"
import cx from "classnames"
import { Input, InputProps } from "@lib/atoms/Input"
import { useUi } from "@lib/hooks"

import "./FormInput.scss"

export type FormInputProps = InputProps & {
label?: string
}

export const FormInput = React.forwardRef<HTMLInputElement, FormInputProps>(
({ children, label, ...props }, ref) => {
const { getPrefix } = useUi()

const prefix = getPrefix("form-input")

const wrappedClass = cx([`${prefix}__form-group`])
const titleClass = cx([`${prefix}__title`])

return (
<label className={wrappedClass}>
<span className={titleClass}>{label}</span>
<Input {...props} ref={ref} />
</label>
)
},
)
1 change: 1 addition & 0 deletions lib/molecules/FormInput/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./FormInput"
107 changes: 107 additions & 0 deletions lib/organisms/DatePicker/DatePicker.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
@import "../../style/import.scss";

.#{$prefix}__calednar {
border-radius: unset;
border: 1px solid map-get($colors, "border") !important;
top: -11px;
left: -1px;

.react-datepicker {
font-size: 1.3rem !important;
}
.react-datepicker__triangle {
display: none;
}

.btn_month {
background: none;
line-height: 1.7rem;
text-align: center;
cursor: pointer;
top: 10px;
width: 0;
padding: 0;
border: 0.45rem solid transparent;
z-index: 1;
height: 10px;
width: 10px;
text-indent: -999em;
overflow: hidden;
}
.btn_month-prev {
border-right-color: #fff;
}
.btn_month-next {
border-left-color: #fff;
}
.month-day {
font-size: 1.6rem;
color: #fff;
font-weight: 400;
}

.react-datepicker__current-month {
font-size: 1.5rem !important;
color: #fff;
}

.react-datepicker__header {
padding-top: 6px;
background-color: map-get($colors, "primary");
border-bottom: transparent;
border-radius: unset;
}
.react-datepicker__navigation {
top: 13px;
}
.react-datepicker__week {
padding: 1px;
}
.react-datepicker__day-names {
background-color: #fff;
}
.react-datepicker__day-name {
font-size: 1rem;
color: #000;
padding: 1px;
}
.react-datepicker__day-name,
.react-datepicker__day {
margin: 0.5rem;
font-size: 1rem;
}
.react-datepicker__day {
padding: 1px;
}
.react-datepicker__day:hover {
border-radius: 50%;
background-color: #dbe7ff;
padding: 1px;
}
.react-datepicker__day--disabled {
color: #cccccc !important;
}
.react-datepicker__day--selected {
background-color: map-get($colors, "primary");
border-radius: 50%;
padding: 1px;
}
.react-datepicker__day--keyboard-selected,
.react-datepicker__month-text--keyboard-selected,
.react-datepicker__quarter-text--keyboard-selected,
.react-datepicker__year-text--keyboard-selected {
background-color: map-get($colors, "primary");
border-radius: 50%;
padding: 1px;
}

.react-datepicker__day-name:nth-child(1) {
color: #ff5249;
}
.react-datepicker__day--outside-month {
color: #ccc !important;
}
.sunday {
color: #ff5249;
}
}
Loading