Skip to content

Commit

Permalink
Stop exporting types (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
leo authored Jan 31, 2025
1 parent 6e26fce commit 85eed49
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/image.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { forwardRef, useCallback, useRef } from 'react';

const supportedFitValues = ['fill', 'contain', 'cover'];

export interface ImageProps {
interface ImageProps {
/**
* Defines text that can replace the image in the page.
*/
Expand Down
15 changes: 7 additions & 8 deletions src/components/rich-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { FunctionComponent, ReactHTML, ReactNode } from 'react';

type ValueOf<T> = T[keyof T];

export type RichTextContent =
type RichTextContent =
| {
type:
| 'doc'
Expand Down Expand Up @@ -58,14 +58,13 @@ export type RichTextContent =
)[];
};

export const RichText = ({
data,
components,
}: {
data: RichTextContent | RichTextContent[];
interface RichTextProps {
data: unknown;
components?: ReactHTML;
}) => {
const items = Array.isArray(data) ? data : [data];
}

export const RichText = ({ data, components }: RichTextProps) => {
const items: RichTextContent[] = Array.isArray(data) ? data : [data];

return items.map((item, position) => {
if (item.type === 'text') {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { RichText, type RichTextContent } from '@/src/components/rich-text';
export { RichText } from '@/src/components/rich-text';
export { Image } from '@/src/components/image.client';

export * from 'ronin';

0 comments on commit 85eed49

Please sign in to comment.