@021.is/brand-studio 0.3.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/AGENTS.md +63 -0
- package/LICENSE +21 -0
- package/README.md +117 -0
- package/dist/BrandStudio-D2DcT8Fu.d.ts +26 -0
- package/dist/app/index.d.ts +25 -0
- package/dist/app/index.js +4 -0
- package/dist/chunk-55AYEWNQ.js +84 -0
- package/dist/chunk-7325RQRP.js +275 -0
- package/dist/chunk-JQV3ASME.js +3327 -0
- package/dist/chunk-LJ4HZCAP.js +69 -0
- package/dist/chunk-QT5N4K7D.js +8 -0
- package/dist/chunk-Z2DJJJDC.js +1196 -0
- package/dist/chunk-ZE5UZAY6.js +113 -0
- package/dist/color/index.d.ts +19 -0
- package/dist/color/index.js +1 -0
- package/dist/contrast-TVW3pzdd.d.ts +19 -0
- package/dist/define/index.d.ts +25 -0
- package/dist/define/index.js +2 -0
- package/dist/generateScheme-BDDcIzA3.d.ts +97 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +8 -0
- package/dist/loading/index.d.ts +86 -0
- package/dist/loading/index.js +3 -0
- package/dist/motion/index.d.ts +197 -0
- package/dist/motion/index.js +2 -0
- package/dist/shapes/index.d.ts +62 -0
- package/dist/shapes/index.js +1 -0
- package/dist/types-PWNYyaBF.d.ts +66 -0
- package/package.json +93 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { LoadingVariant, SpinnerLoadingMark } from './chunk-55AYEWNQ.js';
|
|
3
|
+
import { motion } from 'framer-motion';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function PulseLoadingMark({
|
|
7
|
+
size = 200,
|
|
8
|
+
background = "transparent",
|
|
9
|
+
defs,
|
|
10
|
+
foreground = "currentColor",
|
|
11
|
+
cycleMs = 1200,
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
ariaLabel = "Loading"
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsxs(
|
|
17
|
+
"svg",
|
|
18
|
+
{
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
+
viewBox: "0 0 256 256",
|
|
21
|
+
width: size,
|
|
22
|
+
height: size,
|
|
23
|
+
role: "img",
|
|
24
|
+
"aria-label": ariaLabel,
|
|
25
|
+
className,
|
|
26
|
+
style,
|
|
27
|
+
children: [
|
|
28
|
+
defs ? /* @__PURE__ */ jsx("defs", { children: defs }) : null,
|
|
29
|
+
background !== "transparent" ? /* @__PURE__ */ jsx("rect", { width: "256", height: "256", rx: "56", fill: background }) : null,
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
motion.circle,
|
|
32
|
+
{
|
|
33
|
+
cx: 128,
|
|
34
|
+
cy: 128,
|
|
35
|
+
r: 56,
|
|
36
|
+
fill: foreground,
|
|
37
|
+
style: { transformOrigin: "128px 128px", transformBox: "view-box" },
|
|
38
|
+
animate: { scale: [0.65, 1, 0.65], opacity: [0.35, 1, 0.35] },
|
|
39
|
+
transition: {
|
|
40
|
+
duration: cycleMs / 1e3,
|
|
41
|
+
ease: "easeInOut",
|
|
42
|
+
repeat: Number.POSITIVE_INFINITY
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
var R = 74;
|
|
51
|
+
var CIRC = 2 * Math.PI * R;
|
|
52
|
+
function RingLoadingMark({
|
|
53
|
+
size = 200,
|
|
54
|
+
background = "transparent",
|
|
55
|
+
defs,
|
|
56
|
+
foreground = "currentColor",
|
|
57
|
+
weight = 18,
|
|
58
|
+
cycleMs = 1400,
|
|
59
|
+
className,
|
|
60
|
+
style,
|
|
61
|
+
ariaLabel = "Loading"
|
|
62
|
+
}) {
|
|
63
|
+
return /* @__PURE__ */ jsxs(
|
|
64
|
+
"svg",
|
|
65
|
+
{
|
|
66
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
67
|
+
viewBox: "0 0 256 256",
|
|
68
|
+
width: size,
|
|
69
|
+
height: size,
|
|
70
|
+
role: "img",
|
|
71
|
+
"aria-label": ariaLabel,
|
|
72
|
+
className,
|
|
73
|
+
style,
|
|
74
|
+
children: [
|
|
75
|
+
defs ? /* @__PURE__ */ jsx("defs", { children: defs }) : null,
|
|
76
|
+
background !== "transparent" ? /* @__PURE__ */ jsx("rect", { width: "256", height: "256", rx: "56", fill: background }) : null,
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
motion.circle,
|
|
79
|
+
{
|
|
80
|
+
cx: 128,
|
|
81
|
+
cy: 128,
|
|
82
|
+
r: R,
|
|
83
|
+
fill: "none",
|
|
84
|
+
stroke: foreground,
|
|
85
|
+
strokeWidth: weight,
|
|
86
|
+
strokeLinecap: "round",
|
|
87
|
+
strokeDasharray: CIRC,
|
|
88
|
+
style: { transformOrigin: "128px 128px", transformBox: "view-box", rotate: -90 },
|
|
89
|
+
animate: { strokeDashoffset: [CIRC, 0, 0, -CIRC], opacity: [1, 1, 1, 0] },
|
|
90
|
+
transition: {
|
|
91
|
+
duration: cycleMs / 1e3,
|
|
92
|
+
ease: "easeInOut",
|
|
93
|
+
times: [0, 0.55, 0.7, 1],
|
|
94
|
+
repeat: Number.POSITIVE_INFINITY
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
function LoadingMark({ variant = LoadingVariant.Spinner, ...rest }) {
|
|
103
|
+
switch (variant) {
|
|
104
|
+
case LoadingVariant.Ring:
|
|
105
|
+
return /* @__PURE__ */ jsx(RingLoadingMark, { ...rest });
|
|
106
|
+
case LoadingVariant.Pulse:
|
|
107
|
+
return /* @__PURE__ */ jsx(PulseLoadingMark, { ...rest });
|
|
108
|
+
default:
|
|
109
|
+
return /* @__PURE__ */ jsx(SpinnerLoadingMark, { ...rest });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { LoadingMark, PulseLoadingMark, RingLoadingMark };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { d as Role, B as BrandScheme, C as ColorScheme } from '../generateScheme-BDDcIzA3.js';
|
|
2
|
+
export { a as ColorSpec, H as Hex, R as ROLE, b as ROLE_GROUPS, c as ROLE_ORDER, S as SchemeVariant, g as generateScheme } from '../generateScheme-BDDcIzA3.js';
|
|
3
|
+
export { C as ContrastTier, c as contrastBadge, a as contrastRatio, r as relativeLuminance } from '../contrast-TVW3pzdd.js';
|
|
4
|
+
|
|
5
|
+
/** `onPrimaryContainer` → `--md-on-primary-container`. */
|
|
6
|
+
declare function cssVarName(role: Role): string;
|
|
7
|
+
/** A single mode's role map as `{ "--md-...": "#hex" }`. */
|
|
8
|
+
declare function schemeVars(colors: ColorScheme): Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Emit a CSS string that sets the MD3 role custom properties: light values on
|
|
11
|
+
* `lightSelector`, dark values on `darkSelector`. Drop it into a `<style>` so
|
|
12
|
+
* any descendant can theme from `var(--md-<role>)` and switch with `.dark`.
|
|
13
|
+
*/
|
|
14
|
+
declare function schemeToCssText(scheme: BrandScheme, opts?: {
|
|
15
|
+
lightSelector?: string;
|
|
16
|
+
darkSelector?: string;
|
|
17
|
+
}): string;
|
|
18
|
+
|
|
19
|
+
export { BrandScheme, ColorScheme, Role, cssVarName, schemeToCssText, schemeVars };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ContrastTier, ROLE, ROLE_GROUPS, ROLE_ORDER, SchemeVariant, contrastBadge, contrastRatio, cssVarName, generateScheme, relativeLuminance, schemeToCssText, schemeVars } from '../chunk-JQV3ASME.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WCAG-relative-luminance + contrast-ratio helpers. Pure math, no deps.
|
|
3
|
+
* Used by the Colors panel to label each role pair against WCAG 2.1.
|
|
4
|
+
*/
|
|
5
|
+
declare function relativeLuminance(hex: string): number;
|
|
6
|
+
declare function contrastRatio(a: string, b: string): number;
|
|
7
|
+
declare const ContrastTier: {
|
|
8
|
+
readonly AAA: "AAA";
|
|
9
|
+
readonly AA: "AA";
|
|
10
|
+
readonly AALarge: "AA-LG";
|
|
11
|
+
readonly Fail: "fail";
|
|
12
|
+
};
|
|
13
|
+
type ContrastTier = (typeof ContrastTier)[keyof typeof ContrastTier];
|
|
14
|
+
declare function contrastBadge(ratio: number): {
|
|
15
|
+
label: string;
|
|
16
|
+
tier: ContrastTier;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { ContrastTier as C, contrastRatio as a, contrastBadge as c, relativeLuminance as r };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { B as BrandConfig, R as ResolvedBrandConfig } from '../types-PWNYyaBF.js';
|
|
2
|
+
export { b as BrandType } from '../types-PWNYyaBF.js';
|
|
3
|
+
export { B as BrandScheme, C as ColorScheme, a as ColorSpec, H as Hex, d as Role, S as SchemeVariant, g as generateScheme } from '../generateScheme-BDDcIzA3.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Typed identity helper for declaring a brand. Resolves the MD3 light + dark
|
|
7
|
+
* role sets from `config.color` at declaration time so every surface reads a
|
|
8
|
+
* complete, contrast-correct scheme.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // brand.config.ts
|
|
13
|
+
* import { defineBrand } from "@021.is/brand-studio/define";
|
|
14
|
+
*
|
|
15
|
+
* export default defineBrand({
|
|
16
|
+
* name: "Acme",
|
|
17
|
+
* tagline: "We make things.",
|
|
18
|
+
* color: { seed: "#3B82F6", tertiary: "#22D3EE" },
|
|
19
|
+
* type: { sans: "Inter", mono: "JetBrains Mono" },
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare function defineBrand(config: BrandConfig): ResolvedBrandConfig;
|
|
24
|
+
|
|
25
|
+
export { BrandConfig, ResolvedBrandConfig, defineBrand };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Material Design 3 color roles. The complete role set a scheme exposes for a
|
|
3
|
+
* single mode (light or dark). const-as-object enum — no string-literal unions.
|
|
4
|
+
*
|
|
5
|
+
* Role names match the camelCase getters on `MaterialDynamicColors` so the
|
|
6
|
+
* generator can read each one generically.
|
|
7
|
+
*/
|
|
8
|
+
declare const ROLE: {
|
|
9
|
+
readonly primary: "primary";
|
|
10
|
+
readonly onPrimary: "onPrimary";
|
|
11
|
+
readonly primaryContainer: "primaryContainer";
|
|
12
|
+
readonly onPrimaryContainer: "onPrimaryContainer";
|
|
13
|
+
readonly inversePrimary: "inversePrimary";
|
|
14
|
+
readonly secondary: "secondary";
|
|
15
|
+
readonly onSecondary: "onSecondary";
|
|
16
|
+
readonly secondaryContainer: "secondaryContainer";
|
|
17
|
+
readonly onSecondaryContainer: "onSecondaryContainer";
|
|
18
|
+
readonly tertiary: "tertiary";
|
|
19
|
+
readonly onTertiary: "onTertiary";
|
|
20
|
+
readonly tertiaryContainer: "tertiaryContainer";
|
|
21
|
+
readonly onTertiaryContainer: "onTertiaryContainer";
|
|
22
|
+
readonly error: "error";
|
|
23
|
+
readonly onError: "onError";
|
|
24
|
+
readonly errorContainer: "errorContainer";
|
|
25
|
+
readonly onErrorContainer: "onErrorContainer";
|
|
26
|
+
readonly background: "background";
|
|
27
|
+
readonly onBackground: "onBackground";
|
|
28
|
+
readonly surface: "surface";
|
|
29
|
+
readonly onSurface: "onSurface";
|
|
30
|
+
readonly surfaceVariant: "surfaceVariant";
|
|
31
|
+
readonly onSurfaceVariant: "onSurfaceVariant";
|
|
32
|
+
readonly surfaceContainerLowest: "surfaceContainerLowest";
|
|
33
|
+
readonly surfaceContainerLow: "surfaceContainerLow";
|
|
34
|
+
readonly surfaceContainer: "surfaceContainer";
|
|
35
|
+
readonly surfaceContainerHigh: "surfaceContainerHigh";
|
|
36
|
+
readonly surfaceContainerHighest: "surfaceContainerHighest";
|
|
37
|
+
readonly surfaceDim: "surfaceDim";
|
|
38
|
+
readonly surfaceBright: "surfaceBright";
|
|
39
|
+
readonly surfaceTint: "surfaceTint";
|
|
40
|
+
readonly inverseSurface: "inverseSurface";
|
|
41
|
+
readonly inverseOnSurface: "inverseOnSurface";
|
|
42
|
+
readonly outline: "outline";
|
|
43
|
+
readonly outlineVariant: "outlineVariant";
|
|
44
|
+
readonly shadow: "shadow";
|
|
45
|
+
readonly scrim: "scrim";
|
|
46
|
+
};
|
|
47
|
+
type Role = (typeof ROLE)[keyof typeof ROLE];
|
|
48
|
+
/** Stable order for iterating + rendering the role set. */
|
|
49
|
+
declare const ROLE_ORDER: readonly Role[];
|
|
50
|
+
/** Pairs of (container role, on-role) used by the Colors panel to show legible swatches. */
|
|
51
|
+
declare const ROLE_GROUPS: readonly {
|
|
52
|
+
title: string;
|
|
53
|
+
pairs: readonly [Role, Role][];
|
|
54
|
+
}[];
|
|
55
|
+
|
|
56
|
+
type Hex = `#${string}`;
|
|
57
|
+
/** MD3 scheme variants (const-as-object enum, no string-literal unions). */
|
|
58
|
+
declare const SchemeVariant: {
|
|
59
|
+
readonly TonalSpot: "tonalSpot";
|
|
60
|
+
readonly Vibrant: "vibrant";
|
|
61
|
+
readonly Expressive: "expressive";
|
|
62
|
+
readonly Fidelity: "fidelity";
|
|
63
|
+
readonly Content: "content";
|
|
64
|
+
readonly Neutral: "neutral";
|
|
65
|
+
readonly Monochrome: "monochrome";
|
|
66
|
+
};
|
|
67
|
+
type SchemeVariant = (typeof SchemeVariant)[keyof typeof SchemeVariant];
|
|
68
|
+
type ColorSpec = {
|
|
69
|
+
/** Required key/source color the whole scheme is derived from. */
|
|
70
|
+
seed: Hex;
|
|
71
|
+
/** Optional key colors. When set, that palette is grafted onto the scheme. */
|
|
72
|
+
secondary?: Hex;
|
|
73
|
+
tertiary?: Hex;
|
|
74
|
+
neutral?: Hex;
|
|
75
|
+
/** MD3 contrast level, -1 (low) .. 1 (high). Default 0. */
|
|
76
|
+
contrastLevel?: number;
|
|
77
|
+
/** Scheme variant. Default `tonalSpot` (MD3 default). */
|
|
78
|
+
variant?: SchemeVariant;
|
|
79
|
+
/** Per-role escape hatches applied last, per mode. */
|
|
80
|
+
overrides?: {
|
|
81
|
+
light?: Partial<Record<Role, Hex>>;
|
|
82
|
+
dark?: Partial<Record<Role, Hex>>;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
type ColorScheme = Record<Role, Hex>;
|
|
86
|
+
type BrandScheme = {
|
|
87
|
+
light: ColorScheme;
|
|
88
|
+
dark: ColorScheme;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Generate a complete MD3 light + dark role set from a brand's color spec.
|
|
92
|
+
* Faithful to Material Design 3 (HCT tonal palettes + MaterialDynamicColors),
|
|
93
|
+
* so every on-color is contrast-correct against its surface by construction.
|
|
94
|
+
*/
|
|
95
|
+
declare function generateScheme(spec: ColorSpec): BrandScheme;
|
|
96
|
+
|
|
97
|
+
export { type BrandScheme as B, type ColorScheme as C, type Hex as H, ROLE as R, SchemeVariant as S, type ColorSpec as a, ROLE_GROUPS as b, ROLE_ORDER as c, type Role as d, generateScheme as g };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Disc, DiscProps, Ring, RingProps, Squircle, SquircleProps } from './shapes/index.js';
|
|
2
|
+
export { AppearGrow, AppearGrowProps, Drift, DriftProps, PulseLoop, PulseLoopProps, RingDraw, RingDrawProps, Sequence, SequenceProps, SequenceStep, SequenceStepProps, Strikethrough, StrikethroughProps, Sweep, SweepDirection, SweepProps, Wobble, WobbleProps } from './motion/index.js';
|
|
3
|
+
export { LoadingMark, LoadingMarkProps, PulseLoadingMark, PulseLoadingMarkProps, RingLoadingMark, RingLoadingMarkProps, SpinnerLoadingMark, SpinnerLoadingMarkProps } from './loading/index.js';
|
|
4
|
+
export { B as BrandConfig, a as BrandStudioSection, b as BrandType, L as LoadingVariant, M as MotionState, R as ResolvedBrandConfig } from './types-PWNYyaBF.js';
|
|
5
|
+
export { B as BrandScheme, C as ColorScheme, a as ColorSpec, H as Hex, R as ROLE, b as ROLE_GROUPS, c as ROLE_ORDER, d as Role, S as SchemeVariant, g as generateScheme } from './generateScheme-BDDcIzA3.js';
|
|
6
|
+
export { cssVarName, schemeToCssText, schemeVars } from './color/index.js';
|
|
7
|
+
export { C as ContrastTier, c as contrastBadge, a as contrastRatio, r as relativeLuminance } from './contrast-TVW3pzdd.js';
|
|
8
|
+
export { a as BrandStudio, b as BrandStudioProps } from './BrandStudio-D2DcT8Fu.js';
|
|
9
|
+
export { defineBrand } from './define/index.js';
|
|
10
|
+
import 'react/jsx-runtime';
|
|
11
|
+
import 'react';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export { Disc, Ring, Squircle } from './chunk-LJ4HZCAP.js';
|
|
3
|
+
export { AppearGrow, Drift, PulseLoop, RingDraw, Sequence, SequenceStep, Strikethrough, Sweep, Wobble } from './chunk-7325RQRP.js';
|
|
4
|
+
export { LoadingMark, PulseLoadingMark, RingLoadingMark } from './chunk-ZE5UZAY6.js';
|
|
5
|
+
export { BrandStudio } from './chunk-Z2DJJJDC.js';
|
|
6
|
+
export { BrandStudioSection, LoadingVariant, MotionState, SpinnerLoadingMark } from './chunk-55AYEWNQ.js';
|
|
7
|
+
export { defineBrand } from './chunk-QT5N4K7D.js';
|
|
8
|
+
export { ContrastTier, ROLE, ROLE_GROUPS, ROLE_ORDER, SchemeVariant, contrastBadge, contrastRatio, cssVarName, generateScheme, relativeLuminance, schemeToCssText, schemeVars } from './chunk-JQV3ASME.js';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
3
|
+
import { L as LoadingVariant } from '../types-PWNYyaBF.js';
|
|
4
|
+
import '../generateScheme-BDDcIzA3.js';
|
|
5
|
+
|
|
6
|
+
type LoadingMarkProps = {
|
|
7
|
+
variant?: LoadingVariant;
|
|
8
|
+
size?: number | string;
|
|
9
|
+
background?: string;
|
|
10
|
+
defs?: ReactNode;
|
|
11
|
+
foreground?: string;
|
|
12
|
+
cycleMs?: number;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* LoadingMark — a generic, brand-neutral loading indicator.
|
|
19
|
+
*
|
|
20
|
+
* - `Spinner` → 3/4-arc spinner (default)
|
|
21
|
+
* - `Ring` → ring strokes itself in, resets, loops
|
|
22
|
+
* - `Pulse` → disc pulses (scale + fade)
|
|
23
|
+
*
|
|
24
|
+
* For a brand-coded loading mark, render your own animated logo instead and
|
|
25
|
+
* pass it to `<BrandStudio animatedLogo={...} />`.
|
|
26
|
+
*/
|
|
27
|
+
declare function LoadingMark({ variant, ...rest }: LoadingMarkProps): react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
type SpinnerLoadingMarkProps = {
|
|
30
|
+
size?: number | string;
|
|
31
|
+
/** Tile background. Default transparent (no tile). Pass a color or `url(#id)`. */
|
|
32
|
+
background?: string;
|
|
33
|
+
/** Optional `<defs>` (e.g. a gradient referenced by `background`/`foreground`). */
|
|
34
|
+
defs?: ReactNode;
|
|
35
|
+
/** Arc + track color. Default `currentColor` so it inherits theme text color. */
|
|
36
|
+
foreground?: string;
|
|
37
|
+
/** Stroke thickness of the arc. */
|
|
38
|
+
weight?: number;
|
|
39
|
+
/** Full rotation cycle, ms. */
|
|
40
|
+
cycleMs?: number;
|
|
41
|
+
className?: string;
|
|
42
|
+
style?: CSSProperties;
|
|
43
|
+
ariaLabel?: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* SpinnerLoadingMark — a clean 3/4-arc spinner. Generic and brand-neutral:
|
|
47
|
+
* transparent tile, `currentColor` stroke by default, no hardcoded palette.
|
|
48
|
+
*/
|
|
49
|
+
declare function SpinnerLoadingMark({ size, background, defs, foreground, weight, cycleMs, className, style, ariaLabel, }: SpinnerLoadingMarkProps): react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
type RingLoadingMarkProps = {
|
|
52
|
+
size?: number | string;
|
|
53
|
+
background?: string;
|
|
54
|
+
defs?: ReactNode;
|
|
55
|
+
foreground?: string;
|
|
56
|
+
weight?: number;
|
|
57
|
+
/** Draw-in + fade cycle, ms. */
|
|
58
|
+
cycleMs?: number;
|
|
59
|
+
className?: string;
|
|
60
|
+
style?: CSSProperties;
|
|
61
|
+
ariaLabel?: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* RingLoadingMark — a ring that strokes itself in, then resets and loops.
|
|
65
|
+
* Generic and brand-neutral (transparent tile, `currentColor` by default).
|
|
66
|
+
*/
|
|
67
|
+
declare function RingLoadingMark({ size, background, defs, foreground, weight, cycleMs, className, style, ariaLabel, }: RingLoadingMarkProps): react_jsx_runtime.JSX.Element;
|
|
68
|
+
|
|
69
|
+
type PulseLoadingMarkProps = {
|
|
70
|
+
size?: number | string;
|
|
71
|
+
background?: string;
|
|
72
|
+
defs?: ReactNode;
|
|
73
|
+
foreground?: string;
|
|
74
|
+
/** Pulse cycle, ms. */
|
|
75
|
+
cycleMs?: number;
|
|
76
|
+
className?: string;
|
|
77
|
+
style?: CSSProperties;
|
|
78
|
+
ariaLabel?: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* PulseLoadingMark — a solid disc that pulses (scale + fade) and loops.
|
|
82
|
+
* Generic and brand-neutral (transparent tile, `currentColor` by default).
|
|
83
|
+
*/
|
|
84
|
+
declare function PulseLoadingMark({ size, background, defs, foreground, cycleMs, className, style, ariaLabel, }: PulseLoadingMarkProps): react_jsx_runtime.JSX.Element;
|
|
85
|
+
|
|
86
|
+
export { LoadingMark, type LoadingMarkProps, LoadingVariant, PulseLoadingMark, type PulseLoadingMarkProps, RingLoadingMark, type RingLoadingMarkProps, SpinnerLoadingMark, type SpinnerLoadingMarkProps };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
type AppearGrowProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Delay before the animation starts, ms. */
|
|
7
|
+
delay?: number;
|
|
8
|
+
/** Animation duration, ms. */
|
|
9
|
+
duration?: number;
|
|
10
|
+
/** Initial scale (0 = invisible). */
|
|
11
|
+
from?: number;
|
|
12
|
+
/** Target scale. */
|
|
13
|
+
to?: number;
|
|
14
|
+
/** Pivot point for the scale, expressed as `"50% 50%"` (CSS transform-origin syntax). */
|
|
15
|
+
origin?: string;
|
|
16
|
+
/** Pass `true` to loop the animation. */
|
|
17
|
+
loop?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* AppearGrow — opacity-fade-in + scale-up. Use for "element pops into view".
|
|
21
|
+
* Wraps children in a `<g>` (so it composes inside SVG). The element you wrap must
|
|
22
|
+
* be SVG content; for HTML content swap the wrapping element.
|
|
23
|
+
*/
|
|
24
|
+
declare function AppearGrow({ children, delay, duration, from, to, origin, loop, }: AppearGrowProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
type RingDrawProps = {
|
|
27
|
+
cx?: number;
|
|
28
|
+
cy?: number;
|
|
29
|
+
r?: number;
|
|
30
|
+
strokeWidth?: number;
|
|
31
|
+
color?: string;
|
|
32
|
+
/** Total time to trace the full ring, ms. */
|
|
33
|
+
duration?: number;
|
|
34
|
+
/** Delay before drawing starts, ms. */
|
|
35
|
+
delay?: number;
|
|
36
|
+
/** When true, the ring redraws on every loop iteration. */
|
|
37
|
+
loop?: boolean;
|
|
38
|
+
className?: string;
|
|
39
|
+
style?: CSSProperties;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* RingDraw — animates a circle being drawn stroke-by-stroke (pathLength from 0 to 1).
|
|
43
|
+
* Use for the "O appears" beat of a logo reveal.
|
|
44
|
+
*/
|
|
45
|
+
declare function RingDraw({ cx, cy, r, strokeWidth, color, duration, delay, loop, className, style, }: RingDrawProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
type PulseLoopProps = {
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
/** Min scale during pulse. */
|
|
50
|
+
from?: number;
|
|
51
|
+
/** Max scale during pulse. */
|
|
52
|
+
to?: number;
|
|
53
|
+
/** Full pulse cycle, ms. */
|
|
54
|
+
duration?: number;
|
|
55
|
+
origin?: string;
|
|
56
|
+
/** Pulse opacity along with scale. */
|
|
57
|
+
fadeWithScale?: boolean;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* PulseLoop — gentle infinite breathing scale, useful as a loading indicator
|
|
61
|
+
* on a static mark or as an attention pulse on a CTA-adjacent glyph.
|
|
62
|
+
*/
|
|
63
|
+
declare function PulseLoop({ children, from, to, duration, origin, fadeWithScale, }: PulseLoopProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
|
|
65
|
+
type SequenceStepProps = {
|
|
66
|
+
/** Visible duration of this step, ms. Animation completes within this window. */
|
|
67
|
+
duration?: number;
|
|
68
|
+
/** Delay BEFORE the step starts, after the previous step ends. ms. */
|
|
69
|
+
gap?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Easing curve for the step's opacity transition. Defaults to plain.com-cadence
|
|
72
|
+
* cubic-bezier `[0.16, 1, 0.3, 1]`.
|
|
73
|
+
*/
|
|
74
|
+
ease?: [number, number, number, number] | string;
|
|
75
|
+
/**
|
|
76
|
+
* When `true`, the step stays visible after its window. When `false` (default),
|
|
77
|
+
* the step fades out at the end. Useful for "things stack up" reveals.
|
|
78
|
+
*/
|
|
79
|
+
persist?: boolean;
|
|
80
|
+
children: ReactNode;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* `<Sequence.Step>` — one beat in a `<Sequence>`. Use only as a child of `<Sequence>`.
|
|
84
|
+
* The Sequence parent computes timing offsets; this component is just metadata.
|
|
85
|
+
*/
|
|
86
|
+
declare function SequenceStep(_: SequenceStepProps): ReactNode;
|
|
87
|
+
type SequenceProps = {
|
|
88
|
+
children: ReactNode;
|
|
89
|
+
/** Loop the whole sequence. */
|
|
90
|
+
loop?: boolean;
|
|
91
|
+
/** Delay before the first step, ms. */
|
|
92
|
+
delay?: number;
|
|
93
|
+
/** Gap between the end of the last step and the loop restart, ms. */
|
|
94
|
+
loopGap?: number;
|
|
95
|
+
/** Optional callback per cycle end. Client-only. */
|
|
96
|
+
onCycle?: () => void;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* `<Sequence>` — declarative animation choreography. Compose multiple beats with
|
|
100
|
+
* explicit durations and gaps; the sequence calculates absolute timings, fades each
|
|
101
|
+
* step in/out, and loops cleanly.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```tsx
|
|
105
|
+
* <Sequence loop>
|
|
106
|
+
* <Sequence.Step duration={700}>
|
|
107
|
+
* <RingDraw />
|
|
108
|
+
* </Sequence.Step>
|
|
109
|
+
* <Sequence.Step duration={500} gap={100}>
|
|
110
|
+
* <AppearGrow><YourGlyph /></AppearGrow>
|
|
111
|
+
* </Sequence.Step>
|
|
112
|
+
* <Sequence.Step duration={800} persist>
|
|
113
|
+
* <PulseLoop><YourGlyph /></PulseLoop>
|
|
114
|
+
* </Sequence.Step>
|
|
115
|
+
* </Sequence>
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
declare function Sequence({ children, loop, delay, loopGap }: SequenceProps): react_jsx_runtime.JSX.Element;
|
|
119
|
+
declare namespace Sequence {
|
|
120
|
+
var Step: typeof SequenceStep;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
type StrikethroughProps = {
|
|
124
|
+
/** Starting x in viewBox coords. */
|
|
125
|
+
x1: number;
|
|
126
|
+
/** Starting y. */
|
|
127
|
+
y1: number;
|
|
128
|
+
/** Ending x. */
|
|
129
|
+
x2: number;
|
|
130
|
+
/** Ending y. */
|
|
131
|
+
y2: number;
|
|
132
|
+
color?: string;
|
|
133
|
+
strokeWidth?: number;
|
|
134
|
+
duration?: number;
|
|
135
|
+
delay?: number;
|
|
136
|
+
loop?: boolean;
|
|
137
|
+
className?: string;
|
|
138
|
+
style?: CSSProperties;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Strikethrough — animates a single line being drawn between two points.
|
|
142
|
+
* Use it to "cross out" something visible (a clipboard field, a paper-mail icon)
|
|
143
|
+
* to convey "no more X".
|
|
144
|
+
*/
|
|
145
|
+
declare function Strikethrough({ x1, y1, x2, y2, color, strokeWidth, duration, delay, loop, className, style, }: StrikethroughProps): react_jsx_runtime.JSX.Element;
|
|
146
|
+
|
|
147
|
+
type SweepDirection = "left-to-right" | "right-to-left" | "top-to-bottom" | "bottom-to-top";
|
|
148
|
+
type SweepProps = {
|
|
149
|
+
children: ReactNode;
|
|
150
|
+
/** Total viewBox width the sweep should cover (default 256). */
|
|
151
|
+
width?: number;
|
|
152
|
+
/** Total viewBox height. */
|
|
153
|
+
height?: number;
|
|
154
|
+
direction?: SweepDirection;
|
|
155
|
+
delay?: number;
|
|
156
|
+
duration?: number;
|
|
157
|
+
loop?: boolean;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Sweep — wipes content into view by animating a `<clipPath>` rectangle.
|
|
161
|
+
* Use for reveal-on-scan effects (think OCR-line scanning across a letter).
|
|
162
|
+
*/
|
|
163
|
+
declare function Sweep({ children, width, height, direction, delay, duration, loop, }: SweepProps): react_jsx_runtime.JSX.Element;
|
|
164
|
+
|
|
165
|
+
type WobbleProps = {
|
|
166
|
+
children: ReactNode;
|
|
167
|
+
/** Maximum rotation in degrees. */
|
|
168
|
+
amplitude?: number;
|
|
169
|
+
/** Full wobble cycle, ms. */
|
|
170
|
+
duration?: number;
|
|
171
|
+
/** Pivot point (CSS transform-origin syntax). */
|
|
172
|
+
origin?: string;
|
|
173
|
+
/** Delay before the wobble starts. */
|
|
174
|
+
delay?: number;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Wobble — small left-right rotation, ease-in-out, infinite. Use for "attention"
|
|
178
|
+
* on a CTA-adjacent glyph (e.g., a small bell on a notification badge).
|
|
179
|
+
*/
|
|
180
|
+
declare function Wobble({ children, amplitude, duration, origin, delay, }: WobbleProps): react_jsx_runtime.JSX.Element;
|
|
181
|
+
|
|
182
|
+
type DriftProps = {
|
|
183
|
+
children: ReactNode;
|
|
184
|
+
/** Horizontal drift distance, viewBox units. */
|
|
185
|
+
dx?: number;
|
|
186
|
+
/** Vertical drift distance. */
|
|
187
|
+
dy?: number;
|
|
188
|
+
/** Full cycle (out-and-back), ms. */
|
|
189
|
+
duration?: number;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Drift — gentle floating motion. Use for ambient "alive" feeling on a static
|
|
193
|
+
* mark (subtle x/y oscillation). Not as urgent as Wobble.
|
|
194
|
+
*/
|
|
195
|
+
declare function Drift({ children, dx, dy, duration }: DriftProps): react_jsx_runtime.JSX.Element;
|
|
196
|
+
|
|
197
|
+
export { AppearGrow, type AppearGrowProps, Drift, type DriftProps, PulseLoop, type PulseLoopProps, RingDraw, type RingDrawProps, Sequence, type SequenceProps, SequenceStep, type SequenceStepProps, Strikethrough, type StrikethroughProps, Sweep, type SweepDirection, type SweepProps, Wobble, type WobbleProps };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
type SquircleProps = {
|
|
5
|
+
/** Square edge in viewBox units. Default 256. */
|
|
6
|
+
size?: number;
|
|
7
|
+
/** Corner radius in viewBox units. Default 22% of size (iOS-squircle compatible). */
|
|
8
|
+
radius?: number;
|
|
9
|
+
/** Solid fill OR a gradient ID reference like `url(#bg)`. */
|
|
10
|
+
fill?: string;
|
|
11
|
+
/** Optional `<defs>` content (e.g., a `<linearGradient id="bg" />`). */
|
|
12
|
+
defs?: ReactNode;
|
|
13
|
+
/** Foreground content rendered inside the squircle in the same coord space. */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/** Width/height as DOM dimensions. Pass a number for px. */
|
|
16
|
+
width?: number | string;
|
|
17
|
+
height?: number | string;
|
|
18
|
+
className?: string;
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Squircle — rounded-square SVG container with iOS-compatible corner radius.
|
|
24
|
+
* The base shape for app icons across all 021 brands.
|
|
25
|
+
*/
|
|
26
|
+
declare function Squircle({ size, radius, fill, defs, children, width, height, className, style, ariaLabel, }: SquircleProps): react_jsx_runtime.JSX.Element;
|
|
27
|
+
|
|
28
|
+
type RingProps = {
|
|
29
|
+
/** Center x in viewBox units. */
|
|
30
|
+
cx?: number;
|
|
31
|
+
/** Center y in viewBox units. */
|
|
32
|
+
cy?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Mid-line radius (the centerline of the stroke). Outer = r + stroke/2, inner = r - stroke/2.
|
|
35
|
+
*/
|
|
36
|
+
r?: number;
|
|
37
|
+
/** Stroke width (the ring's thickness). */
|
|
38
|
+
strokeWidth?: number;
|
|
39
|
+
color?: string;
|
|
40
|
+
className?: string;
|
|
41
|
+
style?: CSSProperties;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Ring — the "0" letterform as a thick stroked circle. Sized in SVG viewBox units;
|
|
45
|
+
* place inside a Squircle or other SVG root.
|
|
46
|
+
*/
|
|
47
|
+
declare function Ring({ cx, cy, r, strokeWidth, color, className, style, }: RingProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
|
|
49
|
+
type DiscProps = {
|
|
50
|
+
cx?: number;
|
|
51
|
+
cy?: number;
|
|
52
|
+
r?: number;
|
|
53
|
+
color?: string;
|
|
54
|
+
className?: string;
|
|
55
|
+
style?: CSSProperties;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Disc — solid filled circle. Counterpart to Ring; useful as a postmark dot, pivot screw, etc.
|
|
59
|
+
*/
|
|
60
|
+
declare function Disc({ cx, cy, r, color, className, style, }: DiscProps): react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
62
|
+
export { Disc, type DiscProps, Ring, type RingProps, Squircle, type SquircleProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Disc, Ring, Squircle } from '../chunk-LJ4HZCAP.js';
|