@colisweb/rescript-toolkit 5.46.4 → 5.47.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "5.46.4",
3
+ "version": "5.47.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -720,6 +720,7 @@ module Make = (StateLenses: Config) => {
720
720
  ~label=?,
721
721
  ~id,
722
722
  ~size=?,
723
+ ~disabled=?,
723
724
  ~displayTitle=?,
724
725
  ~switchClassName=?,
725
726
  ~labelClassName=?,
@@ -735,6 +736,7 @@ module Make = (StateLenses: Config) => {
735
736
  onChange={value => handleChange(value)}
736
737
  name=id
737
738
  checked=value
739
+ ?disabled
738
740
  ?size
739
741
  ?displayTitle
740
742
  ?switchClassName
@@ -25,8 +25,30 @@ module.exports = {
25
25
  backforth: "backforth 2s ease-in-out infinite",
26
26
  overlayShow: "overlayShow 200ms cubic-bezier(0.16, 1, 0.3, 1)",
27
27
  contentShow: "contentShow 300ms cubic-bezier(0.16, 1, 0.3, 1)",
28
+ slideInLeft: "slideInLeft 0.3s ease-in",
29
+ slideOutRight: "slideInLeft 0.3s ease-in-out",
28
30
  },
29
31
  keyframes: {
32
+ slideInLeft: {
33
+ from: {
34
+ opacity: 0.2,
35
+ left: "100%",
36
+ },
37
+ to: {
38
+ opacity: 1,
39
+ left: "0",
40
+ },
41
+ },
42
+ slideOutRight: {
43
+ from: {
44
+ opacity: 1,
45
+ left: "0%",
46
+ },
47
+ to: {
48
+ opacity: 0,
49
+ left: "100%",
50
+ },
51
+ },
30
52
  backforth: {
31
53
  "0%": { left: "0px" },
32
54
  "50%": { left: "100%" },
@@ -46,3 +46,4 @@ module ScrollArea = Toolkit__Ui_ScrollArea
46
46
  module PasswordRulesNotice = Toolkit__Ui_PasswordRulesNotice
47
47
  module SectionCard = Toolkit__Ui_SectionCard
48
48
  module SuspenseImage = Toolkit__Ui_SuspenseImage
49
+ module Sheet = Toolkit__Ui_Sheet
@@ -0,0 +1,54 @@
1
+ open Radix
2
+ @react.component
3
+ let make = (
4
+ ~disclosure: Toolkit__Hooks.disclosure,
5
+ ~title: option<React.element>=?,
6
+ ~children: React.element,
7
+ ~ariaLabel="",
8
+ ~icon: option<module(ReactIcons.Icon)>=?,
9
+ ~className="",
10
+ ) => {
11
+ <Dialog.Root
12
+ \"open"={disclosure.isOpen}
13
+ onOpenChange={isOpen => {
14
+ if !isOpen {
15
+ disclosure.hide()
16
+ }
17
+ }}>
18
+ <Dialog.Portal>
19
+ <Dialog.Overlay
20
+ className="data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-40"
21
+ />
22
+ <div className="z-50 fixed inset-0 overflow-y-auto flex min-h-full items-start justify-end">
23
+ <Dialog.Content
24
+ side={Right}
25
+ className={cx([
26
+ "bg-white p-4 shadow-lg w-2/3 h-full relative data-[state=open]:animate-slideInLeft data-[state=close]:animate-slideOutRight",
27
+ className,
28
+ ])}>
29
+ <header className={cx(["flex items-center justify-between gap-4"])}>
30
+ {title->Option.mapWithDefault(React.null, title =>
31
+ <Dialog.Title
32
+ className={cx([
33
+ "text-2xl pb-1 inline-flex items-center gap-2 font-display border-b w-full",
34
+ ])}>
35
+ {icon->Option.mapWithDefault(React.null, icon => {
36
+ let module(Icon) = icon
37
+
38
+ <Icon />
39
+ })}
40
+ title
41
+ </Dialog.Title>
42
+ )}
43
+ <button
44
+ onClick={_ => disclosure.hide()}
45
+ className={cx(["rounded-full hover:bg-neutral-200 p-1 modal-close-button"])}>
46
+ <ReactIcons.MdClose size=28 />
47
+ </button>
48
+ </header>
49
+ <div className="mt-4"> children </div>
50
+ </Dialog.Content>
51
+ </div>
52
+ </Dialog.Portal>
53
+ </Dialog.Root>
54
+ }
@@ -0,0 +1,9 @@
1
+ @react.component
2
+ let make: (
3
+ ~disclosure: Toolkit__Hooks.disclosure,
4
+ ~title: React.element=?,
5
+ ~children: React.element,
6
+ ~ariaLabel: string=?,
7
+ ~icon: module(ReactIcons.Icon)=?,
8
+ ~className: string=?,
9
+ ) => React.element
@@ -532,6 +532,7 @@ module Dialog = {
532
532
  onInteractOutside?: ReactEvent.Mouse.t => unit,
533
533
  className?: string,
534
534
  style?: ReactDOMStyle.t,
535
+ side?: side,
535
536
  }
536
537
 
537
538
  type props = {
@@ -551,6 +552,11 @@ module Dialog = {
551
552
  @module("@radix-ui/react-dialog")
552
553
  external make: React.component<props> = "Title"
553
554
  }
555
+ module Description = {
556
+ type props = {className?: string, asChild?: bool, children?: React.element}
557
+ @module("@radix-ui/react-dialog")
558
+ external make: React.component<props> = "Description"
559
+ }
554
560
  }
555
561
 
556
562
  // module ContextMenu = {