Skip to content

Commit

Permalink
📝 docs: explain cookieAttributes prop
Browse files Browse the repository at this point in the history
  • Loading branch information
switchnollie committed Sep 25, 2023
1 parent a1a6224 commit 33bd890
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
30 changes: 15 additions & 15 deletions packages/cookie-consent-banner-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ npm i @porscheofficial/cookie-consent-banner-react --S

### Properties

| Property (React) | Default | Type | Description |
| :------------------------------------------ | :------------------------------ | :--------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `availableCategories` | `[]` | `CategoryItem[]` | Provide the available Categories. See Real World example |
| `cookieDomain` | `document.location.hostname` | `string` | |
| `cookieName` | `"cookies_accepted_categories"` | `string` | |
| `disableResetSiteCookiesOnConsentWithdrawn` | `false` | `boolean` | Prevent cookies from being deleted automatically if consent of the user changed. |
| `disableSlideInAnimation` | `false` | `boolean` | Disable slide-in animation of banner (See #7) |
| `headline` | `undefined` | `string` | |
| `btnLabelAcceptAndContinue` | `undefined` | `string` | |
| `btnLabelAllAndContinue` | `undefined` | `string` | |
| `btnLabelOnlyEssentialAndContinue` | `undefined` | `string` | |
| `btnLabelPersistSelectionAndContinue` | `undefined` | `string` | |
| `contentSettingsDescription` | `undefined` | `string` | |
| `handlePreferencesRestored` | `undefined` | `({ acceptedCategories, }: { acceptedCategories: string[]; }) => void` |
| `handlePreferencesUpdated` | `undefined` | `({ acceptedCategories, }: { acceptedCategories: string[]; }) => void` | |
| Property (React) | Default | Type | Description |
| :------------------------------------------ | :---------------------------------------------------------- | :--------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `availableCategories` | `[]` | `CategoryItem[]` | Provide the available Categories. See Real World example |
| `cookieAttributes` | `{path: "/",expires: 7,domain: document.location.hostname}` | [`CookieAttributes`](./src/components/cookie-consent-banner/types.ts) | Customization of the cookie attributes for the consent cookie (`expires` can either be a number of days or a `Date` object). |
| `cookieName` | `"cookies_accepted_categories"` | `string` | |
| `disableResetSiteCookiesOnConsentWithdrawn` | `false` | `boolean` | Prevent cookies from being deleted automatically if consent of the user changed. |
| `disableSlideInAnimation` | `false` | `boolean` | Disable slide-in animation of banner (See #7) |
| `headline` | `undefined` | `string` | |
| `btnLabelAcceptAndContinue` | `undefined` | `string` | |
| `btnLabelAllAndContinue` | `undefined` | `string` | |
| `btnLabelOnlyEssentialAndContinue` | `undefined` | `string` | |
| `btnLabelPersistSelectionAndContinue` | `undefined` | `string` | |
| `contentSettingsDescription` | `undefined` | `string` | |
| `handlePreferencesRestored` | `undefined` | `({ acceptedCategories, }: { acceptedCategories: string[]; }) => void` |
| `handlePreferencesUpdated` | `undefined` | `({ acceptedCategories, }: { acceptedCategories: string[]; }) => void` | |

### Events Dispatched by the Component

Expand Down
26 changes: 13 additions & 13 deletions packages/cookie-consent-banner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ npm i @porscheofficial/cookie-consent-banner --S

### Attributes

| Attribute (Web Component) | Default | Type | Description |
| :------------------------------------------------ | :------------------------------ | :--------------- | :------------------------------------------------------------------------------- |
| `available-categories` | `[]` | `CategoryItem[]` | Provide the available Categories. See Real World example |
| `cookie-domain` | `document.location.hostname` | `string` | |
| `cookie-name` | `"cookies_accepted_categories"` | `string` | |
| `disable-reset-site-cookies-on-consent-withdrawn` | `false` | `boolean` | Prevent cookies from being deleted automatically if consent of the user changed. |
| `disable-slide-in-animation` | `false` | `boolean` | Disable slide-in animation of banner (See #7) |
| `headline` | `undefined` | `string` | |
| `btn-label-accept-and-continue` | `undefined` | `string` | |
| `btn-label-select-all-and-continue` | `undefined` | `string` | |
| `btn-label-only-essential-and-continue` | `undefined` | `string` | |
| `btn-label-persist-selection-and-continue` | `undefined` | `string` |
| `content-settings-description` | `undefined` | `string` | |
| Attribute (Web Component) | Default | Type | Description |
| :------------------------------------------------ | :---------------------------------------------------------- | :-------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------- |
| `available-categories` | `[]` | `CategoryItem[]` | Provide the available Categories. See Real World example |
| `cookie-attributes` | `{path: "/",expires: 7,domain: document.location.hostname}` | [`CookieAttributes`](./src/components/cookie-consent-banner/types.ts) | Customization of the cookie attributes for the consent cookie (`expires` can either be a number of days or a `Date` object). |
| `cookie-name` | `"cookies_accepted_categories"` | `string` | |
| `disable-reset-site-cookies-on-consent-withdrawn` | `false` | `boolean` | Prevent cookies from being deleted automatically if consent of the user changed. |
| `disable-slide-in-animation` | `false` | `boolean` | Disable slide-in animation of banner (See #7) |
| `headline` | `undefined` | `string` | |
| `btn-label-accept-and-continue` | `undefined` | `string` | |
| `btn-label-select-all-and-continue` | `undefined` | `string` | |
| `btn-label-only-essential-and-continue` | `undefined` | `string` | |
| `btn-label-persist-selection-and-continue` | `undefined` | `string` |
| `content-settings-description` | `undefined` | `string` | |

### Events Dispatched by the Component

Expand Down

0 comments on commit 33bd890

Please sign in to comment.