@luscii-healthtech/web-ui 0.6.0 → 0.6.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.
- package/dist/components/ButtonV2/ButtonProps.type.d.ts +3 -0
- package/dist/components/ButtonV2/ButtonV2.d.ts +1 -1
- package/dist/web-ui.cjs.development.js +20 -9
- package/dist/web-ui.cjs.development.js.map +1 -1
- package/dist/web-ui.cjs.production.min.js +1 -1
- package/dist/web-ui.cjs.production.min.js.map +1 -1
- package/dist/web-ui.esm.js +20 -9
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ButtonV2/ButtonProps.type.ts +5 -1
- package/src/components/ButtonV2/ButtonV2.tsx +11 -5
- package/src/components/ButtonV2/PrimaryButton.tsx +1 -0
- package/src/components/ButtonV2/SecondaryButton.tsx +2 -0
- package/src/components/ButtonV2/TertiaryButton.tsx +2 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconProps } from "../Icons/types/IconProps.type";
|
|
3
|
+
import { TextColor, TextHoverColor } from "../Text/Text";
|
|
3
4
|
export interface BaseButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
5
|
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
5
6
|
text?: string;
|
|
7
|
+
textColor?: TextColor;
|
|
8
|
+
textHoverColor?: TextHoverColor;
|
|
6
9
|
icon?: React.FunctionComponent<IconProps>;
|
|
7
10
|
isDisabled?: boolean;
|
|
8
11
|
className?: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ButtonProps } from "./ButtonProps.type";
|
|
3
|
-
export declare const ButtonV2: ({ onClick, text, icon, isDisabled, isPending, className, ...otherAttributes }: ButtonProps) => JSX.Element;
|
|
3
|
+
export declare const ButtonV2: ({ onClick, text, textColor, textHoverColor, icon, isDisabled, isPending, className, ...otherAttributes }: ButtonProps) => JSX.Element;
|
|
@@ -358,10 +358,12 @@ var Spinner = function Spinner(props) {
|
|
|
358
358
|
}));
|
|
359
359
|
};
|
|
360
360
|
|
|
361
|
-
var _excluded = ["onClick", "text", "icon", "isDisabled", "isPending", "className"];
|
|
361
|
+
var _excluded = ["onClick", "text", "textColor", "textHoverColor", "icon", "isDisabled", "isPending", "className"];
|
|
362
362
|
var ButtonV2 = function ButtonV2(_ref) {
|
|
363
363
|
var onClick = _ref.onClick,
|
|
364
364
|
text = _ref.text,
|
|
365
|
+
textColor = _ref.textColor,
|
|
366
|
+
textHoverColor = _ref.textHoverColor,
|
|
365
367
|
icon = _ref.icon,
|
|
366
368
|
isDisabled = _ref.isDisabled,
|
|
367
369
|
isPending = _ref.isPending,
|
|
@@ -373,7 +375,7 @@ var ButtonV2 = function ButtonV2(_ref) {
|
|
|
373
375
|
return /*#__PURE__*/React__default.createElement("span", null, "Invalid props passed to this component.");
|
|
374
376
|
}
|
|
375
377
|
|
|
376
|
-
var buttonClassName = classNames(["h-11", "relative flex flex-row justify-center items-center", "border", "transition-outline transition-colors duration-300 ease-in-out", "rounded-full", "leading-none", "shadow-sm", "cursor-pointer", "focus:outline-primary"], {
|
|
378
|
+
var buttonClassName = classNames(["h-11", "relative flex flex-row justify-center items-center", "border", "transition-outline transition-colors duration-300 ease-in-out", "rounded-full", "leading-none", "shadow-sm", "cursor-pointer", "focus:outline-primary", "group"], {
|
|
377
379
|
"w-11": !text && icon,
|
|
378
380
|
"pl-4 pr-6": text && icon,
|
|
379
381
|
"px-4": text && !icon
|
|
@@ -400,29 +402,38 @@ var ButtonV2 = function ButtonV2(_ref) {
|
|
|
400
402
|
}
|
|
401
403
|
}, /*#__PURE__*/React__default.createElement(Spinner, {
|
|
402
404
|
className: "text-white"
|
|
403
|
-
})), text && /*#__PURE__*/React__default.createElement(
|
|
404
|
-
className: classNames(
|
|
405
|
+
})), text && /*#__PURE__*/React__default.createElement(Text, {
|
|
406
|
+
className: classNames({
|
|
405
407
|
invisible: isPending,
|
|
406
408
|
"ml-1": icon
|
|
407
|
-
})
|
|
408
|
-
|
|
409
|
+
}),
|
|
410
|
+
text: text,
|
|
411
|
+
color: textColor,
|
|
412
|
+
hoverColor: textHoverColor,
|
|
413
|
+
hoverInGroup: true
|
|
414
|
+
}));
|
|
409
415
|
};
|
|
410
416
|
|
|
411
417
|
var PrimaryButton = function PrimaryButton(props) {
|
|
412
418
|
return /*#__PURE__*/React__default.createElement(ButtonV2, Object.assign({}, props, {
|
|
413
|
-
className: classNames(["text-white", "bg-blue-800", "border-primary-transparent", "hover:bg-blue-900"], props.className)
|
|
419
|
+
className: classNames(["text-white", "bg-blue-800", "border-primary-transparent", "hover:bg-blue-900"], props.className),
|
|
420
|
+
textColor: "white"
|
|
414
421
|
}));
|
|
415
422
|
};
|
|
416
423
|
|
|
417
424
|
var SecondaryButton = function SecondaryButton(props) {
|
|
418
425
|
return /*#__PURE__*/React__default.createElement(ButtonV2, Object.assign({}, props, {
|
|
419
|
-
className: classNames(["text-blue-800", "bg-white", "border-slate-300", "hover:text-blue-900", "hover:border-slate-400", "focus:border-blue-800"], props.className)
|
|
426
|
+
className: classNames(["text-blue-800", "bg-white", "border-slate-300", "hover:text-blue-900", "hover:border-slate-400", "focus:border-blue-800"], props.className),
|
|
427
|
+
textColor: "blue-800",
|
|
428
|
+
textHoverColor: "blue-900"
|
|
420
429
|
}));
|
|
421
430
|
};
|
|
422
431
|
|
|
423
432
|
var TertiaryButton = function TertiaryButton(props) {
|
|
424
433
|
return /*#__PURE__*/React__default.createElement(ButtonV2, Object.assign({}, props, {
|
|
425
|
-
className: classNames(["text-blue-800", "bg-transparent", "border-transparent", "hover:text-blue-900", "focus:border-blue-800", "shadow-none"], props.className)
|
|
434
|
+
className: classNames(["text-blue-800", "bg-transparent", "border-transparent", "hover:text-blue-900", "focus:border-blue-800", "shadow-none"], props.className),
|
|
435
|
+
textColor: "blue-800",
|
|
436
|
+
textHoverColor: "blue-900"
|
|
426
437
|
}));
|
|
427
438
|
};
|
|
428
439
|
|