diff --git a/packages/shared/system/src/createComponent.ts b/packages/shared/system/src/createComponent.ts index a080808..217b658 100644 --- a/packages/shared/system/src/createComponent.ts +++ b/packages/shared/system/src/createComponent.ts @@ -3,7 +3,7 @@ import { type ElementType, createElement, } from 'react'; -import forwardRef from './forwardRef'; +import { forwardRef } from './forwardRef'; import { type ComponentWithAs, type DOMElements } from './types'; export type FavolinkComponent = ComponentWithAs< @@ -11,9 +11,7 @@ export type FavolinkComponent = ComponentWithAs< object >; -export default function createComponent( - element: Element, -) { +export function createComponent(element: Element) { const favolinkComponent = forwardRef(function favolinkComponent(props, ref) { const { as: asElement, ...restProps } = props; diff --git a/packages/shared/system/src/createContext.tsx b/packages/shared/system/src/createContext.tsx index 2c7dc57..8e51595 100644 --- a/packages/shared/system/src/createContext.tsx +++ b/packages/shared/system/src/createContext.tsx @@ -15,7 +15,7 @@ type CreateContextReturn = [ Context, ]; -export default function createContext( +export function createContext( defaultValue: CreateContextDefaultValue, ): CreateContextReturn { const Context = createReactContext(defaultValue); diff --git a/packages/shared/system/src/createIcon.tsx b/packages/shared/system/src/createIcon.tsx index a196f1f..a0990ed 100644 --- a/packages/shared/system/src/createIcon.tsx +++ b/packages/shared/system/src/createIcon.tsx @@ -1,8 +1,9 @@ -import { Children, type ComponentPropsWithoutRef, type ReactNode } from 'react'; +import { Children, type ReactNode } from 'react'; +import { type HTMLFavolinkProps } from './createComponent'; import { favolink } from './factory'; -import forwardRef from './forwardRef'; +import { forwardRef } from './forwardRef'; -type IconProps = ComponentPropsWithoutRef<'svg'>; +type IconProps = HTMLFavolinkProps<'svg'>; type CreateIconOptions = { d?: string; @@ -10,7 +11,7 @@ type CreateIconOptions = { defaultProps?: IconProps; }; -export default function createIcon(options: CreateIconOptions) { +export function createIcon(options: CreateIconOptions) { const { d: pathDefinition, path, defaultProps = {} } = options; const { viewBox = '0 0 20 20', ...restDefaultProps } = defaultProps; diff --git a/packages/shared/system/src/factory.ts b/packages/shared/system/src/factory.ts index 66b27bd..0acd028 100644 --- a/packages/shared/system/src/factory.ts +++ b/packages/shared/system/src/factory.ts @@ -1,6 +1,7 @@ -import createComponent, { +import { type FavolinkComponent, type HTMLFavolinkComponents, + createComponent, } from './createComponent'; import { type DOMElements } from './types'; diff --git a/packages/shared/system/src/forwardRef.ts b/packages/shared/system/src/forwardRef.ts index 4a8f1c1..7419af2 100644 --- a/packages/shared/system/src/forwardRef.ts +++ b/packages/shared/system/src/forwardRef.ts @@ -6,10 +6,7 @@ import { } from 'react'; import { type ComponentWithAs, type RightJoinProps } from './types'; -export default function forwardRef< - Props extends object, - Component extends ElementType, ->( +export function forwardRef( render: ForwardRefRenderFunction< any, RightJoinProps, Props> & { diff --git a/packages/shared/system/src/index.ts b/packages/shared/system/src/index.ts index b532cce..4bf162a 100644 --- a/packages/shared/system/src/index.ts +++ b/packages/shared/system/src/index.ts @@ -1,10 +1,7 @@ /* eslint-disable @stylistic/padding-line-between-statements */ -export { default as createComponent } from './createComponent'; -export { - default as createContext, - type ContextProviderProps, -} from './createContext'; -export { default as createIcon } from './createIcon'; +export * from './createComponent'; +export * from './createContext'; +export * from './createIcon'; export * from './factory'; -export { default as forwardRef } from './forwardRef'; +export * from './forwardRef'; export * from './types';