@colisweb/rescript-toolkit 3.1.5 → 3.1.6
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/install-state.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -154,11 +154,11 @@ module.exports = {
|
|
|
154
154
|
plugins: [require("@tailwindcss/line-clamp")],
|
|
155
155
|
content: [
|
|
156
156
|
"public/index.html",
|
|
157
|
-
"lib/es6_global/src/**/**.js",
|
|
158
|
-
"src/**/**.js",
|
|
159
|
-
"node_modules/@colisweb/rescript-toolkit/lib/es6_global/src/**/**.js",
|
|
160
|
-
"node_modules/@colisweb/rescript-toolkit/src/**/**.js",
|
|
161
|
-
"playground/**/*.js",
|
|
162
|
-
"lib/es6_global/playground/**/*.js",
|
|
157
|
+
"lib/es6_global/src/**/**.(c)?js",
|
|
158
|
+
"src/**/**.(c)?js",
|
|
159
|
+
"node_modules/@colisweb/rescript-toolkit/lib/es6_global/src/**/**.(c)?js",
|
|
160
|
+
"node_modules/@colisweb/rescript-toolkit/src/**/**.(c)?js",
|
|
161
|
+
"playground/**/*.(c)?js",
|
|
162
|
+
"lib/es6_global/playground/**/*.(c)?js",
|
|
163
163
|
],
|
|
164
164
|
};
|
|
@@ -127,57 +127,60 @@ let make = (
|
|
|
127
127
|
~leftIcon: option<module(Icon)>=?,
|
|
128
128
|
~rightIcon: option<module(Icon)>=?,
|
|
129
129
|
~iconClassName=?,
|
|
130
|
+
~testId="",
|
|
130
131
|
~buttonRef: option<ReactDOM.domRef>=?,
|
|
131
132
|
) => {
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
className
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
133
|
+
<Toolkit__Ui_Spread props={{"data-testid": cx([testId])}}>
|
|
134
|
+
<button
|
|
135
|
+
ref=?{buttonRef}
|
|
136
|
+
?ariaLabel
|
|
137
|
+
?ariaLabelledby
|
|
138
|
+
?ariaExpanded
|
|
139
|
+
?autoFocus
|
|
140
|
+
disabled={isLoading || disabled}
|
|
141
|
+
?type_
|
|
142
|
+
?id
|
|
143
|
+
?tabIndex
|
|
144
|
+
?onFocus
|
|
145
|
+
?onBlur
|
|
146
|
+
?onClick
|
|
147
|
+
className={cx([
|
|
148
|
+
className,
|
|
149
|
+
buttonStyle(~color, ~variant, ~size, ~disabled, ()),
|
|
150
|
+
variant === #pill ? "rounded-full" : "",
|
|
151
|
+
])}>
|
|
152
|
+
{leftIcon->Option.mapWithDefault(React.null, icon => {
|
|
153
|
+
let module(Icon) = icon
|
|
154
|
+
|
|
155
|
+
<span className="mr-2">
|
|
156
|
+
<Icon
|
|
157
|
+
size={switch size {
|
|
158
|
+
| #xs => 12
|
|
159
|
+
| #sm => 16
|
|
160
|
+
| #md => 20
|
|
161
|
+
| #lg => 24
|
|
162
|
+
}}
|
|
163
|
+
className=?iconClassName
|
|
164
|
+
/>
|
|
165
|
+
</span>
|
|
166
|
+
})}
|
|
167
|
+
children
|
|
168
|
+
{rightIcon->Option.mapWithDefault(React.null, icon => {
|
|
169
|
+
let module(Icon) = icon
|
|
170
|
+
|
|
171
|
+
<span className="ml-2">
|
|
172
|
+
<Icon
|
|
173
|
+
size={switch size {
|
|
174
|
+
| #xs => 14
|
|
175
|
+
| #sm => 18
|
|
176
|
+
| #md => 22
|
|
177
|
+
| #lg => 26
|
|
178
|
+
}}
|
|
179
|
+
className=?iconClassName
|
|
180
|
+
/>
|
|
181
|
+
</span>
|
|
182
|
+
})}
|
|
183
|
+
{isLoading ? <Spinner size=#sm color=#current className="ml-2" /> : React.null}
|
|
184
|
+
</button>
|
|
185
|
+
</Toolkit__Ui_Spread>
|
|
183
186
|
}
|
|
@@ -23,18 +23,16 @@ module Header = {
|
|
|
23
23
|
children
|
|
24
24
|
</div>
|
|
25
25
|
{action->Option.mapWithDefault(React.null, ({label, event}) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
React.cloneElement(btn, {"data-testid": cx(["card-header-button", buttonTestId])})
|
|
26
|
+
<Toolkit__Ui_Button
|
|
27
|
+
variant=#pill
|
|
28
|
+
size=#xs
|
|
29
|
+
color=#info
|
|
30
|
+
onClick={_ => event()}
|
|
31
|
+
testId={buttonTestId}
|
|
32
|
+
disabled={actionDisabled->Option.getWithDefault(false)}
|
|
33
|
+
className="flex-shrink-0 ml-4">
|
|
34
|
+
label
|
|
35
|
+
</Toolkit__Ui_Button>
|
|
38
36
|
})}
|
|
39
37
|
</div>
|
|
40
38
|
}
|