@povio/ui 2.1.5 → 2.1.7
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/inputs/DateTime/DatePicker/DatePicker.js +1 -0
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +1 -0
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +1 -0
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +1 -0
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +7 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +10 -4
- package/dist/components/table/CellText.js +1 -1
- package/dist/components/table/table.cva.js +2 -2
- package/dist/config/uiStyle.context.d.ts +7 -0
- package/dist/utils/date.utils.d.ts +2 -0
- package/dist/utils/date.utils.js +11 -0
- package/dist/utils/vendor/auth/auth.context.d.ts +2 -2
- package/dist/utils/vendor/auth/auth.context.js +15 -12
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
interface DatePickerFooterProps {
|
|
2
2
|
isValid?: boolean;
|
|
3
|
+
isDisabled?: boolean;
|
|
3
4
|
onTodayPress?: () => void;
|
|
4
5
|
onApply: () => void;
|
|
5
6
|
}
|
|
6
|
-
export declare const DateTimeDialogFooter: ({ isValid, onTodayPress, onApply }: DatePickerFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const DateTimeDialogFooter: ({ isValid, isDisabled, onTodayPress, onApply, }: DatePickerFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -3,7 +3,12 @@ import { clsx } from "clsx";
|
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
5
5
|
import { ns } from "../../../../config/i18n.js";
|
|
6
|
-
const DateTimeDialogFooter = ({
|
|
6
|
+
const DateTimeDialogFooter = ({
|
|
7
|
+
isValid = true,
|
|
8
|
+
isDisabled = false,
|
|
9
|
+
onTodayPress,
|
|
10
|
+
onApply
|
|
11
|
+
}) => {
|
|
7
12
|
const { t } = useTranslation(ns);
|
|
8
13
|
return /* @__PURE__ */ jsxs(
|
|
9
14
|
"footer",
|
|
@@ -18,6 +23,7 @@ const DateTimeDialogFooter = ({ isValid = true, onTodayPress, onApply }) => {
|
|
|
18
23
|
{
|
|
19
24
|
type: "button",
|
|
20
25
|
color: "primary",
|
|
26
|
+
isDisabled,
|
|
21
27
|
onPress: onTodayPress,
|
|
22
28
|
children: t(($) => $.ui.datePicker.today)
|
|
23
29
|
}
|
|
@@ -6,6 +6,7 @@ import { PointerHorizontalIcon } from "../../../assets/icons/PointerHorizontal.j
|
|
|
6
6
|
import { PointerVerticalIcon } from "../../../assets/icons/PointerVertical.js";
|
|
7
7
|
import { tooltipCva, tooltipPointerHorizontalCva, tooltipPointerVerticalCva, tooltipTextCva } from "./tooltip.cva.js";
|
|
8
8
|
import { Typography } from "../../text/Typography/Typography.js";
|
|
9
|
+
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
9
10
|
const CustomTrigger = ({ children, className }) => {
|
|
10
11
|
const ref = useRef(null);
|
|
11
12
|
const { focusableProps } = useFocusable({}, ref);
|
|
@@ -31,6 +32,11 @@ const Tooltip = ({
|
|
|
31
32
|
triggerClassName,
|
|
32
33
|
...tooltipProps
|
|
33
34
|
}) => {
|
|
35
|
+
const uiStyle = UIStyle.useConfig();
|
|
36
|
+
const tooltipCva$1 = uiStyle?.tooltip?.cva ?? tooltipCva;
|
|
37
|
+
const tooltipPointerHorizontalCva$1 = uiStyle?.tooltip?.pointerHorizontalCva ?? tooltipPointerHorizontalCva;
|
|
38
|
+
const tooltipPointerVerticalCva$1 = uiStyle?.tooltip?.pointerVerticalCva ?? tooltipPointerVerticalCva;
|
|
39
|
+
const tooltipTextCva$1 = uiStyle?.tooltip?.textCva ?? tooltipTextCva;
|
|
34
40
|
const Trigger = isNonInteractiveTrigger ? CustomTrigger : Fragment;
|
|
35
41
|
return /* @__PURE__ */ jsxs(
|
|
36
42
|
TooltipTrigger,
|
|
@@ -51,20 +57,20 @@ const Tooltip = ({
|
|
|
51
57
|
/* @__PURE__ */ jsxs(
|
|
52
58
|
Tooltip$1,
|
|
53
59
|
{
|
|
54
|
-
className: tooltipCva({ color }),
|
|
60
|
+
className: tooltipCva$1({ color }),
|
|
55
61
|
...tooltipProps,
|
|
56
62
|
offset: 13,
|
|
57
63
|
children: [
|
|
58
64
|
/* @__PURE__ */ jsxs(OverlayArrow, { children: [
|
|
59
|
-
/* @__PURE__ */ jsx(PointerHorizontalIcon, { className: tooltipPointerHorizontalCva({ color }) }),
|
|
60
|
-
/* @__PURE__ */ jsx(PointerVerticalIcon, { className: tooltipPointerVerticalCva({ color }) })
|
|
65
|
+
/* @__PURE__ */ jsx(PointerHorizontalIcon, { className: tooltipPointerHorizontalCva$1({ color }) }),
|
|
66
|
+
/* @__PURE__ */ jsx(PointerVerticalIcon, { className: tooltipPointerVerticalCva$1({ color }) })
|
|
61
67
|
] }),
|
|
62
68
|
/* @__PURE__ */ jsx(
|
|
63
69
|
Typography,
|
|
64
70
|
{
|
|
65
71
|
size: "body-4",
|
|
66
72
|
variant: "prominent-1",
|
|
67
|
-
className: tooltipTextCva({ color }),
|
|
73
|
+
className: tooltipTextCva$1({ color }),
|
|
68
74
|
children: text
|
|
69
75
|
}
|
|
70
76
|
)
|
|
@@ -7,7 +7,7 @@ const CellText = ({ children, style, className }) => /* @__PURE__ */ jsx(
|
|
|
7
7
|
variant: "default",
|
|
8
8
|
size: "label-1",
|
|
9
9
|
as: "span",
|
|
10
|
-
className: clsx("block overflow-hidden text-ellipsis
|
|
10
|
+
className: clsx("block overflow-hidden text-ellipsis text-text-default-2", className),
|
|
11
11
|
style,
|
|
12
12
|
"data-rac": true,
|
|
13
13
|
children
|
|
@@ -6,7 +6,7 @@ const tableRow = cva(
|
|
|
6
6
|
"disabled:opacity-50",
|
|
7
7
|
"selected:bg-elevation-fill-default-2",
|
|
8
8
|
"hover:selected:bg-interactive-subtle-secondary-hover",
|
|
9
|
-
"clickable:cursor-pointer",
|
|
9
|
+
"data-clickable:cursor-pointer",
|
|
10
10
|
"focus-within:bg-elevation-fill-default-2"
|
|
11
11
|
],
|
|
12
12
|
{
|
|
@@ -37,7 +37,7 @@ const tableHeadData = cva(
|
|
|
37
37
|
);
|
|
38
38
|
const tableData = cva(
|
|
39
39
|
[
|
|
40
|
-
"relative h-0-5 overflow-hidden text-ellipsis whitespace-nowrap border-t border-t-transparent px-2
|
|
40
|
+
"relative h-0-5 overflow-hidden text-ellipsis whitespace-nowrap border-t border-t-transparent px-2",
|
|
41
41
|
"border-b border-b-elevation-outline-default-1",
|
|
42
42
|
"has-[*>[data-hovered]:not([data-disabled])]:hover:border-b-input-outlined-outline-hover",
|
|
43
43
|
"has-[*>[data-invalid]]:border-b-input-outlined-outline-error!",
|
|
@@ -7,6 +7,7 @@ import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
|
|
|
7
7
|
import { InputBaseProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
|
|
8
8
|
import { LabelBaseProps } from '../components/inputs/shared/label.cva';
|
|
9
9
|
import { ToggleVariantProps } from '../components/inputs/Toggle/toggle.cva';
|
|
10
|
+
import { TooltipPointerHorizontalVariantProps, TooltipPointerVerticalVariantProps, TooltipTextVariantProps, TooltipVariantProps } from '../components/overlays/Tooltip/tooltip.cva';
|
|
10
11
|
import { AlertVariantProps } from '../components/status/Alert/alert.cva';
|
|
11
12
|
import { ToastVariantProps } from '../components/status/Toast/toast.cva';
|
|
12
13
|
import { TableDataVariantProps, TableHeadDataVariantProps, TableHeadRowVariantProps, TableRowVariantProps } from '../components/table/table.cva';
|
|
@@ -75,6 +76,12 @@ export declare namespace UIStyle {
|
|
|
75
76
|
rowCva?: Cva<TableRowVariantProps>;
|
|
76
77
|
dataCva?: Cva<TableDataVariantProps>;
|
|
77
78
|
};
|
|
79
|
+
tooltip: {
|
|
80
|
+
cva?: Cva<TooltipVariantProps>;
|
|
81
|
+
pointerHorizontalCva?: Cva<TooltipPointerHorizontalVariantProps>;
|
|
82
|
+
pointerVerticalCva?: Cva<TooltipPointerVerticalVariantProps>;
|
|
83
|
+
textCva?: Cva<TooltipTextVariantProps>;
|
|
84
|
+
};
|
|
78
85
|
}
|
|
79
86
|
interface ProviderProps {
|
|
80
87
|
config?: Partial<Options>;
|
package/dist/utils/date.utils.js
CHANGED
|
@@ -2,10 +2,21 @@ import { DateTime } from "luxon";
|
|
|
2
2
|
var DateUtils;
|
|
3
3
|
((DateUtils2) => {
|
|
4
4
|
const DATE_FORMAT = "dd/MM/yyyy";
|
|
5
|
+
const DATETIME_FORMAT = "dd/MM/yyyy HH:mm:ss";
|
|
5
6
|
function formatDate(date, format = DATE_FORMAT) {
|
|
6
7
|
return DateTime.fromJSDate(date).toFormat(format);
|
|
7
8
|
}
|
|
8
9
|
DateUtils2.formatDate = formatDate;
|
|
10
|
+
function formatRelativeTime(date, options) {
|
|
11
|
+
const dateTime = typeof date === "string" ? DateTime.fromISO(date) : DateTime.fromJSDate(date);
|
|
12
|
+
if (!dateTime.isValid) {
|
|
13
|
+
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
14
|
+
return formatDate(dateObj, DATETIME_FORMAT);
|
|
15
|
+
}
|
|
16
|
+
const relative = dateTime.toRelative(options);
|
|
17
|
+
return relative || formatDate(dateTime.toJSDate(), DATETIME_FORMAT);
|
|
18
|
+
}
|
|
19
|
+
DateUtils2.formatRelativeTime = formatRelativeTime;
|
|
9
20
|
})(DateUtils || (DateUtils = {}));
|
|
10
21
|
export {
|
|
11
22
|
DateUtils
|
|
@@ -16,7 +16,7 @@ export declare namespace AuthContext {
|
|
|
16
16
|
loadingState?: ReactNode;
|
|
17
17
|
}
|
|
18
18
|
type ProviderProps<TUser = unknown> = Type<TUser>;
|
|
19
|
-
export const Provider: <TUser
|
|
20
|
-
export const useAuth: <TUser
|
|
19
|
+
export const Provider: <TUser>({ isAuthenticated, isInitializing, logout, updateTokens, accessToken, user, userPromise, routes, loadingState, children, }: PropsWithChildren<ProviderProps<TUser>>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export const useAuth: <TUser>() => Type<TUser>;
|
|
21
21
|
export {};
|
|
22
22
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, use } from "react";
|
|
2
|
+
import { createContext, useMemo, use } from "react";
|
|
3
3
|
var AuthContext;
|
|
4
4
|
((AuthContext2) => {
|
|
5
5
|
const Context = createContext({});
|
|
@@ -15,17 +15,20 @@ var AuthContext;
|
|
|
15
15
|
loadingState,
|
|
16
16
|
children
|
|
17
17
|
}) => {
|
|
18
|
-
const value =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
const value = useMemo(
|
|
19
|
+
() => ({
|
|
20
|
+
isAuthenticated,
|
|
21
|
+
isInitializing,
|
|
22
|
+
logout,
|
|
23
|
+
updateTokens,
|
|
24
|
+
accessToken,
|
|
25
|
+
user,
|
|
26
|
+
userPromise,
|
|
27
|
+
routes,
|
|
28
|
+
loadingState
|
|
29
|
+
}),
|
|
30
|
+
[isAuthenticated, isInitializing, logout, updateTokens, accessToken, user, userPromise, routes, loadingState]
|
|
31
|
+
);
|
|
29
32
|
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
30
33
|
};
|
|
31
34
|
AuthContext2.useAuth = () => {
|