@uxf/ui 10.8.2 → 10.10.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.
@@ -1,8 +1,10 @@
1
1
  import { FC } from "react";
2
+ import { IconName } from "../icon/types";
2
3
  import { AlertBubbleColor, AlertBubbleSize } from "./theme";
3
4
  export interface AlertBubbleProps {
4
5
  className?: string;
5
6
  color?: AlertBubbleColor;
7
+ icon?: IconName;
6
8
  size?: AlertBubbleSize;
7
9
  }
8
10
  export declare const AlertBubble: FC<AlertBubbleProps>;
@@ -14,9 +14,9 @@ const ICON = {
14
14
  success: "check",
15
15
  };
16
16
  const AlertBubble = (props) => {
17
- var _a, _b, _c;
17
+ var _a, _b, _c, _d;
18
18
  return (react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-alert-bubble", `uxf-alert-bubble--color-${(_a = props.color) !== null && _a !== void 0 ? _a : "default"}`, `uxf-alert-bubble--size-${(_b = props.size) !== null && _b !== void 0 ? _b : "default"}`, props.className) },
19
- react_1.default.createElement(icon_1.Icon, { className: "uxf-alert-bubble__icon", name: ICON[(_c = props.color) !== null && _c !== void 0 ? _c : "default"] })));
19
+ react_1.default.createElement(icon_1.Icon, { className: "uxf-alert-bubble__icon", name: (_c = props.icon) !== null && _c !== void 0 ? _c : ICON[(_d = props.color) !== null && _d !== void 0 ? _d : "default"] })));
20
20
  };
21
21
  exports.AlertBubble = AlertBubble;
22
22
  exports.AlertBubble.displayName = "UxfUiAlertBubble";
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode } from "react";
2
+ import { IconName } from "../icon/types";
2
3
  import { MessageColor, MessageVariant } from "./theme";
3
4
  export interface ConfirmProps {
4
5
  CustomIconComponent?: ReactNode;
@@ -8,6 +9,7 @@ export interface ConfirmProps {
8
9
  className?: string;
9
10
  color: MessageColor;
10
11
  description?: string;
12
+ icon?: IconName;
11
13
  onAccept?: () => void;
12
14
  onCancel?: () => void;
13
15
  onClose: () => void;
@@ -28,7 +28,7 @@ const MessageContent = (props) => {
28
28
  const isCentered = props.variant === "centered";
29
29
  return (react_1.default.createElement("div", { className: `uxf-message__content ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` },
30
30
  react_1.default.createElement("div", { className: "uxf-message__content-wrapper" },
31
- props.CustomIconComponent !== null ? (react_1.default.createElement("div", { className: "uxf-message__icon-wrapper" }, (_b = props.CustomIconComponent) !== null && _b !== void 0 ? _b : (react_1.default.createElement(alert_bubble_1.AlertBubble, { className: "uxf-message__alert-bubble", color: props.color, size: isCentered ? "default" : "xs" })))) : null,
31
+ props.CustomIconComponent !== null ? (react_1.default.createElement("div", { className: "uxf-message__icon-wrapper" }, (_b = props.CustomIconComponent) !== null && _b !== void 0 ? _b : (react_1.default.createElement(alert_bubble_1.AlertBubble, { className: "uxf-message__alert-bubble", color: props.color, icon: props.icon, size: isCentered ? "default" : "xs" })))) : null,
32
32
  react_1.default.createElement("div", { className: "uxf-message__text-content" },
33
33
  react_1.default.createElement("h2", { className: "uxf-message__title" }, props.title),
34
34
  react_1.default.createElement("p", { className: "uxf-message__description" }, props.description)),
@@ -1,17 +1,19 @@
1
1
  import React, { ReactNode } from "react";
2
+ import { IconName } from "../icon/types";
2
3
  import { MessageColor, MessageVariant } from "./theme";
3
4
  export interface MessageProps {
4
5
  CustomIconComponent?: ReactNode;
6
+ acceptLabel?: string;
7
+ cancelLabel: string;
5
8
  children?: ReactNode;
6
9
  className?: string;
7
- onCancel?: () => void;
10
+ color: MessageColor;
11
+ description?: string;
12
+ icon?: IconName;
8
13
  onAccept?: () => void;
14
+ onCancel?: () => void;
9
15
  title: string;
10
- description?: string;
11
- acceptLabel?: string;
12
- cancelLabel: string;
13
16
  variant?: MessageVariant;
14
- color: MessageColor;
15
17
  }
16
18
  export interface MessageRef {
17
19
  close: () => void;
@@ -42,6 +42,6 @@ exports.Message = (0, react_1.forwardRef)((props, ref) => {
42
42
  message: innerRef.current.message,
43
43
  }), []);
44
44
  return content ? (react_1.default.createElement(dialog_1.Dialog, { className: (0, cx_1.cx)("uxf-message", `uxf-message--variant-${(_a = content.variant) !== null && _a !== void 0 ? _a : "simple"}`, `uxf-message--color-${content.color}`, content.className), disableBackdropClose: true, onClose: close, open: !!content },
45
- react_1.default.createElement(message_content_1.MessageContent, { CustomIconComponent: content.CustomIconComponent, acceptLabel: content.acceptLabel, cancelLabel: content.cancelLabel, color: content.color, description: content.description, onAccept: content.onAccept, onCancel: content.onCancel, onClose: close, title: content.title, variant: content.variant }, content.children))) : null;
45
+ react_1.default.createElement(message_content_1.MessageContent, { CustomIconComponent: content.CustomIconComponent, acceptLabel: content.acceptLabel, cancelLabel: content.cancelLabel, color: content.color, description: content.description, icon: content.icon, onAccept: content.onAccept, onCancel: content.onCancel, onClose: close, title: content.title, variant: content.variant }, content.children))) : null;
46
46
  });
47
47
  exports.Message.displayName = "UxfUiMessage";
@@ -53,7 +53,7 @@ function handleInputKeyDownRecursion(selectedOptions, onRemove) {
53
53
  }
54
54
  }
55
55
  const OptionElement = (props) => {
56
- return (react_3.default.createElement(react_2.Combobox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && props.withoutPopover && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), value: props.option }, (optionState) => (react_3.default.createElement(react_3.default.Fragment, null, props.withCheckboxes ? (react_3.default.createElement(checkbox_input_1.CheckboxInput, { isDisabled: optionState.disabled, isFocused: optionState.active, label: props.label, onChange: props.handleCheckboxChange, value: optionState.selected })) : (props.label)))));
56
+ return (react_3.default.createElement(react_2.Combobox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && props.withoutPopover && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), disabled: props.option.disabled, value: props.option }, (optionState) => (react_3.default.createElement(react_3.default.Fragment, null, props.withCheckboxes ? (react_3.default.createElement(checkbox_input_1.CheckboxInput, { isDisabled: optionState.disabled, isFocused: optionState.active, label: props.label, onChange: props.handleCheckboxChange, value: optionState.selected })) : (props.label)))));
57
57
  };
58
58
  OptionElement.displayName = "UxfUiMultiComboboxOption";
59
59
  exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
@@ -109,8 +109,9 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
109
109
  : (_g = props.notFoundMessage) !== null && _g !== void 0 ? _g : "Nic nenalezeno";
110
110
  const withoutPopover = !props.withPopover;
111
111
  const onBlur = (e) => {
112
+ /* TODO: refactor component to enable this */
113
+ // setQuery("");
112
114
  var _a;
113
- setQuery("");
114
115
  (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
115
116
  };
116
117
  return (react_3.default.createElement(react_2.Combobox, { as: "div", by: "id", className: (0, cx_1.cx)(withoutPopover && "uxf-form-component", "uxf-multi-combobox", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), disabled: props.isDisabled || props.isReadOnly, multiple: true, onChange: handleComboboxValueChange, value: selectedOptions }, (renderProps) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/ui",
3
- "version": "10.8.2",
3
+ "version": "10.10.0",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,9 +17,9 @@
17
17
  "dependencies": {
18
18
  "@floating-ui/react": "0.26.0",
19
19
  "@headlessui/react": "1.7.14",
20
- "@uxf/core": "10.4.0",
20
+ "@uxf/core": "10.10.0",
21
21
  "@uxf/datepicker": "10.8.0",
22
- "@uxf/styles": "10.4.0",
22
+ "@uxf/styles": "10.10.0",
23
23
  "color2k": "2.0.2",
24
24
  "dayjs": "1.11.10",
25
25
  "jump.js": "1.0.2",