@akin2unde/flowui-core 0.1.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/README.md +11 -0
- package/dist/index.cjs +505 -0
- package/dist/index.d.cts +308 -0
- package/dist/index.d.ts +308 -0
- package/dist/index.js +473 -0
- package/package.json +50 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import * as CSS from 'csstype';
|
|
2
|
+
|
|
3
|
+
type CSSLength = number | `${number}px` | `${number}rem` | `${number}em` | `${number}%` | `${number}vh` | `${number}vw` | `calc(${string})` | `var(--${string})`;
|
|
4
|
+
type BreakpointName = "sm" | "md" | "lg" | "xl" | "xxl";
|
|
5
|
+
interface ResponsiveObject<T> {
|
|
6
|
+
default?: T;
|
|
7
|
+
sm?: T;
|
|
8
|
+
md?: T;
|
|
9
|
+
lg?: T;
|
|
10
|
+
xl?: T;
|
|
11
|
+
xxl?: T;
|
|
12
|
+
}
|
|
13
|
+
type ResponsiveValue<T> = T | ResponsiveObject<T>;
|
|
14
|
+
type SpacingToken = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
15
|
+
type SpacingValue = SpacingToken | CSSLength;
|
|
16
|
+
type RadiusToken = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
17
|
+
type RadiusValue = RadiusToken | CSSLength;
|
|
18
|
+
type PaletteColor = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "neutral";
|
|
19
|
+
type ColorShade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950;
|
|
20
|
+
type SchemeColor = "canvas" | "surface" | "surfaceRaised" | "surfaceSunken" | "text" | "textMuted" | "textDisabled" | "textInverse" | "border" | "borderStrong" | "focus" | "overlay";
|
|
21
|
+
type ColorValue = PaletteColor | `${PaletteColor}.${ColorShade}` | SchemeColor | "transparent" | "currentColor" | "inherit" | `#${string}` | `rgb(${string})` | `rgba(${string})` | `hsl(${string})` | `hsla(${string})` | `var(--${string})`;
|
|
22
|
+
type ComponentSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
23
|
+
type ComponentVariant = "solid" | "outline" | "soft" | "ghost" | "link";
|
|
24
|
+
type Orientation = "horizontal" | "vertical";
|
|
25
|
+
type FlexDirection = "row" | "row-reverse" | "column" | "column-reverse";
|
|
26
|
+
type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
27
|
+
type JustifyValue = "start" | "end" | "center" | "between" | "around" | "evenly";
|
|
28
|
+
type AlignValue = "start" | "end" | "center" | "stretch" | "baseline";
|
|
29
|
+
type PositionValue = "static" | "relative" | "absolute" | "fixed" | "sticky";
|
|
30
|
+
type DimensionValue = CSSLength | "auto" | "full" | "fit" | "min" | "max";
|
|
31
|
+
type ThemeMode = "light" | "dark" | "system";
|
|
32
|
+
type FlowUIStyle = CSS.Properties<string | number>;
|
|
33
|
+
type CSSVariableStyle = Partial<Record<`--fui-${string}`, string | number>>;
|
|
34
|
+
type ResolvedStyle = FlowUIStyle & CSSVariableStyle;
|
|
35
|
+
type DeepPartial<T> = {
|
|
36
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
37
|
+
};
|
|
38
|
+
interface SpacingProps {
|
|
39
|
+
margin?: ResponsiveValue<SpacingValue | "auto">;
|
|
40
|
+
marginX?: ResponsiveValue<SpacingValue | "auto">;
|
|
41
|
+
marginY?: ResponsiveValue<SpacingValue | "auto">;
|
|
42
|
+
marginTop?: ResponsiveValue<SpacingValue | "auto">;
|
|
43
|
+
marginRight?: ResponsiveValue<SpacingValue | "auto">;
|
|
44
|
+
marginBottom?: ResponsiveValue<SpacingValue | "auto">;
|
|
45
|
+
marginLeft?: ResponsiveValue<SpacingValue | "auto">;
|
|
46
|
+
padding?: ResponsiveValue<SpacingValue>;
|
|
47
|
+
paddingX?: ResponsiveValue<SpacingValue>;
|
|
48
|
+
paddingY?: ResponsiveValue<SpacingValue>;
|
|
49
|
+
paddingTop?: ResponsiveValue<SpacingValue>;
|
|
50
|
+
paddingRight?: ResponsiveValue<SpacingValue>;
|
|
51
|
+
paddingBottom?: ResponsiveValue<SpacingValue>;
|
|
52
|
+
paddingLeft?: ResponsiveValue<SpacingValue>;
|
|
53
|
+
}
|
|
54
|
+
interface LayoutProps {
|
|
55
|
+
display?: ResponsiveValue<"none" | "block" | "inline" | "inline-block" | "flex" | "inline-flex" | "grid">;
|
|
56
|
+
width?: ResponsiveValue<DimensionValue>;
|
|
57
|
+
minWidth?: ResponsiveValue<DimensionValue>;
|
|
58
|
+
maxWidth?: ResponsiveValue<DimensionValue | "none">;
|
|
59
|
+
height?: ResponsiveValue<DimensionValue>;
|
|
60
|
+
minHeight?: ResponsiveValue<DimensionValue>;
|
|
61
|
+
maxHeight?: ResponsiveValue<DimensionValue | "none">;
|
|
62
|
+
overflow?: ResponsiveValue<"visible" | "hidden" | "clip" | "scroll" | "auto">;
|
|
63
|
+
overflowX?: ResponsiveValue<"visible" | "hidden" | "clip" | "scroll" | "auto">;
|
|
64
|
+
overflowY?: ResponsiveValue<"visible" | "hidden" | "clip" | "scroll" | "auto">;
|
|
65
|
+
}
|
|
66
|
+
interface PositionProps {
|
|
67
|
+
positionType?: ResponsiveValue<PositionValue>;
|
|
68
|
+
absolute?: ResponsiveValue<boolean>;
|
|
69
|
+
top?: ResponsiveValue<CSSLength | "auto">;
|
|
70
|
+
right?: ResponsiveValue<CSSLength | "auto">;
|
|
71
|
+
bottom?: ResponsiveValue<CSSLength | "auto">;
|
|
72
|
+
left?: ResponsiveValue<CSSLength | "auto">;
|
|
73
|
+
zIndex?: ResponsiveValue<number | "auto">;
|
|
74
|
+
}
|
|
75
|
+
interface FlexContainerProps {
|
|
76
|
+
direction?: ResponsiveValue<FlexDirection>;
|
|
77
|
+
wrap?: ResponsiveValue<FlexWrap>;
|
|
78
|
+
justify?: ResponsiveValue<JustifyValue>;
|
|
79
|
+
align?: ResponsiveValue<AlignValue>;
|
|
80
|
+
gap?: ResponsiveValue<SpacingValue>;
|
|
81
|
+
rowGap?: ResponsiveValue<SpacingValue>;
|
|
82
|
+
columnGap?: ResponsiveValue<SpacingValue>;
|
|
83
|
+
}
|
|
84
|
+
interface FlexItemProps {
|
|
85
|
+
flex?: ResponsiveValue<number | string>;
|
|
86
|
+
flexGrow?: ResponsiveValue<number>;
|
|
87
|
+
flexShrink?: ResponsiveValue<number>;
|
|
88
|
+
flexBasis?: ResponsiveValue<DimensionValue>;
|
|
89
|
+
selfAlign?: ResponsiveValue<AlignValue>;
|
|
90
|
+
order?: ResponsiveValue<number>;
|
|
91
|
+
}
|
|
92
|
+
interface BorderProps {
|
|
93
|
+
borderWidth?: ResponsiveValue<CSSLength>;
|
|
94
|
+
borderStyle?: ResponsiveValue<"none" | "solid" | "dashed" | "dotted" | "double">;
|
|
95
|
+
borderColor?: ResponsiveValue<ColorValue>;
|
|
96
|
+
cornerRadius?: ResponsiveValue<RadiusValue>;
|
|
97
|
+
}
|
|
98
|
+
interface VisualProps {
|
|
99
|
+
backgroundColor?: ResponsiveValue<ColorValue>;
|
|
100
|
+
opacity?: ResponsiveValue<number>;
|
|
101
|
+
shadow?: ResponsiveValue<"none" | "xs" | "sm" | "md" | "lg" | "xl">;
|
|
102
|
+
}
|
|
103
|
+
interface TypographyProps {
|
|
104
|
+
textColor?: ResponsiveValue<ColorValue>;
|
|
105
|
+
fontFamily?: ResponsiveValue<string>;
|
|
106
|
+
fontSize?: ResponsiveValue<ComponentSize | "2xl" | "3xl" | CSSLength>;
|
|
107
|
+
fontWeight?: ResponsiveValue<"thin" | "extraLight" | "light" | "normal" | "medium" | "semiBold" | "bold" | "extraBold" | "black" | number>;
|
|
108
|
+
textAlign?: ResponsiveValue<"left" | "center" | "right" | "justify" | "start" | "end">;
|
|
109
|
+
textTransform?: ResponsiveValue<"none" | "uppercase" | "lowercase" | "capitalize">;
|
|
110
|
+
lines?: ResponsiveValue<number>;
|
|
111
|
+
}
|
|
112
|
+
interface BaseUIProps extends SpacingProps, LayoutProps, PositionProps, FlexItemProps, BorderProps, VisualProps {
|
|
113
|
+
id?: string;
|
|
114
|
+
hidden?: boolean;
|
|
115
|
+
testId?: string;
|
|
116
|
+
className?: string;
|
|
117
|
+
style?: Readonly<FlowUIStyle>;
|
|
118
|
+
}
|
|
119
|
+
interface DisableableProps {
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
}
|
|
122
|
+
interface ReadOnlyProps {
|
|
123
|
+
readOnly?: boolean;
|
|
124
|
+
}
|
|
125
|
+
interface RequiredProps {
|
|
126
|
+
required?: boolean;
|
|
127
|
+
}
|
|
128
|
+
interface LoadingProps {
|
|
129
|
+
loading?: boolean;
|
|
130
|
+
loadingText?: string;
|
|
131
|
+
}
|
|
132
|
+
interface FocusableProps {
|
|
133
|
+
autoFocus?: boolean;
|
|
134
|
+
tabIndex?: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
type ColorScale = Record<ColorShade, string>;
|
|
138
|
+
type ColorPalette = Record<PaletteColor, ColorScale>;
|
|
139
|
+
interface ThemeColorScheme {
|
|
140
|
+
canvas: string;
|
|
141
|
+
surface: string;
|
|
142
|
+
surfaceRaised: string;
|
|
143
|
+
surfaceSunken: string;
|
|
144
|
+
text: string;
|
|
145
|
+
textMuted: string;
|
|
146
|
+
textDisabled: string;
|
|
147
|
+
textInverse: string;
|
|
148
|
+
border: string;
|
|
149
|
+
borderStrong: string;
|
|
150
|
+
focus: string;
|
|
151
|
+
overlay: string;
|
|
152
|
+
}
|
|
153
|
+
interface FlowUITheme {
|
|
154
|
+
palette: ColorPalette;
|
|
155
|
+
schemes: {
|
|
156
|
+
light: ThemeColorScheme;
|
|
157
|
+
dark: ThemeColorScheme;
|
|
158
|
+
};
|
|
159
|
+
spacing: Record<"none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl", string | number>;
|
|
160
|
+
radius: Record<"none" | "xs" | "sm" | "md" | "lg" | "xl" | "full", string | number>;
|
|
161
|
+
fontSize: Record<"xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl", string>;
|
|
162
|
+
fontWeight: Record<"thin" | "extraLight" | "light" | "normal" | "medium" | "semiBold" | "bold" | "extraBold" | "black", number>;
|
|
163
|
+
shadows: Record<"none" | "xs" | "sm" | "md" | "lg" | "xl", string>;
|
|
164
|
+
breakpoints: Record<"sm" | "md" | "lg" | "xl" | "xxl", string>;
|
|
165
|
+
zIndex: Record<"base" | "sticky" | "dropdown" | "overlay" | "dialog" | "popover" | "tooltip" | "notification", number>;
|
|
166
|
+
}
|
|
167
|
+
declare const defaultTheme: FlowUITheme;
|
|
168
|
+
declare const createTheme: (override?: DeepPartial<FlowUITheme>) => FlowUITheme;
|
|
169
|
+
declare function themeToCSS(theme: FlowUITheme, mode?: ThemeMode): string;
|
|
170
|
+
declare function responsiveCSS(theme: FlowUITheme): string;
|
|
171
|
+
|
|
172
|
+
interface StyleResolution {
|
|
173
|
+
classNames: string[];
|
|
174
|
+
style: ResolvedStyle;
|
|
175
|
+
}
|
|
176
|
+
declare function resolveFlowStyle(props: Record<string, unknown>, theme: FlowUITheme): StyleResolution;
|
|
177
|
+
declare function flowClass(base: string, props: Pick<BaseUIProps, "className">, resolution: StyleResolution, ...extra: Array<string | false | undefined>): string;
|
|
178
|
+
|
|
179
|
+
interface StackProps extends BaseUIProps, FlexContainerProps {
|
|
180
|
+
as?: "div" | "section" | "article" | "nav" | "header" | "footer" | "main" | "aside" | "form";
|
|
181
|
+
inline?: boolean;
|
|
182
|
+
}
|
|
183
|
+
interface HStackProps extends StackProps {
|
|
184
|
+
}
|
|
185
|
+
interface VStackProps extends StackProps {
|
|
186
|
+
}
|
|
187
|
+
interface IconProps extends BaseUIProps, TypographyProps {
|
|
188
|
+
icon: string;
|
|
189
|
+
label?: string;
|
|
190
|
+
spin?: boolean;
|
|
191
|
+
}
|
|
192
|
+
interface LabelProps extends BaseUIProps, TypographyProps {
|
|
193
|
+
htmlFor?: string;
|
|
194
|
+
required?: boolean;
|
|
195
|
+
}
|
|
196
|
+
interface BadgeProps extends BaseUIProps, TypographyProps {
|
|
197
|
+
color?: PaletteColor;
|
|
198
|
+
variant?: Exclude<ComponentVariant, "link">;
|
|
199
|
+
size?: ComponentSize;
|
|
200
|
+
icon?: string;
|
|
201
|
+
iconPosition?: "left" | "right";
|
|
202
|
+
}
|
|
203
|
+
interface ButtonProps extends BaseUIProps, TypographyProps, DisableableProps, LoadingProps, FocusableProps {
|
|
204
|
+
type?: "button" | "submit" | "reset";
|
|
205
|
+
variant?: ComponentVariant;
|
|
206
|
+
color?: PaletteColor;
|
|
207
|
+
size?: ComponentSize;
|
|
208
|
+
icon?: string;
|
|
209
|
+
iconPosition?: "left" | "right" | "center";
|
|
210
|
+
badge?: string | number;
|
|
211
|
+
ariaLabel?: string;
|
|
212
|
+
}
|
|
213
|
+
interface ButtonGroupProps extends BaseUIProps {
|
|
214
|
+
orientation?: Orientation;
|
|
215
|
+
attached?: boolean;
|
|
216
|
+
align?: AlignValue;
|
|
217
|
+
}
|
|
218
|
+
interface InputProps extends BaseUIProps, TypographyProps, DisableableProps, ReadOnlyProps, RequiredProps, FocusableProps {
|
|
219
|
+
name?: string;
|
|
220
|
+
value?: string | number;
|
|
221
|
+
placeholder?: string;
|
|
222
|
+
type?: "text" | "email" | "password" | "number" | "search" | "tel" | "url" | "date" | "time";
|
|
223
|
+
}
|
|
224
|
+
interface DividerProps extends BaseUIProps {
|
|
225
|
+
orientation?: Orientation;
|
|
226
|
+
label?: string;
|
|
227
|
+
}
|
|
228
|
+
interface ImageProps extends BaseUIProps {
|
|
229
|
+
src: string;
|
|
230
|
+
alt: string;
|
|
231
|
+
fit?: "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
232
|
+
loading?: "eager" | "lazy";
|
|
233
|
+
fallbackSrc?: string;
|
|
234
|
+
}
|
|
235
|
+
interface MenuItem {
|
|
236
|
+
id: string;
|
|
237
|
+
label: string;
|
|
238
|
+
icon?: string;
|
|
239
|
+
badge?: string | number;
|
|
240
|
+
disabled?: boolean;
|
|
241
|
+
separator?: boolean;
|
|
242
|
+
children?: MenuItem[];
|
|
243
|
+
}
|
|
244
|
+
interface SelectOption {
|
|
245
|
+
label: string;
|
|
246
|
+
value: string;
|
|
247
|
+
disabled?: boolean;
|
|
248
|
+
}
|
|
249
|
+
interface DropdownModel {
|
|
250
|
+
display: string | number;
|
|
251
|
+
value: string | number;
|
|
252
|
+
other: any;
|
|
253
|
+
}
|
|
254
|
+
interface TreeModel extends DropdownModel {
|
|
255
|
+
children?: TreeModel[];
|
|
256
|
+
}
|
|
257
|
+
interface TabItem {
|
|
258
|
+
id: string;
|
|
259
|
+
label: string;
|
|
260
|
+
icon?: string;
|
|
261
|
+
disabled?: boolean;
|
|
262
|
+
}
|
|
263
|
+
type SortDirection = "asc" | "desc" | null;
|
|
264
|
+
interface SortState {
|
|
265
|
+
field: string;
|
|
266
|
+
direction: SortDirection;
|
|
267
|
+
}
|
|
268
|
+
interface TableColumn<T> {
|
|
269
|
+
field: keyof T & string;
|
|
270
|
+
header: string;
|
|
271
|
+
sortable?: boolean;
|
|
272
|
+
width?: string | number;
|
|
273
|
+
align?: "left" | "center" | "right";
|
|
274
|
+
format?: (value: unknown, row: T) => string | number;
|
|
275
|
+
}
|
|
276
|
+
type DialogPosition = "center" | "left" | "right" | "top" | "bottom";
|
|
277
|
+
type TooltipLocation = "top" | "right" | "bottom" | "left";
|
|
278
|
+
interface CardProps extends BaseUIProps {
|
|
279
|
+
variant?: "outline" | "elevated" | "filled";
|
|
280
|
+
}
|
|
281
|
+
interface SliderProps extends BaseUIProps, DisableableProps {
|
|
282
|
+
min?: number;
|
|
283
|
+
max?: number;
|
|
284
|
+
step?: number;
|
|
285
|
+
value?: number;
|
|
286
|
+
name?: string;
|
|
287
|
+
}
|
|
288
|
+
interface SwitchProps extends BaseUIProps, DisableableProps {
|
|
289
|
+
checked?: boolean;
|
|
290
|
+
label?: string;
|
|
291
|
+
name?: string;
|
|
292
|
+
}
|
|
293
|
+
interface PasswordInputProps extends Omit<InputProps, "type"> {
|
|
294
|
+
showToggle?: boolean;
|
|
295
|
+
visible?: boolean;
|
|
296
|
+
}
|
|
297
|
+
interface TreeProps extends BaseUIProps {
|
|
298
|
+
nodes: TreeModel[];
|
|
299
|
+
value?: string | number;
|
|
300
|
+
defaultExpanded?: boolean;
|
|
301
|
+
}
|
|
302
|
+
interface TooltipProps extends BaseUIProps {
|
|
303
|
+
text: string;
|
|
304
|
+
location?: TooltipLocation;
|
|
305
|
+
delay?: number;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export { type AlignValue, type BadgeProps, type BaseUIProps, type BorderProps, type BreakpointName, type ButtonGroupProps, type ButtonProps, type CSSLength, type CSSVariableStyle, type CardProps, type ColorPalette, type ColorScale, type ColorShade, type ColorValue, type ComponentSize, type ComponentVariant, type DeepPartial, type DialogPosition, type DimensionValue, type DisableableProps, type DividerProps, type DropdownModel, type FlexContainerProps, type FlexDirection, type FlexItemProps, type FlexWrap, type FlowUIStyle, type FlowUITheme, type FocusableProps, type HStackProps, type IconProps, type ImageProps, type InputProps, type JustifyValue, type LabelProps, type LayoutProps, type LoadingProps, type MenuItem, type Orientation, type PaletteColor, type PasswordInputProps, type PositionProps, type PositionValue, type RadiusToken, type RadiusValue, type ReadOnlyProps, type RequiredProps, type ResolvedStyle, type ResponsiveObject, type ResponsiveValue, type SchemeColor, type SelectOption, type SliderProps, type SortDirection, type SortState, type SpacingProps, type SpacingToken, type SpacingValue, type StackProps, type StyleResolution, type SwitchProps, type TabItem, type TableColumn, type ThemeColorScheme, type ThemeMode, type TooltipLocation, type TooltipProps, type TreeModel, type TreeProps, type TypographyProps, type VStackProps, type VisualProps, createTheme, defaultTheme, flowClass, resolveFlowStyle, responsiveCSS, themeToCSS };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import * as CSS from 'csstype';
|
|
2
|
+
|
|
3
|
+
type CSSLength = number | `${number}px` | `${number}rem` | `${number}em` | `${number}%` | `${number}vh` | `${number}vw` | `calc(${string})` | `var(--${string})`;
|
|
4
|
+
type BreakpointName = "sm" | "md" | "lg" | "xl" | "xxl";
|
|
5
|
+
interface ResponsiveObject<T> {
|
|
6
|
+
default?: T;
|
|
7
|
+
sm?: T;
|
|
8
|
+
md?: T;
|
|
9
|
+
lg?: T;
|
|
10
|
+
xl?: T;
|
|
11
|
+
xxl?: T;
|
|
12
|
+
}
|
|
13
|
+
type ResponsiveValue<T> = T | ResponsiveObject<T>;
|
|
14
|
+
type SpacingToken = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
15
|
+
type SpacingValue = SpacingToken | CSSLength;
|
|
16
|
+
type RadiusToken = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
17
|
+
type RadiusValue = RadiusToken | CSSLength;
|
|
18
|
+
type PaletteColor = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "neutral";
|
|
19
|
+
type ColorShade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950;
|
|
20
|
+
type SchemeColor = "canvas" | "surface" | "surfaceRaised" | "surfaceSunken" | "text" | "textMuted" | "textDisabled" | "textInverse" | "border" | "borderStrong" | "focus" | "overlay";
|
|
21
|
+
type ColorValue = PaletteColor | `${PaletteColor}.${ColorShade}` | SchemeColor | "transparent" | "currentColor" | "inherit" | `#${string}` | `rgb(${string})` | `rgba(${string})` | `hsl(${string})` | `hsla(${string})` | `var(--${string})`;
|
|
22
|
+
type ComponentSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
23
|
+
type ComponentVariant = "solid" | "outline" | "soft" | "ghost" | "link";
|
|
24
|
+
type Orientation = "horizontal" | "vertical";
|
|
25
|
+
type FlexDirection = "row" | "row-reverse" | "column" | "column-reverse";
|
|
26
|
+
type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
27
|
+
type JustifyValue = "start" | "end" | "center" | "between" | "around" | "evenly";
|
|
28
|
+
type AlignValue = "start" | "end" | "center" | "stretch" | "baseline";
|
|
29
|
+
type PositionValue = "static" | "relative" | "absolute" | "fixed" | "sticky";
|
|
30
|
+
type DimensionValue = CSSLength | "auto" | "full" | "fit" | "min" | "max";
|
|
31
|
+
type ThemeMode = "light" | "dark" | "system";
|
|
32
|
+
type FlowUIStyle = CSS.Properties<string | number>;
|
|
33
|
+
type CSSVariableStyle = Partial<Record<`--fui-${string}`, string | number>>;
|
|
34
|
+
type ResolvedStyle = FlowUIStyle & CSSVariableStyle;
|
|
35
|
+
type DeepPartial<T> = {
|
|
36
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
37
|
+
};
|
|
38
|
+
interface SpacingProps {
|
|
39
|
+
margin?: ResponsiveValue<SpacingValue | "auto">;
|
|
40
|
+
marginX?: ResponsiveValue<SpacingValue | "auto">;
|
|
41
|
+
marginY?: ResponsiveValue<SpacingValue | "auto">;
|
|
42
|
+
marginTop?: ResponsiveValue<SpacingValue | "auto">;
|
|
43
|
+
marginRight?: ResponsiveValue<SpacingValue | "auto">;
|
|
44
|
+
marginBottom?: ResponsiveValue<SpacingValue | "auto">;
|
|
45
|
+
marginLeft?: ResponsiveValue<SpacingValue | "auto">;
|
|
46
|
+
padding?: ResponsiveValue<SpacingValue>;
|
|
47
|
+
paddingX?: ResponsiveValue<SpacingValue>;
|
|
48
|
+
paddingY?: ResponsiveValue<SpacingValue>;
|
|
49
|
+
paddingTop?: ResponsiveValue<SpacingValue>;
|
|
50
|
+
paddingRight?: ResponsiveValue<SpacingValue>;
|
|
51
|
+
paddingBottom?: ResponsiveValue<SpacingValue>;
|
|
52
|
+
paddingLeft?: ResponsiveValue<SpacingValue>;
|
|
53
|
+
}
|
|
54
|
+
interface LayoutProps {
|
|
55
|
+
display?: ResponsiveValue<"none" | "block" | "inline" | "inline-block" | "flex" | "inline-flex" | "grid">;
|
|
56
|
+
width?: ResponsiveValue<DimensionValue>;
|
|
57
|
+
minWidth?: ResponsiveValue<DimensionValue>;
|
|
58
|
+
maxWidth?: ResponsiveValue<DimensionValue | "none">;
|
|
59
|
+
height?: ResponsiveValue<DimensionValue>;
|
|
60
|
+
minHeight?: ResponsiveValue<DimensionValue>;
|
|
61
|
+
maxHeight?: ResponsiveValue<DimensionValue | "none">;
|
|
62
|
+
overflow?: ResponsiveValue<"visible" | "hidden" | "clip" | "scroll" | "auto">;
|
|
63
|
+
overflowX?: ResponsiveValue<"visible" | "hidden" | "clip" | "scroll" | "auto">;
|
|
64
|
+
overflowY?: ResponsiveValue<"visible" | "hidden" | "clip" | "scroll" | "auto">;
|
|
65
|
+
}
|
|
66
|
+
interface PositionProps {
|
|
67
|
+
positionType?: ResponsiveValue<PositionValue>;
|
|
68
|
+
absolute?: ResponsiveValue<boolean>;
|
|
69
|
+
top?: ResponsiveValue<CSSLength | "auto">;
|
|
70
|
+
right?: ResponsiveValue<CSSLength | "auto">;
|
|
71
|
+
bottom?: ResponsiveValue<CSSLength | "auto">;
|
|
72
|
+
left?: ResponsiveValue<CSSLength | "auto">;
|
|
73
|
+
zIndex?: ResponsiveValue<number | "auto">;
|
|
74
|
+
}
|
|
75
|
+
interface FlexContainerProps {
|
|
76
|
+
direction?: ResponsiveValue<FlexDirection>;
|
|
77
|
+
wrap?: ResponsiveValue<FlexWrap>;
|
|
78
|
+
justify?: ResponsiveValue<JustifyValue>;
|
|
79
|
+
align?: ResponsiveValue<AlignValue>;
|
|
80
|
+
gap?: ResponsiveValue<SpacingValue>;
|
|
81
|
+
rowGap?: ResponsiveValue<SpacingValue>;
|
|
82
|
+
columnGap?: ResponsiveValue<SpacingValue>;
|
|
83
|
+
}
|
|
84
|
+
interface FlexItemProps {
|
|
85
|
+
flex?: ResponsiveValue<number | string>;
|
|
86
|
+
flexGrow?: ResponsiveValue<number>;
|
|
87
|
+
flexShrink?: ResponsiveValue<number>;
|
|
88
|
+
flexBasis?: ResponsiveValue<DimensionValue>;
|
|
89
|
+
selfAlign?: ResponsiveValue<AlignValue>;
|
|
90
|
+
order?: ResponsiveValue<number>;
|
|
91
|
+
}
|
|
92
|
+
interface BorderProps {
|
|
93
|
+
borderWidth?: ResponsiveValue<CSSLength>;
|
|
94
|
+
borderStyle?: ResponsiveValue<"none" | "solid" | "dashed" | "dotted" | "double">;
|
|
95
|
+
borderColor?: ResponsiveValue<ColorValue>;
|
|
96
|
+
cornerRadius?: ResponsiveValue<RadiusValue>;
|
|
97
|
+
}
|
|
98
|
+
interface VisualProps {
|
|
99
|
+
backgroundColor?: ResponsiveValue<ColorValue>;
|
|
100
|
+
opacity?: ResponsiveValue<number>;
|
|
101
|
+
shadow?: ResponsiveValue<"none" | "xs" | "sm" | "md" | "lg" | "xl">;
|
|
102
|
+
}
|
|
103
|
+
interface TypographyProps {
|
|
104
|
+
textColor?: ResponsiveValue<ColorValue>;
|
|
105
|
+
fontFamily?: ResponsiveValue<string>;
|
|
106
|
+
fontSize?: ResponsiveValue<ComponentSize | "2xl" | "3xl" | CSSLength>;
|
|
107
|
+
fontWeight?: ResponsiveValue<"thin" | "extraLight" | "light" | "normal" | "medium" | "semiBold" | "bold" | "extraBold" | "black" | number>;
|
|
108
|
+
textAlign?: ResponsiveValue<"left" | "center" | "right" | "justify" | "start" | "end">;
|
|
109
|
+
textTransform?: ResponsiveValue<"none" | "uppercase" | "lowercase" | "capitalize">;
|
|
110
|
+
lines?: ResponsiveValue<number>;
|
|
111
|
+
}
|
|
112
|
+
interface BaseUIProps extends SpacingProps, LayoutProps, PositionProps, FlexItemProps, BorderProps, VisualProps {
|
|
113
|
+
id?: string;
|
|
114
|
+
hidden?: boolean;
|
|
115
|
+
testId?: string;
|
|
116
|
+
className?: string;
|
|
117
|
+
style?: Readonly<FlowUIStyle>;
|
|
118
|
+
}
|
|
119
|
+
interface DisableableProps {
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
}
|
|
122
|
+
interface ReadOnlyProps {
|
|
123
|
+
readOnly?: boolean;
|
|
124
|
+
}
|
|
125
|
+
interface RequiredProps {
|
|
126
|
+
required?: boolean;
|
|
127
|
+
}
|
|
128
|
+
interface LoadingProps {
|
|
129
|
+
loading?: boolean;
|
|
130
|
+
loadingText?: string;
|
|
131
|
+
}
|
|
132
|
+
interface FocusableProps {
|
|
133
|
+
autoFocus?: boolean;
|
|
134
|
+
tabIndex?: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
type ColorScale = Record<ColorShade, string>;
|
|
138
|
+
type ColorPalette = Record<PaletteColor, ColorScale>;
|
|
139
|
+
interface ThemeColorScheme {
|
|
140
|
+
canvas: string;
|
|
141
|
+
surface: string;
|
|
142
|
+
surfaceRaised: string;
|
|
143
|
+
surfaceSunken: string;
|
|
144
|
+
text: string;
|
|
145
|
+
textMuted: string;
|
|
146
|
+
textDisabled: string;
|
|
147
|
+
textInverse: string;
|
|
148
|
+
border: string;
|
|
149
|
+
borderStrong: string;
|
|
150
|
+
focus: string;
|
|
151
|
+
overlay: string;
|
|
152
|
+
}
|
|
153
|
+
interface FlowUITheme {
|
|
154
|
+
palette: ColorPalette;
|
|
155
|
+
schemes: {
|
|
156
|
+
light: ThemeColorScheme;
|
|
157
|
+
dark: ThemeColorScheme;
|
|
158
|
+
};
|
|
159
|
+
spacing: Record<"none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl", string | number>;
|
|
160
|
+
radius: Record<"none" | "xs" | "sm" | "md" | "lg" | "xl" | "full", string | number>;
|
|
161
|
+
fontSize: Record<"xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl", string>;
|
|
162
|
+
fontWeight: Record<"thin" | "extraLight" | "light" | "normal" | "medium" | "semiBold" | "bold" | "extraBold" | "black", number>;
|
|
163
|
+
shadows: Record<"none" | "xs" | "sm" | "md" | "lg" | "xl", string>;
|
|
164
|
+
breakpoints: Record<"sm" | "md" | "lg" | "xl" | "xxl", string>;
|
|
165
|
+
zIndex: Record<"base" | "sticky" | "dropdown" | "overlay" | "dialog" | "popover" | "tooltip" | "notification", number>;
|
|
166
|
+
}
|
|
167
|
+
declare const defaultTheme: FlowUITheme;
|
|
168
|
+
declare const createTheme: (override?: DeepPartial<FlowUITheme>) => FlowUITheme;
|
|
169
|
+
declare function themeToCSS(theme: FlowUITheme, mode?: ThemeMode): string;
|
|
170
|
+
declare function responsiveCSS(theme: FlowUITheme): string;
|
|
171
|
+
|
|
172
|
+
interface StyleResolution {
|
|
173
|
+
classNames: string[];
|
|
174
|
+
style: ResolvedStyle;
|
|
175
|
+
}
|
|
176
|
+
declare function resolveFlowStyle(props: Record<string, unknown>, theme: FlowUITheme): StyleResolution;
|
|
177
|
+
declare function flowClass(base: string, props: Pick<BaseUIProps, "className">, resolution: StyleResolution, ...extra: Array<string | false | undefined>): string;
|
|
178
|
+
|
|
179
|
+
interface StackProps extends BaseUIProps, FlexContainerProps {
|
|
180
|
+
as?: "div" | "section" | "article" | "nav" | "header" | "footer" | "main" | "aside" | "form";
|
|
181
|
+
inline?: boolean;
|
|
182
|
+
}
|
|
183
|
+
interface HStackProps extends StackProps {
|
|
184
|
+
}
|
|
185
|
+
interface VStackProps extends StackProps {
|
|
186
|
+
}
|
|
187
|
+
interface IconProps extends BaseUIProps, TypographyProps {
|
|
188
|
+
icon: string;
|
|
189
|
+
label?: string;
|
|
190
|
+
spin?: boolean;
|
|
191
|
+
}
|
|
192
|
+
interface LabelProps extends BaseUIProps, TypographyProps {
|
|
193
|
+
htmlFor?: string;
|
|
194
|
+
required?: boolean;
|
|
195
|
+
}
|
|
196
|
+
interface BadgeProps extends BaseUIProps, TypographyProps {
|
|
197
|
+
color?: PaletteColor;
|
|
198
|
+
variant?: Exclude<ComponentVariant, "link">;
|
|
199
|
+
size?: ComponentSize;
|
|
200
|
+
icon?: string;
|
|
201
|
+
iconPosition?: "left" | "right";
|
|
202
|
+
}
|
|
203
|
+
interface ButtonProps extends BaseUIProps, TypographyProps, DisableableProps, LoadingProps, FocusableProps {
|
|
204
|
+
type?: "button" | "submit" | "reset";
|
|
205
|
+
variant?: ComponentVariant;
|
|
206
|
+
color?: PaletteColor;
|
|
207
|
+
size?: ComponentSize;
|
|
208
|
+
icon?: string;
|
|
209
|
+
iconPosition?: "left" | "right" | "center";
|
|
210
|
+
badge?: string | number;
|
|
211
|
+
ariaLabel?: string;
|
|
212
|
+
}
|
|
213
|
+
interface ButtonGroupProps extends BaseUIProps {
|
|
214
|
+
orientation?: Orientation;
|
|
215
|
+
attached?: boolean;
|
|
216
|
+
align?: AlignValue;
|
|
217
|
+
}
|
|
218
|
+
interface InputProps extends BaseUIProps, TypographyProps, DisableableProps, ReadOnlyProps, RequiredProps, FocusableProps {
|
|
219
|
+
name?: string;
|
|
220
|
+
value?: string | number;
|
|
221
|
+
placeholder?: string;
|
|
222
|
+
type?: "text" | "email" | "password" | "number" | "search" | "tel" | "url" | "date" | "time";
|
|
223
|
+
}
|
|
224
|
+
interface DividerProps extends BaseUIProps {
|
|
225
|
+
orientation?: Orientation;
|
|
226
|
+
label?: string;
|
|
227
|
+
}
|
|
228
|
+
interface ImageProps extends BaseUIProps {
|
|
229
|
+
src: string;
|
|
230
|
+
alt: string;
|
|
231
|
+
fit?: "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
232
|
+
loading?: "eager" | "lazy";
|
|
233
|
+
fallbackSrc?: string;
|
|
234
|
+
}
|
|
235
|
+
interface MenuItem {
|
|
236
|
+
id: string;
|
|
237
|
+
label: string;
|
|
238
|
+
icon?: string;
|
|
239
|
+
badge?: string | number;
|
|
240
|
+
disabled?: boolean;
|
|
241
|
+
separator?: boolean;
|
|
242
|
+
children?: MenuItem[];
|
|
243
|
+
}
|
|
244
|
+
interface SelectOption {
|
|
245
|
+
label: string;
|
|
246
|
+
value: string;
|
|
247
|
+
disabled?: boolean;
|
|
248
|
+
}
|
|
249
|
+
interface DropdownModel {
|
|
250
|
+
display: string | number;
|
|
251
|
+
value: string | number;
|
|
252
|
+
other: any;
|
|
253
|
+
}
|
|
254
|
+
interface TreeModel extends DropdownModel {
|
|
255
|
+
children?: TreeModel[];
|
|
256
|
+
}
|
|
257
|
+
interface TabItem {
|
|
258
|
+
id: string;
|
|
259
|
+
label: string;
|
|
260
|
+
icon?: string;
|
|
261
|
+
disabled?: boolean;
|
|
262
|
+
}
|
|
263
|
+
type SortDirection = "asc" | "desc" | null;
|
|
264
|
+
interface SortState {
|
|
265
|
+
field: string;
|
|
266
|
+
direction: SortDirection;
|
|
267
|
+
}
|
|
268
|
+
interface TableColumn<T> {
|
|
269
|
+
field: keyof T & string;
|
|
270
|
+
header: string;
|
|
271
|
+
sortable?: boolean;
|
|
272
|
+
width?: string | number;
|
|
273
|
+
align?: "left" | "center" | "right";
|
|
274
|
+
format?: (value: unknown, row: T) => string | number;
|
|
275
|
+
}
|
|
276
|
+
type DialogPosition = "center" | "left" | "right" | "top" | "bottom";
|
|
277
|
+
type TooltipLocation = "top" | "right" | "bottom" | "left";
|
|
278
|
+
interface CardProps extends BaseUIProps {
|
|
279
|
+
variant?: "outline" | "elevated" | "filled";
|
|
280
|
+
}
|
|
281
|
+
interface SliderProps extends BaseUIProps, DisableableProps {
|
|
282
|
+
min?: number;
|
|
283
|
+
max?: number;
|
|
284
|
+
step?: number;
|
|
285
|
+
value?: number;
|
|
286
|
+
name?: string;
|
|
287
|
+
}
|
|
288
|
+
interface SwitchProps extends BaseUIProps, DisableableProps {
|
|
289
|
+
checked?: boolean;
|
|
290
|
+
label?: string;
|
|
291
|
+
name?: string;
|
|
292
|
+
}
|
|
293
|
+
interface PasswordInputProps extends Omit<InputProps, "type"> {
|
|
294
|
+
showToggle?: boolean;
|
|
295
|
+
visible?: boolean;
|
|
296
|
+
}
|
|
297
|
+
interface TreeProps extends BaseUIProps {
|
|
298
|
+
nodes: TreeModel[];
|
|
299
|
+
value?: string | number;
|
|
300
|
+
defaultExpanded?: boolean;
|
|
301
|
+
}
|
|
302
|
+
interface TooltipProps extends BaseUIProps {
|
|
303
|
+
text: string;
|
|
304
|
+
location?: TooltipLocation;
|
|
305
|
+
delay?: number;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export { type AlignValue, type BadgeProps, type BaseUIProps, type BorderProps, type BreakpointName, type ButtonGroupProps, type ButtonProps, type CSSLength, type CSSVariableStyle, type CardProps, type ColorPalette, type ColorScale, type ColorShade, type ColorValue, type ComponentSize, type ComponentVariant, type DeepPartial, type DialogPosition, type DimensionValue, type DisableableProps, type DividerProps, type DropdownModel, type FlexContainerProps, type FlexDirection, type FlexItemProps, type FlexWrap, type FlowUIStyle, type FlowUITheme, type FocusableProps, type HStackProps, type IconProps, type ImageProps, type InputProps, type JustifyValue, type LabelProps, type LayoutProps, type LoadingProps, type MenuItem, type Orientation, type PaletteColor, type PasswordInputProps, type PositionProps, type PositionValue, type RadiusToken, type RadiusValue, type ReadOnlyProps, type RequiredProps, type ResolvedStyle, type ResponsiveObject, type ResponsiveValue, type SchemeColor, type SelectOption, type SliderProps, type SortDirection, type SortState, type SpacingProps, type SpacingToken, type SpacingValue, type StackProps, type StyleResolution, type SwitchProps, type TabItem, type TableColumn, type ThemeColorScheme, type ThemeMode, type TooltipLocation, type TooltipProps, type TreeModel, type TreeProps, type TypographyProps, type VStackProps, type VisualProps, createTheme, defaultTheme, flowClass, resolveFlowStyle, responsiveCSS, themeToCSS };
|