@uxf/ui 11.88.2 → 11.89.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/content/content-schema.d.ts +2 -1
- package/content/types.d.ts +2 -1
- package/context/context.d.ts +1 -1
- package/create-component-preview-page/create-component-preview-page.d.ts +2 -1
- package/dialog/dialog.d.ts +1 -1
- package/icon/icon.d.ts +3 -2
- package/icon/icon.js +1 -1
- package/input/index.d.ts +2 -1
- package/input/input-remove-button.d.ts +7 -4
- package/input/input-remove-button.js +4 -5
- package/package.json +4 -4
- package/raster-image/img-sources.d.ts +1 -1
- package/raster-image/img-sources.js +8 -5
- package/raster-image/raster-image.d.ts +1 -1
- package/raster-image/responsive-img-sources.d.ts +1 -1
- package/time-picker-input/time-picker-input.d.ts +1 -0
- package/time-picker-input/time-picker-input.js +3 -2
- package/time-picker-input/time-picker-input.stories.js +5 -5
- package/utils/files/get-file-url.js +3 -1
- package/utils/storybook-config.d.ts +2 -1
package/content/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnyObject } from "@uxf/core/types";
|
|
1
2
|
import { ContentSchema } from "@uxf/ui/content/content-schema";
|
|
2
3
|
import { FC, ReactNode } from "react";
|
|
3
4
|
import { UseControllerProps } from "react-hook-form";
|
|
@@ -6,7 +7,7 @@ interface ContentFormProps<TYPE extends ContentType> extends UseControllerProps<
|
|
|
6
7
|
type: TYPE;
|
|
7
8
|
index: number;
|
|
8
9
|
onRemove: () => void;
|
|
9
|
-
TypeInputProps:
|
|
10
|
+
TypeInputProps: AnyObject;
|
|
10
11
|
}
|
|
11
12
|
export type ContentFormComponent<TYPE extends ContentType> = FC<ContentFormProps<TYPE>> & {
|
|
12
13
|
getConfig: () => {
|
package/context/context.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnyObject } from "@uxf/core/types";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { components } from "../components";
|
|
3
4
|
type Components = typeof components;
|
|
@@ -5,7 +6,7 @@ interface CreateComponentPreviewPageProps {
|
|
|
5
6
|
componentName: keyof Components | null;
|
|
6
7
|
}
|
|
7
8
|
export declare function CreateComponentPreviewPage(props: CreateComponentPreviewPageProps): React.JSX.Element;
|
|
8
|
-
export declare function getServerSideProps(ctx:
|
|
9
|
+
export declare function getServerSideProps(ctx: AnyObject): {
|
|
9
10
|
props: {
|
|
10
11
|
componentName: any;
|
|
11
12
|
};
|
package/dialog/dialog.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseFloatingReturn } from "@floating-ui/react";
|
|
2
2
|
import { DialogVariants } from "@uxf/ui/dialog/theme";
|
|
3
3
|
import React, { FC, HTMLProps, ReactNode, Ref } from "react";
|
|
4
|
-
type GetFloatingElementProps = (userProps?: HTMLProps<HTMLElement>) => Record<string, unknown
|
|
4
|
+
type GetFloatingElementProps = (userProps?: HTMLProps<HTMLElement>) => Partial<Record<string, unknown>>;
|
|
5
5
|
export type DialogVariant = keyof DialogVariants;
|
|
6
6
|
export interface DialogProps {
|
|
7
7
|
children?: ReactNode;
|
package/icon/icon.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AnyObject } from "@uxf/core/types";
|
|
2
|
+
import React, { CSSProperties, FunctionComponent } from "react";
|
|
2
3
|
import { IconColor } from "./theme";
|
|
3
4
|
import { IconName } from "./types";
|
|
4
5
|
type NameOrComponentType = {
|
|
@@ -6,7 +7,7 @@ type NameOrComponentType = {
|
|
|
6
7
|
Component?: never;
|
|
7
8
|
} | {
|
|
8
9
|
name?: never;
|
|
9
|
-
Component:
|
|
10
|
+
Component: FunctionComponent<AnyObject>;
|
|
10
11
|
};
|
|
11
12
|
export type IconProps = {
|
|
12
13
|
"aria-label"?: string;
|
package/icon/icon.js
CHANGED
|
@@ -55,7 +55,7 @@ exports.Icon = (0, react_1.forwardRef)((props, ref) => {
|
|
|
55
55
|
if (CustomComponent) {
|
|
56
56
|
return (react_1.default.createElement(CustomComponent, { "aria-label": props["aria-label"], className: className, preserveAspectRatio: preserveAspectRatio, ref: ref, role: "img", style: style }));
|
|
57
57
|
}
|
|
58
|
-
if (props.name
|
|
58
|
+
if (props.name in componentContext.iconsConfig) {
|
|
59
59
|
const icon = componentContext.iconsConfig[props.name];
|
|
60
60
|
return (react_1.default.createElement("svg", { "aria-label": props["aria-label"], className: className, preserveAspectRatio: preserveAspectRatio, ref: ref, role: "img", style: style, viewBox: `0 0 ${icon.w} ${icon.h}` },
|
|
61
61
|
react_1.default.createElement("use", { xlinkHref: `${componentContext.spriteFilePath}#icon-sprite--${props.name}` })));
|
package/input/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InputArrowIcon } from "./input-arrow-icon";
|
|
2
|
+
import { InputRemoveButton } from "./input-remove-button";
|
|
2
3
|
export type { InputProps } from "./input";
|
|
3
4
|
export type { InputElementProps } from "./input-element";
|
|
4
5
|
export type { InputRemoveButtonProps } from "./input-remove-button";
|
|
@@ -8,7 +9,7 @@ export declare const Input: import("react").ForwardRefExoticComponent<import("./
|
|
|
8
9
|
Element: import("react").ForwardRefExoticComponent<import("./input-element").InputElementProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
9
10
|
LeftAddon: import("react").FC<import("./input-left-addon").InputLeftAddonProps>;
|
|
10
11
|
LeftElement: import("react").FC<import("./input-left-element").InputLeftElementProps>;
|
|
11
|
-
RemoveButton:
|
|
12
|
+
RemoveButton: typeof InputRemoveButton;
|
|
12
13
|
RightAddon: import("react").FC<import("./input-right-addon").InputRightAddonProps>;
|
|
13
14
|
RightElement: import("react").FC<import("./input-right-element").InputRightElementProps>;
|
|
14
15
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
export interface InputRemoveButtonProps {
|
|
3
|
-
onChange?: (value:
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface InputRemoveButtonProps<Value> {
|
|
3
|
+
onChange?: (value: Value | null) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function InputRemoveButton<Value>(props: InputRemoveButtonProps<Value>): React.JSX.Element;
|
|
6
|
+
export declare namespace InputRemoveButton {
|
|
7
|
+
var displayName: string;
|
|
4
8
|
}
|
|
5
|
-
export declare const InputRemoveButton: FC<InputRemoveButtonProps>;
|
|
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.InputRemoveButton =
|
|
6
|
+
exports.InputRemoveButton = InputRemoveButton;
|
|
7
7
|
const icon_1 = require("@uxf/ui/icon");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
|
-
|
|
9
|
+
function InputRemoveButton(props) {
|
|
10
10
|
const onRemoveClick = (e) => {
|
|
11
11
|
var _a;
|
|
12
12
|
e.preventDefault();
|
|
@@ -24,6 +24,5 @@ const InputRemoveButton = (props) => {
|
|
|
24
24
|
return (react_1.default.createElement("button", { className: "uxf-input__remove-button", onClick: onRemoveClick, onKeyDown: onRemoveKeyDown, type: "button" },
|
|
25
25
|
react_1.default.createElement("span", { className: "uxf-input__remove-button-inner" },
|
|
26
26
|
react_1.default.createElement(icon_1.Icon, { className: "uxf-input__remove-button-icon", name: "xmarkLarge" }))));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
exports.InputRemoveButton.displayName = "UxfUiInputRemoveButton";
|
|
27
|
+
}
|
|
28
|
+
InputRemoveButton.displayName = "UxfUiInputRemoveButton";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/ui",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.89.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@floating-ui/react": "0.27.16",
|
|
25
25
|
"@headlessui/react": "1.7.19",
|
|
26
|
-
"@uxf/core": "11.
|
|
27
|
-
"@uxf/core-react": "11.
|
|
26
|
+
"@uxf/core": "11.89.0",
|
|
27
|
+
"@uxf/core-react": "11.89.0",
|
|
28
28
|
"@uxf/datepicker": "11.88.2",
|
|
29
|
-
"@uxf/styles": "11.
|
|
29
|
+
"@uxf/styles": "11.89.0",
|
|
30
30
|
"color2k": "2.0.3",
|
|
31
31
|
"dayjs": "1.11.19",
|
|
32
32
|
"react-dropzone": "14.3.8"
|
|
@@ -7,7 +7,7 @@ export type ImageSourcesOptions = Omit<GetImgSrcSetOptions, "quality" | "toForma
|
|
|
7
7
|
};
|
|
8
8
|
export interface ImageSourcesProps {
|
|
9
9
|
breakpointIndex?: number;
|
|
10
|
-
breakpoints?: string[];
|
|
10
|
+
breakpoints?: (string | undefined)[];
|
|
11
11
|
height: Dimension;
|
|
12
12
|
options?: ImageSourcesOptions;
|
|
13
13
|
quality?: Quality;
|
|
@@ -10,7 +10,7 @@ const is_empty_1 = require("@uxf/core/utils/is-empty");
|
|
|
10
10
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
11
11
|
const react_1 = __importDefault(require("react"));
|
|
12
12
|
function ImgSources(props) {
|
|
13
|
-
var _a, _b;
|
|
13
|
+
var _a, _b, _c;
|
|
14
14
|
if ((0, image_1.isSrcString)(props.src) && (0, is_empty_1.isEmpty)(props.src)) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
@@ -21,17 +21,20 @@ function ImgSources(props) {
|
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
23
|
let media;
|
|
24
|
-
if ((0, is_not_nil_1.isNotNil)(props.
|
|
25
|
-
|
|
24
|
+
if ((0, is_not_nil_1.isNotNil)(props.breakpointIndex)) {
|
|
25
|
+
const breakpoint = (_a = props.breakpoints) === null || _a === void 0 ? void 0 : _a.at(props.breakpointIndex);
|
|
26
|
+
if ((0, is_not_nil_1.isNotNil)(breakpoint)) {
|
|
27
|
+
media = `(min-width: ${breakpoint})`;
|
|
28
|
+
}
|
|
26
29
|
}
|
|
27
30
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
28
|
-
react_1.default.createElement(hide_1.Hide, { when: Boolean((
|
|
31
|
+
react_1.default.createElement(hide_1.Hide, { when: Boolean((_b = props.options) === null || _b === void 0 ? void 0 : _b.isAvifDisabled) },
|
|
29
32
|
react_1.default.createElement("source", { media: media, srcSet: (0, image_1.getImgSrcSet)(props.src, props.width, props.height, {
|
|
30
33
|
...props.options,
|
|
31
34
|
quality: (0, image_1.getImgQuality)(props.quality, "avif"),
|
|
32
35
|
toFormat: "avif",
|
|
33
36
|
}), type: "image/avif" })),
|
|
34
|
-
react_1.default.createElement(hide_1.Hide, { when: Boolean((
|
|
37
|
+
react_1.default.createElement(hide_1.Hide, { when: Boolean((_c = props.options) === null || _c === void 0 ? void 0 : _c.isWebPDisabled) },
|
|
35
38
|
react_1.default.createElement("source", { media: media, srcSet: (0, image_1.getImgSrcSet)(props.src, props.width, props.height, {
|
|
36
39
|
...props.options,
|
|
37
40
|
quality: (0, image_1.getImgQuality)(props.quality, "webp"),
|
|
@@ -3,7 +3,7 @@ import type { ImageSource } from "@uxf/core/utils/resizer";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { ImageSourcesOptions } from "./img-sources";
|
|
5
5
|
export interface ResponsiveImgSourcesProps {
|
|
6
|
-
breakpoints?: Record<string, string
|
|
6
|
+
breakpoints?: Partial<Record<string, string>>;
|
|
7
7
|
height: number | undefined;
|
|
8
8
|
heights?: number[];
|
|
9
9
|
options?: ImageSourcesOptions;
|
|
@@ -8,6 +8,7 @@ export declare const OUTPUT_TIME_FORMAT = "HH:mm:ss";
|
|
|
8
8
|
interface CustomTimePickerProps extends ControlProps<TimeString | null> {
|
|
9
9
|
onClose: () => void;
|
|
10
10
|
}
|
|
11
|
+
export declare const TIME_PICKER_INPUT_COMPONENT_NAME = "timePickerInput";
|
|
11
12
|
export interface TimePickerInputProps extends Omit<InputWithPopoverProps<string | null>, "children" | "placeholder" | "triggerElement"> {
|
|
12
13
|
placeholder?: string;
|
|
13
14
|
triggerElement?: ReactNode;
|
|
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.TimePickerInput = exports.OUTPUT_TIME_FORMAT = exports.DISPLAY_TIME_FORMAT = exports.ALLOWED_TIME_FORMAT = void 0;
|
|
40
|
+
exports.TimePickerInput = exports.TIME_PICKER_INPUT_COMPONENT_NAME = exports.OUTPUT_TIME_FORMAT = exports.DISPLAY_TIME_FORMAT = exports.ALLOWED_TIME_FORMAT = void 0;
|
|
41
41
|
const is_time_string_1 = require("@uxf/core/date/is-time-string");
|
|
42
42
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
43
43
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
@@ -68,6 +68,7 @@ function getSelectedTime(value) {
|
|
|
68
68
|
}
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
|
+
exports.TIME_PICKER_INPUT_COMPONENT_NAME = "timePickerInput";
|
|
71
72
|
exports.TimePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
72
73
|
var _a;
|
|
73
74
|
const onChange = props.onChange;
|
|
@@ -88,6 +89,6 @@ exports.TimePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
88
89
|
}, [onChange]);
|
|
89
90
|
const value = getValue(props.value);
|
|
90
91
|
const selectedTime = getSelectedTime(props.value);
|
|
91
|
-
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, onChange: onInputChange, placeholder: props.placeholder, ref: ref, triggerElement: (_a = props.triggerElement) !== null && _a !== void 0 ? _a : react_1.default.createElement(icon_1.Icon, { name: "clock", size: 20 }), value: value }, ({ close }) => (0, is_not_nil_1.isNotNil)(props.CustomTimePicker) ? (react_1.default.createElement(props.CustomTimePicker, { onChange: props.onChange, onClose: close, value: (0, is_time_string_1.isTimeString)(props.value) ? props.value : null })) : (react_1.default.createElement(time_picker_1.TimePicker, { onChange: onTimePickerChange, onClosePopover: close, preventScroll: true, selectedTime: selectedTime }))));
|
|
92
|
+
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, "data-component": exports.TIME_PICKER_INPUT_COMPONENT_NAME, onChange: onInputChange, placeholder: props.placeholder, ref: ref, triggerElement: (_a = props.triggerElement) !== null && _a !== void 0 ? _a : react_1.default.createElement(icon_1.Icon, { name: "clock", size: 20 }), value: value }, ({ close }) => (0, is_not_nil_1.isNotNil)(props.CustomTimePicker) ? (react_1.default.createElement(props.CustomTimePicker, { onChange: props.onChange, onClose: close, value: (0, is_time_string_1.isTimeString)(props.value) ? props.value : null })) : (react_1.default.createElement(time_picker_1.TimePicker, { onChange: onTimePickerChange, onClosePopover: close, preventScroll: true, selectedTime: selectedTime }))));
|
|
92
93
|
});
|
|
93
94
|
exports.TimePickerInput.displayName = "UxfUiTimePickerInput";
|
|
@@ -42,12 +42,12 @@ const time_picker_input_1 = require("./time-picker-input");
|
|
|
42
42
|
function Default() {
|
|
43
43
|
const [value, setValue] = (0, react_1.useState)(null);
|
|
44
44
|
const onChange = (0, action_1.action)("onChange", setValue);
|
|
45
|
-
return (react_1.default.createElement("div", { className: "
|
|
46
|
-
react_1.default.createElement(time_picker_input_1.TimePickerInput, { id: "time-test", label: "\u010Cas \u010Dehokoliv", name: "
|
|
45
|
+
return (react_1.default.createElement("div", { className: "space-y-4 p-8" },
|
|
46
|
+
react_1.default.createElement(time_picker_input_1.TimePickerInput, { id: "time-test", label: "\u010Cas \u010Dehokoliv", name: "default", onChange: onChange, placeholder: "Zadejte \u010Das...", value: value }),
|
|
47
47
|
react_1.default.createElement(time_picker_input_1.TimePickerInput, { id: "time-test", isClearable: true, label: "\u010Cas \u010Dehokoliv vlastn\u00ED ikona", name: "time", onChange: onChange, triggerElement: react_1.default.createElement(icon_1.Icon, { name: "camera", size: 20 }), value: value }),
|
|
48
|
-
react_1.default.createElement(time_picker_input_1.TimePickerInput, { id: "
|
|
49
|
-
react_1.default.createElement(time_picker_input_1.TimePickerInput, { id: "
|
|
50
|
-
react_1.default.createElement(time_picker_input_1.TimePickerInput, { id: "
|
|
48
|
+
react_1.default.createElement(time_picker_input_1.TimePickerInput, { id: "disabled", isDisabled: true, label: "\u010Cas disabled", name: "disabled", onChange: onChange, value: value }),
|
|
49
|
+
react_1.default.createElement(time_picker_input_1.TimePickerInput, { id: "readonly", isReadOnly: true, label: "\u010Cas readonly", name: "readonly", onChange: onChange, value: value }),
|
|
50
|
+
react_1.default.createElement(time_picker_input_1.TimePickerInput, { id: "invalid", isClearable: true, isInvalid: true, label: "\u010Cas invalid", name: "invalid", onChange: onChange, value: value }),
|
|
51
51
|
react_1.default.createElement(time_picker_input_1.TimePickerInput, { CustomTimePicker: (props) => (react_1.default.createElement(button_1.Button, { onClick: () => {
|
|
52
52
|
props.onChange("15:00:00");
|
|
53
53
|
props.onClose();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFileUrl = getFileUrl;
|
|
4
|
+
const throw_error_1 = require("@uxf/core/utils/throw-error");
|
|
4
5
|
function getFileUrl(domain, file) {
|
|
5
|
-
|
|
6
|
+
var _a, _b;
|
|
7
|
+
return `${domain}/upload/${file.namespace || "default"}/${(_a = file.uuid.at(0)) !== null && _a !== void 0 ? _a : (0, throw_error_1.throwError)("Invalid UUID")}/${(_b = file.uuid.at(1)) !== null && _b !== void 0 ? _b : (0, throw_error_1.throwError)("Invalid UUID")}/${file.uuid}.${file.extension}`;
|
|
6
8
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnyObject } from "@uxf/core/types";
|
|
1
2
|
import { ButtonColor, ButtonSize, ButtonVariant } from "@uxf/ui/button";
|
|
2
3
|
import React, { ReactNode } from "react";
|
|
3
4
|
import { AlertBubbleColor, AlertBubbleSize } from "../alert-bubble";
|
|
@@ -37,7 +38,7 @@ export interface StorybookConfig {
|
|
|
37
38
|
Message: {
|
|
38
39
|
colors: MessageColor[];
|
|
39
40
|
};
|
|
40
|
-
Select:
|
|
41
|
+
Select: AnyObject;
|
|
41
42
|
}
|
|
42
43
|
export declare const defaultConfig: StorybookConfig;
|
|
43
44
|
export declare function useStorybookConfig<T extends keyof StorybookConfig>(key: T): StorybookConfig[T];
|