A React component library for rendering common AT Protocol records for applications such as Bluesky and Leaflet.

version bump + add theme type file

Changed files
+29 -4
lib
+4 -2
README.md
···
--atproto-color-text-secondary
--atproto-color-border
--atproto-color-link
-
/* ...and more */
+
/* ...and more, check out lib/styles.css */
```
### Override Component Theme
···
Wrap any component in a div with custom CSS variables to override its appearance:
```tsx
+
import { AtProtoStyles } from "atproto-ui";
+
<div style={{
'--atproto-color-bg': '#f0f0f0',
'--atproto-color-text': '#000',
'--atproto-color-link': '#0066cc',
-
}}>
+
} satisfies AtProtoStyles}>
<BlueskyPost did="..." rkey="..." />
</div>
```
+1 -1
lib/components/BlueskyPost.tsx
···
rkey: showParent && !record ? rkey : "",
});
-
const currentRecord = record || fetchedRecord;
+
const currentRecord = record ?? fetchedRecord;
const parentUri = currentRecord?.reply?.parent?.uri;
const parsedParentUri = parentUri ? parseAtUri(parentUri) : null;
+23
lib/theme-type.ts
···
+
export type AtProtoStyles = React.CSSProperties & {
+
'--atproto-color-bg'?: string;
+
'--atproto-color-bg-elevated'?: string;
+
'--atproto-color-bg-secondary'?: string;
+
'--atproto-color-text'?: string;
+
'--atproto-color-text-secondary'?: string;
+
'--atproto-color-text-muted'?: string;
+
'--atproto-color-border'?: string;
+
'--atproto-color-border-subtle'?: string;
+
'--atproto-color-link'?: string;
+
'--atproto-color-link-hover'?: string;
+
'--atproto-color-error'?: string;
+
'--atproto-color-button-bg'?: string;
+
'--atproto-color-button-hover'?: string;
+
'--atproto-color-button-text'?: string;
+
'--atproto-color-code-bg'?: string;
+
'--atproto-color-code-border'?: string;
+
'--atproto-color-blockquote-border'?: string;
+
'--atproto-color-blockquote-bg'?: string;
+
'--atproto-color-hr'?: string;
+
'--atproto-color-image-bg'?: string;
+
'--atproto-color-highlight'?: string;
+
};
+1 -1
package.json
···
{
"name": "atproto-ui",
-
"version": "0.5.3-1",
+
"version": "0.5.4",
"type": "module",
"description": "React components and hooks for rendering AT Protocol records.",
"main": "./lib-dist/index.js",