@affinda/react 0.0.19 → 0.0.21
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 +92 -3
- package/dist/components/PaperclipDecoration.d.ts +17 -3
- package/dist/components/PaperclipDecoration.js +14 -4
- package/dist/generated/components.d.ts +6 -0
- package/dist/generated/components.js +18 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -115,6 +115,10 @@ import { Button, Heading, TypographyLockup } from '@affinda/react';
|
|
|
115
115
|
- **TestimonialCarousel** / AfTestimonialCarousel - Carousel for sliding between multiple testimonials
|
|
116
116
|
- **TestimonialStat** / AfTestimonialStat - Individual statistics within testimonials
|
|
117
117
|
|
|
118
|
+
**Feature Showcase:**
|
|
119
|
+
- **FeatureAccordion** / AfFeatureAccordion - Expandable accordion with auto-cycling timer and image display
|
|
120
|
+
- **CtaSection** / AfCtaSection - Call-to-action section with illustration and buttons
|
|
121
|
+
|
|
118
122
|
**Brand:**
|
|
119
123
|
- **Logo** / AfLogo - Affinda logo component
|
|
120
124
|
|
|
@@ -327,12 +331,12 @@ import { HeroSection, PaperclipDecoration } from '@affinda/react';
|
|
|
327
331
|
**Button**
|
|
328
332
|
- Primary actions: Use `variant="primary"` (sparingly, 1-2 per screen)
|
|
329
333
|
- Secondary actions: Use `variant="secondary"`
|
|
330
|
-
- Sizes: `small`, `default
|
|
334
|
+
- Sizes: `small`, `default`
|
|
331
335
|
- Can include icons in left or right slots
|
|
332
336
|
- On dark backgrounds, pass `darkBackground={true}` so borders/text flip automatically
|
|
333
337
|
|
|
334
338
|
```tsx
|
|
335
|
-
<Button variant="primary"
|
|
339
|
+
<Button variant="primary">Sign Up Now</Button>
|
|
336
340
|
<Button variant="secondary">Learn More</Button>
|
|
337
341
|
```
|
|
338
342
|
|
|
@@ -430,6 +434,72 @@ Site-wide navigation header with responsive design and mobile menu support.
|
|
|
430
434
|
- Variant: `"01"` (primary links), `"02"` (secondary/utility links)
|
|
431
435
|
- Variant: Controls visual style
|
|
432
436
|
|
|
437
|
+
#### Feature Showcase
|
|
438
|
+
|
|
439
|
+
**FeatureAccordion**
|
|
440
|
+
- Expandable accordion for showcasing product features
|
|
441
|
+
- Auto-cycles through items with a visual progress timer
|
|
442
|
+
- Displays accompanying images that change with each item
|
|
443
|
+
- Timer resets when user clicks an item
|
|
444
|
+
|
|
445
|
+
```tsx
|
|
446
|
+
import { FeatureAccordion } from '@affinda/react';
|
|
447
|
+
|
|
448
|
+
<FeatureAccordion
|
|
449
|
+
heading="Give AI agents your paperwork"
|
|
450
|
+
items={JSON.stringify([
|
|
451
|
+
{
|
|
452
|
+
title: "Automate document processing with 99%+ accuracy",
|
|
453
|
+
description: "Extract any information from any document with industry-leading precision.",
|
|
454
|
+
imageUrl: "https://example.com/feature1.jpg",
|
|
455
|
+
imageAlt: "Document automation"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
title: "Build models in minutes, not months",
|
|
459
|
+
description: "Affinda learns instantly from every interaction.",
|
|
460
|
+
imageUrl: "https://example.com/feature2.jpg",
|
|
461
|
+
imageAlt: "Fast model building"
|
|
462
|
+
}
|
|
463
|
+
])}
|
|
464
|
+
cycleInterval={6000}
|
|
465
|
+
autoCycle={true}
|
|
466
|
+
/>
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
**Props:**
|
|
470
|
+
- `heading`: Section heading text
|
|
471
|
+
- `items`: JSON string array of accordion items (title, description, imageUrl, imageAlt)
|
|
472
|
+
- `cycleInterval`: Auto-cycle interval in milliseconds (default: 6000)
|
|
473
|
+
- `autoCycle`: Enable/disable auto-cycling (default: true)
|
|
474
|
+
|
|
475
|
+
**CtaSection**
|
|
476
|
+
- Call-to-action section with illustration and decorative background
|
|
477
|
+
- Styled to match the affinda.com design
|
|
478
|
+
|
|
479
|
+
```tsx
|
|
480
|
+
import { CtaSection } from '@affinda/react';
|
|
481
|
+
import { getIllustrationUrlByScene } from '@affinda/illustrations';
|
|
482
|
+
|
|
483
|
+
<CtaSection
|
|
484
|
+
heading="See what our AI agents can do for you"
|
|
485
|
+
description="Upload your documents and watch our AI agents get to work."
|
|
486
|
+
primaryButtonText="Try for free"
|
|
487
|
+
primaryButtonUrl="https://app.affinda.com/auth/register"
|
|
488
|
+
secondaryButtonText="Talk to us"
|
|
489
|
+
secondaryButtonUrl="/contact"
|
|
490
|
+
illustrationUrl={getIllustrationUrlByScene('automate', 'inkwell')}
|
|
491
|
+
/>
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
**Props:**
|
|
495
|
+
- `heading`: Section heading text
|
|
496
|
+
- `description`: Description text below heading
|
|
497
|
+
- `primaryButtonText`: Text for primary CTA button
|
|
498
|
+
- `primaryButtonUrl`: URL for primary button
|
|
499
|
+
- `secondaryButtonText`: Text for secondary button
|
|
500
|
+
- `secondaryButtonUrl`: URL for secondary button
|
|
501
|
+
- `illustrationUrl`: URL to illustration image (use @affinda/illustrations)
|
|
502
|
+
|
|
433
503
|
#### Social Proof & Testimonials
|
|
434
504
|
|
|
435
505
|
**Testimonial**
|
|
@@ -682,10 +752,29 @@ When generating Affinda UI code:
|
|
|
682
752
|
|
|
683
753
|
4. **Never use purple colors** - those were placeholder colors and have been removed
|
|
684
754
|
|
|
755
|
+
## Using Illustrations
|
|
756
|
+
|
|
757
|
+
The `@affinda/illustrations` package provides themed illustration assets:
|
|
758
|
+
|
|
759
|
+
```tsx
|
|
760
|
+
import { getIllustrationUrlByScene } from '@affinda/illustrations';
|
|
761
|
+
|
|
762
|
+
// Available scenes: 'document-raise', 'thinking', 'shapes', 'team-leader',
|
|
763
|
+
// 'grow-business', 'document-type', 'industries', 'accuracy', 'intelligence',
|
|
764
|
+
// 'page-turn', 'automate'
|
|
765
|
+
|
|
766
|
+
// Available themes: 'white-ivory', 'mist-green', 'soft-clay', 'inkwell'
|
|
767
|
+
|
|
768
|
+
<img
|
|
769
|
+
src={getIllustrationUrlByScene('automate', 'inkwell')}
|
|
770
|
+
alt="Automation illustration"
|
|
771
|
+
/>
|
|
772
|
+
```
|
|
773
|
+
|
|
685
774
|
## Related Packages
|
|
686
775
|
|
|
687
776
|
- **@affinda/wc** - Core web components (used internally)
|
|
688
777
|
- **@affinda/tokens** - Design tokens (colors, spacing, typography)
|
|
689
778
|
- **@affinda/icons** - Icon library
|
|
690
|
-
- **@affinda/illustrations** - Illustration assets
|
|
779
|
+
- **@affinda/illustrations** - Illustration assets (install separately: `npm install @affinda/illustrations`)
|
|
691
780
|
- **@affinda/css** - Base CSS styles
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
export interface PaperclipDecorationProps {
|
|
2
3
|
className?: string;
|
|
3
|
-
style?:
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
/** Slot name for use inside web components like HeroSection */
|
|
6
|
+
slot?: string;
|
|
4
7
|
}
|
|
5
8
|
/**
|
|
6
|
-
* Decorative paperclip vector graphic for hero sections
|
|
9
|
+
* Decorative paperclip vector graphic for hero sections.
|
|
10
|
+
*
|
|
11
|
+
* When used inside HeroSection, pass slot="decoration" and position with style:
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <HeroSection variant="dark" withDecoration={true}>
|
|
15
|
+
* <PaperclipDecoration
|
|
16
|
+
* slot="decoration"
|
|
17
|
+
* style={{ position: 'absolute', bottom: -80, right: -800 }}
|
|
18
|
+
* />
|
|
19
|
+
* <Heading>...</Heading>
|
|
20
|
+
* </HeroSection>
|
|
7
21
|
*/
|
|
8
|
-
export declare function PaperclipDecoration({ className, style }: PaperclipDecorationProps): any;
|
|
22
|
+
export declare function PaperclipDecoration({ className, style, slot }: PaperclipDecorationProps): any;
|
|
@@ -2,9 +2,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
/**
|
|
5
|
-
* Decorative paperclip vector graphic for hero sections
|
|
5
|
+
* Decorative paperclip vector graphic for hero sections.
|
|
6
|
+
*
|
|
7
|
+
* When used inside HeroSection, pass slot="decoration" and position with style:
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <HeroSection variant="dark" withDecoration={true}>
|
|
11
|
+
* <PaperclipDecoration
|
|
12
|
+
* slot="decoration"
|
|
13
|
+
* style={{ position: 'absolute', bottom: -80, right: -800 }}
|
|
14
|
+
* />
|
|
15
|
+
* <Heading>...</Heading>
|
|
16
|
+
* </HeroSection>
|
|
6
17
|
*/
|
|
7
|
-
export function PaperclipDecoration({ className, style }) {
|
|
8
|
-
|
|
9
|
-
return (_jsx("svg", { preserveAspectRatio: "none", width: "100%", height: "100%", style: style, viewBox: "0 0 1212 753", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, "aria-hidden": true, children: _jsx("path", { d: "M1102.14 107.875C1031.8 37.1138 939.128 -1.47247 840.61 0.0430067H358.674L262.104 156.72H841.87C842.558 156.72 843.36 156.72 844.047 156.72C900.638 156.72 953.791 178.869 994 219.32C1035.24 260.821 1058.04 316.311 1058.04 375.647C1058.04 497.468 960.665 596.44 841.068 596.44H251.335C197.609 596.44 153.848 551.908 153.848 497.235C153.848 442.561 197.723 397.33 251.221 395.698H779.208L878.872 239.021H248.586C111.577 242.519 0 358.277 0 497.235C0 636.192 112.723 753 251.335 753H841.068C1045.55 753 1212 583.617 1212 375.531C1212 273.994 1173.05 178.985 1102.26 107.758L1102.14 107.875Z", fill: "white", fillOpacity: 0.06 }) }));
|
|
18
|
+
export function PaperclipDecoration({ className, style, slot }) {
|
|
19
|
+
return (_jsx("svg", { preserveAspectRatio: "none", width: "100%", height: "100%", style: style, viewBox: "0 0 1212 753", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, "aria-hidden": true, slot: slot, children: _jsx("path", { d: "M1102.14 107.875C1031.8 37.1138 939.128 -1.47247 840.61 0.0430067H358.674L262.104 156.72H841.87C842.558 156.72 843.36 156.72 844.047 156.72C900.638 156.72 953.791 178.869 994 219.32C1035.24 260.821 1058.04 316.311 1058.04 375.647C1058.04 497.468 960.665 596.44 841.068 596.44H251.335C197.609 596.44 153.848 551.908 153.848 497.235C153.848 442.561 197.723 397.33 251.221 395.698H779.208L878.872 239.021H248.586C111.577 242.519 0 358.277 0 497.235C0 636.192 112.723 753 251.335 753H841.068C1045.55 753 1212 583.617 1212 375.531C1212 273.994 1173.05 178.985 1102.26 107.758L1102.14 107.875Z", fill: "white", fillOpacity: 0.06 }) }));
|
|
10
20
|
}
|
|
@@ -9,6 +9,8 @@ import { AfCard as AfCardElement } from "@affinda/wc/dist/components/af-card.js"
|
|
|
9
9
|
import { AfClientCarousel as AfClientCarouselElement } from "@affinda/wc/dist/components/af-client-carousel.js";
|
|
10
10
|
import { AfColorSwatch as AfColorSwatchElement } from "@affinda/wc/dist/components/af-color-swatch.js";
|
|
11
11
|
import { AfContainer as AfContainerElement } from "@affinda/wc/dist/components/af-container.js";
|
|
12
|
+
import { AfCtaSection as AfCtaSectionElement } from "@affinda/wc/dist/components/af-cta-section.js";
|
|
13
|
+
import { AfFeatureAccordion as AfFeatureAccordionElement } from "@affinda/wc/dist/components/af-feature-accordion.js";
|
|
12
14
|
import { AfHeading as AfHeadingElement } from "@affinda/wc/dist/components/af-heading.js";
|
|
13
15
|
import { AfHeroSection as AfHeroSectionElement } from "@affinda/wc/dist/components/af-hero-section.js";
|
|
14
16
|
import { AfIconButton as AfIconButtonElement } from "@affinda/wc/dist/components/af-icon-button.js";
|
|
@@ -37,6 +39,10 @@ export type AfColorSwatchEvents = NonNullable<unknown>;
|
|
|
37
39
|
export declare const AfColorSwatch: StencilReactComponent<AfColorSwatchElement, AfColorSwatchEvents>;
|
|
38
40
|
export type AfContainerEvents = NonNullable<unknown>;
|
|
39
41
|
export declare const AfContainer: StencilReactComponent<AfContainerElement, AfContainerEvents>;
|
|
42
|
+
export type AfCtaSectionEvents = NonNullable<unknown>;
|
|
43
|
+
export declare const AfCtaSection: StencilReactComponent<AfCtaSectionElement, AfCtaSectionEvents>;
|
|
44
|
+
export type AfFeatureAccordionEvents = NonNullable<unknown>;
|
|
45
|
+
export declare const AfFeatureAccordion: StencilReactComponent<AfFeatureAccordionElement, AfFeatureAccordionEvents>;
|
|
40
46
|
export type AfHeadingEvents = NonNullable<unknown>;
|
|
41
47
|
export declare const AfHeading: StencilReactComponent<AfHeadingElement, AfHeadingEvents>;
|
|
42
48
|
export type AfHeroSectionEvents = NonNullable<unknown>;
|
|
@@ -11,6 +11,8 @@ import { AfCard as AfCardElement, defineCustomElement as defineAfCard } from "@a
|
|
|
11
11
|
import { AfClientCarousel as AfClientCarouselElement, defineCustomElement as defineAfClientCarousel } from "@affinda/wc/dist/components/af-client-carousel.js";
|
|
12
12
|
import { AfColorSwatch as AfColorSwatchElement, defineCustomElement as defineAfColorSwatch } from "@affinda/wc/dist/components/af-color-swatch.js";
|
|
13
13
|
import { AfContainer as AfContainerElement, defineCustomElement as defineAfContainer } from "@affinda/wc/dist/components/af-container.js";
|
|
14
|
+
import { AfCtaSection as AfCtaSectionElement, defineCustomElement as defineAfCtaSection } from "@affinda/wc/dist/components/af-cta-section.js";
|
|
15
|
+
import { AfFeatureAccordion as AfFeatureAccordionElement, defineCustomElement as defineAfFeatureAccordion } from "@affinda/wc/dist/components/af-feature-accordion.js";
|
|
14
16
|
import { AfHeading as AfHeadingElement, defineCustomElement as defineAfHeading } from "@affinda/wc/dist/components/af-heading.js";
|
|
15
17
|
import { AfHeroSection as AfHeroSectionElement, defineCustomElement as defineAfHeroSection } from "@affinda/wc/dist/components/af-hero-section.js";
|
|
16
18
|
import { AfIconButton as AfIconButtonElement, defineCustomElement as defineAfIconButton } from "@affinda/wc/dist/components/af-icon-button.js";
|
|
@@ -82,6 +84,22 @@ export const AfContainer = /*@__PURE__*/ createComponent({
|
|
|
82
84
|
events: {},
|
|
83
85
|
defineCustomElement: defineAfContainer
|
|
84
86
|
});
|
|
87
|
+
export const AfCtaSection = /*@__PURE__*/ createComponent({
|
|
88
|
+
tagName: 'af-cta-section',
|
|
89
|
+
elementClass: AfCtaSectionElement,
|
|
90
|
+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
91
|
+
react: React,
|
|
92
|
+
events: {},
|
|
93
|
+
defineCustomElement: defineAfCtaSection
|
|
94
|
+
});
|
|
95
|
+
export const AfFeatureAccordion = /*@__PURE__*/ createComponent({
|
|
96
|
+
tagName: 'af-feature-accordion',
|
|
97
|
+
elementClass: AfFeatureAccordionElement,
|
|
98
|
+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
99
|
+
react: React,
|
|
100
|
+
events: {},
|
|
101
|
+
defineCustomElement: defineAfFeatureAccordion
|
|
102
|
+
});
|
|
85
103
|
export const AfHeading = /*@__PURE__*/ createComponent({
|
|
86
104
|
tagName: 'af-heading',
|
|
87
105
|
elementClass: AfHeadingElement,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './generated/components.js';
|
|
2
|
-
export { AfAspectRatio as AspectRatio, AfButton as Button, AfButtonGroup as ButtonGroup, AfCard as Card, AfClientCarousel as ClientCarousel, AfColorSwatch as ColorSwatch, AfContainer as Container, AfHeading as Heading, AfHeroSection as HeroSection, AfIconButton as IconButton, AfLogo as Logo, AfLogoWell as LogoWell, AfNavItem as NavItem, AfNavbar as Navbar, AfSection as Section, AfText as Text, AfTestimonial as Testimonial, AfTestimonialCarousel as TestimonialCarousel, AfTestimonialStat as TestimonialStat, AfTypographyLockup as TypographyLockup } from './generated/components.js';
|
|
2
|
+
export { AfAspectRatio as AspectRatio, AfButton as Button, AfButtonGroup as ButtonGroup, AfCard as Card, AfClientCarousel as ClientCarousel, AfColorSwatch as ColorSwatch, AfContainer as Container, AfCtaSection as CtaSection, AfFeatureAccordion as FeatureAccordion, AfHeading as Heading, AfHeroSection as HeroSection, AfIconButton as IconButton, AfLogo as Logo, AfLogoWell as LogoWell, AfNavItem as NavItem, AfNavbar as Navbar, AfSection as Section, AfText as Text, AfTestimonial as Testimonial, AfTestimonialCarousel as TestimonialCarousel, AfTestimonialStat as TestimonialStat, AfTypographyLockup as TypographyLockup } from './generated/components.js';
|
|
3
3
|
export * from '@affinda/icons/react';
|
|
4
4
|
export { PaperclipDecoration } from './components/PaperclipDecoration';
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export * from './generated/components.js';
|
|
3
3
|
// Note: defineCustomElements should be imported directly from @affinda/wc/loader/index.js in your app
|
|
4
4
|
// Re-export components without the 'Af' prefix for cleaner React usage
|
|
5
|
-
export { AfAspectRatio as AspectRatio, AfButton as Button, AfButtonGroup as ButtonGroup, AfCard as Card, AfClientCarousel as ClientCarousel, AfColorSwatch as ColorSwatch, AfContainer as Container, AfHeading as Heading, AfHeroSection as HeroSection, AfIconButton as IconButton, AfLogo as Logo, AfLogoWell as LogoWell, AfNavItem as NavItem, AfNavbar as Navbar, AfSection as Section, AfText as Text, AfTestimonial as Testimonial, AfTestimonialCarousel as TestimonialCarousel, AfTestimonialStat as TestimonialStat, AfTypographyLockup as TypographyLockup } from './generated/components.js';
|
|
5
|
+
export { AfAspectRatio as AspectRatio, AfButton as Button, AfButtonGroup as ButtonGroup, AfCard as Card, AfClientCarousel as ClientCarousel, AfColorSwatch as ColorSwatch, AfContainer as Container, AfCtaSection as CtaSection, AfFeatureAccordion as FeatureAccordion, AfHeading as Heading, AfHeroSection as HeroSection, AfIconButton as IconButton, AfLogo as Logo, AfLogoWell as LogoWell, AfNavItem as NavItem, AfNavbar as Navbar, AfSection as Section, AfText as Text, AfTestimonial as Testimonial, AfTestimonialCarousel as TestimonialCarousel, AfTestimonialStat as TestimonialStat, AfTypographyLockup as TypographyLockup } from './generated/components.js';
|
|
6
6
|
// Re-export React icon components from icons package
|
|
7
7
|
export * from '@affinda/icons/react';
|
|
8
8
|
// Export custom React components
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@affinda/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@affinda/icons": "^0.0.3",
|
|
19
|
-
"@affinda/wc": "^0.0.
|
|
19
|
+
"@affinda/wc": "^0.0.12",
|
|
20
20
|
"@stencil/react-output-target": "^1.2.0"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|