Skip to content

Commit

Permalink
Merge pull request #48 from spicy-ui/next
Browse files Browse the repository at this point in the history
0.1.0-alpha.6
  • Loading branch information
South-Paw authored Jun 8, 2021
2 parents 296d1ca + 4ed8da4 commit b18e4be
Show file tree
Hide file tree
Showing 37 changed files with 2,699 additions and 1,953 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Install dependencies
run: npm ci
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
if: github.event_name == 'push'
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Install dependencies
run: npm ci
Expand All @@ -23,7 +23,7 @@ jobs:
if: github.event_name == 'push'
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Install dependencies
run: npm ci
Expand All @@ -39,7 +39,7 @@ jobs:
if: github.event_name == 'push'
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Install dependencies
run: npm ci
Expand All @@ -53,7 +53,7 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Install dependencies
run: npm ci
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Install dependencies
run: npm ci
Expand All @@ -36,7 +36,7 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Install dependencies
run: npm ci
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
-->

## 0.1.0-alpha.6 (8 June, 2021)

### Changes

- Added `HTMLAttributes` props interface to components
- Added `inherit` variant to Text and Heading
- Added `openOnHover` prop to Menu component
- Exposed internal Menu disclosure state functions ([#47](https://github.com/spicy-ui/core/issues/47))

### Bug Fixes

- Fixed missing `noscroll` class ([#46](https://github.com/spicy-ui/core/issues/46))

## 0.1.0-alpha.5 (28 February, 2021)

### Features
Expand Down
4,438 changes: 2,566 additions & 1,872 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spicy-ui/core",
"version": "0.1.0-alpha.5",
"version": "0.1.0-alpha.6",
"description": "A themable and extensible React UI library, ready to use out of the box",
"keywords": [
"react",
Expand Down Expand Up @@ -43,24 +43,24 @@
"test": "tsdx test --passWithNoTests"
},
"dependencies": {
"@popperjs/core": "^2.8.6",
"@popperjs/core": "^2.9.2",
"@spicy-ui/styled-system": "0.0.1-alpha.3",
"@types/styled-components": "^5.1.7",
"@types/styled-components": "^5.1.9",
"deepmerge": "^4.2.2",
"downshift": "^6.1.0",
"framer-motion": "^3.7.0",
"polished": "^4.1.1",
"downshift": "^6.1.3",
"framer-motion": "^4.1.17",
"polished": "^4.1.3",
"react-fast-compare": "^3.2.0",
"react-focus-lock": "^2.5.0",
"react-focus-lock": "^2.5.1",
"react-icons": "^4.2.0",
"react-popper": "^2.2.4",
"react-popper": "^2.2.5",
"styled-normalize": "^8.0.7"
},
"devDependencies": {
"@storybook/addon-essentials": "^6.1.20",
"@storybook/react": "^6.1.20",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.1",
"@storybook/addon-essentials": "^6.2.9",
"@storybook/react": "^6.2.9",
"@types/react": "^17.0.9",
"@types/react-dom": "^17.0.6",
"@types/react-router-dom": "^5.1.7",
"@typescript-eslint/eslint-plugin": "^4.15.2",
"@typescript-eslint/parser": "^4.15.2",
Expand All @@ -69,17 +69,17 @@
"eslint-plugin-jest": "^24.1.5",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-json-view": "^1.21.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-json-view": "^1.21.3",
"react-lorem-ipsum": "^1.4.9",
"react-router-dom": "^5.2.0",
"react-uid": "^2.3.1",
"rimraf": "^3.0.2",
"styled-components": "^5.2.1",
"styled-components": "^5.3.0",
"tsdx": "^0.14.1",
"tslib": "^2.1.0",
"typescript": "^4.2.2"
"tslib": "^2.2.0",
"typescript": "4.2.2"
},
"peerDependencies": {
"react": ">=17.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import { SxProp, useComponentStyles } from '../../system';
import { ColorScales } from '../../theme';
import { ChildrenProp, LiteralUnion } from '../../types';
import { ChildrenProp, HTMLAttributes, LiteralUnion } from '../../types';
import { Box } from '../Box';

export type AlertColors = ColorScales;

export interface AlertProps extends ChildrenProp, SxProp {
export interface AlertProps extends HTMLAttributes, ChildrenProp, SxProp {
/** Color of the alert. */
color?: LiteralUnion<AlertColors>;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { HiOutlineUser } from 'react-icons/hi';
import { useImage } from '../../hooks';
import { SxProp, useComponentStyles } from '../../system';
import { ChildrenProp, LiteralUnion } from '../../types';
import { ChildrenProp, HTMLAttributes, LiteralUnion } from '../../types';
import { Box } from '../Box';
import { Text } from '../Text';

Expand Down Expand Up @@ -38,7 +38,7 @@ export type AvatarSizes = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';

export type AvatarVariants = 'circle' | 'rounded' | 'square';

export interface AvatarProps extends ChildrenProp, SxProp {
export interface AvatarProps extends HTMLAttributes, ChildrenProp, SxProp {
/** Function to overwrite getting avatar initials. */
getInitials?: (name: string) => string;
/** The avatars fallback icon when the src is not loaded or specified. */
Expand Down
4 changes: 2 additions & 2 deletions src/components/Avatar/AvatarGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SpaceProps } from '@spicy-ui/styled-system';
import * as React from 'react';
import { SxProp, useComponentStyles } from '../../system';
import { AsProp, ChildrenProp } from '../../types';
import { AsProp, ChildrenProp, HTMLAttributes } from '../../types';
import { Box } from '../Box';
import { AvatarProps } from './Avatar';

export interface AvatarGroupProps extends AsProp, ChildrenProp, SxProp {
export interface AvatarGroupProps extends HTMLAttributes, AsProp, ChildrenProp, SxProp {
/** Border color of all avatars. */
borderColor?: string;
/** Maximum number of avatars to show. */
Expand Down
4 changes: 2 additions & 2 deletions src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as React from 'react';
import { SxProp, useComponentStyles } from '../../system';
import { ColorScales } from '../../theme';
import { AsProp, ChildrenProp, LiteralUnion } from '../../types';
import { AsProp, ChildrenProp, HTMLAttributes, LiteralUnion } from '../../types';
import { Box } from '../Box';

export type BadgeColors = ColorScales;

export type BadgeVariants = 'outline' | 'solid' | 'subtle';

export interface BadgeProps extends AsProp, ChildrenProp, SxProp {
export interface BadgeProps extends HTMLAttributes, AsProp, ChildrenProp, SxProp {
/** Color of the badge. */
color?: LiteralUnion<BadgeColors>;
/** Variant of the badge. */
Expand Down
4 changes: 2 additions & 2 deletions src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { shouldForwardProp } from '@spicy-ui/styled-system';
import styled from 'styled-components';
import { allSystem, AllSystemProps, sxMixin, SxProp } from '../../system';
import { AsProp, ChildrenProp } from '../../types';
import { AsProp, ChildrenProp, HTMLAttributes } from '../../types';

export interface BoxProps extends AsProp, ChildrenProp, AllSystemProps, SxProp {
export interface BoxProps extends HTMLAttributes, AsProp, ChildrenProp, AllSystemProps, SxProp {
color?: any;
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/Code/Code.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as React from 'react';
import { SxProp, useComponentStyles } from '../../system';
import { ColorScales } from '../../theme';
import { AsProp, ChildrenProp, LiteralUnion } from '../../types';
import { AsProp, ChildrenProp, HTMLAttributes, LiteralUnion } from '../../types';
import { Box } from '../Box';

export type CodeColors = ColorScales;

export type CodeVariants = 'outline' | 'solid' | 'subtle';

export interface CodeProps extends AsProp, ChildrenProp, SxProp {
export interface CodeProps extends HTMLAttributes, AsProp, ChildrenProp, SxProp {
/** Color of the code element. */
color?: LiteralUnion<CodeColors>;
/** Variant of the code element. */
Expand Down
4 changes: 2 additions & 2 deletions src/components/Divider/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as React from 'react';
import { SxProp, useComponentStyles } from '../../system';
import { AsProp, LiteralUnion } from '../../types';
import { AsProp, HTMLAttributes, LiteralUnion } from '../../types';
import { Box } from '../Box';

export type DividerOrientation = 'horizontal' | 'vertical';

export interface DividerProps extends AsProp, SxProp {
export interface DividerProps extends HTMLAttributes, AsProp, SxProp {
/** Orientation of the divider. */
orientation?: LiteralUnion<DividerOrientation>;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Flex/Flex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components';
import { allSystem, sxMixin } from '../../system';
import { BoxProps } from '../Box';

export interface FlexProps extends BoxProps, ExtendedFlexboxProps {}
export interface FlexProps extends Omit<BoxProps, 'wrap'>, ExtendedFlexboxProps {}

export const Flex = styled.div.withConfig<FlexProps>({ shouldForwardProp })(sxMixin, allSystem, extendedFlexbox);

Expand Down
4 changes: 2 additions & 2 deletions src/components/Heading/Heading.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Meta, Story } from '@storybook/react';
import * as React from 'react';
import { uid } from 'react-uid';
import { Stack, Heading, HeadingProps } from '..';
import { Heading, HeadingProps, Stack } from '..';

const headingVariants = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
const headingVariants = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'inherit'];

export default {
title: 'Heading',
Expand Down
6 changes: 3 additions & 3 deletions src/components/Heading/Heading.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { shouldForwardProp } from '@spicy-ui/styled-system';
import styled from 'styled-components';
import { allSystem, AllSystemProps, componentStylesMixin, sxMixin, SxProp } from '../../system';
import { AsProp, ChildrenProp, LiteralUnion } from '../../types';
import { AsProp, ChildrenProp, HTMLAttributes, LiteralUnion } from '../../types';

export type HeadingVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
export type HeadingVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'inherit';

export interface HeadingProps extends AsProp, ChildrenProp, AllSystemProps, SxProp {
export interface HeadingProps extends HTMLAttributes, AsProp, ChildrenProp, AllSystemProps, SxProp {
color?: string;
/** Variant of the heading. */
variant?: LiteralUnion<HeadingVariant>;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Kbd/Kbd.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as React from 'react';
import { SxProp, useComponentStyles } from '../../system';
import { AsProp, ChildrenProp } from '../../types';
import { AsProp, ChildrenProp, HTMLAttributes } from '../../types';
import { Box } from '../Box';

export interface KbdProps extends AsProp, ChildrenProp, SxProp {}
export interface KbdProps extends HTMLAttributes, AsProp, ChildrenProp, SxProp {}

export const Kbd = React.forwardRef<HTMLElement, KbdProps>((props, ref) => {
const { as, children, sx, ...rest } = props;
Expand Down
13 changes: 12 additions & 1 deletion src/components/Menu/Menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ export const Usage: Story<MenuProps> = (props) => (
</Box>
);

export const OpenOnHover: Story<MenuProps> = (props) => (
<Box h={56}>
<Menu {...props} openOnHover trigger={<Button iconAfter={<HiChevronDown />}>Open</Button>}>
<MenuItem onClick={action('view')}>View</MenuItem>
<MenuItem onClick={action('share')}>Share</MenuItem>
<MenuItem onClick={action('download')}>Download</MenuItem>
<MenuItem onClick={action('delete')}>Delete</MenuItem>
</Menu>
</Box>
);

export const Dividers: Story<MenuProps> = (props) => (
<Menu {...props} trigger={<Button iconAfter={<HiChevronDown />}>Actions</Button>}>
<MenuItem onClick={action('cut')}>Cut</MenuItem>
Expand Down Expand Up @@ -50,7 +61,7 @@ export const Headers: Story<MenuProps> = (props) => (

export const InternalState: Story<MenuProps> = (props) => (
<Menu {...props} trigger={({ isOpen }) => <Button iconAfter={<HiChevronDown />}>{isOpen ? 'Close' : 'Open'}</Button>}>
{(p) => <pre>{JSON.stringify(p)}</pre>}
{({ isOpen }) => <pre>{JSON.stringify({ isOpen })}</pre>}
</Menu>
);

Expand Down
Loading

1 comment on commit b18e4be

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Netlify deployed spicy-ui as draft

https://60bf30333c34fe1967a3a9b1--spicy-ui.netlify.app

Please sign in to comment.