@tachui/primitives 0.8.0-alpha
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 +363 -0
- package/README.md +458 -0
- package/dist/BasicInput-CWFHw9rL.js +390 -0
- package/dist/Divider-DWgDKavU.js +474 -0
- package/dist/HTML-aWcvQ0VC.js +321 -0
- package/dist/Picker-DrZ7ibdt.js +1675 -0
- package/dist/Text-DYyFBJ6i.js +165 -0
- package/dist/controls/Button.d.ts +250 -0
- package/dist/controls/Button.d.ts.map +1 -0
- package/dist/controls/Link.d.ts +365 -0
- package/dist/controls/Link.d.ts.map +1 -0
- package/dist/controls/Picker.d.ts +153 -0
- package/dist/controls/Picker.d.ts.map +1 -0
- package/dist/controls/Toggle.d.ts +207 -0
- package/dist/controls/Toggle.d.ts.map +1 -0
- package/dist/controls/index.d.ts +8 -0
- package/dist/controls/index.d.ts.map +1 -0
- package/dist/controls/index.js +18 -0
- package/dist/display/HTML.d.ts +120 -0
- package/dist/display/HTML.d.ts.map +1 -0
- package/dist/display/Image.d.ts +192 -0
- package/dist/display/Image.d.ts.map +1 -0
- package/dist/display/Text.d.ts +269 -0
- package/dist/display/Text.d.ts.map +1 -0
- package/dist/display/index.d.ts +7 -0
- package/dist/display/index.d.ts.map +1 -0
- package/dist/display/index.js +21 -0
- package/dist/forms/BasicForm.d.ts +141 -0
- package/dist/forms/BasicForm.d.ts.map +1 -0
- package/dist/forms/BasicInput.d.ts +116 -0
- package/dist/forms/BasicInput.d.ts.map +1 -0
- package/dist/forms/index.d.ts +6 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +10 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +485 -0
- package/dist/layout/Divider.d.ts +168 -0
- package/dist/layout/Divider.d.ts.map +1 -0
- package/dist/layout/Spacer.d.ts +35 -0
- package/dist/layout/Spacer.d.ts.map +1 -0
- package/dist/layout/Stack.d.ts +74 -0
- package/dist/layout/Stack.d.ts.map +1 -0
- package/dist/layout/index.d.ts +7 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +15 -0
- package/dist/validation.d.ts +91 -0
- package/dist/validation.d.ts.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Text Component
|
|
3
|
+
*
|
|
4
|
+
* SwiftUI-inspired Text component with full typography support,
|
|
5
|
+
* text formatting, and advanced styling capabilities.
|
|
6
|
+
*/
|
|
7
|
+
import type { ModifiableComponent, ModifierBuilder } from '@tachui/core';
|
|
8
|
+
import type { Signal } from '@tachui/core';
|
|
9
|
+
import type { ComponentInstance, ComponentProps } from '@tachui/core';
|
|
10
|
+
import type { Concatenatable } from '@tachui/core';
|
|
11
|
+
import { type ElementOverrideProps } from '@tachui/core';
|
|
12
|
+
import { ComponentWithCSSClasses, type CSSClassesProps } from '@tachui/core';
|
|
13
|
+
/**
|
|
14
|
+
* Text component properties with element override support and CSS classes
|
|
15
|
+
*/
|
|
16
|
+
export interface TextProps extends ComponentProps, ElementOverrideProps, CSSClassesProps {
|
|
17
|
+
content?: string | (() => string) | Signal<string>;
|
|
18
|
+
font?: {
|
|
19
|
+
family?: string;
|
|
20
|
+
size?: number | string;
|
|
21
|
+
weight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
22
|
+
style?: 'normal' | 'italic' | 'oblique';
|
|
23
|
+
variant?: 'normal' | 'small-caps';
|
|
24
|
+
};
|
|
25
|
+
color?: string | Signal<string>;
|
|
26
|
+
backgroundColor?: string | Signal<string>;
|
|
27
|
+
textAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
28
|
+
textDecoration?: 'none' | 'underline' | 'line-through' | 'overline';
|
|
29
|
+
textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';
|
|
30
|
+
lineHeight?: number | string;
|
|
31
|
+
letterSpacing?: number | string;
|
|
32
|
+
wordSpacing?: number | string;
|
|
33
|
+
lineLimit?: number;
|
|
34
|
+
truncationMode?: 'head' | 'tail' | 'middle';
|
|
35
|
+
allowsSelection?: boolean;
|
|
36
|
+
accessibilityLabel?: string;
|
|
37
|
+
accessibilityRole?: 'text' | 'heading' | 'label';
|
|
38
|
+
accessibilityLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
39
|
+
onTap?: () => void;
|
|
40
|
+
onLongPress?: () => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Text formatting options
|
|
44
|
+
*/
|
|
45
|
+
export interface TextFormatting {
|
|
46
|
+
bold?: boolean;
|
|
47
|
+
italic?: boolean;
|
|
48
|
+
underline?: boolean;
|
|
49
|
+
strikethrough?: boolean;
|
|
50
|
+
monospace?: boolean;
|
|
51
|
+
smallCaps?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Typography presets following SwiftUI patterns
|
|
55
|
+
*/
|
|
56
|
+
export declare const Typography: {
|
|
57
|
+
largeTitle: {
|
|
58
|
+
size: number;
|
|
59
|
+
weight: "400";
|
|
60
|
+
lineHeight: number;
|
|
61
|
+
};
|
|
62
|
+
title: {
|
|
63
|
+
size: number;
|
|
64
|
+
weight: "400";
|
|
65
|
+
lineHeight: number;
|
|
66
|
+
};
|
|
67
|
+
title2: {
|
|
68
|
+
size: number;
|
|
69
|
+
weight: "400";
|
|
70
|
+
lineHeight: number;
|
|
71
|
+
};
|
|
72
|
+
title3: {
|
|
73
|
+
size: number;
|
|
74
|
+
weight: "400";
|
|
75
|
+
lineHeight: number;
|
|
76
|
+
};
|
|
77
|
+
headline: {
|
|
78
|
+
size: number;
|
|
79
|
+
weight: "600";
|
|
80
|
+
lineHeight: number;
|
|
81
|
+
};
|
|
82
|
+
body: {
|
|
83
|
+
size: number;
|
|
84
|
+
weight: "400";
|
|
85
|
+
lineHeight: number;
|
|
86
|
+
};
|
|
87
|
+
callout: {
|
|
88
|
+
size: number;
|
|
89
|
+
weight: "400";
|
|
90
|
+
lineHeight: number;
|
|
91
|
+
};
|
|
92
|
+
subheadline: {
|
|
93
|
+
size: number;
|
|
94
|
+
weight: "400";
|
|
95
|
+
lineHeight: number;
|
|
96
|
+
};
|
|
97
|
+
footnote: {
|
|
98
|
+
size: number;
|
|
99
|
+
weight: "400";
|
|
100
|
+
lineHeight: number;
|
|
101
|
+
};
|
|
102
|
+
caption: {
|
|
103
|
+
size: number;
|
|
104
|
+
weight: "400";
|
|
105
|
+
lineHeight: number;
|
|
106
|
+
};
|
|
107
|
+
caption2: {
|
|
108
|
+
size: number;
|
|
109
|
+
weight: "400";
|
|
110
|
+
lineHeight: number;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Enhanced Text component class with reactive content handling, concatenation support, element override, and CSS classes
|
|
115
|
+
*/
|
|
116
|
+
export declare class EnhancedText extends ComponentWithCSSClasses implements ComponentInstance<TextProps>, Concatenatable<TextProps> {
|
|
117
|
+
props: TextProps;
|
|
118
|
+
readonly type: "component";
|
|
119
|
+
readonly id: string;
|
|
120
|
+
mounted: boolean;
|
|
121
|
+
cleanup: (() => void)[];
|
|
122
|
+
private effectiveTag;
|
|
123
|
+
private validationResult;
|
|
124
|
+
constructor(props: TextProps);
|
|
125
|
+
/**
|
|
126
|
+
* Render the text component with reactive content handling, element override support, and CSS classes
|
|
127
|
+
*/
|
|
128
|
+
render(): import("@tachui/core").DOMNode[];
|
|
129
|
+
concat(_other: any): any;
|
|
130
|
+
toSegment(): any;
|
|
131
|
+
isConcatenatable(): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Cleanup resources
|
|
134
|
+
*/
|
|
135
|
+
dispose(): void;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Create enhanced Text component with modifier support and concatenation
|
|
139
|
+
*/
|
|
140
|
+
export declare function Text(content?: string | (() => string) | Signal<string>, additionalProps?: Partial<TextProps>): ModifiableComponent<TextProps> & {
|
|
141
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
142
|
+
} & Concatenatable<TextProps>;
|
|
143
|
+
/**
|
|
144
|
+
* Text formatting utility functions
|
|
145
|
+
*/
|
|
146
|
+
export declare const TextFormat: {
|
|
147
|
+
/**
|
|
148
|
+
* Create formatted text with multiple styling options
|
|
149
|
+
*/
|
|
150
|
+
formatted(content: string | (() => string) | Signal<string>, formatting: TextFormatting, additionalProps?: Partial<TextProps>): ModifiableComponent<TextProps> & {
|
|
151
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
152
|
+
} & Concatenatable<TextProps>;
|
|
153
|
+
/**
|
|
154
|
+
* Create bold text
|
|
155
|
+
*/
|
|
156
|
+
bold(content: string | (() => string) | Signal<string>, additionalProps?: Partial<TextProps>): ModifiableComponent<TextProps> & {
|
|
157
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
158
|
+
} & Concatenatable<TextProps>;
|
|
159
|
+
/**
|
|
160
|
+
* Create italic text
|
|
161
|
+
*/
|
|
162
|
+
italic(content: string | (() => string) | Signal<string>, additionalProps?: Partial<TextProps>): ModifiableComponent<TextProps> & {
|
|
163
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
164
|
+
} & Concatenatable<TextProps>;
|
|
165
|
+
/**
|
|
166
|
+
* Create underlined text
|
|
167
|
+
*/
|
|
168
|
+
underline(content: string | (() => string) | Signal<string>, additionalProps?: Partial<TextProps>): ModifiableComponent<TextProps> & {
|
|
169
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
170
|
+
} & Concatenatable<TextProps>;
|
|
171
|
+
/**
|
|
172
|
+
* Create monospace text
|
|
173
|
+
*/
|
|
174
|
+
monospace(content: string | (() => string) | Signal<string>, additionalProps?: Partial<TextProps>): ModifiableComponent<TextProps> & {
|
|
175
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
176
|
+
} & Concatenatable<TextProps>;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Text styling utilities
|
|
180
|
+
*/
|
|
181
|
+
export declare const TextStyles: {
|
|
182
|
+
heading: (level?: 1 | 2 | 3 | 4 | 5 | 6) => {
|
|
183
|
+
font: {
|
|
184
|
+
size: number;
|
|
185
|
+
weight: "400";
|
|
186
|
+
lineHeight: number;
|
|
187
|
+
} | {
|
|
188
|
+
size: number;
|
|
189
|
+
weight: "400";
|
|
190
|
+
lineHeight: number;
|
|
191
|
+
} | {
|
|
192
|
+
size: number;
|
|
193
|
+
weight: "400";
|
|
194
|
+
lineHeight: number;
|
|
195
|
+
} | {
|
|
196
|
+
size: number;
|
|
197
|
+
weight: "400";
|
|
198
|
+
lineHeight: number;
|
|
199
|
+
} | {
|
|
200
|
+
size: number;
|
|
201
|
+
weight: "600";
|
|
202
|
+
lineHeight: number;
|
|
203
|
+
} | {
|
|
204
|
+
size: number;
|
|
205
|
+
weight: "400";
|
|
206
|
+
lineHeight: number;
|
|
207
|
+
};
|
|
208
|
+
accessibilityRole: "heading";
|
|
209
|
+
accessibilityLevel: 2 | 1 | 3 | 4 | 5 | 6;
|
|
210
|
+
};
|
|
211
|
+
body: () => {
|
|
212
|
+
font: {
|
|
213
|
+
size: number;
|
|
214
|
+
weight: "400";
|
|
215
|
+
lineHeight: number;
|
|
216
|
+
};
|
|
217
|
+
accessibilityRole: "text";
|
|
218
|
+
};
|
|
219
|
+
caption: () => {
|
|
220
|
+
font: {
|
|
221
|
+
size: number;
|
|
222
|
+
weight: "400";
|
|
223
|
+
lineHeight: number;
|
|
224
|
+
};
|
|
225
|
+
color: string;
|
|
226
|
+
};
|
|
227
|
+
footnote: () => {
|
|
228
|
+
font: {
|
|
229
|
+
size: number;
|
|
230
|
+
weight: "400";
|
|
231
|
+
lineHeight: number;
|
|
232
|
+
};
|
|
233
|
+
color: string;
|
|
234
|
+
};
|
|
235
|
+
LargeTitle: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
236
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
237
|
+
} & Concatenatable<TextProps>;
|
|
238
|
+
Title: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
239
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
240
|
+
} & Concatenatable<TextProps>;
|
|
241
|
+
Title2: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
242
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
243
|
+
} & Concatenatable<TextProps>;
|
|
244
|
+
Title3: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
245
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
246
|
+
} & Concatenatable<TextProps>;
|
|
247
|
+
Headline: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
248
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
249
|
+
} & Concatenatable<TextProps>;
|
|
250
|
+
Body: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
251
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
252
|
+
} & Concatenatable<TextProps>;
|
|
253
|
+
Callout: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
254
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
255
|
+
} & Concatenatable<TextProps>;
|
|
256
|
+
Subheadline: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
257
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
258
|
+
} & Concatenatable<TextProps>;
|
|
259
|
+
Footnote: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
260
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
261
|
+
} & Concatenatable<TextProps>;
|
|
262
|
+
Caption: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
263
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
264
|
+
} & Concatenatable<TextProps>;
|
|
265
|
+
Caption2: (content: string, additionalProps?: Partial<TextProps>) => ModifiableComponent<TextProps> & {
|
|
266
|
+
modifier: ModifierBuilder<ModifiableComponent<TextProps>>;
|
|
267
|
+
} & Concatenatable<TextProps>;
|
|
268
|
+
};
|
|
269
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/display/Text.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAChF,OAAO,EAAE,uBAAuB,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAE5E;;GAEG;AACH,MAAM,WAAW,SACf,SAAQ,cAAc,EACpB,oBAAoB,EACpB,eAAe;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;IAGlD,IAAI,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;QACtB,MAAM,CAAC,EACH,QAAQ,GACR,MAAM,GACN,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK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KrC,MAAM,oBAAoB,OAAO,CAAC,SAAS,CAAC;kBA7KtD,eAAe,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;;CA+K1D,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display Components
|
|
3
|
+
*/
|
|
4
|
+
export { Text, EnhancedText, TextFormat, TextStyles, Typography, type TextProps, type TextFormatting, } from './Text';
|
|
5
|
+
export { Image, EnhancedImage, ImageStates, ImageContentModes, ImageUtils, type ImageProps, type ImageLoadingState, type ImageContentMode, type ImageResizeMode, type ImageLoadingStrategy, } from './Image';
|
|
6
|
+
export { HTML, H1, H2, H3, H4, H5, H6 } from './HTML';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAAK,SAAS,EACd,KAAK,cAAc,GACpB,MAAM,QAAQ,CAAA;AAEf,OAAO,EACL,KAAK,EACL,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,GAC1B,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { E as e, T as t, a as m, b as o, c as H } from "../Text-DYyFBJ6i.js";
|
|
2
|
+
import { E as T, d as n, e as r, f as x, g as I, h as c, i as d, H as h, I as p, b as E, a as f, c as y } from "../HTML-aWcvQ0VC.js";
|
|
3
|
+
export {
|
|
4
|
+
T as EnhancedImage,
|
|
5
|
+
e as EnhancedText,
|
|
6
|
+
n as H1,
|
|
7
|
+
r as H2,
|
|
8
|
+
x as H3,
|
|
9
|
+
I as H4,
|
|
10
|
+
c as H5,
|
|
11
|
+
d as H6,
|
|
12
|
+
h as HTML,
|
|
13
|
+
p as Image,
|
|
14
|
+
E as ImageContentModes,
|
|
15
|
+
f as ImageStates,
|
|
16
|
+
y as ImageUtils,
|
|
17
|
+
t as Text,
|
|
18
|
+
m as TextFormat,
|
|
19
|
+
o as TextStyles,
|
|
20
|
+
H as Typography
|
|
21
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BasicForm Component (Phase 6.4.1)
|
|
3
|
+
*
|
|
4
|
+
* Lightweight SwiftUI-inspired Form component for Core-only applications.
|
|
5
|
+
* Provides essential form functionality with automatic styling and basic validation
|
|
6
|
+
* without the complexity of the full Forms plugin. Perfect for simple forms,
|
|
7
|
+
* contact forms, and login pages where minimal bundle size is important.
|
|
8
|
+
*
|
|
9
|
+
* For advanced form features (comprehensive validation, state management,
|
|
10
|
+
* multi-step forms), use the Form component from @tachui/forms.
|
|
11
|
+
*/
|
|
12
|
+
import type { ModifiableComponent, ModifierBuilder } from '@tachui/core';
|
|
13
|
+
import type { ComponentInstance, ComponentProps } from '@tachui/core';
|
|
14
|
+
/**
|
|
15
|
+
* BasicForm component properties
|
|
16
|
+
*/
|
|
17
|
+
export interface BasicFormProps extends ComponentProps {
|
|
18
|
+
children?: ComponentInstance[];
|
|
19
|
+
onSubmit?: (data: FormData) => void | Promise<void>;
|
|
20
|
+
onValidationChange?: (isValid: boolean, errors: ValidationError[]) => void;
|
|
21
|
+
validateOnChange?: boolean;
|
|
22
|
+
validateOnSubmit?: boolean;
|
|
23
|
+
showValidationSummary?: boolean;
|
|
24
|
+
style?: 'automatic' | 'grouped' | 'inset' | 'plain';
|
|
25
|
+
spacing?: number;
|
|
26
|
+
accessibilityLabel?: string;
|
|
27
|
+
accessibilityRole?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Validation error structure
|
|
31
|
+
*/
|
|
32
|
+
export interface ValidationError {
|
|
33
|
+
field: string;
|
|
34
|
+
message: string;
|
|
35
|
+
code?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Form data structure
|
|
39
|
+
*/
|
|
40
|
+
export interface FormData {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* BasicForm component class
|
|
45
|
+
*/
|
|
46
|
+
export declare class BasicFormImplementation implements ComponentInstance<BasicFormProps> {
|
|
47
|
+
props: BasicFormProps;
|
|
48
|
+
readonly type: "component";
|
|
49
|
+
readonly id: string;
|
|
50
|
+
mounted: boolean;
|
|
51
|
+
cleanup: (() => void)[];
|
|
52
|
+
private formElement;
|
|
53
|
+
private validationErrors;
|
|
54
|
+
private setValidationErrors;
|
|
55
|
+
private setIsValid;
|
|
56
|
+
constructor(props: BasicFormProps);
|
|
57
|
+
/**
|
|
58
|
+
* Extract form data from form elements
|
|
59
|
+
*/
|
|
60
|
+
private extractFormData;
|
|
61
|
+
/**
|
|
62
|
+
* Validate all form fields
|
|
63
|
+
*/
|
|
64
|
+
private validateForm;
|
|
65
|
+
/**
|
|
66
|
+
* Handle form submission
|
|
67
|
+
*/
|
|
68
|
+
private handleSubmit;
|
|
69
|
+
/**
|
|
70
|
+
* Handle form input changes
|
|
71
|
+
*/
|
|
72
|
+
private handleChange;
|
|
73
|
+
/**
|
|
74
|
+
* Get form styling based on style prop
|
|
75
|
+
*/
|
|
76
|
+
private getFormStyles;
|
|
77
|
+
/**
|
|
78
|
+
* Render validation summary
|
|
79
|
+
*/
|
|
80
|
+
private renderValidationSummary;
|
|
81
|
+
render(): import("@tachui/core").DOMNode[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* BasicForm component function
|
|
85
|
+
*/
|
|
86
|
+
export declare function BasicForm(children: ComponentInstance[], props?: Omit<BasicFormProps, 'children'>): ModifiableComponent<BasicFormProps> & {
|
|
87
|
+
modifier: ModifierBuilder<ModifiableComponent<BasicFormProps>>;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* BasicForm style variants
|
|
91
|
+
*/
|
|
92
|
+
export declare const BasicFormStyles: {
|
|
93
|
+
/**
|
|
94
|
+
* Automatic form styling (default)
|
|
95
|
+
*/
|
|
96
|
+
Automatic(children: ComponentInstance[], props?: Omit<BasicFormProps, "children" | "style">): ModifiableComponent<BasicFormProps> & {
|
|
97
|
+
modifier: ModifierBuilder<ModifiableComponent<BasicFormProps>>;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Grouped form with container styling
|
|
101
|
+
*/
|
|
102
|
+
Grouped(children: ComponentInstance[], props?: Omit<BasicFormProps, "children" | "style">): ModifiableComponent<BasicFormProps> & {
|
|
103
|
+
modifier: ModifierBuilder<ModifiableComponent<BasicFormProps>>;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Inset form styling
|
|
107
|
+
*/
|
|
108
|
+
Inset(children: ComponentInstance[], props?: Omit<BasicFormProps, "children" | "style">): ModifiableComponent<BasicFormProps> & {
|
|
109
|
+
modifier: ModifierBuilder<ModifiableComponent<BasicFormProps>>;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Plain form without styling
|
|
113
|
+
*/
|
|
114
|
+
Plain(children: ComponentInstance[], props?: Omit<BasicFormProps, "children" | "style">): ModifiableComponent<BasicFormProps> & {
|
|
115
|
+
modifier: ModifierBuilder<ModifiableComponent<BasicFormProps>>;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* BasicForm validation utilities
|
|
120
|
+
*/
|
|
121
|
+
export declare const BasicFormValidation: {
|
|
122
|
+
/**
|
|
123
|
+
* Common validation rules
|
|
124
|
+
*/
|
|
125
|
+
rules: {
|
|
126
|
+
required: (value: any) => boolean;
|
|
127
|
+
email: (value: string) => boolean;
|
|
128
|
+
minLength: (min: number) => (value: string) => boolean;
|
|
129
|
+
maxLength: (max: number) => (value: string) => boolean;
|
|
130
|
+
pattern: (regex: RegExp) => (value: string) => boolean;
|
|
131
|
+
number: (value: string) => boolean;
|
|
132
|
+
integer: (value: string) => boolean;
|
|
133
|
+
min: (min: number) => (value: string) => boolean;
|
|
134
|
+
max: (max: number) => (value: string) => boolean;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Validate a single field
|
|
138
|
+
*/
|
|
139
|
+
validateField(value: any, rules: Array<(value: any) => boolean | string>): ValidationError | null;
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=BasicForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasicForm.d.ts","sourceRoot":"","sources":["../../src/forms/BasicForm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAIxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAGrE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAG9B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnD,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,IAAI,CAAA;IAG1E,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAG/B,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;IACnD,OAAO,CAAC,EAAE,MAAM,C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ACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;wBAES,iBAAiB,EAAE,UACtB,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC;kBAhBzC,eAAe,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;;IAqB9D;;OAEG;sBAES,iBAAiB,EAAE,UACtB,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC;kBA1BzC,eAAe,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;;IA+B9D;;OAEG;oBAES,iBAAiB,EAAE,UACtB,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC;kBApCzC,eAAe,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;;IAyC9D;;OAEG;oBAES,iBAAiB,EAAE,UACtB,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC;kBA9CzC,eAAe,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;;CAkD/D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;IAC9B;;OAEG;;0BAGiB,GAAG;uBACN,MAAM;yBACJ,MAAM,MAAM,OAAO,MAAM;yBACzB,MAAM,MAAM,OAAO,MAAM;yBACzB,MAAM,MAAM,OAAO,MAAM;wBAC1B,MAAM;yBACL,MAAM;mBACZ,MAAM,MAAM,OAAO,MAAM;mBACzB,MAAM,MAAM,OAAO,MAAM;;IAGtC;;OAEG;yBAGM,GAAG,SAEH,KAAK,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,GAAG,MAAM,CAAC,GAC7C,eAAe,GAAG,IAAI;CAa1B,CAAA"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BasicInput Component (Phase 1)
|
|
3
|
+
*
|
|
4
|
+
* Lightweight text input component for Core-only applications.
|
|
5
|
+
* Provides SwiftUI-style reactive binding without the complexity
|
|
6
|
+
* of the Forms plugin validation and formatting system.
|
|
7
|
+
*/
|
|
8
|
+
import type { ModifiableComponent, ModifierBuilder } from '@tachui/core';
|
|
9
|
+
import type { Signal } from '@tachui/core';
|
|
10
|
+
import type { ComponentInstance, ComponentProps, DOMNode } from '@tachui/core';
|
|
11
|
+
import { ComponentWithCSSClasses, type CSSClassesProps } from '@tachui/core';
|
|
12
|
+
/**
|
|
13
|
+
* BasicInput supported input types
|
|
14
|
+
*/
|
|
15
|
+
export type BasicInputType = 'text' | 'email' | 'password' | 'search' | 'tel' | 'url';
|
|
16
|
+
/**
|
|
17
|
+
* BasicInput component properties with CSS classes support
|
|
18
|
+
*/
|
|
19
|
+
export interface BasicInputProps extends ComponentProps, CSSClassesProps {
|
|
20
|
+
text: Signal<string>;
|
|
21
|
+
setText?: (value: string) => void;
|
|
22
|
+
placeholder?: string | Signal<string>;
|
|
23
|
+
inputType?: BasicInputType | Signal<BasicInputType>;
|
|
24
|
+
disabled?: boolean | Signal<boolean>;
|
|
25
|
+
readonly?: boolean | Signal<boolean>;
|
|
26
|
+
onChange?: (text: string) => void;
|
|
27
|
+
onSubmit?: (text: string) => void;
|
|
28
|
+
onFocus?: () => void;
|
|
29
|
+
onBlur?: () => void;
|
|
30
|
+
accessibilityLabel?: string;
|
|
31
|
+
accessibilityHint?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* BasicInput theme configuration
|
|
35
|
+
*/
|
|
36
|
+
export interface BasicInputTheme {
|
|
37
|
+
colors: {
|
|
38
|
+
background: string;
|
|
39
|
+
border: string;
|
|
40
|
+
text: string;
|
|
41
|
+
placeholder: string;
|
|
42
|
+
focusBorder: string;
|
|
43
|
+
disabledBackground: string;
|
|
44
|
+
disabledText: string;
|
|
45
|
+
};
|
|
46
|
+
spacing: {
|
|
47
|
+
padding: number;
|
|
48
|
+
borderWidth: number;
|
|
49
|
+
};
|
|
50
|
+
borderRadius: number;
|
|
51
|
+
fontSize: number;
|
|
52
|
+
fontFamily: string;
|
|
53
|
+
transition: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* BasicInput component implementation with CSS classes support
|
|
57
|
+
*/
|
|
58
|
+
export declare class BasicInputComponent extends ComponentWithCSSClasses implements ComponentInstance<BasicInputProps> {
|
|
59
|
+
readonly type: "component";
|
|
60
|
+
readonly id: string;
|
|
61
|
+
readonly props: BasicInputProps;
|
|
62
|
+
private theme;
|
|
63
|
+
private inputElement;
|
|
64
|
+
constructor(props: BasicInputProps);
|
|
65
|
+
private resolveValue;
|
|
66
|
+
private getText;
|
|
67
|
+
private setText;
|
|
68
|
+
private getPlaceholder;
|
|
69
|
+
private getInputType;
|
|
70
|
+
private isDisabled;
|
|
71
|
+
private isReadonly;
|
|
72
|
+
private handleInput;
|
|
73
|
+
private handleKeyDown;
|
|
74
|
+
private handleFocus;
|
|
75
|
+
private handleBlur;
|
|
76
|
+
private getInputStyles;
|
|
77
|
+
render(): DOMNode[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Create a BasicInput component
|
|
81
|
+
*/
|
|
82
|
+
export declare function BasicInput(props: BasicInputProps): ModifiableComponent<BasicInputProps> & {
|
|
83
|
+
modifier: ModifierBuilder<ModifiableComponent<BasicInputProps>>;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* BasicInput utility functions and presets
|
|
87
|
+
*/
|
|
88
|
+
export declare const BasicInputUtils: {
|
|
89
|
+
/**
|
|
90
|
+
* Create a search input
|
|
91
|
+
*/
|
|
92
|
+
search(text: Signal<string>, setText: (value: string) => void, onSearch?: (query: string) => void): BasicInputProps;
|
|
93
|
+
/**
|
|
94
|
+
* Create an email input
|
|
95
|
+
*/
|
|
96
|
+
email(text: Signal<string>, setText: (value: string) => void): BasicInputProps;
|
|
97
|
+
/**
|
|
98
|
+
* Create a password input
|
|
99
|
+
*/
|
|
100
|
+
password(text: Signal<string>, setText: (value: string) => void): BasicInputProps;
|
|
101
|
+
/**
|
|
102
|
+
* Create a phone number input
|
|
103
|
+
*/
|
|
104
|
+
phone(text: Signal<string>, setText: (value: string) => void): BasicInputProps;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* BasicInput styles and theming
|
|
108
|
+
*/
|
|
109
|
+
export declare const BasicInputStyles: {
|
|
110
|
+
theme: BasicInputTheme;
|
|
111
|
+
/**
|
|
112
|
+
* Create a custom theme
|
|
113
|
+
*/
|
|
114
|
+
createTheme(overrides: Partial<BasicInputTheme>): BasicInputTheme;
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=BasicInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasicInput.d.ts","sourceRoot":"","sources":["../../src/forms/BasicInput.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAExE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE9E,OAAO,EAAE,uBAAuB,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAE5E;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,KAAK,GACL,KAAK,CAAA;AAET;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,cAAc,EAAE,eAAe;IAEtE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAGjC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;IACrC,SAAS,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;IACnD,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IACpC,QAAQ,CAA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B,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,WAAW,CAWlB;IAED,OAAO,CAAC,aAAa,CAKpB;IAED,OAAO,CAAC,WAAW,CASlB;IAED,OAAO,CAAC,UAAU,CASjB;IAED,OAAO,CAAC,cAAc;IAoBtB,MAAM,IAAI,OAAO,EAAE;CAqEpB;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,eAAe,GACrB,mBAAmB,CAAC,eAAe,CAAC,GAAG;IACxC,QAAQ,EAAE,eAAe,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAA;CAChE,CAEA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;iBAEK,MAAM,CAAC,MAAM,CAAC,WACX,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,aACrB,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GACjC,eAAe;IAUlB;;OAEG;gBAEK,MAAM,CAAC,MAAM,CAAC,WACX,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAC/B,eAAe;IASlB;;OAEG;mBAEK,MAAM,CAAC,MAAM,CAAC,WACX,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAC/B,eAAe;IASlB;;OAEG;gBAEK,MAAM,CAAC,MAAM,CAAC,WACX,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAC/B,eAAe;CAQnB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;;IAG3B;;OAEG;2BACoB,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe;CAGlE,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basic Form Components
|
|
3
|
+
*/
|
|
4
|
+
export { BasicForm, BasicFormImplementation, BasicFormStyles, BasicFormValidation, type BasicFormProps, type FormData, type ValidationError, } from './BasicForm';
|
|
5
|
+
export { BasicInput, BasicInputStyles, BasicInputUtils, type BasicInputProps, type BasicInputTheme, type BasicInputType, } from './BasicInput';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { B as i, a as t, b as c, c as o, d as B, e as m, f as e } from "../BasicInput-CWFHw9rL.js";
|
|
2
|
+
export {
|
|
3
|
+
i as BasicForm,
|
|
4
|
+
t as BasicFormImplementation,
|
|
5
|
+
c as BasicFormStyles,
|
|
6
|
+
o as BasicFormValidation,
|
|
7
|
+
B as BasicInput,
|
|
8
|
+
m as BasicInputStyles,
|
|
9
|
+
e as BasicInputUtils
|
|
10
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TachUI Primitives - Basic UI Components
|
|
3
|
+
*
|
|
4
|
+
* Foundation UI components for tachUI applications
|
|
5
|
+
*/
|
|
6
|
+
export * from './layout';
|
|
7
|
+
export * from './display';
|
|
8
|
+
export * from './controls';
|
|
9
|
+
export * from './forms';
|
|
10
|
+
export * from './validation';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,UAAU,CAAA;AAGxB,cAAc,WAAW,CAAA;AAGzB,cAAc,YAAY,CAAA;AAG1B,cAAc,SAAS,CAAA;AAGvB,cAAc,cAAc,CAAA"}
|