ab-nextjs-components 0.2.2 → 0.3.0
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 +4 -12
- 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-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 -14
- package/package.json +9 -18
- package/server/ab-button/index.tsx +3 -2
- package/server/index.ts +0 -3
- package/types/index.d.ts +8 -6
- package/ab-key-feature/index.tsx +0 -61
- package/ab-key-feature/styles.module.css +0 -79
- package/ab-main-headline/index.tsx +0 -58
- package/ab-main-headline/styles.module.css +0 -56
- package/ab-preview/index.tsx +0 -79
- package/ab-preview/styles.module.css +0 -58
- package/ab-switch-back/index.tsx +0 -73
- package/ab-switch-back/styles.module.css +0 -77
- package/ab-test-hello/index.tsx +0 -38
- package/ab-test-hello/styles.module.css +0 -57
- package/server/ab-button/styles.module.css +0 -191
- package/server/ab-key-feature/index.tsx +0 -60
- package/server/ab-key-feature/styles.module.css +0 -79
- package/server/ab-switch-back/index.tsx +0 -72
- package/server/ab-switch-back/styles.module.css +0 -77
- package/server/ab-test-hello/index.tsx +0 -36
- package/server/ab-test-hello/styles.module.css +0 -54
|
@@ -1,79 +0,0 @@
|
|
|
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: styles.module.css
|
|
28
|
-
* @file: server/ab-key-feature/styles.module.css
|
|
29
|
-
* @type: CSS Stylesheet
|
|
30
|
-
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
.abKeyFeature {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: column;
|
|
36
|
-
gap: 0.5rem;
|
|
37
|
-
padding: 1rem;
|
|
38
|
-
border-radius: 1rem;
|
|
39
|
-
position: relative;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
background: color-mix(in srgb, var(--ab-surface-container, #f3edf7) 85%, transparent);
|
|
42
|
-
}
|
|
43
|
-
.abKeyFeatureIcon {
|
|
44
|
-
font-size: 2rem;
|
|
45
|
-
color: var(--ab-primary, #6750a4);
|
|
46
|
-
}
|
|
47
|
-
.abKeyFeatureName {
|
|
48
|
-
font-size: 0.75rem;
|
|
49
|
-
font-weight: 700;
|
|
50
|
-
text-transform: uppercase;
|
|
51
|
-
letter-spacing: 0.06em;
|
|
52
|
-
opacity: 0.7;
|
|
53
|
-
}
|
|
54
|
-
.abKeyFeatureTitle {
|
|
55
|
-
margin: 0;
|
|
56
|
-
font-size: 1.25rem;
|
|
57
|
-
font-weight: 700;
|
|
58
|
-
}
|
|
59
|
-
.abKeyFeatureDesc {
|
|
60
|
-
margin: 0;
|
|
61
|
-
font-size: 0.9375rem;
|
|
62
|
-
opacity: 0.8;
|
|
63
|
-
}
|
|
64
|
-
.abKeyFeatureLink {
|
|
65
|
-
margin-top: 0.5rem;
|
|
66
|
-
align-self: flex-start;
|
|
67
|
-
color: var(--ab-primary, #6750a4);
|
|
68
|
-
font-weight: 600;
|
|
69
|
-
text-decoration: none;
|
|
70
|
-
}
|
|
71
|
-
.abKeyFeatureWatermark {
|
|
72
|
-
position: absolute;
|
|
73
|
-
right: -0.5rem;
|
|
74
|
-
bottom: -0.5rem;
|
|
75
|
-
font-size: 5rem;
|
|
76
|
-
opacity: 0.06;
|
|
77
|
-
pointer-events: none;
|
|
78
|
-
user-select: none;
|
|
79
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @license MIT
|
|
3
|
-
* ~~~~~~~~~~~~
|
|
4
|
-
* ab-nextjs-components
|
|
5
|
-
* ~~~~~~~~~~~~
|
|
6
|
-
* Copyright (c) 2026 Abraham Ukachi. The abElements Project.
|
|
7
|
-
*
|
|
8
|
-
* @project: ab-nextjs-components
|
|
9
|
-
* @name: AbSwitchBack - Server (port of lyd-switch-back)
|
|
10
|
-
* @file: server/ab-switch-back/index.tsx
|
|
11
|
-
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
16
|
-
import Link from '../../ab-link'; // 🔗 G42: injectable via AbLinkProvider (default next/link)
|
|
17
|
-
import Image from 'next/image';
|
|
18
|
-
import clsx from 'clsx';
|
|
19
|
-
import styles from './styles.module.css';
|
|
20
|
-
|
|
21
|
-
export interface AbSwitchBackProps {
|
|
22
|
-
className?: string;
|
|
23
|
-
hidden?: boolean;
|
|
24
|
-
switched?: boolean;
|
|
25
|
-
image: string;
|
|
26
|
-
imageAlt: string;
|
|
27
|
-
title?: ReactNode;
|
|
28
|
-
description?: ReactNode;
|
|
29
|
-
cta1Label: string;
|
|
30
|
-
cta1Link: string;
|
|
31
|
-
cta2Label: string;
|
|
32
|
-
cta2Link: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const AbSwitchBack = ({
|
|
36
|
-
className,
|
|
37
|
-
hidden = false,
|
|
38
|
-
switched = false,
|
|
39
|
-
image,
|
|
40
|
-
imageAlt,
|
|
41
|
-
title,
|
|
42
|
-
description,
|
|
43
|
-
cta1Label,
|
|
44
|
-
cta1Link,
|
|
45
|
-
cta2Label,
|
|
46
|
-
cta2Link,
|
|
47
|
-
}: AbSwitchBackProps): ReactElement => {
|
|
48
|
-
return (
|
|
49
|
-
<section
|
|
50
|
-
hidden={hidden}
|
|
51
|
-
data-switched={switched ? 'true' : 'false'}
|
|
52
|
-
className={clsx('AbSwitchBack', styles.abSwitchBack, className)}
|
|
53
|
-
>
|
|
54
|
-
<div className={styles.abSwitchBackMedia}>
|
|
55
|
-
<Image className={styles.abSwitchBackImage} src={image} alt={imageAlt} width={800} height={600} unoptimized />
|
|
56
|
-
</div>
|
|
57
|
-
<div className={styles.abSwitchBackCopy}>
|
|
58
|
-
{title ? <h2 className={styles.abSwitchBackTitle}>{title}</h2> : null}
|
|
59
|
-
{description ? <div className={styles.abSwitchBackDesc}>{description}</div> : null}
|
|
60
|
-
<div className={styles.abSwitchBackActions}>
|
|
61
|
-
<Link href={cta1Link} className={styles.abSwitchBackCta}>{cta1Label}</Link>
|
|
62
|
-
<Link href={cta2Link} className={clsx(styles.abSwitchBackCta, styles.abSwitchBackCtaSecondary)}>
|
|
63
|
-
{cta2Label}
|
|
64
|
-
</Link>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</section>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export default AbSwitchBack;
|
|
72
|
-
export { AbSwitchBack };
|
|
@@ -1,77 +0,0 @@
|
|
|
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: styles.module.css
|
|
28
|
-
* @file: server/ab-switch-back/styles.module.css
|
|
29
|
-
* @type: CSS Stylesheet
|
|
30
|
-
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
.abSwitchBack {
|
|
34
|
-
display: grid;
|
|
35
|
-
grid-template-columns: 1fr;
|
|
36
|
-
gap: 1.25rem;
|
|
37
|
-
align-items: center;
|
|
38
|
-
}
|
|
39
|
-
@media (min-width: 768px) {
|
|
40
|
-
.abSwitchBack {
|
|
41
|
-
grid-template-columns: 1fr 1fr;
|
|
42
|
-
}
|
|
43
|
-
.abSwitchBack[data-switched='true'] .abSwitchBackMedia { order: 2; }
|
|
44
|
-
.abSwitchBack[data-switched='true'] .abSwitchBackCopy { order: 1; }
|
|
45
|
-
}
|
|
46
|
-
.abSwitchBackMedia {
|
|
47
|
-
position: relative;
|
|
48
|
-
width: 100%;
|
|
49
|
-
aspect-ratio: 4 / 3;
|
|
50
|
-
border-radius: 1rem;
|
|
51
|
-
overflow: hidden;
|
|
52
|
-
background: #ddd;
|
|
53
|
-
}
|
|
54
|
-
.abSwitchBackImage {
|
|
55
|
-
object-fit: cover;
|
|
56
|
-
width: 100%;
|
|
57
|
-
height: 100%;
|
|
58
|
-
}
|
|
59
|
-
.abSwitchBackCopy { display: flex; flex-direction: column; gap: 0.75rem; }
|
|
60
|
-
.abSwitchBackTitle { margin: 0; font-size: 1.5rem; font-weight: 700; }
|
|
61
|
-
.abSwitchBackDesc { margin: 0; opacity: 0.8; }
|
|
62
|
-
.abSwitchBackActions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
|
|
63
|
-
.abSwitchBackCta {
|
|
64
|
-
display: inline-flex;
|
|
65
|
-
align-items: center;
|
|
66
|
-
padding: 0.5rem 1rem;
|
|
67
|
-
border-radius: 9999px;
|
|
68
|
-
text-decoration: none;
|
|
69
|
-
font-weight: 600;
|
|
70
|
-
background: var(--ab-primary, #6750a4);
|
|
71
|
-
color: #fff;
|
|
72
|
-
}
|
|
73
|
-
.abSwitchBackCtaSecondary {
|
|
74
|
-
background: transparent;
|
|
75
|
-
color: var(--ab-primary, #6750a4);
|
|
76
|
-
border: 1px solid color-mix(in srgb, var(--ab-primary, #6750a4) 40%, transparent);
|
|
77
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @license MIT
|
|
3
|
-
* ~~~~~~~~~~~~
|
|
4
|
-
* ab-nextjs-components
|
|
5
|
-
* ~~~~~~~~~~~~
|
|
6
|
-
* Copyright (c) 2026 Abraham Ukachi. The abElements Project.
|
|
7
|
-
*
|
|
8
|
-
* @project: ab-nextjs-components
|
|
9
|
-
* @name: AbTestHello - Server (port of lyd-test-hello)
|
|
10
|
-
* @file: server/ab-test-hello/index.tsx
|
|
11
|
-
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import type { ReactElement } from 'react';
|
|
15
|
-
import clsx from 'clsx';
|
|
16
|
-
import styles from './styles.module.css';
|
|
17
|
-
|
|
18
|
-
export interface AbTestHelloProps {
|
|
19
|
-
name: string;
|
|
20
|
-
src?: string;
|
|
21
|
-
className?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const AbTestHello = ({ name, src, className }: AbTestHelloProps): ReactElement => {
|
|
25
|
-
return (
|
|
26
|
-
<div id="abTestHello" className={clsx('AbTestHello', styles.abTestHello, className)}>
|
|
27
|
-
<h2 className={styles.abTestHelloTitle}>
|
|
28
|
-
Hello from <span className={styles.abTestHelloName}>{name}</span>
|
|
29
|
-
</h2>
|
|
30
|
-
{src ? <span className={styles.abTestHelloSrc}>{src}</span> : null}
|
|
31
|
-
</div>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default AbTestHello;
|
|
36
|
-
export { AbTestHello };
|
|
@@ -1,54 +0,0 @@
|
|
|
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: styles.module.css
|
|
28
|
-
* @file: server/ab-test-hello/styles.module.css
|
|
29
|
-
* @type: CSS Stylesheet
|
|
30
|
-
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
.abTestHello {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: column;
|
|
36
|
-
align-items: flex-start;
|
|
37
|
-
text-align: left;
|
|
38
|
-
padding: 1.5rem;
|
|
39
|
-
}
|
|
40
|
-
.abTestHelloTitle {
|
|
41
|
-
margin: 0;
|
|
42
|
-
padding: 0.75rem 0 0.25rem;
|
|
43
|
-
font-size: 1rem;
|
|
44
|
-
}
|
|
45
|
-
.abTestHelloName {
|
|
46
|
-
font-family: ui-serif, Georgia, serif;
|
|
47
|
-
font-weight: 700;
|
|
48
|
-
color: var(--ab-primary, #6750a4);
|
|
49
|
-
}
|
|
50
|
-
.abTestHelloSrc {
|
|
51
|
-
font-family: ui-monospace, monospace;
|
|
52
|
-
font-size: 0.875rem;
|
|
53
|
-
opacity: 0.5;
|
|
54
|
-
}
|