@povio/ui 0.0.9 → 0.0.10

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 (31) hide show
  1. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +53 -45
  2. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +86 -77
  3. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +63 -55
  4. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +46 -38
  5. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +1 -0
  6. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +1 -0
  7. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +1 -1
  8. package/dist/components/inputs/Input/NumberInput/NumberInput.js +30 -21
  9. package/dist/components/inputs/Input/TextArea/TextArea.js +41 -32
  10. package/dist/components/inputs/Input/TextInput/TextInput.js +32 -40
  11. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -0
  12. package/dist/components/inputs/Selection/shared/SelectBase.js +3 -1
  13. package/dist/components/inputs/Selection/shared/SelectDesktop.js +72 -60
  14. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  15. package/dist/components/inputs/Selection/shared/SelectInput.js +3 -0
  16. package/dist/components/inputs/Selection/shared/SelectInputTags.d.ts +2 -1
  17. package/dist/components/inputs/Selection/shared/SelectInputTags.js +43 -16
  18. package/dist/components/inputs/Selection/shared/SelectListBox.js +74 -55
  19. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +1 -1
  20. package/dist/components/inputs/Selection/shared/SelectMobile.js +6 -2
  21. package/dist/components/inputs/shared/TooltipWrapper.d.ts +8 -0
  22. package/dist/components/inputs/shared/TooltipWrapper.js +21 -0
  23. package/dist/components/inputs/shared/label.cva.js +1 -1
  24. package/dist/components/overlays/Tooltip/Tooltip.d.ts +2 -1
  25. package/dist/components/overlays/Tooltip/Tooltip.js +4 -2
  26. package/dist/components/table/HeaderText.js +1 -1
  27. package/dist/components/table/table.cva.js +6 -6
  28. package/dist/config/uiConfig.context.d.ts +1 -1
  29. package/dist/config/uiConfig.context.js +2 -1
  30. package/dist/hooks/useTableNav.js +0 -15
  31. package/package.json +1 -1
@@ -0,0 +1,21 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Tooltip } from "../../overlays/Tooltip/Tooltip.js";
3
+ const TooltipWrapper = (props) => {
4
+ if (props.as !== "inline") {
5
+ return props.children;
6
+ }
7
+ return /* @__PURE__ */ jsx(
8
+ Tooltip,
9
+ {
10
+ text: props.error || void 0,
11
+ placement: "bottom",
12
+ color: "error",
13
+ hidden: !props.error,
14
+ isNonInteractiveTrigger: true,
15
+ children: /* @__PURE__ */ jsx("div", { children: props.children })
16
+ }
17
+ );
18
+ };
19
+ export {
20
+ TooltipWrapper
21
+ };
@@ -1,6 +1,6 @@
1
1
  import { cva } from "class-variance-authority";
2
2
  import { compoundMapper } from "../../../utils/compoundMapper.js";
3
- const labelBase = cva([], {
3
+ const labelBase = cva("text-text-default-1", {
4
4
  variants: {
5
5
  as: {
6
6
  default: ["flex items-start gap-1"],
@@ -7,5 +7,6 @@ export interface TooltipProps extends PropsWithChildren<AriaTooltipProps>, Toolt
7
7
  delay?: number;
8
8
  closeDelay?: number;
9
9
  isNonInteractiveTrigger?: boolean;
10
+ triggerClassName?: string;
10
11
  }
11
- export declare const Tooltip: ({ children, text, isDisabled, delay, closeDelay, color, isNonInteractiveTrigger, ...tooltipProps }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const Tooltip: ({ children, text, isDisabled, delay, closeDelay, color, isNonInteractiveTrigger, triggerClassName, ...tooltipProps }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ import { PointerHorizontalIcon } from "../../../assets/icons/PointerHorizontal.j
6
6
  import { PointerVerticalIcon } from "../../../assets/icons/PointerVertical.js";
7
7
  import { tooltipCva, tooltipPointerHorizontalCva, tooltipPointerVerticalCva, tooltipTextCva } from "./tooltip.cva.js";
8
8
  import { Typography } from "../../text/Typography/Typography.js";
9
- const CustomTrigger = ({ children }) => {
9
+ const CustomTrigger = ({ children, className }) => {
10
10
  const ref = useRef(null);
11
11
  const { focusableProps } = useFocusable({}, ref);
12
12
  return /* @__PURE__ */ jsx(
@@ -15,6 +15,7 @@ const CustomTrigger = ({ children }) => {
15
15
  ref,
16
16
  ...focusableProps,
17
17
  tabIndex: 0,
18
+ className,
18
19
  children
19
20
  }
20
21
  );
@@ -27,6 +28,7 @@ const Tooltip = ({
27
28
  closeDelay,
28
29
  color,
29
30
  isNonInteractiveTrigger,
31
+ triggerClassName,
30
32
  ...tooltipProps
31
33
  }) => {
32
34
  const Trigger = isNonInteractiveTrigger ? CustomTrigger : Fragment;
@@ -37,7 +39,7 @@ const Tooltip = ({
37
39
  closeDelay: closeDelay ?? 0,
38
40
  isDisabled,
39
41
  children: [
40
- /* @__PURE__ */ jsx(Trigger, { children }),
42
+ /* @__PURE__ */ jsx(Trigger, { className: triggerClassName, children }),
41
43
  /* @__PURE__ */ jsxs(
42
44
  Tooltip$1,
43
45
  {
@@ -4,7 +4,7 @@ const HeaderText = ({ children }) => /* @__PURE__ */ jsx(
4
4
  Typography,
5
5
  {
6
6
  variant: "default",
7
- size: "label-2",
7
+ size: "label-1",
8
8
  as: "span",
9
9
  className: "overflow-hidden text-ellipsis px-table-cell-content-side-m py-table-cell-content-height-m text-text-default-1",
10
10
  children
@@ -20,7 +20,9 @@ const tableRow = cva(
20
20
  );
21
21
  const tableHeadRow = cva(["h-8 w-full"]);
22
22
  const tableHeadData = cva(
23
- ["border-b border-b-elevation-outline-default-1 border-solid px-table-header-cell-container-side-default text-left"],
23
+ [
24
+ "border-b border-b-elevation-outline-default-1 border-solid px-table-header-cell-container-side-default py-table-header-cell-container-height-default text-left"
25
+ ],
24
26
  {
25
27
  variants: {
26
28
  hasRightBorder: {
@@ -37,11 +39,9 @@ const tableData = cva(
37
39
  [
38
40
  "relative h-0-5 overflow-hidden text-ellipsis whitespace-nowrap border-t border-t-transparent px-2 py-2",
39
41
  "border-b border-b-elevation-outline-default-1",
40
- "has-[input[data-invalid]]:border-b-input-outlined-outline-error!",
41
- "has-[input]:hover:border-b-input-outlined-outline-hover",
42
- "has-[input]:focus:border-b-input-outlined-outline-active",
43
- "has-[input]:invalid:border-b-input-outlined-outline-error",
44
- "has-[input]:disabled:hover:border-transparent"
42
+ "has-[*>[data-hovered]:not([data-disabled])]:hover:border-b-input-outlined-outline-hover",
43
+ "has-[*>[data-invalid]]:border-b-input-outlined-outline-error!",
44
+ "has-[*>[data-focused]]:border-b-input-outlined-outline-active"
45
45
  ],
46
46
  {
47
47
  variants: {
@@ -16,7 +16,7 @@ export declare namespace UIConfig {
16
16
  numberInput: Pick<NumberInputProps, "formatOptions">;
17
17
  radioGroup: Pick<RadioGroupProps, "variant" | "hideLabel">;
18
18
  checkbox: Pick<CheckboxProps, "variant">;
19
- select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "selectedTagsType">;
19
+ select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType">;
20
20
  toggle: Pick<ToggleProps, "variant">;
21
21
  slider: Pick<SliderProps, "minValue" | "maxValue">;
22
22
  dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros">;
@@ -28,7 +28,8 @@ var UIConfig;
28
28
  select: {
29
29
  selectionMode: "single",
30
30
  isSearchable: false,
31
- selectedTagsType: "list"
31
+ selectedTagsType: "list",
32
+ collapseAfter: 3
32
33
  },
33
34
  toggle: {
34
35
  variant: "default"
@@ -49,9 +49,7 @@ class DataGridNav {
49
49
  }
50
50
  /** Used as a keyboard listener for key down */
51
51
  tableKeyDown(e) {
52
- this.debugLog("tableKeyDown", `Key pressed: ${e.key}`);
53
52
  if (this.disabled) {
54
- this.debugLog("tableKeyDown", "interaction is disabled");
55
53
  return;
56
54
  }
57
55
  if ("ArrowDown" === e.key || "ArrowUp" === e.key || "ArrowLeft" === e.key || "ArrowRight" === e.key) {
@@ -65,14 +63,11 @@ class DataGridNav {
65
63
  }
66
64
  const cell = e.target.parentElement?.closest(`${this.selectors.Cell},${this.selectors.Row}`);
67
65
  if (!cell) {
68
- this.debugLog("tableKeyDown", "cell not found");
69
66
  return;
70
67
  }
71
68
  if (cell.matches(this.selectors.Cell)) {
72
- this.debugLog("tableKeyDown", "event captured in cell");
73
69
  this.cellNavigation(e);
74
70
  } else {
75
- this.debugLog("tableKeyDown", "event captured in cell");
76
71
  this.gridNavigation(e);
77
72
  }
78
73
  }
@@ -93,7 +88,6 @@ class DataGridNav {
93
88
  if (e.key === "ArrowRight" || e.key === "ArrowDown") {
94
89
  const cell = e.target.closest(this.selectors.Cell);
95
90
  if (!cell) {
96
- this.debugLog("cellNavigation", "cell not found");
97
91
  return;
98
92
  }
99
93
  const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
@@ -108,7 +102,6 @@ class DataGridNav {
108
102
  if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
109
103
  const cell = e.target.closest(this.selectors.Cell);
110
104
  if (!cell) {
111
- this.debugLog("cellNavigation", "cell not found");
112
105
  return;
113
106
  }
114
107
  const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
@@ -204,7 +197,6 @@ class DataGridNav {
204
197
  const row = e.target.closest(this.selectors.Row);
205
198
  const siblings = row.parentElement?.children;
206
199
  if (!siblings) {
207
- this.debugLog("cellNavigation", "siblings not found");
208
200
  return;
209
201
  }
210
202
  const rowToFocus = secondKey === "Home" ? siblings[0] : siblings[siblings.length - 1];
@@ -225,13 +217,11 @@ class DataGridNav {
225
217
  if (row && cell) {
226
218
  const position = this.getColumnIndex(cell);
227
219
  if (position === void 0) {
228
- this.debugLog("cellNavigation", "position not found");
229
220
  return;
230
221
  }
231
222
  const direction = e.key === "PageUp" ? "prev" : "next";
232
223
  const siblings = row.parentElement?.children;
233
224
  if (!siblings) {
234
- this.debugLog("cellNavigation", "siblings not found");
235
225
  return;
236
226
  }
237
227
  let destinationRow;
@@ -270,10 +260,7 @@ class DataGridNav {
270
260
  if (row && cell) {
271
261
  const cellPosition = this.getColumnIndex(cell);
272
262
  const rowPosition = this.getRowIndex(row);
273
- this.debugLog("gridNavigation", `Initial row position: ${rowPosition}`);
274
- this.debugLog("gridNavigation", `Initial cell position: ${cellPosition}`);
275
263
  if (cellPosition === void 0 || rowPosition === void 0) {
276
- this.debugLog("verticalCellNavigation", "row or cell position not found");
277
264
  return;
278
265
  }
279
266
  const direction = e.key === "ArrowUp" ? "prev" : "next";
@@ -346,7 +333,6 @@ class DataGridNav {
346
333
  position++;
347
334
  }
348
335
  if (siblings[position] === void 0) {
349
- this.debugLog("getColumnIndex", "position finding was not successful");
350
336
  return void 0;
351
337
  }
352
338
  return position;
@@ -365,7 +351,6 @@ class DataGridNav {
365
351
  position++;
366
352
  }
367
353
  if (siblings[position] === void 0) {
368
- this.debugLog("getRowIndex", "position finding was not successful");
369
354
  return void 0;
370
355
  }
371
356
  return position;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",