-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add first components and clean up
- Loading branch information
Showing
8 changed files
with
80 additions
and
26 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
packages/docs/docs/components/core/consent-manager-form.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# ConsentManagerForm | ||
|
||
`ConsentManagerForm` is a React component designed to provide a basic, unstyled form enabling users to control their consent choices for different integrations. This component is particularly useful as a reference or starting point for integrating a custom consent form. It facilitates the enabling or disabling of integrations based on user preferences. For a pre-styled version, consider exploring our default interface. | ||
|
||
## Props | ||
| Prop | Type | Description | | ||
|----------------|-----------------------------|--------------------------------------------------------------| | ||
| `formComponent`| `React.ComponentType<DecisionsFormProps>` | Optional. A custom form component to override the default. | | ||
| `...props` | `unknown` | Any additional props are passed down to the form component. | | ||
|
||
## Example Usage | ||
```jsx | ||
import { ConsentManagerForm } from '@consent-manager/core'; | ||
|
||
const MyConsentForm = () => { | ||
// Custom form component (optional) | ||
const CustomFormComponent = ...; | ||
|
||
return ( | ||
<ConsentManagerForm formComponent={CustomFormComponent} /> | ||
); | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# ConsentManager | ||
|
||
`ConsentManager` is the core component that provides context and state management for all consent-related functionality. It should wrap the root of your application. | ||
|
||
## Props | ||
| Prop | Type | Description | | ||
|---------------------|---------------------------------------|--------------------------------------------------------------| | ||
| `config` | `ConsentManagerConfig` | Configuration object for Consent Manager. | | ||
| `fallbackComponent` | `React.ComponentType<FallbackComponentProps>` | Optional. Custom fallback component for unconsented integrations. | | ||
| `store` | `ConsentManagerStore` | Storage mechanism for consent decisions. | | ||
| `children` | `React.ReactNode` | The application's components. | | ||
|
||
## Example Usage | ||
```jsx | ||
import { ConsentManager } from '@consent-manager/core'; | ||
|
||
const App = () => ( | ||
<ConsentManager config={myConfig} store={myStore}> | ||
{/* Rest of your application */} | ||
</ConsentManager> | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# PrivacyShield | ||
|
||
`PrivacyShield` is a component that conditionally renders children based on the consent decision for a specific integration. It's typically used to wrap content that should only be displayed if the user has consented to the associated integration. | ||
|
||
## Props | ||
| Prop | Type | Description | | ||
|--------------|-----------------------------|--------------------------------------------------------------| | ||
| `id` | `string` | The identifier for the integration to check consent for. | | ||
| `children` | `React.ReactNode` | The content to render if consent is given. | | ||
| `...props` | `unknown` | Additional props passed to the fallback component. | | ||
|
||
## Example Usage | ||
```jsx | ||
import { PrivacyShield } from '@consent-manager/core'; | ||
|
||
const YouTubeEmbed = ({ videoId }) => ( | ||
<PrivacyShield id="youtube"> | ||
{/* Your YouTube embed component */} | ||
</PrivacyShield> | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
id: todo | ||
title: This Page is Under Construction | ||
--- | ||
|
||
Apologies for the inconvenience. This page is currently in progress. We're actively working on adding more content here, so stay tuned! |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters