@uxf/ui 11.90.1 → 11.92.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,2 +1,3 @@
1
1
  import { UiContextType } from "../context";
2
+ export declare const tFunction: import("@uxf/core-react/translations/types").TranslationFunction<string>;
2
3
  export declare const getProviderConfig: () => UiContextType;
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProviderConfig = void 0;
6
+ exports.getProviderConfig = exports.tFunction = void 0;
7
+ const create_default_t_1 = require("@uxf/core-react/translations/create-default-t");
8
+ const cs_json_1 = __importDefault(require("@uxf/ui/translations/cs.json"));
4
9
  const color_scheme_1 = require("../color-scheme");
5
10
  const icons_1 = require("../config/icons");
6
11
  const tw_screens_1 = require("../tw-tokens/tw-screens");
12
+ exports.tFunction = (0, create_default_t_1.createDefaultT)(cs_json_1.default);
7
13
  const getProviderConfig = () => ({
8
14
  colorScheme: {
9
15
  ...color_scheme_1.COLOR_SCHEME_DEFAULTS,
@@ -12,8 +18,12 @@ const getProviderConfig = () => ({
12
18
  },
13
19
  domain: "https://localhost:6006",
14
20
  icon: { spriteFilePath: "/icons-generated/_icon-sprite.svg", iconsConfig: icons_1.ICONS },
21
+ localeConfig: {
22
+ locale: "cs",
23
+ },
15
24
  rasterImage: {
16
25
  breakpoints: tw_screens_1.twScreens,
17
26
  },
27
+ translationFn: exports.tFunction,
18
28
  });
19
29
  exports.getProviderConfig = getProviderConfig;
@@ -33,25 +33,22 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  return result;
34
34
  };
35
35
  })();
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
36
  Object.defineProperty(exports, "__esModule", { value: true });
40
37
  exports.Calendar = void 0;
41
38
  const cx_1 = require("@uxf/core/utils/cx");
42
39
  const use_month_1 = require("@uxf/datepicker/hooks/use-month");
43
- const dayjs_1 = __importDefault(require("dayjs"));
40
+ const date_1 = require("@uxf/localize/src/date");
44
41
  const react_1 = __importStar(require("react"));
45
42
  const calendar_day_cell_1 = require("./calendar-day-cell");
46
43
  exports.Calendar = (0, react_1.forwardRef)((props, ref) => {
47
44
  var _a, _b, _c, _d, _e, _f;
48
45
  const calendarClassName = (0, cx_1.cx)("uxf-calendar", props.className);
49
46
  const { days, weekdayLabels } = (0, use_month_1.useMonth)({
50
- dayLabelFormat: (date) => (0, dayjs_1.default)(date).format("D"),
47
+ dayLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("D"),
51
48
  firstDayOfWeek: props.datePickerProps.firstDayOfWeek,
52
49
  month: (_c = (_a = props.month) !== null && _a !== void 0 ? _a : (_b = props.datePickerProps.activeMonths.at(0)) === null || _b === void 0 ? void 0 : _b.month) !== null && _c !== void 0 ? _c : new Date().getMonth(),
53
- monthLabelFormat: (date) => (0, dayjs_1.default)(date).format("MMMM YYYY"),
54
- weekdayLabelFormat: (date) => (0, dayjs_1.default)(date).format("dd"),
50
+ monthLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("MMMM YYYY"),
51
+ weekdayLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("dd"),
55
52
  year: (_f = (_d = props.year) !== null && _d !== void 0 ? _d : (_e = props.datePickerProps.activeMonths.at(0)) === null || _e === void 0 ? void 0 : _e.year) !== null && _f !== void 0 ? _f : new Date().getFullYear(),
56
53
  });
57
54
  return (react_1.default.createElement("div", { className: calendarClassName, ref: ref },
@@ -4,9 +4,9 @@ export interface ColorRadioProps<ValueType = string | number> extends Omit<FormC
4
4
  checked: boolean;
5
5
  className?: string;
6
6
  color: HexColor;
7
- colorLabel: string;
7
+ colorLabel: ReactNode;
8
8
  onChange?: (value: ValueType) => void;
9
- renderContent?: (className: string, checked: boolean | undefined, colorLabel: string, value: ValueType) => ReactNode;
9
+ renderContent?: (className: string, checked: boolean | undefined, colorLabel: ReactNode, value: ValueType) => ReactNode;
10
10
  style?: CSSProperties;
11
11
  }
12
12
  export declare const ColorRadio: React.ForwardRefExoticComponent<ColorRadioProps<string | number> & React.RefAttributes<HTMLDivElement>>;
@@ -3,7 +3,7 @@ import { FormControlProps, HexColor } from "../types";
3
3
  export type ColorRadioGroupOptionValue = HexColor;
4
4
  export interface ColorRadioGroupOption {
5
5
  disabled?: boolean;
6
- label: string;
6
+ label: ReactNode;
7
7
  value: ColorRadioGroupOptionValue;
8
8
  }
9
9
  export interface ColorRadioGroupProps extends FormControlProps<ColorRadioGroupOptionValue | null> {
@@ -11,7 +11,7 @@ export interface ColorRadioGroupProps extends FormControlProps<ColorRadioGroupOp
11
11
  helperText?: ReactNode;
12
12
  hiddenLabel?: boolean;
13
13
  id?: string;
14
- label: string;
14
+ label: ReactNode;
15
15
  options: ColorRadioGroupOption[];
16
16
  style?: CSSProperties;
17
17
  }
@@ -1,8 +1,3 @@
1
- import { ColorScheme } from "../types";
2
- export declare const COLOR_SCHEME_DEFAULTS: {
3
- readonly defaultColorScheme: "light";
4
- readonly getUserSettings: () => ColorScheme | null;
5
- readonly respectSystemSetting: true;
6
- readonly respectUserSettings: true;
7
- readonly setUserSettings: (colorScheme: ColorScheme) => void;
8
- };
1
+ import { type ColorSchemeOptions } from "./use-handle-color-scheme";
2
+ export declare const COLOR_SCHEME_DEFAULTS: Required<ColorSchemeOptions>;
3
+ export declare const COLOR_SCHEME_DEFAULTS_DISABLE_DARK_MODE: Required<ColorSchemeOptions>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COLOR_SCHEME_DEFAULTS = void 0;
3
+ exports.COLOR_SCHEME_DEFAULTS_DISABLE_DARK_MODE = exports.COLOR_SCHEME_DEFAULTS = void 0;
4
4
  exports.COLOR_SCHEME_DEFAULTS = {
5
5
  defaultColorScheme: "light",
6
6
  getUserSettings: () => localStorage.getItem("theme"),
@@ -8,3 +8,10 @@ exports.COLOR_SCHEME_DEFAULTS = {
8
8
  respectUserSettings: true,
9
9
  setUserSettings: (colorScheme) => localStorage.setItem("theme", colorScheme),
10
10
  };
11
+ exports.COLOR_SCHEME_DEFAULTS_DISABLE_DARK_MODE = {
12
+ defaultColorScheme: "light",
13
+ getUserSettings: () => localStorage.getItem("theme"),
14
+ respectSystemSetting: false,
15
+ respectUserSettings: false,
16
+ setUserSettings: (colorScheme) => localStorage.setItem("theme", colorScheme),
17
+ };
@@ -1,17 +1,25 @@
1
+ import { TranslationFunction } from "@uxf/core-react/translations/types";
1
2
  import { ColorSchemeOptions } from "../color-scheme/use-handle-color-scheme";
2
3
  import { IconName } from "../icon/types";
4
+ export type IconOptions = {
5
+ spriteFilePath: string;
6
+ iconsConfig: Record<IconName, {
7
+ w: number;
8
+ h: number;
9
+ }>;
10
+ };
11
+ export type LocaleConfig = {
12
+ locale: string;
13
+ };
14
+ export type RasterImageOptions = {
15
+ breakpoints: Partial<Record<string, string>>;
16
+ };
3
17
  export type UiContextType = {
4
18
  colorScheme: ColorSchemeOptions;
5
19
  domain: string;
6
- icon: {
7
- spriteFilePath: string;
8
- iconsConfig: Record<IconName, {
9
- w: number;
10
- h: number;
11
- }>;
12
- };
13
- rasterImage: {
14
- breakpoints: Partial<Record<string, string>>;
15
- };
20
+ icon: IconOptions;
21
+ localeConfig: LocaleConfig;
22
+ rasterImage: RasterImageOptions;
23
+ translationFn: TranslationFunction<string>;
16
24
  };
17
25
  export declare const UiContext: import("react").Context<UiContextType | undefined>;
@@ -4,17 +4,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.UiContextProvider = void 0;
7
+ const translations_1 = require("@uxf/core-react/translations");
8
+ const context_1 = require("@uxf/localize/src/context/context");
7
9
  const dayjs_1 = require("dayjs");
8
10
  const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
9
11
  const localizedFormat_1 = __importDefault(require("dayjs/plugin/localizedFormat"));
10
12
  const react_1 = __importDefault(require("react"));
11
13
  const use_handle_color_scheme_1 = require("../color-scheme/use-handle-color-scheme");
12
- const context_1 = require("./context");
14
+ const context_2 = require("./context");
13
15
  (0, dayjs_1.extend)(localizedFormat_1.default);
14
16
  (0, dayjs_1.extend)(customParseFormat_1.default);
15
17
  const UiContextProvider = (props) => {
16
18
  (0, use_handle_color_scheme_1.useHandleColorScheme)(props.value.colorScheme);
17
- return react_1.default.createElement(context_1.UiContext.Provider, { value: props.value }, props.children);
19
+ (0, dayjs_1.locale)(props.value.localeConfig.locale);
20
+ return (react_1.default.createElement(translations_1.TranslationsProvider, { value: props.value.translationFn },
21
+ react_1.default.createElement(context_1._LocalizeProvider, { value: props.value.localeConfig.locale },
22
+ react_1.default.createElement(context_2.UiContext.Provider, { value: props.value }, props.children))));
18
23
  };
19
24
  exports.UiContextProvider = UiContextProvider;
20
25
  exports.UiContextProvider.displayName = "UxfUiContextProvider";
@@ -0,0 +1,15 @@
1
+ import { TranslationFunction } from "@uxf/core-react/translations/types";
2
+ import { ColorSchemeOptions } from "../color-scheme/use-handle-color-scheme";
3
+ import { IconOptions, LocaleConfig, RasterImageOptions, UiContextType } from "./context";
4
+ interface Props {
5
+ colorScheme?: {
6
+ isDarkModeDisabled: true;
7
+ } | ColorSchemeOptions;
8
+ domain: string;
9
+ icon: IconOptions;
10
+ localeConfig: LocaleConfig;
11
+ rasterImage: RasterImageOptions;
12
+ translationFn: TranslationFunction<string>;
13
+ }
14
+ export declare function useUiContextMemoizedValue(props: Props): UiContextType;
15
+ export {};
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useUiContextMemoizedValue = useUiContextMemoizedValue;
4
+ const stable_stringify_1 = require("@uxf/core/utils/stable-stringify");
5
+ const react_1 = require("react");
6
+ const color_scheme_1 = require("../color-scheme");
7
+ const color_scheme_defaults_1 = require("../color-scheme/color-scheme-defaults");
8
+ function useUiContextMemoizedValue(props) {
9
+ return (0, react_1.useMemo)(() => {
10
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
11
+ return ({
12
+ colorScheme: props.colorScheme && "isDarkModeDisabled" in props.colorScheme
13
+ ? color_scheme_defaults_1.COLOR_SCHEME_DEFAULTS_DISABLE_DARK_MODE
14
+ : {
15
+ defaultColorScheme: (_b = (_a = props.colorScheme) === null || _a === void 0 ? void 0 : _a.defaultColorScheme) !== null && _b !== void 0 ? _b : color_scheme_1.COLOR_SCHEME_DEFAULTS.defaultColorScheme,
16
+ getUserSettings: (_d = (_c = props.colorScheme) === null || _c === void 0 ? void 0 : _c.getUserSettings) !== null && _d !== void 0 ? _d : color_scheme_1.COLOR_SCHEME_DEFAULTS.getUserSettings,
17
+ respectSystemSetting: (_f = (_e = props.colorScheme) === null || _e === void 0 ? void 0 : _e.respectSystemSetting) !== null && _f !== void 0 ? _f : color_scheme_1.COLOR_SCHEME_DEFAULTS.respectSystemSetting,
18
+ respectUserSettings: (_h = (_g = props.colorScheme) === null || _g === void 0 ? void 0 : _g.respectUserSettings) !== null && _h !== void 0 ? _h : color_scheme_1.COLOR_SCHEME_DEFAULTS.respectUserSettings,
19
+ setUserSettings: (_k = (_j = props.colorScheme) === null || _j === void 0 ? void 0 : _j.setUserSettings) !== null && _k !== void 0 ? _k : color_scheme_1.COLOR_SCHEME_DEFAULTS.setUserSettings,
20
+ },
21
+ domain: props.domain,
22
+ icon: props.icon,
23
+ localeConfig: props.localeConfig,
24
+ rasterImage: props.rasterImage,
25
+ translationFn: props.translationFn,
26
+ });
27
+ },
28
+ // eslint-disable-next-line react-hooks/exhaustive-deps
29
+ [(0, stable_stringify_1.stableStringify)(props)]);
30
+ }
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
35
  Object.defineProperty(exports, "__esModule", { value: true });
39
36
  exports.DatePickerDecade = void 0;
40
37
  const translations_1 = require("@uxf/core-react/translations");
@@ -43,7 +40,7 @@ const cx_1 = require("@uxf/core/utils/cx");
43
40
  const date_picker_context_1 = require("@uxf/datepicker/contexts/date-picker-context");
44
41
  const use_decade_1 = require("@uxf/datepicker/hooks/use-decade");
45
42
  const use_month_1 = require("@uxf/datepicker/hooks/use-month");
46
- const dayjs_1 = __importDefault(require("dayjs"));
43
+ const date_1 = require("@uxf/localize/src/date");
47
44
  const react_1 = __importStar(require("react"));
48
45
  const calendar_1 = require("../calendar");
49
46
  exports.DatePickerDecade = (0, react_1.memo)((props) => {
@@ -56,8 +53,8 @@ exports.DatePickerDecade = (0, react_1.memo)((props) => {
56
53
  const { years } = (0, use_decade_1.useDecade)({
57
54
  year: currentYear,
58
55
  });
59
- const canGoToPrevDecade = canGoToYear((0, dayjs_1.default)(new Date(currentYear, 0)).subtract(5, "years").toDate());
60
- const canGoToNextDecade = canGoToYear((0, dayjs_1.default)(new Date(currentYear, 0)).add(5, "years").toDate());
56
+ const canGoToPrevDecade = canGoToYear((0, date_1.dayjsTz)(new Date(currentYear, 0)).subtract(5, "years").toDate());
57
+ const canGoToNextDecade = canGoToYear((0, date_1.dayjsTz)(new Date(currentYear, 0)).add(5, "years").toDate());
61
58
  const handleGoToPrevDecadeClick = (0, react_1.useCallback)(() => {
62
59
  if (canGoToPrevDecade) {
63
60
  goToPrevYear(9);
@@ -74,10 +71,10 @@ exports.DatePickerDecade = (0, react_1.memo)((props) => {
74
71
  }
75
72
  }, [canGoToYear, onYearSelect]);
76
73
  const { monthLabel } = (0, use_month_1.useMonth)({
77
- dayLabelFormat: (date) => (0, dayjs_1.default)(date).format("D"),
74
+ dayLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("D"),
78
75
  firstDayOfWeek,
79
76
  month: currentMonth,
80
- monthLabelFormat: (date) => (0, dayjs_1.default)(date).format("MMMM"),
77
+ monthLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("MMMM"),
81
78
  year: currentYear,
82
79
  });
83
80
  const handleSetMonthViewMode = (0, react_1.useCallback)(() => props.setViewMode("year"), [props]);
@@ -96,6 +93,7 @@ exports.DatePickerDecade = (0, react_1.memo)((props) => {
96
93
  children: currentYear,
97
94
  isDisabled: true,
98
95
  } }),
99
- react_1.default.createElement("div", { className: "uxf-calendar__decade" }, years.map((year) => (react_1.default.createElement("button", { className: (0, cx_1.cx)("uxf-calendar__cell uxf-calendar__cell-year", !canGoToYear(year.date) && classes_1.CLASSES.IS_DISABLED, (0, dayjs_1.default)(year.date).year() === (0, dayjs_1.default)(selectedDate).year() && "uxf-calendar__cell--selected"), key: year.yearLabel, onClick: handleSelectYear(year.date), type: "button" }, year.yearLabel))))));
96
+ react_1.default.createElement("div", { className: "uxf-calendar__decade" }, years.map((year) => (react_1.default.createElement("button", { className: (0, cx_1.cx)("uxf-calendar__cell uxf-calendar__cell-year", !canGoToYear(year.date) && classes_1.CLASSES.IS_DISABLED, (0, date_1.dayjsTz)(year.date).year() === (0, date_1.dayjsTz)(selectedDate).year() &&
97
+ "uxf-calendar__cell--selected"), key: year.yearLabel, onClick: handleSelectYear(year.date), type: "button" }, year.yearLabel))))));
100
98
  });
101
99
  exports.DatePickerDecade.displayName = "UxfUiDatePickerDecade";
@@ -32,15 +32,12 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
35
  Object.defineProperty(exports, "__esModule", { value: true });
39
36
  exports.DatePickerMonth = void 0;
40
37
  const translations_1 = require("@uxf/core-react/translations");
41
38
  const date_picker_context_1 = require("@uxf/datepicker/contexts/date-picker-context");
42
39
  const use_month_1 = require("@uxf/datepicker/hooks/use-month");
43
- const dayjs_1 = __importDefault(require("dayjs"));
40
+ const date_1 = require("@uxf/localize/src/date");
44
41
  const react_1 = __importStar(require("react"));
45
42
  const calendar_1 = require("../calendar");
46
43
  exports.DatePickerMonth = (0, react_1.memo)((props) => {
@@ -53,11 +50,11 @@ exports.DatePickerMonth = (0, react_1.memo)((props) => {
53
50
  const currentMonth = (_b = (_a = activeMonths.at(0)) === null || _a === void 0 ? void 0 : _a.month) !== null && _b !== void 0 ? _b : new Date().getMonth();
54
51
  const currentYear = (_d = (_c = activeMonths.at(0)) === null || _c === void 0 ? void 0 : _c.year) !== null && _d !== void 0 ? _d : new Date().getFullYear();
55
52
  const { monthLabel } = (0, use_month_1.useMonth)({
56
- dayLabelFormat: (date) => (0, dayjs_1.default)(date).format("D"),
53
+ dayLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("D"),
57
54
  firstDayOfWeek,
58
55
  month: currentMonth,
59
- monthLabelFormat: (date) => (0, dayjs_1.default)(date).format("MMMM"),
60
- weekdayLabelFormat: (date) => (0, dayjs_1.default)(date).format("dd"),
56
+ monthLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("MMMM"),
57
+ weekdayLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("dd"),
61
58
  year: currentYear,
62
59
  });
63
60
  const handleGoToPrevMonth = (0, react_1.useCallback)(() => {
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
35
  Object.defineProperty(exports, "__esModule", { value: true });
39
36
  exports.DatePickerYear = void 0;
40
37
  const translations_1 = require("@uxf/core-react/translations");
@@ -43,7 +40,7 @@ const cx_1 = require("@uxf/core/utils/cx");
43
40
  const date_picker_context_1 = require("@uxf/datepicker/contexts/date-picker-context");
44
41
  const use_month_1 = require("@uxf/datepicker/hooks/use-month");
45
42
  const use_year_1 = require("@uxf/datepicker/hooks/use-year");
46
- const dayjs_1 = __importDefault(require("dayjs"));
43
+ const date_1 = require("@uxf/localize/src/date");
47
44
  const react_1 = __importStar(require("react"));
48
45
  const calendar_1 = require("../calendar");
49
46
  exports.DatePickerYear = (0, react_1.memo)((props) => {
@@ -54,14 +51,14 @@ exports.DatePickerYear = (0, react_1.memo)((props) => {
54
51
  const currentYear = (_d = (_c = activeMonths.at(0)) === null || _c === void 0 ? void 0 : _c.year) !== null && _d !== void 0 ? _d : new Date().getFullYear();
55
52
  const { months, yearLabel } = (0, use_year_1.useYear)({
56
53
  year: currentYear,
57
- yearLabelFormat: (date) => (0, dayjs_1.default)(date).format("YYYY"),
58
- monthLabelFormat: (date) => (0, dayjs_1.default)(date).format("MMMM"),
54
+ yearLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("YYYY"),
55
+ monthLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("MMMM"),
59
56
  });
60
57
  const { monthLabel } = (0, use_month_1.useMonth)({
61
- dayLabelFormat: (date) => (0, dayjs_1.default)(date).format("D"),
58
+ dayLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("D"),
62
59
  firstDayOfWeek,
63
60
  month: currentMonth,
64
- monthLabelFormat: (date) => (0, dayjs_1.default)(date).format("MMMM"),
61
+ monthLabelFormat: (date) => (0, date_1.dayjsTz)(date).format("MMMM"),
65
62
  year: currentYear,
66
63
  });
67
64
  const handleGoToNextYear = (0, react_1.useCallback)(() => {
@@ -99,8 +96,8 @@ exports.DatePickerYear = (0, react_1.memo)((props) => {
99
96
  onClick: handleYearClick,
100
97
  title: (_k = (_j = props.customButtonTitles) === null || _j === void 0 ? void 0 : _j.selectYear) !== null && _k !== void 0 ? _k : t("uxf-ui-date-picker:select-year"),
101
98
  } }),
102
- react_1.default.createElement("div", { className: "uxf-calendar__year" }, months.map((month, index) => (react_1.default.createElement("button", { className: (0, cx_1.cx)("uxf-calendar__cell uxf-calendar__cell-month", !canGoToMonth(month.date) && classes_1.CLASSES.IS_DISABLED, (0, dayjs_1.default)(month.date).month() === (0, dayjs_1.default)(selectedDate).month() &&
103
- (0, dayjs_1.default)(month.date).year() === (0, dayjs_1.default)(selectedDate).year() &&
99
+ react_1.default.createElement("div", { className: "uxf-calendar__year" }, months.map((month, index) => (react_1.default.createElement("button", { className: (0, cx_1.cx)("uxf-calendar__cell uxf-calendar__cell-month", !canGoToMonth(month.date) && classes_1.CLASSES.IS_DISABLED, (0, date_1.dayjsTz)(month.date).month() === (0, date_1.dayjsTz)(selectedDate).month() &&
100
+ (0, date_1.dayjsTz)(month.date).year() === (0, date_1.dayjsTz)(selectedDate).year() &&
104
101
  "uxf-calendar__cell--selected"), key: month.monthLabel + index, onClick: handleMonthClick(month.date), type: "button" }, month.monthLabel))))));
105
102
  });
106
103
  exports.DatePickerYear.displayName = "UxfUiDatePickerYear";
@@ -32,16 +32,13 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
35
  Object.defineProperty(exports, "__esModule", { value: true });
39
36
  exports.Default = Default;
40
- const dayjs_1 = __importDefault(require("dayjs"));
37
+ const date_1 = require("@uxf/localize/src/date");
41
38
  const react_1 = __importStar(require("react"));
42
39
  const action_1 = require("../utils/action");
43
40
  const date_picker_1 = require("./date-picker");
44
- const today = (0, dayjs_1.default)();
41
+ const today = (0, date_1.dayjsTz)();
45
42
  const unavailableDates = [
46
43
  today.toDate(),
47
44
  today.add(5, "days").toDate(),
@@ -6,7 +6,7 @@ export interface DropzoneListProps extends FormControlProps<DropzoneFile[] | und
6
6
  errorText?: string;
7
7
  isDownloadableOnClick?: boolean;
8
8
  onRemoveConfirm?: (file: DropzoneFile) => Promise<boolean>;
9
- renderItem?: (file: DropzoneFile) => ReactNode;
9
+ renderItem?: (file: DropzoneFile, onRemove: (file: DropzoneFile, isUploading: boolean) => void, isUploading: boolean) => ReactNode;
10
10
  style?: CSSProperties;
11
11
  }
12
12
  export declare function DropzoneList(props: DropzoneListProps): React.JSX.Element | null;
@@ -48,23 +48,23 @@ const get_file_icon_1 = require("../utils/files/get-file-icon");
48
48
  function DropzoneList(props) {
49
49
  var _a, _b, _c;
50
50
  const context = (0, react_1.useContext)(context_1.UiContext);
51
- const handleRemove = (file, value, isUploading) => {
52
- var _a;
53
- if (isUploading) {
54
- (_a = file.abortController) === null || _a === void 0 ? void 0 : _a.abort();
55
- }
56
- props.onChange(value.filter((f) => f.id !== file.id));
57
- };
58
51
  const onRemove = (file, isUploading) => () => {
59
52
  if (!props.value) {
60
53
  return;
61
54
  }
55
+ const handleRemove = (value) => {
56
+ var _a;
57
+ if (isUploading) {
58
+ (_a = file.abortController) === null || _a === void 0 ? void 0 : _a.abort();
59
+ }
60
+ props.onChange(value.filter((f) => f.id !== file.id));
61
+ };
62
62
  if (!props.onRemoveConfirm) {
63
- return handleRemove(file, props.value, isUploading);
63
+ return handleRemove(props.value);
64
64
  }
65
65
  props.onRemoveConfirm(file).then((canRemove) => {
66
66
  if (canRemove && props.value) {
67
- return handleRemove(file, props.value, isUploading);
67
+ return handleRemove(props.value);
68
68
  }
69
69
  });
70
70
  };
@@ -74,7 +74,7 @@ function DropzoneList(props) {
74
74
  return (react_1.default.createElement("ul", { className: `uxf-dropzone-list ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, style: props.style }, (_c = props.value) === null || _c === void 0 ? void 0 : _c.map((file) => {
75
75
  var _a, _b, _c;
76
76
  const isUploading = file.id < 0 && !file.error;
77
- return ((_b = (_a = props.renderItem) === null || _a === void 0 ? void 0 : _a.call(props, file)) !== null && _b !== void 0 ? _b : (react_1.default.createElement("li", { className: "uxf-dropzone-list__item-wrapper", key: file.id },
77
+ return ((_b = (_a = props.renderItem) === null || _a === void 0 ? void 0 : _a.call(props, file, onRemove, isUploading)) !== null && _b !== void 0 ? _b : (react_1.default.createElement("li", { className: "uxf-dropzone-list__item-wrapper", key: file.id },
78
78
  react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-dropzone-list__item", Boolean(file.error) && classes_1.CLASSES.IS_INVALID) },
79
79
  react_1.default.createElement("div", { className: "uxf-dropzone-list__item__block" },
80
80
  react_1.default.createElement(icon_1.Icon, { className: "uxf-dropzone-list__item__block__icon", name: (0, get_file_icon_1.getIconNameFromFileExtension)(file.extension.toLowerCase()) }),
@@ -28,7 +28,7 @@ export interface MultiComboboxProps<ValueId = MultiComboboxValueId, Option = Mul
28
28
  id?: string;
29
29
  inputArrow?: (open: boolean) => ReactNode;
30
30
  keyExtractor?: (option: Option) => string | number;
31
- label: string;
31
+ label: ReactNode;
32
32
  leftAddon?: ReactNode;
33
33
  leftElement?: ReactNode;
34
34
  loadOptions?: (query: string) => Promise<Option[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/ui",
3
- "version": "11.90.1",
3
+ "version": "11.92.0",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,10 +23,11 @@
23
23
  "dependencies": {
24
24
  "@floating-ui/react": "0.27.16",
25
25
  "@headlessui/react": "1.7.19",
26
- "@uxf/core": "11.90.0",
27
- "@uxf/core-react": "11.90.1",
28
- "@uxf/datepicker": "11.90.0",
29
- "@uxf/styles": "11.90.0",
26
+ "@uxf/core": "11.91.0",
27
+ "@uxf/core-react": "11.91.0",
28
+ "@uxf/datepicker": "11.92.0",
29
+ "@uxf/localize": "11.90.0",
30
+ "@uxf/styles": "11.91.0",
30
31
  "color2k": "2.0.3",
31
32
  "dayjs": "1.11.19",
32
33
  "react-dropzone": "14.3.8"