@luscii-healthtech/web-ui 36.2.0 → 37.0.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/README.md +28 -0
- package/dist/components/Text/Text.d.ts +1 -0
- package/dist/index.development.js +22 -6
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/general.types.d.ts +1 -1
- package/dist/web-ui-tailwind.css +257 -0
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -95,6 +95,34 @@ The locale passed should adhere to the `{language}-{region}` format, for example
|
|
|
95
95
|
- `de-DE`
|
|
96
96
|
- `fr-FR`
|
|
97
97
|
|
|
98
|
+
### Tooltip Provider
|
|
99
|
+
|
|
100
|
+
Install the `@radix-ui/react-tooltip` peer dependency into your project:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
yarn add @radix-ui/react-tooltip
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Wrap your app with the `Tooltip.Provider` component:
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
import * as Tooltip from "@radix-ui/react-tooltip";
|
|
110
|
+
import React from "react";
|
|
111
|
+
import { createRoot } from "react-dom/client";
|
|
112
|
+
import App from "./App";
|
|
113
|
+
|
|
114
|
+
function start() {
|
|
115
|
+
const root = createRoot(document.querySelector("#root"));
|
|
116
|
+
root.render(
|
|
117
|
+
<Tooltip.Provider delayDuration={800} skipDelayDuration={500}>
|
|
118
|
+
<App />
|
|
119
|
+
</Tooltip.Provider>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
More about this component can be found in its [documentation](https://www.radix-ui.com/primitives/docs/components/tooltip).
|
|
125
|
+
|
|
98
126
|
## How to use
|
|
99
127
|
|
|
100
128
|
The primary goal of WebUI is to make frontend development faster. It does this by providing a set of commonly used components that can be composed together to build user interfaces.
|
|
@@ -37,6 +37,7 @@ export declare const allowedColors: {
|
|
|
37
37
|
*/
|
|
38
38
|
readonly "on-surface": "ui-text-on-surface";
|
|
39
39
|
readonly "on-surface-variant": "ui-text-on-surface-variant";
|
|
40
|
+
readonly "on-secondary": "ui-text-on-secondary";
|
|
40
41
|
};
|
|
41
42
|
declare const allowedHoverColors: {
|
|
42
43
|
readonly "blue-900": "hover:ui-text-primary-dark";
|
|
@@ -10,7 +10,7 @@ var sortable = require('@dnd-kit/sortable');
|
|
|
10
10
|
var omit = require('lodash.omit');
|
|
11
11
|
var reactLazyLoadImageComponent = require('react-lazy-load-image-component');
|
|
12
12
|
var utilities = require('@dnd-kit/utilities');
|
|
13
|
-
var
|
|
13
|
+
var Tooltip = require('@radix-ui/react-tooltip');
|
|
14
14
|
var ReactModal = require('react-modal');
|
|
15
15
|
var Glider = require('react-glider');
|
|
16
16
|
require('glider-js/glider.min.css');
|
|
@@ -58,7 +58,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
58
58
|
var classNames__default = /*#__PURE__*/_interopDefault(classNames);
|
|
59
59
|
var isString__default = /*#__PURE__*/_interopDefault(isString);
|
|
60
60
|
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
61
|
-
var
|
|
61
|
+
var Tooltip__namespace = /*#__PURE__*/_interopNamespace(Tooltip);
|
|
62
62
|
var ReactModal__default = /*#__PURE__*/_interopDefault(ReactModal);
|
|
63
63
|
var Glider__default = /*#__PURE__*/_interopDefault(Glider);
|
|
64
64
|
var ReactDatePicker__default = /*#__PURE__*/_interopDefault(ReactDatePicker);
|
|
@@ -1408,7 +1408,8 @@ const allowedColors = {
|
|
|
1408
1408
|
* Semantic colors
|
|
1409
1409
|
*/
|
|
1410
1410
|
"on-surface": "ui-text-on-surface",
|
|
1411
|
-
"on-surface-variant": "ui-text-on-surface-variant"
|
|
1411
|
+
"on-surface-variant": "ui-text-on-surface-variant",
|
|
1412
|
+
"on-secondary": "ui-text-on-secondary"
|
|
1412
1413
|
};
|
|
1413
1414
|
const allowedHoverColors = {
|
|
1414
1415
|
"blue-900": "hover:ui-text-primary-dark",
|
|
@@ -1868,6 +1869,7 @@ const Box = (props) => {
|
|
|
1868
1869
|
return React__namespace.default.createElement(Element, Object.assign({ className: classNames__default.default(spacingClasses, {
|
|
1869
1870
|
"ui-bg-surface": props.backgroundColor === "surface",
|
|
1870
1871
|
"ui-bg-background": props.backgroundColor === "background",
|
|
1872
|
+
"ui-bg-secondary-background": props.backgroundColor === "secondary-background",
|
|
1871
1873
|
"ui-bg-slate-100": props.backgroundColor === "base",
|
|
1872
1874
|
"ui-bg-blue-50": props.backgroundColor === "blue",
|
|
1873
1875
|
"ui-bg-red-50": props.backgroundColor === "red",
|
|
@@ -1878,6 +1880,7 @@ const Box = (props) => {
|
|
|
1878
1880
|
}, {
|
|
1879
1881
|
"hover:ui-bg-slate-100": props.hoverBackgroundColor === "base",
|
|
1880
1882
|
"hover:ui-bg-background": props.backgroundColor === "background",
|
|
1883
|
+
"hover:ui-bg-secondary-background": props.hoverBackgroundColor === "secondary-background",
|
|
1881
1884
|
"hover:ui-bg-blue-50": props.hoverBackgroundColor === "blue",
|
|
1882
1885
|
"hover:ui-bg-red-50": props.hoverBackgroundColor === "red",
|
|
1883
1886
|
"hover:ui-bg-green-50": props.hoverBackgroundColor === "green",
|
|
@@ -2403,10 +2406,23 @@ const ButtonV2 = React__namespace.default.forwardRef((_a, innerRef) => {
|
|
|
2403
2406
|
);
|
|
2404
2407
|
if (title) {
|
|
2405
2408
|
return React__namespace.default.createElement(
|
|
2406
|
-
|
|
2409
|
+
Tooltip__namespace.Root,
|
|
2407
2410
|
null,
|
|
2408
|
-
React__namespace.default.createElement(
|
|
2409
|
-
|
|
2411
|
+
React__namespace.default.createElement(Tooltip__namespace.Trigger, { asChild: true, id: buttonTooltipId }, buttonComponent),
|
|
2412
|
+
React__namespace.default.createElement(
|
|
2413
|
+
Tooltip__namespace.Portal,
|
|
2414
|
+
null,
|
|
2415
|
+
React__namespace.default.createElement(
|
|
2416
|
+
Tooltip__namespace.Content,
|
|
2417
|
+
{ className: classNames__default.default("ui-max-w-55", "data-[state=delayed-open]:ui-animate-in data-[state=closed]:ui-animate-out data-[state=closed]:ui-fade-out-0 data-[state=delayed-open]:ui-fade-in-0 data-[state=closed]:ui-zoom-out-95 data-[state=delayed-open]:ui-zoom-in-95 data-[side=bottom]:ui-slide-in-from-top-2 data-[side=left]:ui-slide-in-from-right-2 data-[side=right]:ui-slide-in-from-left-2 data-[side=top]:ui-slide-in-from-bottom-2"), sideOffset: 4 },
|
|
2418
|
+
React__namespace.default.createElement(
|
|
2419
|
+
Box,
|
|
2420
|
+
{ backgroundColor: "secondary-background", px: "m", py: "xs", borderRadius: "xxxxs" },
|
|
2421
|
+
React__namespace.default.createElement(Text, { color: "on-secondary" }, title)
|
|
2422
|
+
),
|
|
2423
|
+
React__namespace.default.createElement(Tooltip__namespace.Arrow, { width: 8, height: 8, className: "ui-fill-secondary-background" })
|
|
2424
|
+
)
|
|
2425
|
+
)
|
|
2410
2426
|
);
|
|
2411
2427
|
}
|
|
2412
2428
|
return buttonComponent;
|