Added more agent skills
This commit is contained in:
@@ -79,7 +79,7 @@ export function CookieBanner({ classNames }: { classNames?: CookieBannerClassNam
|
||||
const secondaryClass = classNames?.secondaryButton ?? defaults.secondaryButton
|
||||
|
||||
return (
|
||||
<div aria-label="Cookie consent" className={rootClass} data-ipal="banner" role="dialog">
|
||||
<div aria-label={texts.settingsTitle} className={rootClass} data-ipal="banner" role="dialog">
|
||||
<div className="mx-auto max-w-4xl">
|
||||
{!showSettings ? (
|
||||
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
@@ -101,13 +101,13 @@ export function CookieBanner({ classNames }: { classNames?: CookieBannerClassNam
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex shrink-0 gap-2">
|
||||
<button className={secondaryClass} onClick={() => setShowSettings(true)}>
|
||||
<button className={secondaryClass} data-ipal="settings" onClick={() => setShowSettings(true)}>
|
||||
{texts.buttons.settings}
|
||||
</button>
|
||||
<button className={secondaryClass} onClick={rejectAll}>
|
||||
<button className={secondaryClass} data-ipal="reject" onClick={rejectAll}>
|
||||
{texts.buttons.reject}
|
||||
</button>
|
||||
<button className={primaryClass} onClick={acceptAll}>
|
||||
<button className={primaryClass} data-ipal="accept" onClick={acceptAll}>
|
||||
{texts.buttons.acceptAll}
|
||||
</button>
|
||||
</div>
|
||||
@@ -138,10 +138,10 @@ export function CookieBanner({ classNames }: { classNames?: CookieBannerClassNam
|
||||
))}
|
||||
</ul>
|
||||
<div className="flex justify-end gap-2">
|
||||
<button className={secondaryClass} onClick={() => setShowSettings(false)}>
|
||||
<button className={secondaryClass} data-ipal="back" onClick={() => setShowSettings(false)}>
|
||||
{texts.buttons.back}
|
||||
</button>
|
||||
<button className={primaryClass} onClick={() => savePreferences(choices)}>
|
||||
<button className={primaryClass} data-ipal="save" onClick={() => savePreferences(choices)}>
|
||||
{texts.buttons.save}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useIsMounted } from './useIsMounted.js'
|
||||
*/
|
||||
export function CookieButton({ className }: { className?: string } = {}) {
|
||||
const isMounted = useIsMounted()
|
||||
const { decided, reopen } = useConsentContext()
|
||||
const { decided, reopen, texts } = useConsentContext()
|
||||
|
||||
// Render nothing until mounted — prevents hydration mismatch (no project
|
||||
// ConsentWrapper workaround needed).
|
||||
@@ -30,7 +30,13 @@ export function CookieButton({ className }: { className?: string } = {}) {
|
||||
'dark:bg-[var(--ipal-surface-dark,#171717)] dark:border-[var(--ipal-border-dark,#262626)] dark:hover:bg-[var(--ipal-hover-dark,#262626)]'
|
||||
|
||||
return (
|
||||
<button aria-label="Cookie settings" className={cls} data-ipal="cookie-button" onClick={reopen}>
|
||||
<button
|
||||
// a11y label per locale: the panel's "settings title" (Cookie Settings global)
|
||||
aria-label={texts.settingsTitle}
|
||||
className={cls}
|
||||
data-ipal="cookie-button"
|
||||
onClick={reopen}
|
||||
>
|
||||
<Cookie
|
||||
aria-hidden="true"
|
||||
className="h-5 w-5 text-[var(--ipal-text,#525252)] dark:text-[var(--ipal-text-dark,#d4d4d4)]"
|
||||
|
||||
Reference in New Issue
Block a user