neneui 1.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.
Files changed (47) hide show
  1. package/README.md +2 -0
  2. package/lib/base/Divider.ts +13 -0
  3. package/lib/base/appBar.ts +27 -0
  4. package/lib/base/center.ts +9 -0
  5. package/lib/base/container.ts +23 -0
  6. package/lib/base/expanded.ts +20 -0
  7. package/lib/base/padding.ts +26 -0
  8. package/lib/base/scaffold.ts +35 -0
  9. package/lib/base/sizedbox.ts +23 -0
  10. package/lib/childrens/Column.ts +23 -0
  11. package/lib/childrens/Flex.ts +32 -0
  12. package/lib/childrens/Row.ts +23 -0
  13. package/lib/childrens/SingleChildScrollView.ts +26 -0
  14. package/lib/content/Card.ts +26 -0
  15. package/lib/content/Image.ts +47 -0
  16. package/lib/content/Text.ts +27 -0
  17. package/lib/core/Actions.ts +17 -0
  18. package/lib/core/BoxConstraints.ts +23 -0
  19. package/lib/core/BoxDecoration.ts +23 -0
  20. package/lib/core/Compare.ts +25 -0
  21. package/lib/core/EdgeInsets.ts +41 -0
  22. package/lib/core/Frame.ts +15 -0
  23. package/lib/core/Icon.ts +3 -0
  24. package/lib/core/IconData.ts +0 -0
  25. package/lib/core/Iconify.ts +14 -0
  26. package/lib/core/TextEditingController.ts +14 -0
  27. package/lib/core/TextStyle.ts +28 -0
  28. package/lib/core/Variable.ts +14 -0
  29. package/lib/core/core.ts +213 -0
  30. package/lib/display/Avatar.ts +52 -0
  31. package/lib/display/CodeSnippet.ts +27 -0
  32. package/lib/display/Skeleton.ts +9 -0
  33. package/lib/empty_shell.ts +3 -0
  34. package/lib/feedback/Button.ts +36 -0
  35. package/lib/feedback/ButtonGroup.ts +20 -0
  36. package/lib/feedback/ProgressIndicator.ts +37 -0
  37. package/lib/form/CheckBox.ts +20 -0
  38. package/lib/form/DatePicker.ts +23 -0
  39. package/lib/form/TextField.ts +26 -0
  40. package/lib/http/http.ts +2 -0
  41. package/lib/navigation/NavigationBar.ts +29 -0
  42. package/lib/navigation/NavigationDivider.ts +5 -0
  43. package/lib/navigation/NavigationGroup.ts +23 -0
  44. package/lib/navigation/NavigationItem.ts +23 -0
  45. package/lib/navigation/NavigationRail.ts +35 -0
  46. package/lib/widgets.ts +46 -0
  47. package/package.json +24 -0
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # NeneUI
2
+ > Server-Side User Interface Rendering for Flutter <-> JavaScript Server.
@@ -0,0 +1,13 @@
1
+ export function Divider() {
2
+ return {
3
+ name: "Divider",
4
+ props: {}
5
+ }
6
+ }
7
+
8
+ export function VerticalDivider() {
9
+ return {
10
+ name: "VerticalDivider",
11
+ props: {}
12
+ }
13
+ }
@@ -0,0 +1,27 @@
1
+ import { Empty } from "../empty_shell";
2
+ import { Text, TextStyle } from "../widgets";
3
+
4
+ export interface AppBarProps {
5
+ leading?: any,
6
+ title?: any,
7
+ actions?: any[],
8
+ backgroundColor?: string,
9
+ }
10
+
11
+ export function AppBar(id: string, {
12
+ leading = Empty(),
13
+ title = Text("#idtext_df", { text: "AppBar", style: TextStyle({}) }),
14
+ actions = [],
15
+ backgroundColor = "#FFFFFF"
16
+ }: AppBarProps){
17
+ return {
18
+ id,
19
+ name: "AppBar",
20
+ props: {
21
+ leading,
22
+ title,
23
+ actions,
24
+ backgroundColor
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,9 @@
1
+ export function Center(child: any) {
2
+ return {
3
+ id: "#"+(Math.floor(Math.random() * 1000)).toString() + "CT",
4
+ name: "Center",
5
+ props: {
6
+ child
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,23 @@
1
+ import { Empty } from "../empty_shell";
2
+
3
+ export interface ContainerProps {
4
+ child?: any,
5
+ decoration?: any
6
+ }
7
+
8
+ export function Container(
9
+ id: string,
10
+ {
11
+ child = Empty(),
12
+ decoration = Empty()
13
+ }: ContainerProps
14
+ ){
15
+ return {
16
+ id: id,
17
+ name: "Container",
18
+ props: {
19
+ child,
20
+ decoration
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,20 @@
1
+ import { Empty } from "../empty_shell";
2
+
3
+ export interface ExpandedProps {
4
+ child: any,
5
+ flex: number
6
+ }
7
+
8
+ export function Expanded(id: string, {
9
+ child = Empty(),
10
+ flex = 1
11
+ }: ExpandedProps){
12
+ return {
13
+ id: id,
14
+ name: "Expanded",
15
+ props: {
16
+ child,
17
+ flex
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,26 @@
1
+ import { Empty } from "../empty_shell";
2
+ import { EdgeInsets } from "../core/EdgeInsets";
3
+
4
+ export interface PaddingProps {
5
+ padding: EdgeInsets,
6
+ child?: any
7
+ }
8
+
9
+ export function Padding(id: string, {
10
+ padding = EdgeInsets.all(1),
11
+ child = Empty()
12
+ }: PaddingProps){
13
+ return {
14
+ id,
15
+ name: "Padding",
16
+ props: {
17
+ child,
18
+ padding: {
19
+ l: padding.left,
20
+ r: padding.right,
21
+ t: padding.top,
22
+ b: padding.bottom
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,35 @@
1
+ import { Empty } from "../empty_shell";
2
+
3
+ export interface ScaffoldProps {
4
+ appBar?: any,
5
+ body?: object,
6
+ drawer?: any,
7
+ floatingActionButton?: any,
8
+ backgroundColor?: string,
9
+ bottom?: any,
10
+ floatingActionButtonLocation?: any,
11
+ }
12
+
13
+ export function Scaffold(id: string,{
14
+ appBar = Empty(),
15
+ body = Empty(),
16
+ drawer = Empty(),
17
+ floatingActionButton = Empty(),
18
+ bottom = Empty(),
19
+ backgroundColor = "#00000",
20
+ floatingActionButtonLocation = null,
21
+ }: ScaffoldProps) {
22
+ return {
23
+ id: id,
24
+ name: "Scaffold",
25
+ props: {
26
+ appBar,
27
+ body,
28
+ drawer,
29
+ floatingActionButton,
30
+ backgroundColor,
31
+ bottom,
32
+ floatingActionButtonLocation
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,23 @@
1
+ import { Empty } from "../empty_shell";
2
+
3
+ export interface SizedBoxProps {
4
+ child?: any,
5
+ width?: number,
6
+ height?: number
7
+ }
8
+
9
+ export function SizedBox(id: string, {
10
+ child = Empty(),
11
+ width = 1,
12
+ height = 1
13
+ }: SizedBoxProps){
14
+ return {
15
+ id,
16
+ name: "SizedBox",
17
+ props: {
18
+ child,
19
+ width,
20
+ height
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ import { CrossAxis, Empty, MainAxis } from "../widgets";
2
+
3
+ export interface ColumnProps {
4
+ mainAxisAlignment: MainAxis,
5
+ crossAxisAlignment: CrossAxis,
6
+ children: any[]
7
+ }
8
+
9
+ export function Column(id: string, {
10
+ mainAxisAlignment = MainAxis.start,
11
+ crossAxisAlignment = CrossAxis.start,
12
+ children = [Empty()]
13
+ }: ColumnProps) {
14
+ return {
15
+ id,
16
+ name: "Column",
17
+ props: {
18
+ mainAxis: mainAxisAlignment,
19
+ crossAxis: crossAxisAlignment,
20
+ children: children
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,32 @@
1
+ import { CrossAxis, Direction, Empty, MainAxis, TextDirection } from "../widgets";
2
+
3
+ export interface FlexProps {
4
+ children: any[],
5
+ crossAxisAlignment: CrossAxis,
6
+ mainAxisAlignment: MainAxis,
7
+ spacing: number,
8
+ textDirection: TextDirection,
9
+ direction: Direction
10
+ }
11
+
12
+ export function Flex(id: string, {
13
+ children = [Empty()],
14
+ crossAxisAlignment = CrossAxis.start,
15
+ mainAxisAlignment = MainAxis.start,
16
+ spacing = 0,
17
+ textDirection = TextDirection.ltr,
18
+ direction = Direction.Vertical,
19
+ }: FlexProps) {
20
+ return {
21
+ id,
22
+ name: "Flex",
23
+ props: {
24
+ children,
25
+ crossAxisAlignment,
26
+ mainAxisAlignment,
27
+ spacing,
28
+ textDirection,
29
+ direction
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,23 @@
1
+ import { CrossAxis, Empty, MainAxis } from "../widgets";
2
+
3
+ export interface RowProps {
4
+ mainAxisAlignment?: MainAxis,
5
+ crossAxisAlignment?: CrossAxis,
6
+ children: any[]
7
+ }
8
+
9
+ export function Row(id: string, {
10
+ mainAxisAlignment = MainAxis.start,
11
+ crossAxisAlignment = CrossAxis.start,
12
+ children = [Empty()]
13
+ }: RowProps) {
14
+ return {
15
+ id,
16
+ name: "Row",
17
+ props: {
18
+ mainAxis: mainAxisAlignment,
19
+ crossAxis: crossAxisAlignment,
20
+ children: children
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,26 @@
1
+ import { Direction, Empty, ScrollPhysics } from "../widgets";
2
+
3
+ export interface SingleChildScrollViewProps {
4
+ child: any,
5
+ physics?: ScrollPhysics,
6
+ scrollDirection?: Direction,
7
+ reverse?: boolean
8
+ }
9
+
10
+ export function SingleChildScrollView(id: string, {
11
+ child = Empty(),
12
+ physics = ScrollPhysics.Scroll,
13
+ scrollDirection = Direction.Vertical,
14
+ reverse = false
15
+ }: SingleChildScrollViewProps){
16
+ return {
17
+ id,
18
+ name: "SingleChildScrollView",
19
+ props: {
20
+ child,
21
+ physics,
22
+ scrollDirection,
23
+ reverse
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,26 @@
1
+ import type { EdgeInsets } from "../widgets";
2
+
3
+ export interface CardProps {
4
+ padding: EdgeInsets,
5
+ child?: any,
6
+ color?: string,
7
+ type: "filled" | "outlined" | "normal"
8
+ }
9
+
10
+ export function Card(id: string, {
11
+ child,
12
+ padding,
13
+ color,
14
+ type = "normal"
15
+ }: CardProps){
16
+ return {
17
+ id,
18
+ name: "Card",
19
+ props: {
20
+ padding,
21
+ color,
22
+ type,
23
+ child
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,47 @@
1
+ import { Alignment, AssetImage, BoxFit, CircularProgressIndicator, FilterQuality, ImageRepeat, SizedBox } from "../widgets";
2
+
3
+ export interface ImageProps {
4
+ path: string,
5
+ width?: number,
6
+ height?: number,
7
+ scale?: number,
8
+ color?: string,
9
+ repeat?: ImageRepeat,
10
+ fit?: BoxFit,
11
+ alignment?: Alignment,
12
+ filterQuality? : FilterQuality,
13
+ loadingWidget?: any,
14
+ errorWidget? : any
15
+ }
16
+
17
+ export function Image(id: string, {
18
+ path = AssetImage(""),
19
+ width = 0,
20
+ height = 0,
21
+ scale = 1.0,
22
+ color = "#000000",
23
+ repeat = ImageRepeat.noRepeat,
24
+ fit = BoxFit.none,
25
+ alignment = Alignment.center,
26
+ filterQuality = FilterQuality.none,
27
+ loadingWidget = CircularProgressIndicator('#fImageLoading', {}),
28
+ errorWidget = SizedBox('#fImageError', {})
29
+ }: ImageProps) {
30
+ return {
31
+ name: "Image",
32
+ id,
33
+ props: {
34
+ path,
35
+ width,
36
+ height,
37
+ scale,
38
+ color,
39
+ repeat,
40
+ fit,
41
+ alignment,
42
+ filterQuality,
43
+ loadingWidget,
44
+ errorWidget
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,27 @@
1
+ import { TextStyle, type TextStyleProps } from "../core/TextStyle";
2
+ import { TextAlign, TextOverflow } from "../widgets";
3
+
4
+ export interface TextProps {
5
+ text: any,
6
+ align?: TextAlign,
7
+ overflow?: TextOverflow
8
+ style?: TextStyleProps
9
+ }
10
+
11
+ export function Text(id: string, {
12
+ text = "",
13
+ align = TextAlign.start,
14
+ overflow = TextOverflow.visible,
15
+ style = TextStyle({})
16
+ }: TextProps) {
17
+ return {
18
+ id,
19
+ name: "Text",
20
+ props: {
21
+ text,
22
+ align,
23
+ overflow,
24
+ style
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,17 @@
1
+ export enum Action {
2
+ SHOW_TOAST = "show_toast",
3
+ NAVIGATE = "navigate",
4
+ NAVIGATE_PUSH_REPLACE = "navigate_pushreplace",
5
+ HIDE = "hide",
6
+ SHOW = "show",
7
+ DEBUG = "daikon",
8
+ DIALOG = "dialog",
9
+ SET_VAR = "setvar"
10
+ }
11
+
12
+ export function DoAction(action: Action, data: any){
13
+ return {
14
+ action,
15
+ data
16
+ }
17
+ }
@@ -0,0 +1,23 @@
1
+ export interface BoxConstraintsProps {
2
+ minWidth?: number,
3
+ maxWidth?: number,
4
+ minHeight?: number,
5
+ maxHeight?: number
6
+ }
7
+
8
+ export function BoxConstraints({
9
+ minHeight = 0.0,
10
+ maxHeight = Infinity,
11
+ minWidth = 0.0,
12
+ maxWidth = Infinity
13
+ }: BoxConstraintsProps){
14
+ return {
15
+ name: "BoxConstraints",
16
+ props: {
17
+ minHeight,
18
+ maxHeight,
19
+ minWidth,
20
+ maxWidth
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ export interface BoxDecoration {
2
+ color?: string,
3
+ image?: string,
4
+ radius?: number,
5
+ borderColor?: string
6
+ borderWidth?: number
7
+ }
8
+
9
+ export function BoxDecoration({
10
+ color = "#FFFFFF",
11
+ image = "none",
12
+ radius = 1,
13
+ borderColor = "#FFFFFF",
14
+ borderWidth = 1
15
+ }: BoxDecoration){
16
+ return {
17
+ color,
18
+ image,
19
+ radius,
20
+ borderColor,
21
+ borderWidth
22
+ }
23
+ }
@@ -0,0 +1,25 @@
1
+ import { Empty } from "../empty_shell";
2
+
3
+ export interface CompareProps{
4
+ fi: string,
5
+ ifEqualTo: string,
6
+ then: any
7
+ or?: any,
8
+ }
9
+
10
+ export function Compare({
11
+ fi = "noIf",
12
+ ifEqualTo = "noIf",
13
+ then = Empty(),
14
+ or = Empty(),
15
+ }: CompareProps){
16
+ return {
17
+ name: "Compare",
18
+ props: {
19
+ fi,
20
+ ifEqualTo,
21
+ then,
22
+ or
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,41 @@
1
+ export class EdgeInsets {
2
+ left: number;
3
+ right: number;
4
+ top: number;
5
+ bottom: number;
6
+
7
+ private constructor(
8
+ left: number,
9
+ top: number,
10
+ right: number,
11
+ bottom: number
12
+ ) {
13
+ this.left = left;
14
+ this.top = top;
15
+ this.right = right;
16
+ this.bottom = bottom;
17
+ }
18
+
19
+ static all(value: number): EdgeInsets {
20
+ return new EdgeInsets(
21
+ value,
22
+ value,
23
+ value,
24
+ value,
25
+ )
26
+ }
27
+
28
+ static fromLTRB(
29
+ left: number,
30
+ top: number,
31
+ right: number,
32
+ bottom: number
33
+ ): EdgeInsets {
34
+ return new EdgeInsets(
35
+ left,
36
+ right,
37
+ top,
38
+ bottom
39
+ );
40
+ }
41
+ }
@@ -0,0 +1,15 @@
1
+ export interface FrameProps{
2
+ framePath: String
3
+ }
4
+
5
+ export function Frame(id: string, {
6
+ framePath = "/ui/main"
7
+ }: FrameProps){
8
+ return {
9
+ id,
10
+ name: "Frame",
11
+ props: {
12
+ framePath
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,3 @@
1
+ export function Icon(){
2
+
3
+ }
File without changes
@@ -0,0 +1,14 @@
1
+ export interface IconifyProps {
2
+ size?: number,
3
+ prefix?: string
4
+ }
5
+
6
+ export function Iconify(name: string, {size = 24, prefix = "material-symbols"}: IconifyProps){
7
+ return {
8
+ name: "Iconify",
9
+ props: {
10
+ icon: prefix + "/" + name,
11
+ size
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ export interface TextEditingControllerProps {
2
+ value?: string
3
+ }
4
+
5
+ export function TextEditingController({
6
+ value = ""
7
+ }: TextEditingControllerProps){
8
+ return {
9
+ name: "TextEditingController",
10
+ props: {
11
+ value
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,28 @@
1
+ import { FontStyle, FontWeight, TextDecoration, Colors } from "./core";
2
+
3
+ export interface TextStyleProps {
4
+ height?: number,
5
+ fontSize?: number,
6
+ fontWeight?: FontWeight,
7
+ color?: string,
8
+ decoration?: TextDecoration,
9
+ fontStyle?: FontStyle
10
+ }
11
+
12
+ export function TextStyle({
13
+ height = 1.0,
14
+ fontSize = 14,
15
+ fontWeight = FontWeight.w400,
16
+ color = Colors.black,
17
+ decoration = TextDecoration.none,
18
+ fontStyle = FontStyle.normal
19
+ }: TextStyleProps) {
20
+ return {
21
+ height,
22
+ fontSize,
23
+ fontWeight,
24
+ color,
25
+ decoration,
26
+ fontStyle
27
+ }
28
+ }
@@ -0,0 +1,14 @@
1
+ export interface VariableProps{
2
+ template: string,
3
+ variable: string
4
+ }
5
+
6
+ export function Var({
7
+ template = "Hello {%1} {%2}",
8
+ variable = "default,defaultb"
9
+ }: VariableProps){
10
+ return {
11
+ template,
12
+ variable
13
+ };
14
+ }
@@ -0,0 +1,213 @@
1
+ export enum MainAxis {
2
+ start = "start",
3
+ center = "center",
4
+ end = "end",
5
+ spaceBetween = "spaceBetween",
6
+ spaceAround = "spaceAround",
7
+ spaceEvenly = "spaceEvenly"
8
+ }
9
+
10
+ export enum TextDirection {
11
+ "ltr" = "ltr",
12
+ "rtl" = "rtl"
13
+ }
14
+
15
+ export enum Direction {
16
+ Horizontal = "horizontal",
17
+ Vertical = "vertical"
18
+ }
19
+
20
+ export enum ScrollPhysics {
21
+ Scroll = "scroll",
22
+ NeverScroll = "never_scroll",
23
+ }
24
+
25
+ export enum ImageRepeat {
26
+ repeat = "repeat",
27
+ repeatX = "repeatX",
28
+ repeatY = "repeatY",
29
+ noRepeat = "noRepeat"
30
+ }
31
+
32
+ export enum BoxFit {
33
+ fill = "fill",
34
+ contain = "contain",
35
+ cover = "cover",
36
+ fitWidth = "fitWidth",
37
+ fitHeight = "fitHeight",
38
+ none = "none"
39
+ }
40
+
41
+ export enum Alignment {
42
+ bottomCenter = "bottomCenter",
43
+ bottomLeft = "bottomLeft",
44
+ bottomRight = "bottomRight",
45
+ center = "center",
46
+ centerLeft = "centerLeft",
47
+ centerRight = "centerRight",
48
+ topCenter = "topCenter",
49
+ topLeft = "topLeft",
50
+ topRight = "topRight"
51
+ }
52
+
53
+ export enum FilterQuality {
54
+ none = "none",
55
+ low = "low",
56
+ medium = "medium",
57
+ high = "high"
58
+ }
59
+
60
+ export enum ButtonType {
61
+ Normal = "normal",
62
+ Primary = "primary",
63
+ Secondary = "secondary",
64
+ Success = "success",
65
+ Danger = "danger",
66
+ Info = "info",
67
+ Warning = "warning"
68
+ }
69
+
70
+ export enum ButtonDensity {
71
+ compact = "compact",
72
+ dense = "dense",
73
+
74
+ normal = "normal",
75
+ comfortable = "comfortable",
76
+ icon = "icon"
77
+ }
78
+
79
+ export enum ButtonShape {
80
+ circle = "circle",
81
+ rectangle = "rectangle"
82
+ }
83
+
84
+ export enum FontWeight {
85
+ bold = "bold",
86
+ w100 = "w100",
87
+ w200 = "w200",
88
+ w300 = "w300",
89
+ w400 = "w400",
90
+ w500 = "w500",
91
+ w600 = "w600",
92
+ w700 = "w700",
93
+ w800 = "w800",
94
+ w900 = "w900"
95
+ }
96
+
97
+ export enum Colors {
98
+ red = "red",
99
+ blue = "blue",
100
+ green = "green",
101
+ black = "black",
102
+ white = "white",
103
+ violet = "violet"
104
+ }
105
+
106
+ export enum TextDecoration {
107
+ none = "none",
108
+ lineThrough = "lineThrough",
109
+ overline = "overline",
110
+ underline = "underline"
111
+ }
112
+
113
+ export enum FontStyle {
114
+ normal = "normal",
115
+ italic = "italic"
116
+ }
117
+
118
+ export enum TextOverflow {
119
+ clip = "clip",
120
+ fade = "fade",
121
+ ellipsis = "ellipsis",
122
+ visible = "visible"
123
+ }
124
+
125
+ export enum InputType {
126
+ text = "text",
127
+ number = "number",
128
+ phone = "phone",
129
+ twitter = "twitter"
130
+ }
131
+
132
+ export enum TextAlign {
133
+ left = "left",
134
+ right = "right",
135
+ center = "center",
136
+ justify = "justify",
137
+ start = "start",
138
+ end = "end"
139
+ }
140
+
141
+ export enum CrossAxis {
142
+ start = "start",
143
+ center = "center",
144
+ end = "end",
145
+ stretch = "stretch"
146
+ }
147
+
148
+ export function AssetImage(img: string){
149
+ return "local+" + img;
150
+ }
151
+
152
+ export function NetworkImage(img: string){
153
+ return "web+" + img;
154
+ }
155
+
156
+ export interface setVarProps{
157
+ variable: string,
158
+ value: string
159
+ }
160
+
161
+ export function setVar({
162
+ variable = "",
163
+ value = ""
164
+ }: setVarProps){
165
+ return {
166
+ var: variable,
167
+ val: value
168
+ }
169
+ }
170
+
171
+ export enum PromptMode {
172
+ dialog = "dialog",
173
+ popup = "popup"
174
+ }
175
+
176
+ export enum DateFormat {
177
+ dmmyyyy = "dmmyyyy",
178
+ yyyyMMdd = "yyyyMMdd"
179
+ }
180
+
181
+ export enum NavigationBarAlignment{
182
+ start = "start",
183
+ center = "center",
184
+ end = "end",
185
+ spaceBetween = "spaceBetween",
186
+ spaceAround = "spaceAround",
187
+ spaceEvenly = "spaceEvenly"
188
+ }
189
+
190
+ export enum NavigationLabelPosition {
191
+ start = "start",
192
+ end = "end",
193
+ top = "top",
194
+ bottom = "bottom"
195
+ }
196
+
197
+ export enum NavigationLabelType{
198
+ none = "none",
199
+ selected = "selected",
200
+ all = "all",
201
+ tootlip = "tootlip",
202
+ expanded = "expanded"
203
+ }
204
+
205
+ export * from "./TextStyle"
206
+ export * from "./BoxDecoration"
207
+ export * from "./Actions"
208
+ export * from "./BoxConstraints"
209
+ export * from "./Variable"
210
+ export * from "./Iconify";
211
+ export * from "./TextEditingController"
212
+ export * from "./Compare"
213
+ export * from "./Frame"
@@ -0,0 +1,52 @@
1
+ import { Empty } from "../empty_shell";
2
+ import { AssetImage } from "../widgets";
3
+
4
+ export interface AvatarProps {
5
+ backgroundColor?: string,
6
+ initials?: string,
7
+ size?: number,
8
+ badge?: any,
9
+ image: string
10
+ }
11
+
12
+ export function Avatar(id: string, {
13
+ backgroundColor = "#000000",
14
+ initials = "Avatar",
15
+ size = 32,
16
+ badge = AvatarBadge({}),
17
+ image = AssetImage('')
18
+ }: AvatarProps){
19
+ return {
20
+ id,
21
+ name: "Avatar",
22
+ props: {
23
+ backgroundColor,
24
+ initials,
25
+ size,
26
+ badge,
27
+ image
28
+ }
29
+ }
30
+ }
31
+
32
+ export interface AvatarBadgeProps{
33
+ size?: number,
34
+ child?: any,
35
+ color?: string
36
+ }
37
+
38
+ export function AvatarBadge({
39
+ size = 1,
40
+ child = Empty(),
41
+ color = "#329e00"
42
+ }: AvatarBadgeProps){
43
+ return {
44
+ id: "#avatarBadge",
45
+ name: "AvatarBadge",
46
+ props: {
47
+ size,
48
+ color,
49
+ child
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,27 @@
1
+ import { BoxConstraints, type BoxConstraintsProps } from "../widgets";
2
+
3
+ export interface CodeSnippetProps {
4
+ code: string,
5
+ lang?: string,
6
+ constraints?: any,
7
+ actions?: any[]
8
+ }
9
+
10
+ export function CodeSnippet(id: string,{
11
+ code = `print('Hello World')`,
12
+ lang = "dart",
13
+ constraints = BoxConstraints({}),
14
+ actions = []
15
+ }: CodeSnippetProps){
16
+ return {
17
+ id,
18
+ name: "CodeSnippet",
19
+ props: {
20
+ code,
21
+ lang,
22
+ constraints,
23
+ actions
24
+ }
25
+ }
26
+ }
27
+
@@ -0,0 +1,9 @@
1
+ export function Skeleton(id: string, ui: any){
2
+ return {
3
+ id: id,
4
+ name: "Skeleton",
5
+ props: {
6
+ child: ui
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,3 @@
1
+ export function Empty() {
2
+ return {id: "#"+(Math.floor(Math.random() * 1000)).toString() + "A",name: "Empty"}
3
+ }
@@ -0,0 +1,36 @@
1
+ import { Action, ButtonDensity, ButtonShape, ButtonType, DoAction, Empty } from "../widgets";
2
+
3
+ export interface ButtonProps {
4
+ child: any,
5
+ leading?: any,
6
+ type: ButtonType,
7
+ density: ButtonDensity,
8
+ disabled: boolean,
9
+ shape: ButtonShape
10
+ onPressed: any
11
+ }
12
+
13
+ export function Button(id: string, {
14
+ child,
15
+ leading = Empty(),
16
+ type = ButtonType.Normal,
17
+ density = ButtonDensity.normal,
18
+ shape = ButtonShape.rectangle,
19
+ disabled = false,
20
+ onPressed = DoAction(Action.SHOW_TOAST, "Hello World")
21
+ }: ButtonProps) {
22
+ return {
23
+ id,
24
+ name: "Button",
25
+ props: {
26
+ child,
27
+ leading,
28
+ type,
29
+ density,
30
+ shape,
31
+ disabled,
32
+ onPressed
33
+ }
34
+ }
35
+ }
36
+
@@ -0,0 +1,20 @@
1
+ import { Direction } from "../widgets";
2
+
3
+ export interface ButtonGroupProps {
4
+ children: any,
5
+ direction?: Direction
6
+ }
7
+
8
+ export function ButtonGroup(id: string, {
9
+ children = [],
10
+ direction = Direction.Horizontal
11
+ }: ButtonGroupProps){
12
+ return {
13
+ id,
14
+ name: "ButtonGroup",
15
+ props: {
16
+ children,
17
+ direction
18
+ }
19
+ };
20
+ }
@@ -0,0 +1,37 @@
1
+ export interface CircularProgressIndicatorProps {
2
+ color?: string,
3
+ strokeWidth?: number
4
+ }
5
+
6
+ export function CircularProgressIndicator(id: string, {
7
+ color = "#0F0F0F",
8
+ strokeWidth = 10
9
+ }: CircularProgressIndicatorProps){
10
+ return {
11
+ id,
12
+ name: "CircularProgressIndicator",
13
+ props: {
14
+ color,
15
+ strokeWidth
16
+ }
17
+ };
18
+ }
19
+
20
+ export interface LinearProgressIndicatorProps {
21
+ color?: string,
22
+ minHeight?: number
23
+ }
24
+
25
+ export function LinearProgressIndicator(id: string, {
26
+ color= "#000000",
27
+ minHeight = 3
28
+ }: LinearProgressIndicatorProps){
29
+ return {
30
+ id,
31
+ name: "LinearProgressIndicator",
32
+ props: {
33
+ color,
34
+ minHeight
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,20 @@
1
+ import { Empty } from "../widgets";
2
+
3
+ export interface CheckBoxProps{
4
+ trailing: any,
5
+ value: boolean
6
+ }
7
+
8
+ export function CheckBox(id: string, {
9
+ trailing = Empty(),
10
+ value = true,
11
+ }: CheckBoxProps){
12
+ return {
13
+ id,
14
+ name: "CheckBox",
15
+ props: {
16
+ trailing,
17
+ value
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,23 @@
1
+ import { PromptMode } from "../widgets";
2
+
3
+ export interface DatePickerProps{
4
+ mode: PromptMode,
5
+ dialogTitle?: any,
6
+ defaultDate: number
7
+ }
8
+
9
+ export function DatePicker(id: string, {
10
+ mode = PromptMode.popup,
11
+ dialogTitle,
12
+ defaultDate = Date.now()
13
+ }: DatePickerProps){
14
+ return {
15
+ id,
16
+ name: "DatePicker",
17
+ props: {
18
+ dialogTitle,
19
+ defaultDate,
20
+ mode
21
+ }
22
+ };
23
+ }
@@ -0,0 +1,26 @@
1
+ import { InputType, Text, TextEditingController } from "../widgets";
2
+
3
+ export interface TextFieldProps {
4
+ controller?: any,
5
+ placeholder?: any,
6
+ inputType?: InputType
7
+ features?: any[],
8
+ }
9
+
10
+ export function TextField(id: string,{
11
+ controller = TextEditingController({value : ""}),
12
+ placeholder = Text("#placeText", {text: "Enter"}),
13
+ inputType = InputType.text,
14
+ features = []
15
+ } : TextFieldProps){
16
+ return {
17
+ id,
18
+ name: "TextField",
19
+ props:{
20
+ controller,
21
+ placeholder,
22
+ inputType,
23
+ features
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,2 @@
1
+ // HTTP Hosting
2
+ // placeholder
@@ -0,0 +1,29 @@
1
+ import { Empty, NavigationBarAlignment, NavigationLabelType } from "../widgets";
2
+
3
+ export interface NavigationBarProps{
4
+ alignment: NavigationBarAlignment,
5
+ labelType: NavigationLabelType,
6
+ expanded: boolean,
7
+ selectedKey: string,
8
+ children: any[]
9
+ }
10
+
11
+ export function NavigationBar(id: string, {
12
+ alignment = NavigationBarAlignment.center,
13
+ labelType = NavigationLabelType.none,
14
+ expanded = false,
15
+ selectedKey = id,
16
+ children = [Empty()]
17
+ }: NavigationBarProps){
18
+ return {
19
+ id,
20
+ name: "NavigationBar",
21
+ props: {
22
+ alignment,
23
+ labelType,
24
+ expanded,
25
+ selectedKey,
26
+ children
27
+ }
28
+ };
29
+ }
@@ -0,0 +1,5 @@
1
+ export function NavigationDivider(){
2
+ return {
3
+ name: "NavigationDivider"
4
+ }
5
+ }
@@ -0,0 +1,23 @@
1
+ import { Alignment, Empty } from "../widgets";
2
+
3
+ export interface NavigationGroupProps {
4
+ label: string,
5
+ children: any[],
6
+ labelAlignment: Alignment
7
+ }
8
+
9
+ export function NavigationGroup({
10
+ label = "NavigationGroup",
11
+ children = [Empty()],
12
+ labelAlignment = Alignment.topLeft
13
+ } : NavigationGroupProps) {
14
+ return {
15
+ id: "#NavGroup_"+label.replaceAll("_", "").replaceAll("/", "").replaceAll("\\", ""),
16
+ name: "NavigationGroup",
17
+ props: {
18
+ label,
19
+ children,
20
+ labelAlignment
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ import { Empty } from "../empty_shell";
2
+
3
+ export interface NavigationItemProps {
4
+ key: number
5
+ label: string,
6
+ child: any,
7
+ }
8
+
9
+ export function NavigationItem({
10
+ key = 0,
11
+ label = "Home",
12
+ child = Empty()
13
+ }: NavigationItemProps){
14
+ return {
15
+ id: `IconBottom${key}`,
16
+ name: "NavigationItem",
17
+ props:{
18
+ key,
19
+ label,
20
+ child
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,35 @@
1
+ import type { Alignment, NavigationLabelPosition, NavigationLabelType } from "../widgets";
2
+
3
+ export interface NavigationRailProps {
4
+ alignment?: Alignment,
5
+ labelType?: NavigationLabelType,
6
+ labelPosition?: NavigationLabelPosition,
7
+ header?: any[],
8
+ footer?: any[],
9
+ expanded: boolean,
10
+ children: any[],
11
+ }
12
+
13
+ export function NavigationRail(id: string, {
14
+ alignment,
15
+ labelType,
16
+ labelPosition,
17
+ header = [],
18
+ footer = [],
19
+ expanded,
20
+ children
21
+ }: NavigationRailProps) {
22
+ return {
23
+ id,
24
+ name: "NavigationRail",
25
+ props: {
26
+ alignment,
27
+ labelType,
28
+ labelPosition,
29
+ header,
30
+ footer,
31
+ expanded,
32
+ children
33
+ }
34
+ }
35
+ }
package/lib/widgets.ts ADDED
@@ -0,0 +1,46 @@
1
+ export * from "./empty_shell";
2
+ export * from "./core/EdgeInsets";
3
+ export * from "./core/core"
4
+
5
+ // Base Widgets
6
+ export * from "./base/scaffold";
7
+ export * from "./base/container";
8
+ export * from "./base/sizedbox";
9
+ export * from "./base/padding";
10
+ export * from "./base/center";
11
+ export * from "./base/appBar";
12
+ export * from "./base/expanded"
13
+ export * from "./base/Divider";
14
+
15
+ // Childrens
16
+ export * from "./childrens/Column";
17
+ export * from "./childrens/Row";
18
+ export * from "./childrens/Flex";
19
+ export * from "./childrens/SingleChildScrollView";
20
+
21
+ // Content
22
+ export * from "./content/Text"
23
+ export * from "./content/Image"
24
+ export * from "./content/Card"
25
+
26
+ // Display
27
+ export * from "./display/Avatar";
28
+ export * from "./display/CodeSnippet"
29
+ export * from "./display/Skeleton"
30
+
31
+ // Form
32
+ export * from "./form/TextField"
33
+ export * from "./form/CheckBox"
34
+ export * from "./form/DatePicker"
35
+
36
+ // Navigation
37
+ export * from "./navigation/NavigationBar";
38
+ export * from "./navigation/NavigationItem";
39
+ export * from "./navigation/NavigationGroup";
40
+ export * from "./navigation/NavigationDivider"
41
+ export * from "./navigation/NavigationRail"
42
+
43
+ // Feedback
44
+ export * from "./feedback/ProgressIndicator"
45
+ export * from "./feedback/Button"
46
+ export * from "./feedback/ButtonGroup"
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "neneui",
3
+ "module": "index.ts",
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "exports":{
7
+ ".": "./lib/widgets.ts"
8
+ },
9
+ "types": "./lib/widgets.ts",
10
+ "files": [
11
+ "lib"
12
+ ],
13
+ "devDependencies": {
14
+ "@types/bun": "latest"
15
+ },
16
+ "peerDependencies": {
17
+ "typescript": "^5"
18
+ },
19
+ "dependencies": {
20
+ "@types/express": "^5.0.6",
21
+ "cors": "^2.8.6",
22
+ "express": "^5.2.1"
23
+ }
24
+ }