@luscii-healthtech/web-ui 0.9.0 → 0.9.3
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 +8 -1
- package/dist/components/List/List.types.d.ts +3 -5
- package/dist/components/Tabbar/Tabbar.d.ts +1 -1
- package/dist/components/Tabbar/TabbarItem.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/web-ui-tailwind.css +12 -8
- package/dist/web-ui.cjs.development.js +54 -32
- 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 +54 -32
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ButtonV2/ButtonProps.type.ts +11 -3
- package/src/components/List/List.tsx +3 -2
- package/src/components/List/List.types.ts +3 -5
- package/src/components/Tabbar/Tabbar.tsx +29 -6
- package/src/components/Tabbar/TabbarItem.tsx +17 -4
- package/src/components/Timeline/TimelineStep.tsx +1 -6
- package/src/index.tsx +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { IconProps } from "../Icons/types/IconProps.type";
|
|
3
3
|
import { TextColor, TextHoverColor } from "../Text/Text";
|
|
4
4
|
/**
|
|
@@ -29,3 +29,10 @@ export interface ButtonProps extends BaseButtonProps, ButtonWithPendingStateProp
|
|
|
29
29
|
textColor?: TextColor;
|
|
30
30
|
textHoverColor?: TextHoverColor;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Interface for defining a button
|
|
34
|
+
*/
|
|
35
|
+
export interface ButtonDefinition<Props extends BaseButtonProps = BaseButtonProps> {
|
|
36
|
+
buttonType: React.FunctionComponent<Props>;
|
|
37
|
+
buttonProps: React.Attributes & Props;
|
|
38
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { ButtonDefinition } from "../ButtonV2/ButtonProps.type";
|
|
3
3
|
import { IconProps } from "../Icons/types/IconProps.type";
|
|
4
|
+
import { PrimaryButtonProps } from "../../index";
|
|
4
5
|
export interface ListItemProps {
|
|
5
6
|
itemId: string | number;
|
|
6
7
|
title: string;
|
|
@@ -22,10 +23,7 @@ export interface ListItemProps {
|
|
|
22
23
|
export declare type OnAssetLoadErrorPayload = Pick<ListItemProps, "itemId" | "subtitle" | "title" | "icon">;
|
|
23
24
|
export declare type ListProps = {
|
|
24
25
|
title?: string;
|
|
25
|
-
headerButton?:
|
|
26
|
-
buttonType: React.FunctionComponent<ButtonProps>;
|
|
27
|
-
buttonProps: ButtonProps;
|
|
28
|
-
};
|
|
26
|
+
headerButton?: ButtonDefinition<PrimaryButtonProps>;
|
|
29
27
|
headerTransparent?: boolean;
|
|
30
28
|
items: ListItemProps[];
|
|
31
29
|
onAssetLoadError?: (payload: OnAssetLoadErrorPayload) => void;
|
|
@@ -6,5 +6,5 @@ interface TabbarProps {
|
|
|
6
6
|
onSelect?: (index: number) => void;
|
|
7
7
|
className?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const Tabbar: ({ tabs, selectedIndex, onSelect, className }: TabbarProps) => JSX.Element;
|
|
9
|
+
export declare const Tabbar: ({ tabs, selectedIndex, onSelect, className, }: TabbarProps) => JSX.Element;
|
|
10
10
|
export default Tabbar;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export interface TabItemDetails {
|
|
2
|
+
export interface TabItemDetails<T extends object = Record<string, unknown>> {
|
|
3
3
|
title: string | JSX.Element;
|
|
4
4
|
badgeCount?: number;
|
|
5
5
|
isLoading?: boolean;
|
|
6
6
|
dataTestId?: string;
|
|
7
|
+
extra?: T;
|
|
7
8
|
}
|
|
8
9
|
interface TabbarItemProps extends TabItemDetails {
|
|
9
10
|
index: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as Acknowledgement, ACKNOWLEDGEMENT_TYPE_OPTIONS, } from "./components/Acknowledgement/Acknowledgement";
|
|
2
2
|
export { default as Avatar } from "./components/Avatar/Avatar";
|
|
3
3
|
export { default as Badge } from "./components/Badge/Badge";
|
|
4
|
-
export { BaseButtonProps as NonPrimaryButtonProps, ButtonWithPendingStateProps as PrimaryButtonProps, } from "./components/ButtonV2/ButtonProps.type";
|
|
4
|
+
export { BaseButtonProps as NonPrimaryButtonProps, ButtonWithPendingStateProps as PrimaryButtonProps, ButtonDefinition } from "./components/ButtonV2/ButtonProps.type";
|
|
5
5
|
export { PrimaryButton } from "./components/ButtonV2/PrimaryButton";
|
|
6
6
|
export { SecondaryButton } from "./components/ButtonV2/SecondaryButton";
|
|
7
7
|
export { TertiaryButton } from "./components/ButtonV2/TertiaryButton";
|
package/dist/web-ui-tailwind.css
CHANGED
|
@@ -1349,6 +1349,10 @@ video {
|
|
|
1349
1349
|
margin-left: auto;
|
|
1350
1350
|
}
|
|
1351
1351
|
|
|
1352
|
+
.mb-px {
|
|
1353
|
+
margin-bottom: 1px;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1352
1356
|
.mb-2\.5 {
|
|
1353
1357
|
margin-bottom: 0.625rem;
|
|
1354
1358
|
}
|
|
@@ -1357,6 +1361,10 @@ video {
|
|
|
1357
1361
|
margin-left: 0.625rem;
|
|
1358
1362
|
}
|
|
1359
1363
|
|
|
1364
|
+
.-mt-px {
|
|
1365
|
+
margin-top: -1px;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1360
1368
|
.-ml-px {
|
|
1361
1369
|
margin-left: -1px;
|
|
1362
1370
|
}
|
|
@@ -1521,10 +1529,6 @@ video {
|
|
|
1521
1529
|
padding-left: 0.25rem;
|
|
1522
1530
|
}
|
|
1523
1531
|
|
|
1524
|
-
.pt-3 {
|
|
1525
|
-
padding-top: 0.75rem;
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
1532
|
.pl-4 {
|
|
1529
1533
|
padding-left: 1rem;
|
|
1530
1534
|
}
|
|
@@ -1621,16 +1625,16 @@ video {
|
|
|
1621
1625
|
left: 0;
|
|
1622
1626
|
}
|
|
1623
1627
|
|
|
1624
|
-
.top-
|
|
1625
|
-
top:
|
|
1628
|
+
.top-6 {
|
|
1629
|
+
top: 1.5rem;
|
|
1626
1630
|
}
|
|
1627
1631
|
|
|
1628
1632
|
.-top-1 {
|
|
1629
1633
|
top: -0.25rem;
|
|
1630
1634
|
}
|
|
1631
1635
|
|
|
1632
|
-
.-left-
|
|
1633
|
-
left: -0.
|
|
1636
|
+
.-left-2 {
|
|
1637
|
+
left: -0.5rem;
|
|
1634
1638
|
}
|
|
1635
1639
|
|
|
1636
1640
|
.-right-54 {
|
|
@@ -2674,8 +2674,9 @@ var List = function List(_ref) {
|
|
|
2674
2674
|
"data-test-id": "list-component"
|
|
2675
2675
|
}, (title || headerButton) && /*#__PURE__*/React__default.createElement("div", {
|
|
2676
2676
|
"data-test-id": "list-header",
|
|
2677
|
-
className: classNames("flex rounded-t flex-row items-center
|
|
2678
|
-
"bg-white border-b border-slate-100": !headerTransparent,
|
|
2677
|
+
className: classNames("flex rounded-t flex-row items-center py-4 space-x-4", {
|
|
2678
|
+
"bg-white border-b border-slate-100 px-4": !headerTransparent,
|
|
2679
|
+
"mb-px": headerTransparent,
|
|
2679
2680
|
"justify-between": title && headerButton,
|
|
2680
2681
|
"justify-start": title && !headerButton,
|
|
2681
2682
|
"justify-end": !title && headerButton
|
|
@@ -3948,15 +3949,36 @@ var Tabbar = function Tabbar(_ref) {
|
|
|
3948
3949
|
onSelect = _ref.onSelect,
|
|
3949
3950
|
_ref$className = _ref.className,
|
|
3950
3951
|
className = _ref$className === void 0 ? "" : _ref$className;
|
|
3952
|
+
|
|
3953
|
+
var _useState = React.useState(tabs),
|
|
3954
|
+
innerTabs = _useState[0],
|
|
3955
|
+
setInnerTabs = _useState[1];
|
|
3956
|
+
|
|
3957
|
+
var _useState2 = React.useState(selectedIndex),
|
|
3958
|
+
innerSelectedIndex = _useState2[0],
|
|
3959
|
+
setInnerSelectedIndex = _useState2[1];
|
|
3960
|
+
|
|
3961
|
+
React.useEffect(function () {
|
|
3962
|
+
setInnerTabs(tabs);
|
|
3963
|
+
}, [tabs]);
|
|
3964
|
+
React.useEffect(function () {
|
|
3965
|
+
setInnerSelectedIndex(innerSelectedIndex);
|
|
3966
|
+
}, [innerSelectedIndex]);
|
|
3967
|
+
|
|
3968
|
+
function handleOnTabSelect(index) {
|
|
3969
|
+
setInnerSelectedIndex(index);
|
|
3970
|
+
onSelect == null ? void 0 : onSelect(index);
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3951
3973
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
3952
3974
|
className: "flex flex-row w-full bg-white rounded-xl " + className
|
|
3953
|
-
},
|
|
3975
|
+
}, innerTabs == null ? void 0 : innerTabs.map(function (tabItemProps, index) {
|
|
3954
3976
|
var _tabItemProps$dataTes;
|
|
3955
3977
|
|
|
3956
3978
|
var itemProps = _extends({
|
|
3957
3979
|
index: index,
|
|
3958
|
-
onSelect:
|
|
3959
|
-
isSelected:
|
|
3980
|
+
onSelect: handleOnTabSelect,
|
|
3981
|
+
isSelected: innerSelectedIndex === index
|
|
3960
3982
|
}, tabItemProps);
|
|
3961
3983
|
|
|
3962
3984
|
return /*#__PURE__*/React__default.createElement(TabbarItem, Object.assign({
|
|
@@ -4239,30 +4261,6 @@ var TextEditorV2 = function TextEditorV2(_ref) {
|
|
|
4239
4261
|
}));
|
|
4240
4262
|
};
|
|
4241
4263
|
|
|
4242
|
-
var SmallCircleIcon = function SmallCircleIcon(props) {
|
|
4243
|
-
return /*#__PURE__*/React__default.createElement("svg", {
|
|
4244
|
-
className: props.className,
|
|
4245
|
-
onClick: props.onClick,
|
|
4246
|
-
role: props.onClick ? "button" : undefined,
|
|
4247
|
-
width: "24",
|
|
4248
|
-
height: "24",
|
|
4249
|
-
viewBox: "0 0 24 24",
|
|
4250
|
-
fill: "none",
|
|
4251
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4252
|
-
}, /*#__PURE__*/React__default.createElement("circle", {
|
|
4253
|
-
cx: "12",
|
|
4254
|
-
cy: "12",
|
|
4255
|
-
r: "6",
|
|
4256
|
-
fill: "currentColor"
|
|
4257
|
-
}), /*#__PURE__*/React__default.createElement("circle", {
|
|
4258
|
-
cx: "14.5",
|
|
4259
|
-
cy: "9.5",
|
|
4260
|
-
r: "1.5",
|
|
4261
|
-
fill: "white",
|
|
4262
|
-
fillOpacity: "0.1"
|
|
4263
|
-
}));
|
|
4264
|
-
};
|
|
4265
|
-
|
|
4266
4264
|
var TimelineStep = function TimelineStep(_ref) {
|
|
4267
4265
|
var _classNames;
|
|
4268
4266
|
|
|
@@ -4270,11 +4268,11 @@ var TimelineStep = function TimelineStep(_ref) {
|
|
|
4270
4268
|
type = _ref.type;
|
|
4271
4269
|
var isWideStep = type === "wide";
|
|
4272
4270
|
var borderClassNames = "ml-4 pl-6 border-blue-800 border-l-2";
|
|
4273
|
-
var containerClassNames = classNames("relative", (_classNames = {}, _classNames[borderClassNames] = !isWideStep, _classNames["
|
|
4271
|
+
var containerClassNames = classNames("relative", (_classNames = {}, _classNames[borderClassNames] = !isWideStep, _classNames["bg-white rounded-lg overflow-hidden"] = isWideStep, _classNames));
|
|
4274
4272
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
4275
4273
|
className: containerClassNames
|
|
4276
|
-
}, content, !isWideStep && /*#__PURE__*/React__default.createElement(
|
|
4277
|
-
className: "
|
|
4274
|
+
}, content, !isWideStep && /*#__PURE__*/React__default.createElement("span", {
|
|
4275
|
+
className: "rounded-lg bg-blue-800 h-4 w-4 absolute top-6 -left-2 -ml-px -mt-px"
|
|
4278
4276
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
4279
4277
|
className: classNames(borderClassNames, "h-6 last:h-0")
|
|
4280
4278
|
}));
|
|
@@ -5000,6 +4998,30 @@ var PinIcon = function PinIcon(props) {
|
|
|
5000
4998
|
}));
|
|
5001
4999
|
};
|
|
5002
5000
|
|
|
5001
|
+
var SmallCircleIcon = function SmallCircleIcon(props) {
|
|
5002
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
5003
|
+
className: props.className,
|
|
5004
|
+
onClick: props.onClick,
|
|
5005
|
+
role: props.onClick ? "button" : undefined,
|
|
5006
|
+
width: "24",
|
|
5007
|
+
height: "24",
|
|
5008
|
+
viewBox: "0 0 24 24",
|
|
5009
|
+
fill: "none",
|
|
5010
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
5011
|
+
}, /*#__PURE__*/React__default.createElement("circle", {
|
|
5012
|
+
cx: "12",
|
|
5013
|
+
cy: "12",
|
|
5014
|
+
r: "6",
|
|
5015
|
+
fill: "currentColor"
|
|
5016
|
+
}), /*#__PURE__*/React__default.createElement("circle", {
|
|
5017
|
+
cx: "14.5",
|
|
5018
|
+
cy: "9.5",
|
|
5019
|
+
r: "1.5",
|
|
5020
|
+
fill: "white",
|
|
5021
|
+
fillOpacity: "0.1"
|
|
5022
|
+
}));
|
|
5023
|
+
};
|
|
5024
|
+
|
|
5003
5025
|
var SmallDiamondIcon = function SmallDiamondIcon(props) {
|
|
5004
5026
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
5005
5027
|
className: props.className,
|