@povio/ui 2.1.19 → 2.1.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.
package/README.md CHANGED
@@ -32,7 +32,7 @@ This is required for buttons to behave as expected. It is based on [Tailwind Upg
32
32
  In order for Tailwind to also compile classes for @povio/ui package, you need to include @source directive in Tailwind config.
33
33
  In your globals.css add (make sure path is correct):
34
34
  ```css
35
- @source "../../node-modules/@povio/ui/dist";
35
+ @source "../../node_modules/@povio/ui/dist";
36
36
  ```
37
37
 
38
38
  ### React Aria
@@ -22,7 +22,7 @@ var staticTransition = {
22
22
  1
23
23
  ]
24
24
  };
25
- var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = false, isScrollable = true, height = "full", label, portalContainerRef, children, footer, sheetMarginTop = 96, sheetMarginBottom = 128, shouldCloseOnInteractOutside }) => {
25
+ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = false, isScrollable = true, height = "full", label, portalContainerRef, children, footer, sheetMarginTop = 96, sheetMarginBottom = 128, shouldCloseOnInteractOutside, containerClassName }) => {
26
26
  const viewport = useViewportSize();
27
27
  const { sheetHeight, windowHeight } = useMemo(() => {
28
28
  return {
@@ -60,7 +60,7 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
60
60
  return /* @__PURE__ */ jsx(react_exports.AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(MotionModalOverlay, {
61
61
  isOpen: true,
62
62
  UNSTABLE_portalContainer: portalContainerRef?.current,
63
- className: "fixed top-0 left-0 z-10 w-screen",
63
+ className: clsx("fixed top-0 left-0 z-10 w-screen", containerClassName),
64
64
  onOpenChange,
65
65
  isDismissable,
66
66
  style: { height: viewport.height },
@@ -34,6 +34,7 @@ const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, butto
34
34
  const endDateFieldRef = useRef(null);
35
35
  const containerRef = useRef(null);
36
36
  const [labelContentRef, { width: labelWidth }] = useMeasure();
37
+ const [trailingContentRef, { width: trailingWidth }] = useMeasure();
37
38
  useImperativeHandle(ref, () => ({
38
39
  clear: () => {
39
40
  dateFieldRef.current?.clearField();
@@ -66,12 +67,19 @@ const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, butto
66
67
  };
67
68
  const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
68
69
  const style = useMemo(() => {
69
- return { paddingLeft: as === "filter" ? `calc(var(${inputSideCva({
70
- size,
71
- type: "var"
72
- })}) + ${labelWidth}px)` : "0px" };
70
+ return {
71
+ paddingLeft: as === "filter" ? `calc(var(${inputSideCva({
72
+ size,
73
+ type: "var"
74
+ })}) + ${labelWidth}px)` : "0px",
75
+ paddingRight: `calc(var(${inputSideCva({
76
+ size,
77
+ type: "var"
78
+ })}) + ${trailingWidth}px)`
79
+ };
73
80
  }, [
74
81
  labelWidth,
82
+ trailingWidth,
75
83
  as,
76
84
  size,
77
85
  inputSideCva
@@ -86,6 +94,7 @@ const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, butto
86
94
  className: clsx("group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2")
87
95
  }),
88
96
  "data-rac": "",
97
+ "data-datetime-input": "",
89
98
  "data-hovered": isHovered || void 0,
90
99
  "data-disabled": isDisabled || void 0,
91
100
  "data-invalid": isInvalid || void 0,
@@ -144,7 +153,11 @@ const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, butto
144
153
  })] })] })
145
154
  ]
146
155
  })] }), /* @__PURE__ */ jsxs("div", {
147
- className: "relative z-1 flex items-center gap-2",
156
+ ref: trailingContentRef,
157
+ className: clsx("absolute top-1/2 flex -translate-y-1/2 items-center gap-2", inputSideCva({
158
+ size,
159
+ type: "right"
160
+ })),
148
161
  children: [isClearable && canClear && /* @__PURE__ */ jsx(InputClear, { onClear }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
149
162
  label: "",
150
163
  color: "secondary",
@@ -32,7 +32,7 @@ const DateTimeDialog = ({ hideSidebar, children, footer, sidebar, label, isOpen,
32
32
  isOpen,
33
33
  onOpenChange,
34
34
  sheetMarginBottom: 0,
35
- isScrollable: false,
35
+ isScrollable: true,
36
36
  height: "auto",
37
37
  isDismissable: true,
38
38
  children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -4,7 +4,7 @@ import { Table } from "./Table.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { useCallback } from "react";
6
6
  const InfiniteTable = ({ hasNextPage, isFetchingNextPage = false, fetchNextPage,...rest }) => {
7
- const { setRef } = useIntersectionObserver({
7
+ const { ref } = useIntersectionObserver({
8
8
  onIntersection: useCallback(() => {
9
9
  if (!isFetchingNextPage && hasNextPage) fetchNextPage();
10
10
  }, [
@@ -17,12 +17,7 @@ const InfiniteTable = ({ hasNextPage, isFetchingNextPage = false, fetchNextPage,
17
17
  return /* @__PURE__ */ jsxs("div", {
18
18
  className: "flex flex-col",
19
19
  children: [/* @__PURE__ */ jsx(Table, { ...rest }), (hasNextPage || isFetchingNextPage) && /* @__PURE__ */ jsx("div", {
20
- ref: (ref) => {
21
- setRef(ref);
22
- return () => {
23
- setRef(null);
24
- };
25
- },
20
+ ref,
26
21
  className: "flex justify-center py-4",
27
22
  children: /* @__PURE__ */ jsx(Loader, {})
28
23
  })]
@@ -38,7 +38,7 @@ const InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, un
38
38
  inputSideCva
39
39
  ]);
40
40
  return /* @__PURE__ */ jsxs("div", {
41
- className: clsx("group/input-content relative", { "h-full": as === "inline" }),
41
+ className: clsx("group/input-content relative", as === "inline" && "h-full"),
42
42
  children: [
43
43
  as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
44
44
  ref: labelContentRef,
@@ -7,7 +7,7 @@ import { ns } from "./i18n.js";
7
7
  import { InputClear } from "./InputClear.js";
8
8
  import { SelectInputTags } from "./SelectInputTags.js";
9
9
  import { SelectContext } from "./select.context.js";
10
- import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
11
  import { clsx } from "clsx";
12
12
  import { Button, ComboBoxStateContext, Input } from "react-aria-components";
13
13
  import { use, useMemo, useState } from "react";
@@ -83,11 +83,13 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
83
83
  "data-has-search": fieldState.searchValue !== "" || void 0,
84
84
  "data-invalid": isInvalid || void 0,
85
85
  "data-is-empty": isEmpty || void 0,
86
+ "data-select-input": "",
86
87
  ...hoverProps,
87
88
  ...focusWithinProps,
88
89
  children: [
89
90
  /* @__PURE__ */ jsxs("div", {
90
91
  className: clsx("relative flex flex-1 items-center truncate", showTags && inputSizeCva({
92
+ as,
91
93
  size,
92
94
  ...props
93
95
  })),
@@ -108,9 +110,10 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
108
110
  selectedTagsType,
109
111
  onRemove
110
112
  }), isSearchable && /* @__PURE__ */ jsx(Input, {
111
- placeholder,
113
+ placeholder: as === "floating" ? void 0 : placeholder,
112
114
  onBlur,
113
115
  className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", !showTags && inputSizeCva({
116
+ as,
114
117
  size,
115
118
  ...props,
116
119
  className: "rounded-input-rounding-default"
@@ -119,23 +122,24 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
119
122
  ...fieldProps
120
123
  })]
121
124
  }),
122
- !isSearchable && /* @__PURE__ */ jsx(Button, {
125
+ !isSearchable && /* @__PURE__ */ jsxs(Button, {
123
126
  isDisabled,
124
127
  onPress: () => setIsOpen(!isOpen),
125
128
  onBlur,
126
129
  "data-type": "select-trigger",
127
130
  className: inputSizeCva({
128
131
  size,
132
+ as,
129
133
  ...props,
130
134
  className: clsx("w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled", showTags && "absolute inset-0 z-0")
131
135
  }),
132
136
  style,
133
137
  ...fieldProps,
134
- children: (isEmpty || !isMultiple) && /* @__PURE__ */ jsxs(Typography, {
138
+ children: [(as === "floating" && isEmpty || isMultiple && !isEmpty) && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }), (isEmpty || !isMultiple) && (as !== "floating" || !isEmpty) && /* @__PURE__ */ jsxs(Typography, {
135
139
  size: "label-1",
136
140
  className: clsx("truncate empty:before:inline-block empty:before:content-['']", isEmpty && "text-text-default-3"),
137
141
  children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
138
- })
142
+ })]
139
143
  })
140
144
  ]
141
145
  }),
@@ -10,7 +10,7 @@ import { useTranslation } from "react-i18next";
10
10
  const SelectListBoxLoadingItem = ({ id, label, onLoadMore }) => {
11
11
  const { t } = useTranslation("ui");
12
12
  const { isDebouncing, isLoading, hasLoadMore } = SelectContext.useSelect();
13
- const { setRef } = useIntersectionObserver({
13
+ const { ref } = useIntersectionObserver({
14
14
  onIntersection: useCallback(() => {
15
15
  if (!isDebouncing && !isLoading && hasLoadMore) onLoadMore?.();
16
16
  }, [
@@ -27,12 +27,7 @@ const SelectListBoxLoadingItem = ({ id, label, onLoadMore }) => {
27
27
  isDisabled: true,
28
28
  className: selectListBoxItemClass,
29
29
  children: /* @__PURE__ */ jsx("div", {
30
- ref: (ref) => {
31
- setRef(ref);
32
- return () => {
33
- setRef(null);
34
- };
35
- },
30
+ ref,
36
31
  className: "flex flex-1 justify-center text-interactive-text-primary-idle",
37
32
  children: /* @__PURE__ */ jsx(Loader, {})
38
33
  })
@@ -100,8 +100,8 @@ const SelectMobile = ({ ref, error, showSelectionContent, inputClassName, contai
100
100
  }), /* @__PURE__ */ jsx(SelectListBox, {
101
101
  ...props,
102
102
  autoFocus: !isSearchable,
103
- isScrollable: false,
104
- onClose: close
103
+ onClose: close,
104
+ isScrollable: true
105
105
  })]
106
106
  })
107
107
  })]
package/dist/Table.js CHANGED
@@ -2,6 +2,7 @@ import { ChevronDownIcon } from "./ChevronDown.js";
2
2
  import { ChevronUpIcon } from "./ChevronUp.js";
3
3
  import { UIStyle } from "./uiStyle.context.js";
4
4
  import { InlineIconButton } from "./InlineIconButton.js";
5
+ import { useIntersectionObserver } from "./useIntersectionObserver.js";
5
6
  import { CellText } from "./CellText.js";
6
7
  import { DragIcon } from "./Drag.js";
7
8
  import { HeaderText } from "./HeaderText.js";
@@ -93,22 +94,27 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
93
94
  internalSelectedRows
94
95
  ]);
95
96
  const baseColumns = useMemo(() => typeof columns === "function" ? columns(i18next.t) : columns, [columns]);
97
+ const tableColumns = useMemo(() => {
98
+ if (enableDragDrop && getRowId) return [{
99
+ id: "drag-handle",
100
+ header: "",
101
+ meta: { width: "w-12" },
102
+ cell: AutoDragHandleCell,
103
+ enableSorting: false
104
+ }, ...baseColumns];
105
+ return baseColumns;
106
+ }, [
107
+ baseColumns,
108
+ enableDragDrop,
109
+ getRowId
110
+ ]);
111
+ const [isSticky, setIsSticky] = useState(false);
112
+ const { ref: stickyRef } = useIntersectionObserver({ onIntersectionChange: useCallback((entry) => {
113
+ setIsSticky(entry.intersectionRatio < 1);
114
+ }, []) });
96
115
  const table = useReactTable({
97
116
  data,
98
- columns: useMemo(() => {
99
- if (enableDragDrop && getRowId) return [{
100
- id: "drag-handle",
101
- header: "",
102
- meta: { width: "w-12" },
103
- cell: AutoDragHandleCell,
104
- enableSorting: false
105
- }, ...baseColumns];
106
- return baseColumns;
107
- }, [
108
- baseColumns,
109
- enableDragDrop,
110
- getRowId
111
- ]),
117
+ columns: tableColumns,
112
118
  state: {
113
119
  sorting,
114
120
  columnOrder,
@@ -165,9 +171,13 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
165
171
  const tableElement = /* @__PURE__ */ jsxs("table", {
166
172
  className: clsx("w-full", className),
167
173
  ...listeners,
168
- children: [/* @__PURE__ */ jsx("thead", {
169
- className: "sticky top-0 z-10 bg-elevation-fill-default-1 shadow-2",
170
- children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
174
+ children: [/* @__PURE__ */ jsxs("thead", {
175
+ className: "group/table-head sticky top-0 z-10 data-is-sticky:shadow-2",
176
+ "data-is-sticky": isSticky || void 0,
177
+ children: [/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("th", {
178
+ ref: stickyRef,
179
+ className: "-mt-px block"
180
+ }) }), table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
171
181
  className: clsx(tableHeadRowCva({})),
172
182
  children: headerGroup.headers.filter((header) => {
173
183
  if (isAnyRowSelected && header.index > 0) return false;
@@ -196,7 +206,7 @@ const Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, clas
196
206
  })
197
207
  }, header.id);
198
208
  })
199
- }, headerGroup.id))
209
+ }, headerGroup.id))]
200
210
  }), /* @__PURE__ */ jsx("tbody", {
201
211
  ref,
202
212
  className: "relative",
package/dist/TextInput.js CHANGED
@@ -70,7 +70,7 @@ var TextInputBase = (props) => {
70
70
  ...formFieldProps,
71
71
  as,
72
72
  labelProps,
73
- className: clsx("group w-full", { "h-full": as === "inline" }, className),
73
+ className: clsx("group w-full", as === "inline" && "h-full", className),
74
74
  tabIndex: as === "inline" ? -1 : void 0,
75
75
  children: /* @__PURE__ */ jsx(InputContent, {
76
76
  ...inputContentProps,
@@ -20,14 +20,22 @@ const TimePickerInput = ({ ref, as, fieldProps, state, isDisabled, isDirty, isIn
20
20
  const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
21
21
  const { isFocusVisible } = useFocusVisible();
22
22
  const [labelContentRef, { width: labelWidth }] = useMeasure();
23
+ const [trailingContentRef, { width: trailingWidth }] = useMeasure();
23
24
  const hidePlaceholder = as === "floating" && !state.value && !isFocused;
24
25
  const style = useMemo(() => {
25
- return { paddingLeft: as === "filter" ? `calc(var(${inputSideCva({
26
- size,
27
- type: "var"
28
- })}) + ${labelWidth}px)` : "0px" };
26
+ return {
27
+ paddingLeft: as === "filter" ? `calc(var(${inputSideCva({
28
+ size,
29
+ type: "var"
30
+ })}) + ${labelWidth}px)` : "0px",
31
+ paddingRight: `calc(var(${inputSideCva({
32
+ size,
33
+ type: "var"
34
+ })}) + ${trailingWidth}px)`
35
+ };
29
36
  }, [
30
37
  labelWidth,
38
+ trailingWidth,
31
39
  as,
32
40
  size,
33
41
  inputSideCva
@@ -43,6 +51,7 @@ const TimePickerInput = ({ ref, as, fieldProps, state, isDisabled, isDirty, isIn
43
51
  className: clsx("group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2")
44
52
  }),
45
53
  "data-rac": "",
54
+ "data-datetime-input": "",
46
55
  "data-hovered": isHovered || void 0,
47
56
  "data-disabled": isDisabled || void 0,
48
57
  "data-invalid": isInvalid || void 0,
@@ -78,7 +87,11 @@ const TimePickerInput = ({ ref, as, fieldProps, state, isDisabled, isDirty, isIn
78
87
  })
79
88
  })
80
89
  ] }), /* @__PURE__ */ jsxs("div", {
81
- className: clsx("relative z-1 flex items-center gap-2", as === "floating" && "-mt-4"),
90
+ ref: trailingContentRef,
91
+ className: clsx("absolute top-1/2 flex -translate-y-1/2 items-center gap-2", inputSideCva({
92
+ size,
93
+ type: "right"
94
+ })),
82
95
  children: [isClearable && canClear && /* @__PURE__ */ jsx(InputClear, { onClear: () => state.setValue(null) }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
83
96
  label: "",
84
97
  color: "secondary",
@@ -8,6 +8,7 @@ export interface InputBaseProps extends VariantProps<typeof inputBase> {
8
8
  }
9
9
  export declare const inputSize: (props?: ({
10
10
  size?: "default" | "small" | "extra-small" | "large" | null | undefined;
11
+ as?: "default" | "filter" | "inline" | "floating" | null | undefined;
11
12
  } & ClassProp) | undefined) => string;
12
13
  export interface InputSizeProps extends VariantProps<typeof inputSize> {
13
14
  }
@@ -14,6 +14,7 @@ interface BottomSheetBaseProps {
14
14
  sheetMarginTop?: number;
15
15
  sheetMarginBottom?: number;
16
16
  shouldCloseOnInteractOutside?: () => boolean;
17
+ containerClassName?: string;
17
18
  }
18
19
  export interface BottomSheetProps extends BottomSheetBaseProps {
19
20
  trigger?: ReactNode;
@@ -1,7 +1,8 @@
1
1
  type UseIntersectionObserverProps = {
2
2
  onIntersection?: () => void;
3
+ onIntersectionChange?: (entry: IntersectionObserverEntry) => void;
3
4
  } & IntersectionObserverInit;
4
- export declare const useIntersectionObserver: ({ onIntersection, root, rootMargin, threshold, }: UseIntersectionObserverProps) => {
5
- setRef: import('react').Dispatch<import('react').SetStateAction<Element | null>>;
5
+ export declare const useIntersectionObserver: <T extends HTMLElement>({ onIntersection, onIntersectionChange, root, rootMargin, threshold, }: UseIntersectionObserverProps) => {
6
+ ref: import('react').RefObject<T | null>;
6
7
  };
7
8
  export {};
package/dist/input.cva.js CHANGED
@@ -10,12 +10,7 @@ const inputBase = cva([uiOutlineClass, "flex w-full truncate"], {
10
10
  },
11
11
  as: {
12
12
  default: "rounded-input-rounding-default",
13
- floating: [
14
- "rounded-input-rounding-default",
15
- "py-floating-label-input-height-empty!",
16
- "group-has-[input:not(:placeholder-shown)]/input-content:pb-floating-label-input-height-filled!",
17
- "group-has-[input:not(:placeholder-shown)]/input-content:pt-[calc(var(--spacing-input-height-default)+14px)]!"
18
- ],
13
+ floating: "rounded-input-rounding-default",
19
14
  filter: "rounded-input-rounding-default",
20
15
  inline: [
21
16
  "h-full",
@@ -113,13 +108,77 @@ const inputBase = cva([uiOutlineClass, "flex w-full truncate"], {
113
108
  }
114
109
  });
115
110
  const inputSize = cva("", {
116
- variants: { size: {
117
- "extra-small": "px-input-side-default py-input-height-default text-label-1",
118
- small: "px-input-side-default py-input-height-default text-label-1",
119
- default: "px-input-side-default py-input-height-default text-label-1",
120
- large: "px-input-side-default py-input-height-default text-label-1"
121
- } },
122
- defaultVariants: { size: "default" }
111
+ variants: {
112
+ size: {
113
+ "extra-small": "text-label-1",
114
+ small: "text-label-1",
115
+ default: "text-label-1",
116
+ large: "text-label-1"
117
+ },
118
+ as: {
119
+ default: "",
120
+ floating: [
121
+ "px-input-side-default",
122
+ "py-floating-label-input-height-empty!",
123
+ "group-has-[input:not(:placeholder-shown)]/input-content:pb-floating-label-input-height-filled!",
124
+ "group-has-[input:not(:placeholder-shown)]/input-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!",
125
+ "group-has-[input:not(:placeholder-shown)]/select-content:pb-floating-label-input-height-filled!",
126
+ "group-has-[input:not(:placeholder-shown)]/select-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!",
127
+ "group-data-[has-selection]/select-content:pb-floating-label-input-height-filled!",
128
+ "group-data-[has-selection]/select-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!",
129
+ "group-data-[has-search]/select-content:pb-floating-label-input-height-filled!",
130
+ "group-data-[has-search]/select-content:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!",
131
+ "data-[datetime-input]:data-[has-selection]:pb-floating-label-input-height-filled!",
132
+ "data-[datetime-input]:data-[has-selection]:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!",
133
+ "data-[datetime-input]:data-[focus-within]:pb-floating-label-input-height-filled!",
134
+ "data-[datetime-input]:data-[focus-within]:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--text-label-3--line-height)*var(--text-label-3))]!"
135
+ ],
136
+ filter: "",
137
+ inline: ""
138
+ }
139
+ },
140
+ compoundVariants: [
141
+ {
142
+ as: [
143
+ "default",
144
+ "filter",
145
+ "inline"
146
+ ],
147
+ size: "extra-small",
148
+ className: "px-input-side-default py-input-height-default text-label-1"
149
+ },
150
+ {
151
+ as: [
152
+ "default",
153
+ "filter",
154
+ "inline"
155
+ ],
156
+ size: "small",
157
+ className: "px-input-side-default py-input-height-default text-label-1"
158
+ },
159
+ {
160
+ as: [
161
+ "default",
162
+ "filter",
163
+ "inline"
164
+ ],
165
+ size: "default",
166
+ className: "px-input-side-default py-input-height-default text-label-1"
167
+ },
168
+ {
169
+ as: [
170
+ "default",
171
+ "filter",
172
+ "inline"
173
+ ],
174
+ size: "large",
175
+ className: "px-input-side-default py-input-height-default text-label-1"
176
+ }
177
+ ],
178
+ defaultVariants: {
179
+ size: "default",
180
+ as: "default"
181
+ }
123
182
  });
124
183
  const inputSide = cva("", {
125
184
  variants: {
package/dist/label.cva.js CHANGED
@@ -1,64 +1,52 @@
1
1
  import { compoundMapper } from "./compoundMapper.js";
2
2
  import { cva } from "class-variance-authority";
3
- const labelBase = cva("text-text-default-1", {
3
+ const labelBase = cva("", {
4
4
  variants: { as: {
5
- default: ["flex items-start gap-1"],
6
- filter: ["absolute top-1/2 -translate-y-1/2"],
7
- inline: ["flex items-start gap-1"],
5
+ default: ["flex items-start gap-1 text-text-default-1"],
6
+ filter: ["absolute top-1/2 -translate-y-1/2 text-text-default-1"],
7
+ inline: ["flex items-start gap-1 text-text-default-1"],
8
8
  floating: [
9
9
  "pointer-events-none",
10
10
  "absolute transition-all duration-75",
11
11
  "top-1/2 -translate-y-1/2",
12
- "text-text-default-2 group-has-[input:disabled]/input-content:text-interactive-text-secondary-disabled",
12
+ "text-text-default-3 group-has-[input:disabled]/input-content:text-interactive-text-secondary-disabled",
13
13
  "group-disabled/date-picker-content:text-interactive-text-secondary-disabled",
14
14
  "group-disabled/text-editor:text-interactive-text-secondary-disabled",
15
15
  "group-has-[input:disabled]/select-content:text-interactive-text-secondary-disabled",
16
16
  "group-has-[textarea:disabled]/text-area:text-interactive-text-secondary-disabled",
17
- "group-data-[text-area]/text-area:top-5 group-data-[text-area]/text-area:translate-y-0",
18
- "group-data-[text-editor]/text-editor:top-5 group-data-[text-editor]/text-editor:left-2 group-data-[text-editor]/text-editor:translate-y-0",
17
+ "group-data-[text-area]/text-area:top-floating-label-input-height-empty group-data-[text-area]/text-area:translate-y-0",
18
+ "group-data-[text-editor]/text-editor:top-floating-label-input-height-empty group-data-[text-editor]/text-editor:left-input-side-default group-data-[text-editor]/text-editor:translate-y-0",
19
19
  "group-has-[input:not(:placeholder-shown)]/input-content:top-floating-label-input-height-filled group-has-[input:not(:placeholder-shown)]/input-content:translate-y-0",
20
- "group-has-[textarea:not(:placeholder-shown)]/text-area:top-floating-label-input-height-filled group-has-[textarea:not(:placeholder-shown)]/text-area:translate-y-0",
21
- "group-data-[is-filled=true]/text-editor:top-floating-label-input-height-filled group-data-[is-filled=true]/text-editor:translate-y-0",
20
+ "group-has-[textarea:not(:placeholder-shown)]/text-area:hidden",
21
+ "group-has-[textarea:placeholder-shown]/text-area:text-text-default-3",
22
+ "group-has-[textarea:placeholder-shown]/text-area:font-medium!",
23
+ "group-data-[is-filled=true]/text-editor:hidden",
24
+ "group-has-[data-text-editor:placeholder-shown]/text-editor:text-text-default-3",
25
+ "group-has-[data-text-editor:placeholder-shown]/text-editor:font-medium!",
22
26
  "group-data-[has-selection]/date-picker-content:top-1 group-data-[has-selection]/date-picker-content:translate-y-0",
23
27
  "group-focus-within/date-picker-content:top-1 group-focus-within/date-picker-content:translate-y-0",
24
28
  "group-data-[has-selection]/select-content:top-1 group-data-[has-selection]/select-content:translate-y-0",
25
29
  "group-data-[searchable-focus-within]/select-content:top-1 group-data-[searchable-focus-within]/select-content:translate-y-0",
26
30
  "group-data-[has-search]/select-content:top-1 group-data-[has-search]/select-content:translate-y-0",
27
31
  "group-has-[input:placeholder-shown]/input-content:text-text-default-3",
28
- "group-has-[input:placeholder-shown]/input-content:!font-medium",
29
- "group-has-[input:not(:placeholder-shown)]/input-content:!font-semibold",
30
- "group-has-[input:not(:placeholder-shown)]/input-content:!text-label-3",
32
+ "group-has-[input:placeholder-shown]/input-content:font-medium!",
33
+ "group-has-[input:not(:placeholder-shown)]/input-content:font-semibold!",
34
+ "group-has-[input:not(:placeholder-shown)]/input-content:text-label-3!",
31
35
  "group-has-[input:not(:placeholder-shown)]/input-content:text-text-default-1",
32
- "group-has-[textarea:placeholder-shown]/text-area:text-text-default-3",
33
- "group-has-[textarea:placeholder-shown]/text-area:!font-medium",
34
- "group-has-[textarea:not(placeholder-shown)]/text-area:!font-semibold",
35
- "group-has-[textarea:not(:placeholder-shown)]/text-area:!text-label-3",
36
- "group-has-[textarea:not(placeholder-shown)]/text-area:text-text-default-1",
37
- "group-focus-within/text-area:!text-text-default-1",
38
- "group-focus-within/text-area:text-label-3",
39
- "group-has-[textarea:focus-within]/text-area:!font-semibold",
40
- "group-has-[data-text-editor:placeholder-shown]/text-editor:text-text-default-3",
41
- "group-has-[data-text-editor:placeholder-shown]/text-editor:!font-medium",
42
- "group-data-[is-filled=true]/text-editor:!font-semibold",
43
- "group-data-[is-filled=true]/text-editor:!text-label-3",
44
- "group-data-[is-filled=true]/text-editor:text-text-default-1",
45
- "group-focus-within/text-editor:!text-text-default-1",
46
- "group-focus-within/text-editor:text-label-3",
47
- "group-has-[data-text-editor:focus-within]/text-editor:!font-semibold",
48
- "group-data-[has-selection]/date-picker-content:!font-semibold",
49
- "group-data-[has-selection]/date-picker-content:!text-label-3",
36
+ "group-data-[has-selection]/date-picker-content:font-semibold!",
37
+ "group-data-[has-selection]/date-picker-content:text-label-3!",
50
38
  "group-data-[has-selection]/date-picker-content:text-text-default-1",
51
- "group-focus-within/date-picker-content:!font-semibold",
52
- "group-focus-within/date-picker-content:!text-label-3",
39
+ "group-focus-within/date-picker-content:font-semibold!",
40
+ "group-focus-within/date-picker-content:text-label-3!",
53
41
  "group-focus-within/date-picker-content:text-text-default-1",
54
- "group-data-[has-selection]/select-content:!font-semibold",
55
- "group-data-[has-selection]/select-content:!text-label-3",
42
+ "group-data-[has-selection]/select-content:font-semibold!",
43
+ "group-data-[has-selection]/select-content:text-label-3!",
56
44
  "group-data-[has-selection]/select-content:text-text-default-1",
57
- "group-data-[searchable-focus-within]/select-content:!font-semibold",
58
- "group-data-[searchable-focus-within]/select-content:!text-label-3",
45
+ "group-data-[searchable-focus-within]/select-content:font-semibold!",
46
+ "group-data-[searchable-focus-within]/select-content:text-label-3!",
59
47
  "group-data-[searchable-focus-within]/select-content:text-text-default-1",
60
- "group-data-[has-search]/select-content:!font-semibold",
61
- "group-data-[has-search]/select-content:!text-label-3",
48
+ "group-data-[has-search]/select-content:font-semibold!",
49
+ "group-data-[has-search]/select-content:text-label-3!",
62
50
  "group-data-[has-search]/select-content:text-text-default-1"
63
51
  ]
64
52
  } },
package/dist/table.cva.js CHANGED
@@ -12,7 +12,7 @@ const tableRow = cva([
12
12
  odd: "odd:bg-elevation-fill-inverted-4/5"
13
13
  } } });
14
14
  const tableHeadRow = cva(["h-8 w-full"]);
15
- const tableHeadData = cva(["border-b border-b-elevation-outline-default-1 border-solid bg-elevation-fill-default-1 px-table-header-cell-container-side-default py-table-header-cell-container-height-default text-left"], {
15
+ const tableHeadData = cva(["border-b border-b-elevation-outline-default-1 border-solid bg-elevation-fill-default-1 px-table-header-cell-container-side-default py-table-header-cell-container-height-default text-left", "group-data-[is-sticky=true]/table-head:bg-elevation-fill-default-1"], {
16
16
  variants: { hasRightBorder: {
17
17
  true: "border-l border-l-elevation-outline-default-1 border-solid",
18
18
  false: ""
@@ -1,23 +1,23 @@
1
- import { useEffect, useState } from "react";
2
- const useIntersectionObserver = ({ onIntersection, root, rootMargin, threshold }) => {
3
- const [ref, setRef] = useState(null);
1
+ import { useEffect, useRef } from "react";
2
+ const useIntersectionObserver = ({ onIntersection, onIntersectionChange, root, rootMargin, threshold }) => {
3
+ const ref = useRef(null);
4
4
  useEffect(() => {
5
5
  const observer = new IntersectionObserver((entries) => {
6
6
  if (entries.some((entry) => entry.isIntersecting)) onIntersection?.();
7
+ onIntersectionChange?.(entries[0]);
7
8
  }, {
8
9
  root,
9
10
  rootMargin,
10
11
  threshold
11
12
  });
12
- if (ref) observer.observe(ref);
13
+ if (ref.current) observer.observe(ref.current);
13
14
  return () => observer.disconnect();
14
15
  }, [
15
16
  ref,
16
17
  root,
17
- rootMargin,
18
- threshold,
19
- onIntersection
18
+ onIntersection,
19
+ onIntersectionChange
20
20
  ]);
21
- return { setRef };
21
+ return { ref };
22
22
  };
23
23
  export { useIntersectionObserver };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.1.19",
3
+ "version": "2.1.20",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",