@octane-xplat/smooth-corners 0.0.1 → 0.11.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/LICENSE +21 -0
- package/dist/native/index.js +2 -0
- package/dist/native/node_modules/.pnpm/@lisse_core@0.7.2/node_modules/@lisse/core/dist/chunk-BL6ZAFLB.js +477 -0
- package/dist/native/octane-client-build.json +8 -0
- package/dist/native/packages/smooth-corners/src/SmoothCorners.tsrx.js +72 -0
- package/dist/native/packages/smooth-corners/src/apply.android.js +95 -0
- package/dist/native/packages/smooth-corners/src/apply.ios.js +92 -0
- package/dist/native/packages/smooth-corners/src/path.js +424 -0
- package/dist/web/index.js +2 -0
- package/dist/web/node_modules/.pnpm/@lisse_core@0.7.2/node_modules/@lisse/core/dist/chunk-BL6ZAFLB.js +477 -0
- package/dist/web/octane-client-build.json +8 -0
- package/dist/web/packages/smooth-corners/src/SmoothCorners.web.tsrx.js +62 -0
- package/dist/web/packages/smooth-corners/src/path.js +453 -0
- package/package.json +67 -4
- package/src/SmoothCorners.macos.tsrx +177 -0
- package/src/SmoothCorners.tsrx +67 -0
- package/src/SmoothCorners.web.tsrx +71 -0
- package/src/apply.android.ts +136 -0
- package/src/apply.ios.ts +136 -0
- package/src/index.macos.ts +10 -0
- package/src/index.ts +13 -0
- package/src/index.web.ts +10 -0
- package/src/path.ts +627 -0
- package/src/props.ts +66 -0
- package/types/index.d.ts +17 -0
- package/types/props.d.ts +59 -0
- package/README.md +0 -4
package/types/props.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Shared props for `SmoothCorners` — identical on every leaf. */
|
|
2
|
+
/** Corner curve family. `'continuous'` is Apple's corner (the default) —
|
|
3
|
+
* reproduced via the Rosenfeld `UIBezierPath` cubic constants, ~0.25 px
|
|
4
|
+
* from live SwiftUI `.continuous`. The rest delegate to `@lisse/core`:
|
|
5
|
+
* `squircle` = Figma's corner smoothing, `superellipse` = |x|^n+|y|^n=1,
|
|
6
|
+
* `clothoid` = Euler-spiral blend, `arc` = plain circular border-radius. */
|
|
7
|
+
export type CornerCurve = 'continuous' | 'squircle' | 'superellipse' | 'clothoid' | 'arc';
|
|
8
|
+
export interface CornerConfig {
|
|
9
|
+
/** Nominal corner radius in dips (matches `border-radius`). */
|
|
10
|
+
radius: number;
|
|
11
|
+
/** Curve family. Default `'continuous'`. */
|
|
12
|
+
curve?: CornerCurve;
|
|
13
|
+
/** 0–1 smoothing — used by `squircle`/`clothoid`, ignored elsewhere.
|
|
14
|
+
* Figma's "iOS" preset is 0.6; Lisse's closest-fit is 0.65. */
|
|
15
|
+
smoothing?: number;
|
|
16
|
+
/** Superellipse exponent (`n`); only `superellipse`. Default 4. */
|
|
17
|
+
exponent?: number;
|
|
18
|
+
/** Preserve smoothing when space is limited. Default true. */
|
|
19
|
+
preserveSmoothing?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Per-corner configuration — each value is a CornerConfig or a radius
|
|
22
|
+
* shorthand. */
|
|
23
|
+
export interface PerCornerConfig {
|
|
24
|
+
topLeft?: CornerConfig | number;
|
|
25
|
+
topRight?: CornerConfig | number;
|
|
26
|
+
bottomRight?: CornerConfig | number;
|
|
27
|
+
bottomLeft?: CornerConfig | number;
|
|
28
|
+
}
|
|
29
|
+
export type CornerOptions = CornerConfig | PerCornerConfig | number;
|
|
30
|
+
export interface SmoothBorderConfig {
|
|
31
|
+
/** Stroke width in dips, painted inside the clip edge. */
|
|
32
|
+
width: number;
|
|
33
|
+
/** Any color string the platform accepts (hex, rgba, named). */
|
|
34
|
+
color: string;
|
|
35
|
+
}
|
|
36
|
+
export interface SmoothShadowConfig {
|
|
37
|
+
color?: string;
|
|
38
|
+
opacity?: number;
|
|
39
|
+
offsetX?: number;
|
|
40
|
+
offsetY?: number;
|
|
41
|
+
blur?: number;
|
|
42
|
+
/** Spread is web/iOS/macOS only — Android elevation cannot express it. */
|
|
43
|
+
spread?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface SmoothCornersProps {
|
|
46
|
+
/** Radius/curve configuration — the single source of truth. `border-radius`
|
|
47
|
+
* in `style`/`className` is ignored on this element on every target. */
|
|
48
|
+
corners: CornerOptions;
|
|
49
|
+
border?: SmoothBorderConfig;
|
|
50
|
+
/** Drop shadow following the clip shape. Fidelity varies per target —
|
|
51
|
+
* see the design note: Android uses `elevation` (fixed direction, no
|
|
52
|
+
* offsets/spread); iOS/macOS use `shadowPath`; web uses
|
|
53
|
+
* `filter: drop-shadow` (no spread). */
|
|
54
|
+
shadow?: SmoothShadowConfig;
|
|
55
|
+
className?: any;
|
|
56
|
+
style?: any;
|
|
57
|
+
id?: string;
|
|
58
|
+
children?: any;
|
|
59
|
+
}
|
package/README.md
DELETED