@povio/ui 2.2.9-rc.2 → 2.2.9-rc.20

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 (92) hide show
  1. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -1
  2. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +2 -2
  3. package/dist/components/inputs/Checkbox/Checkbox.js +6 -1
  4. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
  5. package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
  6. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +9 -4
  7. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +96 -9
  8. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +9 -4
  9. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +114 -7
  10. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +10 -4
  11. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +91 -7
  12. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +5 -3
  13. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +80 -6
  14. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
  15. package/dist/components/inputs/DateTime/shared/Calendar.js +23 -6
  16. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
  17. package/dist/components/inputs/DateTime/shared/CalendarCell.js +3 -3
  18. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
  19. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +5 -2
  20. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +21 -12
  21. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +7 -3
  22. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +3 -0
  23. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +7 -0
  24. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +13 -0
  25. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +6 -0
  26. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +20 -0
  27. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  28. package/dist/components/inputs/FormField/FormFieldHeader.js +3 -1
  29. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +6 -0
  30. package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
  31. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
  32. package/dist/components/inputs/Input/NumberInput/NumberInput.js +92 -8
  33. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
  34. package/dist/components/inputs/Input/TextInput/TextInput.js +95 -8
  35. package/dist/components/inputs/Inputs/InputItem.d.ts +14 -18
  36. package/dist/components/inputs/RadioGroup/RadioGroup.js +17 -9
  37. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +3 -0
  38. package/dist/components/inputs/RadioGroup/radio.cva.js +2 -1
  39. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
  40. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +86 -6
  41. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
  42. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +15 -10
  43. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +25 -19
  44. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -2
  45. package/dist/components/inputs/Selection/Select/QuerySelect.js +5 -3
  46. package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
  47. package/dist/components/inputs/Selection/Select/Select.js +84 -4
  48. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +4 -1
  49. package/dist/components/inputs/Selection/shared/SelectBase.js +3 -2
  50. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  51. package/dist/components/inputs/Selection/shared/SelectDesktop.js +8 -4
  52. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  53. package/dist/components/inputs/Selection/shared/SelectInput.js +12 -2
  54. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  55. package/dist/components/inputs/Selection/shared/SelectListBox.js +3 -3
  56. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  57. package/dist/components/inputs/Selection/shared/SelectMobile.js +5 -3
  58. package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
  59. package/dist/components/inputs/Selection/shared/select.context.js +22 -4
  60. package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
  61. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +3 -0
  62. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
  63. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
  64. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +35 -0
  65. package/dist/components/inputs/Toggle/Toggle.js +6 -1
  66. package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
  67. package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
  68. package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
  69. package/dist/components/inputs/shared/CheckContent.js +3 -4
  70. package/dist/components/inputs/shared/StaticInput.d.ts +34 -0
  71. package/dist/components/inputs/shared/StaticInput.js +88 -0
  72. package/dist/components/inputs/shared/TooltipWrapper.js +5 -1
  73. package/dist/components/inputs/shared/input.cva.d.ts +5 -0
  74. package/dist/components/inputs/shared/input.cva.js +10 -1
  75. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +4 -0
  76. package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
  77. package/dist/config/uiConfig.context.d.ts +8 -2
  78. package/dist/config/uiConfig.context.js +11 -1
  79. package/dist/config/uiStyle.context.d.ts +19 -3
  80. package/dist/helpers/dynamicInputs.d.ts +5 -5
  81. package/dist/helpers/dynamicInputs.js +3 -0
  82. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  83. package/dist/hooks/useIntersectionObserver.js +29 -10
  84. package/dist/hooks/useQueryAutocomplete.d.ts +5 -16
  85. package/dist/hooks/useQueryAutocomplete.js +13 -3
  86. package/dist/index.d.ts +5 -0
  87. package/dist/index.js +3 -2
  88. package/dist/utils/date-time.utils.d.ts +10 -0
  89. package/dist/utils/date-time.utils.js +87 -1
  90. package/dist/utils/query.utils.d.ts +4 -0
  91. package/dist/utils/query.utils.js +8 -0
  92. package/package.json +1 -1
@@ -13,7 +13,7 @@ import { useRef } from "react";
13
13
  import { DialogTrigger } from "react-aria-components";
14
14
  import { useLabel } from "react-aria";
15
15
  //#region src/components/inputs/Selection/shared/SelectMobile.tsx
16
- var SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur, onMouseEnter, onFocusCapture, ...props }) => {
16
+ var SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containerClassName, leadingContent, trailingContent, customTrigger, onBlur, onMouseEnter, onFocusCapture, ...props }) => {
17
17
  const { label, tooltipText, helperText, isDirty, isRequired, rightContent, isHeaderHidden, headerClassName, errorClassName, placeholder, variant, isDisabled, className, hideLabel, hideDropdownIcon, hideSearchIcon, isSearchable, isClearable, as, size, collapseAfter, selectedTagsType } = props;
18
18
  const formFieldProps = {
19
19
  error,
@@ -57,13 +57,13 @@ var SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containe
57
57
  as,
58
58
  labelProps,
59
59
  className: clsx("w-full", containerClassName),
60
+ onMouseEnter,
61
+ onFocusCapture,
60
62
  children: /* @__PURE__ */ jsxs(DialogTrigger, {
61
63
  ...dialogTriggerProps,
62
64
  children: [customTrigger ? /* @__PURE__ */ jsx("div", {
63
65
  ...fieldProps,
64
66
  ref,
65
- onMouseEnter,
66
- onFocusCapture,
67
67
  children: customTrigger
68
68
  }) : /* @__PURE__ */ jsx(SelectInput, {
69
69
  ref,
@@ -81,6 +81,8 @@ var SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containe
81
81
  onBlur: void 0,
82
82
  fieldProps,
83
83
  headerProps,
84
+ leadingContent,
85
+ trailingContent,
84
86
  collapseAfter,
85
87
  selectedTagsType,
86
88
  isRequired,
@@ -17,14 +17,15 @@ export declare namespace SelectContext {
17
17
  onClear: () => void;
18
18
  onSelectAll: () => void;
19
19
  onRemove: (val: Key) => void;
20
+ onBlur: () => void;
20
21
  listItems: ExtendedSelectItem[];
21
22
  selectableListItems: SelectItem[];
22
23
  selectedItems: SelectItem[];
23
24
  selectedIds: Key[];
24
25
  isMultiple: boolean;
25
26
  } & Pick<SelectBaseProps, "onInputChange" | "isLoading" | "hasLoadMore">;
26
- export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled">;
27
- export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
27
+ export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled" | "ignoreInputValueFiltering">;
28
+ export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
28
29
  export const useSelect: () => Type;
29
30
  export {};
30
31
  }
@@ -1,5 +1,5 @@
1
- import { useSelectItems } from "./useSelectItems.js";
2
1
  import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
2
+ import { useSelectItems } from "./useSelectItems.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { createContext, use, useCallback, useEffect, useMemo, useRef, useState } from "react";
5
5
  //#region src/components/inputs/Selection/shared/select.context.tsx
@@ -10,7 +10,7 @@ var SelectContext;
10
10
  id: item.id,
11
11
  label: item.label ?? item.name ?? ""
12
12
  });
13
- _SelectContext.Provider = ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, children, mapInitialToSelectItem = defaultMapInitialToSelectItem, ...props }) => {
13
+ _SelectContext.Provider = ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, children, mapInitialToSelectItem = defaultMapInitialToSelectItem, ...props }) => {
14
14
  const isMultiple = props.selectionMode === "multiple";
15
15
  const initialSelectedItems = useMemo(() => {
16
16
  if (!props.initialSelection) return null;
@@ -42,7 +42,7 @@ var SelectContext;
42
42
  newItemMinLength,
43
43
  isLoading,
44
44
  hasLoadMore,
45
- isClientSearchDisabled
45
+ isClientSearchDisabled: ignoreInputValueFiltering ?? isClientSearchDisabled
46
46
  });
47
47
  const selectedItems = useMemo(() => allItems.filter(({ id }) => Array.isArray(fieldState.value) ? fieldState.value.includes(id) : id === fieldState.value), [allItems, fieldState.value]);
48
48
  const selectedIds = useMemo(() => selectedItems.map(({ id }) => id), [selectedItems]);
@@ -84,7 +84,7 @@ var SelectContext;
84
84
  else updateValue(value);
85
85
  }, [props.value]);
86
86
  useEffect(() => {
87
- if (!isMultiple && fieldState.value && fieldState.inputValue === "" && getItem(fieldState.value)?.label) syncFieldState(fieldState.value);
87
+ if (!isMultiple && props.value !== null && props.value !== void 0 && fieldState.value !== null && fieldState.value !== void 0 && fieldState.inputValue === "" && getItem(fieldState.value)?.label) syncFieldState(fieldState.value);
88
88
  }, [allListItems]);
89
89
  const handleInputChange = useCallback((inputValue) => {
90
90
  const newFieldState = {
@@ -144,6 +144,22 @@ var SelectContext;
144
144
  fieldState.value,
145
145
  onChange
146
146
  ]);
147
+ const onBlur = useCallback(() => {
148
+ if (props.isSearchable && isMultiple && fieldState.searchValue !== "") {
149
+ const newFieldState = {
150
+ ...fieldState,
151
+ inputValue: "",
152
+ searchValue: ""
153
+ };
154
+ setFieldState(newFieldState);
155
+ emitStateChanges(newFieldState);
156
+ setShowAll(true);
157
+ }
158
+ }, [
159
+ props.isSearchable,
160
+ isMultiple,
161
+ fieldState
162
+ ]);
147
163
  const value = useMemo(() => ({
148
164
  fieldState,
149
165
  isOpen,
@@ -154,6 +170,7 @@ var SelectContext;
154
170
  onClear,
155
171
  onSelectAll,
156
172
  onRemove,
173
+ onBlur,
157
174
  listItems,
158
175
  selectableListItems,
159
176
  selectedItems,
@@ -171,6 +188,7 @@ var SelectContext;
171
188
  onClear,
172
189
  onSelectAll,
173
190
  onRemove,
191
+ onBlur,
174
192
  listItems,
175
193
  selectableListItems,
176
194
  selectedIds,
@@ -1,11 +1,11 @@
1
- import { ReactElement } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { Key } from 'react-aria-components';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
  import { ControlProps } from '../../shared/form.types';
5
5
  export interface SelectItem<TKey extends Key = Key> {
6
6
  id: TKey;
7
7
  label: string;
8
- content?: string | ReactElement;
8
+ content?: string | ReactNode;
9
9
  isDisabled?: boolean;
10
10
  }
11
11
  export interface ExtendedSelectItem<TKey extends Key = Key> extends SelectItem<TKey> {
@@ -54,6 +54,7 @@ export interface SelectAsyncProps {
54
54
  onLoadMore?: () => void;
55
55
  }
56
56
  export interface SelectVirtualizationProps {
57
+ totalItems?: number;
57
58
  virtualizerOptions?: {
58
59
  rowHeight?: number;
59
60
  estimatedRowHeight?: number;
@@ -0,0 +1,3 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export declare const selectPopoverCva: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
3
+ export type SelectPopoverCva = VariantProps<typeof selectPopoverCva>;
@@ -0,0 +1,5 @@
1
+ import { cva } from "class-variance-authority";
2
+ //#region src/components/inputs/Selection/shared/selectDesktop.cva.ts
3
+ var selectPopoverCva = cva("my-4 outline-none");
4
+ //#endregion
5
+ export { selectPopoverCva };
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ import { Key } from 'react-aria-components';
3
+ import { SelectBaseProps } from './SelectBase';
4
+ import { DefaultInitialSelectItem, SelectItem } from './select.types';
5
+ interface GetStaticSelectValueOptions<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> {
6
+ items: SelectItem<TKey>[];
7
+ value: TKey | TKey[] | null | undefined;
8
+ selectionMode: SelectBaseProps<TKey>["selectionMode"];
9
+ initialSelection?: TInitialSelectItem | TInitialSelectItem[] | null;
10
+ mapInitialToSelectItem?: (item: TInitialSelectItem) => SelectItem<TKey>;
11
+ showSelectionContent?: boolean;
12
+ isDisabled?: boolean;
13
+ collapseAfter?: SelectBaseProps<TKey>["collapseAfter"];
14
+ selectedTagsType?: SelectBaseProps<TKey>["selectedTagsType"];
15
+ }
16
+ interface StaticSelectValueResult<TKey extends Key = Key> {
17
+ selectedItem: SelectItem<TKey> | null;
18
+ selectedItems: SelectItem<TKey>[];
19
+ displayValue: ReactNode;
20
+ isEmpty: boolean;
21
+ }
22
+ export declare const getStaticSelectValue: <TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>({ items, value, selectionMode, initialSelection, mapInitialToSelectItem, showSelectionContent, isDisabled, collapseAfter, selectedTagsType, }: GetStaticSelectValueOptions<TKey, TInitialSelectItem>) => StaticSelectValueResult<TKey>;
23
+ export {};
@@ -0,0 +1,35 @@
1
+ import { SelectInputTags } from "./SelectInputTags.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/inputs/Selection/shared/staticSelect.utils.tsx
4
+ var getStaticSelectValue = ({ items, value, selectionMode, initialSelection, mapInitialToSelectItem = ((item) => ({
5
+ id: item.id,
6
+ label: item.label ?? item.name ?? ""
7
+ })), showSelectionContent, isDisabled, collapseAfter, selectedTagsType }) => {
8
+ const initialSelectedItems = initialSelection ? (Array.isArray(initialSelection) ? initialSelection : [initialSelection]).map((item) => mapInitialToSelectItem(item)) : [];
9
+ const allItemsMap = /* @__PURE__ */ new Map();
10
+ [...initialSelectedItems, ...items].forEach((item) => allItemsMap.set(item.id, item));
11
+ const allItems = Array.from(allItemsMap.values());
12
+ const getItem = (id) => allItems.find((item) => item.id === id) ?? null;
13
+ const selectedItems = Array.isArray(value) ? value.map((id) => getItem(id)).filter((item) => item != null) : [];
14
+ const selectedItem = !Array.isArray(value) && value != null ? getItem(value) : null;
15
+ if (selectionMode === "multiple") return {
16
+ selectedItem,
17
+ selectedItems,
18
+ displayValue: selectedItems.length > 0 ? /* @__PURE__ */ jsx(SelectInputTags, {
19
+ selectedItems,
20
+ isDisabled,
21
+ collapseAfter,
22
+ selectedTagsType,
23
+ onRemove: () => void 0
24
+ }) : "",
25
+ isEmpty: selectedItems.length === 0
26
+ };
27
+ return {
28
+ selectedItem,
29
+ selectedItems,
30
+ displayValue: selectedItem != null ? showSelectionContent && selectedItem.content ? selectedItem.content : selectedItem.label : "",
31
+ isEmpty: selectedItem == null
32
+ };
33
+ };
34
+ //#endregion
35
+ export { getStaticSelectValue };
@@ -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
  };
@@ -0,0 +1,34 @@
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
+ type StaticInputDataAttributes = {
6
+ dataDisabled?: boolean;
7
+ dataHasSearch?: boolean;
8
+ dataHasSelection?: boolean;
9
+ dataInvalid?: boolean;
10
+ dataIsDirty?: boolean;
11
+ dataIsDisabled?: boolean;
12
+ dataIsEmpty?: boolean;
13
+ dataIsFilled?: boolean;
14
+ dataIsRequired?: boolean;
15
+ };
16
+ interface StaticInputProps extends FormFieldProps {
17
+ onInteract: (shouldFocus: boolean) => void;
18
+ as?: TextInputProps["as"];
19
+ size?: InputSizeProps["size"];
20
+ variant?: InputVariantProps["variant"];
21
+ applyMinInputWidth?: boolean;
22
+ placeholder?: ReactNode;
23
+ displayValue?: ReactNode;
24
+ isEmpty?: boolean;
25
+ leadingVisual?: ReactNode;
26
+ leadingContent?: ReactNode;
27
+ leadingContentClassName?: string;
28
+ trailingContent?: ReactNode;
29
+ contentRowClassName?: string;
30
+ inputClassName?: string;
31
+ dataAttributes?: StaticInputDataAttributes;
32
+ }
33
+ export declare const StaticInput: ({ onInteract, as, size, variant, applyMinInputWidth, placeholder, displayValue, isEmpty, leadingVisual, leadingContent, leadingContentClassName, trailingContent, contentRowClassName, inputClassName, dataAttributes, className, ...formFieldProps }: StaticInputProps) => import("react/jsx-runtime").JSX.Element;
34
+ export {};
@@ -0,0 +1,88 @@
1
+ import { UIStyle } from "../../../config/uiStyle.context.js";
2
+ import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
3
+ import { inputBase, inputSize } from "./input.cva.js";
4
+ import { FormField } from "../FormField/FormField.js";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { clsx } from "clsx";
7
+ //#region src/components/inputs/shared/StaticInput.tsx
8
+ var StaticInput = ({ onInteract, as, size, variant, applyMinInputWidth, placeholder, displayValue, isEmpty, leadingVisual, leadingContent, leadingContentClassName, trailingContent, contentRowClassName, inputClassName, dataAttributes, className, ...formFieldProps }) => {
9
+ const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
10
+ const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
11
+ let hasValue = !!displayValue;
12
+ if (isEmpty != null) hasValue = !isEmpty;
13
+ let staticDisplayContent = placeholder;
14
+ if (hasValue) staticDisplayContent = displayValue;
15
+ else if (as === "floating") staticDisplayContent = null;
16
+ const shouldRenderFloatingLineSpacer = as === "floating" && !hasValue;
17
+ const inputDataAttributes = {
18
+ dataIsEmpty: !hasValue,
19
+ dataDisabled: formFieldProps.isDisabled,
20
+ dataIsDisabled: formFieldProps.isDisabled,
21
+ dataHasSelection: hasValue,
22
+ ...dataAttributes
23
+ };
24
+ return /* @__PURE__ */ jsx(FormField, {
25
+ ...formFieldProps,
26
+ as,
27
+ className,
28
+ onMouseEnter: () => onInteract(false),
29
+ tabIndex: as === "inline" ? -1 : void 0,
30
+ children: /* @__PURE__ */ jsxs("div", {
31
+ tabIndex: formFieldProps.isDisabled ? -1 : 0,
32
+ onFocus: () => onInteract(true),
33
+ onClick: () => onInteract(true),
34
+ onPointerDown: () => onInteract(true),
35
+ "data-is-empty": inputDataAttributes.dataIsEmpty || void 0,
36
+ "data-disabled": inputDataAttributes.dataDisabled || void 0,
37
+ "data-is-disabled": inputDataAttributes.dataIsDisabled || void 0,
38
+ "data-has-selection": inputDataAttributes.dataHasSelection || void 0,
39
+ "data-has-search": inputDataAttributes.dataHasSearch || void 0,
40
+ "data-invalid": inputDataAttributes.dataInvalid || void 0,
41
+ "data-is-dirty": inputDataAttributes.dataIsDirty || void 0,
42
+ "data-is-filled": inputDataAttributes.dataIsFilled || void 0,
43
+ "data-is-required": inputDataAttributes.dataIsRequired || void 0,
44
+ "data-rac": "",
45
+ className: clsx("group/static-input group/input-content group/select-content relative flex items-center gap-input-gap-input-text-to-elements", applyMinInputWidth && "min-w-input-width-min-width", inputBaseCva({
46
+ as,
47
+ variant
48
+ }), !hasValue && "text-text-default-3", inputClassName),
49
+ children: [/* @__PURE__ */ jsxs("div", {
50
+ className: clsx("group/input-content flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
51
+ size,
52
+ as
53
+ }), contentRowClassName),
54
+ children: [
55
+ leadingVisual && /* @__PURE__ */ jsx("div", {
56
+ className: "pointer-events-none shrink-0",
57
+ children: leadingVisual
58
+ }),
59
+ as && ["filter", "floating"].includes(as) && /* @__PURE__ */ jsx(FormFieldLabel, {
60
+ as,
61
+ size,
62
+ label: formFieldProps.label,
63
+ isRequired: formFieldProps.isRequired,
64
+ isDisabled: formFieldProps.isDisabled
65
+ }),
66
+ leadingContent && /* @__PURE__ */ jsx("div", {
67
+ className: clsx("ml-input-side-default flex shrink-0 items-center", leadingContentClassName),
68
+ children: leadingContent
69
+ }),
70
+ staticDisplayContent,
71
+ shouldRenderFloatingLineSpacer && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }),
72
+ placeholder && hasValue && /* @__PURE__ */ jsx("div", {
73
+ className: "text-text-default-3",
74
+ children: placeholder
75
+ })
76
+ ]
77
+ }), trailingContent && /* @__PURE__ */ jsx("div", {
78
+ className: clsx(inputSizeCva({
79
+ size,
80
+ as
81
+ }), "pointer-events-none flex items-center gap-input-gap-trailing-elements py-0! pl-0!"),
82
+ children: trailingContent
83
+ })]
84
+ })
85
+ });
86
+ };
87
+ //#endregion
88
+ export { StaticInput };
@@ -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,11 @@ 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 inputClearClass: (props?: ({
16
+ as?: "filter" | "default" | "floating" | "inline" | null | undefined;
17
+ } & ClassProp) | undefined) => string;
18
+ export interface InputClearClassProps extends VariantProps<typeof inputClearClass> {
19
+ }
15
20
  export declare const inputSide: (props?: ({
16
21
  size?: "small" | "default" | "extra-small" | "large" | null | undefined;
17
22
  type?: "left" | "right" | "var" | null | undefined;
@@ -191,6 +191,15 @@ var inputSize = cva("", {
191
191
  as: "default"
192
192
  }
193
193
  });
194
+ var inputClearClass = cva("", {
195
+ variants: { as: {
196
+ default: "",
197
+ floating: "",
198
+ filter: "",
199
+ inline: ""
200
+ } },
201
+ defaultVariants: { as: "default" }
202
+ });
194
203
  var inputSide = cva("", {
195
204
  variants: {
196
205
  size: {
@@ -277,4 +286,4 @@ var useInputCva = () => {
277
286
  };
278
287
  };
279
288
  //#endregion
280
- export { inputBase, inputSide, inputSize, useInputCva };
289
+ export { inputBase, inputClearClass, 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" | "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,14 @@ var UIConfig;
43
47
  },
44
48
  dateInput: {
45
49
  todayIcon: false,
50
+ todayIconButtonSize: "none",
46
51
  shouldForceLeadingZeros: false,
47
- disableManualEntry: false
52
+ disableManualEntry: false,
53
+ autoFixYear: false,
54
+ calendarIcon: /* @__PURE__ */ jsx(CalendarIcon, { className: "size-5" }),
55
+ dateTimeIcon: /* @__PURE__ */ jsx(DateTimeIcon, { className: "size-5" }),
56
+ timeIcon: /* @__PURE__ */ jsx(ClockIcon, { className: "size-6 text-interactive-text-secondary-idle" }),
57
+ setDateValueOnDateSelection: false
48
58
  },
49
59
  actionModal: {
50
60
  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, 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,16 @@ export declare namespace UIStyle {
64
70
  };
65
71
  input: {
66
72
  baseCva?: Cva<InputBaseProps>;
73
+ clearClassCva?: Cva<InputClearClassProps>;
67
74
  sizeCva?: Cva<InputSizeProps>;
68
75
  sideCva?: Cva<InputSideProps>;
69
76
  };
77
+ tooltipWrapper: {
78
+ triggerCva?: Cva<TooltipWrapperTriggerVariantProps>;
79
+ };
80
+ datePickerInput: {
81
+ contentRowCva?: Cva<DatePickerInputContentRowProps>;
82
+ };
70
83
  label: {
71
84
  cva?: Cva<LabelBaseProps>;
72
85
  typography?: CompoundMapper<TypographyVariantProps, LabelBaseProps>;
@@ -74,6 +87,7 @@ export declare namespace UIStyle {
74
87
  toggle: {
75
88
  cva?: Cva<ToggleVariantProps>;
76
89
  typography?: CompoundMapper<TypographyVariantProps, ToggleVariantProps>;
90
+ contentClassName?: CompoundMapper<string, ToggleVariantProps>;
77
91
  };
78
92
  typography: {
79
93
  cva?: Cva<TypographyVariantProps>;
@@ -145,11 +159,13 @@ export declare namespace UIStyle {
145
159
  cva?: Cva<PopoverVariantProps>;
146
160
  };
147
161
  formField: {
162
+ headerCva?: Cva<FormFieldHeaderVariantProps>;
148
163
  errorLabelCva?: Cva<FormFieldErrorVariantProps>;
149
164
  helperLabelCva?: Cva<FormFieldHelperVariantProps>;
150
165
  };
151
166
  select: {
152
167
  listBoxItemCva?: Cva<SelectListBoxItemCva>;
168
+ popoverCva?: Cva<SelectPopoverCva>;
153
169
  };
154
170
  }
155
171
  interface ProviderProps {