@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.
Files changed (171) hide show
  1. package/.yarn/cache/@csstools-cascade-layer-name-parser-npm-1.0.1-3c03e04847-ca85af36ab.zip +0 -0
  2. package/.yarn/cache/@csstools-css-parser-algorithms-npm-2.0.1-d93fd57f45-9f168cfc8f.zip +0 -0
  3. package/.yarn/cache/@csstools-css-tokenizer-npm-2.0.1-844d89aa1a-b52ac9fc19.zip +0 -0
  4. package/.yarn/cache/@csstools-media-query-list-parser-npm-2.0.1-6d8da9a941-f30b2a9e1a.zip +0 -0
  5. package/.yarn/cache/@csstools-postcss-cascade-layers-npm-3.0.1-fcae0e8d19-da39631e23.zip +0 -0
  6. package/.yarn/cache/@csstools-postcss-color-function-npm-2.0.1-34522e4c49-0e6ce71636.zip +0 -0
  7. package/.yarn/cache/@csstools-postcss-font-format-keywords-npm-2.0.1-f30ce2e0ea-b9e2fc83e2.zip +0 -0
  8. package/.yarn/cache/@csstools-postcss-hwb-function-npm-2.0.1-0a198205ed-8134c45bb9.zip +0 -0
  9. package/.yarn/cache/@csstools-postcss-ic-unit-npm-2.0.1-af9dff83ea-18a239451a.zip +0 -0
  10. package/.yarn/cache/@csstools-postcss-is-pseudo-class-npm-3.0.1-eee09c2887-c736b35cfd.zip +0 -0
  11. package/.yarn/cache/@csstools-postcss-logical-float-and-clear-npm-1.0.1-bcc4cd5492-5184cd62a6.zip +0 -0
  12. package/.yarn/cache/@csstools-postcss-logical-resize-npm-1.0.1-f2df14ea6f-b19f340d19.zip +0 -0
  13. package/.yarn/cache/@csstools-postcss-logical-viewport-units-npm-1.0.2-ffddbc4f90-8780dd03c1.zip +0 -0
  14. package/.yarn/cache/@csstools-postcss-media-queries-aspect-ratio-number-values-npm-1.0.1-c7c2022b49-cbcf01db72.zip +0 -0
  15. package/.yarn/cache/@csstools-postcss-nested-calc-npm-2.0.1-6a7c107213-0ab4774879.zip +0 -0
  16. package/.yarn/cache/@csstools-postcss-normalize-display-values-npm-2.0.1-6e35aa6dbe-d67779977b.zip +0 -0
  17. package/.yarn/cache/@csstools-postcss-oklab-function-npm-2.0.1-905b1f47ea-78a677492e.zip +0 -0
  18. package/.yarn/cache/@csstools-postcss-progressive-custom-properties-npm-2.0.1-dbdcdfdf80-4d0d8df31a.zip +0 -0
  19. package/.yarn/cache/@csstools-postcss-scope-pseudo-class-npm-2.0.1-edf946c1fb-e53d520130.zip +0 -0
  20. package/.yarn/cache/@csstools-postcss-stepped-value-functions-npm-2.0.1-fedf469bf1-907f9a30b9.zip +0 -0
  21. package/.yarn/cache/@csstools-postcss-text-decoration-shorthand-npm-2.1.0-17a49e6bd6-760f821ee3.zip +0 -0
  22. package/.yarn/cache/@csstools-postcss-trigonometric-functions-npm-2.0.1-0a04a18052-b2b7aa8d59.zip +0 -0
  23. package/.yarn/cache/@csstools-postcss-unset-value-npm-2.0.1-b5b03d712f-51fe220dad.zip +0 -0
  24. package/.yarn/cache/@csstools-selector-specificity-npm-2.1.1-1d0a01f035-392ab62732.zip +0 -0
  25. package/.yarn/cache/@originjs-vite-plugin-commonjs-npm-1.0.3-75b36e7757-e4cd22a73e.zip +0 -0
  26. package/.yarn/cache/css-blank-pseudo-npm-5.0.1-b30f0dbdbd-d5e94c4bc4.zip +0 -0
  27. package/.yarn/cache/css-has-pseudo-npm-5.0.1-1e21124076-6674393fe7.zip +0 -0
  28. package/.yarn/cache/css-prefers-color-scheme-npm-8.0.1-66ab97dc9a-766ff644d4.zip +0 -0
  29. package/.yarn/cache/cssdb-npm-7.4.1-8827244a56-c58803ce3e.zip +0 -0
  30. package/.yarn/cache/esbuild-linux-64-npm-0.14.54-2cb8070ade-8.zip +0 -0
  31. package/.yarn/cache/esbuild-npm-0.14.54-b3dcd8a41e-49e360b118.zip +0 -0
  32. package/.yarn/cache/postcss-attribute-case-insensitive-npm-6.0.1-53cf4e827e-1feb61c031.zip +0 -0
  33. package/.yarn/cache/postcss-color-functional-notation-npm-5.0.1-3124cba045-1525779b2d.zip +0 -0
  34. package/.yarn/cache/postcss-color-hex-alpha-npm-9.0.1-4de0057ece-3f35134833.zip +0 -0
  35. package/.yarn/cache/postcss-color-rebeccapurple-npm-8.0.1-60be592329-ea141bf9ca.zip +0 -0
  36. package/.yarn/cache/postcss-custom-media-npm-9.1.1-1a3a67cb63-3694c53423.zip +0 -0
  37. package/.yarn/cache/postcss-custom-properties-npm-13.1.1-31267ed000-21af14e82a.zip +0 -0
  38. package/.yarn/cache/postcss-custom-selectors-npm-7.1.1-74894a31ad-df79db6237.zip +0 -0
  39. package/.yarn/cache/postcss-dir-pseudo-class-npm-7.0.1-76e71e42f9-4d1c204e13.zip +0 -0
  40. package/.yarn/cache/postcss-double-position-gradients-npm-4.0.1-53c9bf55aa-8f17f35082.zip +0 -0
  41. package/.yarn/cache/postcss-focus-visible-npm-8.0.1-7126799e89-6d6734ba0a.zip +0 -0
  42. package/.yarn/cache/postcss-focus-within-npm-7.0.1-0434464641-c110a45427.zip +0 -0
  43. package/.yarn/cache/postcss-gap-properties-npm-4.0.1-2b5cdc5f7e-21a5d5525d.zip +0 -0
  44. package/.yarn/cache/postcss-image-set-function-npm-5.0.1-f7dd97337c-bd55be8ee1.zip +0 -0
  45. package/.yarn/cache/postcss-lab-function-npm-5.0.1-7c27612597-bdca34254b.zip +0 -0
  46. package/.yarn/cache/postcss-logical-npm-6.0.1-3465206299-cb1812fb55.zip +0 -0
  47. package/.yarn/cache/postcss-nesting-npm-11.1.0-29caff6110-639392ca69.zip +0 -0
  48. package/.yarn/cache/postcss-opacity-percentage-npm-1.1.3-552e884ed7-54d1b8ca68.zip +0 -0
  49. package/.yarn/cache/postcss-overflow-shorthand-npm-4.0.1-ca060456c3-f0efcea4fb.zip +0 -0
  50. package/.yarn/cache/postcss-place-npm-8.0.1-b45b2668b9-c812c858aa.zip +0 -0
  51. package/.yarn/cache/postcss-preset-env-npm-8.0.1-a400fc01d4-18326a03dd.zip +0 -0
  52. package/.yarn/cache/postcss-pseudo-class-any-link-npm-8.0.1-c80df879bb-f84b0fe4c0.zip +0 -0
  53. package/.yarn/cache/postcss-selector-not-npm-7.0.1-8f1507853b-4dec95f785.zip +0 -0
  54. package/.yarn/install-state.gz +0 -0
  55. package/package.json +3 -2
  56. package/playground/PlaygroundApp.res +45 -9
  57. package/playground/PlaygroundComponents.res +16 -0
  58. package/playground/PlaygroundHooks.res +111 -0
  59. package/playground/PlaygroundRouter.res +19 -0
  60. package/playground/components/Playground_Accordion.res +2 -2
  61. package/playground/components/Playground_Button.res +16 -0
  62. package/playground/components/Playground_Checkbox.res +60 -0
  63. package/playground/components/Playground_Combobox.res +38 -0
  64. package/playground/components/Playground_DropdownList.res +40 -0
  65. package/playground/{stories/Toolkit__UI_FormStory.res → components/Playground_Form.res} +58 -33
  66. package/playground/components/Playground_IconButton.res +65 -0
  67. package/playground/components/Playground_MultiSelect.res +1 -1
  68. package/playground/components/Playground_ProgressBar.res +33 -0
  69. package/playground/components/Playground_Radio.res +23 -0
  70. package/playground/components/Playground_Reference.res +16 -0
  71. package/playground/components/Playground_RichText.res +22 -0
  72. package/playground/components/Playground_Select.res +86 -0
  73. package/playground/components/Playground_Table.res +45 -0
  74. package/playground/components/Playground_Tabs.res +53 -0
  75. package/playground/components/Playground_Tag.res +52 -0
  76. package/playground/components/Playground_TextInput.res +23 -0
  77. package/playground/components/Playground_Tooltip.res +90 -0
  78. package/playground/design/DesignSystem_Colors.mdx +0 -2
  79. package/playground/design/DesignSystem_Fonts.mdx +0 -2
  80. package/playground/design/DesignSystem_MediaQueries.mdx +0 -2
  81. package/playground/design/TailwindConfigBreakpoints.jsx +1 -1
  82. package/playground/design/TailwindConfigColorsPreview.jsx +2 -2
  83. package/playground/design/TailwindConfigFontsPreview.jsx +1 -1
  84. package/playground/hooks/Playground_Clipboard.res +19 -0
  85. package/playground/hooks/Playground_Disclosure.res +24 -0
  86. package/playground/hooks/Playground_LazyLoad.res +31 -0
  87. package/playground/hooks/Playground_MediaQueries.res +11 -0
  88. package/public/_redirects +1 -0
  89. package/src/form/Toolkit__Form.res +2 -2
  90. package/src/form/Toolkit__FormValidationFunctions.res +13 -0
  91. package/src/router/Toolkit__Router.res +2 -2
  92. package/src/ui/Toolkit__Ui_Alert.res +4 -4
  93. package/src/ui/Toolkit__Ui_Button.res +40 -5
  94. package/src/ui/Toolkit__Ui_Button.resi +3 -2
  95. package/src/ui/Toolkit__Ui_Card.res +4 -4
  96. package/src/ui/Toolkit__Ui_Checkbox.res +1 -1
  97. package/src/ui/Toolkit__Ui_CopyWrapper.res +1 -1
  98. package/src/ui/Toolkit__Ui_Layout.res +11 -6
  99. package/src/ui/Toolkit__Ui_ListboxInput.res +3 -3
  100. package/src/ui/Toolkit__Ui_Modal.res +1 -1
  101. package/src/ui/Toolkit__Ui_MultiSelect.res +1 -1
  102. package/src/ui/Toolkit__Ui_Radio.res +1 -1
  103. package/src/ui/Toolkit__Ui_Reference.res +1 -5
  104. package/src/ui/Toolkit__Ui_Select.res +1 -1
  105. package/src/ui/Toolkit__Ui_Snackbar.res +4 -4
  106. package/src/ui/Toolkit__Ui_Table.res +2 -2
  107. package/src/ui/Toolkit__Ui_WeekDateFilter.res +2 -2
  108. package/src/vendors/{BsReactIcons.res → ReactIcons.res} +14 -0
  109. package/vite.config.js +2 -0
  110. package/.yarn/cache/@csstools-postcss-cascade-layers-npm-1.1.1-4382e19cf0-8ecd6a929e.zip +0 -0
  111. package/.yarn/cache/@csstools-postcss-color-function-npm-1.1.1-7c5a0199ae-087595985e.zip +0 -0
  112. package/.yarn/cache/@csstools-postcss-font-format-keywords-npm-1.0.1-ef1db49912-ed8d9eab97.zip +0 -0
  113. package/.yarn/cache/@csstools-postcss-hwb-function-npm-1.0.2-f3f621e351-352ead754a.zip +0 -0
  114. package/.yarn/cache/@csstools-postcss-ic-unit-npm-1.0.1-111638e451-09c414c9b7.zip +0 -0
  115. package/.yarn/cache/@csstools-postcss-is-pseudo-class-npm-2.0.7-c85939401b-a4494bb8e9.zip +0 -0
  116. package/.yarn/cache/@csstools-postcss-nested-calc-npm-1.0.0-8028506411-53bb783dd6.zip +0 -0
  117. package/.yarn/cache/@csstools-postcss-normalize-display-values-npm-1.0.1-53721ce3eb-75901daec3.zip +0 -0
  118. package/.yarn/cache/@csstools-postcss-oklab-function-npm-1.1.1-2907029cf1-d66b789060.zip +0 -0
  119. package/.yarn/cache/@csstools-postcss-progressive-custom-properties-npm-1.3.0-1e56504855-e281845fde.zip +0 -0
  120. package/.yarn/cache/@csstools-postcss-stepped-value-functions-npm-1.0.1-01aa1138bd-2fc88713a0.zip +0 -0
  121. package/.yarn/cache/@csstools-postcss-text-decoration-shorthand-npm-1.0.0-96f61ef9fe-d27aaf9787.zip +0 -0
  122. package/.yarn/cache/@csstools-postcss-trigonometric-functions-npm-1.0.2-4553514702-f7f5b5f249.zip +0 -0
  123. package/.yarn/cache/@csstools-postcss-unset-value-npm-1.0.2-f57c79bfc4-3facdae154.zip +0 -0
  124. package/.yarn/cache/css-blank-pseudo-npm-3.0.3-af86e84805-9be0a13885.zip +0 -0
  125. package/.yarn/cache/css-has-pseudo-npm-3.0.4-e97bb61896-8f165d68f6.zip +0 -0
  126. package/.yarn/cache/css-prefers-color-scheme-npm-6.0.3-e1c91bc5cd-3a2b02f045.zip +0 -0
  127. package/.yarn/cache/cssdb-npm-7.2.0-ce2edad2c6-a571955eac.zip +0 -0
  128. package/.yarn/cache/postcss-attribute-case-insensitive-npm-5.0.2-6aa24bfafa-c0b8139f37.zip +0 -0
  129. package/.yarn/cache/postcss-color-functional-notation-npm-4.2.4-8f3a9400c3-b763e164fe.zip +0 -0
  130. package/.yarn/cache/postcss-color-hex-alpha-npm-8.0.4-88605e8cec-a2f3173a60.zip +0 -0
  131. package/.yarn/cache/postcss-color-rebeccapurple-npm-7.1.1-b7828c0a0c-03482f9b81.zip +0 -0
  132. package/.yarn/cache/postcss-custom-media-npm-8.0.2-5ad89ea0fe-887bbbacf6.zip +0 -0
  133. package/.yarn/cache/postcss-custom-properties-npm-12.1.11-78be1c709e-421f9d8d6b.zip +0 -0
  134. package/.yarn/cache/postcss-custom-selectors-npm-6.0.3-0a63667536-18080d60a8.zip +0 -0
  135. package/.yarn/cache/postcss-dir-pseudo-class-npm-6.0.5-2555aeb05f-7810c439d8.zip +0 -0
  136. package/.yarn/cache/postcss-double-position-gradients-npm-3.1.2-278f758391-ca09bf2aef.zip +0 -0
  137. package/.yarn/cache/postcss-env-function-npm-4.0.6-2282fa7c63-645b2363cf.zip +0 -0
  138. package/.yarn/cache/postcss-focus-visible-npm-6.0.4-2eb1d7ff31-acd010b9dd.zip +0 -0
  139. package/.yarn/cache/postcss-focus-within-npm-5.0.4-d70f73ac5d-f23d8ab757.zip +0 -0
  140. package/.yarn/cache/postcss-gap-properties-npm-3.0.5-78f268ad64-aed559d6d3.zip +0 -0
  141. package/.yarn/cache/postcss-image-set-function-npm-4.0.7-46769dca3e-7e50933098.zip +0 -0
  142. package/.yarn/cache/postcss-lab-function-npm-4.2.1-1ebd916151-26ac74b430.zip +0 -0
  143. package/.yarn/cache/postcss-logical-npm-5.0.4-cf11b97479-17c71291ed.zip +0 -0
  144. package/.yarn/cache/postcss-nesting-npm-10.2.0-eec5f664e8-25e6e66186.zip +0 -0
  145. package/.yarn/cache/postcss-opacity-percentage-npm-1.1.2-3f7d2b6abb-b582f6d4ef.zip +0 -0
  146. package/.yarn/cache/postcss-overflow-shorthand-npm-3.0.4-b5a0785c77-7400902249.zip +0 -0
  147. package/.yarn/cache/postcss-place-npm-7.0.5-895593f8b4-903fec0c31.zip +0 -0
  148. package/.yarn/cache/postcss-preset-env-npm-7.8.3-242e470fd9-71bfb697ff.zip +0 -0
  149. package/.yarn/cache/postcss-pseudo-class-any-link-npm-7.1.6-1a34600b0e-43aa18ea1e.zip +0 -0
  150. package/.yarn/cache/postcss-selector-not-npm-6.0.1-135f19a20c-fe523a0219.zip +0 -0
  151. package/playground/stories/Storybook.res +0 -178
  152. package/playground/stories/Toolkit__Hooks_ClipboardStory.res +0 -44
  153. package/playground/stories/Toolkit__Hooks_DisclosureStory.res +0 -56
  154. package/playground/stories/Toolkit__Hooks_LazyLoadStory.res +0 -58
  155. package/playground/stories/Toolkit__UI_CheckboxStory.res +0 -150
  156. package/playground/stories/Toolkit__UI_ComboboxStory.res +0 -64
  157. package/playground/stories/Toolkit__UI_DropdownListStory.res +0 -89
  158. package/playground/stories/Toolkit__UI_IconButtonStory.res +0 -140
  159. package/playground/stories/Toolkit__UI_NativeDatePickerStory.res +0 -60
  160. package/playground/stories/Toolkit__UI_PortalDropdownStory.res +0 -40
  161. package/playground/stories/Toolkit__UI_RadioStory.res +0 -128
  162. package/playground/stories/Toolkit__UI_ReferenceStory.res +0 -37
  163. package/playground/stories/Toolkit__UI_RichTextStory.res +0 -40
  164. package/playground/stories/Toolkit__UI_SelectStory.res +0 -153
  165. package/playground/stories/Toolkit__UI_TableStory.res +0 -103
  166. package/playground/stories/Toolkit__UI_TableStory.resi +0 -3
  167. package/playground/stories/Toolkit__UI_TabsStory.res +0 -52
  168. package/playground/stories/Toolkit__UI_TagStory.res +0 -160
  169. package/playground/stories/Toolkit__UI_TextInputStory.res +0 -71
  170. package/playground/stories/Toolkit__UI_TooltipStory.res +0 -136
  171. package/playground/stories/Toolkit__Ui_ProgressBarStory.res +0 -49
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "2.70.1",
3
+ "version": "2.71.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -60,7 +60,7 @@
60
60
  "list-selectors": "2.0.1",
61
61
  "lodash": "4.17.21",
62
62
  "postcss": "8.4.21",
63
- "postcss-preset-env": "7.8.3",
63
+ "postcss-preset-env": "8.0.1",
64
64
  "prismjs": "1.29.0",
65
65
  "react": "18.2.0",
66
66
  "react-big-calendar": "1.5.2",
@@ -90,6 +90,7 @@
90
90
  "@mdx-js/mdx": "2.2.1",
91
91
  "@mdx-js/react": "2.2.1",
92
92
  "@mdx-js/rollup": "2.2.1",
93
+ "@originjs/vite-plugin-commonjs": "^1.0.3",
93
94
  "@types/react": "^18.0.26",
94
95
  "@types/react-dom": "^18.0.9",
95
96
  "@vitejs/plugin-react": "^3.0.0",
@@ -2,13 +2,13 @@ let links: array<PlaygroundRouter.navLink> = [
2
2
  Single(
3
3
  App({
4
4
  route: Home,
5
- icon: <BsReactIcons.MdHome size={30} />,
5
+ icon: <ReactIcons.MdHome size={30} />,
6
6
  label: "Home"->React.string,
7
7
  }),
8
8
  ),
9
9
  Grouped(
10
10
  {
11
- icon: <BsReactIcons.FaBook size={30} />,
11
+ icon: <ReactIcons.FaBook size={30} />,
12
12
  label: "Docs"->React.string,
13
13
  },
14
14
  [
@@ -26,15 +26,45 @@ let links: array<PlaygroundRouter.navLink> = [
26
26
  }),
27
27
  ],
28
28
  ),
29
+ Grouped(
30
+ {
31
+ icon: <ReactIcons.BsPalette size={30} />,
32
+ label: "Design"->React.string,
33
+ },
34
+ [
35
+ App({
36
+ label: "Fonts"->React.string,
37
+ route: DesignSystem(Fonts),
38
+ }),
39
+ App({
40
+ label: "Colors"->React.string,
41
+ route: DesignSystem(Colors),
42
+ }),
43
+ App({
44
+ label: "MediaQueries"->React.string,
45
+ route: DesignSystem(MediaQueries),
46
+ }),
47
+ ],
48
+ ),
29
49
  Single(
30
50
  App({
31
51
  label: "Components"->React.string,
32
- icon: <BsReactIcons.SiDatabricks size={30} />,
52
+ icon: <ReactIcons.SiDatabricks size={30} />,
33
53
  route: Components(List),
34
54
  }),
35
55
  ),
56
+ Single(
57
+ App({
58
+ label: "Hooks"->React.string,
59
+ icon: <ReactIcons.GiHook size={30} />,
60
+ route: Hooks(List),
61
+ }),
62
+ ),
36
63
  ]
37
64
 
65
+ @val
66
+ external baseUrl: string = "import.meta.env.BASE_URL"
67
+
38
68
  @react.component
39
69
  let make = () => {
40
70
  <PlaygroundLocales.Provider>
@@ -44,6 +74,7 @@ let make = () => {
44
74
  onLogoClick={() => {
45
75
  PlaygroundRouter.redirect(Home)
46
76
  }}
77
+ logoSrc={`${baseUrl}assets/logo.svg`}
47
78
  sideNavRender={(
48
79
  {
49
80
  onLinkClick,
@@ -80,18 +111,23 @@ let make = () => {
80
111
  | Form => <Playground_Docs.Form />
81
112
  | Requests => <Playground_Docs.Requests />
82
113
  }
83
- | DesignSystem(_route) => React.null
84
- // switch route {
85
- // | Fonts => <Playground_DesignSystem.Fonts />
86
- // | Colors => <Playground_DesignSystem.Colors />
87
- // | MediaQueries => <Playground_DesignSystem.MediaQueries />
88
- // }
114
+ | DesignSystem(route) =>
115
+ switch route {
116
+ | Fonts => <Playground_DesignSystem.Fonts />
117
+ | Colors => <Playground_DesignSystem.Colors />
118
+ | MediaQueries => <Playground_DesignSystem.MediaQueries />
119
+ }
89
120
 
90
121
  | Components(component) =>
91
122
  switch component {
92
123
  | List => <PlaygroundComponents.List />
93
124
  | Details(component) => <PlaygroundComponents.Details component />
94
125
  }
126
+ | Hooks(component) =>
127
+ switch component {
128
+ | List => <PlaygroundHooks.List />
129
+ | Details(component) => <PlaygroundHooks.Details component />
130
+ }
95
131
 
96
132
  | NotFound => "NotFound"->React.string
97
133
  }}
@@ -20,6 +20,21 @@ let components: array<(string, module(Config))> = [
20
20
  ("snackbar", module(Playground_Snackbar)),
21
21
  ("dropdown", module(Playground_Dropdown)),
22
22
  ("portalDropdown", module(Playground_PortalDropdown)),
23
+ ("tabs", module(Playground_Tabs)),
24
+ ("reference", module(Playground_Reference)),
25
+ ("select", module(Playground_Select)),
26
+ ("checkbox", module(Playground_Checkbox)),
27
+ ("tag", module(Playground_Tag)),
28
+ ("radio", module(Playground_Radio)),
29
+ ("richText", module(Playground_RichText)),
30
+ ("table", module(Playground_Table)),
31
+ ("ProgressBar", module(Playground_ProgressBar)),
32
+ ("Tooltip", module(Playground_Tooltip)),
33
+ ("DropdownList", module(Playground_DropdownList)),
34
+ ("TextInput", module(Playground_TextInput)),
35
+ ("Form", module(Playground_Form)),
36
+ ("Combobox", module(Playground_Combobox)),
37
+ ("IconButton", module(Playground_IconButton)),
23
38
  ]
24
39
 
25
40
  module List = {
@@ -55,6 +70,7 @@ module List = {
55
70
  </h1>
56
71
  <div className="flex flex-row flex-wrap gap-4">
57
72
  {components
73
+ ->Lodash.sortBy(((name, _)) => name->Js.String2.toLowerCase)
58
74
  ->Array.keep(((name, _)) => name->Js.String2.toLowerCase->Js.String2.includes(search))
59
75
  ->Array.map(((name, _)) => <ComponentLink name key={name} />)
60
76
  ->React.array}
@@ -0,0 +1,111 @@
1
+ module type Config = {
2
+ let resi: string
3
+ let codeExample: string
4
+ @react.component
5
+ let make: unit => React.element
6
+ }
7
+
8
+ let components: array<(string, module(Config))> = [
9
+ ("Clipboard", module(Playground_Clipboard)),
10
+ ("Disclosure", module(Playground_Disclosure)),
11
+ ("LazyLoad", module(Playground_LazyLoad)),
12
+ ("MediaQueries", module(Playground_MediaQueries)),
13
+ ]
14
+
15
+ module List = {
16
+ module ComponentLink = {
17
+ @react.component
18
+ let make = (~name) => {
19
+ <PlaygroundRouter.Link
20
+ route={Hooks(Details(name))}
21
+ className="p-4 rounded-lg border bg-white hover:border-primary-700 w-64">
22
+ <strong className="capitalize"> {name->React.string} </strong>
23
+ </PlaygroundRouter.Link>
24
+ }
25
+ }
26
+
27
+ @react.component
28
+ let make = () => {
29
+ let (search, setSearch) = React.useState(() => "")
30
+
31
+ <div>
32
+ <h1 className="text-4xl font-bold font-display mb-4 flex flex-row gap-4 items-center">
33
+ {"Hooks"->React.string}
34
+ <input
35
+ type_="search"
36
+ placeholder="Search"
37
+ value={search}
38
+ onChange={event => {
39
+ let target = event->ReactEvent.Form.target
40
+
41
+ setSearch(_ => target["value"])
42
+ }}
43
+ className="bg-white text-sm font-sans px-4 font-normal rounded-md border border-neutral-300 focus:border-primary-700 h-10 w-60"
44
+ />
45
+ </h1>
46
+ <div className="flex flex-row flex-wrap gap-4">
47
+ {components
48
+ ->Array.keep(((name, _)) => name->Js.String2.toLowerCase->Js.String2.includes(search))
49
+ ->Array.map(((name, _)) => <ComponentLink name key={name} />)
50
+ ->React.array}
51
+ </div>
52
+ </div>
53
+ }
54
+ }
55
+
56
+ module Details = {
57
+ module Component = {
58
+ @react.component
59
+ let make = (~component: module(Config)) => {
60
+ let module(Config) = component
61
+ <div>
62
+ <ReachUi.Tabs>
63
+ <ReachUi.TabList className="mb-4">
64
+ <ReachUi.Tab> {"Example"->React.string} </ReachUi.Tab>
65
+ <ReachUi.Tab> {"Code example"->React.string} </ReachUi.Tab>
66
+ <ReachUi.Tab> {"API"->React.string} </ReachUi.Tab>
67
+ </ReachUi.TabList>
68
+ <ReachUi.TabPanels>
69
+ <ReachUi.TabPanel>
70
+ <Config />
71
+ </ReachUi.TabPanel>
72
+ <ReachUi.TabPanel>
73
+ <Playground_CodeBlock code={Config.codeExample} />
74
+ </ReachUi.TabPanel>
75
+ <ReachUi.TabPanel>
76
+ <Playground_CodeBlock code={Config.resi} />
77
+ </ReachUi.TabPanel>
78
+ </ReachUi.TabPanels>
79
+ </ReachUi.Tabs>
80
+ </div>
81
+ }
82
+ }
83
+
84
+ @react.component
85
+ let make = (~component: string) => {
86
+ PlaygroundRouter.Breadcrumb.use([
87
+ {
88
+ route: Hooks(List),
89
+ text: "Hooks"->React.string,
90
+ },
91
+ {
92
+ route: Hooks(Details(component)),
93
+ text: <span className="capitalize"> {`${component}`->React.string} </span>,
94
+ },
95
+ ])
96
+ <div>
97
+ <h1 className="text-4xl font-bold font-display mb-4 capitalize">
98
+ {component->React.string}
99
+ </h1>
100
+ <div>
101
+ {components
102
+ ->Array.getBy(((name, _)) => {
103
+ component->Js.String2.toLowerCase === name->Js.String2.toLowerCase
104
+ })
105
+ ->Option.mapWithDefault("unknown"->React.string, ((_, playgroundModule)) => {
106
+ <Component component={playgroundModule} />
107
+ })}
108
+ </div>
109
+ </div>
110
+ }
111
+ }
@@ -2,6 +2,9 @@ module RouterConfig = {
2
2
  type componentRoutes =
3
3
  | List
4
4
  | Details(string)
5
+ type hookRoutes =
6
+ | List
7
+ | Details(string)
5
8
  type docRoutes =
6
9
  | ApiDecoding
7
10
  | Identifiers
@@ -17,6 +20,7 @@ module RouterConfig = {
17
20
  | Home
18
21
  | Docs(docRoutes)
19
22
  | Components(componentRoutes)
23
+ | Hooks(hookRoutes)
20
24
  | DesignSystem(designRoutes)
21
25
  | NotFound
22
26
 
@@ -49,6 +53,12 @@ module RouterConfig = {
49
53
  | list{component} => Components(Details(component))
50
54
  | _ => NotFound
51
55
  }
56
+ | list{"hooks", ...rest} =>
57
+ switch rest {
58
+ | list{} => Hooks(List)
59
+ | list{component} => Hooks(Details(component))
60
+ | _ => NotFound
61
+ }
52
62
 
53
63
  | _ => NotFound
54
64
  }
@@ -90,6 +100,15 @@ module RouterConfig = {
90
100
  }
91
101
  }
92
102
 
103
+ | Hooks(route) => {
104
+ let base = `${baseUrl}hooks`
105
+
106
+ switch route {
107
+ | List => `${base}`
108
+ | Details(component) => `${base}/${component}`
109
+ }
110
+ }
111
+
93
112
  | NotFound => `${baseUrl}404`
94
113
  }
95
114
  }
@@ -13,7 +13,7 @@ let make = () =>
13
13
  {"title"->React.string}
14
14
  <AccordionButton>
15
15
  <span className="cw-accordion-icon">
16
- <BsReactIcons.MdKeyboardArrowRight />
16
+ <ReactIcons.MdKeyboardArrowRight />
17
17
  </span>
18
18
  </AccordionButton>
19
19
  <AccordionPanel> {"content"->React.string} </AccordionPanel>
@@ -22,7 +22,7 @@ let make = () =>
22
22
  <AccordionButton className="flex items-center">
23
23
  {"title"->React.string}
24
24
  <span className="cw-accordion-icon">
25
- <BsReactIcons.MdKeyboardArrowRight />
25
+ <ReactIcons.MdKeyboardArrowRight />
26
26
  </span>
27
27
  </AccordionButton>
28
28
  <AccordionPanel> {"content"->React.string} </AccordionPanel>
@@ -63,6 +63,22 @@ let make = () => {
63
63
  </div>,
64
64
  )
65
65
  ->React.array}
66
+ <div className="flex items-center gap-1 mb-2">
67
+ {sizes
68
+ ->Js.Dict.entries
69
+ ->Array.mapWithIndex(
70
+ (k, (sizeText, size)) =>
71
+ <div
72
+ key={(i + k)->Int.toString ++ "icon" ++ ((color :> string) ++ sizeText)}
73
+ className="flex flex-col justify-center items-center">
74
+ <Toolkit__Ui_Button leftIcon=module(ReactIcons.FaCheck) variant color size>
75
+ {"hello"->React.string}
76
+ </Toolkit__Ui_Button>
77
+ <span className="text-xxs"> {sizeText->React.string} </span>
78
+ </div>,
79
+ )
80
+ ->React.array}
81
+ </div>
66
82
  </div>
67
83
  </div>
68
84
  })
@@ -0,0 +1,60 @@
1
+
2
+ open Toolkit__Ui
3
+
4
+ @module("@root/src/ui/Toolkit__Ui_Checkbox.resi?raw")
5
+ external resi: string = "default"
6
+
7
+ @module("@root/playground/components/Playground_Checkbox.res?raw")
8
+ external codeExample: string = "default"
9
+
10
+ @react.component
11
+ let make = () => {
12
+ let (checked, setChecked) = React.useState(() => true)
13
+
14
+ <div className="flex flex-col gap-4">
15
+ <Checkbox name="test" value="test"> {"children"->React.string} </Checkbox>
16
+ <Checkbox
17
+ name="test2" value="test" inverseLabel={true} checkedClassname="border border-success-500">
18
+ {"children"->React.string}
19
+ </Checkbox>
20
+ <Checkbox
21
+ name="test2"
22
+ value="test"
23
+ inverseLabel={true}
24
+ checkedClassname="border border-success-500"
25
+ hideLabel={true}>
26
+ {"children"->React.string}
27
+ </Checkbox>
28
+ <div className="w-64">
29
+ <h2> {"controlled"->React.string} </h2>
30
+ <Checkbox
31
+ name="test2"
32
+ value="test"
33
+ checked
34
+ onChange={(checked, _) => setChecked(_ => checked)}
35
+ checkedClassname="border border-success-500"
36
+ hideLabel={true}>
37
+ {"children"->React.string}
38
+ </Checkbox>
39
+ <button onClick={_ => setChecked(c => !c)}> {"toggle"->React.string} </button>
40
+ </div>
41
+ <div>
42
+ <h2> {"Checked"->React.string} </h2>
43
+ <Checkbox checked=true name="test" value="test"> {"children"->React.string} </Checkbox>
44
+ </div>
45
+ <div>
46
+ <Checkbox checked=true name="test" value="test" size=#xs className="mb-4">
47
+ {"xs"->React.string}
48
+ </Checkbox>
49
+ <Checkbox checked=true name="test" value="test" size=#sm className="mb-4">
50
+ {"sm"->React.string}
51
+ </Checkbox>
52
+ <Checkbox checked=true name="test" value="test" size=#md className="mb-4">
53
+ {"md"->React.string}
54
+ </Checkbox>
55
+ <Checkbox checked=true name="test" value="test" size=#lg className="mb-4">
56
+ {"lg"->React.string}
57
+ </Checkbox>
58
+ </div>
59
+ </div>
60
+ }
@@ -0,0 +1,38 @@
1
+ open ReachUi.Combobox
2
+
3
+ let resi = ""
4
+
5
+ @module("@root/playground/components/Playground_Combobox.res?raw")
6
+ external codeExample: string = "default"
7
+
8
+ @react.component
9
+ let make = () =>
10
+ <div className="w-60">
11
+ <Combobox onSelect={value => Js.log(value)}>
12
+ <ComboboxInput
13
+ onChange={event => ReactEvent.Form.target(event)["value"]->Js.log} selectOnClick=true
14
+ />
15
+ <ComboboxPopover>
16
+ <ComboboxList>
17
+ <ComboboxOption value="test">
18
+ <ComboboxOptionText />
19
+ </ComboboxOption>
20
+ <ComboboxOption value="test2">
21
+ <ComboboxOptionText />
22
+ </ComboboxOption>
23
+ <ComboboxOption value="test4">
24
+ <ComboboxOptionText />
25
+ </ComboboxOption>
26
+ <ComboboxOption value="really big return value example an address from google maps">
27
+ <ComboboxOptionText />
28
+ </ComboboxOption>
29
+ <ComboboxOption value="toto">
30
+ <ComboboxOptionText />
31
+ </ComboboxOption>
32
+ <ComboboxOption value="aaa">
33
+ <ComboboxOptionText />
34
+ </ComboboxOption>
35
+ </ComboboxList>
36
+ </ComboboxPopover>
37
+ </Combobox>
38
+ </div>
@@ -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
+ }