Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop exporting types #2

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Loading