@uxf/ui 10.10.1 → 11.0.0-beta.17

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.
Files changed (42) hide show
  1. package/_file-input-base/file-input-base.d.ts +0 -1
  2. package/_file-input-base/file-input-base.js +7 -9
  3. package/_select-base/_select-base.d.ts +0 -1
  4. package/_select-base/_select-base.js +5 -14
  5. package/alert-bubble/alert-bubble.d.ts +0 -2
  6. package/alert-bubble/alert-bubble.js +2 -2
  7. package/avatar-file-input/avatar-file-input.d.ts +2 -10
  8. package/avatar-file-input/avatar-file-input.js +11 -27
  9. package/button-list/button-list.d.ts +1 -2
  10. package/calendar/calendar-day-cell.js +2 -3
  11. package/checkbox-input/checkbox-input.d.ts +0 -1
  12. package/checkbox-input/checkbox-input.js +3 -8
  13. package/combobox/combobox.js +1 -2
  14. package/create-component-preview-page/ui-components.d.ts +0 -10
  15. package/create-component-preview-page/ui-components.js +0 -10
  16. package/create-component-preview-page/ui-readmes.js +44 -48
  17. package/css/avatar-file-input.css +67 -97
  18. package/css/calendar.css +6 -1
  19. package/css/checkbox-input.css +1 -9
  20. package/date-picker/date-picker.stories.js +1 -17
  21. package/date-picker-input/date-picker-input.d.ts +3 -5
  22. package/date-picker-input/date-picker-input.js +7 -9
  23. package/date-picker-input/date-picker-input.stories.js +1 -2
  24. package/dropzone/dropzone-input.d.ts +0 -1
  25. package/dropzone/dropzone-input.js +5 -11
  26. package/dropzone/dropzone-list.d.ts +0 -1
  27. package/dropzone/dropzone-list.js +2 -2
  28. package/file-input/file-input.d.ts +2 -2
  29. package/file-input/file-input.js +2 -11
  30. package/message/README.md +1 -25
  31. package/message/message-content.d.ts +0 -2
  32. package/message/message-content.js +1 -1
  33. package/message/message.d.ts +5 -7
  34. package/message/message.js +1 -1
  35. package/multi-combobox/_multi-combobox-base.js +4 -26
  36. package/package.json +4 -4
  37. package/radio-group/radio-group.d.ts +1 -1
  38. package/tabs/tabs.d.ts +0 -1
  39. package/tabs/tabs.js +1 -2
  40. package/image-gallery/README.md +0 -8
  41. package/utils/validator/validator-exceptions.d.ts +0 -3
  42. package/utils/validator/validator-exceptions.js +0 -7
@@ -30,7 +30,6 @@ const classes_1 = require("@uxf/core/constants/classes");
30
30
  const useInputFocus_1 = require("@uxf/core/hooks/useInputFocus");
31
31
  const composeRefs_1 = require("@uxf/core/utils/composeRefs");
32
32
  const cx_1 = require("@uxf/core/utils/cx");
33
- const last_1 = require("@uxf/core/utils/last");
34
33
  const slugify_1 = require("@uxf/core/utils/slugify");
35
34
  const chip_1 = require("@uxf/ui/chip");
36
35
  const use_async_loading_1 = require("@uxf/ui/hooks/use-async-loading");
@@ -40,22 +39,6 @@ const input_1 = require("@uxf/ui/input");
40
39
  const label_1 = require("@uxf/ui/label");
41
40
  const react_3 = __importStar(require("react"));
42
41
  const checkbox_input_1 = require("../checkbox-input");
43
- function handleInputKeyDownRecursion(selectedOptions, onRemove) {
44
- const lastSelectedOption = (0, last_1.last)(selectedOptions);
45
- if (!lastSelectedOption) {
46
- return;
47
- }
48
- if (lastSelectedOption.disabled) {
49
- handleInputKeyDownRecursion(selectedOptions.slice(0, -1), onRemove);
50
- }
51
- else {
52
- onRemove(lastSelectedOption.id);
53
- }
54
- }
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), 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
- };
58
- OptionElement.displayName = "UxfUiMultiComboboxOption";
59
42
  exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
60
43
  var _a, _b, _c, _d, _e, _f, _g;
61
44
  const isAsync = !!props.loadOptions;
@@ -94,7 +77,7 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
94
77
  };
95
78
  const handleInputKeyDown = (e) => {
96
79
  if (e.key === "Backspace" && query === "" && selectedOptions.length > 0) {
97
- handleInputKeyDownRecursion(selectedOptions, onRemove);
80
+ onRemove(selectedOptions[selectedOptions.length - 1].id);
98
81
  }
99
82
  };
100
83
  const handleInputChange = (e) => setQuery(e.target.value);
@@ -108,12 +91,6 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
108
91
  ? (_f = props.allOptionsSelectedMessage) !== null && _f !== void 0 ? _f : "Všechny možnosti jsou již vybrány"
109
92
  : (_g = props.notFoundMessage) !== null && _g !== void 0 ? _g : "Nic nenalezeno";
110
93
  const withoutPopover = !props.withPopover;
111
- const onBlur = (e) => {
112
- /* TODO: refactor component to enable this */
113
- // setQuery("");
114
- var _a;
115
- (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
116
- };
117
94
  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) => {
118
95
  var _a, _b;
119
96
  const inputElement = (react_3.default.createElement(react_3.default.Fragment, null,
@@ -122,14 +99,15 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
122
99
  props.leftElement && react_3.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
123
100
  react_3.default.createElement("div", { className: "uxf-multi-combobox__selected-options" },
124
101
  selectedOptions.map((item) => (react_3.default.createElement(chip_1.Chip, { className: "uxf-multi-combobox__input-chip", color: item.color, key: item.id, onClose: item.disabled ? undefined : handleRemove(item.id), size: "large", suppressFocus: true }, item.label))),
125
- react_3.default.createElement(react_2.Combobox.Input, { autoComplete: "off", className: "uxf-multi-combobox__input", onBlur: onBlur, onChange: handleInputChange, onKeyDown: handleInputKeyDown, placeholder: props.placeholder, type: "text", value: query })),
102
+ react_3.default.createElement(react_2.Combobox.Input, { autoComplete: "off", className: "uxf-multi-combobox__input", onChange: handleInputChange, onKeyDown: handleInputKeyDown, placeholder: props.placeholder, type: "text", value: query })),
126
103
  props.rightAddon && react_3.default.createElement(input_1.Input.RightAddon, null, props.rightAddon),
127
104
  props.rightElement && react_3.default.createElement(input_1.Input.RightElement, null, props.rightElement),
128
105
  react_3.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-select-base__arrow-icon", (props.withPopover ? props.isPopoverOpen : renderProps.open) && classes_1.CLASSES.IS_OPEN), name: iconName })),
129
106
  renderProps.open && (react_3.default.createElement(react_1.FloatingPortal, null,
130
107
  react_3.default.createElement(react_2.Combobox.Options, { className: (0, cx_1.cx)("uxf-dropdown", `uxf-dropdown--size-${(_a = props.size) !== null && _a !== void 0 ? _a : "default"}`, `uxf-dropdown--variant-${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`, dropdown.placement === "bottom" && "uxf-dropdown--bottom", dropdown.placement === "top" && "uxf-dropdown--top"), ref: dropdown.refs.setFloating, static: true, style: dropdown.floatingStyles }, filteredData.length > 0 ? (filteredData.map((option) => {
131
108
  var _a, _b, _c, _d;
132
- return (react_3.default.createElement(OptionElement, { option: option, key: (_b = (_a = props.keyExtractor) === null || _a === void 0 ? void 0 : _a.call(props, option)) !== null && _b !== void 0 ? _b : option.id, label: (_d = (_c = props.renderOption) === null || _c === void 0 ? void 0 : _c.call(props, option)) !== null && _d !== void 0 ? _d : option.label, handleCheckboxChange: handleCheckboxChange(option.id), withCheckboxes: props.withCheckboxes, withoutPopover: withoutPopover }));
109
+ const label = (_b = (_a = props.renderOption) === null || _a === void 0 ? void 0 : _a.call(props, option)) !== null && _b !== void 0 ? _b : option.label;
110
+ return (react_3.default.createElement(react_2.Combobox.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && withoutPopover && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), disabled: option.disabled, key: (_d = (_c = props.keyExtractor) === null || _c === void 0 ? void 0 : _c.call(props, option)) !== null && _d !== void 0 ? _d : option.id, value: 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: label, onChange: handleCheckboxChange(option.id), value: optionState.selected })) : (label)))));
133
111
  })) : (react_3.default.createElement("div", { className: "uxf-dropdown__empty-wrapper" }, emptyMessage))))),
134
112
  props.helperText && withoutPopover && (react_3.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: props.errorId }, props.helperText))));
135
113
  return (react_3.default.createElement(react_3.default.Fragment, null, withoutPopover ? (react_3.default.createElement(react_3.default.Fragment, null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/ui",
3
- "version": "10.10.1",
3
+ "version": "11.0.0-beta.17",
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.10.1",
21
- "@uxf/datepicker": "10.8.0",
22
- "@uxf/styles": "10.10.1",
20
+ "@uxf/core": "10.0.0",
21
+ "@uxf/datepicker": "10.0.0",
22
+ "@uxf/styles": "10.0.0",
23
23
  "color2k": "2.0.2",
24
24
  "dayjs": "1.11.10",
25
25
  "jump.js": "1.0.2",
@@ -6,7 +6,7 @@ export type RadioGroupOptionValueId = string | number;
6
6
  export interface RadioGroupOption {
7
7
  disabled?: boolean;
8
8
  id: RadioGroupOptionValueId;
9
- label: ReactNode;
9
+ label: string;
10
10
  }
11
11
  export interface RadioGroupProps extends FormControlProps<RadioGroupOptionValueId | null> {
12
12
  className?: string;
package/tabs/tabs.d.ts CHANGED
@@ -7,7 +7,6 @@ export interface TabsPanelProps {
7
7
  }
8
8
  export interface TabsProps {
9
9
  className?: string;
10
- customTabListContent?: ReactNode;
11
10
  defaultIndex?: number;
12
11
  grow?: boolean;
13
12
  onChange?: (index: number) => void;
package/tabs/tabs.js CHANGED
@@ -62,8 +62,7 @@ const TabsRoot = (0, react_2.forwardRef)((props, ref) => {
62
62
  react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-tabs__tab-list", `uxf-tabs__tab-list--${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}`), ref: containerRef, style: { justifyContent: hasOverflow ? "flex-start" : undefined, ...dragStyle } }, tabs.map((tab, index) => (react_2.default.createElement(react_1.Tab, { disabled: tab.disabled, className: ({ selected }) => {
63
63
  var _a;
64
64
  return (0, cx_1.cx)("uxf-tabs__tab", selected && classes_1.CLASSES.IS_ACTIVE, tab.disabled && classes_1.CLASSES.IS_DISABLED, `uxf-tabs__tab--${(_a = props.variant) !== null && _a !== void 0 ? _a : "default"}`);
65
- }, key: `${tab.title}--${index}` }, tab.title)))),
66
- props.customTabListContent),
65
+ }, key: `${tab.title}--${index}` }, tab.title))))),
67
66
  react_2.default.createElement(react_1.Tab.Panels, { className: "uxf-tabs__panels" }, tabPanels.map((tab, index) => (react_2.default.createElement(react_1.Tab.Panel, { className: "outline-none", key: `${tab}--${index}` }, tab))))));
68
67
  });
69
68
  TabsRoot.displayName = "UxfUiTabs";
@@ -1,8 +0,0 @@
1
- # Image Gallery
2
-
3
- ## CSS dependencies
4
-
5
- ```css
6
- @import url("@uxf/ui/icon/icon.css");
7
- @import url("@uxf/ui/image-gallery/image-gallery.css");
8
- ```
@@ -1,3 +0,0 @@
1
- export declare enum ValidatorExceptions {
2
- MaxFileSize = "MaxFileSizeException"
3
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidatorExceptions = void 0;
4
- var ValidatorExceptions;
5
- (function (ValidatorExceptions) {
6
- ValidatorExceptions["MaxFileSize"] = "MaxFileSizeException";
7
- })(ValidatorExceptions || (exports.ValidatorExceptions = ValidatorExceptions = {}));