Skip to content

Commit

Permalink
feat(createComponent): ✨ add __displayname for UI library
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Jan 4, 2022
1 parent 5779e7e commit 1ada1e2
Show file tree
Hide file tree
Showing 66 changed files with 285 additions and 67 deletions.
4 changes: 3 additions & 1 deletion src/accordion/Accordion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { CompositeHTMLProps, CompositeOptions, useComposite } from "reakit";

import { createComponent } from "../system";

import { ACCORDION_KEYS } from "./__keys";

export const useAccordion = createHook<AccordionOptions, AccordionHTMLProps>({
Expand Down
4 changes: 3 additions & 1 deletion src/accordion/AccordionPanel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import {
DisclosureContentHTMLProps,
DisclosureContentOptions,
Expand All @@ -10,6 +10,8 @@ import {
} from "reakit";
import { useForkRef } from "reakit-utils";

import { createComponent } from "../system";

import { ACCORDION_PANEL_KEYS } from "./__keys";
import { AccordionMultiStateReturn } from "./AccordionMultiState";
import { AccordionStateReturn } from "./AccordionState";
Expand Down
3 changes: 2 additions & 1 deletion src/accordion/AccordionTrigger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import {
ButtonHTMLProps,
ButtonOptions,
Expand All @@ -10,6 +10,7 @@ import {
} from "reakit";
import { callAllHandlers } from "@chakra-ui/utils";

import { createComponent } from "../system";
import { ariaAttr } from "../utils";

import { ACCORDION_TRIGGER_KEYS } from "./__keys";
Expand Down
3 changes: 2 additions & 1 deletion src/breadcrumbs/BreadcrumbLink.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";

import { LinkHTMLProps, LinkOptions, useLink } from "../link";
import { createComponent } from "../system";

import { BREADCRUMB_LINK_KEYS } from "./__keys";

Expand Down
4 changes: 3 additions & 1 deletion src/calendar/Calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
* We improved the Calendar from Aria [useCalendarBase](https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/calendar/src/useCalendarBase.ts)
* to work with Reakit System
*/
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { RoleHTMLProps, RoleOptions, useRole } from "reakit";

import { createComponent } from "../system";

import { CALENDAR_KEYS } from "./__keys";
import { CalendarStateReturn } from "./CalendarState";

Expand Down
4 changes: 3 additions & 1 deletion src/calendar/CalendarButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
* We improved the Calendar from Aria [useCalendarBase](https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/calendar/src/useCalendarBase.ts)
* to work with Reakit System
*/
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { ButtonHTMLProps, ButtonOptions, useButton } from "reakit";
import { callAllHandlers } from "@chakra-ui/utils";

import { createComponent } from "../system";

import { CALENDAR_BUTTON_KEYS } from "./__keys";
import { CalendarStateReturn } from "./CalendarState";

Expand Down
3 changes: 2 additions & 1 deletion src/calendar/CalendarCell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
* to work with Reakit System
*/
import { useCallback } from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { RoleHTMLProps, RoleOptions, useRole } from "reakit";
import { callAllHandlers } from "@chakra-ui/utils";

import { createComponent } from "../system";
import {
ariaAttr,
dataAttr,
Expand Down
3 changes: 2 additions & 1 deletion src/calendar/CalendarCellButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
* to work with Reakit System
*/
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { ButtonHTMLProps, ButtonOptions, useButton } from "reakit";
import { ensureFocus, useForkRef } from "reakit-utils";
import { callAllHandlers } from "@chakra-ui/utils";
import { useDateFormatter } from "@react-aria/i18n";

import { createComponent } from "../system";
import { isSameDay } from "../utils";

import { CALENDAR_CELL_BUTTON_KEYS } from "./__keys";
Expand Down
3 changes: 2 additions & 1 deletion src/calendar/CalendarGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
* to work with Reakit System
*/
import { KeyboardEvent, useRef } from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { RoleHTMLProps, RoleOptions, useRole } from "reakit";
import { createOnKeyDown, useForkRef } from "reakit-utils";
import { callAllHandlers } from "@chakra-ui/utils";
import { chain } from "@react-aria/utils";

import { createComponent } from "../system";
import { ariaAttr } from "../utils";

import { CALENDAR_GRID_KEYS } from "./__keys";
Expand Down
4 changes: 3 additions & 1 deletion src/calendar/CalendarHeader.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { RoleHTMLProps, RoleOptions, useRole } from "reakit";
import { useDateFormatter } from "@react-aria/i18n";

import { createComponent } from "../system";

import { CALENDAR_HEADER_KEYS } from "./__keys";
import { CalendarStateReturn } from "./CalendarState";

Expand Down
4 changes: 3 additions & 1 deletion src/calendar/CalendarWeekTitle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { RoleHTMLProps, RoleOptions, useRole } from "reakit";

import { createComponent } from "../system";

import { CALENDAR_WEEK_TITLE_KEYS } from "./__keys";
import { CalendarStateReturn } from "./CalendarState";

Expand Down
4 changes: 3 additions & 1 deletion src/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { ClickableHTMLProps, ClickableOptions, useClickable } from "reakit";
import { removeIndexFromArray, useForkRef, useLiveRef } from "reakit-utils";
import { warning } from "reakit-warning";

import { createComponent } from "../system";

import { CHECKBOX_KEYS } from "./__keys";
import { CheckboxStateReturn } from "./CheckboxState";
import { fireChange, getChecked, useIndeterminateState } from "./helpers";
Expand Down
3 changes: 2 additions & 1 deletion src/datepicker/DatePicker.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";

import {
PickerBaseHTMLProps,
PickerBaseOptions,
usePickerBase,
} from "../picker-base";
import { createComponent } from "../system";
import { ariaAttr } from "../utils";

import { DATE_PICKER_KEYS } from "./__keys";
Expand Down
3 changes: 2 additions & 1 deletion src/datepicker/DatePickerContent.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";

import {
PickerBaseHTMLProps,
PickerBaseOptions,
usePickerBaseContent,
} from "../picker-base";
import { createComponent } from "../system";

import { DATE_PICKER_CONTENT_KEYS } from "./__keys";

Expand Down
3 changes: 2 additions & 1 deletion src/datepicker/DatePickerSegment.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { unstable_useId as useId } from "reakit";

import { SegmentHTMLProps, SegmentOptions, useSegment } from "../segment";
import { createComponent } from "../system";

import { DATE_PICKER_SEGMENT_KEYS } from "./__keys";
import { DatePickerStateReturn } from ".";
Expand Down
3 changes: 2 additions & 1 deletion src/datepicker/DatePickerSegmentField.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";

import {
SegmentFieldHTMLProps,
SegmentFieldOptions,
useSegmentField,
} from "../segment";
import { createComponent } from "../system";

import { DATE_PICKER_SEGMENT_FIELD_KEYS } from "./__keys";
import { DatePickerStateReturn } from "./DatePickerState";
Expand Down
3 changes: 2 additions & 1 deletion src/datepicker/DatePickerTrigger.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";

import {
PickerBaseTriggerHTMLProps,
PickerBaseTriggerOptions,
usePickerBaseTrigger,
} from "../picker-base";
import { createComponent } from "../system";

import { DATE_PICKER_TRIGGER_KEYS } from "./__keys";

Expand Down
3 changes: 2 additions & 1 deletion src/dialog/DialogBackdrop.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import * as React from "react";
import { RemoveScroll } from "react-remove-scroll";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { Portal } from "reakit";

import {
DisclosureContentHTMLProps,
DisclosureContentOptions,
useDisclosureContent,
} from "../disclosure/DisclosureContent";
import { createComponent } from "../system";

import { DIALOG_BACKDROP_KEYS } from "./__keys";
import { DialogStateReturn } from "./DialogState";
Expand Down
3 changes: 2 additions & 1 deletion src/dialog/DialogDisclosure.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { useForkRef, useLiveRef } from "reakit-utils";
import { warning } from "reakit-warning";
import { useSafeLayoutEffect } from "@chakra-ui/hooks";
Expand All @@ -9,6 +9,7 @@ import {
DisclosureOptions,
useDisclosure,
} from "../disclosure";
import { createComponent } from "../system";

import { DIALOG_DISCLOSURE_KEYS } from "./__keys";
import { DialogStateReturn } from "./DialogState";
Expand Down
3 changes: 2 additions & 1 deletion src/drawer/Drawer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";

import { DialogHTMLProps, DialogOptions, useDialog } from "../dialog";
import { createComponent } from "../system";

import { DRAWER_KEYS } from "./__keys";

Expand Down
3 changes: 2 additions & 1 deletion src/drawer/DrawerBackdrop.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";

import {
DialogBackdropHTMLProps,
DialogBackdropOptions,
useDialogBackdrop,
} from "../dialog";
import { createComponent } from "../system";

import { DRAWER_BACKDROP_KEYS } from "./__keys";

Expand Down
3 changes: 2 additions & 1 deletion src/drawer/DrawerDisclosure.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";

import {
DialogDisclosureHTMLProps,
DialogDisclosureOptions,
useDialogDisclosure,
} from "../dialog";
import { createComponent } from "../system";

import { DRAWER_DISCLOSURE_KEYS } from "./__keys";

Expand Down
4 changes: 3 additions & 1 deletion src/link/Link.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { ClickableHTMLProps, ClickableOptions, useClickable } from "reakit";
import { useForkRef } from "reakit-utils";
import { useWarning } from "reakit-warning";

import { createComponent } from "../system";

import { LINK_KEYS } from "./__keys";

export type LinkOptions = ClickableOptions & {
Expand Down
3 changes: 2 additions & 1 deletion src/number-input/NumberInput.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { InputHTMLProps, InputOptions, useInput } from "reakit";
import { EventKeyMap, mergeRefs } from "@chakra-ui/react-utils";
import {
Expand All @@ -8,6 +8,7 @@ import {
StringOrNumber,
} from "@chakra-ui/utils";

import { createComponent } from "../system";
import { ariaAttr } from "../utils";

import { NUMBER_INPUT_KEYS } from "./__keys";
Expand Down
4 changes: 3 additions & 1 deletion src/number-input/NumberInputDecrementButton.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { ButtonHTMLProps, ButtonOptions, useButton } from "reakit";
import { callAllHandlers } from "@chakra-ui/utils";

import { createComponent } from "../system";

import { NUMBER_INPUT_DECREMENT_BUTTON_KEYS } from "./__keys";
import { NumberInputStateReturn } from "./index";

Expand Down
4 changes: 3 additions & 1 deletion src/number-input/NumberInputIncrementButton.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { ButtonHTMLProps, ButtonOptions, useButton } from "reakit";
import { callAllHandlers } from "@chakra-ui/utils";

import { createComponent } from "../system";

import { NUMBER_INPUT_INCREMENT_BUTTON_KEYS } from "./__keys";
import { NumberInputStateReturn } from "./index";

Expand Down
4 changes: 3 additions & 1 deletion src/pagination/PaginationButton.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { ButtonHTMLProps, ButtonOptions, useButton } from "reakit";
import { callAllHandlers, isNumber } from "@chakra-ui/utils";

import { createComponent } from "../system";

import { PAGINATION_BUTTON_KEYS } from "./__keys";
import { PaginationStateReturn } from "./PaginationState";

Expand Down
3 changes: 2 additions & 1 deletion src/picker-base/PickerBase.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as React from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { RoleHTMLProps, RoleOptions, useRole } from "reakit";
import { createOnKeyDown } from "reakit-utils";
import { callAllHandlers } from "@chakra-ui/utils";

import { createComponent } from "../system";
import { ariaAttr, isTouch } from "../utils";

import { PICKER_BASE_KEYS } from "./__keys";
Expand Down
4 changes: 3 additions & 1 deletion src/picker-base/PickerBaseContent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { PopoverHTMLProps, PopoverOptions, usePopover } from "reakit";

import { createComponent } from "../system";

import { PICKER_BASE_CONTENT_KEYS } from "./__keys";
import { PickerBaseStateReturn } from "./PickerBaseState";

Expand Down
4 changes: 3 additions & 1 deletion src/picker-base/PickerBaseTrigger.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import {
PopoverDisclosureHTMLProps,
PopoverDisclosureOptions,
usePopoverDisclosure,
} from "reakit";
import { callAllHandlers } from "@chakra-ui/utils";

import { createComponent } from "../system";

import { PICKER_BASE_TRIGGER_KEYS } from "./__keys";
import { PickerBaseStateReturn } from "./PickerBaseState";

Expand Down
4 changes: 3 additions & 1 deletion src/popover/Popover.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { CSSProperties } from "react";
import { createComponent, createHook } from "reakit-system";
import { createHook } from "reakit-system";
import { RoleHTMLProps, RoleOptions, useRole } from "reakit";

import { createComponent } from "../system";

import { POPOVER_KEYS } from "./__keys";
import { PopoverStateReturn } from "./PopoverState";

Expand Down
Loading

0 comments on commit 1ada1e2

Please sign in to comment.