@colisweb/rescript-toolkit 2.70.1 → 2.71.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/.yarn/cache/@csstools-cascade-layer-name-parser-npm-1.0.1-3c03e04847-ca85af36ab.zip +0 -0
- package/.yarn/cache/@csstools-css-parser-algorithms-npm-2.0.1-d93fd57f45-9f168cfc8f.zip +0 -0
- package/.yarn/cache/@csstools-css-tokenizer-npm-2.0.1-844d89aa1a-b52ac9fc19.zip +0 -0
- package/.yarn/cache/@csstools-media-query-list-parser-npm-2.0.1-6d8da9a941-f30b2a9e1a.zip +0 -0
- package/.yarn/cache/@csstools-postcss-cascade-layers-npm-3.0.1-fcae0e8d19-da39631e23.zip +0 -0
- package/.yarn/cache/@csstools-postcss-color-function-npm-2.0.1-34522e4c49-0e6ce71636.zip +0 -0
- package/.yarn/cache/@csstools-postcss-font-format-keywords-npm-2.0.1-f30ce2e0ea-b9e2fc83e2.zip +0 -0
- package/.yarn/cache/@csstools-postcss-hwb-function-npm-2.0.1-0a198205ed-8134c45bb9.zip +0 -0
- package/.yarn/cache/@csstools-postcss-ic-unit-npm-2.0.1-af9dff83ea-18a239451a.zip +0 -0
- package/.yarn/cache/@csstools-postcss-is-pseudo-class-npm-3.0.1-eee09c2887-c736b35cfd.zip +0 -0
- package/.yarn/cache/@csstools-postcss-logical-float-and-clear-npm-1.0.1-bcc4cd5492-5184cd62a6.zip +0 -0
- package/.yarn/cache/@csstools-postcss-logical-resize-npm-1.0.1-f2df14ea6f-b19f340d19.zip +0 -0
- package/.yarn/cache/@csstools-postcss-logical-viewport-units-npm-1.0.2-ffddbc4f90-8780dd03c1.zip +0 -0
- package/.yarn/cache/@csstools-postcss-media-queries-aspect-ratio-number-values-npm-1.0.1-c7c2022b49-cbcf01db72.zip +0 -0
- package/.yarn/cache/@csstools-postcss-nested-calc-npm-2.0.1-6a7c107213-0ab4774879.zip +0 -0
- package/.yarn/cache/@csstools-postcss-normalize-display-values-npm-2.0.1-6e35aa6dbe-d67779977b.zip +0 -0
- package/.yarn/cache/@csstools-postcss-oklab-function-npm-2.0.1-905b1f47ea-78a677492e.zip +0 -0
- package/.yarn/cache/@csstools-postcss-progressive-custom-properties-npm-2.0.1-dbdcdfdf80-4d0d8df31a.zip +0 -0
- package/.yarn/cache/@csstools-postcss-scope-pseudo-class-npm-2.0.1-edf946c1fb-e53d520130.zip +0 -0
- package/.yarn/cache/@csstools-postcss-stepped-value-functions-npm-2.0.1-fedf469bf1-907f9a30b9.zip +0 -0
- package/.yarn/cache/@csstools-postcss-text-decoration-shorthand-npm-2.1.0-17a49e6bd6-760f821ee3.zip +0 -0
- package/.yarn/cache/@csstools-postcss-trigonometric-functions-npm-2.0.1-0a04a18052-b2b7aa8d59.zip +0 -0
- package/.yarn/cache/@csstools-postcss-unset-value-npm-2.0.1-b5b03d712f-51fe220dad.zip +0 -0
- package/.yarn/cache/@csstools-selector-specificity-npm-2.1.1-1d0a01f035-392ab62732.zip +0 -0
- package/.yarn/cache/@originjs-vite-plugin-commonjs-npm-1.0.3-75b36e7757-e4cd22a73e.zip +0 -0
- package/.yarn/cache/css-blank-pseudo-npm-5.0.1-b30f0dbdbd-d5e94c4bc4.zip +0 -0
- package/.yarn/cache/css-has-pseudo-npm-5.0.1-1e21124076-6674393fe7.zip +0 -0
- package/.yarn/cache/css-prefers-color-scheme-npm-8.0.1-66ab97dc9a-766ff644d4.zip +0 -0
- package/.yarn/cache/cssdb-npm-7.4.1-8827244a56-c58803ce3e.zip +0 -0
- package/.yarn/cache/esbuild-linux-64-npm-0.14.54-2cb8070ade-8.zip +0 -0
- package/.yarn/cache/esbuild-npm-0.14.54-b3dcd8a41e-49e360b118.zip +0 -0
- package/.yarn/cache/postcss-attribute-case-insensitive-npm-6.0.1-53cf4e827e-1feb61c031.zip +0 -0
- package/.yarn/cache/postcss-color-functional-notation-npm-5.0.1-3124cba045-1525779b2d.zip +0 -0
- package/.yarn/cache/postcss-color-hex-alpha-npm-9.0.1-4de0057ece-3f35134833.zip +0 -0
- package/.yarn/cache/postcss-color-rebeccapurple-npm-8.0.1-60be592329-ea141bf9ca.zip +0 -0
- package/.yarn/cache/postcss-custom-media-npm-9.1.1-1a3a67cb63-3694c53423.zip +0 -0
- package/.yarn/cache/postcss-custom-properties-npm-13.1.1-31267ed000-21af14e82a.zip +0 -0
- package/.yarn/cache/postcss-custom-selectors-npm-7.1.1-74894a31ad-df79db6237.zip +0 -0
- package/.yarn/cache/postcss-dir-pseudo-class-npm-7.0.1-76e71e42f9-4d1c204e13.zip +0 -0
- package/.yarn/cache/postcss-double-position-gradients-npm-4.0.1-53c9bf55aa-8f17f35082.zip +0 -0
- package/.yarn/cache/postcss-focus-visible-npm-8.0.1-7126799e89-6d6734ba0a.zip +0 -0
- package/.yarn/cache/postcss-focus-within-npm-7.0.1-0434464641-c110a45427.zip +0 -0
- package/.yarn/cache/postcss-gap-properties-npm-4.0.1-2b5cdc5f7e-21a5d5525d.zip +0 -0
- package/.yarn/cache/postcss-image-set-function-npm-5.0.1-f7dd97337c-bd55be8ee1.zip +0 -0
- package/.yarn/cache/postcss-lab-function-npm-5.0.1-7c27612597-bdca34254b.zip +0 -0
- package/.yarn/cache/postcss-logical-npm-6.0.1-3465206299-cb1812fb55.zip +0 -0
- package/.yarn/cache/postcss-nesting-npm-11.1.0-29caff6110-639392ca69.zip +0 -0
- package/.yarn/cache/postcss-opacity-percentage-npm-1.1.3-552e884ed7-54d1b8ca68.zip +0 -0
- package/.yarn/cache/postcss-overflow-shorthand-npm-4.0.1-ca060456c3-f0efcea4fb.zip +0 -0
- package/.yarn/cache/postcss-place-npm-8.0.1-b45b2668b9-c812c858aa.zip +0 -0
- package/.yarn/cache/postcss-preset-env-npm-8.0.1-a400fc01d4-18326a03dd.zip +0 -0
- package/.yarn/cache/postcss-pseudo-class-any-link-npm-8.0.1-c80df879bb-f84b0fe4c0.zip +0 -0
- package/.yarn/cache/postcss-selector-not-npm-7.0.1-8f1507853b-4dec95f785.zip +0 -0
- package/.yarn/install-state.gz +0 -0
- package/package.json +3 -2
- package/playground/PlaygroundApp.res +45 -9
- package/playground/PlaygroundComponents.res +16 -0
- package/playground/PlaygroundHooks.res +111 -0
- package/playground/PlaygroundRouter.res +19 -0
- package/playground/components/Playground_Accordion.res +2 -2
- package/playground/components/Playground_Button.res +16 -0
- package/playground/components/Playground_Checkbox.res +60 -0
- package/playground/components/Playground_Combobox.res +38 -0
- package/playground/components/Playground_DropdownList.res +40 -0
- package/playground/{stories/Toolkit__UI_FormStory.res → components/Playground_Form.res} +58 -33
- package/playground/components/Playground_IconButton.res +65 -0
- package/playground/components/Playground_MultiSelect.res +1 -1
- package/playground/components/Playground_ProgressBar.res +33 -0
- package/playground/components/Playground_Radio.res +23 -0
- package/playground/components/Playground_Reference.res +16 -0
- package/playground/components/Playground_RichText.res +22 -0
- package/playground/components/Playground_Select.res +86 -0
- package/playground/components/Playground_Table.res +45 -0
- package/playground/components/Playground_Tabs.res +53 -0
- package/playground/components/Playground_Tag.res +52 -0
- package/playground/components/Playground_TextInput.res +23 -0
- package/playground/components/Playground_Tooltip.res +90 -0
- package/playground/design/DesignSystem_Colors.mdx +0 -2
- package/playground/design/DesignSystem_Fonts.mdx +0 -2
- package/playground/design/DesignSystem_MediaQueries.mdx +0 -2
- package/playground/design/TailwindConfigBreakpoints.jsx +1 -1
- package/playground/design/TailwindConfigColorsPreview.jsx +2 -2
- package/playground/design/TailwindConfigFontsPreview.jsx +1 -1
- package/playground/hooks/Playground_Clipboard.res +19 -0
- package/playground/hooks/Playground_Disclosure.res +24 -0
- package/playground/hooks/Playground_LazyLoad.res +31 -0
- package/playground/hooks/Playground_MediaQueries.res +11 -0
- package/public/_redirects +1 -0
- package/src/form/Toolkit__Form.res +2 -2
- package/src/form/Toolkit__FormValidationFunctions.res +13 -0
- package/src/router/Toolkit__Router.res +2 -2
- package/src/ui/Toolkit__Ui_Alert.res +4 -4
- package/src/ui/Toolkit__Ui_Button.res +40 -5
- package/src/ui/Toolkit__Ui_Button.resi +3 -2
- package/src/ui/Toolkit__Ui_Card.res +4 -4
- package/src/ui/Toolkit__Ui_Checkbox.res +1 -1
- package/src/ui/Toolkit__Ui_CopyWrapper.res +1 -1
- package/src/ui/Toolkit__Ui_Layout.res +11 -6
- package/src/ui/Toolkit__Ui_ListboxInput.res +3 -3
- package/src/ui/Toolkit__Ui_Modal.res +1 -1
- package/src/ui/Toolkit__Ui_MultiSelect.res +1 -1
- package/src/ui/Toolkit__Ui_Radio.res +1 -1
- package/src/ui/Toolkit__Ui_Reference.res +1 -5
- package/src/ui/Toolkit__Ui_Select.res +1 -1
- package/src/ui/Toolkit__Ui_Snackbar.res +4 -4
- package/src/ui/Toolkit__Ui_Table.res +2 -2
- package/src/ui/Toolkit__Ui_WeekDateFilter.res +2 -2
- package/src/vendors/{BsReactIcons.res → ReactIcons.res} +14 -0
- package/vite.config.js +2 -0
- package/.yarn/cache/@csstools-postcss-cascade-layers-npm-1.1.1-4382e19cf0-8ecd6a929e.zip +0 -0
- package/.yarn/cache/@csstools-postcss-color-function-npm-1.1.1-7c5a0199ae-087595985e.zip +0 -0
- package/.yarn/cache/@csstools-postcss-font-format-keywords-npm-1.0.1-ef1db49912-ed8d9eab97.zip +0 -0
- package/.yarn/cache/@csstools-postcss-hwb-function-npm-1.0.2-f3f621e351-352ead754a.zip +0 -0
- package/.yarn/cache/@csstools-postcss-ic-unit-npm-1.0.1-111638e451-09c414c9b7.zip +0 -0
- package/.yarn/cache/@csstools-postcss-is-pseudo-class-npm-2.0.7-c85939401b-a4494bb8e9.zip +0 -0
- package/.yarn/cache/@csstools-postcss-nested-calc-npm-1.0.0-8028506411-53bb783dd6.zip +0 -0
- package/.yarn/cache/@csstools-postcss-normalize-display-values-npm-1.0.1-53721ce3eb-75901daec3.zip +0 -0
- package/.yarn/cache/@csstools-postcss-oklab-function-npm-1.1.1-2907029cf1-d66b789060.zip +0 -0
- package/.yarn/cache/@csstools-postcss-progressive-custom-properties-npm-1.3.0-1e56504855-e281845fde.zip +0 -0
- package/.yarn/cache/@csstools-postcss-stepped-value-functions-npm-1.0.1-01aa1138bd-2fc88713a0.zip +0 -0
- package/.yarn/cache/@csstools-postcss-text-decoration-shorthand-npm-1.0.0-96f61ef9fe-d27aaf9787.zip +0 -0
- package/.yarn/cache/@csstools-postcss-trigonometric-functions-npm-1.0.2-4553514702-f7f5b5f249.zip +0 -0
- package/.yarn/cache/@csstools-postcss-unset-value-npm-1.0.2-f57c79bfc4-3facdae154.zip +0 -0
- package/.yarn/cache/css-blank-pseudo-npm-3.0.3-af86e84805-9be0a13885.zip +0 -0
- package/.yarn/cache/css-has-pseudo-npm-3.0.4-e97bb61896-8f165d68f6.zip +0 -0
- package/.yarn/cache/css-prefers-color-scheme-npm-6.0.3-e1c91bc5cd-3a2b02f045.zip +0 -0
- package/.yarn/cache/cssdb-npm-7.2.0-ce2edad2c6-a571955eac.zip +0 -0
- package/.yarn/cache/postcss-attribute-case-insensitive-npm-5.0.2-6aa24bfafa-c0b8139f37.zip +0 -0
- package/.yarn/cache/postcss-color-functional-notation-npm-4.2.4-8f3a9400c3-b763e164fe.zip +0 -0
- package/.yarn/cache/postcss-color-hex-alpha-npm-8.0.4-88605e8cec-a2f3173a60.zip +0 -0
- package/.yarn/cache/postcss-color-rebeccapurple-npm-7.1.1-b7828c0a0c-03482f9b81.zip +0 -0
- package/.yarn/cache/postcss-custom-media-npm-8.0.2-5ad89ea0fe-887bbbacf6.zip +0 -0
- package/.yarn/cache/postcss-custom-properties-npm-12.1.11-78be1c709e-421f9d8d6b.zip +0 -0
- package/.yarn/cache/postcss-custom-selectors-npm-6.0.3-0a63667536-18080d60a8.zip +0 -0
- package/.yarn/cache/postcss-dir-pseudo-class-npm-6.0.5-2555aeb05f-7810c439d8.zip +0 -0
- package/.yarn/cache/postcss-double-position-gradients-npm-3.1.2-278f758391-ca09bf2aef.zip +0 -0
- package/.yarn/cache/postcss-env-function-npm-4.0.6-2282fa7c63-645b2363cf.zip +0 -0
- package/.yarn/cache/postcss-focus-visible-npm-6.0.4-2eb1d7ff31-acd010b9dd.zip +0 -0
- package/.yarn/cache/postcss-focus-within-npm-5.0.4-d70f73ac5d-f23d8ab757.zip +0 -0
- package/.yarn/cache/postcss-gap-properties-npm-3.0.5-78f268ad64-aed559d6d3.zip +0 -0
- package/.yarn/cache/postcss-image-set-function-npm-4.0.7-46769dca3e-7e50933098.zip +0 -0
- package/.yarn/cache/postcss-lab-function-npm-4.2.1-1ebd916151-26ac74b430.zip +0 -0
- package/.yarn/cache/postcss-logical-npm-5.0.4-cf11b97479-17c71291ed.zip +0 -0
- package/.yarn/cache/postcss-nesting-npm-10.2.0-eec5f664e8-25e6e66186.zip +0 -0
- package/.yarn/cache/postcss-opacity-percentage-npm-1.1.2-3f7d2b6abb-b582f6d4ef.zip +0 -0
- package/.yarn/cache/postcss-overflow-shorthand-npm-3.0.4-b5a0785c77-7400902249.zip +0 -0
- package/.yarn/cache/postcss-place-npm-7.0.5-895593f8b4-903fec0c31.zip +0 -0
- package/.yarn/cache/postcss-preset-env-npm-7.8.3-242e470fd9-71bfb697ff.zip +0 -0
- package/.yarn/cache/postcss-pseudo-class-any-link-npm-7.1.6-1a34600b0e-43aa18ea1e.zip +0 -0
- package/.yarn/cache/postcss-selector-not-npm-6.0.1-135f19a20c-fe523a0219.zip +0 -0
- package/playground/stories/Storybook.res +0 -178
- package/playground/stories/Toolkit__Hooks_ClipboardStory.res +0 -44
- package/playground/stories/Toolkit__Hooks_DisclosureStory.res +0 -56
- package/playground/stories/Toolkit__Hooks_LazyLoadStory.res +0 -58
- package/playground/stories/Toolkit__UI_CheckboxStory.res +0 -150
- package/playground/stories/Toolkit__UI_ComboboxStory.res +0 -64
- package/playground/stories/Toolkit__UI_DropdownListStory.res +0 -89
- package/playground/stories/Toolkit__UI_IconButtonStory.res +0 -140
- package/playground/stories/Toolkit__UI_NativeDatePickerStory.res +0 -60
- package/playground/stories/Toolkit__UI_PortalDropdownStory.res +0 -40
- package/playground/stories/Toolkit__UI_RadioStory.res +0 -128
- package/playground/stories/Toolkit__UI_ReferenceStory.res +0 -37
- package/playground/stories/Toolkit__UI_RichTextStory.res +0 -40
- package/playground/stories/Toolkit__UI_SelectStory.res +0 -153
- package/playground/stories/Toolkit__UI_TableStory.res +0 -103
- package/playground/stories/Toolkit__UI_TableStory.resi +0 -3
- package/playground/stories/Toolkit__UI_TabsStory.res +0 -52
- package/playground/stories/Toolkit__UI_TagStory.res +0 -160
- package/playground/stories/Toolkit__UI_TextInputStory.res +0 -71
- package/playground/stories/Toolkit__UI_TooltipStory.res +0 -136
- package/playground/stories/Toolkit__Ui_ProgressBarStory.res +0 -49
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import tailwindConfig from "../../src/tailwind/tailwind.config.cjs";
|
|
2
2
|
|
|
3
3
|
const colors = tailwindConfig.theme.colors;
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ export default () => (
|
|
|
36
36
|
return (
|
|
37
37
|
<div className="mb-6" key={colorType}>
|
|
38
38
|
<h3 className="text-xl font-bold mb-2">{colorType}</h3>
|
|
39
|
-
<div className="flex
|
|
39
|
+
<div className="flex gap-4">
|
|
40
40
|
{typeof colors === "string" ? (
|
|
41
41
|
<ColorPreview code={null} color={colors} />
|
|
42
42
|
) : (
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
let resi = ""
|
|
2
|
+
|
|
3
|
+
@module("@root/playground/hooks/Playground_Clipboard.res?raw")
|
|
4
|
+
external codeExample: string = "default"
|
|
5
|
+
|
|
6
|
+
@react.component
|
|
7
|
+
let make = () => {
|
|
8
|
+
let clipboard = Toolkit.Hooks.useClipboard(
|
|
9
|
+
~onCopyNotificationMessage="Copied !",
|
|
10
|
+
"copied content",
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
<div>
|
|
14
|
+
<Toolkit.Ui.Snackbar.Provider />
|
|
15
|
+
<Toolkit.Ui.Button onClick={_ => clipboard.copy()}>
|
|
16
|
+
{"Copy some content to the clipboard"->React.string}
|
|
17
|
+
</Toolkit.Ui.Button>
|
|
18
|
+
</div>
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
let resi = ""
|
|
2
|
+
|
|
3
|
+
@module("@root/playground/hooks/Playground_Disclosure.res?raw")
|
|
4
|
+
external codeExample: string = "default"
|
|
5
|
+
|
|
6
|
+
@react.component
|
|
7
|
+
let make = () => {
|
|
8
|
+
let disclosure = Toolkit.Hooks.useDisclosure()
|
|
9
|
+
|
|
10
|
+
<div className="grid grid-cols-2 gap-4 w-64">
|
|
11
|
+
<div className="grid grid-rows-3 gap-4">
|
|
12
|
+
<Toolkit.Ui.Button onClick={_ => disclosure.toggle()}>
|
|
13
|
+
{"Toggle"->React.string}
|
|
14
|
+
</Toolkit.Ui.Button>
|
|
15
|
+
<Toolkit.Ui.Button onClick={_ => disclosure.show()}>
|
|
16
|
+
{"Show"->React.string}
|
|
17
|
+
</Toolkit.Ui.Button>
|
|
18
|
+
<Toolkit.Ui.Button onClick={_ => disclosure.hide()}>
|
|
19
|
+
{"Hide"->React.string}
|
|
20
|
+
</Toolkit.Ui.Button>
|
|
21
|
+
</div>
|
|
22
|
+
<p> {(disclosure.isOpen ? "Visible" : "hidden")->React.string} </p>
|
|
23
|
+
</div>
|
|
24
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
let resi = ""
|
|
2
|
+
|
|
3
|
+
@module("@root/playground/hooks/Playground_LazyLoad.res?raw")
|
|
4
|
+
external codeExample: string = "default"
|
|
5
|
+
|
|
6
|
+
@react.component
|
|
7
|
+
let make = () => {
|
|
8
|
+
let ref = React.useRef(Js.Nullable.null)
|
|
9
|
+
let intersection = ReactUse.useIntersection(
|
|
10
|
+
ref,
|
|
11
|
+
{
|
|
12
|
+
root: Js.Nullable.null,
|
|
13
|
+
rootMargin: "0px",
|
|
14
|
+
threshold: 1.,
|
|
15
|
+
},
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
<div
|
|
19
|
+
className={cx([
|
|
20
|
+
"h-[300px] w-64 overflow-scroll border",
|
|
21
|
+
switch intersection->Js.Nullable.toOption {
|
|
22
|
+
| Some({intersectionRatio}) if intersectionRatio < 1. => ""
|
|
23
|
+
| _ => "bg-info-100"
|
|
24
|
+
},
|
|
25
|
+
])}>
|
|
26
|
+
<p className="h-[500px]">
|
|
27
|
+
{"The background will change when the text at the end will be visible in the viewport. Scroll down"->React.string}
|
|
28
|
+
</p>
|
|
29
|
+
<p ref={ReactDOM.Ref.domRef(ref)}> {"not visible"->React.string} </p>
|
|
30
|
+
</div>
|
|
31
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
let resi = ""
|
|
2
|
+
|
|
3
|
+
@module("@root/playground/hooks/Playground_MediaQueries.res?raw")
|
|
4
|
+
external codeExample: string = "default"
|
|
5
|
+
|
|
6
|
+
@react.component
|
|
7
|
+
let make = () => {
|
|
8
|
+
let result = Toolkit__Hooks.useMediaQuery()
|
|
9
|
+
|
|
10
|
+
<div> {result->Obj.magic->Js.Json.stringifyWithSpace(2)->React.string} </div>
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* /index.html 200
|
|
@@ -190,8 +190,8 @@ module Make = (StateLenses: Config) => {
|
|
|
190
190
|
className="p-1 bg-neutral-300 rounded-r border border-gray-300 text-neutral-800"
|
|
191
191
|
onClick={_ => setShowPassword(v => !v)}>
|
|
192
192
|
{showPassword
|
|
193
|
-
? <
|
|
194
|
-
: <
|
|
193
|
+
? <ReactIcons.AiFillEyeInvisible size={26} />
|
|
194
|
+
: <ReactIcons.AiFillEye size={26} />}
|
|
195
195
|
</button>
|
|
196
196
|
</Toolkit__Ui_Tooltip>
|
|
197
197
|
| _ => React.null
|
|
@@ -140,6 +140,19 @@ let requiredPosFloatTimeHour_Min = (intl, value) => {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
let optionalPosFloatTimeHour_Min = (intl, value) => {
|
|
144
|
+
switch value {
|
|
145
|
+
| "" => None
|
|
146
|
+
| v =>
|
|
147
|
+
switch v->Toolkit__Decoders.UnitMeasure.Time.WithUnit.decodeFromString {
|
|
148
|
+
| Ok(#h(_)) => None
|
|
149
|
+
| Ok(#min(_)) => None
|
|
150
|
+
| _ =>
|
|
151
|
+
Some(Intl.formatMessageWithValues(intl, Msg.wrongFormat, {"exemple": "'10 min' '0.5 h'"}))
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
143
156
|
let optionalPosFloatTimeMin = (intl, value) => {
|
|
144
157
|
switch value {
|
|
145
158
|
| "" => None
|
|
@@ -196,7 +196,7 @@ module Make = (Config: RouterConfig) => {
|
|
|
196
196
|
{links
|
|
197
197
|
->Array.mapWithIndex((i, {route, text}) => {
|
|
198
198
|
<React.Fragment key={i->Int.toString}>
|
|
199
|
-
{i > 0 ? <
|
|
199
|
+
{i > 0 ? <ReactIcons.MdKeyboardArrowRight size=20 /> : React.null}
|
|
200
200
|
{links->Toolkit__Primitives.Array.isLastIndex(i)
|
|
201
201
|
? <p className="font-semibold"> text </p>
|
|
202
202
|
: <Link route className="hover:underline"> text </Link>}
|
|
@@ -368,7 +368,7 @@ module Make = (Config: RouterConfig) => {
|
|
|
368
368
|
groupInfo.label
|
|
369
369
|
</span>
|
|
370
370
|
<span className={cx(["absolute right-0 mr-2", isNavOpen ? "opacity-100" : "opacity-0"])}>
|
|
371
|
-
<
|
|
371
|
+
<ReactIcons.MdKeyboardArrowRight
|
|
372
372
|
size=24
|
|
373
373
|
className={cx([
|
|
374
374
|
"transition-all ease-linear duration-200 transform",
|
|
@@ -14,11 +14,11 @@ let make = (~title, ~description=?, ~status, ~className=?) =>
|
|
|
14
14
|
className->Option.getWithDefault(""),
|
|
15
15
|
])}>
|
|
16
16
|
{switch status {
|
|
17
|
-
| #success => <
|
|
18
|
-
| #error => <
|
|
17
|
+
| #success => <ReactIcons.MdCheckCircle size=28 className="text-success-600 flex-shrink-0" />
|
|
18
|
+
| #error => <ReactIcons.MdWarning size=28 className="text-danger-600 flex-shrink-0" />
|
|
19
19
|
| #warning =>
|
|
20
|
-
<
|
|
21
|
-
| #info => <
|
|
20
|
+
<ReactIcons.FaExclamationTriangle size=28 className="text-warning-600 flex-shrink-0" />
|
|
21
|
+
| #info => <ReactIcons.FaExclamationCircle size=28 className="text-info-600 flex-shrink-0" />
|
|
22
22
|
}}
|
|
23
23
|
<div className="mx-3">
|
|
24
24
|
<div
|
|
@@ -100,6 +100,11 @@ let buttonStyle = (
|
|
|
100
100
|
cx([baseStyle, sizeStyle, colorStyle, disabledStyle])
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
module type Icon = {
|
|
104
|
+
@react.component
|
|
105
|
+
let make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element
|
|
106
|
+
}
|
|
107
|
+
|
|
103
108
|
@react.component
|
|
104
109
|
let make = (
|
|
105
110
|
~size=#md,
|
|
@@ -119,10 +124,11 @@ let make = (
|
|
|
119
124
|
~type_: option<string>=?,
|
|
120
125
|
~className="",
|
|
121
126
|
~children=React.null,
|
|
122
|
-
~leftIcon
|
|
123
|
-
~rightIcon
|
|
127
|
+
~leftIcon: option<module(Icon)>=?,
|
|
128
|
+
~rightIcon: option<module(Icon)>=?,
|
|
129
|
+
~iconClassName=?,
|
|
124
130
|
~buttonRef: option<ReactDOM.domRef>=?,
|
|
125
|
-
) =>
|
|
131
|
+
) => {
|
|
126
132
|
<button
|
|
127
133
|
ref=?{buttonRef}
|
|
128
134
|
?ariaLabel
|
|
@@ -141,8 +147,37 @@ let make = (
|
|
|
141
147
|
buttonStyle(~color, ~variant, ~size, ~disabled, ()),
|
|
142
148
|
variant === #pill ? "rounded-full" : "",
|
|
143
149
|
])}>
|
|
144
|
-
{leftIcon->Option.mapWithDefault(React.null, icon =>
|
|
150
|
+
{leftIcon->Option.mapWithDefault(React.null, icon => {
|
|
151
|
+
let module(Icon) = icon
|
|
152
|
+
|
|
153
|
+
<span className="mr-2">
|
|
154
|
+
<Icon
|
|
155
|
+
size={switch size {
|
|
156
|
+
| #xs => 12
|
|
157
|
+
| #sm => 16
|
|
158
|
+
| #md => 20
|
|
159
|
+
| #lg => 24
|
|
160
|
+
}}
|
|
161
|
+
className=?iconClassName
|
|
162
|
+
/>
|
|
163
|
+
</span>
|
|
164
|
+
})}
|
|
145
165
|
children
|
|
146
|
-
{rightIcon->Option.mapWithDefault(React.null, icon =>
|
|
166
|
+
{rightIcon->Option.mapWithDefault(React.null, icon => {
|
|
167
|
+
let module(Icon) = icon
|
|
168
|
+
|
|
169
|
+
<span className="ml-2">
|
|
170
|
+
<Icon
|
|
171
|
+
size={switch size {
|
|
172
|
+
| #xs => 14
|
|
173
|
+
| #sm => 18
|
|
174
|
+
| #md => 22
|
|
175
|
+
| #lg => 26
|
|
176
|
+
}}
|
|
177
|
+
className=?iconClassName
|
|
178
|
+
/>
|
|
179
|
+
</span>
|
|
180
|
+
})}
|
|
147
181
|
{isLoading ? <Spinner size=#sm color=#current className="ml-2" /> : React.null}
|
|
148
182
|
</button>
|
|
183
|
+
}
|
|
@@ -34,7 +34,8 @@ let make: (
|
|
|
34
34
|
~type_: string=?,
|
|
35
35
|
~className: string=?,
|
|
36
36
|
~children: React.element=?,
|
|
37
|
-
~leftIcon:
|
|
38
|
-
~rightIcon:
|
|
37
|
+
~leftIcon: module(ReactIcons.Icon)=?,
|
|
38
|
+
~rightIcon: module(ReactIcons.Icon)=?,
|
|
39
|
+
~iconClassName: string=?,
|
|
39
40
|
~buttonRef: ReactDOM.domRef=?,
|
|
40
41
|
) => React.element
|
|
@@ -53,10 +53,10 @@ module Message = {
|
|
|
53
53
|
@react.component
|
|
54
54
|
let make = (~variant, ~className="", ~children=React.null) => {
|
|
55
55
|
let icon = switch variant {
|
|
56
|
-
| #info => <
|
|
57
|
-
| #success => <
|
|
58
|
-
| #warning => <
|
|
59
|
-
| #error => <
|
|
56
|
+
| #info => <ReactIcons.MdInfo className="w-6 h-6 mr-2 text-info-600" />
|
|
57
|
+
| #success => <ReactIcons.MdCheckCircle className="w-6 h-6 mr-2 text-success-600" />
|
|
58
|
+
| #warning => <ReactIcons.MdWarning className="w-6 h-6 mr-2 text-warning-600" />
|
|
59
|
+
| #error => <ReactIcons.MdError className="w-6 h-6 mr-2 text-danger-600" />
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
let color = switch variant {
|
|
@@ -22,7 +22,7 @@ let make = (~children, ~textToCopy, ~className="", ~intl) => {
|
|
|
22
22
|
onClick={_ => {
|
|
23
23
|
ref1Clipboard.copy()
|
|
24
24
|
}}>
|
|
25
|
-
<
|
|
25
|
+
<ReactIcons.MdContentCopy size=10 />
|
|
26
26
|
</div>
|
|
27
27
|
<div className="py-1 px-2 pr-4"> {children} </div>
|
|
28
28
|
</div>
|
|
@@ -39,13 +39,13 @@ module App = {
|
|
|
39
39
|
|
|
40
40
|
module TopNavigationBar = {
|
|
41
41
|
@react.component
|
|
42
|
-
let make = (~toggleMenu, ~username=?, ~onLogoClick, ~logout=?) => {
|
|
42
|
+
let make = (~toggleMenu, ~username=?, ~logoSrc=?, ~onLogoClick, ~logout=?) => {
|
|
43
43
|
<div
|
|
44
44
|
className="bg-white h-16 border-b flex items-center px-1 justify-between fixed top-0 left-0 w-full z-40">
|
|
45
45
|
<div className="flex items-center px-1">
|
|
46
46
|
<button
|
|
47
47
|
onClick=toggleMenu className="text-neutral-800 hover:bg-neutral-300 rounded-full p-2">
|
|
48
|
-
<
|
|
48
|
+
<ReactIcons.MdMenu size=32 />
|
|
49
49
|
</button>
|
|
50
50
|
<a
|
|
51
51
|
href="#"
|
|
@@ -54,7 +54,11 @@ module App = {
|
|
|
54
54
|
|
|
55
55
|
onLogoClick()
|
|
56
56
|
}}>
|
|
57
|
-
<img
|
|
57
|
+
<img
|
|
58
|
+
src={logoSrc->Option.getWithDefault("/assets/logo.svg")}
|
|
59
|
+
alt="Colisweb"
|
|
60
|
+
className="w-16 ml-4"
|
|
61
|
+
/>
|
|
58
62
|
</a>
|
|
59
63
|
</div>
|
|
60
64
|
{switch (username, logout) {
|
|
@@ -67,10 +71,10 @@ module App = {
|
|
|
67
71
|
{username->React.string}
|
|
68
72
|
</span>
|
|
69
73
|
<div>
|
|
70
|
-
<
|
|
74
|
+
<ReactIcons.MdAccountCircle size=28 />
|
|
71
75
|
</div>
|
|
72
76
|
<div>
|
|
73
|
-
<
|
|
77
|
+
<ReactIcons.MdKeyboardArrowDown size=18 />
|
|
74
78
|
</div>
|
|
75
79
|
</div>}>
|
|
76
80
|
<button
|
|
@@ -146,6 +150,7 @@ module App = {
|
|
|
146
150
|
~logout=?,
|
|
147
151
|
~onLogoClick,
|
|
148
152
|
~bottom=?,
|
|
153
|
+
~logoSrc=?,
|
|
149
154
|
) => {
|
|
150
155
|
let {isLg} = Toolkit__Hooks.useMediaQuery()
|
|
151
156
|
let (isNavOpen, setOpen) = React.useState(() =>
|
|
@@ -173,7 +178,7 @@ module App = {
|
|
|
173
178
|
|
|
174
179
|
<NavOpenContext.Provider value={isNavOpen}>
|
|
175
180
|
<div>
|
|
176
|
-
<TopNavigationBar ?username ?logout toggleMenu onLogoClick />
|
|
181
|
+
<TopNavigationBar ?logoSrc ?username ?logout toggleMenu onLogoClick />
|
|
177
182
|
<div className="flex">
|
|
178
183
|
<LeftNavigationBar isNavOpen ?bottom hideMenu openMenu>
|
|
179
184
|
{sideNavRender}
|
|
@@ -318,7 +318,7 @@ module ListboxInputOption = {
|
|
|
318
318
|
onClick=itemProps.onClick
|
|
319
319
|
className={cx([className, "pr-8", item === Placeholder ? "italic" : ""])}>
|
|
320
320
|
{isSelected(item)
|
|
321
|
-
? <
|
|
321
|
+
? <ReactIcons.MdCheck className="mr-4 w-6 h-6 flex-none" />
|
|
322
322
|
: <span className="mr-4 w-6 h-6 flex-none" />}
|
|
323
323
|
<span className="truncate"> children </span>
|
|
324
324
|
</Listbox.Option>
|
|
@@ -466,7 +466,7 @@ module ListboxInputSelect = {
|
|
|
466
466
|
->Option.mapWithDefault(placeholder, item => item->itemToString)
|
|
467
467
|
->React.string}
|
|
468
468
|
</span>
|
|
469
|
-
<
|
|
469
|
+
<ReactIcons.MdArrowDropDown className="ml-2 w-6 h-6 -my-1 flex-none" />
|
|
470
470
|
</ListboxInputButton>
|
|
471
471
|
<ListboxInputPopover className="-mt-12">
|
|
472
472
|
<ListboxInputList ?onBlur>
|
|
@@ -633,7 +633,7 @@ module ListboxInputMultiSelect = {
|
|
|
633
633
|
| items => items->Array.map(itemToString)->Js.Array.joinWith(", ", _)
|
|
634
634
|
}->React.string}
|
|
635
635
|
</span>
|
|
636
|
-
<
|
|
636
|
+
<ReactIcons.MdArrowDropDown className="ml-2 w-6 h-6 -my-1 flex-none" />
|
|
637
637
|
</ListboxInputButton>
|
|
638
638
|
<ListboxInputPopover className="-mt-12">
|
|
639
639
|
<ListboxInputList ?onBlur>
|
|
@@ -57,7 +57,7 @@ let make = (
|
|
|
57
57
|
<p className="flex flex-row gap-2 w-full items-center">
|
|
58
58
|
<span className="ml-1"> {placeholder} </span>
|
|
59
59
|
<span className="absolute inset-y-0 right-0 flex items-center px-2">
|
|
60
|
-
<
|
|
60
|
+
<ReactIcons.FaAngleDown />
|
|
61
61
|
</span>
|
|
62
62
|
</p>
|
|
63
63
|
| options =>
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// ----------------------
|
|
2
|
-
// This component require the presence of a Toolkit Ui Snackbar provider for onCopy notifications to work
|
|
3
|
-
// ----------------------
|
|
4
|
-
|
|
5
1
|
@react.component
|
|
6
2
|
let make = (
|
|
7
3
|
~reference,
|
|
@@ -25,7 +21,7 @@ let make = (
|
|
|
25
21
|
color=#info
|
|
26
22
|
onClick={_ => refClipboard.copy()}
|
|
27
23
|
ariaLabel="copy"
|
|
28
|
-
icon={<
|
|
24
|
+
icon={<ReactIcons.MdContentCopy size={copyButtonSize} />}
|
|
29
25
|
className="flex-shrink-0"
|
|
30
26
|
/>
|
|
31
27
|
</div>
|
|
@@ -87,7 +87,7 @@ module Item = {
|
|
|
87
87
|
])}>
|
|
88
88
|
{closable
|
|
89
89
|
? <button className="absolute right-1" onClick={_ => hide(id)}>
|
|
90
|
-
<
|
|
90
|
+
<ReactIcons.MdClose
|
|
91
91
|
size={24}
|
|
92
92
|
className={cx([
|
|
93
93
|
{
|
|
@@ -104,9 +104,9 @@ module Item = {
|
|
|
104
104
|
<div className="flex flex-row gap-3 relative">
|
|
105
105
|
<div>
|
|
106
106
|
{switch variant {
|
|
107
|
-
| #success => <
|
|
108
|
-
| #warning => <
|
|
109
|
-
| #danger => <
|
|
107
|
+
| #success => <ReactIcons.MdCheckCircle size=28 className="text-success-600" />
|
|
108
|
+
| #warning => <ReactIcons.MdWarning size=28 className="text-warning-600" />
|
|
109
|
+
| #danger => <ReactIcons.MdError size=28 className="text-danger-600" />
|
|
110
110
|
}}
|
|
111
111
|
</div>
|
|
112
112
|
<div>
|
|
@@ -68,8 +68,8 @@ module Core = {
|
|
|
68
68
|
? column.isSortedDesc->Option.mapWithDefault(React.null, v =>
|
|
69
69
|
<span className="absolute right-0 top-0 mt-1">
|
|
70
70
|
{v
|
|
71
|
-
? <
|
|
72
|
-
: <
|
|
71
|
+
? <ReactIcons.MdKeyboardArrowDown size=18 />
|
|
72
|
+
: <ReactIcons.MdKeyboardArrowUp size=18 />}
|
|
73
73
|
</span>
|
|
74
74
|
)
|
|
75
75
|
: React.null}
|
|
@@ -155,7 +155,7 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
|
|
|
155
155
|
color=#neutral
|
|
156
156
|
onClick={_ => dispatch(PreviousTimeSlot)}
|
|
157
157
|
ariaLabel="previous week"
|
|
158
|
-
icon={<
|
|
158
|
+
icon={<ReactIcons.MdKeyboardArrowLeft size=30 />}
|
|
159
159
|
/>
|
|
160
160
|
<div className="flex items-center mx-2">
|
|
161
161
|
{BsDateFns.eachDayOfInterval({
|
|
@@ -207,7 +207,7 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
|
|
|
207
207
|
color=#neutral
|
|
208
208
|
onClick={_ => dispatch(NextTimeSlot)}
|
|
209
209
|
ariaLabel="next week"
|
|
210
|
-
icon={<
|
|
210
|
+
icon={<ReactIcons.MdKeyboardArrowRight size=30 />}
|
|
211
211
|
/>
|
|
212
212
|
</div>
|
|
213
213
|
{children({timeslot, selectedDay})}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
module type Icon = {
|
|
2
|
+
@react.component
|
|
3
|
+
let make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
module Md3dRotation = {
|
|
2
7
|
@module("react-icons/md") @react.component
|
|
3
8
|
external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element =
|
|
@@ -6014,3 +6019,12 @@ module SiDatabricks = {
|
|
|
6014
6019
|
external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element =
|
|
6015
6020
|
"SiDatabricks"
|
|
6016
6021
|
}
|
|
6022
|
+
module GiHook = {
|
|
6023
|
+
@module("react-icons/gi") @react.component
|
|
6024
|
+
external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element = "GiHook"
|
|
6025
|
+
}
|
|
6026
|
+
module BsPalette = {
|
|
6027
|
+
@module("react-icons/bs") @react.component
|
|
6028
|
+
external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element =
|
|
6029
|
+
"BsPalette"
|
|
6030
|
+
}
|
package/vite.config.js
CHANGED
|
@@ -8,6 +8,7 @@ import rehypeHighlight from "rehype-highlight";
|
|
|
8
8
|
import rescriptHighlight from "./playground/utils/rescript-highlight";
|
|
9
9
|
import rehypeAutolinkHeadings from "rehype-autolink-headings";
|
|
10
10
|
import rehypeSlug from "rehype-slug";
|
|
11
|
+
import { viteCommonjs } from "@originjs/vite-plugin-commonjs";
|
|
11
12
|
|
|
12
13
|
const appDirectory = fs.realpathSync(process.cwd());
|
|
13
14
|
const isProduction = process.env.NODE_ENV === "production";
|
|
@@ -18,6 +19,7 @@ export default defineConfig({
|
|
|
18
19
|
sourcemap: true,
|
|
19
20
|
},
|
|
20
21
|
plugins: [
|
|
22
|
+
viteCommonjs(),
|
|
21
23
|
mdx({
|
|
22
24
|
rehypePlugins: [
|
|
23
25
|
[
|
|
Binary file
|
|
Binary file
|
package/.yarn/cache/@csstools-postcss-font-format-keywords-npm-1.0.1-ef1db49912-ed8d9eab97.zip
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/.yarn/cache/@csstools-postcss-normalize-display-values-npm-1.0.1-53721ce3eb-75901daec3.zip
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/.yarn/cache/@csstools-postcss-stepped-value-functions-npm-1.0.1-01aa1138bd-2fc88713a0.zip
DELETED
|
Binary file
|
package/.yarn/cache/@csstools-postcss-text-decoration-shorthand-npm-1.0.0-96f61ef9fe-d27aaf9787.zip
DELETED
|
Binary file
|
package/.yarn/cache/@csstools-postcss-trigonometric-functions-npm-1.0.2-4553514702-f7f5b5f249.zip
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|