@limboai/react 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -0
- package/dist/icons/CRLogo.d.ts +12 -0
- package/dist/icons/LinkedInIcon.d.ts +13 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/index.cjs +2169 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.mjs +2147 -0
- package/dist/index.mjs.map +1 -0
- package/dist/shared/hooks/index.d.ts +2 -0
- package/dist/shared/hooks/useTooltipVisibility.d.ts +32 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/types/index.d.ts +59 -0
- package/dist/types/media.d.ts +56 -0
- package/dist/ui/core/Slot.d.ts +33 -0
- package/dist/ui/core/credential/CredentialBadge.d.ts +63 -0
- package/dist/ui/core/credential/CredentialOverlayContent.d.ts +23 -0
- package/dist/ui/core/credential/CredentialOverlayRoot.d.ts +35 -0
- package/dist/ui/core/credential/CredentialOverlayTrigger.d.ts +23 -0
- package/dist/ui/core/credential/context/CredentialBadgeContext.d.ts +8 -0
- package/dist/ui/core/credential/context/CredentialOverlayContext.d.ts +21 -0
- package/dist/ui/core/credential/context/index.d.ts +2 -0
- package/dist/ui/core/credential/hooks/index.d.ts +2 -0
- package/dist/ui/core/credential/hooks/useCredentialBadgeContext.d.ts +15 -0
- package/dist/ui/core/credential/hooks/useCredentialOverlayContext.d.ts +23 -0
- package/dist/ui/core/credential/index.d.ts +36 -0
- package/dist/ui/core/index.d.ts +2 -0
- package/dist/ui/core/passport/PassportActions.d.ts +27 -0
- package/dist/ui/core/passport/PassportCopyButton.d.ts +38 -0
- package/dist/ui/core/passport/PassportField.d.ts +39 -0
- package/dist/ui/core/passport/PassportFooter.d.ts +20 -0
- package/dist/ui/core/passport/PassportHeader.d.ts +19 -0
- package/dist/ui/core/passport/PassportIdentities.d.ts +35 -0
- package/dist/ui/core/passport/PassportLogo.d.ts +25 -0
- package/dist/ui/core/passport/PassportRoot.d.ts +24 -0
- package/dist/ui/core/passport/PassportSigners.d.ts +28 -0
- package/dist/ui/core/passport/PassportTitle.d.ts +30 -0
- package/dist/ui/core/passport/context/PassportContext.d.ts +12 -0
- package/dist/ui/core/passport/context/index.d.ts +1 -0
- package/dist/ui/core/passport/hooks/index.d.ts +2 -0
- package/dist/ui/core/passport/hooks/usePassportContext.d.ts +20 -0
- package/dist/ui/core/passport/hooks/usePassportData.d.ts +22 -0
- package/dist/ui/core/passport/index.d.ts +49 -0
- package/dist/ui/default/LimboBadge.d.ts +22 -0
- package/dist/ui/default/LimboImage.d.ts +66 -0
- package/dist/ui/default/LimboPassport.d.ts +30 -0
- package/dist/ui/default/LimboVideo.d.ts +64 -0
- package/dist/ui/default/constants.d.ts +19 -0
- package/dist/ui/default/index.d.ts +10 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/media/MediaImage.d.ts +87 -0
- package/dist/ui/media/MediaVideo.d.ts +85 -0
- package/dist/ui/media/context/MediaContext.d.ts +19 -0
- package/dist/ui/media/context/index.d.ts +1 -0
- package/dist/ui/media/hooks/index.d.ts +3 -0
- package/dist/ui/media/hooks/useHeicConversion.d.ts +32 -0
- package/dist/ui/media/hooks/useMediaContext.d.ts +13 -0
- package/dist/ui/media/hooks/useMediaOverlay.d.ts +37 -0
- package/dist/ui/media/index.d.ts +5 -0
- package/package.json +71 -0
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# @limboai/react
|
|
2
|
+
|
|
3
|
+
Headless React components for displaying [C2PA](https://c2pa.org/) content credentials.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @limboai/react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Storybook
|
|
12
|
+
|
|
13
|
+
See the Storybook for live examples and usage patterns:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn dev
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Opens at [http://localhost:6006](http://localhost:6006).
|
|
20
|
+
|
|
21
|
+
## Public API
|
|
22
|
+
|
|
23
|
+
### Compound Components
|
|
24
|
+
|
|
25
|
+
- **Passport** - Object with `.Root`, `.Header`, `.Field`, `.Actions`, `.Identities`, `.Signers`, `.Footer`, `.CopyButton`, `.Logo`, `.Title`
|
|
26
|
+
- **CredentialBadge** - Object with `.Root`, `.Loading`, `.Verified`, `.NoCredentials`, `.Error`, `.Idle`
|
|
27
|
+
- **CredentialOverlay** - Object with `.Root`, `.Trigger`, `.Content`
|
|
28
|
+
|
|
29
|
+
### Context Hooks (for advanced usage inside render props)
|
|
30
|
+
|
|
31
|
+
- `usePassportContext` - Access passport data within Passport.Root
|
|
32
|
+
- `useCredentialBadgeContext` - Access badge state within CredentialBadge.Root
|
|
33
|
+
- `useCredentialOverlayContext` - Access overlay state within CredentialOverlay.Root
|
|
34
|
+
- `useMediaContext` - Access media context within MediaImage/MediaVideo render props
|
|
35
|
+
|
|
36
|
+
### Headless Media Components
|
|
37
|
+
|
|
38
|
+
- `MediaImage` - Image component with credential overlay support
|
|
39
|
+
- `MediaVideo` - Video component with credential overlay support
|
|
40
|
+
|
|
41
|
+
### Pre-styled Components
|
|
42
|
+
|
|
43
|
+
- `LimboImage` - Ready-to-use image with badge and passport
|
|
44
|
+
- `LimboVideo` - Ready-to-use video with badge and passport
|
|
45
|
+
- `LimboBadge` - Pre-styled credential badge
|
|
46
|
+
- `LimboPassport` - Pre-styled passport tooltip
|
|
47
|
+
|
|
48
|
+
### User-facing Hooks
|
|
49
|
+
|
|
50
|
+
- `usePassportData` - Extract passport data from validation response
|
|
51
|
+
- `useHeicConversion` - HEIC to JPEG conversion utility
|
|
52
|
+
- `useTooltipVisibility` - Tooltip state management with delayed hide
|
|
53
|
+
|
|
54
|
+
### Constants & Types
|
|
55
|
+
|
|
56
|
+
- `BadgePosition`, `BadgePositionType` - Badge positioning options
|
|
57
|
+
- `Theme`, `ThemeType` - Light/dark theme options
|
|
58
|
+
- `PassportVariant`, `PassportVariantType` - Passport display variants
|
|
59
|
+
- `ValidationStatus`, `ValidationStatusType` - Validation states
|
|
60
|
+
- Core types: `C2PAValidationResponse`, `PassportData`, `SignerInfo`, `IdentityInfo`, etc.
|
|
61
|
+
|
|
62
|
+
### Icons
|
|
63
|
+
|
|
64
|
+
- `CRLogo` - Content Credentials logo
|
|
65
|
+
- `LinkedInIcon` - LinkedIn icon for identity display
|
|
66
|
+
|
|
67
|
+
## Usage Examples
|
|
68
|
+
|
|
69
|
+
### Headless Passport
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { Passport } from "@limboai/react";
|
|
73
|
+
|
|
74
|
+
<Passport.Root validation={validation}>
|
|
75
|
+
<Passport.Header>
|
|
76
|
+
<Passport.Logo className="w-6 h-6" />
|
|
77
|
+
<Passport.Title className="text-lg font-bold" />
|
|
78
|
+
</Passport.Header>
|
|
79
|
+
|
|
80
|
+
<Passport.Field name="issuer" />
|
|
81
|
+
<Passport.Field name="date" />
|
|
82
|
+
|
|
83
|
+
<Passport.Actions>
|
|
84
|
+
{(actions) => actions.map(a => <span key={a}>{a}</span>)}
|
|
85
|
+
</Passport.Actions>
|
|
86
|
+
|
|
87
|
+
<Passport.Footer>
|
|
88
|
+
<Passport.CopyButton />
|
|
89
|
+
</Passport.Footer>
|
|
90
|
+
</Passport.Root>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Headless Badge + Overlay
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
import { CredentialBadge, CredentialOverlay, Passport } from "@limboai/react";
|
|
97
|
+
|
|
98
|
+
<CredentialOverlay.Root validation={validation} status={status}>
|
|
99
|
+
<CredentialOverlay.Trigger>
|
|
100
|
+
<CredentialBadge.Root status={status} hasCredentials={hasCredentials}>
|
|
101
|
+
<CredentialBadge.Verified>
|
|
102
|
+
<CheckIcon className="text-green-500" />
|
|
103
|
+
</CredentialBadge.Verified>
|
|
104
|
+
<CredentialBadge.Loading>
|
|
105
|
+
<Spinner />
|
|
106
|
+
</CredentialBadge.Loading>
|
|
107
|
+
</CredentialBadge.Root>
|
|
108
|
+
</CredentialOverlay.Trigger>
|
|
109
|
+
|
|
110
|
+
<CredentialOverlay.Content>
|
|
111
|
+
<Passport.Root validation={validation}>
|
|
112
|
+
...
|
|
113
|
+
</Passport.Root>
|
|
114
|
+
</CredentialOverlay.Content>
|
|
115
|
+
</CredentialOverlay.Root>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Pre-styled Components
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
import { LimboImage, BadgePosition, Theme } from "@limboai/react";
|
|
122
|
+
|
|
123
|
+
<LimboImage
|
|
124
|
+
src="/photo.jpg"
|
|
125
|
+
validation={validation}
|
|
126
|
+
status={status}
|
|
127
|
+
badgePosition={BadgePosition.TopRight}
|
|
128
|
+
theme={Theme.Light}
|
|
129
|
+
/>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CSSProperties, FC } from "react";
|
|
2
|
+
export interface CRLogoProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: CSSProperties;
|
|
5
|
+
size?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Content Credentials (CR) Logo
|
|
9
|
+
*
|
|
10
|
+
* Based on the Content Authenticity Initiative logo
|
|
11
|
+
*/
|
|
12
|
+
export declare const CRLogo: FC<CRLogoProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CSSProperties, FC } from "react";
|
|
2
|
+
export interface LinkedInIconProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: CSSProperties;
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* LinkedIn Icon as inline SVG
|
|
10
|
+
*
|
|
11
|
+
* Used for LinkedIn identity verification links
|
|
12
|
+
*/
|
|
13
|
+
export declare const LinkedInIcon: FC<LinkedInIconProps>;
|