@driveflux/ui 1.0.3 → 1.0.5
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/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +16 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/modal/ModalProvider.js +1 -0
- package/dist/cjs/theme/colors.js +7 -0
- package/dist/cjs/translations.js +1 -0
- package/dist/cjs/utils/react.js +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/modal/ModalProvider.d.ts.map +1 -1
- package/dist/modal/ModalProvider.js +1 -0
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/colors.js +7 -0
- package/dist/translations.d.ts.map +1 -1
- package/dist/translations.js +1 -0
- package/dist/utils/react.d.ts.map +1 -1
- package/dist/utils/react.js +5 -2
- package/package.json +5 -5
- package/src/index.ts +1 -0
- package/src/modal/ModalProvider.tsx +7 -6
- package/src/theme/colors.ts +8 -0
- package/src/translations.ts +1 -0
- package/src/utils/react.ts +3 -0
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
> @driveflux/ui@1.0.
|
|
2
|
+
> @driveflux/ui@1.0.5 build /Users/flux/Projects/flux/shared/ui
|
|
3
3
|
> fab
|
|
4
4
|
|
|
5
|
-
Successfully compiled: 19 files with swc (
|
|
6
|
-
Successfully compiled: 19 files with swc (
|
|
5
|
+
Successfully compiled: 19 files with swc (173.15ms)
|
|
6
|
+
Successfully compiled: 19 files with swc (176.06ms)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @driveflux/ui
|
|
2
2
|
|
|
3
|
+
## 1.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Version upgrade
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @driveflux/icons@1.0.4
|
|
10
|
+
|
|
11
|
+
## 1.0.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Reverted SWC core version
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @driveflux/icons@1.0.3
|
|
18
|
+
|
|
3
19
|
## 1.0.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
package/dist/cjs/theme/colors.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// TODO sync this with the one in dump
|
|
2
|
+
// remove dump file version
|
|
3
|
+
// update all instances using colors
|
|
1
4
|
"use strict";
|
|
2
5
|
Object.defineProperty(exports, "__esModule", {
|
|
3
6
|
value: true
|
|
@@ -76,6 +79,7 @@ var colors = {
|
|
|
76
79
|
800: "#000000",
|
|
77
80
|
900: "#000000"
|
|
78
81
|
},
|
|
82
|
+
// TODO add 25
|
|
79
83
|
success: {
|
|
80
84
|
50: "#d8f7f2",
|
|
81
85
|
100: "#98e6d6",
|
|
@@ -88,6 +92,7 @@ var colors = {
|
|
|
88
92
|
800: "#00724d",
|
|
89
93
|
900: "#005530"
|
|
90
94
|
},
|
|
95
|
+
// TODO add 25
|
|
91
96
|
accent: {
|
|
92
97
|
50: "#fceaee",
|
|
93
98
|
100: "#f8cad3",
|
|
@@ -100,6 +105,7 @@ var colors = {
|
|
|
100
105
|
800: "#b91231",
|
|
101
106
|
900: "#aa0026"
|
|
102
107
|
},
|
|
108
|
+
// TODO add 25
|
|
103
109
|
warning: {
|
|
104
110
|
50: "#FDF0DE",
|
|
105
111
|
100: "#F4B25C",
|
|
@@ -125,6 +131,7 @@ var colors = {
|
|
|
125
131
|
800: "#50C8E8",
|
|
126
132
|
900: "#50C8E8"
|
|
127
133
|
},
|
|
134
|
+
// TODO add 25
|
|
128
135
|
alert: {
|
|
129
136
|
50: "#E24657",
|
|
130
137
|
100: "#E24657",
|
package/dist/cjs/translations.js
CHANGED
package/dist/cjs/utils/react.js
CHANGED
|
@@ -28,15 +28,18 @@ function _instanceof(left, right) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
function isReactComponent(Component) {
|
|
31
|
-
return typeof Component === "function" && //
|
|
31
|
+
return typeof Component === "function" && // TODO
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- React component, it's fine
|
|
32
33
|
(_instanceof(Component.prototype, Component) || Component.displayName !== undefined);
|
|
33
34
|
}
|
|
34
35
|
function isReactElement(element) {
|
|
36
|
+
// TODO
|
|
35
37
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- isValidElement is a validation function
|
|
36
38
|
return (0, _react.isValidElement)(element);
|
|
37
39
|
}
|
|
38
40
|
function isReactNode(node) {
|
|
39
|
-
if (//
|
|
41
|
+
if (// TODO
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- isValidElement is a validation function
|
|
40
43
|
(0, _react.isValidElement)(node) || // Check if it's a React element
|
|
41
44
|
typeof node === "string" || // Check if it's a string
|
|
42
45
|
typeof node === "number" // Check if it's a number
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalProvider.d.ts","sourceRoot":"","sources":["../../src/modal/ModalProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkC,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AA+BvF,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ModalProvider.d.ts","sourceRoot":"","sources":["../../src/modal/ModalProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkC,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AA+BvF,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,CA4GxC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/theme/colors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/theme/colors.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;IACjB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFJ,CAAA"}
|
package/dist/theme/colors.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// TODO sync this with the one in dump
|
|
2
|
+
// remove dump file version
|
|
3
|
+
// update all instances using colors
|
|
1
4
|
export var colors = {
|
|
2
5
|
/**
|
|
3
6
|
* #EFEFF0 Light Gray
|
|
@@ -66,6 +69,7 @@ export var colors = {
|
|
|
66
69
|
800: "#000000",
|
|
67
70
|
900: "#000000"
|
|
68
71
|
},
|
|
72
|
+
// TODO add 25
|
|
69
73
|
success: {
|
|
70
74
|
50: "#d8f7f2",
|
|
71
75
|
100: "#98e6d6",
|
|
@@ -78,6 +82,7 @@ export var colors = {
|
|
|
78
82
|
800: "#00724d",
|
|
79
83
|
900: "#005530"
|
|
80
84
|
},
|
|
85
|
+
// TODO add 25
|
|
81
86
|
accent: {
|
|
82
87
|
50: "#fceaee",
|
|
83
88
|
100: "#f8cad3",
|
|
@@ -90,6 +95,7 @@ export var colors = {
|
|
|
90
95
|
800: "#b91231",
|
|
91
96
|
900: "#aa0026"
|
|
92
97
|
},
|
|
98
|
+
// TODO add 25
|
|
93
99
|
warning: {
|
|
94
100
|
50: "#FDF0DE",
|
|
95
101
|
100: "#F4B25C",
|
|
@@ -115,6 +121,7 @@ export var colors = {
|
|
|
115
121
|
800: "#50C8E8",
|
|
116
122
|
900: "#50C8E8"
|
|
117
123
|
},
|
|
124
|
+
// TODO add 25
|
|
118
125
|
alert: {
|
|
119
126
|
50: "#E24657",
|
|
120
127
|
100: "#E24657",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../src/translations.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG,OAAO,YAAY,CAAA;AAEvC,eAAO,MAAM,YAAY;;;;;;;;;CASxB,CAAA;AAED,eAAO,MAAM,eAAe,OAAQ,QAAQ,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../src/translations.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG,OAAO,YAAY,CAAA;AAEvC,eAAO,MAAM,YAAY;;;;;;;;;CASxB,CAAA;AAED,eAAO,MAAM,eAAe,OAAQ,QAAQ,YAAY,CAAC,SAMxD,CAAA;AAED,eAAO,MAAM,cAAc,6HAAuC,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,SAE1F,CAAA"}
|
package/dist/translations.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/utils/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE7F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS,IAAI,aAAa,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/utils/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE7F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS,IAAI,aAAa,CAAC,GAAG,CAAC,CAOhF;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,YAAY,CAIpE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,SAAS,CAiBxD"}
|
package/dist/utils/react.js
CHANGED
|
@@ -7,15 +7,18 @@ function _instanceof(left, right) {
|
|
|
7
7
|
}
|
|
8
8
|
import { isValidElement } from "react";
|
|
9
9
|
export function isReactComponent(Component) {
|
|
10
|
-
return typeof Component === "function" && //
|
|
10
|
+
return typeof Component === "function" && // TODO
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- React component, it's fine
|
|
11
12
|
(_instanceof(Component.prototype, Component) || Component.displayName !== undefined);
|
|
12
13
|
}
|
|
13
14
|
export function isReactElement(element) {
|
|
15
|
+
// TODO
|
|
14
16
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- isValidElement is a validation function
|
|
15
17
|
return isValidElement(element);
|
|
16
18
|
}
|
|
17
19
|
export function isReactNode(node) {
|
|
18
|
-
if (//
|
|
20
|
+
if (// TODO
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- isValidElement is a validation function
|
|
19
22
|
isValidElement(node) || // Check if it's a React element
|
|
20
23
|
typeof node === "string" || // Check if it's a string
|
|
21
24
|
typeof node === "number" // Check if it's a number
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@chakra-ui/react": "^2.8.2",
|
|
42
|
-
"@driveflux/icons": "1.0.
|
|
42
|
+
"@driveflux/icons": "1.0.4",
|
|
43
43
|
"lodash": "^4.17.21"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@driveflux/eslint-config": "1.0.2",
|
|
52
|
-
"@driveflux/fab": "1.0.
|
|
52
|
+
"@driveflux/fab": "1.0.3",
|
|
53
53
|
"@driveflux/problem": "4.0.2",
|
|
54
|
-
"@driveflux/result": "4.0.
|
|
54
|
+
"@driveflux/result": "4.0.3",
|
|
55
55
|
"@driveflux/tsconfig": "1.0.2",
|
|
56
56
|
"@lingui/macro": "^4.10.0",
|
|
57
57
|
"@swc/cli": "^0.3.12",
|
|
58
|
-
"@swc/core": "
|
|
58
|
+
"@swc/core": "1.3.105",
|
|
59
59
|
"@types/lodash": "^4.17.0",
|
|
60
60
|
"@types/node": "^20.12.7",
|
|
61
61
|
"@types/react": "^18.2.78",
|
package/src/index.ts
CHANGED
|
@@ -18,8 +18,8 @@ const getModalComponent = (modalContentConfig: ModalContentConfig, controls: Mod
|
|
|
18
18
|
return <StandardModalContent controls={controls} modalContentConfig={modalContentConfig} {...otherProps} />
|
|
19
19
|
|
|
20
20
|
}
|
|
21
|
-
case 'minimal':{
|
|
22
|
-
|
|
21
|
+
case 'minimal': {
|
|
22
|
+
return <MinimalModalContent controls={controls} modalContentConfig={modalContentConfig} {...otherProps} />
|
|
23
23
|
}
|
|
24
24
|
case 'custom':
|
|
25
25
|
return isReactNode(modalContentConfig.content) ? modalContentConfig.content : <modalContentConfig.content open={open} close={close} {...otherProps} />
|
|
@@ -59,7 +59,7 @@ const ModalProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
|
59
59
|
newModalContentConfig = modalContentConfigOrOptions.modalContentConfig
|
|
60
60
|
newModalSate = modalContentConfigOrOptions.modalContentConfig.initialModalState
|
|
61
61
|
newModalOptions = modalContentConfigOrOptions
|
|
62
|
-
}
|
|
62
|
+
}
|
|
63
63
|
// we will set the state only when we're passing the modal content config. Maybe the modal
|
|
64
64
|
// was closed with keepModalContentConfig set to true, so we don't want to override the state
|
|
65
65
|
else if (modalContentConfigOrOptions) {
|
|
@@ -71,7 +71,7 @@ const ModalProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
|
71
71
|
setModalContentConfig((oldModalContentConfig) => {
|
|
72
72
|
const modalContentConfig = newModalContentConfig || oldModalContentConfig
|
|
73
73
|
|
|
74
|
-
if(modalContentConfig) {
|
|
74
|
+
if (modalContentConfig) {
|
|
75
75
|
onOpenRaw()
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -91,7 +91,7 @@ const ModalProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
|
91
91
|
if (!oldModalContentConfig) {
|
|
92
92
|
return oldModalContentConfig
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
|
|
95
95
|
return {
|
|
96
96
|
...oldModalContentConfig,
|
|
97
97
|
...updateOptions.modalContentConfig,
|
|
@@ -106,6 +106,7 @@ const ModalProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
|
106
106
|
const state = useMemo((): ModalContextState => {
|
|
107
107
|
return {
|
|
108
108
|
isOpen,
|
|
109
|
+
// TODO
|
|
109
110
|
// @ts-expect-error
|
|
110
111
|
open: onOpen,
|
|
111
112
|
close: onClose,
|
|
@@ -126,7 +127,7 @@ const ModalProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
|
126
127
|
isCentered
|
|
127
128
|
blockScrollOnMount
|
|
128
129
|
closeOnOverlayClick
|
|
129
|
-
size={
|
|
130
|
+
size={modalContentConfig?.size || { base: 'full', md: '3xl' }}
|
|
130
131
|
isOpen={isOpen}
|
|
131
132
|
onClose={onClose}
|
|
132
133
|
>
|
package/src/theme/colors.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// TODO sync this with the one in dump
|
|
2
|
+
// remove dump file version
|
|
3
|
+
// update all instances using colors
|
|
4
|
+
|
|
1
5
|
export const colors = {
|
|
2
6
|
/**
|
|
3
7
|
* #EFEFF0 Light Gray
|
|
@@ -103,6 +107,7 @@ export const colors = {
|
|
|
103
107
|
900: '#000000'
|
|
104
108
|
},
|
|
105
109
|
|
|
110
|
+
// TODO add 25
|
|
106
111
|
success: {
|
|
107
112
|
50: '#d8f7f2',
|
|
108
113
|
100: '#98e6d6',
|
|
@@ -116,6 +121,7 @@ export const colors = {
|
|
|
116
121
|
900: '#005530'
|
|
117
122
|
},
|
|
118
123
|
|
|
124
|
+
// TODO add 25
|
|
119
125
|
accent: {
|
|
120
126
|
50: '#fceaee',
|
|
121
127
|
100: '#f8cad3',
|
|
@@ -129,6 +135,7 @@ export const colors = {
|
|
|
129
135
|
900: '#aa0026'
|
|
130
136
|
},
|
|
131
137
|
|
|
138
|
+
// TODO add 25
|
|
132
139
|
warning: {
|
|
133
140
|
50: '#FDF0DE',
|
|
134
141
|
100: '#F4B25C',
|
|
@@ -156,6 +163,7 @@ export const colors = {
|
|
|
156
163
|
900: '#50C8E8'
|
|
157
164
|
},
|
|
158
165
|
|
|
166
|
+
// TODO add 25
|
|
159
167
|
alert: {
|
|
160
168
|
50: '#E24657',
|
|
161
169
|
100: '#E24657',
|
package/src/translations.ts
CHANGED
package/src/utils/react.ts
CHANGED
|
@@ -3,18 +3,21 @@ import { isValidElement, type ComponentType, type ReactElement, type ReactNode }
|
|
|
3
3
|
export function isReactComponent(Component: any): Component is ComponentType<any> {
|
|
4
4
|
return (
|
|
5
5
|
typeof Component === 'function' &&
|
|
6
|
+
// TODO
|
|
6
7
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- React component, it's fine
|
|
7
8
|
(Component.prototype instanceof Component || Component.displayName !== undefined)
|
|
8
9
|
)
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export function isReactElement(element: any): element is ReactElement {
|
|
13
|
+
// TODO
|
|
12
14
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- isValidElement is a validation function
|
|
13
15
|
return isValidElement(element)
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export function isReactNode(node: any): node is ReactNode {
|
|
17
19
|
if (
|
|
20
|
+
// TODO
|
|
18
21
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- isValidElement is a validation function
|
|
19
22
|
isValidElement(node) || // Check if it's a React element
|
|
20
23
|
typeof node === 'string' || // Check if it's a string
|