Skip to content

Commit

Permalink
feat: final
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsimao committed Mar 8, 2024
1 parent 772967c commit b20156e
Show file tree
Hide file tree
Showing 181 changed files with 823 additions and 1,395 deletions.
4 changes: 2 additions & 2 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import React from 'react';

import { InterlayUIProvider } from '../packages/core/system/src';
import { CSSReset } from '../packages/components/src';
import '../packages/core/theme/src/css/theme.interlay.css';
import { bobTheme } from '../packages/core/themeV2/src';
import '../packages/core/theme/src/temp/css/theme.interlay.css';
import { bobTheme } from '../packages/core/theme/src';
import './style.css';

const preview: Preview = {
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ function App({ children }) {
2. Now you can start using components like so!:

```jsx
import { CTA } from '@interlay/ui';
import { Button } from '@interlay/ui';

function Example() {
return <CTA>I am using Interlay UI</CTA>;
return <Button>I am using Interlay UI</Button>;
}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

### Patch Changes

- [#42](https://github.com/interlay/ui/pull/42) [`4f38fec0481cd7b1134457932dc23a94c9665511`](https://github.com/interlay/ui/commit/4f38fec0481cd7b1134457932dc23a94c9665511) Thanks [@danielsimao](https://github.com/danielsimao)! - refactor(components): Spinner (LoadingSpinner) and CTA
- [#42](https://github.com/interlay/ui/pull/42) [`4f38fec0481cd7b1134457932dc23a94c9665511`](https://github.com/interlay/ui/commit/4f38fec0481cd7b1134457932dc23a94c9665511) Thanks [@danielsimao](https://github.com/danielsimao)! - refactor(components): Spinner (LoadingSpinner) and Button

- [#46](https://github.com/interlay/ui/pull/46) [`95c75c1968cda23b75ff5f7aaaa13d5c4cbe6c0e`](https://github.com/interlay/ui/commit/95c75c1968cda23b75ff5f7aaaa13d5c4cbe6c0e) Thanks [@danielsimao](https://github.com/danielsimao)! - fix(components): Radio and RadioGroup

Expand Down
4 changes: 2 additions & 2 deletions packages/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ function App({ children }) {
2. Now you can start using components like so!:

```jsx
import { CTA } from '@interlay/ui';
import { Button } from '@interlay/ui';

function Example() {
return <CTA>I am using Interlay UI</CTA>;
return <Button>I am using Interlay UI</Button>;
}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@interlay/icons": "workspace:*",
"@interlay/system": "workspace:*",
"@interlay/theme": "workspace:*",
"@interlay/themev2": "workspace:*",
"@interlay/theme": "workspace:*",
"@radix-ui/react-slot": "^1.0.2",
"@react-aria/accordion": "3.0.0-alpha.20",
"@react-aria/breadcrumbs": "^3.5.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Accordion/Accordion.style.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled, { css } from 'styled-components';
import { ChevronDown } from '@interlay/icons';
import { AccordionVariants } from '@interlay/themev2';
import { AccordionVariants } from '@interlay/theme';

import { H3, Span } from '../Text';

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { mergeProps } from '@react-aria/utils';
import { useTreeState } from '@react-stately/tree';
import { forwardRef, HTMLAttributes, Ref } from 'react';
import { useDOMRef } from '@interlay/hooks';
import { AccordionVariants } from '@interlay/themev2';
import { AccordionVariants } from '@interlay/theme';

import { AccordionItem } from './AccordionItem';
import { StyledAccordion } from './Accordion.style';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Accordion/AccordionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { mergeProps } from '@react-aria/utils';
import { TreeState } from '@react-stately/tree';
import { Node } from '@react-types/shared';
import { useRef } from 'react';
import { AccordionVariants } from '@interlay/themev2';
import { AccordionVariants } from '@interlay/theme';

import {
StyledAccordionItemButton,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Alert/Alert.style.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CheckCircle, InformationCircle, Warning } from '@interlay/icons';
import styled, { css } from 'styled-components';
import { AlertStatus } from '@interlay/themev2';
import { AlertStatus } from '@interlay/theme';

import { Flex } from '../Flex';

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AlertStatus } from '@interlay/themev2';
import { AlertStatus } from '@interlay/theme';
import { ForwardRefExoticComponent } from 'react';

import { FlexProps } from '../Flex';
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/Breadcrumbs/BreadcrumbItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const BreadcrumbItem = ({ children, isDisabled, isCurrent, href, ...props }: Bre

const commonProps: Pick<TextLinkProps, 'size' | 'color'> = {
size: 's',
color: isCurrent ? 'secondary' : 'tertiary'
color: isCurrent ? 'light' : 'green-300'
};

return (
Expand All @@ -51,7 +51,7 @@ const BreadcrumbItem = ({ children, isDisabled, isCurrent, href, ...props }: Bre
{children}
</StyledLinkBreadcrumb>
)}
{isCurrent === false && <ChevronRight color='tertiary' size='xs' />}
{isCurrent === false && <ChevronRight color='green-300' size='xs' />}
</Fragment>
);
};
Expand Down
5 changes: 2 additions & 3 deletions packages/components/src/Breadcrumbs/Breadcrumbs.style.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from 'styled-components';
import { theme } from '@interlay/theme';

import { Span } from '../Text';
import { TextLink } from '../TextLink';
Expand Down Expand Up @@ -28,12 +27,12 @@ const StyledListItem = styled.li`
`;

const StyledSpanBreadcrumb = styled(Span)<StyledBreadcrumbProps>`
padding: 0 ${theme.spacing.spacing2};
padding: 0 ${({ theme }) => theme.spacing('s')};
cursor: default;
`;

const StyledLinkBreadcrumb = styled(TextLink)<StyledBreadcrumbProps>`
padding: 0 ${theme.spacing.spacing2};
padding: 0 ${({ theme }) => theme.spacing('s')};
text-decoration: none;
`;

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/Button/Button.style.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ButtonSizes, ButtonVariants } from '@interlay/themev2';
import { ButtonColors } from '@interlay/themev2/src/components';
import { ButtonSizes, ButtonVariants } from '@interlay/theme';
import { ButtonColors } from '@interlay/theme/src/components';
import styled, { css } from 'styled-components';

import { UnstyledButton } from '../UnstyledButton';
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useFocusRing } from '@react-aria/focus';
import { mergeProps } from '@react-aria/utils';
import { PressEvent } from '@react-types/shared';
import { ButtonHTMLAttributes, forwardRef } from 'react';
import { ButtonVariants, ButtonSizes, ButtonColors, SpinnerSizes, SpinnerColors } from '@interlay/themev2';
import { ButtonVariants, ButtonSizes, ButtonColors, SpinnerSizes, SpinnerColors } from '@interlay/theme';
import { Slottable } from '@radix-ui/react-slot';

import { Flex } from '../Flex';
Expand Down
10 changes: 5 additions & 5 deletions packages/components/src/Button/__tests__/CTA.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ import { render } from '@testing-library/react';
import { createRef } from 'react';
import { testA11y } from '@interlay/test-utils';

import { CTA } from '..';
import { Button } from '..';

describe('CTA', () => {
describe('Button', () => {
it('should render correctly', () => {
const wrapper = render(<CTA>Button</CTA>);
const wrapper = render(<Button>Button</Button>);

expect(() => wrapper.unmount()).not.toThrow();
});

it('ref should be forwarded', () => {
const ref = createRef<HTMLButtonElement>();

render(<CTA ref={ref}>Button</CTA>);
render(<Button ref={ref}>Button</Button>);

expect(ref.current).not.toBeNull();
});

it('should pass a11y', async () => {
await testA11y(<CTA>Button</CTA>);
await testA11y(<Button>Button</Button>);
});
});
62 changes: 0 additions & 62 deletions packages/components/src/CTA/BaseCTA.tsx

This file was deleted.

80 changes: 0 additions & 80 deletions packages/components/src/CTA/CTA.stories.tsx

This file was deleted.

Loading

0 comments on commit b20156e

Please sign in to comment.