elseware-ui 3.0.12 → 3.0.14

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.
@@ -1,4 +1,4 @@
1
- import React__default, { HTMLAttributes, ReactNode } from 'react';
1
+ import react__default, { HTMLAttributes, ReactNode } from 'react';
2
2
  import { FieldHookConfig, FormikValues, FormikConfig, FormikProps, FormikHelpers } from 'formik';
3
3
 
4
4
  declare const CURRENCIES: {
@@ -167,19 +167,33 @@ interface BaseComponentProps<T extends HTMLElement = HTMLDivElement> extends Omi
167
167
  }
168
168
 
169
169
  type ButtonMode = "contained" | "contained-tonal" | "outlined" | "text";
170
+ /**
171
+ * An icon can be a ready element or a render function that receives the
172
+ * resolved icon color and size, so the same icon adapts to every button size.
173
+ */
170
174
  type ButtonIcon = ReactNode | ((props: {
171
175
  color: string;
172
176
  size: number;
173
177
  }) => ReactNode);
178
+ /** Cross-platform accessibility state (a subset shared by web + React Native). */
179
+ interface ButtonAccessibilityState {
180
+ selected?: boolean;
181
+ disabled?: boolean;
182
+ busy?: boolean;
183
+ expanded?: boolean;
184
+ }
174
185
  interface ButtonProps extends Omit<BaseComponentProps<HTMLButtonElement>, "style"> {
175
186
  type?: "button" | "submit" | "reset";
176
187
  icon?: ButtonIcon;
188
+ /** Which side of the label the icon (and loading spinner) sits on. */
189
+ iconPosition?: "leading" | "trailing";
177
190
  text?: string;
178
191
  children?: ReactNode;
179
192
  loading?: boolean;
180
193
  disabled?: boolean;
181
194
  block?: boolean;
182
195
  compact?: boolean;
196
+ /** Web-only pointer glow. Native accepts and ignores it to keep one contract. */
183
197
  glow?: boolean;
184
198
  mode?: ButtonMode;
185
199
  contentClassName?: string;
@@ -190,7 +204,7 @@ interface ButtonProps extends Omit<BaseComponentProps<HTMLButtonElement>, "style
190
204
  size?: Size;
191
205
  accessibilityLabel?: string;
192
206
  accessibilityRole?: string;
193
- accessibilityState?: unknown;
207
+ accessibilityState?: ButtonAccessibilityState;
194
208
  testID?: string;
195
209
  onPress?: () => void;
196
210
  }
@@ -404,12 +418,12 @@ interface EUIConfigs {
404
418
 
405
419
  interface EUIContextValue {
406
420
  config: EUIConfigs;
407
- setConfig: React__default.Dispatch<React__default.SetStateAction<EUIConfigs>>;
421
+ setConfig: react__default.Dispatch<react__default.SetStateAction<EUIConfigs>>;
408
422
  }
409
423
  declare const EUIProvider: ({ config, children, }: {
410
424
  config: EUIConfigs;
411
- children: React__default.ReactNode;
412
- }) => React__default.JSX.Element;
425
+ children: react__default.ReactNode;
426
+ }) => react__default.JSX.Element;
413
427
  declare const useEUIConfig: () => EUIContextValue;
414
428
 
415
429
  declare function resolveWithGlobal<T>(config: EUIConfigs | null, props: T, defaults: Partial<T>): T;
@@ -1,4 +1,4 @@
1
- import React__default, { HTMLAttributes, ReactNode } from 'react';
1
+ import react__default, { HTMLAttributes, ReactNode } from 'react';
2
2
  import { FieldHookConfig, FormikValues, FormikConfig, FormikProps, FormikHelpers } from 'formik';
3
3
 
4
4
  declare const CURRENCIES: {
@@ -167,19 +167,33 @@ interface BaseComponentProps<T extends HTMLElement = HTMLDivElement> extends Omi
167
167
  }
168
168
 
169
169
  type ButtonMode = "contained" | "contained-tonal" | "outlined" | "text";
170
+ /**
171
+ * An icon can be a ready element or a render function that receives the
172
+ * resolved icon color and size, so the same icon adapts to every button size.
173
+ */
170
174
  type ButtonIcon = ReactNode | ((props: {
171
175
  color: string;
172
176
  size: number;
173
177
  }) => ReactNode);
178
+ /** Cross-platform accessibility state (a subset shared by web + React Native). */
179
+ interface ButtonAccessibilityState {
180
+ selected?: boolean;
181
+ disabled?: boolean;
182
+ busy?: boolean;
183
+ expanded?: boolean;
184
+ }
174
185
  interface ButtonProps extends Omit<BaseComponentProps<HTMLButtonElement>, "style"> {
175
186
  type?: "button" | "submit" | "reset";
176
187
  icon?: ButtonIcon;
188
+ /** Which side of the label the icon (and loading spinner) sits on. */
189
+ iconPosition?: "leading" | "trailing";
177
190
  text?: string;
178
191
  children?: ReactNode;
179
192
  loading?: boolean;
180
193
  disabled?: boolean;
181
194
  block?: boolean;
182
195
  compact?: boolean;
196
+ /** Web-only pointer glow. Native accepts and ignores it to keep one contract. */
183
197
  glow?: boolean;
184
198
  mode?: ButtonMode;
185
199
  contentClassName?: string;
@@ -190,7 +204,7 @@ interface ButtonProps extends Omit<BaseComponentProps<HTMLButtonElement>, "style
190
204
  size?: Size;
191
205
  accessibilityLabel?: string;
192
206
  accessibilityRole?: string;
193
- accessibilityState?: unknown;
207
+ accessibilityState?: ButtonAccessibilityState;
194
208
  testID?: string;
195
209
  onPress?: () => void;
196
210
  }
@@ -404,12 +418,12 @@ interface EUIConfigs {
404
418
 
405
419
  interface EUIContextValue {
406
420
  config: EUIConfigs;
407
- setConfig: React__default.Dispatch<React__default.SetStateAction<EUIConfigs>>;
421
+ setConfig: react__default.Dispatch<react__default.SetStateAction<EUIConfigs>>;
408
422
  }
409
423
  declare const EUIProvider: ({ config, children, }: {
410
424
  config: EUIConfigs;
411
- children: React__default.ReactNode;
412
- }) => React__default.JSX.Element;
425
+ children: react__default.ReactNode;
426
+ }) => react__default.JSX.Element;
413
427
  declare const useEUIConfig: () => EUIContextValue;
414
428
 
415
429
  declare function resolveWithGlobal<T>(config: EUIConfigs | null, props: T, defaults: Partial<T>): T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elseware-ui",
3
- "version": "3.0.12",
3
+ "version": "3.0.14",
4
4
  "private": false,
5
5
  "description": "A modern and customizable React UI component library by elseware Technology.",
6
6
  "keywords": [
@@ -1,116 +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
- };
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
+ };