Skip to content

Commit

Permalink
updated deps
Browse files Browse the repository at this point in the history
  • Loading branch information
adammockor committed Sep 28, 2021
1 parent 32b25f8 commit d444729
Show file tree
Hide file tree
Showing 41 changed files with 4,667 additions and 8,569 deletions.
11 changes: 11 additions & 0 deletions .changeset/dry-cycles-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"components": minor
"design-system": minor
"example": minor
"example-wordpress": minor
"@lighting-beetle/lighter-hooks": minor
"@lighting-beetle/lighter-styleguide": minor
"@lighting-beetle/next-lighter-config": minor
---

Updated deps
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run pre-commit
68 changes: 34 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,52 +27,52 @@
"test": "npm-run-all test:*",
"test:components": "yarn --cwd packages/components test",
"test:hooks": "yarn --cwd packages/lighter-hooks test",
"lint": "eslint ."
"lint": "eslint .",
"prepare": "husky install",
"pre-commit": "tsc --noEmit && lint-staged && yarn test"
},
"dependencies": {
"react": "~16.14.0",
"react-dom": "~16.14.0"
"react": "~17.0.2",
"react-dom": "~17.0.2"
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@changesets/cli": "^2.11.2",
"@testing-library/dom": "~7.26.3",
"@testing-library/jest-dom": "~5.11.5",
"@testing-library/react": "~11.1.2",
"@testing-library/react-hooks": "^3.7.0",
"@testing-library/user-event": "^12.6.2",
"@types/jest": "^26.0.19",
"@types/node": "~14.14.6",
"@types/react": "~16.9.55",
"@types/react-dom": "~16.9.9",
"@typescript-eslint/eslint-plugin": "~4.6.0",
"@typescript-eslint/parser": "~4.6.0",
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.15.0",
"@changesets/cli": "^2.17.0",
"@testing-library/dom": "~8.6.0",
"@testing-library/jest-dom": "~5.14.1",
"@testing-library/react": "~12.1.1",
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "^27.0.2",
"@types/node": "~16.10.1",
"@types/react": "~17.0.24",
"@types/react-dom": "~17.0.9",
"@typescript-eslint/eslint-plugin": "~4.32.0",
"@typescript-eslint/parser": "~4.32.0",
"babel-eslint": "~10.1.0",
"babel-jest": "~26.6.1",
"cheerio": "~1.0.0-rc.3",
"babel-jest": "~27.2.3",
"cheerio": "~1.0.0-rc.10",
"cross-spawn": "~7.0.3",
"eslint": "~7.12.1",
"eslint": "~7.32.0",
"eslint-config-react-app": "~6.0.0",
"eslint-plugin-flowtype": "~5.2.0",
"eslint-plugin-import": "~2.22.1",
"eslint-plugin-flowtype": "~6.1.0",
"eslint-plugin-import": "~2.24.2",
"eslint-plugin-jsx-a11y": "~6.4.1",
"eslint-plugin-react": "~7.21.5",
"eslint-plugin-react": "~7.26.0",
"eslint-plugin-react-hooks": "~4.2.0",
"get-port": "~5.1.1",
"husky": "~4.3.0",
"jest-cli": "~26.6.1",
"lint-staged": "~10.5.0",
"node-fetch": "~2.6.1",
"husky": "~7.0.2",
"jest-cli": "~27.2.3",
"lint-staged": "~11.1.2",
"node-fetch": "~3.0.0",
"npm-run-all": "^4.1.5",
"prettier": "~2.2.1",
"prettier": "~2.4.1",
"tree-kill": "~1.2.2",
"ts-jest": "^26.4.4",
"typescript": "~4.1.3"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"ts-jest": "^27.0.5",
"typescript": "~4.4.3"
},
"lint-staged": {
"*.{js,ts,tsx}": [
Expand Down
18 changes: 9 additions & 9 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
"dependencies": {
"@lighting-beetle/lighter-hooks": "1.0.0",
"@lighting-beetle/lighter-styleguide": "5.0.0-beta.1",
"classnames": "^2.2.6",
"downshift": "^6.1.0",
"polished": "^4.0.5",
"preact": "~10.5.11",
"preact-render-to-string": "~5.1.12"
"classnames": "^2.3.1",
"downshift": "^6.1.7",
"polished": "^4.1.3",
"preact": "~10.5.14",
"preact-render-to-string": "~5.1.19"
},
"browserslist": ">1%, not ie 11, not op_mini all",
"devDependencies": {
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"microbundle": "^0.13.0",
"jest": "^27.2.3",
"microbundle": "^0.13.3",
"npm-run-all": "^4.1.5",
"sass": "~1.30.0",
"svg-sprite": "~1.5.0"
"sass": "~1.42.1",
"svg-sprite": "~1.5.2"
}
}
10 changes: 5 additions & 5 deletions packages/components/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import cx from "classnames";
import "./styles/style.scss";

type ButtonProps = JSX.IntrinsicElements["button"] & {
type ButtonProps = {
/** Button with same width as height */
square?: boolean;
/** Link with href attribute rendered visually as button. */
Expand All @@ -12,12 +12,12 @@ type ButtonProps = JSX.IntrinsicElements["button"] & {
/** Disabled state */
isDisabled?: boolean;
/** Button size */
size?: "s" | "l";
size?: 's' | 'l';
/** Visual variant of the button. Undefined means */
variant?: "plain";
variant?: 'plain';
/** Purpose of the button. Default means CTA button. */
purpose?: "secondary" | "link";
};
purpose?: 'secondary' | 'link';
} & (React.ComponentProps<'button'> | React.ComponentProps<'a'>);

export const Button = ({
className,
Expand Down
76 changes: 40 additions & 36 deletions packages/components/src/components/Icon/Icon.test.tsx
Original file line number Diff line number Diff line change
@@ -1,86 +1,90 @@
import * as React from "react";
import { render, screen } from "@testing-library/react";
import "@testing-library/jest-dom/extend-expect";
import Icon, { IconProvider } from ".";
/**
* @jest-environment jsdom
*/

describe("Icon", () => {
it("render SVG", () => {
import * as React from 'react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import Icon, { IconProvider } from '.';

describe('Icon', () => {
it('render SVG', () => {
render(<Icon name="home" />);

const icon = screen.getByTitle("home").parentNode;
const icon = screen.getByTitle('home').parentNode;

expect(icon).toBeInTheDocument();
expect(icon).toHaveClass("icon", "icon--home");
expect(icon.querySelector("use")).toHaveAttribute(
"xlink:href",
"/icons-sprite.svg#home"
expect(icon).toHaveClass('icon', 'icon--home');
expect(icon.querySelector('use')).toHaveAttribute(
'xlink:href',
'/icons-sprite.svg#home'
);
});

it("render decorative SVG", () => {
it('render decorative SVG', () => {
render(<Icon name="home" />);

const icon = screen.getByTitle("home").parentNode;
const icon = screen.getByTitle('home').parentNode;

expect(icon).toHaveAttribute("aria-hidden", "true");
expect(icon).toHaveAttribute('aria-hidden', 'true');
});

it("render meaningful SVG", () => {
it('render meaningful SVG', () => {
render(<Icon name="home" alt="This is home icon" />);

expect(screen.getByRole("img")).toBeInTheDocument();
expect(screen.getByTitle("This is home icon")).toBeInTheDocument();
expect(screen.getByRole('img')).toBeInTheDocument();
expect(screen.getByTitle('This is home icon')).toBeInTheDocument();
});

it("render in correct size", () => {
it('render in correct size', () => {
render(<Icon name="home" size="l" />);

const icon = screen.getByTitle("home").parentNode;
const icon = screen.getByTitle('home').parentNode;

expect(icon).toHaveClass("icon--l");
expect(icon).toHaveClass('icon--l');
});

it("render custom sprite path", () => {
it('render custom sprite path', () => {
render(<Icon name="home" spritePath="/sprite.svg" />);

const icon = screen.getByTitle("home").parentNode;
const icon = screen.getByTitle('home').parentNode;

expect(icon.querySelector("use")).toHaveAttribute(
"xlink:href",
"/sprite.svg#home"
expect(icon.querySelector('use')).toHaveAttribute(
'xlink:href',
'/sprite.svg#home'
);
});

it("render custom class", () => {
it('render custom class', () => {
render(<Icon name="home" className="test" />);

const icon = screen.getByTitle("home").parentNode;
const icon = screen.getByTitle('home').parentNode;

expect(icon).toHaveClass("test");
expect(icon).toHaveClass('test');
});

it("render custom attribute", () => {
it('render custom attribute', () => {
render(<Icon name="home" data-testid="test" />);

const icon = screen.getByTestId("test");
const icon = screen.getByTestId('test');

expect(icon).toBeInTheDocument();
});
});

describe("IconProivder", () => {
it("render custom sprite path", () => {
describe('IconProivder', () => {
it('render custom sprite path', () => {
render(
<IconProvider spritePath="/sprite.svg">
<Icon name="home" />
</IconProvider>
);

const icon = screen.getByTitle("home").parentNode;
const icon = screen.getByTitle('home').parentNode;

expect(icon.querySelector("use")).toHaveAttribute(
"xlink:href",
"/sprite.svg#home"
expect(icon.querySelector('use')).toHaveAttribute(
'xlink:href',
'/sprite.svg#home'
);
});
});
Loading

0 comments on commit d444729

Please sign in to comment.