@affinda/react 0.0.17 → 0.0.19

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
@@ -131,7 +131,11 @@ The hero section component makes it easy to create marketing page heroes with co
131
131
  import { HeroSection, Heading, Text, Button, PaperclipDecoration } from '@affinda/react';
132
132
 
133
133
  <HeroSection variant="dark" withDecoration={true} minHeight="60vh">
134
- <PaperclipDecoration slot="decoration" />
134
+ {/* Position the paperclip decoration - adjust bottom/right values as needed */}
135
+ <PaperclipDecoration
136
+ slot="decoration"
137
+ style={{ position: 'absolute', bottom: -80, right: -800 }}
138
+ />
135
139
  <Heading level="1" theme="dark" align="center">
136
140
  Harness AI to transform business processes
137
141
  </Heading>
@@ -173,6 +177,8 @@ import { Section, Heading, Text } from '@affinda/react';
173
177
  - `background`: `"white"` | `"level1"` | `"dark"` | `"inkwell"`
174
178
  - `container`: boolean - Auto-wraps content in Container
175
179
 
180
+ > **Contrast helper:** When `background="dark"` or `background="inkwell"`, `Section` automatically exposes CSS variables so nested `Heading`, `Text`, and `TypographyLockup` components render in mist-green, even if you forget to set `theme="dark"`. Buttons still need `darkBackground={true}` (see below).
181
+
176
182
  ### Card with Photo Background
177
183
 
178
184
  Cards now support photo backgrounds with gradient overlays.
@@ -199,6 +205,35 @@ import { Card, Heading, Text } from '@affinda/react';
199
205
  - `backgroundImage`: URL to background image
200
206
  - `darkOverlay`: boolean - Applies gradient overlay with white text
201
207
 
208
+ ### PaperclipDecoration
209
+
210
+ Decorative SVG paperclip graphic for hero sections.
211
+
212
+ ⚠️ **Important**: When using with `HeroSection`, you must manually position the paperclip using inline styles, as the component uses scoped styles rather than shadow DOM.
213
+
214
+ ```tsx
215
+ import { HeroSection, PaperclipDecoration } from '@affinda/react';
216
+
217
+ <HeroSection variant="dark" withDecoration={true}>
218
+ <PaperclipDecoration
219
+ slot="decoration"
220
+ style={{
221
+ position: 'absolute',
222
+ bottom: -80, // Adjust to move vertically
223
+ right: -800 // Adjust to move horizontally
224
+ }}
225
+ />
226
+ {/* Hero content */}
227
+ </HeroSection>
228
+ ```
229
+
230
+ **Positioning Tips:**
231
+ - **Negative values** move the decoration outside the viewport (creating a partial reveal effect)
232
+ - **bottom**: Controls vertical position (negative = move down/off-screen)
233
+ - **right**: Controls horizontal position (negative = move right/off-screen)
234
+ - Start with `bottom: -80, right: -800` and adjust to taste
235
+ - The paperclip automatically sits behind content (`z-index: 0`)
236
+
202
237
  ## Component Guide
203
238
 
204
239
  ### When to Use Each Component
@@ -294,6 +329,7 @@ import { Card, Heading, Text } from '@affinda/react';
294
329
  - Secondary actions: Use `variant="secondary"`
295
330
  - Sizes: `small`, `default`, `large`
296
331
  - Can include icons in left or right slots
332
+ - On dark backgrounds, pass `darkBackground={true}` so borders/text flip automatically
297
333
 
298
334
  ```tsx
299
335
  <Button variant="primary" size="large">Sign Up Now</Button>
@@ -5,6 +5,6 @@ import * as React from 'react';
5
5
  * Decorative paperclip vector graphic for hero sections
6
6
  */
7
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 }) }));
8
+ const svgStyle = Object.assign({ display: 'block', position: 'absolute' }, style || {});
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 }) }));
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@affinda/react",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -21,6 +21,7 @@
21
21
  },
22
22
  "scripts": {
23
23
  "build": "pnpm run clean && tsc -p tsconfig.json",
24
+ "dev": "tsc -p tsconfig.json --watch",
24
25
  "clean": "rm -rf dist"
25
26
  }
26
27
  }