Skip to content

Commit

Permalink
refactor(format): 🎨 update path and improve format
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Sep 2, 2021
1 parent 09d84e4 commit e0b3140
Show file tree
Hide file tree
Showing 66 changed files with 364 additions and 399 deletions.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"orta.vscode-jest",
"tlent.jest-snapshot-language-support"
"tlent.jest-snapshot-language-support",
"vespa-dev-works.jestrunit"
]
}
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,19 @@
"@testing-library/dom": "^8.0.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/react-hooks": "^7.0.1",
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "27.0.1",
"@types/jest-axe": "3.5.2",
"@types/jest-in-case": "1.0.5",
"@types/mockdate": "^3.0.0",
"@types/node": "^16.7.6",
"@types/node": "^16.7.10",
"@types/react": "17.0.19",
"@types/react-dom": "17.0.9",
"@types/react-transition-group": "4.4.2",
"@types/testing-library__jest-dom": "5.14.1",
"@typescript-eslint/eslint-plugin": "4.29.3",
"@typescript-eslint/parser": "4.29.3",
"@typescript-eslint/eslint-plugin": "4.30.0",
"@typescript-eslint/parser": "4.30.0",
"all-contributors-cli": "^6.20.0",
"ast-to-markdown": "^1.0.0",
"autoprefixer": "^10.3.3",
Expand All @@ -155,22 +155,22 @@
"eslint": "7.32.0",
"eslint-config-prettier": "8.3.0",
"eslint-config-react-app": "6.0.0",
"eslint-plugin-flowtype": "5.9.1",
"eslint-plugin-flowtype": "5.9.2",
"eslint-plugin-import": "2.24.2",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-prettier": "3.4.1",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-react": "7.25.1",
"eslint-plugin-react-hooks": "4.2.0",
"gacp": "2.10.2",
"glob": "^7.1.7",
"glob-fs": "^0.1.7",
"husky": "^7.0.2",
"jest": "27.1.0",
"jest-axe": "5.0.1",
"jest-in-case": "1.0.2",
"jest-matcher-utils": "27.1.0",
"lint-staged": "11.1.2",
"lodash": "4.17.21",
"jest": "^27.1.0",
"jest-axe": "^5.0.1",
"jest-in-case": "^1.0.2",
"jest-matcher-utils": "^27.1.0",
"lint-staged": "^11.1.2",
"lodash": "^4.17.21",
"markdown-to-ast": "^6.0.3",
"markdown-toc": "^1.2.0",
"md-node-inject": "^1.0.1",
Expand All @@ -181,26 +181,26 @@
"postcss": "^8.3.6",
"postcss-import": "^14.0.2",
"postcss-scopify": "^0.1.9",
"prettier": "2.2.1",
"prettier": "2.3.2",
"raw-loader": "^4.0.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hook-form": "7.14.1",
"react-test-renderer": "17.0.2",
"react-transition-group": "4.4.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-hook-form": "^7.14.2",
"react-test-renderer": "^17.0.2",
"react-transition-group": "^4.4.2",
"react-virtual": "^2.8.1",
"reakit": "1.3.8",
"reakit": "^1.3.8",
"reakit-test-utils": "^0.15.1",
"release-it": "^14.11.5",
"rimraf": "3.0.2",
"rimraf": "^3.0.2",
"sort-package-json": "^1.50.0",
"storybook-addon-preview": "^2.1.2",
"strip-comments": "^2.0.1",
"tailwindcss": "^2.2.9",
"ts-jest": "^27.0.5",
"ts-morph": "^12.0.0",
"ts-node": "^10.2.1",
"typescript": "4.4.2",
"typescript": "^4.4.2",
"webpack": "^5.51.1",
"yaml": "^1.10.2"
},
Expand Down
5 changes: 2 additions & 3 deletions scripts/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ function getPublicFiles(rootPath, prefix = "") {
isDirectory(path) && getPublicFiles(path, join(prefix, filename));
return {
...(childFiles || {
[removeExt(normalizePath(join(prefix, filename)))]: normalizePath(
path,
),
[removeExt(normalizePath(join(prefix, filename)))]:
normalizePath(path),
}),
...acc,
};
Expand Down
7 changes: 4 additions & 3 deletions src/accordion/AccordionTrigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ export const useAccordionTrigger = createHook<
select?.(id);
}, [id, select]);

const onClick = React.useCallback(() => handleSelection(), [
handleSelection,
]);
const onClick = React.useCallback(
() => handleSelection(),
[handleSelection],
);

const onFocus = React.useCallback(() => {
if (manual) return;
Expand Down
2 changes: 1 addition & 1 deletion src/accordion/stories/AccordionBasic.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
AccordionPanel,
AccordionTrigger,
useAccordionState,
} from "../index";
} from "../../index";

export function App(props: any) {
const state = useAccordionState(props);
Expand Down
2 changes: 1 addition & 1 deletion src/accordion/stories/AccordionMulti.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
AccordionPanel,
AccordionTrigger,
useAccordionMultiState,
} from "../index";
} from "../../index";

export function App(props: any) {
const state = useAccordionMultiState(props);
Expand Down
2 changes: 1 addition & 1 deletion src/accordion/stories/AccordionStyled.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
AccordionTrigger,
useAccordionState,
AccordionInitialState,
} from "../index";
} from "../../index";

// Styled based on https://www.w3.org/TR/wai-aria-practices-1.2/examples/accordion/accordion.html
export const App: React.FC<AccordionInitialState> = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/accordion/stories/AccordionZAuto.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
AccordionPanel,
AccordionTrigger,
useAccordionState,
} from "../index";
} from "../../index";

export function App(props: any) {
const initialProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/breadcrumbs/stories/Breadcrumbs.component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";

import { Breadcrumbs, BreadcrumbLink } from "../index";
import { Breadcrumbs, BreadcrumbLink } from "../../index";

export const App: React.FC = props => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/calendar/stories/CalendarBase.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
CalendarHeader,
CalendarWeekTitle,
CalendarInitialState,
} from "../index";
} from "../../index";

import {
ChevronLeft,
Expand Down
2 changes: 1 addition & 1 deletion src/calendar/stories/CalendarRange.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
CalendarWeekTitle,
useRangeCalendarState,
RangeCalendarInitialState,
} from "../index";
} from "../../index";

import {
ChevronLeft,
Expand Down
10 changes: 5 additions & 5 deletions src/checkbox/stories/Checkbox.component.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from "react";

import {
Checkbox as RenderlesskitCheckbox,
CheckboxProps as RenderlesskitCheckboxProps,
useCheckboxState,
CheckboxInitialState,
} from "../index";
import { splitStateProps } from "../../utils/index";
import { USE_CHECKBOX_STATE_KEYS } from "../__keys";
Checkbox as RenderlesskitCheckbox,
CheckboxProps as RenderlesskitCheckboxProps,
USE_CHECKBOX_STATE_KEYS,
splitStateProps,
} from "../../index";

export type CheckboxProps = RenderlesskitCheckboxProps &
CheckboxInitialState & {};
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/stories/DatePickerBase.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useDatePickerState,
DatePickerSegmentField,
DatePickerInitialState,
} from "../index";
} from "../../index";
import {
Calendar as CalendarWrapper,
CalendarButton,
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/stories/DatePickerRange.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
DatePickerSegmentField,
useDateRangePickerState,
DateRangePickerInitialState,
} from "../index";
} from "../../index";
import {
Calendar,
CalendarCell,
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/stories/styled/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
CalendarCellButton,
CalendarStateReturn,
Calendar as CalendarWrapper,
} from "../../../calendar/index";
} from "../../../index";

import {
ChevronLeft,
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/stories/styled/DatePicker.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
DatePickerSegmentField,
DatePickerInitialState,
DatePicker as DatePickerWrapper,
} from "../../index";
} from "../../../index";
import { Calendar, CalendarIcon } from "./Calendar";

export const DatePicker: React.FC<DatePickerInitialState> = props => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
DatePicker as DatePickerWrapper,
useDateRangePickerState,
DateRangePickerInitialState,
} from "../../index";
} from "../../../index";
import { Calendar, CalendarIcon } from "./Calendar";

export const RangeDatePicker: React.FC<DateRangePickerInitialState> = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/drawer/stories/Drawer.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
DrawerBackdrop,
DrawerCloseButton,
DrawerDisclosure,
} from "../index";
} from "../../index";

export const App = () => {
const dialog = useDrawerState({ animated: true });
Expand Down
2 changes: 1 addition & 1 deletion src/link/stories/Link.component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";

import { Link } from "../index";
import { Link } from "../../index";

export interface AppProps {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/meter/stories/MeterBasic.component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";

import { Meter, useMeterState, MeterInitialState } from "../index";
import { Meter, useMeterState, MeterInitialState } from "../../index";

export const App: React.FC<MeterInitialState> = props => {
const state = useMeterState(props);
Expand Down
2 changes: 1 addition & 1 deletion src/meter/stories/MeterStyled.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useMeterState,
MeterStateReturn,
MeterInitialState,
} from "../index";
} from "../../index";

export interface AppProps extends MeterInitialState {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/number-input/NumberInputDecrementButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export type NumberInputDecrementButtonOptions = ButtonOptions &

export type NumberInputDecrementButtonHTMLProps = ButtonHTMLProps;

export type NumberInputDecrementButtonProps = NumberInputDecrementButtonOptions &
NumberInputDecrementButtonHTMLProps;
export type NumberInputDecrementButtonProps =
NumberInputDecrementButtonOptions & NumberInputDecrementButtonHTMLProps;

export const useNumberInputDecrementButton = createHook<
NumberInputDecrementButtonOptions,
Expand Down
4 changes: 2 additions & 2 deletions src/number-input/NumberInputIncrementButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export type NumberInputIncrementButtonOptions = ButtonOptions &

export type NumberInputIncrementButtonHTMLProps = ButtonHTMLProps;

export type NumberInputIncrementButtonProps = NumberInputIncrementButtonOptions &
NumberInputIncrementButtonHTMLProps;
export type NumberInputIncrementButtonProps =
NumberInputIncrementButtonOptions & NumberInputIncrementButtonHTMLProps;

export const useNumberInputIncrementButton = createHook<
NumberInputIncrementButtonOptions,
Expand Down
3 changes: 2 additions & 1 deletion src/number-input/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ export const NUMBER_INPUT_KEYS = [
"allowMouseWheel",
] as const;
export const NUMBER_INPUT_DECREMENT_BUTTON_KEYS = NUMBER_INPUT_STATE_KEYS;
export const NUMBER_INPUT_INCREMENT_BUTTON_KEYS = NUMBER_INPUT_DECREMENT_BUTTON_KEYS;
export const NUMBER_INPUT_INCREMENT_BUTTON_KEYS =
NUMBER_INPUT_DECREMENT_BUTTON_KEYS;
2 changes: 1 addition & 1 deletion src/number-input/stories/NumberInput.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
NumberinputInitialState,
NumberInputDecrementButton,
NumberInputIncrementButton,
} from "../index";
} from "../../index";

export interface AppProps extends NumberinputInitialState {
/**
Expand Down
10 changes: 4 additions & 6 deletions src/pagination/__tests__/PaginationState.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,15 @@ describe("usePaginationState", () => {
});

it("has no ellipses when count <= 7", () => {
const { pages } = renderHook(() =>
usePaginationState({ count: 7 }),
).result.current;
const { pages } = renderHook(() => usePaginationState({ count: 7 })).result
.current;

expect(pages).not.toContain("end-ellipsis");
});

it("should have end-ellipses when count >= 8", () => {
const { pages } = renderHook(() =>
usePaginationState({ count: 8 }),
).result.current;
const { pages } = renderHook(() => usePaginationState({ count: 8 })).result
.current;

expect(pages).toContain("end-ellipsis");
});
Expand Down
2 changes: 1 addition & 1 deletion src/pagination/stories/Pagination.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
usePaginationState,
PaginationInitialState,
TGoto,
} from "../index";
} from "../../index";

export const App: React.FC<PaginationInitialState> = props => {
const state = usePaginationState({ count: 10, ...props });
Expand Down
2 changes: 1 addition & 1 deletion src/picker-base/stories/PickerBase.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
PickerBaseContent,
usePickerBaseState,
PickerBaseInitialState,
} from "../index";
} from "../../index";

export const App: React.FC<PickerBaseInitialState> = props => {
const state = usePickerBaseState(props);
Expand Down
2 changes: 1 addition & 1 deletion src/progress/stories/CircularProgress.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ProgressState,
useProgressState,
ProgressInitialState,
} from "../index";
} from "../../index";
import { isNull } from "../../utils/index";

export interface AppProps extends ProgressInitialState {
Expand Down
2 changes: 1 addition & 1 deletion src/progress/stories/LinearProgress.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ProgressState,
useProgressState,
ProgressInitialState,
} from "../index";
} from "../../index";
import { cx, isNull } from "../../utils/index";

export interface AppProps extends ProgressInitialState {
Expand Down
2 changes: 1 addition & 1 deletion src/progress/stories/ProgressBasic.component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";

import { Progress, useProgressState, ProgressInitialState } from "../index";
import { Progress, useProgressState, ProgressInitialState } from "../../index";

export const App: React.FC<ProgressInitialState> = props => {
const state = useProgressState(props);
Expand Down
Loading

0 comments on commit e0b3140

Please sign in to comment.