ab-nextjs-components 0.2.1 โ 0.2.3
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/CHANGELOG.md +5 -1
- package/ab-bottom-drawer/index.tsx +35 -4
- package/ab-bottom-drawer/use-ab-swipe-down.ts +125 -0
- package/ab-button/helpers.ts +2 -2
- package/ab-button/index.tsx +1 -1
- package/ab-button/styles.module.css +86 -20
- package/ab-carousel/index.tsx +202 -31
- package/ab-carousel/styles.module.css +22 -1
- package/ab-drawer/kit.module.css +27 -0
- package/ab-flow-diagram/frame-scale.tsx +65 -0
- package/ab-flow-diagram/helpers.ts +89 -3
- package/ab-flow-diagram/index.tsx +116 -3
- package/ab-flow-diagram/styles.module.css +112 -1
- package/ab-mobile-header/index.tsx +151 -12
- package/ab-package-card/index.tsx +1 -1
- package/ab-package-card/previews.tsx +20 -4
- package/ab-playground-scene/i18n.module.css +54 -0
- package/ab-playground-scene/i18n.tsx +141 -0
- package/ab-playground-scene/icons.tsx +96 -0
- package/ab-playground-scene/index.tsx +138 -0
- package/ab-playground-scene/labels.ts +103 -0
- package/ab-playground-scene/scenes.tsx +103 -0
- package/ab-playground-scene/styles.module.css +148 -0
- package/ab-playground-scene/upgraded.tsx +315 -0
- package/ab-playground-scene/welcome.tsx +120 -0
- package/ab-theme-mode/index.tsx +82 -0
- package/ab-theme-toggle/index.tsx +22 -3
- package/index.ts +11 -1
- package/package.json +9 -5
- package/server/ab-button/index.tsx +3 -2
- package/server/ab-test-hello/styles.module.css +3 -0
- package/types/index.d.ts +8 -1
- package/server/ab-button/styles.module.css +0 -191
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
## 0.2.
|
|
1
|
+
## 0.2.2 (Unreleased, proposed)
|
|
2
|
+
|
|
3
|
+
- ๐ AbPackagePreviewComponents `labels` ({ button, chip, switch }); English defaults unchanged, the 0.2.1 `button` / `chip` props still work
|
|
4
|
+
|
|
5
|
+
## 0.2.1
|
|
2
6
|
|
|
3
7
|
### Sidebar profile (God 02:44)
|
|
4
8
|
- โจ AbSidebar `profile` prop (opt-in): a 40px profile button at the bottom left opens AbSettingsDrawer. Signed out it shows the profile glyph; signed in the initials ("AU") on the container colour, or the photo masked to a circle, plus the name when expanded. Rendered on the server and hidden by CSS below 1180px (no flash); the collapsed rail names it with an AbBalloon tooltip. Label via `labels.profile` (default "Profile and settings")
|
|
@@ -43,18 +43,22 @@
|
|
|
43
43
|
'use client';
|
|
44
44
|
|
|
45
45
|
// โ๏ธ React
|
|
46
|
-
import type
|
|
46
|
+
import { useEffect, useId, useRef, type ReactElement, type RefObject } from 'react';
|
|
47
47
|
// ๐งต classes
|
|
48
48
|
import clsx from 'clsx';
|
|
49
49
|
// ๐๏ธ built on AbDrawer
|
|
50
50
|
import AbDrawer, { type AbDrawerProps } from '../ab-drawer';
|
|
51
51
|
// ๐จ styles
|
|
52
52
|
import styles from './styles.module.css';
|
|
53
|
+
// ๐ 0.2.3 (Joseph, Welcome 0.2.21): swipe down to close
|
|
54
|
+
import { useAbSwipeDown } from './use-ab-swipe-down';
|
|
53
55
|
|
|
54
56
|
/** โ๏ธ props: AbDrawer's, minus `side` (always bottom); scope defaults to the whole app */
|
|
55
57
|
export interface AbBottomDrawerProps extends Omit<AbDrawerProps, 'side'> {
|
|
56
58
|
side?: AbDrawerProps['side']; // ๐ accepted for drop-in use (AbDrawerList `as`), always rendered as bottom
|
|
57
59
|
handle?: boolean; // โ grab handle at the top (default true; decorative)
|
|
60
|
+
swipeToClose?: boolean; // ๐ 0.2.3: a swipe down closes it (default true; off when `snapPoints` drives the drag)
|
|
61
|
+
trigger?: RefObject<HTMLElement | null>; // โฉ๏ธ 0.2.3: focused on close (wins over everything); default = the opener, else the `[aria-controls=id]` button
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
/**
|
|
@@ -62,10 +66,37 @@ export interface AbBottomDrawerProps extends Omit<AbDrawerProps, 'side'> {
|
|
|
62
66
|
* with `side="bottom"`, `scope="app"`, the Home tokens (card surface, hairline top edge, 20px top radius,
|
|
63
67
|
* grab handle, safe-area padding) and at most 560px wide, centred, above 768px.
|
|
64
68
|
*/
|
|
65
|
-
const AbBottomDrawer = ({ handle = true, scope = 'app', initialFocus = 'panel', className, ...rest }: AbBottomDrawerProps): ReactElement =>
|
|
66
|
-
|
|
67
|
-
);
|
|
69
|
+
const AbBottomDrawer = ({ handle = true, scope = 'app', initialFocus = 'panel', className, swipeToClose = true, trigger, returnFocus, ...rest }: AbBottomDrawerProps): ReactElement => {
|
|
70
|
+
// ๐ the sheet needs an id: the swipe finds the portalled panel by it, and the trigger points at it (aria-controls)
|
|
71
|
+
const auto = useId().replace(/[^A-Za-z0-9_-]/g, ''); // ๐ SSR-stable
|
|
72
|
+
const id = rest.id ?? `ab-bottom-drawer-${auto}`;
|
|
73
|
+
// ๐ 0.2.3: swipe down to close (AbDrawer's own snap drag owns the gesture when `snapPoints` is on)
|
|
74
|
+
useAbSwipeDown({ id, onClose: rest.onClose, enabled: rest.open && swipeToClose && !rest.snapPoints });
|
|
75
|
+
// โฉ๏ธ 0.2.3 (Joseph): focus goes back to the trigger. AbDrawer already returns it to the focused opener; Safari
|
|
76
|
+
// (and taps on iOS) never focus a clicked <button>, so the opener is <body> and AbDrawer fell back to the logo.
|
|
77
|
+
// The fallback selector is now the button that controls this sheet, and an explicit `trigger` ref wins.
|
|
78
|
+
const wasOpen = useRef(rest.open); // ๐ง the previous `open`
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const closing = wasOpen.current && !rest.open; wasOpen.current = rest.open;
|
|
81
|
+
if (!closing || !trigger?.current) return;
|
|
82
|
+
const el = trigger.current; // ๐ this close's target
|
|
83
|
+
const t = window.setTimeout(() => { if (el.isConnected) el.focus({ preventScroll: true }); }, 0); // โญ๏ธ after AbDrawer's microtask
|
|
84
|
+
return () => window.clearTimeout(t);
|
|
85
|
+
}, [rest.open, trigger]);
|
|
86
|
+
return (
|
|
87
|
+
<AbDrawer
|
|
88
|
+
{...rest}
|
|
89
|
+
id={id}
|
|
90
|
+
returnFocus={returnFocus ?? `[aria-controls="${id}"]`} // โฉ๏ธ the trigger (when the opener wasn't focused)
|
|
91
|
+
scope={scope}
|
|
92
|
+
initialFocus={initialFocus}
|
|
93
|
+
side="bottom"
|
|
94
|
+
className={clsx('AbBottomDrawer', styles.abBottomDrawer, handle && styles.withHandle, className)}
|
|
95
|
+
/>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
68
98
|
|
|
69
99
|
// ๐ฆ exports
|
|
70
100
|
export default AbBottomDrawer;
|
|
71
101
|
export { AbBottomDrawer };
|
|
102
|
+
export { useAbSwipeDown, isAbScrolledInside, type UseAbSwipeDownOptions } from './use-ab-swipe-down'; // ๐ 0.2.3
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @license MIT
|
|
3
|
+
* ~~~~~~~~~~~~
|
|
4
|
+
* ab-nextjs-components
|
|
5
|
+
* ~~~~~~~~~~~~
|
|
6
|
+
* Copyright (c) 2026 Abraham Ukachi. The abElements Project.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the 'Software'), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*
|
|
26
|
+
* @project: ab-nextjs-components
|
|
27
|
+
* @name: useAbSwipeDown (close a bottom sheet with a swipe down)
|
|
28
|
+
* @file: ab-bottom-drawer/use-ab-swipe-down.ts
|
|
29
|
+
* @type: Client hook
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
35
|
+
* MOTTO: We'll always do more ๐!!!
|
|
36
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
'use client';
|
|
40
|
+
|
|
41
|
+
// โ๏ธ React
|
|
42
|
+
import { useEffect, useRef } from 'react';
|
|
43
|
+
// ๐ค the shared drawer rules (same numbers as useAbEdgeSwipe: 8px slop, 30% / 0.5px/ms commit)
|
|
44
|
+
import { AB_SWIPE, createAbVelocityTracker, resolveAbSideRelease } from '../ab-drawer/gestures';
|
|
45
|
+
|
|
46
|
+
/** โ๏ธ options */
|
|
47
|
+
export interface UseAbSwipeDownOptions {
|
|
48
|
+
id: string; // ๐ the sheet's dialog id (the panel is portalled, so we find it by id)
|
|
49
|
+
onClose: () => void; // ๐ช called when the swipe commits
|
|
50
|
+
enabled?: boolean; // ๐๏ธ e.g. only while open (default true)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** ๐ is there a scroller between `el` and the sheet that is NOT at its top? Then the finger scrolls it, not the sheet. */
|
|
54
|
+
export function isAbScrolledInside(el: Element | null, sheet: Element): boolean {
|
|
55
|
+
for (let n: Element | null = el; n && n !== sheet.parentElement; n = n.parentElement) {
|
|
56
|
+
if ((n as HTMLElement).scrollTop > 0) return true; // ๐ scrolled down: the gesture belongs to the content
|
|
57
|
+
if (n === sheet) break; // ๐งฑ stop at the sheet
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* ๐ useAbSwipeDown โ close a bottom sheet with a swipe down (Joseph, Welcome 0.2.21):
|
|
64
|
+
* - ๐ touch events, like useAbEdgeSwipe (Android Chrome fires pointercancel on a native pan, so pointer events
|
|
65
|
+
* would lose the gesture); the passive touchstart only arms it, a NON-passive touchmove is attached just for
|
|
66
|
+
* that press, and preventDefault runs only once the move is ours (down, and mostly vertical)
|
|
67
|
+
* - ๐ never fights inner scroll: a press inside a scroller that isn't at scrollTop 0 is left alone, and an
|
|
68
|
+
* upward move is always the content's
|
|
69
|
+
* - ๐งญ a mostly sideways move (a carousel, a chip row) is not ours either
|
|
70
|
+
* - ๐ซณ the sheet follows the finger (translateY), then on release it closes past 30% of its height or at
|
|
71
|
+
* โฅ 0.5px/ms down; anything less springs back
|
|
72
|
+
*/
|
|
73
|
+
export function useAbSwipeDown({ id, onClose, enabled = true }: UseAbSwipeDownOptions): void {
|
|
74
|
+
const latest = useRef(onClose); // ๐ latest callback for the listeners
|
|
75
|
+
useEffect(() => { latest.current = onClose; }, [onClose]);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!enabled) return;
|
|
78
|
+
let d: { y: number; x: number; axis: 0 | 1 | 2; v: ReturnType<typeof createAbVelocityTracker>; sheet: HTMLElement } | null = null; // ๐ซณ the press
|
|
79
|
+
// ๐๏ธ follow / release the finger
|
|
80
|
+
const follow = (sheet: HTMLElement, dy: number | null) => {
|
|
81
|
+
if (dy == null) { sheet.style.removeProperty('transform'); sheet.style.removeProperty('transition'); return; } // ๐ฌ back to CSS
|
|
82
|
+
sheet.style.transition = 'none'; // ๐ซ no lag while dragging
|
|
83
|
+
sheet.style.transform = `translateY(${Math.max(0, dy)}px)`; // โฌ๏ธ never above its rest
|
|
84
|
+
};
|
|
85
|
+
const tmove = (e: TouchEvent) => {
|
|
86
|
+
const t = e.touches[0]; if (!d || !t || d.axis === 2) return;
|
|
87
|
+
const dx = t.clientX - d.x; const dy = t.clientY - d.y; // โ๏ธ โ๏ธ
|
|
88
|
+
if (d.axis === 0) {
|
|
89
|
+
if (Math.max(Math.abs(dx), Math.abs(dy)) < AB_SWIPE.slop) return; // ๐ซณ still a tap
|
|
90
|
+
d.axis = dy > 0 && Math.abs(dy) > Math.abs(dx) ? 1 : 2; // ๐งญ down = ours; up / sideways = the content's
|
|
91
|
+
if (d.axis === 2) { detach(); d = null; return; } // ๐
let go early
|
|
92
|
+
}
|
|
93
|
+
if (e.cancelable) e.preventDefault(); // ๐ no page / body scroll while we lead
|
|
94
|
+
d.v.add(t.clientY, e.timeStamp); // โก
|
|
95
|
+
follow(d.sheet, dy); // ๐ซณ
|
|
96
|
+
};
|
|
97
|
+
const tend = (e: TouchEvent) => {
|
|
98
|
+
const cur = d; d = null; detach();
|
|
99
|
+
if (!cur || cur.axis !== 1) return;
|
|
100
|
+
const t = e.changedTouches[0];
|
|
101
|
+
follow(cur.sheet, null); // ๐ฌ the drawer's own slide-out (or spring back) takes over
|
|
102
|
+
if (e.type !== 'touchend' || !t) return; // โ cancelled
|
|
103
|
+
const height = cur.sheet.offsetHeight || cur.sheet.getBoundingClientRect().height || 320; // ๐
|
|
104
|
+
if (resolveAbSideRelease({ distance: t.clientY - cur.y, velocity: cur.v.velocity(), width: height })) latest.current(); // โ
30% / 0.5px/ms
|
|
105
|
+
};
|
|
106
|
+
const attach = () => { document.addEventListener('touchmove', tmove, { capture: true, passive: false }); document.addEventListener('touchend', tend, true); document.addEventListener('touchcancel', tend, true); };
|
|
107
|
+
const detach = () => { document.removeEventListener('touchmove', tmove, true); document.removeEventListener('touchend', tend, true); document.removeEventListener('touchcancel', tend, true); };
|
|
108
|
+
const tstart = (e: TouchEvent) => {
|
|
109
|
+
detach(); d = null;
|
|
110
|
+
if (e.touches.length !== 1) return; // โ๏ธ pinch etc.
|
|
111
|
+
const target = e.target as Element | null;
|
|
112
|
+
const sheet = document.getElementById(id); // ๐๏ธ the portalled panel
|
|
113
|
+
if (!sheet || !target || !sheet.contains(target)) return; // ๐
not on our sheet
|
|
114
|
+
if (target.closest('[data-ab-no-swipe-down], input, textarea, select, [contenteditable="true"]')) return; // ๐
opt-out + text editing
|
|
115
|
+
if (isAbScrolledInside(target, sheet)) return; // ๐ the content isn't at its top
|
|
116
|
+
const t = e.touches[0]; const v = createAbVelocityTracker(); v.add(t.clientY, e.timeStamp);
|
|
117
|
+
d = { x: t.clientX, y: t.clientY, axis: 0, v, sheet }; attach(); // ๐ง armed
|
|
118
|
+
};
|
|
119
|
+
document.addEventListener('touchstart', tstart, { capture: true, passive: true }); // ๐ passive: never delays a tap or scroll
|
|
120
|
+
return () => { document.removeEventListener('touchstart', tstart, true); detach(); if (d) follow(d.sheet, null); d = null; };
|
|
121
|
+
}, [id, enabled]);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ๐ฆ default export
|
|
125
|
+
export default useAbSwipeDown;
|
package/ab-button/helpers.ts
CHANGED
|
@@ -44,9 +44,9 @@ export type AbButtonType = 'contained' | 'filled' | 'outlined' | 'text' | 'secon
|
|
|
44
44
|
// ๐ท 0.1.14 (P16): 'pill' = the legacy 999px look (default) ยท 'rounded' = the Home 10px button
|
|
45
45
|
export type AbButtonShape = 'pill' | 'rounded';
|
|
46
46
|
// ๐ 0.1.14 (P16): 'md' = 40px (44px under 768px, the touch CTA); undefined keeps the legacy sizing
|
|
47
|
-
export type AbButtonSize = 'md';
|
|
47
|
+
export type AbButtonSize = 'md' | 'lg'; // ๐ 'lg' = v6 CTA: 52px / 56px โฅ 1180px, radius 12px (0.2.3)
|
|
48
48
|
// ๐จ colour roles
|
|
49
|
-
export type AbButtonColor = 'primary' | 'secondary' | 'tertiary' | 'white' | 'black';
|
|
49
|
+
export type AbButtonColor = 'primary' | 'secondary' | 'tertiary' | 'white' | 'black' | 'bronze' | 'card'; // ๐ฅ 'bronze' = v6 Get Started ยท ๐ 'card' = v6 GitHub secondary (0.2.3)
|
|
50
50
|
// ๐ท๏ธ badge tones (G22): neutral grey or bronze accent
|
|
51
51
|
export type AbButtonBadgeTone = 'neutral' | 'accent';
|
|
52
52
|
|
package/ab-button/index.tsx
CHANGED
|
@@ -72,7 +72,7 @@ export interface AbButtonProps {
|
|
|
72
72
|
iconStyle?: CSSProperties; // ๐จ Material icon style
|
|
73
73
|
rounded?: boolean; // ๐
|
|
74
74
|
shape?: AbButtonShape; // ๐ท 0.1.14 (P16): 'rounded' = Home 10px radius (overrides `rounded`)
|
|
75
|
-
size?: AbButtonSize; // ๐ 0.1.14 (P16): 'md' = 40px / 44px on touch widths
|
|
75
|
+
size?: AbButtonSize; // ๐ 0.1.14 (P16): 'md' = 40px / 44px on touch widths ยท 0.2.3: 'lg' = v6 CTA 52px / 56px โฅ 1180px
|
|
76
76
|
raised?: boolean; // ๐๏ธ
|
|
77
77
|
shrinks?: boolean; // ๐ค
|
|
78
78
|
expands?: boolean; // ๐
|
|
@@ -151,16 +151,36 @@
|
|
|
151
151
|
border: 0; /* ๐งน */
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
/*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
154
|
+
/* ๐ 0.2.3 (Joseph 03:37): AbButton OWNS its box per type (button AND link), with the old theme values, because
|
|
155
|
+
* theme โฅ 0.3.7 keeps its legacy button sizes off `.AbButton`. Every value is a --ab-button-* token:
|
|
156
|
+
* --ab-button-padding contained / text 6px 12px ยท filled 6px 16px ยท outlined 8px 16px (all 8px 16px โฅ 460px)
|
|
157
|
+
* --ab-button-font-size 18px (20px โฅ 460px, as the theme did)
|
|
158
|
+
* --ab-button-line-height 32px
|
|
159
|
+
* --ab-button-height / -min-height 40px (border-box, like the theme's <button data-type>)
|
|
160
|
+
* --ab-button-radius 8px (filled 999px)
|
|
161
|
+
* shape="rounded" / size="md" (doubled class, below) keep their own box. */
|
|
162
|
+
.abButton[data-type] {
|
|
163
|
+
box-sizing: border-box; /* ๐ฆ */
|
|
164
|
+
padding: var(--ab-button-padding, 6px 12px); /* ๐ฆ contained / text */
|
|
165
|
+
font-size: var(--ab-button-font-size, 18px); /* ๐ค */
|
|
166
|
+
line-height: var(--ab-button-line-height, 32px); /* ๐ */
|
|
167
|
+
height: var(--ab-button-height, 40px); /* ๐ 40px tall */
|
|
168
|
+
min-height: var(--ab-button-min-height, 40px); /* ๐ */
|
|
169
|
+
border-radius: var(--ab-button-radius, 8px); /* ๐ฒ */
|
|
163
170
|
}
|
|
171
|
+
.abButton[data-type="filled"] { padding: var(--ab-button-padding, 6px 16px); border-radius: var(--ab-button-radius, 999px); } /* ๐ */
|
|
172
|
+
.abButton[data-type="outlined"] {
|
|
173
|
+
padding: var(--ab-button-padding, 8px 16px); /* ๐ฆ */
|
|
174
|
+
border: 2px solid var(--ab-button-outline-color, var(--outline-color)); /* โ */
|
|
175
|
+
opacity: var(--ab-button-opacity, var(--opacity-text-inactive, 1)); /* ๐ซ๏ธ theme look (hover โ 1 via the theme) */
|
|
176
|
+
}
|
|
177
|
+
.abButton[data-type="outlined"]:not(:disabled, [aria-disabled="true"]):is(:hover, :focus-visible) { opacity: 1; } /* ๐ */
|
|
178
|
+
@media (width >= 460px) {
|
|
179
|
+
.abButton[data-type] { padding: var(--ab-button-padding, 8px 16px); font-size: var(--ab-button-font-size, 20px); } /* ๐ฑโ๐ฅ๏ธ the theme's โฅ 460px size */
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* ๐ 0.1.13 (Joseph #7): link mode colours. The theme paints `button[data-type]` and `a[role="button"][data-type]`,
|
|
183
|
+
* but a real link (no role=button: it navigates) matches neither, so it takes the colours here (box: above). */
|
|
164
184
|
a.abButton[data-type="contained"] {
|
|
165
185
|
background: var(--ab-button-background-color, var(--primary-container-color)); /* ๐จ */
|
|
166
186
|
color: var(--ab-button-text-color, var(--on-primary-container-color)); /* ๐๏ธ */
|
|
@@ -168,17 +188,6 @@ a.abButton[data-type="contained"] {
|
|
|
168
188
|
a.abButton[data-type="filled"] {
|
|
169
189
|
background: var(--ab-button-background-color, var(--md-sys-color-primary)); /* ๐ฅ */
|
|
170
190
|
color: var(--ab-button-text-color, var(--md-sys-color-on-primary)); /* ๐๏ธ */
|
|
171
|
-
padding: var(--ab-button-padding, 6px 16px); /* ๐ฆ */
|
|
172
|
-
border-radius: var(--ab-button-radius, 999px); /* ๐ */
|
|
173
|
-
font-size: 18px; /* ๐ค */
|
|
174
|
-
line-height: 32px; /* ๐ */
|
|
175
|
-
}
|
|
176
|
-
a.abButton[data-type="outlined"] {
|
|
177
|
-
border: 2px solid var(--ab-button-outline-color, var(--outline-color)); /* โ */
|
|
178
|
-
border-radius: 8px; /* ๐ฒ */
|
|
179
|
-
padding: 8px 16px; /* ๐ฆ */
|
|
180
|
-
font-size: 18px; /* ๐ค */
|
|
181
|
-
line-height: 32px; /* ๐ */
|
|
182
191
|
}
|
|
183
192
|
a.abButton.abButtonRounded { border-radius: 9999px; } /* ๐ */
|
|
184
193
|
|
|
@@ -217,6 +226,63 @@ a.abButton.abButtonRounded { border-radius: 9999px; } /* ๐ */
|
|
|
217
226
|
.abButton.abButton[data-size="md"] { height: var(--ab-button-height-touch, 44px); }
|
|
218
227
|
.abButton.abButton[data-shape="rounded"][data-size="md"] { font-size: 14.5px; }
|
|
219
228
|
}
|
|
229
|
+
/* ๐ 0.2.3 (God 04:12): size="lg" = the v6 Welcome CTA box (welcome-v6/_src/build.py `.btn` + `.lap .f8 .btn`):
|
|
230
|
+
* mobile 52px ยท 0 24px ยท 16px/600 ยท radius 12px ยท gap 10px โ laptop (โฅ 1180px, core's laptop breakpoint) 56px ยท 0 30px ยท 17px.
|
|
231
|
+
* Triple class (0,4,0) + later than shape="rounded", so it wins over rounded's padding / radius / font. */
|
|
232
|
+
.abButton.abButton.abButton[data-size="lg"] {
|
|
233
|
+
box-sizing: border-box; /* ๐ฆ */
|
|
234
|
+
height: var(--ab-button-height-lg, 52px); min-height: var(--ab-button-height-lg, 52px); /* ๐ */
|
|
235
|
+
padding: 0 var(--ab-button-padding-inline-lg, 24px); /* ๐ฆ */
|
|
236
|
+
border-radius: var(--ab-button-radius-lg, 12px); /* ๐ฒ */
|
|
237
|
+
font-size: var(--ab-button-font-size-lg, 16px); font-weight: var(--ab-button-font-weight-lg, 600); line-height: 1; /* ๐ค */
|
|
238
|
+
gap: var(--ab-button-gap-lg, 10px); white-space: nowrap; /* ๐งฑ */
|
|
239
|
+
}
|
|
240
|
+
@media (width >= 1180px) {
|
|
241
|
+
.abButton.abButton.abButton[data-size="lg"] {
|
|
242
|
+
height: var(--ab-button-height-lg-laptop, 56px); min-height: var(--ab-button-height-lg-laptop, 56px); /* ๐ป */
|
|
243
|
+
padding: 0 var(--ab-button-padding-inline-lg-laptop, 30px); font-size: var(--ab-button-font-size-lg-laptop, 17px); /* ๐ป */
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/* ๐ฅ 0.2.3 (God 04:12): color="bronze" = v6 `.btn.p` (any type / shape). Same values in dark (v6 dark uses the same bronze).
|
|
247
|
+
* Quad class (0,5,0) + later than rounded+filled, so it wins over the rounded primary paint. */
|
|
248
|
+
.abButton.abButton.abButton.abButton[data-color="bronze"] {
|
|
249
|
+
background: var(--ab-button-bronze-background, var(--ab-color-bronze, #a67c52)); /* ๐จ */
|
|
250
|
+
color: var(--ab-button-bronze-text-color, var(--ab-color-on-bronze, #fff8f5)); /* ๐๏ธ */
|
|
251
|
+
border: 0; opacity: 1; /* โ */
|
|
252
|
+
box-shadow: var(--ab-button-bronze-shadow, 0 8px 24px rgba(166, 124, 82, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2)); /* โจ v6 exact */
|
|
253
|
+
}
|
|
254
|
+
.abButton.abButton.abButton.abButton[data-color="bronze"]:not(:disabled, [aria-disabled="true"]):hover {
|
|
255
|
+
background: var(--ab-button-bronze-background-hover, color-mix(in srgb, var(--ab-color-bronze, #a67c52) 90%, #000)); /* ๐ฑ๏ธ */
|
|
256
|
+
}
|
|
257
|
+
.abButton.abButton.abButton.abButton[data-color="bronze"]:not(:disabled, [aria-disabled="true"]):active {
|
|
258
|
+
background: var(--ab-button-bronze-background-active, color-mix(in srgb, var(--ab-color-bronze, #a67c52) 82%, #000)); /* ๐ */
|
|
259
|
+
box-shadow: var(--ab-button-bronze-shadow-active, 0 4px 12px rgba(166, 124, 82, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2));
|
|
260
|
+
transform: translateY(1px);
|
|
261
|
+
}
|
|
262
|
+
.abButton.abButton.abButton.abButton[data-color="bronze"]:focus-visible {
|
|
263
|
+
outline: 2px solid var(--ab-button-bronze-focus-ring, var(--ab-color-bronze-text, #8a6440)); outline-offset: 2px; /* โฟ AA ring (light #8a6440 / dark #d9ab7f) */
|
|
264
|
+
}
|
|
265
|
+
.abButton.abButton.abButton.abButton[data-color="bronze"]:is(:disabled, [aria-disabled="true"]) {
|
|
266
|
+
opacity: var(--ab-button-disabled-opacity, 0.5); box-shadow: none; cursor: not-allowed; /* ๐ซ */
|
|
267
|
+
}
|
|
268
|
+
/* ๐ 0.2.3 (God 04:16): color="card" = v6 `.btn.s` (Continue with GitHub): 1px --line border on --card, --fg text.
|
|
269
|
+
* Opt-in only: plain outlined buttons are untouched. v6 โ theme: --line โ --ab-color-line, --card โ --ab-color-card,
|
|
270
|
+
* --fg โ --ab-color-text. v6 has no hover for .btn.s, so hover = the secondary button's 8% bronze tint over the card. */
|
|
271
|
+
.abButton.abButton.abButton.abButton[data-color="card"] {
|
|
272
|
+
border: var(--ab-button-outline-width, 1px) solid var(--ab-button-outline-color, var(--ab-color-line, rgb(107 79 53 / 16%))); /* โ */
|
|
273
|
+
background: var(--ab-button-background, var(--ab-color-card, #fff)); /* ๐ */
|
|
274
|
+
color: var(--ab-button-text-color, var(--ab-color-text, #211a16)); /* ๐๏ธ */
|
|
275
|
+
opacity: 1; box-shadow: none; /* ๐ซฅ no inactive fade, no shadow */
|
|
276
|
+
}
|
|
277
|
+
.abButton.abButton.abButton.abButton[data-color="card"]:not(:disabled, [aria-disabled="true"]):hover {
|
|
278
|
+
background: var(--ab-button-background-hover, linear-gradient(var(--ab-color-hover, rgb(166 124 82 / 0.08)), var(--ab-color-hover, rgb(166 124 82 / 0.08))) var(--ab-color-card, #fff)); /* ๐ฑ๏ธ */
|
|
279
|
+
}
|
|
280
|
+
.abButton.abButton.abButton.abButton[data-color="card"]:not(:disabled, [aria-disabled="true"]):active { transform: translateY(1px); } /* ๐ */
|
|
281
|
+
.abButton.abButton.abButton.abButton[data-color="card"]:focus-visible { outline: 2px solid var(--ab-color-bronze-text, #8a6440); outline-offset: 2px; } /* โฟ */
|
|
282
|
+
.abButton.abButton.abButton.abButton[data-color="card"]:is(:disabled, [aria-disabled="true"]) { opacity: var(--ab-button-disabled-opacity, 0.5); cursor: not-allowed; } /* ๐ซ */
|
|
283
|
+
@media (prefers-reduced-motion: reduce) {
|
|
284
|
+
.abButton.abButton.abButton.abButton:is([data-color="bronze"], [data-color="card"]):active { transform: none; } /* โฟ */
|
|
285
|
+
}
|
|
220
286
|
@media (prefers-reduced-motion: reduce) {
|
|
221
287
|
.abButton.abButton[data-shape="rounded"]:active { transform: none; } /* โฟ no nudge */
|
|
222
288
|
}
|