@affinda/react 0.0.13 → 0.0.14

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 CHANGED
@@ -80,23 +80,121 @@ import { Button, Heading, TypographyLockup } from '@affinda/react';
80
80
 
81
81
  ### Available Components
82
82
 
83
- - **Button** / AfButton - Primary buttons with variants and icons
84
- - **ButtonGroup** / AfButtonGroup - Group multiple buttons together
85
- - **IconButton** / AfIconButton - Icon-only buttons
86
- - **Heading** / AfHeading - Typography headings (H1-H6)
87
- - **Text** / AfText - Body text components
88
- - **TypographyLockup** / AfTypographyLockup - Composite heading + text + button layouts
83
+ **Layout & Structure:**
84
+ - **HeroSection** / AfHeroSection - Hero sections for marketing pages
85
+ - **Section** / AfSection - Page sections with consistent spacing
89
86
  - **Container** / AfContainer - Layout containers with max-width
90
87
  - **AspectRatio** / AfAspectRatio - Maintain aspect ratios for media
91
- - **Card** / AfCard - Content cards with optional borders and shadows
92
- - **ColorSwatch** / AfColorSwatch - Display color swatches
93
- - **Logo** / AfLogo - Affinda logo component
94
- - **Navbar** / AfNavbar - Navigation bar
88
+
89
+ **Navigation:**
90
+ - **Navbar** / AfNavbar - Navigation bar with mobile hamburger menu
95
91
  - **NavItem** / AfNavItem - Navigation items
92
+
93
+ **Typography:**
94
+ - **Heading** / AfHeading - Typography headings (H1-H6) with theme support
95
+ - **Text** / AfText - Body text components with theme support
96
+ - **TypographyLockup** / AfTypographyLockup - Composite heading + text + button layouts
97
+
98
+ **Buttons:**
99
+ - **Button** / AfButton - Primary buttons with variants, icons, and dark background support
100
+ - **ButtonGroup** / AfButtonGroup - Group multiple buttons together
101
+ - **IconButton** / AfIconButton - Icon-only buttons
102
+
103
+ **Cards & Content:**
104
+ - **Card** / AfCard - Content cards with optional backgrounds and photo variants
105
+ - **ColorSwatch** / AfColorSwatch - Display color swatches
106
+
107
+ **Social Proof:**
108
+ - **ClientCarousel** / AfClientCarousel - Infinite scrolling carousel for client logos
109
+ - **LogoWell** / AfLogoWell - Rounded container for client logos
96
110
  - **Testimonial** / AfTestimonial - Customer testimonials with background images, stats, and quotes
97
111
  - **TestimonialCarousel** / AfTestimonialCarousel - Carousel for sliding between multiple testimonials
98
112
  - **TestimonialStat** / AfTestimonialStat - Individual statistics within testimonials
99
113
 
114
+ **Brand:**
115
+ - **Logo** / AfLogo - Affinda logo component
116
+
117
+ **Decorative:**
118
+ - **PaperclipDecoration** - Decorative paperclip vector for hero sections
119
+
120
+ ## Quick Start Components
121
+
122
+ ### HeroSection
123
+
124
+ The hero section component makes it easy to create marketing page heroes with consistent styling.
125
+
126
+ ```tsx
127
+ import { HeroSection, Heading, Text, Button, PaperclipDecoration } from '@affinda/react';
128
+
129
+ <HeroSection variant="dark" withDecoration={true} minHeight="60vh">
130
+ <PaperclipDecoration slot="decoration" />
131
+ <Heading level="1" theme="dark" align="center">
132
+ Harness AI to transform business processes
133
+ </Heading>
134
+ <Text variant="large" theme="dark" align="center">
135
+ Around the world, leading enterprises use Affinda's AI agents...
136
+ </Text>
137
+ <div style={{ display: 'flex', gap: '12px', justifyContent: 'center', marginTop: '2rem' }}>
138
+ <Button variant="primary">Discover the platform</Button>
139
+ <Button variant="secondary">Explore solutions</Button>
140
+ </div>
141
+ </HeroSection>
142
+ ```
143
+
144
+ **Props:**
145
+ - `variant`: `"light"` | `"dark"` (default: `"dark"`)
146
+ - `withDecoration`: boolean - Shows decoration slot
147
+ - `minHeight`: string - CSS min-height value
148
+
149
+ **Features:**
150
+ - Automatically applies correct text colors for dark backgrounds
151
+ - Built-in padding that accounts for floating navbar
152
+ - Responsive on mobile
153
+
154
+ ### Section
155
+
156
+ The section component provides consistent spacing and backgrounds for page sections.
157
+
158
+ ```tsx
159
+ import { Section, Heading, Text } from '@affinda/react';
160
+
161
+ <Section padding="default" background="level1" container={true}>
162
+ <Heading level="2" align="center">Work smarter, grow faster</Heading>
163
+ <Text variant="large" align="center">Feature content here...</Text>
164
+ </Section>
165
+ ```
166
+
167
+ **Props:**
168
+ - `padding`: `"tight"` (48px) | `"default"` (96px) | `"loose"` (120px)
169
+ - `background`: `"white"` | `"level1"` | `"dark"` | `"inkwell"`
170
+ - `container`: boolean - Auto-wraps content in Container
171
+
172
+ ### Card with Photo Background
173
+
174
+ Cards now support photo backgrounds with gradient overlays.
175
+
176
+ ```tsx
177
+ import { Card, Heading, Text } from '@affinda/react';
178
+
179
+ // Light background card
180
+ <Card backgroundColor="var(--colour-background-level1)">
181
+ <Heading level="3">Automate any document with 99%+ accuracy</Heading>
182
+ <Text variant="large">Extract any information...</Text>
183
+ <img src="screenshot.webp" alt="Feature" />
184
+ </Card>
185
+
186
+ // Photo background card with dark overlay
187
+ <Card backgroundImage="photo.jpg" darkOverlay={true}>
188
+ <Heading level="3">Build models in minutes</Heading>
189
+ <Text variant="large">Affinda is the only AI platform...</Text>
190
+ </Card>
191
+ ```
192
+
193
+ **Props:**
194
+ - `backgroundColor`: CSS color or variable
195
+ - `backgroundImage`: URL to background image
196
+ - `darkOverlay`: boolean - Applies gradient overlay with white text
197
+
100
198
  ## Component Guide
101
199
 
102
200
  ### When to Use Each Component
@@ -0,0 +1,8 @@
1
+ export interface PaperclipDecorationProps {
2
+ className?: string;
3
+ style?: Record<string, any>;
4
+ }
5
+ /**
6
+ * Decorative paperclip vector graphic for hero sections
7
+ */
8
+ export declare function PaperclipDecoration({ className, style }: PaperclipDecorationProps): any;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // @ts-nocheck
3
+ import * as React from 'react';
4
+ /**
5
+ * Decorative paperclip vector graphic for hero sections
6
+ */
7
+ export function PaperclipDecoration({ className, style }) {
8
+ const svgStyle = Object.assign({ display: 'block' }, style || {});
9
+ return (_jsx("svg", { preserveAspectRatio: "none", width: "100%", height: "100%", style: svgStyle, 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 }) }));
10
+ }
@@ -6,13 +6,17 @@ import { AfAspectRatio as AfAspectRatioElement } from "@affinda/wc/dist/componen
6
6
  import { AfButtonGroup as AfButtonGroupElement } from "@affinda/wc/dist/components/af-button-group.js";
7
7
  import { AfButton as AfButtonElement } from "@affinda/wc/dist/components/af-button.js";
8
8
  import { AfCard as AfCardElement } from "@affinda/wc/dist/components/af-card.js";
9
+ import { AfClientCarousel as AfClientCarouselElement } from "@affinda/wc/dist/components/af-client-carousel.js";
9
10
  import { AfColorSwatch as AfColorSwatchElement } from "@affinda/wc/dist/components/af-color-swatch.js";
10
11
  import { AfContainer as AfContainerElement } from "@affinda/wc/dist/components/af-container.js";
11
12
  import { AfHeading as AfHeadingElement } from "@affinda/wc/dist/components/af-heading.js";
13
+ import { AfHeroSection as AfHeroSectionElement } from "@affinda/wc/dist/components/af-hero-section.js";
12
14
  import { AfIconButton as AfIconButtonElement } from "@affinda/wc/dist/components/af-icon-button.js";
15
+ import { AfLogoWell as AfLogoWellElement } from "@affinda/wc/dist/components/af-logo-well.js";
13
16
  import { AfLogo as AfLogoElement } from "@affinda/wc/dist/components/af-logo.js";
14
17
  import { AfNavItem as AfNavItemElement } from "@affinda/wc/dist/components/af-nav-item.js";
15
18
  import { AfNavbar as AfNavbarElement } from "@affinda/wc/dist/components/af-navbar.js";
19
+ import { AfSection as AfSectionElement } from "@affinda/wc/dist/components/af-section.js";
16
20
  import { AfTestimonialCarousel as AfTestimonialCarouselElement } from "@affinda/wc/dist/components/af-testimonial-carousel.js";
17
21
  import { AfTestimonialStat as AfTestimonialStatElement } from "@affinda/wc/dist/components/af-testimonial-stat.js";
18
22
  import { AfTestimonial as AfTestimonialElement } from "@affinda/wc/dist/components/af-testimonial.js";
@@ -27,20 +31,28 @@ export type AfButtonGroupEvents = NonNullable<unknown>;
27
31
  export declare const AfButtonGroup: StencilReactComponent<AfButtonGroupElement, AfButtonGroupEvents>;
28
32
  export type AfCardEvents = NonNullable<unknown>;
29
33
  export declare const AfCard: StencilReactComponent<AfCardElement, AfCardEvents>;
34
+ export type AfClientCarouselEvents = NonNullable<unknown>;
35
+ export declare const AfClientCarousel: StencilReactComponent<AfClientCarouselElement, AfClientCarouselEvents>;
30
36
  export type AfColorSwatchEvents = NonNullable<unknown>;
31
37
  export declare const AfColorSwatch: StencilReactComponent<AfColorSwatchElement, AfColorSwatchEvents>;
32
38
  export type AfContainerEvents = NonNullable<unknown>;
33
39
  export declare const AfContainer: StencilReactComponent<AfContainerElement, AfContainerEvents>;
34
40
  export type AfHeadingEvents = NonNullable<unknown>;
35
41
  export declare const AfHeading: StencilReactComponent<AfHeadingElement, AfHeadingEvents>;
42
+ export type AfHeroSectionEvents = NonNullable<unknown>;
43
+ export declare const AfHeroSection: StencilReactComponent<AfHeroSectionElement, AfHeroSectionEvents>;
36
44
  export type AfIconButtonEvents = NonNullable<unknown>;
37
45
  export declare const AfIconButton: StencilReactComponent<AfIconButtonElement, AfIconButtonEvents>;
38
46
  export type AfLogoEvents = NonNullable<unknown>;
39
47
  export declare const AfLogo: StencilReactComponent<AfLogoElement, AfLogoEvents>;
48
+ export type AfLogoWellEvents = NonNullable<unknown>;
49
+ export declare const AfLogoWell: StencilReactComponent<AfLogoWellElement, AfLogoWellEvents>;
40
50
  export type AfNavItemEvents = NonNullable<unknown>;
41
51
  export declare const AfNavItem: StencilReactComponent<AfNavItemElement, AfNavItemEvents>;
42
52
  export type AfNavbarEvents = NonNullable<unknown>;
43
53
  export declare const AfNavbar: StencilReactComponent<AfNavbarElement, AfNavbarEvents>;
54
+ export type AfSectionEvents = NonNullable<unknown>;
55
+ export declare const AfSection: StencilReactComponent<AfSectionElement, AfSectionEvents>;
44
56
  export type AfTestimonialEvents = NonNullable<unknown>;
45
57
  export declare const AfTestimonial: StencilReactComponent<AfTestimonialElement, AfTestimonialEvents>;
46
58
  export type AfTestimonialCarouselEvents = NonNullable<unknown>;
@@ -8,13 +8,17 @@ import { AfAspectRatio as AfAspectRatioElement, defineCustomElement as defineAfA
8
8
  import { AfButtonGroup as AfButtonGroupElement, defineCustomElement as defineAfButtonGroup } from "@affinda/wc/dist/components/af-button-group.js";
9
9
  import { AfButton as AfButtonElement, defineCustomElement as defineAfButton } from "@affinda/wc/dist/components/af-button.js";
10
10
  import { AfCard as AfCardElement, defineCustomElement as defineAfCard } from "@affinda/wc/dist/components/af-card.js";
11
+ import { AfClientCarousel as AfClientCarouselElement, defineCustomElement as defineAfClientCarousel } from "@affinda/wc/dist/components/af-client-carousel.js";
11
12
  import { AfColorSwatch as AfColorSwatchElement, defineCustomElement as defineAfColorSwatch } from "@affinda/wc/dist/components/af-color-swatch.js";
12
13
  import { AfContainer as AfContainerElement, defineCustomElement as defineAfContainer } from "@affinda/wc/dist/components/af-container.js";
13
14
  import { AfHeading as AfHeadingElement, defineCustomElement as defineAfHeading } from "@affinda/wc/dist/components/af-heading.js";
15
+ import { AfHeroSection as AfHeroSectionElement, defineCustomElement as defineAfHeroSection } from "@affinda/wc/dist/components/af-hero-section.js";
14
16
  import { AfIconButton as AfIconButtonElement, defineCustomElement as defineAfIconButton } from "@affinda/wc/dist/components/af-icon-button.js";
17
+ import { AfLogoWell as AfLogoWellElement, defineCustomElement as defineAfLogoWell } from "@affinda/wc/dist/components/af-logo-well.js";
15
18
  import { AfLogo as AfLogoElement, defineCustomElement as defineAfLogo } from "@affinda/wc/dist/components/af-logo.js";
16
19
  import { AfNavItem as AfNavItemElement, defineCustomElement as defineAfNavItem } from "@affinda/wc/dist/components/af-nav-item.js";
17
20
  import { AfNavbar as AfNavbarElement, defineCustomElement as defineAfNavbar } from "@affinda/wc/dist/components/af-navbar.js";
21
+ import { AfSection as AfSectionElement, defineCustomElement as defineAfSection } from "@affinda/wc/dist/components/af-section.js";
18
22
  import { AfTestimonialCarousel as AfTestimonialCarouselElement, defineCustomElement as defineAfTestimonialCarousel } from "@affinda/wc/dist/components/af-testimonial-carousel.js";
19
23
  import { AfTestimonialStat as AfTestimonialStatElement, defineCustomElement as defineAfTestimonialStat } from "@affinda/wc/dist/components/af-testimonial-stat.js";
20
24
  import { AfTestimonial as AfTestimonialElement, defineCustomElement as defineAfTestimonial } from "@affinda/wc/dist/components/af-testimonial.js";
@@ -54,6 +58,14 @@ export const AfCard = /*@__PURE__*/ createComponent({
54
58
  events: {},
55
59
  defineCustomElement: defineAfCard
56
60
  });
61
+ export const AfClientCarousel = /*@__PURE__*/ createComponent({
62
+ tagName: 'af-client-carousel',
63
+ elementClass: AfClientCarouselElement,
64
+ // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
65
+ react: React,
66
+ events: {},
67
+ defineCustomElement: defineAfClientCarousel
68
+ });
57
69
  export const AfColorSwatch = /*@__PURE__*/ createComponent({
58
70
  tagName: 'af-color-swatch',
59
71
  elementClass: AfColorSwatchElement,
@@ -78,6 +90,14 @@ export const AfHeading = /*@__PURE__*/ createComponent({
78
90
  events: {},
79
91
  defineCustomElement: defineAfHeading
80
92
  });
93
+ export const AfHeroSection = /*@__PURE__*/ createComponent({
94
+ tagName: 'af-hero-section',
95
+ elementClass: AfHeroSectionElement,
96
+ // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
97
+ react: React,
98
+ events: {},
99
+ defineCustomElement: defineAfHeroSection
100
+ });
81
101
  export const AfIconButton = /*@__PURE__*/ createComponent({
82
102
  tagName: 'af-icon-button',
83
103
  elementClass: AfIconButtonElement,
@@ -94,6 +114,14 @@ export const AfLogo = /*@__PURE__*/ createComponent({
94
114
  events: {},
95
115
  defineCustomElement: defineAfLogo
96
116
  });
117
+ export const AfLogoWell = /*@__PURE__*/ createComponent({
118
+ tagName: 'af-logo-well',
119
+ elementClass: AfLogoWellElement,
120
+ // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
121
+ react: React,
122
+ events: {},
123
+ defineCustomElement: defineAfLogoWell
124
+ });
97
125
  export const AfNavItem = /*@__PURE__*/ createComponent({
98
126
  tagName: 'af-nav-item',
99
127
  elementClass: AfNavItemElement,
@@ -110,6 +138,14 @@ export const AfNavbar = /*@__PURE__*/ createComponent({
110
138
  events: {},
111
139
  defineCustomElement: defineAfNavbar
112
140
  });
141
+ export const AfSection = /*@__PURE__*/ createComponent({
142
+ tagName: 'af-section',
143
+ elementClass: AfSectionElement,
144
+ // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
145
+ react: React,
146
+ events: {},
147
+ defineCustomElement: defineAfSection
148
+ });
113
149
  export const AfTestimonial = /*@__PURE__*/ createComponent({
114
150
  tagName: 'af-testimonial',
115
151
  elementClass: AfTestimonialElement,
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './generated/components.js';
2
- export { AfAspectRatio as AspectRatio, AfButton as Button, AfButtonGroup as ButtonGroup, AfCard as Card, AfColorSwatch as ColorSwatch, AfContainer as Container, AfHeading as Heading, AfIconButton as IconButton, AfLogo as Logo, AfNavItem as NavItem, AfNavbar as Navbar, 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, 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
+ export { PaperclipDecoration } from './components/PaperclipDecoration';
package/dist/index.js CHANGED
@@ -2,6 +2,8 @@
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, AfColorSwatch as ColorSwatch, AfContainer as Container, AfHeading as Heading, AfIconButton as IconButton, AfLogo as Logo, AfNavItem as NavItem, AfNavbar as Navbar, 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, 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
+ // Export custom React components
9
+ export { PaperclipDecoration } from './components/PaperclipDecoration';
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@affinda/react",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "private": false,
5
5
  "type": "module",
6
- "files": ["dist", "README.md"],
6
+ "files": [
7
+ "dist",
8
+ "README.md"
9
+ ],
7
10
  "main": "dist/index.js",
8
11
  "module": "dist/index.js",
9
12
  "types": "dist/index.d.ts",
@@ -20,4 +23,4 @@
20
23
  "build": "pnpm run clean && tsc -p tsconfig.json",
21
24
  "clean": "rm -rf dist"
22
25
  }
23
- }
26
+ }