Skip to content

Commit

Permalink
Merge 51ac849 into 18c8469
Browse files Browse the repository at this point in the history
  • Loading branch information
heyjul3s committed Feb 17, 2021
2 parents 18c8469 + 51ac849 commit e157eb5
Show file tree
Hide file tree
Showing 43 changed files with 1,698 additions and 1,688 deletions.
9 changes: 9 additions & 0 deletions bundlesize.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
{
"path": "./packages/hextorgb/dist/*.js"
},
{
"path": "./packages/hextorgba/dist/*.js"
},
{
"path": "./packages/pxtoem/dist/*.js"
},
{
"path": "./packages/pxtorem/dist/*.js"
},
{
"path": "./packages/usematchmedia/dist/*.js"
},
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"eslint-plugin-react": "^7.22.0",
"eslint-watch": "^7.0.0",
"jest": "^26.6.3",
"jest-dom": "^4.0.0",
"jest-runner-eslint": "^0.10.0",
"jest-styled-components": "^7.0.3",
"lerna": "^3.22.1",
Expand Down
40 changes: 40 additions & 0 deletions packages/artifak/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# artifak

## 2.1.1

### Patch Changes

- 6f08e4c: New hexToRGB, hexToRGBA, pxToEm and pxToRem utilities
- Updated dependencies [6f08e4c]
- @artifak/block@1.1.6
- @artifak/component-generator@2.0.3
- @artifak/flex@1.1.9
- @artifak/grid@1.1.6
- @artifak/hextorgb@1.0.1
- @artifak/hextorgba@1.0.1
- @artifak/imagery@1.0.8
- @artifak/media@1.0.4
- @artifak/pxtoem@1.0.1
- @artifak/pxtorem@1.0.1
- @artifak/typography@2.0.1
- @artifak/usematchmedia@1.0.3
- @artifak/usewindowsize@1.0.3

## 2.1.0

### Minor Changes

- Added new hexToRGB, hexToRGBA, pxToEm and pxToRem utilities

### Patch Changes

- update Media typings: extractByRegex to return RegExpMatchArray or string array
- update typings for FlexCol
- update typings for Generator
- Updated dependencies [undefined]
- @artifak/component-generator@2.0.2
- @artifak/flex@1.1.8
- @artifak/hextorgb@1.0.0
- @artifak/hextorgba@1.0.0
- @artifak/media@1.0.3
- @artifak/pxtoem@1.0.0
- @artifak/pxtorem@1.0.0

## 2.0.2

### Patch Changes
Expand Down
6 changes: 5 additions & 1 deletion packages/artifak/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artifak",
"version": "2.0.2",
"version": "2.1.1",
"description": "A set of React UI primitives to help you build your component UI system",
"author": "Julian Low",
"homepage": "https://github.com/heyjul3s/artifak#readme",
Expand Down Expand Up @@ -48,8 +48,12 @@
"@artifak/flex": "^1.1.7",
"@artifak/fluidsizing": "^1.0.1",
"@artifak/grid": "^1.1.5",
"@artifak/hextorgb": "^1.0.1",
"@artifak/hextorgba": "^1.0.1",
"@artifak/imagery": "^1.0.7",
"@artifak/media": "^1.0.2",
"@artifak/pxtoem": "^1.0.1",
"@artifak/pxtorem": "^1.0.1",
"@artifak/typography": "^2.0.0",
"@artifak/usematchmedia": "^1.0.2",
"@artifak/usewindowsize": "^1.0.2"
Expand Down
4 changes: 4 additions & 0 deletions packages/artifak/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ export {
export { fluidSizing } from '@artifak/fluidsizing';
export { useMatchMedia } from '@artifak/usematchmedia';
export { useWindowSize } from '@artifak/usewindowsize';
export { hexToRGB, getHexColorRGBvalues } from '@artifak/hextorgb';
export { hexToRGBA } from '@artifak/hextorgba';
export { pxToEm } from '@artifak/pxtoem';
export { pxToRem } from '@artifak/pxtorem';
7 changes: 7 additions & 0 deletions packages/block/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @artifak/block

## 1.1.6

### Patch Changes

- Updated dependencies [6f08e4c]
- @artifak/component-generator@2.0.3

## 1.1.5

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/block/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artifak/block",
"version": "1.1.5",
"version": "1.1.6",
"description": "Basic React component primitive for handling spacing",
"author": "Julian Low",
"homepage": "https://github.com/heyjul3s/artifak#readme",
Expand Down Expand Up @@ -58,6 +58,6 @@
"styled-components": ">=5.2.1"
},
"dependencies": {
"@artifak/component-generator": "^2.0.1"
"@artifak/component-generator": "^2.0.3"
}
}
13 changes: 13 additions & 0 deletions packages/component-generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @artifak/component-generator

## 2.0.3

### Patch Changes

- Minor package typings update
- 6f08e4c: New hexToRGB, hexToRGBA, pxToEm and pxToRem utilities

## 2.0.2

### Patch Changes

- Added return types for generateComponent and createStyled

## 2.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/component-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artifak/component-generator",
"version": "2.0.1",
"version": "2.0.3",
"description": "Component generator utility for Artifak",
"author": "Julian Low",
"license": "MIT",
Expand Down
17 changes: 17 additions & 0 deletions packages/flex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @artifak/flex

## 1.1.9

### Patch Changes

- Minor typings update
- 6f08e4c: New hexToRGB, hexToRGBA, pxToEm and pxToRem utilities
- Updated dependencies [6f08e4c]
- @artifak/component-generator@2.0.3

## 1.1.8

### Patch Changes

- Added return type for parseNumberToTwoDecimals
- Updated dependencies [undefined]
- @artifak/component-generator@2.0.2

## 1.1.7

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/flex/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artifak/flex",
"version": "1.1.7",
"version": "1.1.9",
"description": "A styled-component Flex grid component for your layout needs.",
"keywords": [
"react",
Expand Down Expand Up @@ -59,6 +59,6 @@
"styled-components": ">=5.2.1"
},
"dependencies": {
"@artifak/component-generator": "^2.0.1"
"@artifak/component-generator": "^2.0.3"
}
}
7 changes: 7 additions & 0 deletions packages/grid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @artifak/grid

## 1.1.6

### Patch Changes

- Updated dependencies [6f08e4c]
- @artifak/component-generator@2.0.3

## 1.1.5

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/grid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artifak/grid",
"version": "1.1.5",
"version": "1.1.6",
"description": "Basic React grid component for helping with building grid layout components",
"author": "Julian Low",
"homepage": "https://github.com/heyjul3s/artifak#readme",
Expand Down Expand Up @@ -57,6 +57,6 @@
"styled-components": ">=5.2.1"
},
"dependencies": {
"@artifak/component-generator": "^2.0.1"
"@artifak/component-generator": "^2.0.3"
}
}
11 changes: 11 additions & 0 deletions packages/hextorgb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @artifak/hextorgb

## 1.0.1

### Patch Changes

- 6f08e4c: New hexToRGB utilities

## 1.0.0

- Added new hexToRGB utility function.
28 changes: 28 additions & 0 deletions packages/hextorgb/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# `@artifak/hextorgb`

A utility function to convert hexadecimal colour values to RGB string.

## Installation

### Yarn

```sh
yarn add @artifak/hextorgb
```

### NPM

```sh
npm install @artifak/hextorgb
```

## Usage

```ts
import { hexToRGB } from 'artifak';
import styled from 'styled-components';

export const Container = styled.div`
margin: 0 auto;
width: 100%;
background: #000;
color: ${hexToRGB('#FFF')};
`;
```
6 changes: 3 additions & 3 deletions packages/hextorgb/__tests__/hextorgb.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
hexToRGB,
getRGBvalues,
getHexColorRGBvalues,
splitHexToRGB,
formatHexValue,
expandShorthandHex,
Expand Down Expand Up @@ -70,15 +70,15 @@ describe('@artifak/hextorgb', () => {

describe('getRGBvalues', () => {
it('returns an object with RGB values', () => {
expect(getRGBvalues('#DF3EA1')).toMatchObject({
expect(getHexColorRGBvalues('#DF3EA1')).toMatchObject({
r: 223,
g: 62,
b: 161
});
});

it('returns UNDEFINED with invalid hex string values', () => {
expect(getRGBvalues('Hello World')).toEqual(void 0);
expect(getHexColorRGBvalues('Hello World')).toEqual(void 0);
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/hextorgb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artifak/hextorgb",
"version": "1.0.0",
"version": "1.0.1",
"description": "Utility function to convert style hex colour codes to RGB string.",
"keywords": [
"color",
Expand Down
4 changes: 2 additions & 2 deletions packages/hextorgb/src/hextorgb.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { RGBColor } from './typings';

export function hexToRGB(hex: string): string | void {
const color = getRGBvalues(hex);
const color = getHexColorRGBvalues(hex);

if (!!color) {
return `rgb(${color.r}, ${color.g}, ${color.b})`;
}
}

export function getRGBvalues(hex: string): RGBColor | void {
export function getHexColorRGBvalues(hex: string): RGBColor | void {
const hexValue = formatHexValue(hex);

if (!!hexValue) {
Expand Down
2 changes: 1 addition & 1 deletion packages/hextorgb/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { hexToRGB, getRGBvalues } from './hextorgb';
export { hexToRGB, getHexColorRGBvalues } from './hextorgb';
export { RGBColor } from './typings';
13 changes: 13 additions & 0 deletions packages/hextorgba/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @artifak/hextorgba

## 1.0.1

### Patch Changes

- 6f08e4c: New hexToRGBA utilities
- Updated dependencies [6f08e4c]
- @artifak/hextorgb@1.0.1

## 1.0.0

- Added new hexToRGBA utility function.
28 changes: 28 additions & 0 deletions packages/hextorgba/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# `@artifak/hextorgba`

A utility function to convert hexadecimal colour values to RGBA string.

## Installation

### Yarn

```sh
yarn add @artifak/hextorgb
```

### NPM

```sh
npm install @artifak/hextorgb
```

## Usage

```ts
import { hexToRGBA } from 'artifak';
import styled from 'styled-components';

export const Container = styled.div`
margin: 0 auto;
width: 100%;
background: #000;
color: ${hexToRGBA('#FFF', 0.75)};
`;
```
4 changes: 2 additions & 2 deletions packages/hextorgba/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artifak/hextorgba",
"version": "1.0.0",
"version": "1.0.1",
"description": "Utility function to convert style hex colour codes to RGBA string.",
"keywords": [
"color",
Expand Down Expand Up @@ -41,6 +41,6 @@
"@artifak/bundler": "^1.1.3"
},
"dependencies": {
"@artifak/hextorgb": "^1.0.0"
"@artifak/hextorgb": "^1.0.1"
}
}
4 changes: 2 additions & 2 deletions packages/hextorgba/src/hextorgba.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getRGBvalues } from '@artifak/hextorgb';
import { getHexColorRGBvalues } from '@artifak/hextorgb';

export function hexToRGBA(hex: string, alpha = 1): string | void {
const color = getRGBvalues(hex);
const color = getHexColorRGBvalues(hex);

if (!!color) {
return `rgba(${color.r}, ${color.g}, ${color.b}, ${alpha})`;
Expand Down
2 changes: 1 addition & 1 deletion packages/hextorgba/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { hexToRGBA } from './hextorgba';
export { getRGBvalues } from '@artifak/hextorgb';
export { getHexColorRGBvalues } from '@artifak/hextorgb';
Loading

0 comments on commit e157eb5

Please sign in to comment.