ab-nextjs-components 0.2.3 → 0.3.1

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.
@@ -1,38 +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 - Client (port of lyd-test-hello)
10
- * @file: ab-test-hello/index.tsx
11
- * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
12
- */
13
-
14
- 'use client';
15
-
16
- import type { ReactElement } from 'react';
17
- import clsx from 'clsx';
18
- import styles from './styles.module.css';
19
-
20
- export interface AbTestHelloProps {
21
- name: string;
22
- src?: string;
23
- className?: string;
24
- }
25
-
26
- const AbTestHello = ({ name, src, className }: AbTestHelloProps): ReactElement => {
27
- return (
28
- <div id="abTestHello" className={clsx('AbTestHello', styles.abTestHello, className)}>
29
- <h2 className={styles.abTestHelloTitle}>
30
- Hello from <span className={styles.abTestHelloName}>{name}</span>
31
- </h2>
32
- {src ? <span className={styles.abTestHelloSrc}>{src}</span> : null}
33
- </div>
34
- );
35
- };
36
-
37
- export default AbTestHello;
38
- export { AbTestHello };
@@ -1,57 +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: 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
- }
55
- .abTestHelloSrc:hover {
56
- opacity: 0.9;
57
- }
@@ -1,60 +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: AbKeyFeature - Server (port of lyd-key-feature)
10
- * @file: server/ab-key-feature/index.tsx
11
- * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
12
- */
13
-
14
-
15
- import type { ReactElement } from 'react';
16
- import Link from '../../ab-link'; // 🔗 G42: injectable via AbLinkProvider (default next/link)
17
- import clsx from 'clsx';
18
- import styles from './styles.module.css';
19
-
20
- export interface AbKeyFeatureProps {
21
- className?: string;
22
- hidden?: boolean;
23
- icon: string;
24
- name: string;
25
- title: string;
26
- description?: string;
27
- linkHidden?: boolean;
28
- linkLabel?: string;
29
- link?: string;
30
- watermark?: string;
31
- }
32
-
33
- const AbKeyFeature = ({
34
- className,
35
- hidden = false,
36
- icon,
37
- name,
38
- title,
39
- description,
40
- linkHidden = false,
41
- linkLabel = 'Learn more',
42
- link,
43
- watermark,
44
- }: AbKeyFeatureProps): ReactElement => {
45
- return (
46
- <article hidden={hidden} className={clsx('AbKeyFeature', styles.abKeyFeature, className)}>
47
- <span className={clsx('material-symbols-rounded', styles.abKeyFeatureIcon)} aria-hidden>{icon}</span>
48
- <span className={styles.abKeyFeatureName}>{name}</span>
49
- <h3 className={styles.abKeyFeatureTitle}>{title}</h3>
50
- {description ? <p className={styles.abKeyFeatureDesc}>{description}</p> : null}
51
- {!linkHidden && link ? (
52
- <Link href={link} className={styles.abKeyFeatureLink}>{linkLabel}</Link>
53
- ) : null}
54
- {watermark ? <span className={styles.abKeyFeatureWatermark} aria-hidden>{watermark}</span> : null}
55
- </article>
56
- );
57
- };
58
-
59
- export default AbKeyFeature;
60
- export { AbKeyFeature };
@@ -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,57 +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
- }
55
- .abTestHelloSrc:hover {
56
- opacity: 0.9;
57
- }