@colisweb/rescript-toolkit 2.70.0 → 2.71.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.
- 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 +18 -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/{stories/Toolkit__UI_DropdownStory.res → components/Playground_Dropdown.res} +6 -59
- 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_PortalDropdown.res +11 -0
- 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/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_PortalDropdown.res +1 -1
- package/src/ui/Toolkit__Ui_PortalDropdown.resi +21 -0
- 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
package/playground/{stories/Toolkit__UI_DropdownStory.res → components/Playground_Dropdown.res}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
@module("@root/src/ui/Toolkit__Ui_Dropdown.resi?raw")
|
|
2
|
+
external resi: string = "default"
|
|
2
3
|
|
|
3
|
-
@module("
|
|
4
|
-
external
|
|
4
|
+
@module("@root/playground/components/Playground_Dropdown.res?raw")
|
|
5
|
+
external codeExample: string = "default"
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let example = () =>
|
|
7
|
+
@react.component
|
|
8
|
+
let make = () =>
|
|
9
9
|
<div>
|
|
10
10
|
<Toolkit__Ui_Dropdown dropdownClassName="w-60" label={"overflow"->React.string}>
|
|
11
11
|
<div> {"Dropdown content !"->React.string} </div>
|
|
@@ -50,56 +50,3 @@ let example = () =>
|
|
|
50
50
|
</div>
|
|
51
51
|
</div>
|
|
52
52
|
</div>
|
|
53
|
-
|
|
54
|
-
example->CSF.addMeta(
|
|
55
|
-
~name="example",
|
|
56
|
-
~parameters={
|
|
57
|
-
"docs": {
|
|
58
|
-
"page": () => <>
|
|
59
|
-
<CodeBlock> source </CodeBlock>
|
|
60
|
-
<Docs.Source
|
|
61
|
-
language="rescript"
|
|
62
|
-
code={j`
|
|
63
|
-
<Toolkit__Ui_Dropdown
|
|
64
|
-
className="p-4 shadow rounded"
|
|
65
|
-
renderButton={disclosure => {
|
|
66
|
-
<Button onClick={_ => disclosure.toggle()}> {"Toggle me"->React.string} </Button>
|
|
67
|
-
}}>
|
|
68
|
-
<div> {"Dropdown content !"->React.string} </div>
|
|
69
|
-
</Toolkit__Ui_Dropdown>
|
|
70
|
-
`}
|
|
71
|
-
/>
|
|
72
|
-
<Docs.Story id="components-dropdown--example" />
|
|
73
|
-
</>,
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
(),
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
let portal = () =>
|
|
80
|
-
<div>
|
|
81
|
-
<Toolkit__Ui_PortalDropdown dropdownClassName="w-60" label={"overflow"->React.string}>
|
|
82
|
-
{_ => <div> {"Dropdown content !"->React.string} </div>}
|
|
83
|
-
</Toolkit__Ui_PortalDropdown>
|
|
84
|
-
</div>
|
|
85
|
-
|
|
86
|
-
example->CSF.addMeta(
|
|
87
|
-
~name="portal",
|
|
88
|
-
~parameters={
|
|
89
|
-
"docs": {
|
|
90
|
-
"page": () => <>
|
|
91
|
-
<CodeBlock> source </CodeBlock>
|
|
92
|
-
<Docs.Source
|
|
93
|
-
language="rescript"
|
|
94
|
-
code={j`
|
|
95
|
-
<Toolkit__Ui_PortalDropdown dropdownClassName="w-60" label={"overflow"->React.string}>
|
|
96
|
-
<div> {"Dropdown content !"->React.string} </div>
|
|
97
|
-
</Toolkit__Ui_PortalDropdown>
|
|
98
|
-
`}
|
|
99
|
-
/>
|
|
100
|
-
<Docs.Story id="components-dropdown--portal" />
|
|
101
|
-
</>,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
(),
|
|
105
|
-
)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@module("@root/src/ui/Toolkit__Ui_DropdownList.resi?raw")
|
|
2
|
+
external resi: string = "default"
|
|
3
|
+
|
|
4
|
+
@module("@root/playground/components/Playground_DropdownList.res?raw")
|
|
5
|
+
external codeExample: string = "default"
|
|
6
|
+
|
|
7
|
+
@react.component
|
|
8
|
+
let make = () => {
|
|
9
|
+
let items: array<Toolkit__Ui_DropdownList.item> = [
|
|
10
|
+
{
|
|
11
|
+
icon: <ReactIcons.MdKeyboardArrowRight size={22} />,
|
|
12
|
+
label: "Test"->React.string,
|
|
13
|
+
onClick: () => Js.log("test"),
|
|
14
|
+
className: "",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
icon: <ReactIcons.MdKeyboardArrowRight size={22} />,
|
|
18
|
+
label: "Test 2"->React.string,
|
|
19
|
+
onClick: () => Js.log("test 2"),
|
|
20
|
+
className: "",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
icon: <ReactIcons.MdKeyboardArrowRight size={22} />,
|
|
24
|
+
label: "Test 3"->React.string,
|
|
25
|
+
onClick: () => Js.log("test 3"),
|
|
26
|
+
className: "",
|
|
27
|
+
},
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
<div className="flex flex-row gap-8 relative">
|
|
31
|
+
<Toolkit__Ui_DropdownList label={"default bottom"->React.string} items />
|
|
32
|
+
<Toolkit__Ui_DropdownList label={"top"->React.string} position=#top items />
|
|
33
|
+
<div className="absolute top-20 left-40">
|
|
34
|
+
<Toolkit__Ui_DropdownList label={"test"->React.string} items />
|
|
35
|
+
</div>
|
|
36
|
+
<div className="absolute top-20 right-0">
|
|
37
|
+
<Toolkit__Ui_DropdownList label={"test 2"->React.string} defaultIsOpen={true} items />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
open Storybook.Story
|
|
2
|
-
open Storybook
|
|
3
1
|
open Toolkit__Ui
|
|
4
2
|
|
|
5
|
-
let
|
|
3
|
+
let resi = ""
|
|
4
|
+
|
|
5
|
+
@module("@root/playground/components/Playground_Form.res?raw")
|
|
6
|
+
external codeExample: string = "default"
|
|
6
7
|
|
|
7
8
|
module ReformTest = {
|
|
8
9
|
module FormState = {
|
|
@@ -41,28 +42,6 @@ module ReformTest = {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
storiesOf("Form/reform", _module)->add("default", () => <ReformTest />)->ignore
|
|
45
|
-
|
|
46
|
-
storiesOf("Form/TextareaInput", _module)
|
|
47
|
-
->addDecorator(Knobs.withKnobs)
|
|
48
|
-
->add("default", () =>
|
|
49
|
-
<div>
|
|
50
|
-
<Label htmlFor="test" optionalMessage={"Optional"->React.string}>
|
|
51
|
-
{"Label"->React.string}
|
|
52
|
-
</Label>
|
|
53
|
-
<TextareaInput id="test" placeholder="Test" />
|
|
54
|
-
</div>
|
|
55
|
-
)
|
|
56
|
-
->add("with error", () =>
|
|
57
|
-
<div>
|
|
58
|
-
<Label htmlFor="test" optionalMessage={"Optional"->React.string}>
|
|
59
|
-
{"Label"->React.string}
|
|
60
|
-
</Label>
|
|
61
|
-
<TextareaInput id="test" placeholder="Test" isInvalid=true />
|
|
62
|
-
</div>
|
|
63
|
-
)
|
|
64
|
-
->ignore
|
|
65
|
-
|
|
66
45
|
module DayPickerExample = {
|
|
67
46
|
open BsReactDayPicker
|
|
68
47
|
|
|
@@ -106,12 +85,58 @@ module DayPickerExample = {
|
|
|
106
85
|
}
|
|
107
86
|
}
|
|
108
87
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
88
|
+
@react.component
|
|
89
|
+
let make = () => {
|
|
90
|
+
<div className="flex flex-col gap-4">
|
|
91
|
+
<div>
|
|
92
|
+
<h2> {"Reform"->React.string} </h2>
|
|
93
|
+
<ReformTest />
|
|
94
|
+
</div>
|
|
95
|
+
<div>
|
|
96
|
+
<h2> {"TextareaInput"->React.string} </h2>
|
|
97
|
+
<Label htmlFor="test" optionalMessage={"Optional"->React.string}>
|
|
98
|
+
{"Label"->React.string}
|
|
99
|
+
</Label>
|
|
100
|
+
<TextareaInput id="test" placeholder="Test" />
|
|
101
|
+
<div>
|
|
102
|
+
<Label htmlFor="test" optionalMessage={"Optional"->React.string}>
|
|
103
|
+
{"Label"->React.string}
|
|
104
|
+
</Label>
|
|
105
|
+
<TextareaInput id="test" placeholder="Test" isInvalid=true />
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<div>
|
|
109
|
+
<h2> {"DayPicker"->React.string} </h2>
|
|
110
|
+
<DayPickerExample />
|
|
111
|
+
</div>
|
|
112
|
+
<div>
|
|
113
|
+
<h2> {"DayPickerInput"->React.string} </h2>
|
|
114
|
+
<BsReactDayPicker.ReactDayPicker.DayPickerInput showOutsideDays=true firstDayOfWeek=1 />
|
|
115
|
+
</div>
|
|
116
|
+
<div>
|
|
117
|
+
<h2> {"NativeDatePicker"->React.string} </h2>
|
|
118
|
+
<div className="grid grid-cols-2 grid-flow-row auto-rows-auto gap-x-3 gap-y-3">
|
|
119
|
+
<p> {"base"->React.string} </p>
|
|
120
|
+
<Toolkit.Ui.NativeDatePicker
|
|
121
|
+
onChange={date => {
|
|
122
|
+
()
|
|
123
|
+
}}
|
|
124
|
+
/>
|
|
125
|
+
<p> {"invalid"->React.string} </p>
|
|
126
|
+
<Toolkit.Ui.NativeDatePicker
|
|
127
|
+
onChange={date => {
|
|
128
|
+
()
|
|
129
|
+
}}
|
|
130
|
+
isInvalid=true
|
|
131
|
+
/>
|
|
132
|
+
<p> {"disabled"->React.string} </p>
|
|
133
|
+
<Toolkit.Ui.NativeDatePicker
|
|
134
|
+
onChange={date => {
|
|
135
|
+
()
|
|
136
|
+
}}
|
|
137
|
+
disabled=true
|
|
138
|
+
/>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
115
141
|
</div>
|
|
116
|
-
|
|
117
|
-
->ignore
|
|
142
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
let resi = ""
|
|
2
|
+
|
|
3
|
+
@module("@root/playground/components/Playground_IconButton.res?raw")
|
|
4
|
+
external codeExample: string = "default"
|
|
5
|
+
|
|
6
|
+
@react.component
|
|
7
|
+
let make = () => {
|
|
8
|
+
let colors: array<Toolkit__Ui.IconButton.color> = [
|
|
9
|
+
#primary,
|
|
10
|
+
#black,
|
|
11
|
+
#white,
|
|
12
|
+
#gray,
|
|
13
|
+
#success,
|
|
14
|
+
#info,
|
|
15
|
+
#danger,
|
|
16
|
+
#warning,
|
|
17
|
+
#neutral,
|
|
18
|
+
#neutralLight,
|
|
19
|
+
]
|
|
20
|
+
let variants: array<Toolkit__Ui.IconButton.variant> = [#default, #outline]
|
|
21
|
+
|
|
22
|
+
let sizes = Js.Dict.fromArray([("xs", #xs), ("sm", #sm), ("md", #md), ("lg", #lg)])
|
|
23
|
+
|
|
24
|
+
<div>
|
|
25
|
+
{colors
|
|
26
|
+
->Array.mapWithIndex((i, color) => {
|
|
27
|
+
let colorText = (color :> string)
|
|
28
|
+
<div
|
|
29
|
+
key={i->Int.toString ++ colorText}
|
|
30
|
+
className="flex flex-col gap-4 first:border-0 border-t py-4 first:pt-0 border-neutral-500">
|
|
31
|
+
<h2> {colorText->React.string} </h2>
|
|
32
|
+
<div className="flex flex-row flex-wrap gap-8">
|
|
33
|
+
{variants
|
|
34
|
+
->Array.map(variant => {
|
|
35
|
+
let variantText = (variant :> string)
|
|
36
|
+
<div key={`${colorText}${variantText}`} className="flex flex-col gap-4">
|
|
37
|
+
<h4> {variantText->React.string} </h4>
|
|
38
|
+
{[false, true]
|
|
39
|
+
->Array.mapWithIndex(
|
|
40
|
+
(j, disabled) =>
|
|
41
|
+
<div className="flex items-center gap-4">
|
|
42
|
+
{disabled ? <p> {"Disabled"->React.string} </p> : React.null}
|
|
43
|
+
{sizes
|
|
44
|
+
->Js.Dict.entries
|
|
45
|
+
->Array.mapWithIndex(
|
|
46
|
+
(k, (sizeText, size)) =>
|
|
47
|
+
<div key={(i + j + k)->Int.toString ++ (colorText ++ sizeText)}>
|
|
48
|
+
<Toolkit__Ui_IconButton
|
|
49
|
+
variant color size disabled icon={<ReactIcons.MdHome />}
|
|
50
|
+
/>
|
|
51
|
+
</div>,
|
|
52
|
+
)
|
|
53
|
+
->React.array}
|
|
54
|
+
</div>,
|
|
55
|
+
)
|
|
56
|
+
->React.array}
|
|
57
|
+
</div>
|
|
58
|
+
})
|
|
59
|
+
->React.array}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
})
|
|
63
|
+
->React.array}
|
|
64
|
+
</div>
|
|
65
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@module("@root/src/ui/Toolkit__Ui_PortalDropdown.resi?raw")
|
|
2
|
+
external resi: string = "default"
|
|
3
|
+
|
|
4
|
+
@module("@root/playground/components/Playground_PortalDropdown.res?raw")
|
|
5
|
+
external codeExample: string = "default"
|
|
6
|
+
|
|
7
|
+
@react.component
|
|
8
|
+
let make = () =>
|
|
9
|
+
<Toolkit__Ui_PortalDropdown dropdownClassName="w-60" label={"overflow"->React.string}>
|
|
10
|
+
{_ => <div> {"Dropdown content !"->React.string} </div>}
|
|
11
|
+
</Toolkit__Ui_PortalDropdown>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
open Toolkit__Ui
|
|
2
|
+
|
|
3
|
+
@module("@root/src/ui/Toolkit__Ui_ProgressBar.resi?raw")
|
|
4
|
+
external resi: string = "default"
|
|
5
|
+
|
|
6
|
+
@module("@root/playground/components/Playground_ProgressBar.res?raw")
|
|
7
|
+
external codeExample: string = "default"
|
|
8
|
+
|
|
9
|
+
@react.component
|
|
10
|
+
let make = () => {
|
|
11
|
+
let colors = Js.Dict.fromArray([
|
|
12
|
+
("success", #success),
|
|
13
|
+
("warning", #warning),
|
|
14
|
+
("info", #info),
|
|
15
|
+
("danger", #danger),
|
|
16
|
+
])
|
|
17
|
+
|
|
18
|
+
<div>
|
|
19
|
+
{colors
|
|
20
|
+
->Js.Dict.entries
|
|
21
|
+
->Array.mapWithIndex((i, (colorText, color)) =>
|
|
22
|
+
<div
|
|
23
|
+
key={i->Int.toString ++ colorText}
|
|
24
|
+
className="flex flex-row flex-col-gap-4 mb-4 items-center">
|
|
25
|
+
<strong className="w-40"> {colorText->React.string} </strong>
|
|
26
|
+
<div className="w-60">
|
|
27
|
+
<ProgressBar color progression=60. />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
)
|
|
31
|
+
->React.array}
|
|
32
|
+
</div>
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
open Toolkit__Ui
|
|
2
|
+
|
|
3
|
+
@module("@root/src/ui/Toolkit__Ui_Radio.resi?raw")
|
|
4
|
+
external resi: string = "default"
|
|
5
|
+
|
|
6
|
+
@module("@root/playground/components/Playground_Radio.res?raw")
|
|
7
|
+
external codeExample: string = "default"
|
|
8
|
+
|
|
9
|
+
@react.component
|
|
10
|
+
let make = () =>
|
|
11
|
+
<div className="flex flex-col gap-4">
|
|
12
|
+
<Radio name="test" value="test1"> {"test1"->React.string} </Radio>
|
|
13
|
+
<Radio name="test" value="test2"> {"test2"->React.string} </Radio>
|
|
14
|
+
<Radio name="test" value="test3"> {"test3"->React.string} </Radio>
|
|
15
|
+
<Radio checked=true name="ddd" value="test"> {"default checked"->React.string} </Radio>
|
|
16
|
+
<div className="flex flex-col gap-2">
|
|
17
|
+
<h2> {"Sizes"->React.string} </h2>
|
|
18
|
+
<Radio checked=true name="test2" value="test5" size=#xs> {"xs"->React.string} </Radio>
|
|
19
|
+
<Radio checked=true name="test2" value="test55" size=#sm> {"sm"->React.string} </Radio>
|
|
20
|
+
<Radio checked=true name="test2" value="test33" size=#md> {"md"->React.string} </Radio>
|
|
21
|
+
<Radio checked=true name="test2" value="test2" size=#lg> {"lg"->React.string} </Radio>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
open Toolkit__Ui
|
|
2
|
+
|
|
3
|
+
@module("@root/src/ui/Toolkit__Ui_Reference.resi?raw")
|
|
4
|
+
external resi: string = "default"
|
|
5
|
+
|
|
6
|
+
@module("@root/playground/components/Playground_Reference.res?raw")
|
|
7
|
+
external codeExample: string = "default"
|
|
8
|
+
|
|
9
|
+
@react.component
|
|
10
|
+
let make = () =>
|
|
11
|
+
<div>
|
|
12
|
+
<Reference reference="07868-9897687-0898" />
|
|
13
|
+
<div className="w-48 mt-4">
|
|
14
|
+
<Reference reference="07868-9897687-0898" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
open Toolkit__Ui
|
|
2
|
+
|
|
3
|
+
@module("@root/src/ui/Toolkit__Ui_RichText.resi?raw")
|
|
4
|
+
external resi: string = "default"
|
|
5
|
+
|
|
6
|
+
@module("@root/playground/components/Playground_RichText.res?raw")
|
|
7
|
+
external codeExample: string = "default"
|
|
8
|
+
|
|
9
|
+
@react.component
|
|
10
|
+
let make = () => {
|
|
11
|
+
let html = `
|
|
12
|
+
<h1>
|
|
13
|
+
test 2
|
|
14
|
+
</h1>
|
|
15
|
+
`
|
|
16
|
+
let link = "https://www.colisweb.com"
|
|
17
|
+
<div className="flex flex-col gap-4">
|
|
18
|
+
<RichText text="test" />
|
|
19
|
+
<RichText text=html />
|
|
20
|
+
<RichText text=link />
|
|
21
|
+
</div>
|
|
22
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
open Toolkit__Ui
|
|
2
|
+
open BsReactSelect
|
|
3
|
+
|
|
4
|
+
@module("@root/src/ui/Toolkit__Ui_Select.resi?raw")
|
|
5
|
+
external resi: string = "default"
|
|
6
|
+
|
|
7
|
+
@module("@root/playground/components/Playground_Select.res?raw")
|
|
8
|
+
external codeExample: string = "default"
|
|
9
|
+
|
|
10
|
+
@react.component
|
|
11
|
+
let make = () => {
|
|
12
|
+
let options = [
|
|
13
|
+
{label: "Label", value: "value"},
|
|
14
|
+
{label: "Label2", value: "value2"},
|
|
15
|
+
{label: "Label3", value: "value3"},
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
<div className="flex flex-col gap-6">
|
|
19
|
+
<div>
|
|
20
|
+
<Label htmlFor="test" optionalMessage={"Optional"->React.string}>
|
|
21
|
+
{"Native select"->React.string}
|
|
22
|
+
</Label>
|
|
23
|
+
<Select
|
|
24
|
+
onChange={_ => ()}
|
|
25
|
+
id="test"
|
|
26
|
+
placeholder="This is a placeholder"
|
|
27
|
+
options=[
|
|
28
|
+
("label", "value", true),
|
|
29
|
+
("label2", "value2", true),
|
|
30
|
+
("label disabled", "value3", false),
|
|
31
|
+
]
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
<div>
|
|
35
|
+
<h2> {"react-select"->React.string} </h2>
|
|
36
|
+
<Label htmlFor="test" optionalMessage={"Optional"->React.string}>
|
|
37
|
+
{"default"->React.string}
|
|
38
|
+
</Label>
|
|
39
|
+
<ReactSelect
|
|
40
|
+
name="test"
|
|
41
|
+
classNamePrefix="react-select"
|
|
42
|
+
placeholder="Placeholder"
|
|
43
|
+
onChange={v => Js.log(v)}
|
|
44
|
+
options
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
<div>
|
|
48
|
+
<Label htmlFor="test3" optionalMessage={"Optional"->React.string}>
|
|
49
|
+
{"Disabled"->React.string}
|
|
50
|
+
</Label>
|
|
51
|
+
<ReactSelect
|
|
52
|
+
name="test3"
|
|
53
|
+
isDisabled=true
|
|
54
|
+
classNamePrefix="react-select"
|
|
55
|
+
placeholder="Placeholder"
|
|
56
|
+
onChange={v => Js.log(v)}
|
|
57
|
+
options
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
<div>
|
|
61
|
+
<Label htmlFor="test4" optionalMessage={"Optional"->React.string}>
|
|
62
|
+
{"Errored"->React.string}
|
|
63
|
+
</Label>
|
|
64
|
+
<ReactSelect
|
|
65
|
+
name="test4"
|
|
66
|
+
classNamePrefix="react-select"
|
|
67
|
+
className={cx(["errored"])}
|
|
68
|
+
placeholder="Placeholder"
|
|
69
|
+
onChange={v => Js.log(v)}
|
|
70
|
+
options
|
|
71
|
+
/>
|
|
72
|
+
<div className="h-10" />
|
|
73
|
+
<Label htmlFor="test2" optionalMessage={"Optional"->React.string}>
|
|
74
|
+
{"Searchable select with multiple value"->React.string}
|
|
75
|
+
</Label>
|
|
76
|
+
<ReactSelectMultiple
|
|
77
|
+
name="test2"
|
|
78
|
+
defaultValue=[]
|
|
79
|
+
classNamePrefix="react-select"
|
|
80
|
+
placeholder="Placeholder"
|
|
81
|
+
onChange={v => Js.log(v)}
|
|
82
|
+
options
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@module("@root/src/ui/Toolkit__Ui_Table.resi?raw")
|
|
2
|
+
external resi: string = "default"
|
|
3
|
+
|
|
4
|
+
@module("@root/playground/components/Playground_Table.res?raw")
|
|
5
|
+
external codeExample: string = "default"
|
|
6
|
+
|
|
7
|
+
type rec data = array<(test, toto)>
|
|
8
|
+
and test = {
|
|
9
|
+
name: string,
|
|
10
|
+
age: int,
|
|
11
|
+
}
|
|
12
|
+
and toto = Js.Dict.t<string>
|
|
13
|
+
|
|
14
|
+
let data: data = Array.make(100, ({name: "toto", age: 2}, Js.Dict.empty()))
|
|
15
|
+
|
|
16
|
+
@react.component
|
|
17
|
+
let make = () => {
|
|
18
|
+
let columns = React.useMemo0(() => [
|
|
19
|
+
ReactTable.makeColumn(
|
|
20
|
+
~accessor=((value, _dict)) => value.name,
|
|
21
|
+
~id="test",
|
|
22
|
+
~header="Name"->React.string,
|
|
23
|
+
~filterRender=_ => React.null,
|
|
24
|
+
~cell=cell => <p> {cell.cell.value->React.string} </p>,
|
|
25
|
+
(),
|
|
26
|
+
),
|
|
27
|
+
])
|
|
28
|
+
|
|
29
|
+
let table = {
|
|
30
|
+
open ReactTable
|
|
31
|
+
useTable5(
|
|
32
|
+
make(~columns, ~data, ()),
|
|
33
|
+
useFilters,
|
|
34
|
+
useSortBy,
|
|
35
|
+
usePagination,
|
|
36
|
+
useFlexLayout,
|
|
37
|
+
useResizeColumns,
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
<div>
|
|
42
|
+
<Toolkit__Ui_Table.Pagination table />
|
|
43
|
+
<Toolkit__Ui_Table.Core table emptyMessage="No items" />
|
|
44
|
+
</div>
|
|
45
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
open ReachUi
|
|
2
|
+
|
|
3
|
+
let resi = ""
|
|
4
|
+
|
|
5
|
+
@module("@root/playground/components/Playground_Tabs.res?raw")
|
|
6
|
+
external codeExample: string = "default"
|
|
7
|
+
|
|
8
|
+
@react.component
|
|
9
|
+
let make = () => {
|
|
10
|
+
<div className="flex flex-col gap-6">
|
|
11
|
+
<div>
|
|
12
|
+
<Tabs className="flex flex-col">
|
|
13
|
+
<TabList className="cw-Tabs">
|
|
14
|
+
<Tab> {"Tab 1"->React.string} </Tab>
|
|
15
|
+
<Tab> {"Tab 2"->React.string} </Tab>
|
|
16
|
+
</TabList>
|
|
17
|
+
<TabPanels className="mt-4">
|
|
18
|
+
<TabPanel> {"Panel 1"->React.string} </TabPanel>
|
|
19
|
+
<TabPanel> {"Panel 2"->React.string} </TabPanel>
|
|
20
|
+
</TabPanels>
|
|
21
|
+
</Tabs>
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<h2> {"Big"->React.string} </h2>
|
|
25
|
+
<Tabs className="flex flex-col">
|
|
26
|
+
<TabList className="cw-Tabs cw-Tabs--big">
|
|
27
|
+
<Tab> {"Tab 1"->React.string} </Tab>
|
|
28
|
+
<Tab> {"Tab 2"->React.string} </Tab>
|
|
29
|
+
</TabList>
|
|
30
|
+
<TabPanels className="mt-4">
|
|
31
|
+
<TabPanel> {"Panel 1"->React.string} </TabPanel>
|
|
32
|
+
<TabPanel> {"Panel 2"->React.string} </TabPanel>
|
|
33
|
+
</TabPanels>
|
|
34
|
+
</Tabs>
|
|
35
|
+
</div>
|
|
36
|
+
<div>
|
|
37
|
+
<h2> {"Render"->React.string} </h2>
|
|
38
|
+
<TabsRender className="flex flex-col">
|
|
39
|
+
{({selectedIndex}) => <>
|
|
40
|
+
{("selected index : " ++ selectedIndex->Int.toString)->React.string}
|
|
41
|
+
<TabList className="cw-Tabs">
|
|
42
|
+
<Tab> {"Tab 1"->React.string} </Tab>
|
|
43
|
+
<Tab> {"Tab 2"->React.string} </Tab>
|
|
44
|
+
</TabList>
|
|
45
|
+
<TabPanels className="mt-4">
|
|
46
|
+
<TabPanel> {"Panel 1"->React.string} </TabPanel>
|
|
47
|
+
<TabPanel> {"Panel 2"->React.string} </TabPanel>
|
|
48
|
+
</TabPanels>
|
|
49
|
+
</>}
|
|
50
|
+
</TabsRender>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@module("@root/src/ui/Toolkit__Ui_Tag.resi?raw")
|
|
2
|
+
external resi: string = "default"
|
|
3
|
+
|
|
4
|
+
@module("@root/playground/components/Playground_Tag.res?raw")
|
|
5
|
+
external codeExample: string = "default"
|
|
6
|
+
|
|
7
|
+
@react.component
|
|
8
|
+
let make = () => {
|
|
9
|
+
let colors: array<Toolkit__Ui.Tag.color> = [
|
|
10
|
+
#black,
|
|
11
|
+
#white,
|
|
12
|
+
#gray,
|
|
13
|
+
#primary,
|
|
14
|
+
#info,
|
|
15
|
+
#danger,
|
|
16
|
+
#warning,
|
|
17
|
+
#success,
|
|
18
|
+
#neutral,
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
let size: array<Toolkit__Ui.Tag.size> = [#xs, #sm, #md, #lg]
|
|
22
|
+
let variants: array<Toolkit__Ui.Tag.variant> = [#plain, #outline]
|
|
23
|
+
|
|
24
|
+
<div className="flex flex-col gap-4">
|
|
25
|
+
{variants
|
|
26
|
+
->Array.map(variant => {
|
|
27
|
+
<div>
|
|
28
|
+
<h2> {(variant :> string)->React.string} </h2>
|
|
29
|
+
<div className="flex flex-col gap-2">
|
|
30
|
+
{colors
|
|
31
|
+
->Array.mapWithIndex((i, color) =>
|
|
32
|
+
<div key={i->Int.toString ++ color->Obj.magic} className="flex items-center gap-4">
|
|
33
|
+
<strong className="w-32"> {(color :> string)->React.string} </strong>
|
|
34
|
+
{size
|
|
35
|
+
->Array.mapWithIndex(
|
|
36
|
+
(j, size) =>
|
|
37
|
+
<div key={(i + j)->Int.toString ++ size->Obj.magic}>
|
|
38
|
+
<Toolkit__Ui_Tag variant color size>
|
|
39
|
+
{"content"->React.string}
|
|
40
|
+
</Toolkit__Ui_Tag>
|
|
41
|
+
</div>,
|
|
42
|
+
)
|
|
43
|
+
->React.array}
|
|
44
|
+
</div>
|
|
45
|
+
)
|
|
46
|
+
->React.array}
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
})
|
|
50
|
+
->React.array}
|
|
51
|
+
</div>
|
|
52
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
open Toolkit__Ui
|
|
2
|
+
|
|
3
|
+
let resi = ""
|
|
4
|
+
|
|
5
|
+
@module("@root/playground/components/Playground_TextInput.res?raw")
|
|
6
|
+
external codeExample: string = "default"
|
|
7
|
+
|
|
8
|
+
@react.component
|
|
9
|
+
let make = () =>
|
|
10
|
+
<div className="flex flex-col gap-4">
|
|
11
|
+
<div>
|
|
12
|
+
<Label htmlFor="test" optionalMessage={"Optional"->React.string}>
|
|
13
|
+
{"Label"->React.string}
|
|
14
|
+
</Label>
|
|
15
|
+
<TextInput id="test" placeholder="Test" />
|
|
16
|
+
</div>
|
|
17
|
+
<div>
|
|
18
|
+
<Label htmlFor="test" optionalMessage={"Optional"->React.string}>
|
|
19
|
+
{"Label"->React.string}
|
|
20
|
+
</Label>
|
|
21
|
+
<TextInput id="test" placeholder="Test" isInvalid=true />
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|