@povio/ui 2.2.9-rc.3 → 2.2.9-rc.31

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 (117) hide show
  1. package/dist/components/buttons/Button/Button.d.ts +2 -1
  2. package/dist/components/buttons/Button/Button.js +41 -32
  3. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
  4. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +2 -2
  5. package/dist/components/inputs/Checkbox/Checkbox.js +6 -1
  6. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
  7. package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
  8. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +8 -3
  9. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +80 -6
  10. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +7 -2
  11. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +83 -6
  12. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +8 -2
  13. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +83 -7
  14. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +2 -1
  15. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +64 -4
  16. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
  17. package/dist/components/inputs/DateTime/shared/Calendar.js +23 -6
  18. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
  19. package/dist/components/inputs/DateTime/shared/CalendarCell.js +3 -3
  20. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
  21. package/dist/components/inputs/DateTime/shared/DateField.js +3 -10
  22. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +6 -2
  23. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +65 -55
  24. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +14 -0
  25. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +19 -6
  26. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +4 -2
  27. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +4 -0
  28. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +7 -0
  29. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +13 -0
  30. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +6 -0
  31. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +21 -0
  32. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
  33. package/dist/components/inputs/DateTime/shared/dateSegment.utils.js +9 -0
  34. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
  35. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +35 -0
  36. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +80 -0
  37. package/dist/components/inputs/File/FileUpload.js +1 -0
  38. package/dist/components/inputs/File/shared/InputUploadContent.js +1 -0
  39. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  40. package/dist/components/inputs/FormField/FormFieldHeader.js +3 -1
  41. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +6 -0
  42. package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
  43. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
  44. package/dist/components/inputs/Input/NumberInput/NumberInput.js +76 -7
  45. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
  46. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +146 -0
  47. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
  48. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +232 -0
  49. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
  50. package/dist/components/inputs/Input/TextInput/TextInput.js +79 -7
  51. package/dist/components/inputs/Input/shared/InputContent.js +7 -6
  52. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
  53. package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
  54. package/dist/components/inputs/Inputs/InputItem.d.ts +15 -18
  55. package/dist/components/inputs/Inputs/InputItem.js +2 -0
  56. package/dist/components/inputs/RadioGroup/RadioGroup.js +17 -9
  57. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +3 -0
  58. package/dist/components/inputs/RadioGroup/radio.cva.js +2 -1
  59. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
  60. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +99 -6
  61. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
  62. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +15 -10
  63. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +25 -19
  64. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +3 -4
  65. package/dist/components/inputs/Selection/Select/QuerySelect.js +8 -35
  66. package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
  67. package/dist/components/inputs/Selection/Select/Select.js +112 -4
  68. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +4 -1
  69. package/dist/components/inputs/Selection/shared/SelectBase.js +3 -2
  70. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  71. package/dist/components/inputs/Selection/shared/SelectDesktop.js +8 -4
  72. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  73. package/dist/components/inputs/Selection/shared/SelectInput.js +13 -2
  74. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  75. package/dist/components/inputs/Selection/shared/SelectListBox.js +3 -3
  76. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  77. package/dist/components/inputs/Selection/shared/SelectMobile.js +5 -3
  78. package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
  79. package/dist/components/inputs/Selection/shared/select.context.js +27 -4
  80. package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
  81. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +3 -0
  82. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
  83. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
  84. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -0
  85. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
  86. package/dist/components/inputs/Skeleton/InputFrame.d.ts +68 -0
  87. package/dist/components/inputs/Skeleton/InputFrame.js +178 -0
  88. package/dist/components/inputs/TextEditor/TextEditor.js +1 -0
  89. package/dist/components/inputs/Toggle/Toggle.js +6 -1
  90. package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
  91. package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
  92. package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
  93. package/dist/components/inputs/shared/CheckContent.js +3 -4
  94. package/dist/components/inputs/shared/InputClear.d.ts +2 -1
  95. package/dist/components/inputs/shared/InputClear.js +13 -1
  96. package/dist/components/inputs/shared/StaticInput.d.ts +38 -0
  97. package/dist/components/inputs/shared/TooltipWrapper.js +5 -1
  98. package/dist/components/inputs/shared/input.cva.d.ts +10 -0
  99. package/dist/components/inputs/shared/input.cva.js +19 -1
  100. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +4 -0
  101. package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
  102. package/dist/config/uiConfig.context.d.ts +8 -2
  103. package/dist/config/uiConfig.context.js +12 -1
  104. package/dist/config/uiStyle.context.d.ts +20 -3
  105. package/dist/helpers/dynamicInputs.d.ts +1 -1
  106. package/dist/helpers/dynamicInputs.js +3 -0
  107. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  108. package/dist/hooks/useIntersectionObserver.js +29 -10
  109. package/dist/hooks/useQueryAutocomplete.d.ts +5 -16
  110. package/dist/hooks/useQueryAutocomplete.js +13 -3
  111. package/dist/index.d.ts +7 -0
  112. package/dist/index.js +4 -2
  113. package/dist/utils/date-time.utils.d.ts +30 -9
  114. package/dist/utils/date-time.utils.js +113 -1
  115. package/dist/utils/query.utils.d.ts +4 -0
  116. package/dist/utils/query.utils.js +8 -0
  117. package/package.json +1 -1
@@ -0,0 +1,178 @@
1
+ import { UIStyle } from "../../../config/uiStyle.context.js";
2
+ import { typography } from "../../text/Typography/typography.cva.js";
3
+ import { Loader } from "../../status/Loader/Loader.js";
4
+ import { UIConfig } from "../../../config/uiConfig.context.js";
5
+ import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
6
+ import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
7
+ import { InputClear } from "../shared/InputClear.js";
8
+ import { inputBase, inputContentWrapper, inputSize } from "../shared/input.cva.js";
9
+ import { FormField } from "../FormField/FormField.js";
10
+ import { TooltipWrapper } from "../shared/TooltipWrapper.js";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ import { clsx } from "clsx";
13
+ import { isValidElement } from "react";
14
+ //#region src/components/inputs/Skeleton/InputFrame.tsx
15
+ var InputFrame = (props) => {
16
+ const ui = UIConfig.useConfig();
17
+ const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
18
+ const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
19
+ const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
20
+ const typographyCva = UIStyle.useCva("typography.cva", typography);
21
+ const { ref, children, formFieldRef, labelProps, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, inputClassName, contentClassName, contentWrapperClassName, labelPlacement = "content-wrapper", trailingClassName, variant: variantProp, as: asProp, size: sizeProp } = props;
22
+ const as = asProp ?? ui.input.as;
23
+ const size = sizeProp ?? ui.input.size;
24
+ const variant = variantProp ?? ui.input.variant;
25
+ const hideLabel = hideLabelProp ?? ui.input.hideLabel;
26
+ const hasClear = !!(isClearableProp ?? ui.input.isClearable);
27
+ const isLeadingIconElement = leadingIcon && isValidElement(leadingIcon);
28
+ const isTrailingIconElement = trailingIcon && isValidElement(trailingIcon);
29
+ const hasTrailingContent = hasClear || !!trailingContent || !!unit || !!isLoading || !!action || !!trailingIcon || !!trailingAction;
30
+ const isTrailingInteractive = !!action || !!trailingAction || !!isTrailingIconElement || hasClear && !!showClear || !!trailingContent;
31
+ const dataAttributeProps = getInputFrameDataAttributeProps(dataAttributes);
32
+ const formFieldProps = {
33
+ error,
34
+ label: label ?? "",
35
+ tooltipText,
36
+ helperText,
37
+ isRequired,
38
+ rightContent,
39
+ isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
40
+ hideLabel,
41
+ isDisabled,
42
+ headerClassName,
43
+ errorClassName,
44
+ className
45
+ };
46
+ const resolvedHeaderProps = headerProps ?? {
47
+ label: label ?? "",
48
+ tooltipText,
49
+ helperText,
50
+ isRequired,
51
+ rightContent,
52
+ isHeaderHidden: hideLabel || isHeaderHidden,
53
+ isDisabled,
54
+ className: headerClassName,
55
+ labelProps
56
+ };
57
+ const labelContent = as && ["filter", "floating"].includes(as) ? /* @__PURE__ */ jsx(FormFieldLabel, {
58
+ as,
59
+ size,
60
+ ...resolvedHeaderProps
61
+ }) : null;
62
+ const resolvedContentWrapperClassName = contentWrapperClassName ?? inputContentWrapperCva({ as });
63
+ return /* @__PURE__ */ jsx(TooltipWrapper, {
64
+ as,
65
+ error,
66
+ triggerTabIndex: as === "inline" ? -1 : void 0,
67
+ children: /* @__PURE__ */ jsx(FormField, {
68
+ ...formFieldProps,
69
+ ...dataAttributeProps,
70
+ ref: formFieldRef,
71
+ as,
72
+ labelProps,
73
+ tabIndex: as === "inline" ? -1 : void 0,
74
+ onMouseEnter: () => {
75
+ if (renderStatic) onStaticInteract?.(false);
76
+ },
77
+ onFocusCapture: () => {
78
+ if (renderStatic) onStaticInteract?.(true);
79
+ },
80
+ children: /* @__PURE__ */ jsxs("div", {
81
+ ref,
82
+ ...dataAttributeProps,
83
+ className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
84
+ variant,
85
+ as
86
+ }), inputClassName),
87
+ tabIndex: renderStatic ? isDisabled ? -1 : 0 : void 0,
88
+ onFocus: () => {
89
+ if (renderStatic) onStaticInteract?.(true);
90
+ },
91
+ onClick: () => {
92
+ if (renderStatic) onStaticInteract?.(true);
93
+ },
94
+ onPointerDown: () => {
95
+ if (renderStatic) onStaticInteract?.(true);
96
+ },
97
+ "data-rac": "",
98
+ children: [/* @__PURE__ */ jsxs("div", {
99
+ className: clsx("group/input-frame flex min-w-0 w-full items-center gap-input-gap-input-text-to-elements pr-0!", as === "inline" && "h-full", inputSizeCva({
100
+ size,
101
+ as
102
+ }), typographySize && typographyCva({ size: typographySize }), contentClassName),
103
+ children: [
104
+ leadingContent,
105
+ leadingIcon && /* @__PURE__ */ jsx("div", {
106
+ className: clsx(!isLeadingIconElement && "pointer-events-none"),
107
+ children: renderIconVisual(leadingIcon)
108
+ }),
109
+ labelPlacement === "content-row" && labelContent,
110
+ /* @__PURE__ */ jsxs("div", {
111
+ className: resolvedContentWrapperClassName,
112
+ children: [
113
+ labelPlacement === "content-wrapper" && labelContent,
114
+ actionContent,
115
+ typeof children === "function" ? children(dataAttributeProps) : children
116
+ ]
117
+ })
118
+ ]
119
+ }), hasTrailingContent && /* @__PURE__ */ jsxs("div", {
120
+ className: clsx("flex items-center gap-input-gap-trailing-elements py-0! pl-0!", inputSizeCva({
121
+ size,
122
+ as
123
+ }), !isTrailingInteractive && "pointer-events-none", trailingClassName),
124
+ children: [
125
+ hasClear && /* @__PURE__ */ jsx(InputClear, {
126
+ onClear: () => onClear?.(),
127
+ className: clearClassName,
128
+ show: !!showClear,
129
+ renderStatic
130
+ }),
131
+ trailingContent,
132
+ unit && /* @__PURE__ */ jsx("span", {
133
+ className: typographyCva({
134
+ size: "label-2",
135
+ sizeMobile: "label-2",
136
+ variant: "prominent-1",
137
+ className: "text-text-default-3"
138
+ }),
139
+ children: unit
140
+ }),
141
+ isLoading && /* @__PURE__ */ jsx("div", {
142
+ className: "inline-flex",
143
+ children: /* @__PURE__ */ jsx(Loader, {})
144
+ }),
145
+ !isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
146
+ color: "secondary",
147
+ icon: action.icon,
148
+ isDisabled,
149
+ onPress: action.onClick,
150
+ excludeFromTabOrder: true,
151
+ label: action.altText,
152
+ className: clsx("border-0!", action.className)
153
+ }),
154
+ !isLoading && !action && trailingIcon && renderIconVisual(trailingIcon),
155
+ trailingAction
156
+ ]
157
+ })]
158
+ })
159
+ })
160
+ });
161
+ };
162
+ var renderIconVisual = (icon) => {
163
+ if (isValidElement(icon)) return icon;
164
+ return /* @__PURE__ */ jsx(icon, { className: "size-6 text-interactive-text-secondary-idle" });
165
+ };
166
+ var getInputFrameDataAttributeProps = (dataAttributes) => ({
167
+ "data-is-empty": dataAttributes?.dataIsEmpty || void 0,
168
+ "data-is-filled": dataAttributes?.dataIsFilled || void 0,
169
+ "data-is-dirty": dataAttributes?.dataIsDirty || void 0,
170
+ "data-is-required": dataAttributes?.dataIsRequired || void 0,
171
+ "data-is-disabled": dataAttributes?.dataIsDisabled || void 0,
172
+ "data-disabled": dataAttributes?.dataDisabled || void 0,
173
+ "data-has-search": dataAttributes?.dataHasSearch || void 0,
174
+ "data-invalid": dataAttributes?.dataInvalid || void 0,
175
+ "data-has-selection": dataAttributes?.dataHasSelection || void 0
176
+ });
177
+ //#endregion
178
+ export { InputFrame };
@@ -106,6 +106,7 @@ var TextEditorBase = ({ ref, as = "default", placeholder, label, hideLabel, tool
106
106
  "data-rac": "",
107
107
  "data-hovered": isHovered || void 0,
108
108
  "data-disabled": isDisabled || void 0,
109
+ "data-is-disabled": isDisabled || void 0,
109
110
  "data-focus-within": isFocused || void 0,
110
111
  "data-focus-visible": isFocused && isFocusVisible || void 0,
111
112
  "data-is-filled": !editor?.isEmpty,
@@ -2,7 +2,7 @@ import { UIStyle } from "../../../config/uiStyle.context.js";
2
2
  import { UIConfig } from "../../../config/uiConfig.context.js";
3
3
  import { FormFieldError } from "../FormField/FormFieldError.js";
4
4
  import { CheckContent } from "../shared/CheckContent.js";
5
- import { toggle, toggleTypography } from "./toggle.cva.js";
5
+ import { toggle, toggleContentClassName, toggleTypography } from "./toggle.cva.js";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { clsx } from "clsx";
8
8
  import { Switch } from "react-aria-components";
@@ -13,6 +13,7 @@ var ToggleBase = (props) => {
13
13
  const ui = UIConfig.useConfig();
14
14
  const toggleCva = UIStyle.useCva("toggle.cva", toggle);
15
15
  const toggleTypographyMap = UIStyle.useMapper("toggle.typography", toggleTypography);
16
+ const toggleContentClassNameMap = UIStyle.useMapper("toggle.contentClassName", toggleContentClassName);
16
17
  const { className, children, isDisabled, error, variant = ui.toggle.variant, ...rest } = props;
17
18
  const formFieldErrorProps = {
18
19
  error,
@@ -32,6 +33,10 @@ var ToggleBase = (props) => {
32
33
  variant,
33
34
  ...rest
34
35
  }),
36
+ contentClassName: toggleContentClassNameMap({
37
+ variant,
38
+ ...rest
39
+ }),
35
40
  children
36
41
  })]
37
42
  }), /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps })] });
@@ -8,3 +8,6 @@ export interface ToggleVariantProps extends VariantProps<typeof toggle> {
8
8
  export declare const toggleTypography: (props: {
9
9
  variant?: "default" | null | undefined;
10
10
  }) => TypographyVariantProps | undefined;
11
+ export declare const toggleContentClassName: (props: {
12
+ variant?: "default" | null | undefined;
13
+ }) => string | undefined;
@@ -26,5 +26,6 @@ var toggleTypography = compoundMapper({ default: {
26
26
  sizeMobile: "label-1",
27
27
  variant: "default"
28
28
  } });
29
+ var toggleContentClassName = compoundMapper({ default: "text-text-default-2" });
29
30
  //#endregion
30
- export { toggle, toggleTypography };
31
+ export { toggle, toggleContentClassName, toggleTypography };
@@ -3,6 +3,7 @@ import { TypographyVariantProps } from '../../text/Typography/typography.cva';
3
3
  interface CheckContentProps {
4
4
  typography?: TypographyVariantProps;
5
5
  className?: string;
6
+ contentClassName?: string;
6
7
  }
7
- export declare const CheckContent: ({ children, className, ...props }: PropsWithChildren<CheckContentProps>) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const CheckContent: ({ children, className, contentClassName, ...props }: PropsWithChildren<CheckContentProps>) => import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -3,15 +3,14 @@ import { typography } from "../../text/Typography/typography.cva.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import clsx$1 from "clsx";
5
5
  //#region src/components/inputs/shared/CheckContent.tsx
6
- var CheckContent = ({ children, className, ...props }) => {
6
+ var CheckContent = ({ children, className, contentClassName, ...props }) => {
7
7
  return /* @__PURE__ */ jsx("div", {
8
8
  className: clsx$1(UIStyle.useCva("typography.cva", typography)({
9
9
  size: "label-1",
10
10
  sizeMobile: "label-1",
11
11
  variant: "default",
12
- ...props.typography,
13
- className: "text-text-default-2"
14
- }), className),
12
+ ...props.typography
13
+ }), contentClassName, className),
15
14
  children
16
15
  });
17
16
  };
@@ -2,8 +2,9 @@ import { CSSProperties } from 'react';
2
2
  interface InputClearProps {
3
3
  onClear: () => void;
4
4
  show?: boolean;
5
+ renderStatic?: boolean;
5
6
  className?: string;
6
7
  style?: CSSProperties;
7
8
  }
8
- export declare const InputClear: ({ onClear, className, style, show }: InputClearProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const InputClear: ({ onClear, className, style, show, renderStatic }: InputClearProps) => import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -5,7 +5,19 @@ import { jsx } from "react/jsx-runtime";
5
5
  import { clsx } from "clsx";
6
6
  import { useTranslation } from "react-i18next";
7
7
  //#region src/components/inputs/shared/InputClear.tsx
8
- var InputClear = ({ onClear, className, style, show }) => {
8
+ var InputClear = ({ onClear, className, style, show, renderStatic }) => {
9
+ if (renderStatic) return /* @__PURE__ */ jsx("button", {
10
+ className: clsx("invisible relative z-1 flex items-center size-6 shrink-0", "group-focus-within:visible group-hover/date-picker-content:visible group-hover/select-content:visible group-hover/text-area:visible group-hover:visible", "border-0!", !show && "invisible!", className),
11
+ style
12
+ });
13
+ return /* @__PURE__ */ jsx(InputClearButton, {
14
+ onClear,
15
+ className,
16
+ style,
17
+ show
18
+ });
19
+ };
20
+ var InputClearButton = ({ onClear, className, style, show }) => {
9
21
  const { t } = useTranslation("ui");
10
22
  return /* @__PURE__ */ jsx(InlineIconButton, {
11
23
  color: "secondary",
@@ -0,0 +1,38 @@
1
+ import { ReactNode } from 'react';
2
+ import { FormFieldProps } from '../FormField/FormField';
3
+ import { TextInputProps } from '../Input/TextInput/TextInput';
4
+ import { InputSizeProps, InputVariantProps } from './input.cva';
5
+ import { TypographyVariantProps } from '../../text/Typography/typography.cva';
6
+ type StaticInputDataAttributes = {
7
+ dataDisabled?: boolean;
8
+ dataHasSearch?: boolean;
9
+ dataHasSelection?: boolean;
10
+ dataInvalid?: boolean;
11
+ dataIsDirty?: boolean;
12
+ dataIsDisabled?: boolean;
13
+ dataIsEmpty?: boolean;
14
+ dataIsFilled?: boolean;
15
+ dataIsRequired?: boolean;
16
+ };
17
+ interface StaticInputProps extends FormFieldProps {
18
+ onInteract: (shouldFocus: boolean) => void;
19
+ as?: TextInputProps["as"];
20
+ typographySize?: TypographyVariantProps["size"];
21
+ size?: InputSizeProps["size"];
22
+ variant?: InputVariantProps["variant"];
23
+ applyMinInputWidth?: boolean;
24
+ placeholder?: ReactNode;
25
+ showPlacholderIfFilled?: boolean;
26
+ displayValue?: ReactNode;
27
+ isEmpty?: boolean;
28
+ leadingVisual?: ReactNode;
29
+ leadingContent?: ReactNode;
30
+ leadingContentClassName?: string;
31
+ hasClearIcon?: boolean;
32
+ trailingContent?: ReactNode;
33
+ contentRowClassName?: string;
34
+ inputClassName?: string;
35
+ dataAttributes?: StaticInputDataAttributes;
36
+ }
37
+ export declare const StaticInput: ({ onInteract, as, typographySize, size, variant, applyMinInputWidth, placeholder, showPlacholderIfFilled, displayValue, isEmpty, leadingVisual, leadingContent, leadingContentClassName, hasClearIcon, trailingContent, contentRowClassName, inputClassName, dataAttributes, className, ...formFieldProps }: StaticInputProps) => import("react/jsx-runtime").JSX.Element;
38
+ export {};
@@ -1,7 +1,10 @@
1
+ import { UIStyle } from "../../../config/uiStyle.context.js";
1
2
  import { Tooltip } from "../../overlays/Tooltip/Tooltip.js";
3
+ import { tooltipWrapperTrigger } from "./tooltipWrapper.cva.js";
2
4
  import { jsx } from "react/jsx-runtime";
3
5
  //#region src/components/inputs/shared/TooltipWrapper.tsx
4
6
  var TooltipWrapper = (props) => {
7
+ const tooltipWrapperTriggerCva = UIStyle.useCva("tooltipWrapper.triggerCva", tooltipWrapperTrigger);
5
8
  if (props.as !== "inline") return props.children;
6
9
  return /* @__PURE__ */ jsx(Tooltip, {
7
10
  text: props.error || void 0,
@@ -9,10 +12,11 @@ var TooltipWrapper = (props) => {
9
12
  color: "error",
10
13
  hidden: !props.error,
11
14
  isNonInteractiveTrigger: true,
12
- triggerClassName: props.triggerClassName,
15
+ triggerClassName: tooltipWrapperTriggerCva({ className: props.triggerClassName }),
13
16
  triggerTabIndex: props.triggerTabIndex,
14
17
  children: /* @__PURE__ */ jsx("div", {
15
18
  tabIndex: -1,
19
+ className: tooltipWrapperTriggerCva({}),
16
20
  children: props.children
17
21
  })
18
22
  });
@@ -12,6 +12,16 @@ export declare const inputSize: (props?: ({
12
12
  } & ClassProp) | undefined) => string;
13
13
  export interface InputSizeProps extends VariantProps<typeof inputSize> {
14
14
  }
15
+ export declare const inputContentWrapper: (props?: ({
16
+ as?: "filter" | "default" | "floating" | "inline" | null | undefined;
17
+ } & ClassProp) | undefined) => string;
18
+ export interface InputContentWrapperProps extends VariantProps<typeof inputContentWrapper> {
19
+ }
20
+ export declare const inputClearClass: (props?: ({
21
+ as?: "filter" | "default" | "floating" | "inline" | null | undefined;
22
+ } & ClassProp) | undefined) => string;
23
+ export interface InputClearClassProps extends VariantProps<typeof inputClearClass> {
24
+ }
15
25
  export declare const inputSide: (props?: ({
16
26
  size?: "small" | "default" | "extra-small" | "large" | null | undefined;
17
27
  type?: "left" | "right" | "var" | null | undefined;
@@ -191,6 +191,24 @@ var inputSize = cva("", {
191
191
  as: "default"
192
192
  }
193
193
  });
194
+ var inputContentWrapper = cva("flex w-full", {
195
+ variants: { as: {
196
+ default: "",
197
+ floating: "flex-col",
198
+ filter: "gap-input-gap-input-text-to-elements",
199
+ inline: ""
200
+ } },
201
+ defaultVariants: { as: "default" }
202
+ });
203
+ var inputClearClass = cva("", {
204
+ variants: { as: {
205
+ default: "",
206
+ floating: "",
207
+ filter: "",
208
+ inline: ""
209
+ } },
210
+ defaultVariants: { as: "default" }
211
+ });
194
212
  var inputSide = cva("", {
195
213
  variants: {
196
214
  size: {
@@ -277,4 +295,4 @@ var useInputCva = () => {
277
295
  };
278
296
  };
279
297
  //#endregion
280
- export { inputBase, inputSide, inputSize, useInputCva };
298
+ export { inputBase, inputClearClass, inputContentWrapper, inputSide, inputSize, useInputCva };
@@ -0,0 +1,4 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export declare const tooltipWrapperTrigger: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
3
+ export interface TooltipWrapperTriggerVariantProps extends VariantProps<typeof tooltipWrapperTrigger> {
4
+ }
@@ -0,0 +1,5 @@
1
+ import { cva } from "class-variance-authority";
2
+ //#region src/components/inputs/shared/tooltipWrapper.cva.ts
3
+ var tooltipWrapperTrigger = cva("inline-flex");
4
+ //#endregion
5
+ export { tooltipWrapperTrigger };
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { PropsWithChildren, ReactElement } from 'react';
2
2
  import { ButtonProps } from '../components/buttons/Button/Button';
3
3
  import { CheckboxProps } from '../components/inputs/Checkbox/Checkbox';
4
4
  import { DatePickerProps } from '../components/inputs/DateTime/DatePicker/DatePicker';
@@ -19,6 +19,7 @@ export declare namespace UIConfig {
19
19
  [P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : Exclude<T[P], null | undefined>;
20
20
  };
21
21
  export interface Options {
22
+ renderStaticInput: boolean;
22
23
  input: Pick<TextInputProps, "variant" | "isClearable" | "hideLabel" | "as" | "size">;
23
24
  button: Pick<ButtonProps, "variant" | "size">;
24
25
  numberInput: Pick<NumberInputProps, "formatOptions">;
@@ -33,7 +34,12 @@ export declare namespace UIConfig {
33
34
  };
34
35
  toggle: Pick<ToggleProps, "variant">;
35
36
  slider: Pick<SliderProps, "minValue" | "maxValue">;
36
- dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros" | "disableManualEntry">;
37
+ dateInput: Pick<DatePickerProps, "todayIcon" | "todayIconButtonSize" | "todayIconPlacement" | "shouldForceLeadingZeros" | "disableManualEntry" | "autoFixYear"> & {
38
+ calendarIcon?: ReactElement;
39
+ dateTimeIcon?: ReactElement;
40
+ timeIcon?: ReactElement;
41
+ setDateValueOnDateSelection?: boolean;
42
+ };
37
43
  actionModal: Pick<ActionModalProps, "titleTypography" | "descriptionTypography">;
38
44
  bottomSheet: Pick<BottomSheetProps, "closeDragThreshold" | "closeVelocityThreshold" | "hideThumb" | "headerTypography">;
39
45
  tableHeaderText: Pick<HeaderTextProps, "variant" | "size">;
@@ -1,3 +1,6 @@
1
+ import { CalendarIcon } from "../assets/icons/Calendar.js";
2
+ import { ClockIcon } from "../assets/icons/Clock.js";
3
+ import { DateTimeIcon } from "../assets/icons/DateTime.js";
1
4
  import { ObjectUtils } from "../utils/object.utils.js";
2
5
  import { useDeepCompareMemo } from "../hooks/useDeepCompare.js";
3
6
  import { jsx } from "react/jsx-runtime";
@@ -6,6 +9,7 @@ import { createContext, use } from "react";
6
9
  var UIConfig;
7
10
  (function(_UIConfig) {
8
11
  const DEFAULT_CONFIG = {
12
+ renderStaticInput: true,
9
13
  input: {
10
14
  variant: "outlined",
11
15
  as: "default",
@@ -43,8 +47,15 @@ var UIConfig;
43
47
  },
44
48
  dateInput: {
45
49
  todayIcon: false,
50
+ todayIconButtonSize: "none",
51
+ todayIconPlacement: "content",
46
52
  shouldForceLeadingZeros: false,
47
- disableManualEntry: false
53
+ disableManualEntry: false,
54
+ autoFixYear: false,
55
+ calendarIcon: /* @__PURE__ */ jsx(CalendarIcon, { className: "size-5" }),
56
+ dateTimeIcon: /* @__PURE__ */ jsx(DateTimeIcon, { className: "size-5" }),
57
+ timeIcon: /* @__PURE__ */ jsx(ClockIcon, { className: "size-6 text-interactive-text-secondary-idle" }),
58
+ setDateValueOnDateSelection: false
48
59
  },
49
60
  actionModal: {
50
61
  titleTypography: {
@@ -4,11 +4,16 @@ import { BreadcrumbChevronVariantProps, BreadcrumbIconVariantProps, BreadcrumbIt
4
4
  import { ButtonVariantProps } from '../components/buttons/Button/button.cva';
5
5
  import { PillButtonVariants } from '../components/buttons/PillButton/pillButton.cva';
6
6
  import { CheckboxIconVariantProps, CheckboxVariantProps } from '../components/inputs/Checkbox/checkbox.cva';
7
+ import { DatePickerInputContentRowProps } from '../components/inputs/DateTime/shared/datePickerInput.cva';
7
8
  import { FormFieldErrorVariantProps } from '../components/inputs/FormField/formFieldError.cva';
9
+ import { FormFieldHeaderVariantProps } from '../components/inputs/FormField/formFieldHeader.cva';
8
10
  import { FormFieldHelperVariantProps } from '../components/inputs/FormField/formFieldHelper.cva';
9
11
  import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
10
- import { InputBaseProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
12
+ import { SelectPopoverCva } from '../components/inputs/Selection/shared/selectDesktop.cva';
13
+ import { SelectListBoxItemCva } from '../components/inputs/Selection/shared/selectItem.cva';
14
+ import { InputBaseProps, InputClearClassProps, InputContentWrapperProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
11
15
  import { LabelBaseProps } from '../components/inputs/shared/label.cva';
16
+ import { TooltipWrapperTriggerVariantProps } from '../components/inputs/shared/tooltipWrapper.cva';
12
17
  import { ToggleVariantProps } from '../components/inputs/Toggle/toggle.cva';
13
18
  import { MenuCvaVariantProps, MenuItemVariantProps, MenuPopoverVariantProps, MenuPopoverWrapperVariantProps } from '../components/Menu/menu.cva';
14
19
  import { AccordionChevronVariantProps, AccordionHeadingSubtitleVariantProps, AccordionHeadingTitleVariantProps, AccordionHeadingVariantProps, AccordionIconVariantProps, AccordionItemVariantProps, AccordionPanelContentVariantProps, AccordionPanelVariantProps, AccordionTriggerVariantProps, AccordionVariantProps } from '../components/navigation/Accordion/accordion.cva';
@@ -24,13 +29,12 @@ import { LinkVariantProps } from '../components/text/Link/link.cva';
24
29
  import { TagVariantProps } from '../components/text/Tag/tag.cva';
25
30
  import { TypographyVariantProps } from '../components/text/Typography/typography.cva';
26
31
  import { CompoundMapper, ConfigSchema } from '../utils/compoundMapper';
27
- import { SelectListBoxItemCva } from '../components/inputs/Selection/shared/selectItem.cva';
28
32
  export declare namespace UIStyle {
29
33
  export type Cva<T> = (props: (T & ClassProp) | ClassProp) => string;
30
34
  type OptionKey = {
31
35
  [K in keyof Options]: Options[K] extends object ? `${K & string}.${keyof Options[K] & string}` : never;
32
36
  }[keyof Options];
33
- interface Options {
37
+ export interface Options {
34
38
  button: {
35
39
  cva?: Cva<ButtonVariantProps>;
36
40
  sizeCva?: Cva<ButtonVariantProps>;
@@ -46,10 +50,12 @@ export declare namespace UIStyle {
46
50
  cva?: Cva<CheckboxVariantProps>;
47
51
  iconCva?: Cva<CheckboxIconVariantProps>;
48
52
  typography?: CompoundMapper<TypographyVariantProps, CheckboxVariantProps>;
53
+ contentClassName?: CompoundMapper<string, CheckboxVariantProps>;
49
54
  };
50
55
  radio: {
51
56
  cva?: Cva<RadioVariantProps>;
52
57
  typography?: CompoundMapper<TypographyVariantProps, RadioVariantProps>;
58
+ contentClassName?: CompoundMapper<string, RadioVariantProps>;
53
59
  };
54
60
  status: {
55
61
  iconCva?: Cva<ToastVariantProps>;
@@ -64,9 +70,17 @@ export declare namespace UIStyle {
64
70
  };
65
71
  input: {
66
72
  baseCva?: Cva<InputBaseProps>;
73
+ clearClassCva?: Cva<InputClearClassProps>;
74
+ contentWrapperCva?: Cva<InputContentWrapperProps>;
67
75
  sizeCva?: Cva<InputSizeProps>;
68
76
  sideCva?: Cva<InputSideProps>;
69
77
  };
78
+ tooltipWrapper: {
79
+ triggerCva?: Cva<TooltipWrapperTriggerVariantProps>;
80
+ };
81
+ datePickerInput: {
82
+ contentRowCva?: Cva<DatePickerInputContentRowProps>;
83
+ };
70
84
  label: {
71
85
  cva?: Cva<LabelBaseProps>;
72
86
  typography?: CompoundMapper<TypographyVariantProps, LabelBaseProps>;
@@ -74,6 +88,7 @@ export declare namespace UIStyle {
74
88
  toggle: {
75
89
  cva?: Cva<ToggleVariantProps>;
76
90
  typography?: CompoundMapper<TypographyVariantProps, ToggleVariantProps>;
91
+ contentClassName?: CompoundMapper<string, ToggleVariantProps>;
77
92
  };
78
93
  typography: {
79
94
  cva?: Cva<TypographyVariantProps>;
@@ -145,11 +160,13 @@ export declare namespace UIStyle {
145
160
  cva?: Cva<PopoverVariantProps>;
146
161
  };
147
162
  formField: {
163
+ headerCva?: Cva<FormFieldHeaderVariantProps>;
148
164
  errorLabelCva?: Cva<FormFieldErrorVariantProps>;
149
165
  helperLabelCva?: Cva<FormFieldHelperVariantProps>;
150
166
  };
151
167
  select: {
152
168
  listBoxItemCva?: Cva<SelectListBoxItemCva>;
169
+ popoverCva?: Cva<SelectPopoverCva>;
153
170
  };
154
171
  }
155
172
  interface ProviderProps {
@@ -23,7 +23,7 @@ export type AllowedComponentType<TZodType extends z.ZodType> = ZodUtils.ZodTypeS
23
23
  boolean: "toggle" | "checkbox";
24
24
  number: "numberInput" | "slider" | "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
25
25
  enum: "select" | "querySelect" | "autocomplete" | "segment";
26
- string: "textInput" | "passwordInput" | "textArea" | "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
26
+ string: "textInput" | "passwordInput" | "textArea" | "textEditor" | "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
27
27
  email: "textInput";
28
28
  array: "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
29
29
  object: InputComponentType;
@@ -81,6 +81,7 @@ var getDefaultProps = (componentType, keyType) => {
81
81
  ].includes(componentType)) props.items = getDefaultSelectionItems(unwrappedType);
82
82
  if ([
83
83
  "select",
84
+ "querySelect",
84
85
  "autocomplete",
85
86
  "queryAutocomplete",
86
87
  "segment"
@@ -146,6 +147,8 @@ var populateInputDef = (schema, schemaKey, value, options) => {
146
147
  const inputWrapper = value.inputWrapper ?? options.globalInputWrapper;
147
148
  if ("render" in value) return {
148
149
  name,
150
+ label,
151
+ placeholder,
149
152
  render: value.render
150
153
  };
151
154
  const schemaKeyType = schema.shape[schemaKey];
@@ -3,6 +3,6 @@ type UseIntersectionObserverProps = {
3
3
  onIntersectionChange?: (entry: IntersectionObserverEntry) => void;
4
4
  } & IntersectionObserverInit;
5
5
  export declare const useIntersectionObserver: <T extends HTMLElement>({ onIntersection, onIntersectionChange, root, rootMargin, threshold, }: UseIntersectionObserverProps) => {
6
- ref: import('react').RefObject<T | null>;
6
+ ref: (element: T | null) => void;
7
7
  };
8
8
  export {};