@colisweb/rescript-toolkit 2.2.0 → 2.4.1
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/.gitlab-ci.yml +4 -4
- package/package.json +27 -28
- package/postcss.config.js +0 -1
- package/src/router/Toolkit__Router.res +13 -1
- package/src/tailwind/tailwind.config.js +2 -73
- package/src/ui/Toolkit__Ui_Layout.res +14 -8
- package/src/ui/Toolkit__Ui_Table.res +3 -2
- package/src/ui/styles.css +3 -2
package/.gitlab-ci.yml
CHANGED
|
@@ -4,12 +4,12 @@ include:
|
|
|
4
4
|
# -----------------------------------------------
|
|
5
5
|
# Test
|
|
6
6
|
# -----------------------------------------------
|
|
7
|
-
|
|
7
|
+
rescript compilation:
|
|
8
8
|
tags:
|
|
9
9
|
- aws
|
|
10
10
|
extends: .rules-except-for-tags
|
|
11
11
|
stage: test
|
|
12
|
-
image: node:lts-
|
|
12
|
+
image: node:lts-bullseye
|
|
13
13
|
cache:
|
|
14
14
|
key: "yarn-$CI_COMMIT_REF_SLUG"
|
|
15
15
|
paths:
|
|
@@ -29,7 +29,7 @@ version:
|
|
|
29
29
|
# Publish npm
|
|
30
30
|
# -----------------------------------------------
|
|
31
31
|
publish rescript-toolkit:
|
|
32
|
-
image: node:lts-
|
|
32
|
+
image: node:lts-bullseye
|
|
33
33
|
extends: .rules-only-for-tags
|
|
34
34
|
tags:
|
|
35
35
|
- aws
|
|
@@ -49,7 +49,7 @@ pages:
|
|
|
49
49
|
tags:
|
|
50
50
|
- aws
|
|
51
51
|
stage: deploy
|
|
52
|
-
image: node:lts-
|
|
52
|
+
image: node:lts-bullseye
|
|
53
53
|
script:
|
|
54
54
|
- export NPM_TOKEN=${NPM_TOKEN:-undefined}
|
|
55
55
|
- yarn
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colisweb/rescript-toolkit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"clean": "rescript clean",
|
|
6
6
|
"build": "rescript build",
|
|
7
7
|
"watch": "rescript build -w",
|
|
8
8
|
"dev": "rescript build -w",
|
|
9
|
-
"test": "rescript build",
|
|
9
|
+
"test": "rescript build -with-deps",
|
|
10
10
|
"build:reacticons": "node tools/extract-react-icons.js",
|
|
11
11
|
"build:datetimeinput": "node tools/build-datepicker-style.js",
|
|
12
12
|
"storybook": "STORYBOOK=true start-storybook -p 6006 --no-manager-cache",
|
|
@@ -24,20 +24,20 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@colisweb/react-day-picker": "7.4.16",
|
|
26
26
|
"@reach/accordion": "0.16.1",
|
|
27
|
-
"@reach/alert-dialog": "0.16.
|
|
27
|
+
"@reach/alert-dialog": "0.16.2",
|
|
28
28
|
"@reach/auto-id": "0.16.0",
|
|
29
|
-
"@reach/combobox": "0.16.
|
|
30
|
-
"@reach/dialog": "0.16.
|
|
31
|
-
"@reach/disclosure": "0.16.
|
|
32
|
-
"@reach/listbox": "0.16.
|
|
33
|
-
"@reach/menu-button": "0.16.
|
|
34
|
-
"@reach/popover": "0.16.
|
|
35
|
-
"@reach/portal": "0.16.
|
|
36
|
-
"@reach/tabs": "0.16.
|
|
37
|
-
"@reach/tooltip": "0.16.
|
|
29
|
+
"@reach/combobox": "0.16.5",
|
|
30
|
+
"@reach/dialog": "0.16.2",
|
|
31
|
+
"@reach/disclosure": "0.16.2",
|
|
32
|
+
"@reach/listbox": "0.16.2",
|
|
33
|
+
"@reach/menu-button": "0.16.2",
|
|
34
|
+
"@reach/popover": "0.16.2",
|
|
35
|
+
"@reach/portal": "0.16.2",
|
|
36
|
+
"@reach/tabs": "0.16.4",
|
|
37
|
+
"@reach/tooltip": "0.16.2",
|
|
38
38
|
"@reach/visually-hidden": "0.16.0",
|
|
39
39
|
"@rescript/react": "0.10.3",
|
|
40
|
-
"autoprefixer": "10.
|
|
40
|
+
"autoprefixer": "10.4.0",
|
|
41
41
|
"axios": "0.24.0",
|
|
42
42
|
"bs-axios": "0.0.43",
|
|
43
43
|
"bs-css": "13.4.0",
|
|
@@ -45,36 +45,35 @@
|
|
|
45
45
|
"case": "1.6.3",
|
|
46
46
|
"click-outside-hook": "1.1.0",
|
|
47
47
|
"copy-to-clipboard": "3.3.1",
|
|
48
|
-
"date-fns": "2.
|
|
48
|
+
"date-fns": "2.27.0",
|
|
49
49
|
"decco": "1.5.0",
|
|
50
50
|
"dedent": "0.7.0",
|
|
51
51
|
"downshift": "5.2.5",
|
|
52
|
-
"highlight.js": "10.7.2",
|
|
53
52
|
"lenses-ppx": "6.1.10",
|
|
54
53
|
"list-selectors": "2.0.0",
|
|
55
|
-
"postcss": "8.
|
|
54
|
+
"postcss": "8.4.5",
|
|
56
55
|
"postcss-loader": "4.2.0",
|
|
57
56
|
"postcss-preset-env": "6.7.0",
|
|
58
|
-
"prismjs": "1.
|
|
59
|
-
"react-datepicker": "3.8.0",
|
|
57
|
+
"prismjs": "1.25.0",
|
|
60
58
|
"react-icons": "4.3.1",
|
|
61
|
-
"react-select": "
|
|
59
|
+
"react-select": "5.2.1",
|
|
62
60
|
"react-table": "7.7.0",
|
|
63
61
|
"react-use": "17.3.1",
|
|
64
|
-
"reason-promise": "1.1.
|
|
62
|
+
"reason-promise": "1.1.5",
|
|
65
63
|
"reason-react": "0.9.1",
|
|
66
64
|
"reschema": "1.3.1",
|
|
67
65
|
"rescript": "9.1.4",
|
|
68
66
|
"rescript-classnames": "6.0.0",
|
|
69
|
-
"rescript-logger": "2.0.
|
|
70
|
-
"rescript-react-update": "
|
|
67
|
+
"rescript-logger": "2.0.2",
|
|
68
|
+
"rescript-react-update": "5.0.0",
|
|
71
69
|
"restorative": "0.4.0-beta.1",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
70
|
+
"swr": "1.1.1",
|
|
71
|
+
"tailwindcss": "3.0.2",
|
|
72
|
+
"react-datepicker": "3.8.0"
|
|
75
73
|
},
|
|
76
74
|
"devDependencies": {
|
|
77
|
-
"
|
|
75
|
+
"highlight.js": "11.3.1",
|
|
76
|
+
"@babel/core": "7.16.5",
|
|
78
77
|
"@storybook/addon-actions": "6.1.21",
|
|
79
78
|
"@storybook/addon-essentials": "6.1.21",
|
|
80
79
|
"@storybook/addon-knobs": "6.1.21",
|
|
@@ -82,11 +81,11 @@
|
|
|
82
81
|
"@storybook/addons": "6.1.21",
|
|
83
82
|
"@storybook/react": "6.1.21",
|
|
84
83
|
"@storybook/theming": "6.1.21",
|
|
85
|
-
"babel-loader": "8.2.
|
|
84
|
+
"babel-loader": "8.2.3",
|
|
86
85
|
"raw-loader": "4.0.2",
|
|
87
86
|
"react": "17.0.2",
|
|
88
87
|
"react-dom": "17.0.2",
|
|
89
88
|
"react-is": "17.0.2",
|
|
90
|
-
"sass": "1.
|
|
89
|
+
"sass": "1.45.0"
|
|
91
90
|
}
|
|
92
91
|
}
|
package/postcss.config.js
CHANGED
|
@@ -228,6 +228,7 @@ module Make = (Config: RouterConfig) => {
|
|
|
228
228
|
~links: array<link>,
|
|
229
229
|
~isNavOpen: bool,
|
|
230
230
|
~onLinkClick=() => (),
|
|
231
|
+
~openMenu,
|
|
231
232
|
) => {
|
|
232
233
|
let (isOpen, setIsOpen) = React.useState(() => false)
|
|
233
234
|
|
|
@@ -241,7 +242,12 @@ module Make = (Config: RouterConfig) => {
|
|
|
241
242
|
}, [isNavOpen])
|
|
242
243
|
|
|
243
244
|
<>
|
|
244
|
-
<button
|
|
245
|
+
<button
|
|
246
|
+
onClick={_ => {
|
|
247
|
+
openMenu()
|
|
248
|
+
toggle()
|
|
249
|
+
}}
|
|
250
|
+
className={cx([commonClassName, "flex items-center w-full sidenav-link"])}>
|
|
245
251
|
<span className={cx(["mr-2 text-neutral-800", isNavOpen ? "pl-2" : "px-2"])}>
|
|
246
252
|
groupInfo.icon
|
|
247
253
|
</span>
|
|
@@ -261,6 +267,12 @@ module Make = (Config: RouterConfig) => {
|
|
|
261
267
|
])}
|
|
262
268
|
/>
|
|
263
269
|
</span>
|
|
270
|
+
{isNavOpen
|
|
271
|
+
? React.null
|
|
272
|
+
: <div
|
|
273
|
+
className="sidenav-link-tooltip absolute left-0 p-2 bg-neutral-700 text-white rounded transform top-1/2 -translate-y-1/2 transition-all duration-200 ease-in-out opacity-0 invisible ml-16 whitespace-nowrap">
|
|
274
|
+
groupInfo.label
|
|
275
|
+
</div>}
|
|
264
276
|
</button>
|
|
265
277
|
<div
|
|
266
278
|
className={cx([
|
|
@@ -1,55 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
const plugin = require("tailwindcss/plugin");
|
|
3
|
-
|
|
4
|
-
const flexGapPlugin = plugin(({ addUtilities, theme, variants }) => {
|
|
5
|
-
const newUtilities = Object.keys(theme("spacing")).reduce(
|
|
6
|
-
(acc, key) => ({
|
|
7
|
-
...acc,
|
|
8
|
-
[`.flex-gap-${key}`]: {
|
|
9
|
-
marginBottom: "-" + theme(`spacing.${key}`),
|
|
10
|
-
marginLeft: "-" + theme(`spacing.${key}`),
|
|
11
|
-
[` > *`]: {
|
|
12
|
-
paddingBottom: theme(`spacing.${key}`),
|
|
13
|
-
paddingLeft: theme(`spacing.${key}`),
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
[`.flex-col-gap-${key}`]: {
|
|
17
|
-
marginLeft: "-" + theme(`spacing.${key}`),
|
|
18
|
-
[` > *`]: {
|
|
19
|
-
paddingLeft: theme(`spacing.${key}`),
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
[`.flex-row-gap-${key}`]: {
|
|
23
|
-
marginBottom: "-" + theme(`spacing.${key}`),
|
|
24
|
-
[` > *`]: {
|
|
25
|
-
paddingBottom: theme(`spacing.${key}`),
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
}),
|
|
29
|
-
{}
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
addUtilities(newUtilities, variants("flexGap"));
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const boxShadowColorPlugin = plugin(({ addUtilities, theme, variants }) => {
|
|
36
|
-
const newUtilities = Object.keys(theme("colors")).reduce(
|
|
37
|
-
(acc, key) =>
|
|
38
|
-
theme("colors")[key][500]
|
|
39
|
-
? {
|
|
40
|
-
...acc,
|
|
41
|
-
[`.shadow-${key}-500`]: {
|
|
42
|
-
boxShadow: `${theme("colors")[key][500]} 0px 0px 0px 1px;`,
|
|
43
|
-
},
|
|
44
|
-
}
|
|
45
|
-
: acc,
|
|
46
|
-
{}
|
|
47
|
-
);
|
|
48
|
-
addUtilities(newUtilities, variants("boxShadowColor"));
|
|
49
|
-
});
|
|
1
|
+
const defaultColors = require("tailwindcss/colors");
|
|
50
2
|
|
|
51
3
|
module.exports = {
|
|
52
|
-
mode: "jit",
|
|
53
4
|
theme: {
|
|
54
5
|
extend: {
|
|
55
6
|
screens: {
|
|
@@ -189,29 +140,7 @@ module.exports = {
|
|
|
189
140
|
},
|
|
190
141
|
},
|
|
191
142
|
},
|
|
192
|
-
|
|
193
|
-
variants: {
|
|
194
|
-
textColor: ["responsive", "hover", "focus", "disabled"],
|
|
195
|
-
backgroundColor: [
|
|
196
|
-
"responsive",
|
|
197
|
-
"hover",
|
|
198
|
-
"focus",
|
|
199
|
-
"disabled",
|
|
200
|
-
"active",
|
|
201
|
-
"even",
|
|
202
|
-
],
|
|
203
|
-
margin: ["responsive", "last"],
|
|
204
|
-
padding: ["responsive", "last"],
|
|
205
|
-
borderWidth: ["responsive", "last"],
|
|
206
|
-
zIndex: ["responsive", "focus"],
|
|
207
|
-
width: ["responsive", "hover"],
|
|
208
|
-
overflow: ["responsive", "hover"],
|
|
209
|
-
/* Custom */
|
|
210
|
-
flexGap: ["responsive"],
|
|
211
|
-
boxShadowColor: ["responsive", "hover", "focus"],
|
|
212
|
-
},
|
|
213
|
-
plugins: [flexGapPlugin, boxShadowColorPlugin],
|
|
214
|
-
purge: [
|
|
143
|
+
content: [
|
|
215
144
|
"public/index.html",
|
|
216
145
|
"lib/es6_global/src/**/**.js",
|
|
217
146
|
"src/**/**.js",
|
|
@@ -84,10 +84,17 @@ module App = {
|
|
|
84
84
|
type sideNavRender = {
|
|
85
85
|
onLinkClick: unit => unit,
|
|
86
86
|
isNavOpen: bool,
|
|
87
|
+
openMenu: unit => unit,
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
@react.component
|
|
90
|
-
let make = (
|
|
91
|
+
let make = (
|
|
92
|
+
~isNavOpen,
|
|
93
|
+
~bottom=?,
|
|
94
|
+
~hideMenu,
|
|
95
|
+
~children: sideNavRender => React.element,
|
|
96
|
+
~openMenu,
|
|
97
|
+
) => {
|
|
91
98
|
let {isLg} = Toolkit__Hooks.useMediaQuery()
|
|
92
99
|
|
|
93
100
|
let onLinkClick = () => isLg ? () : hideMenu()
|
|
@@ -99,17 +106,13 @@ module App = {
|
|
|
99
106
|
"lg:flex border-r px-2 py-3 fixed flex-col bg-white justify-between transition-all duration-300 ease-in-out z-40",
|
|
100
107
|
isNavOpen ? "w-64 overflow-y-auto" : "w-16 hidden sidenav--closed",
|
|
101
108
|
])}>
|
|
102
|
-
{children({onLinkClick: onLinkClick, isNavOpen: isNavOpen})}
|
|
109
|
+
{children({onLinkClick: onLinkClick, isNavOpen: isNavOpen, openMenu: openMenu})}
|
|
103
110
|
{bottom->Option.mapWithDefault(React.null, content =>
|
|
104
111
|
<div className={!isNavOpen ? "overflow-hidden" : ""}>
|
|
105
112
|
<div
|
|
106
113
|
className={cx([
|
|
107
|
-
"flex flex-col justify-end transition-all duration-300 ease-in-out",
|
|
114
|
+
"flex flex-col justify-end transition-all duration-300 ease-in-out w-[14.75rem]",
|
|
108
115
|
isNavOpen ? "opacity-100" : "opacity-0",
|
|
109
|
-
{
|
|
110
|
-
open Css
|
|
111
|
-
style(list{width(14.75->rem)})
|
|
112
|
-
},
|
|
113
116
|
])}>
|
|
114
117
|
content
|
|
115
118
|
</div>
|
|
@@ -161,12 +164,15 @@ module App = {
|
|
|
161
164
|
)
|
|
162
165
|
|
|
163
166
|
let hideMenu = React.useCallback(_ => setOpen(_ => false))
|
|
167
|
+
let openMenu = React.useCallback(_ => setOpen(_ => true))
|
|
164
168
|
|
|
165
169
|
<NavOpenContext.Provider value={isNavOpen}>
|
|
166
170
|
<div>
|
|
167
171
|
<TopNavigationBar username logout logoutLabel toggleMenu onLogoClick />
|
|
168
172
|
<div className="flex">
|
|
169
|
-
<LeftNavigationBar isNavOpen ?bottom hideMenu
|
|
173
|
+
<LeftNavigationBar isNavOpen ?bottom hideMenu openMenu>
|
|
174
|
+
{sideNavRender}
|
|
175
|
+
</LeftNavigationBar>
|
|
170
176
|
<main
|
|
171
177
|
className={cx([
|
|
172
178
|
className,
|
|
@@ -60,7 +60,8 @@ module Core = {
|
|
|
60
60
|
className="px-2 pt-2 border-b border-r border-gray-300 h-20"
|
|
61
61
|
key={"thead-thd" ++ index->Int.toString}>
|
|
62
62
|
<Toolkit__Ui_Spread props={column.getSortByToggleProps()}>
|
|
63
|
-
<
|
|
63
|
+
<div
|
|
64
|
+
className="font-semibold text-sm mb-1 text-primary-800 pr-2 relative">
|
|
64
65
|
{column.render("header", ())}
|
|
65
66
|
{column.isSorted
|
|
66
67
|
? column.isSortedDesc->Option.mapWithDefault(React.null, v =>
|
|
@@ -71,7 +72,7 @@ module Core = {
|
|
|
71
72
|
</span>
|
|
72
73
|
)
|
|
73
74
|
: React.null}
|
|
74
|
-
</
|
|
75
|
+
</div>
|
|
75
76
|
</Toolkit__Ui_Spread>
|
|
76
77
|
<Toolkit__Ui_Spread props={column.getResizerProps()}>
|
|
77
78
|
<div className={"resizer" ++ (column.isResizing ? " isResizing" : "")} />
|
package/src/ui/styles.css
CHANGED
|
@@ -225,10 +225,11 @@ iframe:not([tabindex="-1"]):focus,
|
|
|
225
225
|
|
|
226
226
|
.cw-Tabs [data-selected] {
|
|
227
227
|
background: linear-gradient(270deg, #11a3b6 0%, #27d0dc 100%);
|
|
228
|
-
|
|
228
|
+
color: white;
|
|
229
229
|
}
|
|
230
230
|
.cw-Tabs [data-selected]:hover {
|
|
231
|
-
|
|
231
|
+
color: white;
|
|
232
|
+
@apply bg-primary-500;
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
.cw-Tabs [data-reach-tab] {
|