@aviala-design/spiral 2.9.0 → 3.0.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.
@@ -0,0 +1,174 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+
3
+ // src/lib/utils.ts
4
+ var _clsx = require('clsx');
5
+ var _tailwindmerge = require('tailwind-merge');
6
+ function cn(...inputs) {
7
+ return _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, inputs));
8
+ }
9
+
10
+ // src/components/form-field-context.ts
11
+ var _react = require('react');
12
+ var FormFieldControlContext = _react.createContext.call(void 0, null);
13
+ function useResolvedControlError(errorProp) {
14
+ const ctx = _react.useContext.call(void 0, FormFieldControlContext);
15
+ return _nullishCoalesce(_nullishCoalesce(errorProp, () => ( _optionalChain([ctx, 'optionalAccess', _ => _.invalid]))), () => ( false));
16
+ }
17
+
18
+ // src/components/typography.tsx
19
+ var _reactslot = require('@radix-ui/react-slot');
20
+ var _classvarianceauthority = require('class-variance-authority');
21
+
22
+ var _jsxruntime = require('react/jsx-runtime');
23
+ var typographyVariants = _classvarianceauthority.cva.call(void 0, "aviala-typography", {
24
+ variants: {
25
+ level: {
26
+ display: "aviala-typography--display",
27
+ headline1: "aviala-typography--headline1",
28
+ headline2: "aviala-typography--headline2",
29
+ title: "aviala-typography--title",
30
+ subtitle: "aviala-typography--subtitle",
31
+ text: "aviala-typography--text",
32
+ caption: "aviala-typography--caption"
33
+ }
34
+ },
35
+ defaultVariants: {
36
+ level: "text"
37
+ }
38
+ });
39
+ var Typography = _react.forwardRef.call(void 0,
40
+ ({
41
+ className,
42
+ level = "text",
43
+ content = "text",
44
+ tone = "default",
45
+ as: Tag = "span",
46
+ asChild = false,
47
+ ...props
48
+ }, ref) => {
49
+ const hostProps = {
50
+ ...props,
51
+ ref,
52
+ className: cn(typographyVariants({ level }), className),
53
+ "data-content": content,
54
+ "data-tone": tone === "white" ? "white" : void 0
55
+ };
56
+ if (asChild) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactslot.Slot, { ...hostProps });
57
+ return _react.createElement.call(void 0, Tag, hostProps);
58
+ }
59
+ );
60
+ Typography.displayName = "Typography";
61
+
62
+ // src/components/typeface.tsx
63
+
64
+
65
+ var typefaceLayouts = {
66
+ allCustom: [
67
+ { level: "text", children: null },
68
+ { level: "caption", children: null }
69
+ ],
70
+ textCaption: [
71
+ { level: "text", children: null },
72
+ { level: "caption", children: null }
73
+ ],
74
+ textCaptionSubtitle: [
75
+ { level: "subtitle", children: null },
76
+ { level: "text", children: null },
77
+ { level: "caption", children: null }
78
+ ],
79
+ textTitle: [
80
+ { level: "title", children: null },
81
+ { level: "text", children: null }
82
+ ],
83
+ textHeadline2: [
84
+ { level: "headline2", children: null },
85
+ { level: "text", children: null }
86
+ ],
87
+ textHeadline1: [
88
+ { level: "headline1", children: null },
89
+ { level: "text", children: null }
90
+ ]
91
+ };
92
+ var Typeface = _react.forwardRef.call(void 0,
93
+ ({
94
+ className,
95
+ content = "allCustom",
96
+ primary,
97
+ secondary,
98
+ tertiary,
99
+ primaryContent = "text",
100
+ secondaryContent = "text",
101
+ tertiaryContent = "text",
102
+ tone = "default",
103
+ children,
104
+ ...props
105
+ }, ref) => {
106
+ const layout = typefaceLayouts[content];
107
+ const values = resolveTypefaceValues(
108
+ primary,
109
+ secondary,
110
+ tertiary,
111
+ children
112
+ );
113
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
114
+ "div",
115
+ {
116
+ ref,
117
+ className: cn("aviala-typeface", className),
118
+ "data-content": content,
119
+ ...props,
120
+ children: layout.map((line, index) => {
121
+ const value = values[index];
122
+ if (value === void 0 || value === null || value === false)
123
+ return null;
124
+ const lineContent = index === 0 ? primaryContent : index === 1 ? secondaryContent : tertiaryContent;
125
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
126
+ "span",
127
+ {
128
+ className: "aviala-typeface__line",
129
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Typography, { level: line.level, content: lineContent, tone, children: value })
130
+ },
131
+ `${line.level}-${index}`
132
+ );
133
+ })
134
+ }
135
+ );
136
+ }
137
+ );
138
+ Typeface.displayName = "Typeface";
139
+ function resolveTypefaceValues(primary, secondary, tertiary, children) {
140
+ if (primary !== void 0 || secondary !== void 0 || tertiary !== void 0) {
141
+ return [primary, secondary, tertiary];
142
+ }
143
+ if (children == null || children === false) {
144
+ return [];
145
+ }
146
+ if (Array.isArray(children)) {
147
+ return children;
148
+ }
149
+ return [children];
150
+ }
151
+ var TypefacePair = _react.forwardRef.call(void 0,
152
+ ({ title, description, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
153
+ Typeface,
154
+ {
155
+ ref,
156
+ content: "textCaption",
157
+ primary: title,
158
+ secondary: description,
159
+ ...props
160
+ }
161
+ )
162
+ );
163
+ TypefacePair.displayName = "TypefacePair";
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+ exports.cn = cn; exports.FormFieldControlContext = FormFieldControlContext; exports.useResolvedControlError = useResolvedControlError; exports.typographyVariants = typographyVariants; exports.Typography = Typography; exports.Typeface = Typeface; exports.TypefacePair = TypefacePair;
174
+ //# sourceMappingURL=chunk-CXGFGGGI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/spiral-2/spiral-2/packages/ui/dist/chunk-CXGFGGGI.cjs","../src/lib/utils.ts","../src/components/form-field-context.ts","../src/components/typography.tsx","../src/components/typeface.tsx"],"names":["forwardRef","jsx"],"mappings":"AAAA,6rBAAY;AACZ;AACA;ACFA,4BAAsC;AACtC,+CAAwB;AAEjB,SAAS,EAAA,CAAA,GAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,oCAAA,wBAAQ,MAAW,CAAC,CAAA;AAC7B;ADGA;AACA;AETA,8BAA0C;AAanC,IAAM,wBAAA,EACX,kCAAA,IAAuD,CAAA;AAMlD,SAAS,uBAAA,CAAwB,SAAA,EAA8B;AACpE,EAAA,MAAM,IAAA,EAAM,+BAAA,uBAAkC,CAAA;AAC9C,EAAA,yCAAO,SAAA,0BAAa,GAAA,2BAAK,WAAA,UAAW,OAAA;AACtC;AFPA;AACA;AGjBA,iDAAqB;AACrB,kEAAuC;AACvC;AAiEwB,+CAAA;AAjDjB,IAAM,mBAAA,EAAqB,yCAAA,mBAAI,EAAqB;AAAA,EACzD,QAAA,EAAU;AAAA,IACR,KAAA,EAAO;AAAA,MACL,OAAA,EAAS,4BAAA;AAAA,MACT,SAAA,EAAW,8BAAA;AAAA,MACX,SAAA,EAAW,8BAAA;AAAA,MACX,KAAA,EAAO,0BAAA;AAAA,MACP,QAAA,EAAU,6BAAA;AAAA,MACV,IAAA,EAAM,yBAAA;AAAA,MACN,OAAA,EAAS;AAAA,IACX;AAAA,EACF,CAAA;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,KAAA,EAAO;AAAA,EACT;AACF,CAAC,CAAA;AAaM,IAAM,WAAA,EAAa,+BAAA;AAAA,EACxB,CACE;AAAA,IACE,SAAA;AAAA,IACA,MAAA,EAAQ,MAAA;AAAA,IACR,QAAA,EAAU,MAAA;AAAA,IACV,KAAA,EAAO,SAAA;AAAA,IACP,EAAA,EAAI,IAAA,EAAM,MAAA;AAAA,IACV,QAAA,EAAU,KAAA;AAAA,IACV,GAAG;AAAA,EACL,CAAA,EACA,GAAA,EAAA,GACG;AACH,IAAA,MAAM,UAAA,EAA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,IAAU,KAAA,EAAA,GAAa,MAAA,IAAU,KAAA,GAAQ,MAAA,IAAU,KAAA;AACrD,YAAA,OAAO,IAAA;AAET,UAAA,MAAM,YAAA,EACJ,MAAA,IAAU,EAAA,EACN,eAAA,EACA,MAAA,IAAU,EAAA,EACR,iBAAA,EACA,eAAA;AAER,UAAA,uBACEA,6BAAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cAEC,SAAA,EAAU,uBAAA;AAAA,cAEV,QAAA,kBAAAA,6BAAAA,UAAC,EAAA,EAAW,KAAA,EAAO,IAAA,CAAK,KAAA,EAAO,OAAA,EAAS,WAAA,EAAa,IAAA,EAClD,QAAA,EAAA,MAAA,CACH;AAAA,YAAA,CAAA;AAAA,YALK,CAAA,EAAA;AAMP,UAAA;AAEH,QAAA;AAAA,MAAA;AACH,IAAA;AAEJ,EAAA;AACF;AACS;AAEA;AAOL,EAAA;AAIQ,IAAA;AACV,EAAA;AAEI,EAAA;AACM,IAAA;AACV,EAAA;AAEU,EAAA;AACD,IAAA;AACT,EAAA;AAEQ,EAAA;AACV;AAQa;AACD,EAAA;AACP,IAAA;AAAA,IAAA;AACC,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACI,MAAA;AAAA,IAAA;AACN,EAAA;AAEJ;AACa;AJTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/spiral-2/spiral-2/packages/ui/dist/chunk-CXGFGGGI.cjs","sourcesContent":[null,"import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { createContext, useContext } from \"react\";\n\n/**\n * Kept free of `react-hook-form` imports so the controls that consume it\n * (Input, Textarea, Select, …) stay usable from the main entry without the\n * peer dependency installed. The RHF-aware pieces live in `form-field.tsx`,\n * which is only reachable through `@aviala-design/spiral/form`.\n */\ntype FormFieldControlContextValue = {\n /** True when FormField is showing an error tip (layout `error` or RHF message). */\n invalid: boolean;\n};\n\nexport const FormFieldControlContext =\n createContext<FormFieldControlContextValue | null>(null);\n\n/**\n * Resolve a control `error` prop against the surrounding FormField.\n * Explicit `error={true|false}` wins; otherwise inherits FormField tip invalidity.\n */\nexport function useResolvedControlError(errorProp?: boolean): boolean {\n const ctx = useContext(FormFieldControlContext);\n return errorProp ?? ctx?.invalid ?? false;\n}\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { createElement, forwardRef, type HTMLAttributes } from \"react\";\nimport { cn } from \"../lib/utils\";\n\n/** Figma Components → System Composition → Typography (128:85) */\nexport type TypographyLevel =\n | \"display\"\n | \"headline1\"\n | \"headline2\"\n | \"title\"\n | \"subtitle\"\n | \"text\"\n | \"caption\";\n\nexport type TypographyContent = \"text\" | \"number\";\nexport type TypographyTone = \"default\" | \"white\";\n\nexport const typographyVariants = cva(\"aviala-typography\", {\n variants: {\n level: {\n display: \"aviala-typography--display\",\n headline1: \"aviala-typography--headline1\",\n headline2: \"aviala-typography--headline2\",\n title: \"aviala-typography--title\",\n subtitle: \"aviala-typography--subtitle\",\n text: \"aviala-typography--text\",\n caption: \"aviala-typography--caption\",\n },\n },\n defaultVariants: {\n level: \"text\",\n },\n});\n\nexport type TypographyProps = HTMLAttributes<HTMLElement> &\n VariantProps<typeof typographyVariants> & {\n /** Figma `Content` — text vs numeric styling */\n content?: TypographyContent;\n /** Figma `White` — light text on dark surfaces */\n tone?: TypographyTone;\n asChild?: boolean;\n as?:\n \"p\" | \"span\" | \"div\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"label\";\n };\n\nexport const Typography = forwardRef<HTMLSpanElement, TypographyProps>(\n (\n {\n className,\n level = \"text\",\n content = \"text\",\n tone = \"default\",\n as: Tag = \"span\",\n asChild = false,\n ...props\n },\n ref\n ) => {\n const hostProps = {\n ...props,\n ref,\n className: cn(typographyVariants({ level }), className),\n \"data-content\": content,\n \"data-tone\": tone === \"white\" ? \"white\" : undefined,\n };\n\n if (asChild) return <Slot {...hostProps} />;\n\n // JSX resolves a union `as` tag to the intersection of every member's props,\n // which no single element ref can satisfy. createElement keeps the ref typed\n // as HTMLElement.\n return createElement(Tag, hostProps);\n }\n);\nTypography.displayName = \"Typography\";\n","import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport {\n Typography,\n type TypographyContent,\n type TypographyLevel,\n type TypographyTone,\n} from \"./typography\";\n\n/** Figma Components → System Composition → Typeface (527:56311) */\nexport type TypefaceContent =\n | \"allCustom\"\n | \"textCaption\"\n | \"textCaptionSubtitle\"\n | \"textTitle\"\n | \"textHeadline2\"\n | \"textHeadline1\";\n\ntype TypefaceLine = {\n level: TypographyLevel;\n content?: TypographyContent;\n tone?: TypographyTone;\n children: ReactNode;\n};\n\nconst typefaceLayouts: Record<TypefaceContent, TypefaceLine[]> = {\n allCustom: [\n { level: \"text\", children: null },\n { level: \"caption\", children: null },\n ],\n textCaption: [\n { level: \"text\", children: null },\n { level: \"caption\", children: null },\n ],\n textCaptionSubtitle: [\n { level: \"subtitle\", children: null },\n { level: \"text\", children: null },\n { level: \"caption\", children: null },\n ],\n textTitle: [\n { level: \"title\", children: null },\n { level: \"text\", children: null },\n ],\n textHeadline2: [\n { level: \"headline2\", children: null },\n { level: \"text\", children: null },\n ],\n textHeadline1: [\n { level: \"headline1\", children: null },\n { level: \"text\", children: null },\n ],\n};\n\nexport type TypefaceProps = Omit<HTMLAttributes<HTMLDivElement>, \"content\"> & {\n /** Figma `Content` preset */\n content?: TypefaceContent;\n /** Primary line — overrides preset first line */\n primary?: ReactNode;\n /** Secondary line — overrides preset second line */\n secondary?: ReactNode;\n /** Tertiary line — used by `textCaptionSubtitle` */\n tertiary?: ReactNode;\n /** Per-line content mode for numeric text */\n primaryContent?: TypographyContent;\n secondaryContent?: TypographyContent;\n tertiaryContent?: TypographyContent;\n tone?: TypographyTone;\n};\n\nexport const Typeface = forwardRef<HTMLDivElement, TypefaceProps>(\n (\n {\n className,\n content = \"allCustom\",\n primary,\n secondary,\n tertiary,\n primaryContent = \"text\",\n secondaryContent = \"text\",\n tertiaryContent = \"text\",\n tone = \"default\",\n children,\n ...props\n },\n ref\n ) => {\n const layout = typefaceLayouts[content];\n const values = resolveTypefaceValues(\n primary,\n secondary,\n tertiary,\n children\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"aviala-typeface\", className)}\n data-content={content}\n {...props}\n >\n {layout.map((line, index) => {\n const value = values[index];\n if (value === undefined || value === null || value === false)\n return null;\n\n const lineContent =\n index === 0\n ? primaryContent\n : index === 1\n ? secondaryContent\n : tertiaryContent;\n\n return (\n <span\n key={`${line.level}-${index}`}\n className=\"aviala-typeface__line\"\n >\n <Typography level={line.level} content={lineContent} tone={tone}>\n {value}\n </Typography>\n </span>\n );\n })}\n </div>\n );\n }\n);\nTypeface.displayName = \"Typeface\";\n\nfunction resolveTypefaceValues(\n primary?: ReactNode,\n secondary?: ReactNode,\n tertiary?: ReactNode,\n children?: ReactNode\n): ReactNode[] {\n if (\n primary !== undefined ||\n secondary !== undefined ||\n tertiary !== undefined\n ) {\n return [primary, secondary, tertiary];\n }\n\n if (children == null || children === false) {\n return [];\n }\n\n if (Array.isArray(children)) {\n return children;\n }\n\n return [children];\n}\n\n/** Convenience helper for two-line label + caption pairs (Radio, Checkbox, etc.) */\nexport type TypefacePairProps = Omit<TypefaceProps, \"content\"> & {\n title: ReactNode;\n description?: ReactNode;\n};\n\nexport const TypefacePair = forwardRef<HTMLDivElement, TypefacePairProps>(\n ({ title, description, ...props }, ref) => (\n <Typeface\n ref={ref}\n content=\"textCaption\"\n primary={title}\n secondary={description}\n {...props}\n />\n )\n);\nTypefacePair.displayName = \"TypefacePair\";\n"]}
@@ -0,0 +1,174 @@
1
+ "use client";
2
+
3
+ // src/lib/utils.ts
4
+ import { clsx } from "clsx";
5
+ import { twMerge } from "tailwind-merge";
6
+ function cn(...inputs) {
7
+ return twMerge(clsx(inputs));
8
+ }
9
+
10
+ // src/components/form-field-context.ts
11
+ import { createContext, useContext } from "react";
12
+ var FormFieldControlContext = createContext(null);
13
+ function useResolvedControlError(errorProp) {
14
+ const ctx = useContext(FormFieldControlContext);
15
+ return errorProp ?? ctx?.invalid ?? false;
16
+ }
17
+
18
+ // src/components/typography.tsx
19
+ import { Slot } from "@radix-ui/react-slot";
20
+ import { cva } from "class-variance-authority";
21
+ import { createElement, forwardRef } from "react";
22
+ import { jsx } from "react/jsx-runtime";
23
+ var typographyVariants = cva("aviala-typography", {
24
+ variants: {
25
+ level: {
26
+ display: "aviala-typography--display",
27
+ headline1: "aviala-typography--headline1",
28
+ headline2: "aviala-typography--headline2",
29
+ title: "aviala-typography--title",
30
+ subtitle: "aviala-typography--subtitle",
31
+ text: "aviala-typography--text",
32
+ caption: "aviala-typography--caption"
33
+ }
34
+ },
35
+ defaultVariants: {
36
+ level: "text"
37
+ }
38
+ });
39
+ var Typography = forwardRef(
40
+ ({
41
+ className,
42
+ level = "text",
43
+ content = "text",
44
+ tone = "default",
45
+ as: Tag = "span",
46
+ asChild = false,
47
+ ...props
48
+ }, ref) => {
49
+ const hostProps = {
50
+ ...props,
51
+ ref,
52
+ className: cn(typographyVariants({ level }), className),
53
+ "data-content": content,
54
+ "data-tone": tone === "white" ? "white" : void 0
55
+ };
56
+ if (asChild) return /* @__PURE__ */ jsx(Slot, { ...hostProps });
57
+ return createElement(Tag, hostProps);
58
+ }
59
+ );
60
+ Typography.displayName = "Typography";
61
+
62
+ // src/components/typeface.tsx
63
+ import { forwardRef as forwardRef2 } from "react";
64
+ import { jsx as jsx2 } from "react/jsx-runtime";
65
+ var typefaceLayouts = {
66
+ allCustom: [
67
+ { level: "text", children: null },
68
+ { level: "caption", children: null }
69
+ ],
70
+ textCaption: [
71
+ { level: "text", children: null },
72
+ { level: "caption", children: null }
73
+ ],
74
+ textCaptionSubtitle: [
75
+ { level: "subtitle", children: null },
76
+ { level: "text", children: null },
77
+ { level: "caption", children: null }
78
+ ],
79
+ textTitle: [
80
+ { level: "title", children: null },
81
+ { level: "text", children: null }
82
+ ],
83
+ textHeadline2: [
84
+ { level: "headline2", children: null },
85
+ { level: "text", children: null }
86
+ ],
87
+ textHeadline1: [
88
+ { level: "headline1", children: null },
89
+ { level: "text", children: null }
90
+ ]
91
+ };
92
+ var Typeface = forwardRef2(
93
+ ({
94
+ className,
95
+ content = "allCustom",
96
+ primary,
97
+ secondary,
98
+ tertiary,
99
+ primaryContent = "text",
100
+ secondaryContent = "text",
101
+ tertiaryContent = "text",
102
+ tone = "default",
103
+ children,
104
+ ...props
105
+ }, ref) => {
106
+ const layout = typefaceLayouts[content];
107
+ const values = resolveTypefaceValues(
108
+ primary,
109
+ secondary,
110
+ tertiary,
111
+ children
112
+ );
113
+ return /* @__PURE__ */ jsx2(
114
+ "div",
115
+ {
116
+ ref,
117
+ className: cn("aviala-typeface", className),
118
+ "data-content": content,
119
+ ...props,
120
+ children: layout.map((line, index) => {
121
+ const value = values[index];
122
+ if (value === void 0 || value === null || value === false)
123
+ return null;
124
+ const lineContent = index === 0 ? primaryContent : index === 1 ? secondaryContent : tertiaryContent;
125
+ return /* @__PURE__ */ jsx2(
126
+ "span",
127
+ {
128
+ className: "aviala-typeface__line",
129
+ children: /* @__PURE__ */ jsx2(Typography, { level: line.level, content: lineContent, tone, children: value })
130
+ },
131
+ `${line.level}-${index}`
132
+ );
133
+ })
134
+ }
135
+ );
136
+ }
137
+ );
138
+ Typeface.displayName = "Typeface";
139
+ function resolveTypefaceValues(primary, secondary, tertiary, children) {
140
+ if (primary !== void 0 || secondary !== void 0 || tertiary !== void 0) {
141
+ return [primary, secondary, tertiary];
142
+ }
143
+ if (children == null || children === false) {
144
+ return [];
145
+ }
146
+ if (Array.isArray(children)) {
147
+ return children;
148
+ }
149
+ return [children];
150
+ }
151
+ var TypefacePair = forwardRef2(
152
+ ({ title, description, ...props }, ref) => /* @__PURE__ */ jsx2(
153
+ Typeface,
154
+ {
155
+ ref,
156
+ content: "textCaption",
157
+ primary: title,
158
+ secondary: description,
159
+ ...props
160
+ }
161
+ )
162
+ );
163
+ TypefacePair.displayName = "TypefacePair";
164
+
165
+ export {
166
+ cn,
167
+ FormFieldControlContext,
168
+ useResolvedControlError,
169
+ typographyVariants,
170
+ Typography,
171
+ Typeface,
172
+ TypefacePair
173
+ };
174
+ //# sourceMappingURL=chunk-XVABQUTX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/utils.ts","../src/components/form-field-context.ts","../src/components/typography.tsx","../src/components/typeface.tsx"],"sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { createContext, useContext } from \"react\";\n\n/**\n * Kept free of `react-hook-form` imports so the controls that consume it\n * (Input, Textarea, Select, …) stay usable from the main entry without the\n * peer dependency installed. The RHF-aware pieces live in `form-field.tsx`,\n * which is only reachable through `@aviala-design/spiral/form`.\n */\ntype FormFieldControlContextValue = {\n /** True when FormField is showing an error tip (layout `error` or RHF message). */\n invalid: boolean;\n};\n\nexport const FormFieldControlContext =\n createContext<FormFieldControlContextValue | null>(null);\n\n/**\n * Resolve a control `error` prop against the surrounding FormField.\n * Explicit `error={true|false}` wins; otherwise inherits FormField tip invalidity.\n */\nexport function useResolvedControlError(errorProp?: boolean): boolean {\n const ctx = useContext(FormFieldControlContext);\n return errorProp ?? ctx?.invalid ?? false;\n}\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { createElement, forwardRef, type HTMLAttributes } from \"react\";\nimport { cn } from \"../lib/utils\";\n\n/** Figma Components → System Composition → Typography (128:85) */\nexport type TypographyLevel =\n | \"display\"\n | \"headline1\"\n | \"headline2\"\n | \"title\"\n | \"subtitle\"\n | \"text\"\n | \"caption\";\n\nexport type TypographyContent = \"text\" | \"number\";\nexport type TypographyTone = \"default\" | \"white\";\n\nexport const typographyVariants = cva(\"aviala-typography\", {\n variants: {\n level: {\n display: \"aviala-typography--display\",\n headline1: \"aviala-typography--headline1\",\n headline2: \"aviala-typography--headline2\",\n title: \"aviala-typography--title\",\n subtitle: \"aviala-typography--subtitle\",\n text: \"aviala-typography--text\",\n caption: \"aviala-typography--caption\",\n },\n },\n defaultVariants: {\n level: \"text\",\n },\n});\n\nexport type TypographyProps = HTMLAttributes<HTMLElement> &\n VariantProps<typeof typographyVariants> & {\n /** Figma `Content` — text vs numeric styling */\n content?: TypographyContent;\n /** Figma `White` — light text on dark surfaces */\n tone?: TypographyTone;\n asChild?: boolean;\n as?:\n \"p\" | \"span\" | \"div\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"label\";\n };\n\nexport const Typography = forwardRef<HTMLSpanElement, TypographyProps>(\n (\n {\n className,\n level = \"text\",\n content = \"text\",\n tone = \"default\",\n as: Tag = \"span\",\n asChild = false,\n ...props\n },\n ref\n ) => {\n const hostProps = {\n ...props,\n ref,\n className: cn(typographyVariants({ level }), className),\n \"data-content\": content,\n \"data-tone\": tone === \"white\" ? \"white\" : undefined,\n };\n\n if (asChild) return <Slot {...hostProps} />;\n\n // JSX resolves a union `as` tag to the intersection of every member's props,\n // which no single element ref can satisfy. createElement keeps the ref typed\n // as HTMLElement.\n return createElement(Tag, hostProps);\n }\n);\nTypography.displayName = \"Typography\";\n","import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport {\n Typography,\n type TypographyContent,\n type TypographyLevel,\n type TypographyTone,\n} from \"./typography\";\n\n/** Figma Components → System Composition → Typeface (527:56311) */\nexport type TypefaceContent =\n | \"allCustom\"\n | \"textCaption\"\n | \"textCaptionSubtitle\"\n | \"textTitle\"\n | \"textHeadline2\"\n | \"textHeadline1\";\n\ntype TypefaceLine = {\n level: TypographyLevel;\n content?: TypographyContent;\n tone?: TypographyTone;\n children: ReactNode;\n};\n\nconst typefaceLayouts: Record<TypefaceContent, TypefaceLine[]> = {\n allCustom: [\n { level: \"text\", children: null },\n { level: \"caption\", children: null },\n ],\n textCaption: [\n { level: \"text\", children: null },\n { level: \"caption\", children: null },\n ],\n textCaptionSubtitle: [\n { level: \"subtitle\", children: null },\n { level: \"text\", children: null },\n { level: \"caption\", children: null },\n ],\n textTitle: [\n { level: \"title\", children: null },\n { level: \"text\", children: null },\n ],\n textHeadline2: [\n { level: \"headline2\", children: null },\n { level: \"text\", children: null },\n ],\n textHeadline1: [\n { level: \"headline1\", children: null },\n { level: \"text\", children: null },\n ],\n};\n\nexport type TypefaceProps = Omit<HTMLAttributes<HTMLDivElement>, \"content\"> & {\n /** Figma `Content` preset */\n content?: TypefaceContent;\n /** Primary line — overrides preset first line */\n primary?: ReactNode;\n /** Secondary line — overrides preset second line */\n secondary?: ReactNode;\n /** Tertiary line — used by `textCaptionSubtitle` */\n tertiary?: ReactNode;\n /** Per-line content mode for numeric text */\n primaryContent?: TypographyContent;\n secondaryContent?: TypographyContent;\n tertiaryContent?: TypographyContent;\n tone?: TypographyTone;\n};\n\nexport const Typeface = forwardRef<HTMLDivElement, TypefaceProps>(\n (\n {\n className,\n content = \"allCustom\",\n primary,\n secondary,\n tertiary,\n primaryContent = \"text\",\n secondaryContent = \"text\",\n tertiaryContent = \"text\",\n tone = \"default\",\n children,\n ...props\n },\n ref\n ) => {\n const layout = typefaceLayouts[content];\n const values = resolveTypefaceValues(\n primary,\n secondary,\n tertiary,\n children\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"aviala-typeface\", className)}\n data-content={content}\n {...props}\n >\n {layout.map((line, index) => {\n const value = values[index];\n if (value === undefined || value === null || value === false)\n return null;\n\n const lineContent =\n index === 0\n ? primaryContent\n : index === 1\n ? secondaryContent\n : tertiaryContent;\n\n return (\n <span\n key={`${line.level}-${index}`}\n className=\"aviala-typeface__line\"\n >\n <Typography level={line.level} content={lineContent} tone={tone}>\n {value}\n </Typography>\n </span>\n );\n })}\n </div>\n );\n }\n);\nTypeface.displayName = \"Typeface\";\n\nfunction resolveTypefaceValues(\n primary?: ReactNode,\n secondary?: ReactNode,\n tertiary?: ReactNode,\n children?: ReactNode\n): ReactNode[] {\n if (\n primary !== undefined ||\n secondary !== undefined ||\n tertiary !== undefined\n ) {\n return [primary, secondary, tertiary];\n }\n\n if (children == null || children === false) {\n return [];\n }\n\n if (Array.isArray(children)) {\n return children;\n }\n\n return [children];\n}\n\n/** Convenience helper for two-line label + caption pairs (Radio, Checkbox, etc.) */\nexport type TypefacePairProps = Omit<TypefaceProps, \"content\"> & {\n title: ReactNode;\n description?: ReactNode;\n};\n\nexport const TypefacePair = forwardRef<HTMLDivElement, TypefacePairProps>(\n ({ title, description, ...props }, ref) => (\n <Typeface\n ref={ref}\n content=\"textCaption\"\n primary={title}\n secondary={description}\n {...props}\n />\n )\n);\nTypefacePair.displayName = \"TypefacePair\";\n"],"mappings":";;;AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,SAAS,eAAe,kBAAkB;AAanC,IAAM,0BACX,cAAmD,IAAI;AAMlD,SAAS,wBAAwB,WAA8B;AACpE,QAAM,MAAM,WAAW,uBAAuB;AAC9C,SAAO,aAAa,KAAK,WAAW;AACtC;;;ACvBA,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAS,eAAe,kBAAuC;AAiEvC;AAjDjB,IAAM,qBAAqB,IAAI,qBAAqB;AAAA,EACzD,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA,MACT,WAAW;AAAA,MACX,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,OAAO;AAAA,EACT;AACF,CAAC;AAaM,IAAM,aAAa;AAA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AA,EAC1B,CAAC,EAAE,OAAO,aAAa,GAAG,MAAM,GAAG,QACjC,gBAAAD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR,SAAS;AAAA,MACT,WAAW;AAAA,MACV,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,aAAa,cAAc;","names":["forwardRef","jsx","forwardRef"]}
@@ -25,7 +25,30 @@
25
25
  }
26
26
  }
27
27
  ],
28
+ "Card": [
29
+ {
30
+ "version": "3.0.0",
31
+ "sections": {
32
+ "Removed": [
33
+ "`CardHead` / `CardBottom` `actionLabel` 的 `Text` 默认值;未传 `actionLabel` 且未传 `action` 时不再渲染主操作按钮"
34
+ ]
35
+ }
36
+ }
37
+ ],
28
38
  "CascaderField": [
39
+ {
40
+ "version": "3.0.0",
41
+ "sections": {
42
+ "Added": [
43
+ "`CascaderItem`:Up / Down 在同一列的选项之间移动焦点,Home / End 跳到该列首尾;`title` 行与禁用项自动跳过,跨列仍由展开方向键负责",
44
+ "`CascaderOptionsMenu` `groupTitle`:可选的列分组标题,透传给 `CascaderItemGroup` 的 `label`;默认不传即不渲染标题行"
45
+ ],
46
+ "Removed": [
47
+ "`CascaderOptionsMenu` 不再输出硬编码的 `Title` 分组标题",
48
+ "`CascaderItem` 开启 `showBadge` 但未传 `badge` 时不再回填 `Text` 占位 Badge"
49
+ ]
50
+ }
51
+ },
29
52
  {
30
53
  "version": "2.8.0",
31
54
  "sections": {
@@ -117,6 +140,15 @@
117
140
  }
118
141
  ],
119
142
  "DatePickerField": [
143
+ {
144
+ "version": "3.0.0",
145
+ "sections": {
146
+ "Fixed": [
147
+ "日历面板不再使用 `role=\"application\"`,改为 `role=\"group\"`,屏幕阅读器恢复常规浏览模式",
148
+ "日期网格补齐 `role=\"row\"` 行语义,配合已有的 `role=\"gridcell\"` 与方向键 / Home / End / PageUp / PageDown 导航"
149
+ ]
150
+ }
151
+ },
120
152
  {
121
153
  "version": "2.8.0",
122
154
  "sections": {
@@ -166,7 +198,31 @@
166
198
  }
167
199
  }
168
200
  ],
201
+ "Form": [
202
+ {
203
+ "version": "3.0.0",
204
+ "sections": {
205
+ "Changed": [
206
+ "**BREAKING** `Form` 与 `FormField` 移至子路径入口 `@aviala-design/spiral/form`,主入口不再导出它们。迁移方式:`import { Form, FormField } from \"@aviala-design/spiral/form\";`。",
207
+ "主入口 `@aviala-design/spiral` 不再引用 `react-hook-form`,未安装该 peer 的项目可以正常引入包内任意组件。",
208
+ "`react-hook-form` peer 区间保持 `>=7.50`,并标记为 `peerDependenciesMeta.optional`,仅使用 `/form` 入口时才需要安装。"
209
+ ],
210
+ "Added": [
211
+ "新增 `./form` 导出条件(`types` / `import` / `require`,并附 `development` 指向 `./src/form.ts`),与主入口保持一致的解析方式。"
212
+ ]
213
+ }
214
+ }
215
+ ],
169
216
  "FormField": [
217
+ {
218
+ "version": "3.0.0",
219
+ "sections": {
220
+ "Changed": [
221
+ "**BREAKING** `FormField` 从主入口移至 `@aviala-design/spiral/form`(layout 模式与 react-hook-form 模式均在此入口)。迁移方式:`import { FormField } from \"@aviala-design/spiral/form\";`。",
222
+ "`useResolvedControlError` 仍从主入口导出,Input / Textarea / Select / NumberInput / Cascader / DatePicker / TimePicker 的 error 联动行为不变。"
223
+ ]
224
+ }
225
+ },
170
226
  {
171
227
  "version": "2.7.2",
172
228
  "sections": {
@@ -177,6 +233,18 @@
177
233
  }
178
234
  ],
179
235
  "List": [
236
+ {
237
+ "version": "3.0.0",
238
+ "sections": {
239
+ "Fixed": [
240
+ "可交互的 `ListItem`(传入 `onClick` 或 `interactive`)现在可以获得焦点:补上 `tabIndex`、`role=\"button\"` 与 Enter / Space 触发,行内 Switch、Button、Select 等控件仍各自响应按键",
241
+ "`disabled` 的可交互行标记 `aria-disabled`;`href` 链接行的行为保持不变"
242
+ ],
243
+ "Removed": [
244
+ "`ListItem` `actionLabel` 的 `Text` 默认值;未传 `actionLabel` 且未传 `action` 时不再渲染主操作按钮"
245
+ ]
246
+ }
247
+ },
180
248
  {
181
249
  "version": "2.6.2",
182
250
  "sections": {
@@ -394,6 +462,14 @@
394
462
  }
395
463
  ],
396
464
  "ScrollPicker": [
465
+ {
466
+ "version": "3.0.0",
467
+ "sections": {
468
+ "Fixed": [
469
+ "`loop={false}` 的列滚到首尾后不再吞掉滚轮事件,页面可以继续滚动;loop 列行为不变"
470
+ ]
471
+ }
472
+ },
397
473
  {
398
474
  "version": "2.6.1",
399
475
  "sections": {
@@ -405,6 +481,17 @@
405
481
  }
406
482
  ],
407
483
  "SegmentatorGroup": [
484
+ {
485
+ "version": "3.0.0",
486
+ "sections": {
487
+ "Added": [
488
+ "键盘操作对齐 radiogroup 规范:方向键(horizontal 用 Left/Right,vertical 用 Up/Down,RTL 自动镜像)在项之间移动并同步选中,Home/End 跳到首尾"
489
+ ],
490
+ "Changed": [
491
+ "改为 roving tabindex:仅选中项参与 Tab 序列(未选中时由首个可用项接管),进入分段控件后用方向键切换"
492
+ ]
493
+ }
494
+ },
408
495
  {
409
496
  "version": "2.8.0",
410
497
  "sections": {
@@ -461,6 +548,20 @@
461
548
  }
462
549
  ],
463
550
  "Select": [
551
+ {
552
+ "version": "3.0.0",
553
+ "sections": {
554
+ "Added": [
555
+ "`SelectSubItem`:焦点在子菜单行上时可用 Up / Down / Home / End 在同层菜单项之间移动;展开方向键(RTL 下镜像)打开子菜单并把焦点送入首项,收起方向键或 Esc 关闭并把焦点送回该行",
556
+ "主菜单在 `SelectSubItem` 与 Radix `SelectItem` 混排时,方向键会把焦点送入/送出子菜单行(Radix 集合本身会跳过这些行)",
557
+ "子菜单面板内同样支持 Up / Down / Home / End,导航范围限定在当前面板"
558
+ ],
559
+ "Removed": [
560
+ "`SelectItem` / `SelectSubItem` 开启 `showBadge` 但未传 `badge` 时不再回填 `Text` 占位 Badge",
561
+ "`SelectItem` / `SelectSubItem` 开启 `showMoreFunction` 但未传 `moreAction` 时不再回填 `Text` 占位 Link,尾部槽位整体不渲染"
562
+ ]
563
+ }
564
+ },
464
565
  {
465
566
  "version": "2.8.0",
466
567
  "sections": {
@@ -546,6 +647,18 @@
546
647
  }
547
648
  ],
548
649
  "Table": [
650
+ {
651
+ "version": "3.0.0",
652
+ "sections": {
653
+ "Changed": [
654
+ "`TableCell` `content=\"people\"` 未传 `people` 时,默认头像改用 `users_user` 图标,不再显示 `A` 占位字母"
655
+ ],
656
+ "Removed": [
657
+ "`TableCell` `content=\"badge\"` 未传 `badge` / `badgeLabel` 时不再回填 `Text` 占位 Badge",
658
+ "`TableCell` `content=\"icon-place+text\"` 未传 `iconPlace` / `icon` 时不再渲染 `A` 占位形底,图标位整体省略"
659
+ ]
660
+ }
661
+ },
549
662
  {
550
663
  "version": "2.7.0",
551
664
  "sections": {
@@ -563,6 +676,14 @@
563
676
  }
564
677
  ],
565
678
  "TimePickerField": [
679
+ {
680
+ "version": "3.0.0",
681
+ "sections": {
682
+ "Fixed": [
683
+ "时间面板不再使用 `role=\"application\"`,改为 `role=\"group\"`;面板内的时 / 分列仍是可 Tab 到达的 listbox,支持 Up / Down / Home / End"
684
+ ]
685
+ }
686
+ },
566
687
  {
567
688
  "version": "2.8.0",
568
689
  "sections": {
@@ -624,6 +745,14 @@
624
745
  }
625
746
  ],
626
747
  "Typeface": [
748
+ {
749
+ "version": "3.0.0",
750
+ "sections": {
751
+ "Removed": [
752
+ "未传 `children` / `primary` / `secondary` / `tertiary` 时不再回填 `Text` 占位文案,改为不渲染任何文本行"
753
+ ]
754
+ }
755
+ },
627
756
  {
628
757
  "version": "2.0.0",
629
758
  "sections": {
@@ -634,6 +763,14 @@
634
763
  }
635
764
  ],
636
765
  "Video": [
766
+ {
767
+ "version": "3.0.0",
768
+ "sections": {
769
+ "Fixed": [
770
+ "倍速菜单补齐 listbox 键盘模型:roving tabindex 让当前倍速成为唯一 Tab 落点,Up / Down / Home / End 在选项间移动,`aria-activedescendant` 指向焦点项"
771
+ ]
772
+ }
773
+ },
637
774
  {
638
775
  "version": "2.8.0",
639
776
  "sections": {
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Resolve a control `error` prop against the surrounding FormField.
3
+ * Explicit `error={true|false}` wins; otherwise inherits FormField tip invalidity.
4
+ */
5
+ declare function useResolvedControlError(errorProp?: boolean): boolean;
6
+
7
+ export { useResolvedControlError as u };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Resolve a control `error` prop against the surrounding FormField.
3
+ * Explicit `error={true|false}` wins; otherwise inherits FormField tip invalidity.
4
+ */
5
+ declare function useResolvedControlError(errorProp?: boolean): boolean;
6
+
7
+ export { useResolvedControlError as u };