elseware-ui 2.40.3 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,228 @@
1
+ import React__default, { HTMLAttributes, ReactNode, CSSProperties } from 'react';
2
+
3
+ declare const CURRENCIES: {
4
+ name: string;
5
+ symbol: string;
6
+ code: string;
7
+ }[];
8
+
9
+ declare enum Variant$1 {
10
+ default = "default",
11
+ primary = "primary",
12
+ secondary = "secondary",
13
+ success = "success",
14
+ danger = "danger",
15
+ warning = "warning",
16
+ info = "info",
17
+ light = "light",
18
+ dark = "dark"
19
+ }
20
+ declare enum TextVariant {
21
+ default = "default",
22
+ primary = "primary",
23
+ secondary = "secondary",
24
+ success = "success",
25
+ danger = "danger",
26
+ warning = "warning",
27
+ info = "info",
28
+ light = "light",
29
+ dark = "dark"
30
+ }
31
+ declare enum Shape$1 {
32
+ circle = "circle",
33
+ roundedSquare = "roundedSquare",
34
+ softRoundedSquare = "softRoundedSquare",
35
+ square = "square"
36
+ }
37
+ declare enum Size$1 {
38
+ xs = "xs",
39
+ sm = "sm",
40
+ md = "md",
41
+ lg = "lg",
42
+ xl = "xl"
43
+ }
44
+ declare enum Appearance$1 {
45
+ solid = "solid",
46
+ lite = "lite",
47
+ ghost = "ghost"
48
+ }
49
+ declare enum Decoration {
50
+ underline = "underline",
51
+ overline = "overline",
52
+ lineThrough = "lineThrough",
53
+ noUnderline = "noUnderline"
54
+ }
55
+ declare enum Target {
56
+ blank = "blank",
57
+ self = "self",
58
+ parent = "parent",
59
+ top = "top"
60
+ }
61
+ declare enum VerticalPosition$1 {
62
+ top = "top",
63
+ bottom = "bottom"
64
+ }
65
+ declare enum HorizontalPosition$1 {
66
+ left = "left",
67
+ right = "right"
68
+ }
69
+ declare enum CardinalPosition$1 {
70
+ top = "top",
71
+ bottom = "bottom",
72
+ left = "left",
73
+ right = "right"
74
+ }
75
+ declare enum CornerPosition$1 {
76
+ "top-left" = "top-left",
77
+ "top-right" = "top-right",
78
+ "bottom-left" = "bottom-left",
79
+ "bottom-right" = "bottom-right"
80
+ }
81
+ declare enum OctilePosition$1 {
82
+ top = "top",
83
+ bottom = "bottom",
84
+ left = "left",
85
+ right = "right",
86
+ "top-left" = "top-left",
87
+ "top-right" = "top-right",
88
+ "bottom-left" = "bottom-left",
89
+ "bottom-right" = "bottom-right"
90
+ }
91
+ declare enum ListBulletType$1 {
92
+ dot = "dot",
93
+ diamond = "diamond",
94
+ number = "number",
95
+ none = "none"
96
+ }
97
+ declare enum ListAlign$1 {
98
+ start = "start",
99
+ center = "center"
100
+ }
101
+ declare enum ListDirection$1 {
102
+ vertical = "vertical",
103
+ horizontal = "horizontal"
104
+ }
105
+ declare enum SpinnerType$1 {
106
+ border = "border",
107
+ ring = "ring",
108
+ dots = "dots",
109
+ bars = "bars",
110
+ pulse = "pulse",
111
+ orbit = "orbit",
112
+ dualRing = "dualRing",
113
+ ripple = "ripple",
114
+ grid = "grid",
115
+ wave = "wave"
116
+ }
117
+ declare enum ToastPosition {
118
+ topLeft = "top-left",
119
+ topCenter = "top-center",
120
+ topRight = "top-right",
121
+ bottomLeft = "bottom-left",
122
+ bottomCenter = "bottom-center",
123
+ bottomRight = "bottom-right"
124
+ }
125
+ declare enum ToastStatus {
126
+ default = "default",
127
+ success = "success",
128
+ warning = "warning",
129
+ error = "error",
130
+ danger = "danger",
131
+ info = "info"
132
+ }
133
+
134
+ type Variant = `${Variant$1}`;
135
+ type Shape = `${Shape$1}`;
136
+ type Size = `${Size$1}`;
137
+ type Appearance = `${Appearance$1}`;
138
+ type TextDecoration = `${Decoration}`;
139
+ type HyperRefTarget = `${Target}`;
140
+ type VerticalPosition = `${VerticalPosition$1}`;
141
+ type HorizontalPosition = `${HorizontalPosition$1}`;
142
+ type CardinalPosition = `${CardinalPosition$1}`;
143
+ type CornerPosition = `${CornerPosition$1}`;
144
+ type OctilePosition = `${OctilePosition$1}`;
145
+ type TitleBannerLevel = 1 | 2;
146
+ type ListBulletType = `${ListBulletType$1}`;
147
+ type ListAlign = `${ListAlign$1}`;
148
+ type ListDirection = `${ListDirection$1}`;
149
+ type RouteTabMode = "route" | "state";
150
+ type CurrencyCode = (typeof CURRENCIES)[number]["code"];
151
+ type SpinnerType = `${SpinnerType$1}`;
152
+ type SpinnerDirection = "vertical" | "horizontal";
153
+
154
+ /**
155
+ * Contains ReactElements such as "children" using HTMLAttributes
156
+ *
157
+ * Contains DOMAttributes such as "onClick" using HTMLAttributes
158
+ *
159
+ * Define the custom types as follows for the custom DOM elements
160
+ * BaseComponentProps<HTMLDivElement> // default
161
+ * BaseComponentProps<HTMLButtonElement> // buttons
162
+ * BaseComponentProps<HTMLAnchorElement> // links
163
+ */
164
+ interface BaseComponentProps<T extends HTMLElement = HTMLDivElement> extends Omit<HTMLAttributes<T>, "children"> {
165
+ className?: string;
166
+ }
167
+
168
+ type ButtonMode = "contained" | "contained-tonal" | "outlined" | "text";
169
+ type ButtonIcon = ReactNode | ((props: {
170
+ color: string;
171
+ size: number;
172
+ }) => ReactNode);
173
+ interface ButtonProps extends BaseComponentProps<HTMLButtonElement> {
174
+ type?: "button" | "submit" | "reset";
175
+ icon?: ButtonIcon;
176
+ text?: string;
177
+ children?: ReactNode;
178
+ loading?: boolean;
179
+ disabled?: boolean;
180
+ block?: boolean;
181
+ compact?: boolean;
182
+ mode?: ButtonMode;
183
+ buttonColor?: string;
184
+ textColor?: string;
185
+ contentClassName?: string;
186
+ labelClassName?: string;
187
+ variant?: Variant;
188
+ appearance?: Appearance;
189
+ shape?: Shape;
190
+ size?: Size;
191
+ style?: CSSProperties;
192
+ contentStyle?: unknown;
193
+ labelStyle?: unknown;
194
+ accessibilityLabel?: string;
195
+ accessibilityRole?: string;
196
+ accessibilityState?: unknown;
197
+ testID?: string;
198
+ onPress?: () => void;
199
+ }
200
+
201
+ interface EUIComponentDefaults {
202
+ variant?: keyof typeof Variant$1;
203
+ size?: keyof typeof Size$1;
204
+ shape?: keyof typeof Shape$1;
205
+ styles?: string;
206
+ }
207
+ interface EUIRoute {
208
+ path: string;
209
+ name: string;
210
+ }
211
+ interface EUIConfigs {
212
+ global?: EUIComponentDefaults;
213
+ routes?: EUIRoute[];
214
+ }
215
+
216
+ interface EUIContextValue {
217
+ config: EUIConfigs;
218
+ setConfig: React__default.Dispatch<React__default.SetStateAction<EUIConfigs>>;
219
+ }
220
+ declare const EUIProvider: ({ config, children, }: {
221
+ config: EUIConfigs;
222
+ children: React__default.ReactNode;
223
+ }) => React__default.JSX.Element;
224
+ declare const useEUIConfig: () => EUIContextValue;
225
+
226
+ declare function resolveWithGlobal<T>(config: EUIConfigs | null, props: T, defaults: Partial<T>): T;
227
+
228
+ export { type Appearance as A, type ButtonProps as B, type CurrencyCode as C, Decoration as D, type EUIComponentDefaults as E, type HorizontalPosition as H, type ListBulletType as L, type OctilePosition as O, type RouteTabMode as R, type Shape as S, type TitleBannerLevel as T, type Variant as V, type ButtonIcon as a, type ButtonMode as b, type EUIConfigs as c, EUIProvider as d, type EUIRoute as e, type BaseComponentProps as f, type Size as g, type ListDirection as h, type ListAlign as i, type SpinnerType as j, type SpinnerDirection as k, type TextDecoration as l, Shape$1 as m, Variant$1 as n, Size$1 as o, TextVariant as p, ToastStatus as q, resolveWithGlobal as r, ToastPosition as s, Target as t, useEUIConfig as u, type CardinalPosition as v, type CornerPosition as w, type HyperRefTarget as x, type VerticalPosition as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elseware-ui",
3
- "version": "2.40.3",
3
+ "version": "3.0.0",
4
4
  "private": false,
5
5
  "description": "A modern and customizable React UI component library by elseware Technology.",
6
6
  "keywords": [
@@ -20,17 +20,30 @@
20
20
  "license": "MIT",
21
21
  "main": "./dist/index.js",
22
22
  "module": "./dist/index.mjs",
23
+ "react-native": "./dist/index.native.js",
23
24
  "types": "./dist/index.d.ts",
24
25
  "exports": {
25
26
  ".": {
27
+ "react-native": {
28
+ "types": "./dist/index.native.d.ts",
29
+ "import": "./dist/index.native.mjs",
30
+ "require": "./dist/index.native.js"
31
+ },
26
32
  "types": "./dist/index.d.ts",
27
33
  "import": "./dist/index.mjs",
28
34
  "require": "./dist/index.js"
29
35
  },
36
+ "./native": {
37
+ "types": "./dist/index.native.d.ts",
38
+ "import": "./dist/index.native.mjs",
39
+ "require": "./dist/index.native.js"
40
+ },
41
+ "./tailwind": "./tailwind.preset.js",
30
42
  "./styles.css": "./dist/index.css"
31
43
  },
32
44
  "files": [
33
- "dist"
45
+ "dist",
46
+ "tailwind.preset.js"
34
47
  ],
35
48
  "sideEffects": [
36
49
  "**/*.css"
@@ -56,10 +69,20 @@
56
69
  "full": "npm run lint:fix && npm run format && npm run validate"
57
70
  },
58
71
  "peerDependencies": {
59
- "react": "^18.3.1",
60
- "react-dom": "^18.3.1",
72
+ "react": ">=18.3.1 <20",
73
+ "react-dom": ">=18.3.1 <20",
74
+ "react-native": "*",
75
+ "nativewind": ">=4.0.0 <5",
61
76
  "tailwindcss": ">=3.0.0"
62
77
  },
78
+ "peerDependenciesMeta": {
79
+ "nativewind": {
80
+ "optional": true
81
+ },
82
+ "react-native": {
83
+ "optional": true
84
+ }
85
+ },
63
86
  "dependencies": {
64
87
  "@codemirror/lang-markdown": "^6.5.0",
65
88
  "@codemirror/theme-one-dark": "^6.1.3",
@@ -117,12 +140,17 @@
117
140
  "husky": "^9.1.7",
118
141
  "knip": "^6.15.0",
119
142
  "lint-staged": "^17.0.7",
143
+ "nativewind": "^4.2.6",
120
144
  "path": "^0.12.7",
121
145
  "postcss": "^8.4.33",
122
146
  "prettier": "^3.8.3",
123
147
  "prop-types": "^15.8.1",
124
148
  "react": "^18.3.1",
125
149
  "react-dom": "^18.3.1",
150
+ "react-native": "0.75.2",
151
+ "react-native-css-interop": "0.2.6",
152
+ "react-native-reanimated": "3.10.1",
153
+ "react-native-web": "^0.21.2",
126
154
  "rimraf": "^6.0.1",
127
155
  "storybook": "^8.5.0",
128
156
  "tailwindcss": "^3.4.1",
@@ -0,0 +1,116 @@
1
+ module.exports = {
2
+ darkMode: "class",
3
+ theme: {
4
+ extend: {
5
+ colors: {
6
+ "eui-primary": {
7
+ 50: "#e6e8ec",
8
+ 100: "#c3c8d2",
9
+ 200: "#9aa2b3",
10
+ 300: "#707a93",
11
+ 400: "#4c5673",
12
+ 500: "#00040f",
13
+ 600: "#00030d",
14
+ 700: "#00020a",
15
+ 800: "#000106",
16
+ 900: "#000003",
17
+ },
18
+ "eui-secondary": {
19
+ 50: "#e6ffcc",
20
+ 100: "#c0ff8c",
21
+ 200: "#a3ff5f",
22
+ 300: "#7aff2f",
23
+ 400: "#64e245",
24
+ 500: "#4cd900",
25
+ 600: "#17b800",
26
+ 700: "#149900",
27
+ 800: "#107a00",
28
+ 900: "#0a5a00",
29
+ },
30
+ "eui-success": {
31
+ 50: "#b0e8d0",
32
+ 100: "#8ddbb9",
33
+ 200: "#6bcfa2",
34
+ 300: "#48c28b",
35
+ 400: "#26b674",
36
+ 500: "#198754",
37
+ 600: "#146b42",
38
+ 700: "#0f4e31",
39
+ 800: "#0a321f",
40
+ 900: "#05170e",
41
+ },
42
+ "eui-danger": {
43
+ 50: "#f9c3c7",
44
+ 100: "#f49aa1",
45
+ 200: "#ef717b",
46
+ 300: "#ea4855",
47
+ 400: "#e51f2f",
48
+ 500: "#dc3545",
49
+ 600: "#af2a37",
50
+ 700: "#821f29",
51
+ 800: "#56151b",
52
+ 900: "#2a0a0e",
53
+ },
54
+ "eui-warning": {
55
+ 50: "#fff3cd",
56
+ 100: "#ffe89b",
57
+ 200: "#ffdc69",
58
+ 300: "#ffd137",
59
+ 400: "#ffc606",
60
+ 500: "#ffc107",
61
+ 600: "#cc9905",
62
+ 700: "#997104",
63
+ 800: "#664902",
64
+ 900: "#332401",
65
+ },
66
+ "eui-info": {
67
+ 50: "#a7effa",
68
+ 100: "#82e6f8",
69
+ 200: "#5dddf6",
70
+ 300: "#38d3f4",
71
+ 400: "#14caf2",
72
+ 500: "#0dcaf0",
73
+ 600: "#0aa0c0",
74
+ 700: "#087690",
75
+ 800: "#054c60",
76
+ 900: "#032330",
77
+ },
78
+ "eui-light": {
79
+ 50: "#ffffff",
80
+ 100: "#fefefe",
81
+ 200: "#fdfdfd",
82
+ 300: "#fcfcfc",
83
+ 400: "#fbfbfb",
84
+ 500: "#f8f9fa",
85
+ 600: "#c6c7c8",
86
+ 700: "#949596",
87
+ 800: "#626263",
88
+ 900: "#313132",
89
+ },
90
+ "eui-dark": {
91
+ 50: "#9ea1a4",
92
+ 100: "#868a8d",
93
+ 200: "#6f7376",
94
+ 300: "#575c5f",
95
+ 400: "#404547",
96
+ 500: "#212529",
97
+ 600: "#1a1d20",
98
+ 700: "#141618",
99
+ 800: "#0d0e10",
100
+ 900: "#070708",
101
+ },
102
+ },
103
+ transitionDuration: {
104
+ 120: "120ms",
105
+ 180: "180ms",
106
+ 240: "240ms",
107
+ 250: "250ms",
108
+ },
109
+ },
110
+ fontFamily: { poppins: ["Poppins", "sans-serif"] },
111
+ },
112
+ variants: {
113
+ extend: {},
114
+ },
115
+ plugins: [],
116
+ };