@colisweb/rescript-toolkit 5.30.4 → 5.31.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.30.4",
3
+ "version": "5.31.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -55,6 +55,7 @@ let make = (
55
55
  ~type_=#default,
56
56
  ~footer=?,
57
57
  ~ariaLabel="",
58
+ ~icon: option<module(ReactIcons.Icon)>=?,
58
59
  ) =>
59
60
  <HeadlessUi.Dialog \"open"=isVisible onClose=hide className="relative z-50">
60
61
  <HeadlessUi.Dialog.Backdrop
@@ -88,7 +89,15 @@ let make = (
88
89
  ])}>
89
90
  {title->Option.mapWithDefault(React.null, title =>
90
91
  <HeadlessUi.Dialog.Title
91
- className={cx(["text-2xl pb-1 font-display", titleStyle(~type_)])}>
92
+ className={cx([
93
+ "text-2xl pb-1 inline-flex items-center gap-2 font-display",
94
+ titleStyle(~type_),
95
+ ])}>
96
+ {icon->Option.mapWithDefault(React.null, icon => {
97
+ let module(Icon) = icon
98
+
99
+ <Icon />
100
+ })}
92
101
  title
93
102
  </HeadlessUi.Dialog.Title>
94
103
  )}
@@ -12,4 +12,5 @@ let make: (
12
12
  ~type_: style=?, // default: `default
13
13
  ~footer: React.element=?,
14
14
  ~ariaLabel: string=?,
15
+ ~icon: module(ReactIcons.Icon)=?,
15
16
  ) => React.element
@@ -51,6 +51,7 @@ module Core = {
51
51
  ~emptyMessage,
52
52
  ~additionalRow: option<(ReactTable.instanceRow<'a>, 'a) => React.element>=?,
53
53
  ~trClassName="",
54
+ ~tdClassName="",
54
55
  ) =>
55
56
  <div className={cx([className, "flex flex-auto w-full overflow-x-auto relative"])}>
56
57
  <Toolkit__Ui_Spread props={table.getTableProps()}>
@@ -63,7 +64,10 @@ module Core = {
63
64
  ? <Toolkit__Ui_Spread
64
65
  key={"thead-th" ++ index->Int.toString} props={column.getHeaderProps()}>
65
66
  <td
66
- className="px-2 pt-2 border-b border-r border-gray-300 xl:min-h-[5rem]"
67
+ className={cx([
68
+ tdClassName,
69
+ "px-2 pt-2 border-b border-r border-gray-300 xl:min-h-[5rem]",
70
+ ])}
67
71
  key={"thead-thd" ++ index->Int.toString}>
68
72
  <Toolkit__Ui_Spread props={column.getSortByToggleProps()}>
69
73
  <div
@@ -11,6 +11,7 @@ module Core: {
11
11
  ~emptyMessage: string,
12
12
  ~additionalRow: (ReactTable.instanceRow<'a>, 'a) => React.element=?,
13
13
  ~trClassName: string=?,
14
+ ~tdClassName: string=?,
14
15
  ) => React.element
15
16
  }
16
17