@colisweb/rescript-toolkit 2.70.0 → 2.70.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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "2.70.0",
3
+ "version": "2.70.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -18,6 +18,8 @@ let components: array<(string, module(Config))> = [
18
18
  ("spinner", module(Playground_Spinner)),
19
19
  ("notice", module(Playground_Notice)),
20
20
  ("snackbar", module(Playground_Snackbar)),
21
+ ("dropdown", module(Playground_Dropdown)),
22
+ ("portalDropdown", module(Playground_PortalDropdown)),
21
23
  ]
22
24
 
23
25
  module List = {
@@ -1,11 +1,11 @@
1
- open Storybook
1
+ @module("@root/src/ui/Toolkit__Ui_Dropdown.resi?raw")
2
+ external resi: string = "default"
2
3
 
3
- @module("!!raw-loader!../../../src/ui/Toolkit__Ui_Dropdown.resi")
4
- external source: 'a = "default"
4
+ @module("@root/playground/components/Playground_Dropdown.res?raw")
5
+ external codeExample: string = "default"
5
6
 
6
- let default = CSF.make(~title="Components/Dropdown", ())
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,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>
@@ -92,7 +92,7 @@ let make = (
92
92
  })}
93
93
  className={cx([
94
94
  "dropdown",
95
- "absolute z-20 bg-white p-2 transform shadow rounded text-base font-normal text-neutral-700 opacity-0",
95
+ "absolute z-40 bg-white p-2 transform shadow rounded text-base font-normal text-neutral-700 opacity-0",
96
96
  dropdownClassName,
97
97
  ])}
98
98
  style={adjustmentStyle->Option.getWithDefault(ReactDOM.Style.make())}>
@@ -0,0 +1,21 @@
1
+ type position = [
2
+ | #bottom
3
+ | #right
4
+ | #top
5
+ | #left
6
+ ]
7
+
8
+ @react.component
9
+ let make: (
10
+ ~label: React.element,
11
+ ~children: Toolkit__Hooks.disclosure => React.element,
12
+ ~dropdownClassName: string=?,
13
+ ~buttonClassName: string=?,
14
+ ~containerClassName: string=?,
15
+ ~defaultIsOpen: bool=?,
16
+ ~onButtonClick: unit => unit=?,
17
+ ~onClickOutside: unit => unit=?,
18
+ ~buttonColor: Toolkit__Ui_Button.color=?,
19
+ ~buttonSize: Toolkit__Ui_Button.size=?,
20
+ ~buttonVariant: Toolkit__Ui_Button.variant=?,
21
+ ) => React.element