@owlmeans/web-consent 0.1.18-rc.20 → 0.1.18-rc.22
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 +1 -1
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/web-consent/SKILL.md +7 -1
- package/build/consent/component.d.ts.map +1 -1
- package/build/consent/component.js +1 -1
- package/build/consent/component.js.map +1 -1
- package/package.json +2 -2
- package/src/consent/component.tsx +8 -1
- package/tests/consent.spec.ts +31 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
6
6
|
your project's skill store (`.agents/skills/`):
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
9
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.28
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/web-consent",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.22",
|
|
5
|
+
"generatedAt": "2026-09-17T08:16:11.231Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/web-consent
|
|
9
9
|
|
|
10
10
|
**Layer:** Web (React)
|
|
11
|
-
**Install:** `"@owlmeans/web-consent": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/web-consent": "^0.1.18-rc.22"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
The browser components of the consent set. The model — categories, storage, migration, the store,
|
|
14
14
|
Consent Mode signalling — is `@owlmeans/consent`, and this package re-exports a **named selection**
|
|
@@ -68,6 +68,12 @@ import { CookieConsent } from '@owlmeans/web-consent'
|
|
|
68
68
|
work — the component must not know how its host does routing.
|
|
69
69
|
- `noReopenButton` hides the floating button for an app that offers a footer link instead; that link
|
|
70
70
|
calls `openConsent('reopen')`.
|
|
71
|
+
- **The re-open button is a bare icon in the very corner (`bottom-1 left-1`), not a card.** No
|
|
72
|
+
filled background, no border, no shadow, no hover-scale — `bg-transparent`, dimmed
|
|
73
|
+
(`opacity-70`) at rest and picked out on hover/focus — because it sits on every page of a site
|
|
74
|
+
for as long as a visitor stays and must read as a small fixture rather than compete with the
|
|
75
|
+
page's own controls. The pictogram itself stays at its original 20px (`h-5 w-5`); only the
|
|
76
|
+
chrome around it shrank. `[data-consent-reopen]` is still what any test or CSS override keys on.
|
|
71
77
|
- `silent` skips every `dataLayer` and global write. It is for tests and for an app that runs no
|
|
72
78
|
tags at all.
|
|
73
79
|
- The draft is **re-seeded from storage every time the dialog opens**, not from the last render — a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/consent/component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAS/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/consent/component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAS/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAkIhD,CAAA"}
|
|
@@ -51,6 +51,6 @@ export const CookieConsent = props => {
|
|
|
51
51
|
const gated = consent.reason === 'login';
|
|
52
52
|
return _jsxs(_Fragment, { children: [consent.open && _jsx("div", { className: "fixed inset-0 z-[999998] flex items-center justify-center overflow-y-auto bg-black/70 px-4 py-6 backdrop-blur-md", "aria-modal": "true", role: "dialog", "aria-labelledby": "cc-title", "aria-describedby": "cc-desc", "data-consent-dialog": true, children: _jsxs("div", { className: cn('relative z-[999999] w-full max-w-lg rounded-2xl border border-border bg-popover/95 p-6 shadow-[0_25px_60px_-12px_rgba(0,0,0,0.5)] ring-1 ring-primary/20 backdrop-blur-xl sm:p-8', props.className), children: [_jsx("div", { className: "absolute inset-x-0 top-0 h-1 rounded-t-2xl bg-gradient-to-r from-primary to-secondary" }), _jsxs("div", { className: "mb-4 flex items-center gap-3", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10 text-primary", children: _jsx(Cookie, { className: "h-5 w-5", "aria-hidden": "true" }) }), _jsx("h2", { id: "cc-title", className: "text-xl font-bold text-popover-foreground sm:text-2xl", children: t('title', 'Cookie Preferences') })] }), _jsx("p", { id: "cc-desc", className: "mb-6 text-sm leading-relaxed text-muted-foreground", children: t('description', 'We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic.') }), _jsx("div", { className: "space-y-3", children: categories.map(category => _jsx(ConsentToggle, { id: `cc-${category.key}`, label: t(category.labelKey, category.key), description: t(category.descriptionKey, ''), checked: draft[category.key] === true, ...(category.required === true ? { required: true } : {}), requiredLabel: t('required', 'Required'), onChange: value => setDraft(current => ({ ...current, [category.key]: value })) }, category.key)) }), gated && _jsx("p", { role: "status", "data-consent-reason": true, className: "mt-4 text-sm text-popover-foreground", children: t('loginReason', 'Signing in stores a session cookie. Accept essential cookies to continue.') }), _jsxs("div", { className: "mt-8 flex flex-col gap-3 sm:flex-row sm:gap-4", children: [_jsx("button", { type: "button", onClick: onSave, "data-consent-save": true, className: "flex-1 rounded-lg border border-border bg-transparent px-4 py-3 text-sm font-semibold text-popover-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: t('savePreferences', 'Save Preferences') }), _jsx("button", { type: "button", onClick: onAcceptAll, "data-consent-accept-all": true, className: "flex-1 rounded-lg bg-primary px-4 py-3 text-sm font-bold text-primary-foreground shadow-lg shadow-primary/25 transition-all hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", children: gated
|
|
53
53
|
? t('acceptAndContinue', 'Accept & continue')
|
|
54
|
-
: t('acceptAll', 'Accept All') })] }), (props.policyHref != null || props.links != null) && _jsxs("div", { className: "mt-4 flex flex-wrap justify-center gap-3 text-xs text-muted-foreground", children: [props.policyHref != null && _jsx("a", { href: props.policyHref, target: "_blank", rel: "noopener noreferrer", className: "underline underline-offset-2 transition-colors hover:text-popover-foreground", children: t('policyLink', 'Cookie Policy') }), props.links?.map(link => _jsx("a", { href: link.href, target: "_blank", rel: "noopener noreferrer", className: "underline underline-offset-2 transition-colors hover:text-popover-foreground", children: t(link.labelKey, link.defaultLabel) }, link.href))] })] }) }), props.noReopenButton !== true && consent.record != null && !consent.open && _jsx("button", { type: "button", onClick: () => consent.openDialog('reopen'), "aria-label": t('openPreferences', 'Cookie preferences'), "data-consent-reopen": true, className: "fixed bottom-
|
|
54
|
+
: t('acceptAll', 'Accept All') })] }), (props.policyHref != null || props.links != null) && _jsxs("div", { className: "mt-4 flex flex-wrap justify-center gap-3 text-xs text-muted-foreground", children: [props.policyHref != null && _jsx("a", { href: props.policyHref, target: "_blank", rel: "noopener noreferrer", className: "underline underline-offset-2 transition-colors hover:text-popover-foreground", children: t('policyLink', 'Cookie Policy') }), props.links?.map(link => _jsx("a", { href: link.href, target: "_blank", rel: "noopener noreferrer", className: "underline underline-offset-2 transition-colors hover:text-popover-foreground", children: t(link.labelKey, link.defaultLabel) }, link.href))] })] }) }), props.noReopenButton !== true && consent.record != null && !consent.open && _jsx("button", { type: "button", onClick: () => consent.openDialog('reopen'), "aria-label": t('openPreferences', 'Cookie preferences'), "data-consent-reopen": true, className: "fixed bottom-1 left-1 z-[999997] inline-flex items-center justify-center rounded border-0 bg-transparent p-1.5 text-muted-foreground opacity-70 transition-opacity hover:opacity-100 hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(Cookie, { className: "h-5 w-5", "aria-hidden": "true" }) })] });
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/consent/component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EACL,0BAA0B,EAAE,uBAAuB,EAAE,WAAW,GACjE,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B,KAAK,CAAC,EAAE;IAC3D,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,0BAA0B,CAAA;IACjE,MAAM,CAAC,GAAG,KAAK,CAAC,SAAS,IAAI,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAElE,MAAM,OAAO,GAAG,UAAU,CAAC;QACzB,UAAU;QACV,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU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7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@owlmeans/dep-config": "workspace:*",
|
|
36
|
-
"@owlmeans/test-ui": "^0.1.18-rc.
|
|
36
|
+
"@owlmeans/test-ui": "^0.1.18-rc.30",
|
|
37
37
|
"@tailwindcss/vite": "^4.0.0",
|
|
38
38
|
"@types/bun": "^1.4.0",
|
|
39
39
|
"@types/react": "^19.2.17",
|
|
@@ -132,11 +132,18 @@ export const CookieConsent: FC<CookieConsentProps> = props => {
|
|
|
132
132
|
</div>
|
|
133
133
|
</div>}
|
|
134
134
|
|
|
135
|
+
{/*
|
|
136
|
+
* A bare icon, not a card: it sits in the very corner of the page for as long as a visitor
|
|
137
|
+
* stays, on every page of the site, so it must read as a small fixture rather than as a
|
|
138
|
+
* floating action button competing with the page's own controls. No border, no filled
|
|
139
|
+
* background, no shadow and no hover-scale — only the pictogram, dimmed at rest and picked
|
|
140
|
+
* out on hover/focus, at the exact size (`h-5 w-5`) it always was.
|
|
141
|
+
*/}
|
|
135
142
|
{props.noReopenButton !== true && consent.record != null && !consent.open && <button
|
|
136
143
|
type="button" onClick={() => consent.openDialog('reopen')}
|
|
137
144
|
aria-label={t('openPreferences', 'Cookie preferences')}
|
|
138
145
|
data-consent-reopen
|
|
139
|
-
className="fixed bottom-
|
|
146
|
+
className="fixed bottom-1 left-1 z-[999997] inline-flex items-center justify-center rounded border-0 bg-transparent p-1.5 text-muted-foreground opacity-70 transition-opacity hover:opacity-100 hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
140
147
|
>
|
|
141
148
|
<Cookie className="h-5 w-5" aria-hidden="true" />
|
|
142
149
|
</button>}
|
package/tests/consent.spec.ts
CHANGED
|
@@ -181,6 +181,37 @@ describe('@owlmeans/web-consent — the dialog', () => {
|
|
|
181
181
|
}
|
|
182
182
|
}, TIMEOUT)
|
|
183
183
|
|
|
184
|
+
test('the re-open button is a bare, compact corner icon', async () => {
|
|
185
|
+
// The harness carries no Tailwind build (the package ships classes for a CONSUMING app's own
|
|
186
|
+
// `@source` scan, as `web-panel`'s consuming `index.css` does), so this is asserted on the
|
|
187
|
+
// class list itself rather than on computed style — exactly what every card/border/shadow/
|
|
188
|
+
// size utility below would resolve to once a consumer's stylesheet compiles them.
|
|
189
|
+
const { page, close } = await seeded(
|
|
190
|
+
{ essential: true, analytics: false, marketing: false, v: CONSENT_SCHEMA_VERSION }
|
|
191
|
+
)
|
|
192
|
+
try {
|
|
193
|
+
const button = page.locator('[data-consent-reopen]')
|
|
194
|
+
await button.waitFor()
|
|
195
|
+
const cls = await button.getAttribute('class') ?? ''
|
|
196
|
+
|
|
197
|
+
// In the very corner, not 20px off it (`bottom-5 left-5` was the old, card-sized offset).
|
|
198
|
+
expect(cls).toContain('bottom-1')
|
|
199
|
+
expect(cls).toContain('left-1')
|
|
200
|
+
// Bare icon: no filled surface, no border, no shadow, no hover-scale card affordance.
|
|
201
|
+
expect(cls).toContain('bg-transparent')
|
|
202
|
+
expect(cls).not.toMatch(/\bshadow-lg\b/)
|
|
203
|
+
expect(cls).not.toMatch(/\brounded-full\b/)
|
|
204
|
+
expect(cls).not.toMatch(/\bborder-border\b/)
|
|
205
|
+
expect(cls).not.toMatch(/\bhover:scale-110\b/)
|
|
206
|
+
// The pictogram itself keeps its original size.
|
|
207
|
+
const iconCls = await page.locator('[data-consent-reopen] svg').getAttribute('class') ?? ''
|
|
208
|
+
expect(iconCls).toMatch(/\bh-5\b/)
|
|
209
|
+
expect(iconCls).toMatch(/\bw-5\b/)
|
|
210
|
+
} finally {
|
|
211
|
+
await close()
|
|
212
|
+
}
|
|
213
|
+
}, TIMEOUT)
|
|
214
|
+
|
|
184
215
|
test('the re-open button brings the dialog back with a reason', async () => {
|
|
185
216
|
const { page, close } = await seeded({ essential: true, analytics: false, marketing: false, v: CONSENT_SCHEMA_VERSION })
|
|
186
217
|
try {
|