@luscii-healthtech/web-ui 23.0.0 → 23.1.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/Box/Box.d.ts +19 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +16 -2
- package/dist/components/Stack/Stack.d.ts +62 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.development.js +82 -9
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/system/Elevation.d.ts +9 -0
- package/dist/system/Sizes.d.ts +10 -0
- package/dist/web-ui-tailwind.css +30775 -1166
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SIZES } from "../../system/Sizes";
|
|
3
|
+
import { ELEVATION } from "../../system/Elevation";
|
|
4
|
+
type Size = keyof typeof SIZES;
|
|
5
|
+
declare const spacingKeys: readonly ["p", "pt", "pr", "pb", "pl", "px", "py", "m", "mt", "mr", "mb", "ml", "mx", "my"];
|
|
6
|
+
type SpacingProps = Partial<Record<(typeof spacingKeys)[number], Size>>;
|
|
7
|
+
type ElevationProp = keyof typeof ELEVATION;
|
|
8
|
+
type Props<C extends React.ElementType> = React.ComponentPropsWithoutRef<C> & SpacingProps & {
|
|
9
|
+
/**
|
|
10
|
+
* Adds a box-shadow to the element based on the design system
|
|
11
|
+
*/
|
|
12
|
+
elevation?: ElevationProp;
|
|
13
|
+
/**
|
|
14
|
+
* Make the item fill up horizontal space
|
|
15
|
+
*/
|
|
16
|
+
width?: "full";
|
|
17
|
+
};
|
|
18
|
+
export declare const Box: <C extends React.ElementType<any> = "div">(props: Props<C>) => React.JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import Text from "../Text/Text";
|
|
3
|
+
type RenderBreadcrumb = (props: {
|
|
4
|
+
name: string;
|
|
5
|
+
link?: string;
|
|
6
|
+
textProps: React.ComponentProps<typeof Text>;
|
|
7
|
+
}) => React.ReactNode;
|
|
8
|
+
export type Crumb = {
|
|
9
|
+
render: RenderBreadcrumb;
|
|
10
|
+
key?: string;
|
|
11
|
+
name: never;
|
|
12
|
+
link: never;
|
|
13
|
+
} | {
|
|
2
14
|
name: string;
|
|
3
15
|
key?: string;
|
|
4
16
|
link?: string;
|
|
5
|
-
}
|
|
17
|
+
};
|
|
6
18
|
export interface BreadcrumbProps {
|
|
7
19
|
crumbs: Crumb[];
|
|
8
20
|
truncateAfter?: number;
|
|
21
|
+
renderItem?: RenderBreadcrumb;
|
|
9
22
|
}
|
|
10
23
|
export type BreadcrumbDividerProps = {
|
|
11
24
|
onClick: () => void;
|
|
12
25
|
truncatedCrumbs: Crumb[];
|
|
13
26
|
};
|
|
14
27
|
export declare const isBreadcrumbDividerProps: (subject: unknown) => subject is BreadcrumbDividerProps;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React, { ComponentProps } from "react";
|
|
2
|
+
import { SIZES } from "../../system/Sizes";
|
|
3
|
+
import { Box } from "../Box/Box";
|
|
4
|
+
type Size = keyof typeof SIZES;
|
|
5
|
+
type Props<C extends React.ElementType> = React.ComponentPropsWithoutRef<C> & {
|
|
6
|
+
as?: C;
|
|
7
|
+
/**
|
|
8
|
+
* Size of gutter between items
|
|
9
|
+
*/
|
|
10
|
+
gap?: Size;
|
|
11
|
+
/**
|
|
12
|
+
* Positioning of items along the Stack’s cross axis.
|
|
13
|
+
* The values are based on Tailwind's classnames and are therefore limited to the following:
|
|
14
|
+
*/
|
|
15
|
+
align?: "start" | "end" | "center" | "baseline" | "stretch";
|
|
16
|
+
/**
|
|
17
|
+
* Positioning of items along the Stack’s main axis.
|
|
18
|
+
* The values are based on Tailwind's classnames and are therefore limited to the following:
|
|
19
|
+
*/
|
|
20
|
+
justify?: "normal" | "start" | "end" | "center" | "between" | "around" | "evenly";
|
|
21
|
+
/**
|
|
22
|
+
* Positioning of items along the Stack’s x (horizontal) or y (vertical) axis
|
|
23
|
+
*/
|
|
24
|
+
axis?: "x" | "y";
|
|
25
|
+
/**
|
|
26
|
+
* Reverse the order of the items
|
|
27
|
+
*/
|
|
28
|
+
reverse?: boolean;
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
className?: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const Stack: <C extends React.ElementType<any> = "div">(props: React.PropsWithoutRef<React.ComponentProps<C>> & {
|
|
33
|
+
as?: C | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Size of gutter between items
|
|
36
|
+
*/
|
|
37
|
+
gap?: "s" | "xl" | "xs" | "m" | "xxxs" | "xxs" | "l" | "xxl" | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Positioning of items along the Stack’s cross axis.
|
|
40
|
+
* The values are based on Tailwind's classnames and are therefore limited to the following:
|
|
41
|
+
*/
|
|
42
|
+
align?: "center" | "start" | "end" | "stretch" | "baseline" | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Positioning of items along the Stack’s main axis.
|
|
45
|
+
* The values are based on Tailwind's classnames and are therefore limited to the following:
|
|
46
|
+
*/
|
|
47
|
+
justify?: "center" | "start" | "end" | "between" | "normal" | "around" | "evenly" | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Positioning of items along the Stack’s x (horizontal) or y (vertical) axis
|
|
50
|
+
*/
|
|
51
|
+
axis?: "x" | "y" | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Reverse the order of the items
|
|
54
|
+
*/
|
|
55
|
+
reverse?: boolean | undefined;
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
className?: string | undefined;
|
|
58
|
+
} & Omit<any, "ref"> & Partial<Record<"p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my", "s" | "xl" | "xs" | "m" | "xxxs" | "xxs" | "l" | "xxl">> & {
|
|
59
|
+
elevation?: "small" | "medium" | "large" | "base" | "drag" | "surface" | "extraLarge" | undefined;
|
|
60
|
+
width?: "full" | undefined;
|
|
61
|
+
}) => React.JSX.Element;
|
|
62
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -62,6 +62,8 @@ export { Steps } from "./components/Steps/Steps";
|
|
|
62
62
|
export { default as Switcher } from "./components/Switcher/Switcher";
|
|
63
63
|
export { default as Image } from "./components/Image/Image";
|
|
64
64
|
export { MediaPicker, type TargetProps, } from "./components/MediaPicker/MediaPicker";
|
|
65
|
+
export { Stack } from "./components/Stack/Stack";
|
|
66
|
+
export { Box } from "./components/Box/Box";
|
|
65
67
|
export { default as Tabbar, type TabbarProps, type TabItemDetails, } from "./components/Tabbar/Tabbar";
|
|
66
68
|
export { Breadcrumbs, type BreadcrumbProps } from "./components/Breadcrumbs";
|
|
67
69
|
export { PageHeader, type PageHeaderProps } from "./components/PageHeader";
|
|
@@ -22,6 +22,7 @@ var ReactSelect = require('react-select');
|
|
|
22
22
|
var groupBy = require('lodash/groupBy');
|
|
23
23
|
var debounce = require('lodash.debounce');
|
|
24
24
|
var reactLazyLoadImageComponent = require('react-lazy-load-image-component');
|
|
25
|
+
var omit = require('lodash.omit');
|
|
25
26
|
var ReactQuill = require('react-quill');
|
|
26
27
|
require('react-quill/dist/quill.snow.css');
|
|
27
28
|
var react = require('@headlessui/react');
|
|
@@ -61,6 +62,7 @@ var ClipboardJS__default = /*#__PURE__*/_interopDefault(ClipboardJS);
|
|
|
61
62
|
var ReactSelect__default = /*#__PURE__*/_interopDefault(ReactSelect);
|
|
62
63
|
var groupBy__default = /*#__PURE__*/_interopDefault(groupBy);
|
|
63
64
|
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
65
|
+
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
64
66
|
var ReactQuill__default = /*#__PURE__*/_interopDefault(ReactQuill);
|
|
65
67
|
var ToggleGroup__namespace = /*#__PURE__*/_interopNamespace(ToggleGroup);
|
|
66
68
|
|
|
@@ -4123,12 +4125,40 @@ const isBreadcrumbDividerProps = (subject) => {
|
|
|
4123
4125
|
return typeof possibleSubject.onClick === "function" && Array.isArray(possibleSubject.truncatedCrumbs);
|
|
4124
4126
|
};
|
|
4125
4127
|
|
|
4126
|
-
const BreadcrumbItem = (
|
|
4127
|
-
return React__namespace.default.createElement(
|
|
4128
|
-
|
|
4129
|
-
{
|
|
4130
|
-
React__namespace.default.createElement(
|
|
4131
|
-
)
|
|
4128
|
+
const BreadcrumbItem = (props) => {
|
|
4129
|
+
return React__namespace.default.createElement(
|
|
4130
|
+
"li",
|
|
4131
|
+
{ className: "ui-flex ui-flex-row ui-items-center ui-slash-split" },
|
|
4132
|
+
React__namespace.default.createElement(BreadcrumbContent, Object.assign({}, props))
|
|
4133
|
+
);
|
|
4134
|
+
};
|
|
4135
|
+
const linkTextProps = {
|
|
4136
|
+
variant: "base",
|
|
4137
|
+
color: "blue-800",
|
|
4138
|
+
className: "ui-whitespace-no-wrap ui-max-w-xs ui-truncate"
|
|
4139
|
+
};
|
|
4140
|
+
const defaultTextProps = {
|
|
4141
|
+
variant: "strong",
|
|
4142
|
+
color: "base",
|
|
4143
|
+
className: "ui-whitespace-no-wrap ui-w-full ui-max-w-xs ui-truncate"
|
|
4144
|
+
};
|
|
4145
|
+
const BreadcrumbContent = (_a) => {
|
|
4146
|
+
var { name, link } = _a, props = __rest(_a, ["name", "link"]);
|
|
4147
|
+
if ("render" in props && !!props.render) {
|
|
4148
|
+
return React__namespace.default.createElement(React__namespace.default.Fragment, null, props.render({
|
|
4149
|
+
name,
|
|
4150
|
+
link,
|
|
4151
|
+
textProps: link ? linkTextProps : defaultTextProps
|
|
4152
|
+
}));
|
|
4153
|
+
}
|
|
4154
|
+
if (link) {
|
|
4155
|
+
return React__namespace.default.createElement(
|
|
4156
|
+
router.Link,
|
|
4157
|
+
{ to: link },
|
|
4158
|
+
React__namespace.default.createElement(Text, Object.assign({}, linkTextProps), name)
|
|
4159
|
+
);
|
|
4160
|
+
}
|
|
4161
|
+
return React__namespace.default.createElement(Text, Object.assign({}, defaultTextProps), name);
|
|
4132
4162
|
};
|
|
4133
4163
|
const BreadcrumbDividerItem = ({ onClick, truncatedCrumbs }) => {
|
|
4134
4164
|
return React__namespace.default.createElement(
|
|
@@ -4137,12 +4167,12 @@ const BreadcrumbDividerItem = ({ onClick, truncatedCrumbs }) => {
|
|
|
4137
4167
|
React__namespace.default.createElement(
|
|
4138
4168
|
"button",
|
|
4139
4169
|
{ onClick, title: truncatedCrumbs.map((crumb) => crumb.name).join(" / "), className: "ui-px-1" },
|
|
4140
|
-
React__namespace.default.createElement(Text, {
|
|
4170
|
+
React__namespace.default.createElement(Text, { color: "blue-800", type: "strong" }, "\u2026")
|
|
4141
4171
|
)
|
|
4142
4172
|
);
|
|
4143
4173
|
};
|
|
4144
4174
|
|
|
4145
|
-
const Breadcrumbs = ({ crumbs, truncateAfter = Infinity }) => {
|
|
4175
|
+
const Breadcrumbs = ({ crumbs, truncateAfter = Infinity, renderItem }) => {
|
|
4146
4176
|
const [head, ...tail] = crumbs;
|
|
4147
4177
|
const [isTruncated, setIsTruncated] = React.useState(tail.length > truncateAfter);
|
|
4148
4178
|
const truncatedCrumbs = [];
|
|
@@ -4163,7 +4193,7 @@ const Breadcrumbs = ({ crumbs, truncateAfter = Infinity }) => {
|
|
|
4163
4193
|
dividerProps,
|
|
4164
4194
|
...tail
|
|
4165
4195
|
];
|
|
4166
|
-
return React__namespace.default.createElement("ul", { "data-test-id": "breadcrumbs", className: "ui-flex ui-flex-row ui-flex-wrap ui-items-center" }, (isTruncated ? crumbsAndDivider : crumbs).map((crumbOrDividerProps) => isBreadcrumbDividerProps(crumbOrDividerProps) ? React__namespace.default.createElement(BreadcrumbDividerItem, Object.assign({ key: `divider-${truncatedCrumbs.map((crumb) => crumb.name).join("-")}` }, crumbOrDividerProps)) : React__namespace.default.createElement(BreadcrumbItem, Object.assign({ key: crumbOrDividerProps.key || crumbOrDividerProps.name }, crumbOrDividerProps))));
|
|
4196
|
+
return React__namespace.default.createElement("ul", { "data-test-id": "breadcrumbs", className: "ui-flex ui-flex-row ui-flex-wrap ui-items-center" }, (isTruncated ? crumbsAndDivider : crumbs).map((crumbOrDividerProps) => isBreadcrumbDividerProps(crumbOrDividerProps) ? React__namespace.default.createElement(BreadcrumbDividerItem, Object.assign({ key: `divider-${truncatedCrumbs.map((crumb) => crumb.name).join("-")}` }, crumbOrDividerProps)) : React__namespace.default.createElement(BreadcrumbItem, Object.assign({ key: crumbOrDividerProps.key || crumbOrDividerProps.name }, crumbOrDividerProps, { render: renderItem }))));
|
|
4167
4197
|
};
|
|
4168
4198
|
|
|
4169
4199
|
const TabbarItem = ({ title, index, isSelected, onSelect, className, badgeCount = 0, isLoading = false, dataTestId = "" }) => {
|
|
@@ -4988,6 +5018,47 @@ const MediaPicker = React__namespace.default.forwardRef((props, ref) => {
|
|
|
4988
5018
|
return React__namespace.default.createElement(ImagePickerInner, Object.assign({}, mappedProps, { innerRef: ref }));
|
|
4989
5019
|
});
|
|
4990
5020
|
|
|
5021
|
+
const spacingKeys = [
|
|
5022
|
+
"p",
|
|
5023
|
+
"pt",
|
|
5024
|
+
"pr",
|
|
5025
|
+
"pb",
|
|
5026
|
+
"pl",
|
|
5027
|
+
"px",
|
|
5028
|
+
"py",
|
|
5029
|
+
"m",
|
|
5030
|
+
"mt",
|
|
5031
|
+
"mr",
|
|
5032
|
+
"mb",
|
|
5033
|
+
"ml",
|
|
5034
|
+
"mx",
|
|
5035
|
+
"my"
|
|
5036
|
+
];
|
|
5037
|
+
const createSpacingClassNames = (keys, spacingProps) => {
|
|
5038
|
+
return keys.filter((key) => spacingProps[key]).map((key) => `ui-${key}-${spacingProps[key]}`).join(" ");
|
|
5039
|
+
};
|
|
5040
|
+
const Box = (props) => {
|
|
5041
|
+
const { as: Element = "div", className, elevation, width } = props, attributes = __rest(props, ["as", "className", "elevation", "width"]);
|
|
5042
|
+
const spacingClasses = createSpacingClassNames(spacingKeys, props);
|
|
5043
|
+
const attributesWithoutSpacingKeys = omit__default.default(attributes, spacingKeys);
|
|
5044
|
+
return React__namespace.default.createElement(Element, Object.assign({ className: classNames__default.default(spacingClasses, {
|
|
5045
|
+
[`ui-shadow-${elevation}`]: elevation,
|
|
5046
|
+
"ui-w-full": width === "full"
|
|
5047
|
+
}, className) }, attributesWithoutSpacingKeys));
|
|
5048
|
+
};
|
|
5049
|
+
|
|
5050
|
+
const Stack = (props) => {
|
|
5051
|
+
const { children, gap, align = "start", justify = "normal", axis = "y", className, reverse } = props, attributes = __rest(props, ["children", "gap", "align", "justify", "axis", "className", "reverse"]);
|
|
5052
|
+
const stackClasses = classNames__default.default(`ui-flex`, {
|
|
5053
|
+
"ui-flex-row": axis === "x",
|
|
5054
|
+
"ui-flex-col": axis === "y",
|
|
5055
|
+
"ui-flex-row-reverse": axis === "x" && reverse,
|
|
5056
|
+
"ui-flex-col-reverse": axis === "y" && reverse,
|
|
5057
|
+
[`ui-gap-${gap}`]: gap
|
|
5058
|
+
}, `ui-items-${align} ui-justify-${justify}`);
|
|
5059
|
+
return React__namespace.default.createElement(Box, Object.assign({ className: classNames__default.default(stackClasses, className) }, attributes), children);
|
|
5060
|
+
};
|
|
5061
|
+
|
|
4991
5062
|
const TagGroup = ({ children, tags, tagSize = "base", className }) => React__namespace.default.createElement(
|
|
4992
5063
|
"div",
|
|
4993
5064
|
{ className: classNames__default.default("ui-flex ui-flex-row ui-flex-wrap ui-gap-2", className) },
|
|
@@ -5781,6 +5852,7 @@ exports.Avatar = Avatar;
|
|
|
5781
5852
|
exports.Badge = Badge;
|
|
5782
5853
|
exports.BellIcon = BellIcon;
|
|
5783
5854
|
exports.BluetoothIcon = BluetoothIcon;
|
|
5855
|
+
exports.Box = Box;
|
|
5784
5856
|
exports.Breadcrumbs = Breadcrumbs;
|
|
5785
5857
|
exports.BrushIcon = BrushIcon;
|
|
5786
5858
|
exports.CRUDPage = CRUDPage;
|
|
@@ -5919,6 +5991,7 @@ exports.SmallDiamondIcon = SmallDiamondIcon;
|
|
|
5919
5991
|
exports.SmallSquareIcon = SmallSquareIcon;
|
|
5920
5992
|
exports.SpaceRocketIcon = RocketIcon;
|
|
5921
5993
|
exports.Spinner = Spinner;
|
|
5994
|
+
exports.Stack = Stack;
|
|
5922
5995
|
exports.StarIcon = StarIcon;
|
|
5923
5996
|
exports.StatusColoredIcon = StatusColoredIcon;
|
|
5924
5997
|
exports.StatusIndicator = StatusIndicator;
|