@povio/ui 0.0.7 → 0.0.9

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 (104) hide show
  1. package/dist/assets/icons/Calendar.js +1 -1
  2. package/dist/assets/icons/CheckCircle.js +3 -3
  3. package/dist/assets/icons/ChevronsLeft.js +11 -22
  4. package/dist/assets/icons/ChevronsRight.js +11 -22
  5. package/dist/assets/icons/DateTime.js +13 -6
  6. package/dist/assets/icons/Drag.js +1 -1
  7. package/dist/assets/icons/File.js +1 -1
  8. package/dist/assets/icons/Info.js +2 -4
  9. package/dist/assets/icons/Menu.js +1 -3
  10. package/dist/assets/icons/Send.js +1 -1
  11. package/dist/assets/icons/Upload.js +2 -2
  12. package/dist/assets/icons/{Warningfilled.js → WarningFilled.js} +1 -1
  13. package/dist/components/Menu/MenuPopover.js +1 -1
  14. package/dist/components/buttons/PillButton/pillButton.cva.js +1 -1
  15. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -1
  16. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +7 -4
  17. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +10 -4
  18. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +7 -4
  19. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +16 -5
  20. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +3 -2
  21. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +30 -23
  22. package/dist/components/inputs/File/FileUpload.js +1 -1
  23. package/dist/components/inputs/File/InputUpload.js +1 -1
  24. package/dist/components/inputs/File/shared/FileUploadContentError.js +1 -1
  25. package/dist/components/inputs/File/shared/InputUploadContent.js +10 -4
  26. package/dist/components/inputs/File/shared/InputUploadFilled.js +36 -22
  27. package/dist/components/inputs/File/shared/fileUpload.cva.js +3 -2
  28. package/dist/components/inputs/File/shared/inputUploadButton.cva.js +6 -5
  29. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +3 -2
  30. package/dist/components/inputs/FormField/FormFieldLabel.js +8 -2
  31. package/dist/components/inputs/Input/TextArea/TextArea.js +6 -9
  32. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -0
  33. package/dist/components/inputs/Input/TextInput/TextInput.js +26 -3
  34. package/dist/components/inputs/Input/shared/InputContent.js +67 -59
  35. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +3 -2
  36. package/dist/components/inputs/Selection/shared/SelectBase.js +2 -1
  37. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  38. package/dist/components/inputs/Selection/shared/SelectInput.js +84 -90
  39. package/dist/components/inputs/Selection/shared/SelectInputTags.d.ts +11 -0
  40. package/dist/components/inputs/Selection/shared/SelectInputTags.js +22 -0
  41. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  42. package/dist/components/inputs/Selection/shared/SelectListBox.js +56 -45
  43. package/dist/components/inputs/Selection/shared/select.context.js +1 -0
  44. package/dist/components/inputs/Selection/shared/select.types.d.ts +8 -0
  45. package/dist/components/inputs/shared/InputClear.d.ts +3 -1
  46. package/dist/components/inputs/shared/InputClear.js +4 -3
  47. package/dist/components/inputs/shared/input.cva.js +18 -17
  48. package/dist/components/inputs/shared/label.cva.js +2 -2
  49. package/dist/components/overlays/BottomSheet/BottomSheet.js +17 -12
  50. package/dist/components/overlays/Tooltip/Tooltip.d.ts +4 -2
  51. package/dist/components/overlays/Tooltip/Tooltip.js +32 -6
  52. package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +21 -0
  53. package/dist/components/overlays/Tooltip/tooltip.cva.js +60 -0
  54. package/dist/components/segment/Segment.js +8 -2
  55. package/dist/components/segment/SegmentItem.js +4 -2
  56. package/dist/components/table/CellText.js +2 -2
  57. package/dist/components/table/HeaderText.js +1 -1
  58. package/dist/components/table/Table.js +34 -16
  59. package/dist/components/table/table.cva.d.ts +7 -3
  60. package/dist/components/table/table.cva.js +37 -11
  61. package/dist/config/uiConfig.context.d.ts +3 -1
  62. package/dist/config/uiConfig.context.js +6 -1
  63. package/dist/config/uiStyle.context.d.ts +2 -1
  64. package/dist/helpers/dynamicColumns.js +2 -2
  65. package/dist/helpers/dynamicInputs.d.ts +2 -0
  66. package/dist/helpers/dynamicInputs.js +5 -3
  67. package/dist/hooks/useAutosave.js +4 -1
  68. package/dist/hooks/useTableColumnConfig.js +5 -1
  69. package/dist/index.d.ts +12 -6
  70. package/dist/index.js +15 -11
  71. package/dist/utils/date-time.utils.js +12 -12
  72. package/dist/utils/dom.utils.js +2 -2
  73. package/dist/utils/file.utils.js +1 -1
  74. package/dist/utils/isEqual.js +2 -1
  75. package/dist/utils/object.utils.js +2 -2
  76. package/dist/utils/{rest/rest.utils.js → rest.utils.js} +1 -1
  77. package/dist/utils/vendor/acl/AclGuard.d.ts +8 -0
  78. package/dist/utils/vendor/acl/AclGuard.js +15 -0
  79. package/dist/utils/vendor/acl/Can.d.ts +9 -0
  80. package/dist/utils/vendor/acl/Can.js +18 -0
  81. package/dist/utils/vendor/acl/ability.context.d.ts +15 -0
  82. package/dist/utils/vendor/acl/ability.context.js +37 -0
  83. package/dist/utils/vendor/acl/appAbility.types.d.ts +3 -0
  84. package/dist/utils/vendor/auth/AuthGuard.d.ts +6 -0
  85. package/dist/utils/vendor/auth/AuthGuard.js +26 -0
  86. package/dist/utils/vendor/auth/auth.context.d.ts +21 -0
  87. package/dist/utils/vendor/auth/auth.context.js +36 -0
  88. package/dist/utils/vendor/auth/withPrivateAuthGuard.d.ts +6 -0
  89. package/dist/utils/vendor/auth/withPrivateAuthGuard.js +17 -0
  90. package/dist/utils/vendor/error-handling.js +1 -1
  91. package/dist/utils/{rest/rest-client.d.ts → vendor/rest-client.types.d.ts} +8 -14
  92. package/dist/utils/zod.utils.d.ts +2 -1
  93. package/package.json +2 -2
  94. package/dist/hooks/useSingletonMutation.d.ts +0 -4
  95. package/dist/hooks/useSingletonMutation.js +0 -27
  96. package/dist/utils/rest/interceptors/logging.interceptor.d.ts +0 -2
  97. package/dist/utils/rest/interceptors/logging.interceptor.js +0 -17
  98. package/dist/utils/rest/interceptors/response.interceptor.d.ts +0 -2
  99. package/dist/utils/rest/interceptors/response.interceptor.js +0 -25
  100. package/dist/utils/rest/rest-client.js +0 -62
  101. /package/dist/assets/icons/{Warningfilled.d.ts → WarningFilled.d.ts} +0 -0
  102. /package/dist/utils/{rest/rest.utils.d.ts → rest.utils.d.ts} +0 -0
  103. /package/dist/utils/{rest/interceptors → vendor}/rest-interceptor.d.ts +0 -0
  104. /package/dist/utils/{rest/interceptors → vendor}/rest-interceptor.js +0 -0
@@ -7,10 +7,10 @@ import { useTranslation } from "react-i18next";
7
7
  import useMeasure from "react-use-measure";
8
8
  import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
9
9
  import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
10
+ import { SelectInputTags } from "./SelectInputTags.js";
10
11
  import { SelectContext } from "./select.context.js";
11
12
  import { InputClear } from "../../shared/InputClear.js";
12
- import { inputSize, inputBase } from "../../shared/input.cva.js";
13
- import { Tag } from "../../../text/Tag/Tag.js";
13
+ import { inputSize, inputBase, inputSide } from "../../shared/input.cva.js";
14
14
  import { Typography } from "../../../text/Typography/Typography.js";
15
15
  import { ns } from "../../../../config/i18n.js";
16
16
  import { UIStyle } from "../../../../config/uiStyle.context.js";
@@ -30,6 +30,7 @@ const SelectInput = ({
30
30
  inputClassName,
31
31
  fieldProps,
32
32
  headerProps,
33
+ selectedTagsType,
33
34
  onCloseComboBox,
34
35
  onBlur,
35
36
  ...props
@@ -37,6 +38,7 @@ const SelectInput = ({
37
38
  const uiStyle = UIStyle.useConfig();
38
39
  const inputSizeCva = uiStyle?.input?.sizeCva ?? inputSize;
39
40
  const inputBaseCva = uiStyle?.input?.baseCva ?? inputBase;
41
+ const inputSideCva = uiStyle?.input?.sideCva ?? inputSide;
40
42
  const { t } = useTranslation(ns);
41
43
  const state = use(ComboBoxStateContext);
42
44
  const { hoverProps, isHovered } = useHover({ isDisabled });
@@ -65,10 +67,11 @@ const SelectInput = ({
65
67
  if (as !== "filter") {
66
68
  return {};
67
69
  }
70
+ const paddingLeft = `calc(${isSearchable || showTags ? "1 * " : "2 * "}var(${inputSideCva({ size, type: "var" })}) + ${labelWidth}px)`;
68
71
  return {
69
- paddingLeft: `calc(var(--spacing-input-side-default) + ${labelWidth}px + var(--spacing-2))`
72
+ paddingLeft
70
73
  };
71
- }, [labelWidth, as]);
74
+ }, [labelWidth, as, size, isSearchable, showTags, inputSideCva]);
72
75
  const labelProps = useMemo(() => {
73
76
  const { labelProps: headerLabelProps } = headerProps ?? {};
74
77
  const isFilterOrFloating = as && ["filter", "floating"].includes(as);
@@ -98,7 +101,7 @@ const SelectInput = ({
98
101
  variant,
99
102
  as,
100
103
  ...props,
101
- className: clsx("group/select-content !px-0 relative flex", isSearchable && "cursor-text", className)
104
+ className: clsx("group/select-content relative flex px-0!", isSearchable && "cursor-text", className)
102
105
  }),
103
106
  "data-rac": "",
104
107
  "data-disabled": isDisabled,
@@ -113,102 +116,93 @@ const SelectInput = ({
113
116
  ...hoverProps,
114
117
  ...focusWithinProps,
115
118
  children: [
116
- /* @__PURE__ */ jsxs(
117
- "div",
118
- {
119
- className: clsx(
120
- "relative flex flex-1 items-center truncate",
121
- showTags && inputSizeCva({ size, ...props, className: "pr-2 pl-input-side-default" })
122
- ),
123
- children: [
124
- as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(
125
- FormFieldLabel,
126
- {
127
- ref: labelContentRef,
128
- as,
129
- ...headerProps,
130
- labelProps
131
- }
132
- ),
133
- (showTags || isSearchable) && /* @__PURE__ */ jsxs(
134
- "div",
119
+ /* @__PURE__ */ jsxs("div", { className: clsx("relative flex flex-1 items-center truncate", showTags && inputSizeCva({ size, ...props })), children: [
120
+ as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(
121
+ FormFieldLabel,
122
+ {
123
+ ref: labelContentRef,
124
+ as,
125
+ ...headerProps,
126
+ labelProps
127
+ }
128
+ ),
129
+ (showTags || isSearchable) && /* @__PURE__ */ jsxs(
130
+ "div",
131
+ {
132
+ className: clsx("flex flex-1 flex-wrap gap-2 truncate", !isSearchable && "pointer-events-none z-1"),
133
+ style,
134
+ children: [
135
+ showTags && /* @__PURE__ */ jsx(
136
+ SelectInputTags,
137
+ {
138
+ selectedItems,
139
+ isDisabled,
140
+ selectedTagsType,
141
+ onRemove
142
+ }
143
+ ),
144
+ isSearchable && /* @__PURE__ */ jsx(
145
+ Input,
146
+ {
147
+ placeholder,
148
+ onBlur,
149
+ className: clsx(
150
+ "flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled",
151
+ !showTags && inputSizeCva({
152
+ size,
153
+ ...props,
154
+ className: "rounded-input-rounding-default"
155
+ }),
156
+ inputClassName
157
+ ),
158
+ onKeyDown,
159
+ ...fieldProps
160
+ }
161
+ )
162
+ ]
163
+ }
164
+ ),
165
+ !isSearchable && /* @__PURE__ */ jsx(
166
+ Button,
167
+ {
168
+ isDisabled,
169
+ onPress: () => setIsOpen(!isOpen),
170
+ onBlur,
171
+ "data-type": "select-trigger",
172
+ className: inputSizeCva({
173
+ size,
174
+ ...props,
175
+ className: clsx(
176
+ "w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled",
177
+ showTags && "absolute inset-0 z-0"
178
+ )
179
+ }),
180
+ style,
181
+ ...fieldProps,
182
+ children: (isEmpty || !isMultiple) && /* @__PURE__ */ jsxs(
183
+ Typography,
135
184
  {
136
- className: clsx("flex flex-1 flex-wrap gap-2 truncate", !isSearchable && "pointer-events-none z-[1]"),
137
- style,
185
+ size: "label-1",
186
+ className: clsx(
187
+ "truncate empty:before:inline-block empty:before:content-['']",
188
+ isEmpty && "text-text-default-3"
189
+ ),
138
190
  children: [
139
- showTags && selectedItems.map((item) => /* @__PURE__ */ jsx(
140
- Tag,
141
- {
142
- dismissable: true,
143
- isDisabled,
144
- onDismiss: () => onRemove(item.id),
145
- excludeFromTabOrder: true,
146
- className: "z-[1]",
147
- children: item.label
148
- },
149
- item.id
150
- )),
151
- isSearchable && /* @__PURE__ */ jsx(
152
- Input,
153
- {
154
- placeholder,
155
- onBlur,
156
- className: clsx(
157
- "flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled",
158
- !showTags && inputSizeCva({
159
- size,
160
- ...props,
161
- className: "rounded-input-rounding-default pl-input-side-default"
162
- }),
163
- inputClassName
164
- ),
165
- onKeyDown,
166
- ...fieldProps
167
- }
168
- )
191
+ isEmpty && placeholder,
192
+ !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)
169
193
  ]
170
194
  }
171
- ),
172
- !isSearchable && /* @__PURE__ */ jsx(
173
- Button,
174
- {
175
- isDisabled,
176
- onPress: () => setIsOpen(!isOpen),
177
- onBlur,
178
- "data-type": "select-trigger",
179
- className: inputSizeCva({
180
- size,
181
- ...props,
182
- className: clsx(
183
- "w-full truncate pl-input-side-default text-start outline-none disabled:text-interactive-text-secondary-disabled",
184
- showTags && "absolute inset-0 z-0"
185
- )
186
- }),
187
- style,
188
- ...fieldProps,
189
- children: (isEmpty || !isMultiple) && /* @__PURE__ */ jsxs(
190
- Typography,
191
- {
192
- size: "label-1",
193
- className: "truncate empty:before:inline-block empty:before:content-['']",
194
- children: [
195
- isEmpty && placeholder,
196
- !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)
197
- ]
198
- }
199
- )
200
- }
201
195
  )
202
- ]
203
- }
204
- ),
196
+ }
197
+ )
198
+ ] }),
205
199
  showClearButton && /* @__PURE__ */ jsx(InputClear, { onClear }),
206
200
  !hideDropdownIcon && /* @__PURE__ */ jsx(
207
201
  Button,
208
202
  {
209
203
  excludeFromTabOrder: true,
210
204
  "aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
211
- className: "self-stretch pr-input-side-default pl-1-5 outline-none",
205
+ className: clsx("self-stretch pl-1-5 outline-none", inputSizeCva({ size })),
212
206
  isDisabled,
213
207
  onPress: () => {
214
208
  if (!isSearchable) {
@@ -0,0 +1,11 @@
1
+ import { Key } from 'react-aria-components';
2
+ import { SelectBaseProps } from './SelectBase';
3
+ import { SelectItem } from './select.types';
4
+ interface SelectInputTagsProps {
5
+ selectedItems: SelectItem[];
6
+ isDisabled: SelectBaseProps["isDisabled"];
7
+ selectedTagsType: SelectBaseProps["selectedTagsType"];
8
+ onRemove: (id: Key) => void;
9
+ }
10
+ export declare const SelectInputTags: ({ selectedItems, isDisabled, selectedTagsType, onRemove }: SelectInputTagsProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,22 @@
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import { Tag } from "../../../text/Tag/Tag.js";
3
+ const SelectInputTags = ({ selectedItems, isDisabled, selectedTagsType, onRemove }) => {
4
+ if (selectedTagsType !== "tags") {
5
+ return /* @__PURE__ */ jsx("p", { children: selectedItems.map((item) => item.label).join(", ") });
6
+ }
7
+ return /* @__PURE__ */ jsx(Fragment, { children: selectedItems.map((item) => /* @__PURE__ */ jsx(
8
+ Tag,
9
+ {
10
+ dismissable: true,
11
+ isDisabled,
12
+ onDismiss: () => onRemove(item.id),
13
+ excludeFromTabOrder: true,
14
+ className: "z-1",
15
+ children: item.label
16
+ },
17
+ item.id
18
+ )) });
19
+ };
20
+ export {
21
+ SelectInputTags
22
+ };
@@ -1,9 +1,9 @@
1
1
  import { AriaListBoxProps } from 'react-aria';
2
2
  import { SelectBaseProps } from './SelectBase';
3
3
  import { SelectItem } from './select.types';
4
- export interface SelectListBoxProps extends Pick<SelectBaseProps, "label" | "newItemRender" | "onLoadMore" | "selectionMode" | "isSearchable">, Omit<AriaListBoxProps<SelectItem>, "children" | "aria-label" | "selectionMode" | "items" | "selectedKeys" | "onSelectionChange" | "escapeKeyBehavior" | "shouldSelectOnPressUp" | "label"> {
4
+ export interface SelectListBoxProps extends Pick<SelectBaseProps, "label" | "newItemRender" | "onLoadMore" | "selectionMode" | "isSearchable" | "virtualizerOptions">, Omit<AriaListBoxProps<SelectItem>, "children" | "aria-label" | "selectionMode" | "items" | "selectedKeys" | "onSelectionChange" | "escapeKeyBehavior" | "shouldSelectOnPressUp" | "label"> {
5
5
  className?: string;
6
6
  isScrollable?: boolean;
7
7
  onClose?: () => void;
8
8
  }
9
- export declare const SelectListBox: ({ label, selectionMode, isSearchable, isScrollable, newItemRender, onLoadMore, className, onClose, ...props }: SelectListBoxProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const SelectListBox: ({ label, selectionMode, isSearchable, isScrollable, virtualizerOptions, newItemRender, onLoadMore, className, onClose, ...props }: SelectListBoxProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { clsx } from "clsx";
3
- import { ListBox } from "react-aria-components";
3
+ import { Virtualizer, ListLayout, ListBox } from "react-aria-components";
4
4
  import { SelectListBoxItem } from "./SelectListBoxItem.js";
5
5
  import { SelectListBoxItemSelectAll } from "./SelectListBoxItemSelectAll.js";
6
6
  import { SelectListBoxLoadingItem } from "./SelectListBoxLoadingItem.js";
@@ -11,6 +11,7 @@ const SelectListBox = ({
11
11
  selectionMode,
12
12
  isSearchable,
13
13
  isScrollable = true,
14
+ virtualizerOptions,
14
15
  newItemRender,
15
16
  onLoadMore,
16
17
  className,
@@ -43,52 +44,62 @@ const SelectListBox = ({
43
44
  }
44
45
  };
45
46
  return /* @__PURE__ */ jsx(
46
- ListBox,
47
+ Virtualizer,
47
48
  {
48
- ...props,
49
- "aria-label": label,
50
- selectionMode,
51
- className: clsx(
52
- "flex-1 outline-none",
53
- isScrollable ? "overflow-y-auto overflow-x-hidden" : "overflow-hidden",
54
- className
55
- ),
56
- items: listItems,
57
- selectedKeys: selectedIds,
58
- onSelectionChange,
59
- escapeKeyBehavior: "none",
60
- shouldSelectOnPressUp: true,
61
- children: ({ isSelectAllItem, isNewItem, isLoadingItem, ...item }) => {
62
- if (isSelectAllItem) {
63
- return /* @__PURE__ */ jsx(
64
- SelectListBoxItemSelectAll,
65
- {
66
- ...item
67
- },
68
- item.id
69
- );
49
+ layout: ListLayout,
50
+ layoutOptions: {
51
+ estimatedRowHeight: 40,
52
+ ...virtualizerOptions
53
+ },
54
+ children: /* @__PURE__ */ jsx(
55
+ ListBox,
56
+ {
57
+ ...props,
58
+ "aria-label": label,
59
+ selectionMode,
60
+ className: clsx(
61
+ "flex-1 outline-none",
62
+ isScrollable ? "overflow-y-auto overflow-x-hidden" : "overflow-hidden",
63
+ className
64
+ ),
65
+ items: listItems,
66
+ selectedKeys: selectedIds,
67
+ onSelectionChange,
68
+ escapeKeyBehavior: "none",
69
+ shouldSelectOnPressUp: true,
70
+ children: ({ isSelectAllItem, isNewItem, isLoadingItem, ...item }) => {
71
+ if (isSelectAllItem) {
72
+ return /* @__PURE__ */ jsx(
73
+ SelectListBoxItemSelectAll,
74
+ {
75
+ ...item
76
+ },
77
+ item.id
78
+ );
79
+ }
80
+ if (isLoadingItem) {
81
+ return /* @__PURE__ */ jsx(
82
+ SelectListBoxLoadingItem,
83
+ {
84
+ ...item,
85
+ onLoadMore
86
+ },
87
+ item.id
88
+ );
89
+ }
90
+ return /* @__PURE__ */ jsx(
91
+ SelectListBoxItem,
92
+ {
93
+ ...item,
94
+ isSearchable,
95
+ isNewItem,
96
+ newItemRender
97
+ },
98
+ item.id
99
+ );
100
+ }
70
101
  }
71
- if (isLoadingItem) {
72
- return /* @__PURE__ */ jsx(
73
- SelectListBoxLoadingItem,
74
- {
75
- ...item,
76
- onLoadMore
77
- },
78
- item.id
79
- );
80
- }
81
- return /* @__PURE__ */ jsx(
82
- SelectListBoxItem,
83
- {
84
- ...item,
85
- isSearchable,
86
- isNewItem,
87
- newItemRender
88
- },
89
- item.id
90
- );
91
- }
102
+ )
92
103
  }
93
104
  );
94
105
  };
@@ -146,6 +146,7 @@ var SelectContext;
146
146
  setIsOpen(true);
147
147
  }
148
148
  },
149
+ // oxlint-disable-next-line exhaustive-deps
149
150
  [emitStateChanges, fieldState.value, isMultiple]
150
151
  );
151
152
  const onChange = useCallback(
@@ -53,3 +53,11 @@ export interface SelectAsyncProps {
53
53
  hasLoadMore?: boolean;
54
54
  onLoadMore?: () => void;
55
55
  }
56
+ export interface SelectVirtualizationProps {
57
+ virtualizerOptions?: {
58
+ rowHeight?: number;
59
+ estimatedRowHeight?: number;
60
+ padding?: number;
61
+ gap?: number;
62
+ };
63
+ }
@@ -1,6 +1,8 @@
1
+ import { CSSProperties } from 'react';
1
2
  interface InputClearProps {
2
3
  onClear: () => void;
3
4
  className?: string;
5
+ style?: CSSProperties;
4
6
  }
5
- export declare const InputClear: ({ onClear, className }: InputClearProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const InputClear: ({ onClear, className, style }: InputClearProps) => import("react/jsx-runtime").JSX.Element;
6
8
  export {};
@@ -4,20 +4,21 @@ import { useTranslation } from "react-i18next";
4
4
  import { CloseIcon } from "../../../assets/icons/Close.js";
5
5
  import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
6
6
  import { ns } from "../../../config/i18n.js";
7
- const InputClear = ({ onClear, className }) => {
7
+ const InputClear = ({ onClear, className, style }) => {
8
8
  const { t } = useTranslation(ns);
9
9
  return /* @__PURE__ */ jsx(
10
10
  InlineIconButton,
11
11
  {
12
12
  color: "secondary",
13
13
  className: clsx(
14
- "group-hover/date-picker-content:!flex group-hover/select-content:!flex hidden items-center group-focus-within:flex group-hover:flex",
14
+ "group-hover/date-picker-content:flex! group-hover/select-content:flex! hidden! items-center group-focus-within:flex group-hover:flex",
15
15
  className
16
16
  ),
17
17
  label: t(($) => $.ui.clearAlt),
18
18
  icon: CloseIcon,
19
19
  onPress: onClear,
20
- excludeFromTabOrder: true
20
+ excludeFromTabOrder: true,
21
+ style
21
22
  }
22
23
  );
23
24
  };
@@ -1,7 +1,8 @@
1
- import { cx, cva } from "class-variance-authority";
1
+ import { cva } from "class-variance-authority";
2
+ import { clsx } from "clsx";
2
3
  import { uiOutlineClass } from "../../outline.clsx.js";
3
4
  import { UIStyle } from "../../../config/uiStyle.context.js";
4
- const inputBase = cva([uiOutlineClass, "flex w-full"], {
5
+ const inputBase = cva([uiOutlineClass, "flex w-full truncate"], {
5
6
  variants: {
6
7
  variant: {
7
8
  outlined: "",
@@ -12,8 +13,8 @@ const inputBase = cva([uiOutlineClass, "flex w-full"], {
12
13
  floating: "rounded-input-rounding-default",
13
14
  filter: "rounded-input-rounding-default",
14
15
  inline: [
15
- "rounded-input-rounding-default",
16
- "border border-transparent bg-transparent text-text-default-1",
16
+ "h-full",
17
+ "border-transparent border-b-0 bg-transparent text-text-default-1",
17
18
  "hover:border-input-outlined-outline-hover",
18
19
  "focus:border-input-outlined-outline-active",
19
20
  "invalid:border-input-outlined-outline-error",
@@ -27,10 +28,10 @@ const inputBase = cva([uiOutlineClass, "flex w-full"], {
27
28
  as: "default",
28
29
  className: [
29
30
  "border border-input-outlined-outline-idle border-solid bg-input-outlined-idle text-text-default-1",
30
- "hover:border hover:border-input-outlined-outline-hover hover:border-solid hover:bg-input-outlined-hover hover:text-text-default-1",
31
- "focus-within:border focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
32
- "invalid:border invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
33
- "disabled:border disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-1",
31
+ "hover:border-input-outlined-outline-hover hover:border-solid hover:bg-input-outlined-hover hover:text-text-default-1",
32
+ "focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
33
+ "invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
34
+ "disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-1",
34
35
  "placeholder:text-text-default-3",
35
36
  "focus-visible:outline-interactive-contained-primary-focus"
36
37
  ]
@@ -53,10 +54,10 @@ const inputBase = cva([uiOutlineClass, "flex w-full"], {
53
54
  as: "floating",
54
55
  className: [
55
56
  "border border-input-outlined-outline-idle border-solid bg-input-outlined-idle text-text-default-1",
56
- "hover:border hover:border-input-outlined-outline-hover hover:border-solid hover:bg-input-outlined-hover hover:text-text-default-1",
57
- "focus-within:border focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
58
- "invalid:border invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
59
- "disabled:border disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-1",
57
+ "hover:border-input-outlined-outline-hover hover:border-solid hover:bg-input-outlined-hover hover:text-text-default-1",
58
+ "focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
59
+ "invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
60
+ "disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-1",
60
61
  "placeholder:text-text-default-3",
61
62
  "focus-visible:outline-interactive-contained-primary-focus"
62
63
  ]
@@ -79,10 +80,10 @@ const inputBase = cva([uiOutlineClass, "flex w-full"], {
79
80
  as: "filter",
80
81
  className: [
81
82
  "border border-input-outlined-outline-idle border-solid bg-input-outlined-idle text-text-default-1",
82
- "hover:border hover:border-input-outlined-outline-hover hover:border-solid hover:bg-input-outlined-hover hover:text-text-default-1",
83
- "focus-within:border focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
84
- "invalid:border invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
85
- "disabled:border disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-1",
83
+ "hover:border-input-outlined-outline-hover hover:border-solid hover:bg-input-outlined-hover hover:text-text-default-1",
84
+ "focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
85
+ "invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
86
+ "disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-1",
86
87
  "placeholder:text-text-default-3",
87
88
  "focus-visible:outline-interactive-contained-primary-focus"
88
89
  ]
@@ -156,7 +157,7 @@ const useInputCva = () => {
156
157
  const inputBaseCva = uiStyle?.input?.baseCva ?? inputBase;
157
158
  const inputSizeCva = uiStyle?.input?.sizeCva ?? inputSize;
158
159
  return ({ className, ...rest }) => {
159
- return cx(inputBaseCva(rest), inputSizeCva(rest), className);
160
+ return clsx(inputBaseCva(rest), inputSizeCva(rest), className);
160
161
  };
161
162
  };
162
163
  export {
@@ -4,10 +4,10 @@ const labelBase = cva([], {
4
4
  variants: {
5
5
  as: {
6
6
  default: ["flex items-start gap-1"],
7
- filter: ["-translate-y-1/2 absolute top-1/2 left-input-side-default"],
7
+ filter: ["-translate-y-1/2 absolute top-1/2"],
8
8
  inline: ["flex items-start gap-1"],
9
9
  floating: [
10
- "absolute left-input-side-default transition-all duration-75",
10
+ "absolute transition-all duration-75",
11
11
  "-translate-y-1/2 top-1/2",
12
12
  "text-text-default-2 group-has-[input:disabled]/input-content:text-interactive-text-secondary-disabled",
13
13
  "group-disabled/date-picker-content:text-interactive-text-secondary-disabled",
@@ -108,6 +108,12 @@ const BottomSheetBase = ({
108
108
  drag: "y",
109
109
  dragElastic: 1,
110
110
  dragConstraints: overlayRef,
111
+ onUpdate: (latest) => {
112
+ if (!latest || !footerRef.current) {
113
+ return;
114
+ }
115
+ footerRef.current?.style.setProperty("--scroll-position", `${(latest.y || 0).toFixed(0)}px`);
116
+ },
111
117
  onDragStart: () => {
112
118
  if (document.activeElement && DomUtils.isKeyboardInput(document.activeElement)) {
113
119
  focusTrapRef.current?.focus();
@@ -177,23 +183,22 @@ const BottomSheetBase = ({
177
183
  /* @__PURE__ */ jsx("div", { className: "absolute top-full h-screen w-full bg-elevation-fill-default-1" })
178
184
  ]
179
185
  }
186
+ ),
187
+ footer && /* @__PURE__ */ jsx(
188
+ motion.div,
189
+ {
190
+ ref: footerRef,
191
+ className: clsx(
192
+ "pointer-events-auto absolute z-50 w-full bg-elevation-fill-default-2",
193
+ "top-(--visual-viewport-height) left-0 translate-y-[calc(-100%-var(--scroll-position,0px))]"
194
+ ),
195
+ children: footer
196
+ }
180
197
  )
181
198
  ] })
182
199
  }
183
200
  )
184
201
  }
185
- ),
186
- footer && /* @__PURE__ */ jsx(
187
- motion.div,
188
- {
189
- className: "absolute bottom-0 w-full bg-elevation-fill-default-2",
190
- ref: footerRef,
191
- animate: { y: 0 },
192
- initial: { y: windowHeight },
193
- exit: { y: windowHeight },
194
- transition: staticTransition,
195
- children: footer
196
- }
197
202
  )
198
203
  ]
199
204
  }
@@ -1,9 +1,11 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
2
  import { TooltipProps as AriaTooltipProps } from 'react-aria-components';
3
- export interface TooltipProps extends PropsWithChildren<AriaTooltipProps> {
3
+ import { TooltipVariantProps } from './tooltip.cva';
4
+ export interface TooltipProps extends PropsWithChildren<AriaTooltipProps>, TooltipVariantProps {
4
5
  text: ReactNode;
5
6
  isDisabled?: boolean;
6
7
  delay?: number;
7
8
  closeDelay?: number;
9
+ isNonInteractiveTrigger?: boolean;
8
10
  }
9
- export declare const Tooltip: ({ children, text, isDisabled, delay, closeDelay, ...tooltipProps }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const Tooltip: ({ children, text, isDisabled, delay, closeDelay, color, isNonInteractiveTrigger, ...tooltipProps }: TooltipProps) => import("react/jsx-runtime").JSX.Element;