@uxf/ui 10.0.0-beta.4 → 10.0.0-beta.40

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 (66) hide show
  1. package/_file-input-base/file-input-base.js +9 -1
  2. package/_select-base/_select-base.d.ts +1 -1
  3. package/_select-base/_select-base.js +4 -3
  4. package/calendar/calendar-day-cell.js +3 -2
  5. package/chip/chip.d.ts +5 -7
  6. package/chip/chip.js +22 -7
  7. package/chip/chip.spec.d.ts +1 -0
  8. package/chip/chip.spec.js +9 -0
  9. package/chip/chip.stories.d.ts +1 -1
  10. package/chip/chip.stories.js +37 -28
  11. package/chip/index.d.ts +3 -1
  12. package/chip/index.js +3 -15
  13. package/chip/theme.d.ts +3 -0
  14. package/css/calendar.css +56 -48
  15. package/css/chip.css +217 -318
  16. package/css/flash-messages.css +133 -9
  17. package/css/image-gallery.css +13 -9
  18. package/css/textarea.css +66 -74
  19. package/css/time-picker.css +11 -15
  20. package/date-picker/date-picker.d.ts +1 -0
  21. package/date-picker/date-picker.js +1 -0
  22. package/date-picker-input/date-picker-input.js +3 -1
  23. package/datetime-picker/datetime-picker.js +1 -1
  24. package/datetime-picker-input/datetime-picker-input.js +3 -1
  25. package/dropzone/dropzone-input.js +10 -6
  26. package/flash-messages/flash-message.js +1 -1
  27. package/flash-messages/flash-messages.js +44 -10
  28. package/flash-messages/flash-messages.stories.js +12 -0
  29. package/image-gallery/components/close-button.d.ts +2 -1
  30. package/image-gallery/components/close-button.js +2 -3
  31. package/image-gallery/components/gallery.d.ts +6 -3
  32. package/image-gallery/components/gallery.js +15 -7
  33. package/image-gallery/components/next-button.d.ts +7 -0
  34. package/image-gallery/components/next-button.js +14 -0
  35. package/image-gallery/components/prev-button.d.ts +7 -0
  36. package/image-gallery/components/prev-button.js +14 -0
  37. package/image-gallery/image-gallery.d.ts +6 -1
  38. package/image-gallery/image-gallery.js +1 -1
  39. package/image-gallery/image-gallery.stories.js +5 -1
  40. package/multi-combobox/_multi-combobox-base.js +2 -1
  41. package/multi-combobox/types.d.ts +3 -0
  42. package/multi-select/_multi-select-base.js +2 -1
  43. package/multi-select/types.d.ts +3 -2
  44. package/package.json +12 -9
  45. package/radio-group/index.d.ts +1 -1
  46. package/radio-group/radio-group.d.ts +3 -3
  47. package/radio-group/radio-group.js +2 -2
  48. package/radio-group/radio-group.stories.js +4 -4
  49. package/raster-image/raster-image.js +1 -1
  50. package/textarea/textarea.js +5 -5
  51. package/time-picker/time-picker-hour.js +3 -3
  52. package/time-picker/time-picker-hours.js +1 -1
  53. package/time-picker/time-picker-minute.js +3 -3
  54. package/time-picker/time-picker-minutes.js +1 -1
  55. package/time-picker/time-picker.d.ts +1 -0
  56. package/time-picker/time-picker.js +3 -2
  57. package/time-picker-input/time-picker-input.js +3 -1
  58. package/tw-tokens/tw-z-index.d.ts +1 -0
  59. package/tw-tokens/tw-z-index.js +1 -0
  60. package/utils/mocks/uploadFIle.mock.js +1 -1
  61. package/utils/storybook-config.d.ts +1 -1
  62. package/utils/tailwind-config.js +1 -0
  63. package/image-gallery/components/arrow-button.d.ts +0 -7
  64. package/image-gallery/components/arrow-button.js +0 -14
  65. package/select/theme.d.ts +0 -5
  66. package/select/theme.js +0 -2
@@ -26,7 +26,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports._FileInputBase = void 0;
27
27
  const react_1 = __importStar(require("react"));
28
28
  exports._FileInputBase = (0, react_1.forwardRef)((props, ref) => {
29
- const onChange = (e) => props.onChange(null, e);
29
+ const onChange = async (e) => {
30
+ if (e.target.files) {
31
+ const res = await props.onUploadFile(e.target.files[0]);
32
+ props.onChange(res, e);
33
+ }
34
+ else {
35
+ props.onChange(null, e);
36
+ }
37
+ };
30
38
  return (react_1.default.createElement("input", { accept: props.accept, "aria-invalid": props.isInvalid, "aria-describedby": props["aria-describedby"], className: props.className, disabled: props.isDisabled, form: props.form, id: props.id, name: props.name, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, readOnly: props.isReadOnly, ref: ref, required: props.isRequired, tabIndex: props.isDisabled ? -1 : undefined, type: "file" }));
31
39
  });
32
40
  exports._FileInputBase.displayName = "UxfUiFileInputBase";
@@ -3,7 +3,7 @@ import type { Combobox as HUICombobox, Listbox as HUIListbox } from "@headlessui
3
3
  import { IconsSet } from "@uxf/ui/icon/theme";
4
4
  import { Clearable, FormControlProps } from "@uxf/ui/types";
5
5
  import React, { ReactElement, ReactNode, Ref } from "react";
6
- import { InputGroupSizes, InputGroupVariants } from "../input/theme";
6
+ import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
7
7
  export type SelectBaseValueId = number | string;
8
8
  export type SelectBaseValue<ValueId = SelectBaseValueId> = {
9
9
  id: ValueId;
@@ -51,8 +51,9 @@ const InputArrow = (props) => {
51
51
  return react_2.default.createElement(icon_1.Icon, { className: (0, cx_1.cx)("uxf-select-base__arrow-icon", props.open && classes_1.CLASSES.IS_OPEN), name: iconName });
52
52
  };
53
53
  const Options = (props) => {
54
+ var _a, _b;
54
55
  const HUIComponent = props.HUIComponent;
55
- return (react_2.default.createElement(HUIComponent.Options, { className: (0, cx_1.cx)("uxf-dropdown", props.placement === "bottom" && "uxf-dropdown--bottom", props.placement === "top" && "uxf-dropdown--top"), ref: props.forwardRef, static: true, style: props.style }, props.options && props.options.length > 0 ? (props.options.map((option) => {
56
+ return (react_2.default.createElement(HUIComponent.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"}`, props.placement === "bottom" && "uxf-dropdown--bottom", props.placement === "top" && "uxf-dropdown--top"), ref: props.forwardRef, static: true, style: props.style }, props.options && props.options.length > 0 ? (props.options.map((option) => {
56
57
  var _a, _b, _c, _d;
57
58
  const optionKey = (_a = props.keyExtractor) === null || _a === void 0 ? void 0 : _a.call(props, option);
58
59
  return (react_2.default.createElement(HUIComponent.Option, { className: (optionState) => (0, cx_1.cx)("uxf-dropdown__item", optionState.active && classes_1.CLASSES.IS_ACTIVE, optionState.disabled && classes_1.CLASSES.IS_DISABLED, optionState.selected && classes_1.CLASSES.IS_SELECTED), key: optionKey !== null && optionKey !== void 0 ? optionKey : option.id, value: option }, (_d = (_c = (_b = props.renderOption) === null || _b === void 0 ? void 0 : _b.call(props, option)) !== null && _c !== void 0 ? _c : optionKey) !== null && _d !== void 0 ? _d : option.label));
@@ -69,7 +70,7 @@ const _SelectBase = (props) => {
69
70
  const dropdown = (0, use_dropdown_1.useDropdown)((_b = props.dropdownPlacement) !== null && _b !== void 0 ? _b : "bottom", true, props.dropdownStrategy);
70
71
  const stableRef = (0, react_2.useMemo)(() => (0, composeRefs_1.composeRefs)(innerRef, props.forwardRef, dropdown.refs.setReference), [dropdown.refs.setReference, props.forwardRef]);
71
72
  const HUIComponent = props.HUIComponent;
72
- return (react_2.default.createElement(HUIComponent, { as: "div", className: (0, cx_1.cx)("uxf-form-component uxf-select-base", 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, onChange: props.onChange, value: props.value }, (renderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
73
+ return (react_2.default.createElement(HUIComponent, { as: "div", className: (0, cx_1.cx)("uxf-form-component uxf-select-base", 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), "data-testid": id, disabled: props.isDisabled || props.isReadOnly, onChange: props.onChange, value: props.value }, (renderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
73
74
  react_2.default.createElement("div", { className: "uxf-form-component__label" },
74
75
  react_2.default.createElement(HUIComponent.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label)),
75
76
  react_2.default.createElement("div", { className: "uxf-form-component__input" },
@@ -87,7 +88,7 @@ const _SelectBase = (props) => {
87
88
  react_2.default.createElement(InputArrow, { iconName: props.iconName, open: renderProps.open }))) : (react_2.default.createElement(InputArrow, { iconName: props.iconName, open: renderProps.open }))),
88
89
  props.rightAddon && react_2.default.createElement(input_1.Input.RightAddon, null, props.rightAddon)),
89
90
  renderProps.open && (react_2.default.createElement(react_1.FloatingPortal, null,
90
- react_2.default.createElement(Options, { HUIComponent: HUIComponent, emptyMessage: props.emptyMessage, forwardRef: dropdown.refs.setFloating, keyExtractor: props.keyExtractor, options: props.options, placement: dropdown.placement, renderOption: props.renderOption, style: dropdown.floatingStyles }))),
91
+ react_2.default.createElement(Options, { HUIComponent: HUIComponent, emptyMessage: props.emptyMessage, forwardRef: dropdown.refs.setFloating, keyExtractor: props.keyExtractor, options: props.options, placement: dropdown.placement, renderOption: props.renderOption, size: props.size, style: dropdown.floatingStyles, variant: props.variant }))),
91
92
  props.helperText && (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-helper-text", props.isInvalid && classes_1.CLASSES.IS_INVALID), id: errorId }, props.helperText)))))));
92
93
  };
93
94
  exports._SelectBase = _SelectBase;
@@ -34,7 +34,7 @@ const useOnMount_1 = require("@uxf/core/hooks/useOnMount");
34
34
  exports.CalendarDayCell = (0, react_1.memo)((props) => {
35
35
  const dayCellRef = (0, react_1.useRef)(null);
36
36
  const innerRef = (0, react_1.useRef)(null);
37
- const { focusedDate, isDateBlocked, isDateFocused, isDateHovered, isDateSelected, onDateFocus, onDateHover, onDateSelect, } = (0, react_1.useContext)(date_picker_context_1.DatePickerContext);
37
+ const { focusedDate, isDateBlocked, isDateFocused, isDateHovered, isDateSelected, onDateFocus, onDateHover, onDateSelect, preventScroll, } = (0, react_1.useContext)(date_picker_context_1.DatePickerContext);
38
38
  const { disabledDate, isSelected, onClick, onKeyDown, onMouseEnter, tabIndex, isToday } = (0, use_day_1.useDay)({
39
39
  date: props.day.date,
40
40
  focusedDate,
@@ -46,11 +46,12 @@ exports.CalendarDayCell = (0, react_1.memo)((props) => {
46
46
  onDateHover,
47
47
  onDateSelect,
48
48
  dayRef: dayCellRef,
49
+ preventScroll,
49
50
  });
50
51
  (0, useOnMount_1.useOnMount)(() => {
51
52
  const node = innerRef.current;
52
53
  if (node && (isToday || isSelected)) {
53
- node.focus({ preventScroll: true });
54
+ node.focus({ preventScroll });
54
55
  }
55
56
  });
56
57
  if (!props.day.dayLabel) {
package/chip/chip.d.ts CHANGED
@@ -1,13 +1,11 @@
1
- import { ChipColors, ChipSizes, ChipVariants } from "@uxf/ui/chip/theme";
2
- import React, { HTMLAttributes, MouseEventHandler } from "react";
3
- export type ChipColor = keyof ChipColors;
4
- export type ChipSize = keyof ChipSizes;
5
- export type ChipVariant = keyof ChipVariants;
6
- export interface ChipProps extends HTMLAttributes<HTMLDivElement> {
1
+ import { ChipColor, ChipSize, ChipVariant } from "@uxf/ui/chip/theme";
2
+ import React, { AnchorHTMLAttributes, MouseEventHandler } from "react";
3
+ import { UseAnchorProps } from "@uxf/core/hooks/useAnchorProps";
4
+ export interface ChipProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "color" | "type">, UseAnchorProps {
7
5
  color?: ChipColor;
8
6
  onClose?: MouseEventHandler;
9
7
  size?: ChipSize;
10
8
  suppressFocus?: boolean;
11
9
  variant?: ChipVariant;
12
10
  }
13
- export declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement>>;
11
+ export declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLAnchorElement>>;
package/chip/chip.js CHANGED
@@ -26,15 +26,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.Chip = void 0;
27
27
  const cx_1 = require("@uxf/core/utils/cx");
28
28
  const react_1 = __importStar(require("react"));
29
+ const useAnchorProps_1 = require("@uxf/core/hooks/useAnchorProps");
30
+ const CloseButton = (props) => {
31
+ const onClose = (e) => {
32
+ var _a;
33
+ e.preventDefault();
34
+ e.stopPropagation();
35
+ (_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e);
36
+ };
37
+ return (react_1.default.createElement("button", { className: "uxf-chip__button", onClick: onClose, tabIndex: props.suppressFocus ? -1 : undefined, type: "button" },
38
+ react_1.default.createElement("span", { className: "uxf-chip__button-label" }, "Odebrat polo\u017Eku"),
39
+ react_1.default.createElement("svg", { className: "uxf-chip__button-icon", stroke: "currentColor", fill: "none", viewBox: "0 0 8 8" },
40
+ react_1.default.createElement("path", { strokeLinecap: "round", strokeWidth: "1.5", d: "M1 1l6 6m0-6L1 7" }))));
41
+ };
29
42
  exports.Chip = (0, react_1.forwardRef)((props, ref) => {
30
43
  var _a, _b, _c;
31
- const { children, className, onClose, suppressFocus, ...restProps } = props;
44
+ const { children, className, onClose, suppressFocus, tabIndex, ...restProps } = props;
32
45
  const chipClassName = (0, cx_1.cx)("uxf-chip", `uxf-chip--color-${(_a = props.color) !== null && _a !== void 0 ? _a : "default"}`, `uxf-chip--size-${(_b = props.size) !== null && _b !== void 0 ? _b : "default"}`, `uxf-chip--variant-${(_c = props.variant) !== null && _c !== void 0 ? _c : "default"}`, onClose && "has-button", className);
33
- return (react_1.default.createElement("div", { className: chipClassName, ref: ref, ...restProps },
46
+ const anchorProps = (0, useAnchorProps_1.useAnchorProps)({
47
+ className: (0, cx_1.cx)(chipClassName),
48
+ tabIndex: suppressFocus ? -1 : tabIndex,
49
+ ...restProps,
50
+ });
51
+ return (react_1.default.createElement("a", { ref: ref, ...anchorProps },
34
52
  typeof children === "string" ? react_1.default.createElement("span", { className: "uxf-chip__text" }, children) : children,
35
- onClose && (react_1.default.createElement("button", { className: "uxf-chip__button", onClick: onClose, tabIndex: suppressFocus ? -1 : undefined, type: "button" },
36
- react_1.default.createElement("span", { className: "sr-only" }, "Remove option"),
37
- react_1.default.createElement("svg", { stroke: "currentColor", fill: "none", viewBox: "0 0 8 8" },
38
- react_1.default.createElement("path", { strokeLinecap: "round", strokeWidth: "1.5", d: "M1 1l6 6m0-6L1 7" }))))));
53
+ !!onClose && react_1.default.createElement(CloseButton, { onClose: onClose })));
39
54
  });
40
- exports.Chip.displayName = "UxfUiChip";
55
+ exports.Chip.displayName = "UxfChip";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const snap_test_1 = require("../utils/snap-test");
8
+ const chip_stories_1 = require("./chip.stories");
9
+ (0, snap_test_1.snapTest)("render stories", react_1.default.createElement(chip_stories_1.Default, null));
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  declare const _default: {
3
3
  title: string;
4
- component: React.ForwardRefExoticComponent<import("@uxf/ui/chip").ChipProps & React.RefAttributes<HTMLDivElement>>;
4
+ component: React.ForwardRefExoticComponent<import("@uxf/ui/chip").ChipProps & React.RefAttributes<HTMLAnchorElement>>;
5
5
  parameters: {
6
6
  docs: {};
7
7
  };
@@ -1,10 +1,30 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.Default = void 0;
7
- const react_1 = __importDefault(require("react"));
27
+ const react_1 = __importStar(require("react"));
8
28
  const chip_1 = require("@uxf/ui/chip");
9
29
  const storybook_config_1 = require("../utils/storybook-config");
10
30
  exports.default = {
@@ -16,34 +36,23 @@ exports.default = {
16
36
  },
17
37
  },
18
38
  };
19
- const getChipsForSize = (size, colors) => {
20
- const lowChips = colors.map((color) => (react_1.default.createElement("div", { key: color },
21
- react_1.default.createElement(chip_1.Chip, { variant: "low", size: size, color: color, onClose: () => null }, color))));
22
- const mediumChips = colors.map((color) => (react_1.default.createElement("div", { key: color },
23
- react_1.default.createElement(chip_1.Chip, { variant: "medium", size: size, color: color }, color))));
24
- const defaultChips = colors.map((color) => (react_1.default.createElement("div", { key: color },
25
- react_1.default.createElement(chip_1.Chip, { variant: "default", size: size, color: color }, color))));
26
- return (react_1.default.createElement("div", { className: "grid grid-cols-3 gap-4" },
27
- react_1.default.createElement("div", { className: "flex flex-col gap-2" }, lowChips),
28
- react_1.default.createElement("div", { className: "flex flex-col gap-2" }, mediumChips),
29
- react_1.default.createElement("div", { className: "flex flex-col gap-2" }, defaultChips)));
39
+ const getChipsForSize = (colors) => {
40
+ const sizes = ["small", "default", "large"];
41
+ const variants = ["low", "medium", "default"];
42
+ return sizes.map((size) => (react_1.default.createElement(react_1.Fragment, { key: size },
43
+ react_1.default.createElement("div", { className: "uxf-typo-h5" }, size),
44
+ react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" },
45
+ react_1.default.createElement("div", { className: "grid grid-cols-3 gap-4", key: size }, variants.map((variant) => (react_1.default.createElement("div", { className: "flex flex-col gap-2", key: `${size}${variant}` }, colors.map((color) => (react_1.default.createElement("div", { className: "flex flex-col items-start space-y-2", key: `${size}${variant}${color}` },
46
+ react_1.default.createElement(chip_1.Chip, { color: color, size: size, variant: variant }, color),
47
+ react_1.default.createElement(chip_1.Chip, { color: color, size: size, onClose: () => null, variant: variant }, color),
48
+ react_1.default.createElement(chip_1.Chip, { color: color, href: "https://uxf.cz", onClose: () => null, size: size, target: "_blank", variant: variant },
49
+ "#",
50
+ color))))))))))));
30
51
  };
31
52
  function Default() {
32
53
  const config = (0, storybook_config_1.useStorybookConfig)("Chip");
33
54
  return (react_1.default.createElement("div", { className: "flex lg:flex-row" },
34
- react_1.default.createElement("div", { className: "light space-y-4 rounded bg-white p-10" },
35
- react_1.default.createElement("div", { className: "uxf-typo-h5" }, "small"),
36
- react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("small", config.colors)),
37
- react_1.default.createElement("div", { className: "uxf-typo-h5" }, "default"),
38
- react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("default", config.colors)),
39
- react_1.default.createElement("div", { className: "uxf-typo-h5" }, "large"),
40
- react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("large", config.colors))),
41
- react_1.default.createElement("div", { className: "dark space-y-4 rounded bg-gray-900 p-10 text-white" },
42
- react_1.default.createElement("div", { className: "uxf-typo-h5" }, "small"),
43
- react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("small", config.colors)),
44
- react_1.default.createElement("div", { className: "uxf-typo-h5" }, "default"),
45
- react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("default", config.colors)),
46
- react_1.default.createElement("div", { className: "uxf-typo-h5" }, "large"),
47
- react_1.default.createElement("div", { className: "flex flex-col space-y-4 px-5" }, getChipsForSize("large", config.colors)))));
55
+ react_1.default.createElement("div", { className: "light space-y-4 rounded bg-white p-10" }, getChipsForSize(config.colors)),
56
+ react_1.default.createElement("div", { className: "dark space-y-4 rounded bg-gray-900 p-10 text-white" }, getChipsForSize(config.colors))));
48
57
  }
49
58
  exports.Default = Default;
package/chip/index.d.ts CHANGED
@@ -1 +1,3 @@
1
- export * from "./chip";
1
+ export type { ChipColor, ChipSize, ChipVariant } from "./theme";
2
+ export type { ChipProps } from "./chip";
3
+ export { Chip } from "./chip";
package/chip/index.js CHANGED
@@ -1,17 +1,5 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./chip"), exports);
3
+ exports.Chip = void 0;
4
+ var chip_1 = require("./chip");
5
+ Object.defineProperty(exports, "Chip", { enumerable: true, get: function () { return chip_1.Chip; } });
package/chip/theme.d.ts CHANGED
@@ -20,3 +20,6 @@ export interface ChipVariants {
20
20
  medium: true;
21
21
  low: true;
22
22
  }
23
+ export type ChipColor = keyof ChipColors;
24
+ export type ChipSize = keyof ChipSizes;
25
+ export type ChipVariant = keyof ChipVariants;
package/css/calendar.css CHANGED
@@ -1,6 +1,12 @@
1
1
  .uxf-calendar {
2
- &__cell-day {
2
+ &__cell {
3
+ --bg-color: unset;
4
+ --color: unset;
5
+ --compensated-radii: calc(theme("borderRadius.md") - theme("spacing.px"));
6
+
3
7
  align-items: center;
8
+ background-color: var(--bg-color);
9
+ color: var(--color);
4
10
  display: flex;
5
11
  font-size: 14px;
6
12
  font-weight: theme("fontWeight.medium");
@@ -12,29 +18,29 @@
12
18
  text-align: center;
13
19
 
14
20
  :root .light & {
15
- background-color: theme("backgroundColor.white");
16
- color: theme("colors.lightMedium");
21
+ --bg-color: theme("backgroundColor.white");
22
+ --color: theme("colors.lightMedium");
17
23
  }
18
24
 
19
25
  :root .dark & {
20
- background-color: theme("backgroundColor.gray.900");
21
- color: theme("colors.darkMedium");
26
+ --bg-color: theme("backgroundColor.gray.900");
27
+ --color: theme("colors.darkMedium");
22
28
  }
23
29
 
24
30
  &:hover {
25
31
  :root .light & {
26
- background-color: theme("backgroundColor.gray.50");
32
+ --bg-color: theme("backgroundColor.gray.50");
27
33
  }
28
34
 
29
35
  :root .dark & {
30
- background-color: theme("backgroundColor.gray.950");
36
+ --bg-color: theme("backgroundColor.gray.950");
31
37
  }
32
38
  }
33
39
 
34
40
  &:focus-visible {
35
41
  &::before {
36
- border: 2px solid theme("colors.primary.500");
37
42
  border-radius: 2px;
43
+ border: 2px solid theme("colors.primary.500");
38
44
  content: "";
39
45
  inset: 0;
40
46
  position: absolute;
@@ -45,50 +51,33 @@
45
51
  cursor: auto;
46
52
 
47
53
  :root .light & {
48
- background-color: theme("backgroundColor.gray.100");
54
+ --bg-color: theme("backgroundColor.gray.100");
49
55
  }
50
56
 
51
57
  :root .dark & {
52
- background-color: theme("backgroundColor.gray.800");
58
+ --bg-color: theme("backgroundColor.gray.800");
53
59
  }
54
60
  }
55
61
 
56
- --compensated-radii: calc(theme("borderRadius.md") - theme("spacing.px"));
57
-
58
62
  &:first-child {
59
63
  border-top-left-radius: var(--compensated-radii);
60
64
  }
61
65
 
62
- &:nth-child(7) {
63
- border-top-right-radius: var(--compensated-radii);
64
- }
65
-
66
- &:nth-last-child(7) {
67
- border-bottom-left-radius: var(--compensated-radii);
68
- }
69
-
70
66
  &:last-child {
71
67
  border-bottom-right-radius: var(--compensated-radii);
72
68
  }
73
69
 
74
70
  &--selected {
75
- :root .light & {
76
- background-color: theme("backgroundColor.primary.500");
77
- color: theme("colors.white");
78
- }
79
-
71
+ :root .light &,
80
72
  :root .dark & {
81
- background-color: theme("backgroundColor.primary.500");
82
- color: theme("colors.white");
73
+ --bg-color: theme("backgroundColor.primary.500");
74
+ --color: theme("colors.white");
83
75
  }
84
76
 
85
77
  &:hover {
86
- :root .light & {
87
- background-color: theme("backgroundColor.primary.500");
88
- }
89
-
78
+ :root .light &,
90
79
  :root .dark & {
91
- background-color: theme("backgroundColor.primary.500");
80
+ --bg-color: theme("backgroundColor.primary.500");
92
81
  }
93
82
  }
94
83
  }
@@ -104,14 +93,15 @@
104
93
  width: 32px;
105
94
 
106
95
  :root .light & {
107
- background-color: theme("backgroundColor.lightHigh");
108
- color: theme("colors.white");
96
+ --bg-color: theme("backgroundColor.lightHigh");
97
+ --color: theme("colors.white");
109
98
  }
110
99
 
111
100
  :root .dark & {
112
- background-color: theme("backgroundColor.transparent");
101
+ --bg-color: theme("backgroundColor.transparent");
102
+ --color: theme("colors.white");
103
+
113
104
  border: 2px solid theme("colors.darkMedium");
114
- color: theme("colors.white");
115
105
  }
116
106
  }
117
107
 
@@ -126,25 +116,29 @@
126
116
 
127
117
  &--not-current-month {
128
118
  :root .light & {
129
- background-color: theme("backgroundColor.gray.100");
130
- color: theme("colors.lightLow");
119
+ --bg-color: theme("backgroundColor.gray.100");
120
+ --color: theme("colors.lightLow");
131
121
  }
132
122
 
133
123
  :root .dark & {
134
- background-color: theme("backgroundColor.gray.800");
135
- color: theme("colors.darkLow");
124
+ --bg-color: theme("backgroundColor.gray.800");
125
+ --color: theme("colors.darkLow");
136
126
  }
137
127
  }
138
128
  }
139
129
 
140
- &__cell-month,
141
- &__cell-year {
142
- --compensated-radii: calc(theme("borderRadius.md") - theme("spacing.px"));
130
+ &__cell-day {
131
+ &:nth-child(7) {
132
+ border-top-right-radius: var(--compensated-radii);
133
+ }
143
134
 
144
- &:first-child {
145
- border-top-left-radius: var(--compensated-radii);
135
+ &:nth-last-child(7) {
136
+ border-bottom-left-radius: var(--compensated-radii);
146
137
  }
138
+ }
147
139
 
140
+ &__cell-month,
141
+ &__cell-year {
148
142
  &:nth-child(3) {
149
143
  border-top-right-radius: var(--compensated-radii);
150
144
  }
@@ -152,9 +146,16 @@
152
146
  &:nth-last-child(3) {
153
147
  border-bottom-left-radius: var(--compensated-radii);
154
148
  }
149
+ }
155
150
 
156
- &:last-child {
157
- border-bottom-right-radius: var(--compensated-radii);
151
+ &__cell-hour,
152
+ &__cell-minute {
153
+ &:nth-child(6) {
154
+ border-top-right-radius: var(--compensated-radii);
155
+ }
156
+
157
+ &:nth-last-child(6) {
158
+ border-bottom-left-radius: var(--compensated-radii);
158
159
  }
159
160
  }
160
161
 
@@ -188,7 +189,9 @@
188
189
 
189
190
  &__days,
190
191
  &__year,
191
- &__decade {
192
+ &__decade,
193
+ &__hours,
194
+ &__minutes {
192
195
  border-radius: 6px;
193
196
  display: grid;
194
197
  gap: 1px;
@@ -212,4 +215,9 @@
212
215
  &__decade {
213
216
  grid-template-columns: repeat(3, minmax(0, 1fr));
214
217
  }
218
+
219
+ &__hours,
220
+ &__minutes {
221
+ grid-template-columns: repeat(6, minmax(0, 1fr));
222
+ }
215
223
  }