@povio/ui 2.1.12 → 2.1.14

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/Menu/menu.cva.js +2 -2
  2. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +2 -0
  3. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +7 -2
  4. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +2 -0
  5. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +6 -1
  6. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +2 -0
  7. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +7 -2
  8. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +2 -0
  9. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +12 -28
  10. package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
  11. package/dist/components/inputs/DateTime/shared/DateField.js +19 -4
  12. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +4 -1
  13. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +53 -22
  14. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +2 -2
  15. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +3 -1
  16. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +32 -22
  17. package/dist/components/inputs/File/FileUpload.js +62 -59
  18. package/dist/components/inputs/File/InputUpload.js +19 -21
  19. package/dist/components/inputs/File/fileUpload.types.d.ts +2 -0
  20. package/dist/components/inputs/File/inputUpload.types.d.ts +2 -0
  21. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +8 -11
  22. package/dist/components/inputs/shared/input.cva.js +11 -11
  23. package/dist/components/overlays/Modal/Modal.d.ts +2 -1
  24. package/dist/components/overlays/Modal/Modal.js +4 -2
  25. package/dist/components/table/Table.js +1 -1
  26. package/dist/components/table/table.cva.js +1 -1
  27. package/dist/config/uiConfig.context.d.ts +1 -1
  28. package/dist/config/uiConfig.context.js +2 -1
  29. package/dist/hooks/useBreakpoint.d.ts +1 -1
  30. package/dist/hooks/useBreakpoint.js +8 -0
  31. package/package.json +1 -1
@@ -16,10 +16,10 @@ const menuItemCva = cva(
16
16
  "border-b border-b-elevation-outline-default-1 outline-none last:border-b-0",
17
17
  "bg-elevation-fill-default-1 text-interactive-text-secondary-idle",
18
18
  "disabled:cursor-default disabled:text-interactive-text-secondary-disabled",
19
- "hover:bg-elevation-fill-default-1 hover:text-interactive-text-secondary-hover",
19
+ "hover:bg-elevation-fill-default-2 hover:text-interactive-text-secondary-hover",
20
20
  "open:bg-interactive-contained-primary-idle open:text-interactive-contained-primary-on-idle",
21
21
  "open:hover:bg-interactive-contained-primary-hover open:hover:text-interactive-contained-primary-on-hover",
22
- "focus-visible:bg-elevation-fill-default-1 focus-visible:text-interactive-text-secondary-hover"
22
+ "focus-visible:bg-elevation-fill-default-2 focus-visible:text-interactive-text-secondary-hover"
23
23
  ],
24
24
  {
25
25
  variants: {
@@ -11,6 +11,8 @@ interface DatePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<Da
11
11
  isClearable?: boolean;
12
12
  className?: string;
13
13
  todayIcon?: boolean;
14
+ disableManualEntry?: boolean;
15
+ placeholder?: string;
14
16
  }
15
17
  export interface DatePickerProps extends Omit<DatePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue"> {
16
18
  value?: string | null;
@@ -34,6 +34,7 @@ const DatePickerBase = (props) => {
34
34
  value,
35
35
  disableDropdown,
36
36
  className,
37
+ placeholder,
37
38
  as = ui.input.as,
38
39
  hideLabel = ui.input.hideLabel,
39
40
  variant = ui.input.variant,
@@ -41,6 +42,7 @@ const DatePickerBase = (props) => {
41
42
  isClearable = ui.input.isClearable,
42
43
  todayIcon = ui.dateInput.todayIcon,
43
44
  shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros,
45
+ disableManualEntry = ui.dateInput.disableManualEntry,
44
46
  ...rest
45
47
  } = props;
46
48
  const formFieldProps = {
@@ -138,16 +140,19 @@ const DatePickerBase = (props) => {
138
140
  fieldProps: { ...fieldProps, placeholderValue: PLACEHOLDER_VALUE },
139
141
  buttonProps,
140
142
  isDisabled,
143
+ disableManualEntry,
141
144
  isInvalid: !!error,
142
145
  disableDropdown,
143
146
  variant,
144
147
  size,
145
148
  isClearable,
146
149
  headerProps,
147
- todayIcon
150
+ todayIcon,
151
+ onOpenDropdown: () => state.toggle(),
152
+ placeholder
148
153
  }
149
154
  ),
150
- !disableDropdown && /* @__PURE__ */ jsx(
155
+ (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(
151
156
  DateTimeDialog,
152
157
  {
153
158
  footer: /* @__PURE__ */ jsx(
@@ -13,6 +13,8 @@ interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Om
13
13
  hideSidebar?: boolean;
14
14
  className?: string;
15
15
  todayIcon?: boolean;
16
+ disableManualEntry?: boolean;
17
+ placeholder?: string;
16
18
  }
17
19
  export interface DateRangePickerProps extends Omit<DateRangePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue"> {
18
20
  value?: {
@@ -40,6 +40,7 @@ const DateRangePickerBase = (props) => {
40
40
  disableDropdown,
41
41
  className,
42
42
  hideSidebar,
43
+ placeholder,
43
44
  hideLabel = ui.input.hideLabel,
44
45
  variant = ui.input.variant,
45
46
  as = ui.input.as,
@@ -47,6 +48,7 @@ const DateRangePickerBase = (props) => {
47
48
  isClearable = ui.input.isClearable,
48
49
  todayIcon = ui.dateInput.todayIcon,
49
50
  shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros,
51
+ disableManualEntry = ui.dateInput.disableManualEntry,
50
52
  ...rest
51
53
  } = props;
52
54
  const [validationRangeError, setValidationRangeError] = useState();
@@ -523,7 +525,10 @@ const DateRangePickerBase = (props) => {
523
525
  size,
524
526
  isClearable,
525
527
  headerProps,
526
- todayIcon
528
+ todayIcon,
529
+ disableManualEntry,
530
+ placeholder,
531
+ onOpenDropdown: () => state.toggle()
527
532
  }
528
533
  ),
529
534
  /* @__PURE__ */ jsx(
@@ -11,6 +11,8 @@ interface DateTimePickerBaseProps extends FormFieldProps, InputVariantProps, Omi
11
11
  isTimeOptional?: boolean;
12
12
  isClearable?: boolean;
13
13
  todayIcon?: boolean;
14
+ disableManualEntry?: boolean;
15
+ placeholder?: string;
14
16
  }
15
17
  export interface DateTimePickerProps extends Omit<DateTimePickerBaseProps, "value" | "onChange"> {
16
18
  value?: string | null;
@@ -32,6 +32,7 @@ const DateTimePickerBase = (props) => {
32
32
  value,
33
33
  disableDropdown,
34
34
  isTimeOptional,
35
+ placeholder,
35
36
  hideLabel = ui.input.hideLabel,
36
37
  variant = ui.input.variant,
37
38
  as = ui.input.as,
@@ -39,6 +40,7 @@ const DateTimePickerBase = (props) => {
39
40
  isClearable = ui.input.isClearable,
40
41
  todayIcon = ui.dateInput.todayIcon,
41
42
  shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros,
43
+ disableManualEntry = ui.dateInput.disableManualEntry,
42
44
  ...rest
43
45
  } = props;
44
46
  const formFieldProps = {
@@ -167,10 +169,13 @@ const DateTimePickerBase = (props) => {
167
169
  isDateTime: true,
168
170
  isClearable,
169
171
  headerProps,
170
- todayIcon
172
+ todayIcon,
173
+ disableManualEntry,
174
+ placeholder,
175
+ onOpenDropdown: () => state.toggle()
171
176
  }
172
177
  ),
173
- !disableDropdown && /* @__PURE__ */ jsx(
178
+ (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(
174
179
  DateTimeDialog,
175
180
  {
176
181
  footer: /* @__PURE__ */ jsx(
@@ -9,6 +9,8 @@ interface TimePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<Ar
9
9
  disableDropdown?: boolean;
10
10
  date?: string | null;
11
11
  isClearable?: boolean;
12
+ disableManualEntry?: boolean;
13
+ placeholder?: string;
12
14
  }
13
15
  export interface TimePickerProps extends Omit<TimePickerBaseProps, "value" | "onChange"> {
14
16
  value?: string | null;
@@ -31,11 +31,13 @@ const TimePickerBase = (props) => {
31
31
  onChange,
32
32
  value,
33
33
  disableDropdown,
34
+ placeholder,
34
35
  variant = ui.input.variant,
35
36
  as = ui.input.as,
36
37
  size = ui.input.size,
37
38
  hideLabel = ui.input.hideLabel,
38
39
  isClearable = ui.input.isClearable,
40
+ disableManualEntry = ui.dateInput.disableManualEntry,
39
41
  ...rest
40
42
  } = props;
41
43
  const formFieldProps = {
@@ -52,7 +54,6 @@ const TimePickerBase = (props) => {
52
54
  errorClassName
53
55
  };
54
56
  const [isOpen, setIsOpen] = useState(false);
55
- const skipOnChangeRef = useRef(false);
56
57
  const initialDateEmitRef = useRef(true);
57
58
  const { locale } = useLocale();
58
59
  const dialogState = useTimeFieldState({
@@ -64,11 +65,7 @@ const TimePickerBase = (props) => {
64
65
  ...rest,
65
66
  isDisabled,
66
67
  value,
67
- onChange: (val) => {
68
- if (!skipOnChangeRef.current) {
69
- onChange?.(val);
70
- }
71
- },
68
+ onChange,
72
69
  locale
73
70
  });
74
71
  useEffect(() => {
@@ -80,18 +77,12 @@ const TimePickerBase = (props) => {
80
77
  onChange?.(state.timeValue);
81
78
  }
82
79
  }, [rest.date]);
83
- useEffect(() => {
84
- if (dialogState.timeValue || !state.value) {
85
- return;
86
- }
87
- state.segments.forEach((segment) => {
88
- if (segment.isEditable && segment.value != null) {
89
- dialogState.setSegment(segment.type, segment.value);
90
- }
91
- });
92
- }, [state.value]);
93
80
  const timeFieldRef = useRef(null);
94
- const { labelProps, fieldProps } = useTimeField({ ...rest, label }, state, timeFieldRef);
81
+ const { labelProps, fieldProps } = useTimeField(
82
+ { ...rest, label, isReadOnly: disableManualEntry },
83
+ state,
84
+ timeFieldRef
85
+ );
95
86
  const headerProps = {
96
87
  label,
97
88
  tooltipText,
@@ -104,15 +95,6 @@ const TimePickerBase = (props) => {
104
95
  labelProps
105
96
  };
106
97
  const onApply = () => {
107
- if (!state.timeValue) {
108
- skipOnChangeRef.current = true;
109
- dialogState.segments.forEach((segment) => {
110
- if (segment.isEditable && segment.value != null) {
111
- state.setSegment(segment.type, segment.value);
112
- }
113
- });
114
- skipOnChangeRef.current = false;
115
- }
116
98
  state.setValue(dialogState.value);
117
99
  setIsOpen(false);
118
100
  };
@@ -153,10 +135,12 @@ const TimePickerBase = (props) => {
153
135
  variant,
154
136
  size,
155
137
  isClearable,
156
- headerProps
138
+ headerProps,
139
+ disableManualEntry,
140
+ placeholder
157
141
  }
158
142
  ),
159
- !disableDropdown && /* @__PURE__ */ jsx(
143
+ (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(
160
144
  DateTimeDialog,
161
145
  {
162
146
  footer: /* @__PURE__ */ jsx(
@@ -7,6 +7,7 @@ interface DateFieldProps extends Omit<DateFieldStateOptions, "locale" | "createC
7
7
  ref?: Ref<DateFieldHandle>;
8
8
  onClearChange?: (canClear: boolean) => void;
9
9
  hidePlaceholder?: boolean;
10
+ disableManualEntry?: boolean;
10
11
  }
11
- export declare const DateField: ({ ref, onClearChange, hidePlaceholder, ...props }: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const DateField: ({ ref, onClearChange, hidePlaceholder, isDisabled, disableManualEntry, ...props }: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -1,18 +1,28 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { createCalendar } from "@internationalized/date";
3
+ import { clsx } from "clsx";
3
4
  import { useRef, useImperativeHandle, useEffect } from "react";
4
5
  import { useLocale, useDateField } from "react-aria";
5
6
  import { useDateFieldState } from "react-stately";
6
7
  import { DateSegmentItem } from "./DateSegmentItem.js";
7
- const DateField = ({ ref, onClearChange, hidePlaceholder, ...props }) => {
8
+ const DateField = ({
9
+ ref,
10
+ onClearChange,
11
+ hidePlaceholder,
12
+ isDisabled,
13
+ disableManualEntry,
14
+ ...props
15
+ }) => {
8
16
  const { locale } = useLocale();
9
17
  const state = useDateFieldState({
10
18
  ...props,
19
+ isDisabled,
20
+ isReadOnly: disableManualEntry,
11
21
  locale,
12
22
  createCalendar
13
23
  });
14
24
  const dataFieldRef = useRef(null);
15
- const { fieldProps } = useDateField(props, state, dataFieldRef);
25
+ const { fieldProps } = useDateField({ ...props, isDisabled, isReadOnly: disableManualEntry }, state, dataFieldRef);
16
26
  const handleBlur = (e) => {
17
27
  fieldProps.onBlur?.(e);
18
28
  if (!state.value) {
@@ -32,6 +42,11 @@ const DateField = ({ ref, onClearChange, hidePlaceholder, ...props }) => {
32
42
  useImperativeHandle(ref, () => ({
33
43
  clearField: () => {
34
44
  state.setValue(null);
45
+ for (const segment of state.segments) {
46
+ if (segment.type !== "literal") {
47
+ state.clearSegment(segment.type);
48
+ }
49
+ }
35
50
  }
36
51
  }));
37
52
  useEffect(() => {
@@ -43,13 +58,13 @@ const DateField = ({ ref, onClearChange, hidePlaceholder, ...props }) => {
43
58
  ...fieldProps,
44
59
  ref: dataFieldRef,
45
60
  onBlur: handleBlur,
46
- className: "relative w-full",
61
+ className: clsx("relative w-full", disableManualEntry && "pointer-events-none"),
47
62
  children: /* @__PURE__ */ jsx("div", { className: "flex", children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(
48
63
  DateSegmentItem,
49
64
  {
50
65
  segment,
51
66
  state,
52
- isDisabled: props.isDisabled,
67
+ isDisabled,
53
68
  hidePlaceholder
54
69
  },
55
70
  i
@@ -15,6 +15,9 @@ interface DatePickerInputProps extends InputVariantProps {
15
15
  isClearable?: boolean;
16
16
  headerProps?: FormFieldHeaderProps;
17
17
  todayIcon?: boolean;
18
+ disableManualEntry?: boolean;
19
+ placeholder?: string;
20
+ onOpenDropdown?: () => void;
18
21
  }
19
- export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, disableManualEntry, placeholder, onOpenDropdown, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
20
23
  export {};
@@ -3,6 +3,7 @@ import { now, getLocalTimeZone, today } from "@internationalized/date";
3
3
  import { clsx } from "clsx";
4
4
  import { useState, useRef, useCallback, useMemo } from "react";
5
5
  import { useHover, useFocusWithin, useFocusVisible } from "react-aria";
6
+ import { Button } from "react-aria-components";
6
7
  import useMeasure from "react-use-measure";
7
8
  import { CalendarIcon } from "../../../../assets/icons/Calendar.js";
8
9
  import { DateTimeIcon } from "../../../../assets/icons/DateTime.js";
@@ -13,6 +14,7 @@ import { DateField } from "./DateField.js";
13
14
  import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
14
15
  import { InputClear } from "../../shared/InputClear.js";
15
16
  import { useInputCva, inputSide } from "../../shared/input.cva.js";
17
+ import { Typography } from "../../../text/Typography/Typography.js";
16
18
  import { UIStyle } from "../../../../config/uiStyle.context.js";
17
19
  const DatePickerInput = ({
18
20
  ref,
@@ -30,6 +32,9 @@ const DatePickerInput = ({
30
32
  isClearable,
31
33
  headerProps,
32
34
  todayIcon,
35
+ disableManualEntry,
36
+ placeholder,
37
+ onOpenDropdown,
33
38
  ...props
34
39
  }) => {
35
40
  const inputCva = useInputCva();
@@ -49,10 +54,7 @@ const DatePickerInput = ({
49
54
  const onClear = () => {
50
55
  dateFieldRef.current?.clearField();
51
56
  fieldProps.onChange?.(null);
52
- const timeout = setTimeout(() => {
53
- endDateFieldRef.current?.clearField();
54
- clearTimeout(timeout);
55
- }, 0);
57
+ endDateFieldRef.current?.clearField();
56
58
  setCanClear(false);
57
59
  };
58
60
  const onToday = () => {
@@ -115,47 +117,76 @@ const DatePickerInput = ({
115
117
  className: "flex items-center gap-2",
116
118
  style,
117
119
  children: [
120
+ disableManualEntry && /* @__PURE__ */ jsx(
121
+ Button,
122
+ {
123
+ onPress: onOpenDropdown,
124
+ className: "absolute inset-0 z-0",
125
+ isDisabled
126
+ }
127
+ ),
118
128
  todayIcon && /* @__PURE__ */ jsx(
119
129
  IconButton,
120
130
  {
121
131
  label: "",
122
132
  icon: TodayIcon,
123
133
  size: "none",
124
- onPress: onToday
134
+ onPress: onToday,
135
+ className: "relative z-1"
125
136
  }
126
137
  ),
127
- /* @__PURE__ */ jsx(
128
- DateField,
138
+ disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(
139
+ Typography,
129
140
  {
130
- ref: dateFieldRef,
131
- ...fieldProps,
132
- isDisabled,
133
- isInvalid,
134
- onClearChange,
135
- hidePlaceholder
141
+ size: "label-1",
142
+ className: "text-text-default-3",
143
+ children: placeholder
136
144
  }
137
- ),
138
- endFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [
139
- !((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", { className: clsx("select-none", isDisabled && "text-interactive-text-secondary-disabled"), children: "–" }),
145
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
140
146
  /* @__PURE__ */ jsx(
141
147
  DateField,
142
148
  {
143
- ref: endDateFieldRef,
144
- ...endFieldProps,
149
+ ref: dateFieldRef,
150
+ ...fieldProps,
145
151
  isDisabled,
146
152
  isInvalid,
147
153
  onClearChange,
148
- hidePlaceholder
154
+ hidePlaceholder,
155
+ disableManualEntry
149
156
  }
150
- )
157
+ ),
158
+ endFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [
159
+ !((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx(
160
+ "span",
161
+ {
162
+ className: clsx(
163
+ "pointer-events-none select-none",
164
+ isDisabled && "text-interactive-text-secondary-disabled"
165
+ ),
166
+ children: "–"
167
+ }
168
+ ),
169
+ /* @__PURE__ */ jsx(
170
+ DateField,
171
+ {
172
+ ref: endDateFieldRef,
173
+ ...endFieldProps,
174
+ isDisabled,
175
+ isInvalid,
176
+ onClearChange,
177
+ hidePlaceholder,
178
+ disableManualEntry
179
+ }
180
+ )
181
+ ] })
151
182
  ] })
152
183
  ]
153
184
  }
154
185
  )
155
186
  ] }),
156
- /* @__PURE__ */ jsxs("div", { className: clsx("flex items-center gap-2", as === "floating" && "-mt-4"), children: [
187
+ /* @__PURE__ */ jsxs("div", { className: "relative z-1 flex items-center gap-2", children: [
157
188
  isClearable && canClear && /* @__PURE__ */ jsx(InputClear, { onClear }),
158
- !disableDropdown && /* @__PURE__ */ jsx(
189
+ (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(
159
190
  InlineIconButton,
160
191
  {
161
192
  label: "",
@@ -31,7 +31,7 @@ const DateTimeDialog = ({
31
31
  Dialog,
32
32
  {
33
33
  ...dialogProps,
34
- className: "!outline-none",
34
+ className: "outline-none!",
35
35
  "aria-label": label,
36
36
  children: /* @__PURE__ */ jsxs("div", { className: "flex overflow-hidden rounded-input-rounding-default border border-elevation-outline-default-1 border-solid bg-elevation-fill-default-1 shadow-5", children: [
37
37
  !hideSidebar && sidebar,
@@ -61,7 +61,7 @@ const DateTimeDialog = ({
61
61
  FormFieldHeader,
62
62
  {
63
63
  label,
64
- className: "!mb-8 shrink-0 px-4 pt-3",
64
+ className: "mb-8! shrink-0 px-4 pt-3",
65
65
  rightContent: /* @__PURE__ */ jsx(FormFieldHeaderClose, { onClose: close })
66
66
  }
67
67
  ),
@@ -12,7 +12,9 @@ interface DatePickerInputProps extends InputVariantProps {
12
12
  disableDropdown?: boolean;
13
13
  headerProps?: FormFieldHeaderProps;
14
14
  isClearable?: boolean;
15
+ disableManualEntry?: boolean;
16
+ placeholder?: string;
15
17
  onPress: () => void;
16
18
  }
17
- export declare const TimePickerInput: ({ ref, as, fieldProps, state, isDisabled, isInvalid, disableDropdown, variant, size, isClearable, headerProps, onPress, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const TimePickerInput: ({ ref, as, fieldProps, state, isDisabled, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, onPress, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
18
20
  export {};
@@ -2,6 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { clsx } from "clsx";
3
3
  import { useState, useMemo } from "react";
4
4
  import { useHover, useFocusWithin, useFocusVisible } from "react-aria";
5
+ import { Button } from "react-aria-components";
5
6
  import useMeasure from "react-use-measure";
6
7
  import { ClockIcon } from "../../../../assets/icons/Clock.js";
7
8
  import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
@@ -9,6 +10,7 @@ import { TimeField } from "./TimeField.js";
9
10
  import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
10
11
  import { InputClear } from "../../shared/InputClear.js";
11
12
  import { useInputCva, inputSide } from "../../shared/input.cva.js";
13
+ import { Typography } from "../../../text/Typography/Typography.js";
12
14
  import { UIStyle } from "../../../../config/uiStyle.context.js";
13
15
  const TimePickerInput = ({
14
16
  ref,
@@ -22,6 +24,8 @@ const TimePickerInput = ({
22
24
  size,
23
25
  isClearable,
24
26
  headerProps,
27
+ disableManualEntry,
28
+ placeholder,
25
29
  onPress,
26
30
  ...props
27
31
  }) => {
@@ -67,6 +71,13 @@ const TimePickerInput = ({
67
71
  ...hoverProps,
68
72
  children: [
69
73
  /* @__PURE__ */ jsxs("div", { children: [
74
+ disableManualEntry && /* @__PURE__ */ jsx(
75
+ Button,
76
+ {
77
+ onPress,
78
+ className: "absolute inset-0 z-0"
79
+ }
80
+ ),
70
81
  as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(
71
82
  FormFieldLabel,
72
83
  {
@@ -75,7 +86,14 @@ const TimePickerInput = ({
75
86
  ...headerProps
76
87
  }
77
88
  ),
78
- /* @__PURE__ */ jsx("div", { style, children: /* @__PURE__ */ jsx(
89
+ /* @__PURE__ */ jsx("div", { style, children: disableManualEntry && placeholder && !state.value ? /* @__PURE__ */ jsx(
90
+ Typography,
91
+ {
92
+ size: "label-1",
93
+ className: "text-text-default-3",
94
+ children: placeholder
95
+ }
96
+ ) : /* @__PURE__ */ jsx(
79
97
  TimeField,
80
98
  {
81
99
  fieldProps,
@@ -85,27 +103,19 @@ const TimePickerInput = ({
85
103
  }
86
104
  ) })
87
105
  ] }),
88
- /* @__PURE__ */ jsxs(
89
- "div",
90
- {
91
- className: clsx("flex items-center gap-2", {
92
- "-mt-4": as === "floating"
93
- }),
94
- children: [
95
- isClearable && canClear && /* @__PURE__ */ jsx(InputClear, { onClear: () => state.setValue(null) }),
96
- !disableDropdown && /* @__PURE__ */ jsx(
97
- InlineIconButton,
98
- {
99
- label: "",
100
- color: "secondary",
101
- onPress,
102
- icon: ClockIcon,
103
- isDisabled
104
- }
105
- )
106
- ]
107
- }
108
- )
106
+ /* @__PURE__ */ jsxs("div", { className: clsx("relative z-1 flex items-center gap-2", as === "floating" && "-mt-4"), children: [
107
+ isClearable && canClear && /* @__PURE__ */ jsx(InputClear, { onClear: () => state.setValue(null) }),
108
+ (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(
109
+ InlineIconButton,
110
+ {
111
+ label: "",
112
+ color: "secondary",
113
+ onPress,
114
+ icon: ClockIcon,
115
+ isDisabled
116
+ }
117
+ )
118
+ ] })
109
119
  ]
110
120
  }
111
121
  );
@@ -39,6 +39,7 @@ const FileUploadBase = (props) => {
39
39
  fileRemove,
40
40
  children,
41
41
  listRenderer,
42
+ onInvalidFileType,
42
43
  ...rest
43
44
  } = props;
44
45
  const ui = UIConfig.useConfig();
@@ -56,68 +57,70 @@ const FileUploadBase = (props) => {
56
57
  errorClassName
57
58
  };
58
59
  const labelProps = useLabels({ "aria-label": label });
59
- const handleUpload = useCallback(
60
- async (inputFiles) => {
61
- const acceptedFiles = inputFiles.filter((file) => FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
62
- if (acceptedFiles.length === 0 || !fileUpload) {
63
- return;
60
+ const handleUpload = async (inputFiles) => {
61
+ const acceptedFiles = inputFiles.filter((file) => FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
62
+ const invalidFiles = inputFiles.filter((file) => !FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
63
+ if (invalidFiles.length > 0) {
64
+ if (allowsMultiple) {
65
+ onInvalidFileType?.(invalidFiles.map((file) => file.name));
66
+ } else {
67
+ onInvalidFileType?.(invalidFiles[0].name);
64
68
  }
65
- if (!allowsMultiple) {
66
- setUploadState([]);
67
- }
68
- const newUploadState = [];
69
- acceptedFiles.forEach((file) => {
70
- newUploadState.push({ state: "uploading", progress: 0, file, abortController: new AbortController() });
71
- });
72
- const startIndex = allowsMultiple ? uploadState.length : 0;
73
- setUploadState((prev) => [...prev, ...newUploadState]);
74
- const promises = [];
75
- acceptedFiles.forEach(async (file, index) => {
76
- promises.push(
77
- fileUpload(
78
- {
79
- data: {
80
- resourceName: file.name,
81
- fileName: file.name,
82
- fileSize: file.size,
83
- method: "put"
69
+ }
70
+ if (acceptedFiles.length === 0 || !fileUpload) {
71
+ return;
72
+ }
73
+ if (!allowsMultiple) {
74
+ setUploadState([]);
75
+ }
76
+ const newUploadState = [];
77
+ acceptedFiles.forEach((file) => {
78
+ newUploadState.push({ state: "uploading", progress: 0, file, abortController: new AbortController() });
79
+ });
80
+ const startIndex = allowsMultiple ? uploadState.length : 0;
81
+ setUploadState((prev) => [...prev, ...newUploadState]);
82
+ const promises = [];
83
+ acceptedFiles.forEach(async (file, index) => {
84
+ promises.push(
85
+ fileUpload(
86
+ {
87
+ data: {
88
+ resourceName: file.name,
89
+ fileName: file.name,
90
+ fileSize: file.size,
91
+ method: "put"
92
+ }
93
+ },
94
+ file,
95
+ {
96
+ onUploadProgress: ({ loaded, total }) => {
97
+ if (total == null) {
98
+ return;
84
99
  }
100
+ const progress = Math.round(loaded / total * 100);
101
+ setUploadState(
102
+ (prev) => prev.map((state, i) => i === startIndex + index ? { ...state, progress } : state)
103
+ );
85
104
  },
86
- file,
87
- {
88
- onUploadProgress: ({ loaded, total }) => {
89
- if (total == null) {
90
- return;
91
- }
92
- const progress = Math.round(loaded / total * 100);
93
- setUploadState(
94
- (prev) => prev.map((state, i) => i === startIndex + index ? { ...state, progress } : state)
95
- );
96
- },
97
- abortController: newUploadState[index]?.abortController
98
- }
99
- )
100
- );
101
- });
102
- const response = await Promise.all(promises);
103
- response.forEach((res, index) => {
104
- setUploadState(
105
- (prev) => prev.map((state, i) => i === startIndex + index ? { ...state, state: "uploaded", id: res.id } : state)
106
- );
107
- });
108
- },
109
- [fileUpload, acceptedFileTypes, setUploadState, allowsMultiple, uploadState.length]
110
- );
111
- const handleSelect = useCallback(
112
- (inputFiles) => {
113
- if (!inputFiles) {
114
- return;
115
- }
116
- const filesArray = Array.from(inputFiles);
117
- handleUpload(filesArray);
118
- },
119
- [handleUpload]
120
- );
105
+ abortController: newUploadState[index]?.abortController
106
+ }
107
+ )
108
+ );
109
+ });
110
+ const response = await Promise.all(promises);
111
+ response.forEach((res, index) => {
112
+ setUploadState(
113
+ (prev) => prev.map((state, i) => i === startIndex + index ? { ...state, state: "uploaded", id: res.id } : state)
114
+ );
115
+ });
116
+ };
117
+ const handleSelect = (inputFiles) => {
118
+ if (!inputFiles) {
119
+ return;
120
+ }
121
+ const filesArray = Array.from(inputFiles);
122
+ handleUpload(filesArray);
123
+ };
121
124
  const handleDrop = async (e) => {
122
125
  if (!e.items) {
123
126
  return;
@@ -5,6 +5,7 @@ import { useState } from "react";
5
5
  import { Controller } from "react-hook-form";
6
6
  import { FormField } from "../FormField/FormField.js";
7
7
  import { UIConfig } from "../../../config/uiConfig.context.js";
8
+ import { FileUtils } from "../../../utils/file.utils.js";
8
9
  import { InputUploadContent } from "./shared/InputUploadContent.js";
9
10
  import { InputUploadFilled } from "./shared/InputUploadFilled.js";
10
11
  const InputUploadBase = ({
@@ -21,6 +22,7 @@ const InputUploadBase = ({
21
22
  error,
22
23
  className,
23
24
  onChange,
25
+ onInvalidFileType,
24
26
  value,
25
27
  defaultValue,
26
28
  allowsMultiple = false,
@@ -73,28 +75,29 @@ const InputUploadBase = ({
73
75
  onChange?.(newFiles[0] || null);
74
76
  }
75
77
  };
76
- const isFileAccepted = (file) => {
77
- if (!acceptedFileTypes || acceptedFileTypes.length === 0) {
78
- return true;
79
- }
80
- return acceptedFileTypes.some((type) => {
81
- if (type.includes("/")) {
82
- return file.type === type || type.endsWith("/*") && file.type.startsWith(type.slice(0, -1));
78
+ const handleFileSelect = (inputFiles) => {
79
+ const acceptedFiles = inputFiles.filter((file) => FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
80
+ const invalidFiles = inputFiles.filter((file) => !FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
81
+ if (allowsMultiple) {
82
+ updateFiles([...files, ...acceptedFiles]);
83
+ if (invalidFiles.length > 0) {
84
+ onInvalidFileType?.(invalidFiles.map((file) => file.name));
83
85
  }
84
- return file.name.toLowerCase().endsWith(type.toLowerCase());
85
- });
86
+ } else {
87
+ if (acceptedFiles.length > 0) {
88
+ updateFiles([acceptedFiles[0]]);
89
+ }
90
+ if (invalidFiles.length > 0) {
91
+ onInvalidFileType?.(invalidFiles[0].name);
92
+ }
93
+ }
86
94
  };
87
95
  const handleSelect = (inputFiles) => {
88
96
  if (!inputFiles) {
89
97
  return;
90
98
  }
91
99
  const filesArray = Array.from(inputFiles);
92
- const acceptedFiles = filesArray.filter(isFileAccepted);
93
- if (allowsMultiple) {
94
- updateFiles([...files, ...acceptedFiles]);
95
- } else {
96
- updateFiles([acceptedFiles[0]]);
97
- }
100
+ handleFileSelect(filesArray);
98
101
  };
99
102
  const handleDrop = async (e) => {
100
103
  if (!e.items) {
@@ -107,12 +110,7 @@ const InputUploadBase = ({
107
110
  }
108
111
  });
109
112
  const inputFiles = await Promise.all(promises);
110
- const acceptedFiles = inputFiles.filter(isFileAccepted);
111
- if (allowsMultiple) {
112
- updateFiles([...files, ...acceptedFiles]);
113
- } else {
114
- updateFiles([acceptedFiles[0]]);
115
- }
113
+ handleFileSelect(inputFiles);
116
114
  };
117
115
  const handleRemove = () => {
118
116
  updateFiles([]);
@@ -12,12 +12,14 @@ export interface SingleFileUploadProps {
12
12
  value?: FileUploadState | null;
13
13
  onChange?: (file: File | null) => void;
14
14
  defaultValue?: File | null;
15
+ onInvalidFileType?: (filename: string) => void;
15
16
  }
16
17
  export interface MultipleFileUploadProps {
17
18
  allowsMultiple: true;
18
19
  value?: FileUploadState[];
19
20
  onChange?: (files: File[]) => void;
20
21
  defaultValue?: File[];
22
+ onInvalidFileType?: (filenames: string[]) => void;
21
23
  }
22
24
  export type GroupedFileUploadProps = MultipleFileUploadProps | SingleFileUploadProps;
23
25
  export type GroupedFileUploadControlProps<TFieldValues extends FieldValues> = ({
@@ -9,12 +9,14 @@ export interface SingleFileUploadProps {
9
9
  value?: File | null;
10
10
  onChange?: (file: File | null) => void;
11
11
  defaultValue?: File | null;
12
+ onInvalidFileType?: (filename: string) => void;
12
13
  }
13
14
  export interface MultipleFileUploadProps {
14
15
  allowsMultiple: true;
15
16
  value?: File[];
16
17
  onChange?: (files: File[]) => void;
17
18
  defaultValue?: File[];
19
+ onInvalidFileType?: (filenames: string[]) => void;
18
20
  }
19
21
  export type GroupedFileUploadProps = MultipleFileUploadProps | SingleFileUploadProps;
20
22
  export type GroupedFileUploadControlProps<TFieldValues extends FieldValues> = ({
@@ -35,14 +35,11 @@ const FileUploadContentFilled = ({
35
35
  /* @__PURE__ */ jsxs(
36
36
  "div",
37
37
  {
38
- className: clsx(
39
- "flex min-w-0 max-w-full flex-grow items-center gap-file-upload-content-gap-icon-to-content",
40
- {
41
- "flex-col": variant === "vertical",
42
- "flex-row": variant === "horizontal",
43
- "opacity-50": isDisabled
44
- }
45
- ),
38
+ className: clsx("flex min-w-0 max-w-full grow items-center gap-file-upload-content-gap-icon-to-content", {
39
+ "flex-col": variant === "vertical",
40
+ "flex-row": variant === "horizontal",
41
+ "opacity-50": isDisabled
42
+ }),
46
43
  children: [
47
44
  /* @__PURE__ */ jsx(CheckCircleIcon, { className: "h-6 w-6 text-text-default-1" }),
48
45
  /* @__PURE__ */ jsxs(
@@ -50,7 +47,7 @@ const FileUploadContentFilled = ({
50
47
  {
51
48
  className: clsx("flex flex-col gap-file-upload-content-gap-text-to-text", {
52
49
  "max-w-full items-center": variant === "vertical",
53
- "max-w-[calc(100%_-_32px)]": variant === "horizontal"
50
+ "max-w-[calc(100%-32px)]": variant === "horizontal"
54
51
  }),
55
52
  children: [
56
53
  /* @__PURE__ */ jsx(
@@ -94,7 +91,7 @@ const FileUploadContentFilled = ({
94
91
  TextButton,
95
92
  {
96
93
  className: clsx("text-interactive-text-primary-idle", {
97
- "[&>span>span]:!font-medium": variant === "vertical"
94
+ "[&>span>span]:font-medium!": variant === "vertical"
98
95
  }),
99
96
  children: browseText ?? ""
100
97
  }
@@ -124,7 +121,7 @@ const FileUploadContentFilled = ({
124
121
  TextButton,
125
122
  {
126
123
  className: clsx(
127
- variant === "vertical" && "[&>span>span]:!font-medium text-interactive-text-primary-idle lowercase"
124
+ variant === "vertical" && "text-interactive-text-primary-idle lowercase [&>span>span]:font-medium!"
128
125
  ),
129
126
  color: variant === "horizontal" ? "secondary" : "primary",
130
127
  onPress: () => {
@@ -46,10 +46,10 @@ const inputBase = cva([uiOutlineClass, "flex w-full truncate"], {
46
46
  variant: "filled",
47
47
  as: "default",
48
48
  className: [
49
- "bg-input-filled-idle text-text-default-1",
50
- "hover:border hover:border-input-filled-outline-hover hover:border-solid hover:bg-input-filled-hover hover:text-text-default-1",
51
- "focus-within:border focus-within:border-input-filled-outline-active focus-within:border-solid focus-within:bg-input-filled-active focus-within:text-text-default-1",
52
- "invalid:border invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
49
+ "border border-transparent border-solid bg-input-filled-idle text-text-default-1",
50
+ "hover:border-input-filled-outline-hover hover:border-solid hover:bg-input-filled-hover hover:text-text-default-1",
51
+ "focus-within:border-input-filled-outline-active focus-within:border-solid focus-within:bg-input-filled-active focus-within:text-text-default-1",
52
+ "invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
53
53
  "disabled:bg-input-filled-disabled disabled:text-text-default-1",
54
54
  "placeholder:text-text-default-3",
55
55
  "focus-visible:outline-interactive-contained-primary-focus"
@@ -72,9 +72,9 @@ const inputBase = cva([uiOutlineClass, "flex w-full truncate"], {
72
72
  variant: "filled",
73
73
  as: "floating",
74
74
  className: [
75
- "bg-input-filled-idle text-text-default-1",
76
- "hover:border hover:border-input-filled-outline-hover hover:border-solid hover:bg-input-filled-hover hover:text-text-default-1",
77
- "focus-within:border focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-idle focus-within:text-text-default-1",
75
+ "border border-transparent border-solid bg-input-filled-idle text-text-default-1",
76
+ "hover:border-input-filled-outline-hover hover:border-solid hover:bg-input-filled-hover hover:text-text-default-1",
77
+ "focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-idle focus-within:text-text-default-1",
78
78
  "invalid:border invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
79
79
  "disabled:bg-input-filled-disabled disabled:text-text-default-1",
80
80
  "placeholder:text-text-default-3",
@@ -98,10 +98,10 @@ const inputBase = cva([uiOutlineClass, "flex w-full truncate"], {
98
98
  variant: "outlined",
99
99
  as: "filter",
100
100
  className: [
101
- "bg-input-filled-idle text-text-default-1",
102
- "hover:border hover:border-input-filled-outline-hover hover:border-solid hover:bg-input-filled-hover hover:text-text-default-1",
103
- "focus-within:border focus-within:border-input-filled-outline-active focus-within:border-solid focus-within:bg-input-filled-active focus-within:text-text-default-1",
104
- "invalid:border invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
101
+ "border border-transparent border-solid bg-input-filled-idle text-text-default-1",
102
+ "hover:border-input-filled-outline-hover hover:border-solid hover:bg-input-filled-hover hover:text-text-default-1",
103
+ "focus-within:border-input-filled-outline-active focus-within:border-solid focus-within:bg-input-filled-active focus-within:text-text-default-1",
104
+ "invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
105
105
  "disabled:bg-input-filled-disabled disabled:text-text-default-1",
106
106
  "placeholder:text-text-default-3",
107
107
  "focus-visible:outline-interactive-contained-primary-focus"
@@ -6,7 +6,8 @@ export interface ModalProps extends ModalVariantProps {
6
6
  onClose: () => void;
7
7
  modalClassName?: string;
8
8
  closeIconClassName?: string;
9
+ overlayClassName?: string;
9
10
  showCloseIcon?: boolean;
10
11
  isDismissable?: boolean;
11
12
  }
12
- export declare const Modal: ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, showCloseIcon, isDismissable, }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Modal: ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable, }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
@@ -15,6 +15,7 @@ const Modal = ({
15
15
  children,
16
16
  modalClassName,
17
17
  closeIconClassName,
18
+ overlayClassName,
18
19
  showCloseIcon,
19
20
  isDismissable = true
20
21
  }) => {
@@ -27,7 +28,7 @@ const Modal = ({
27
28
  ModalOverlay,
28
29
  {
29
30
  UNSTABLE_portalContainer: portalContainerRef?.current,
30
- className: modalOverlayCva({ aside }),
31
+ className: modalOverlayCva({ aside, className: overlayClassName }),
31
32
  isDismissable,
32
33
  isOpen,
33
34
  shouldCloseOnInteractOutside: () => {
@@ -49,7 +50,8 @@ const Modal = ({
49
50
  "absolute top-0 right-0 p-modal-gap-desktop-modal-close-icon-top-right",
50
51
  closeIconClassName
51
52
  ),
52
- label: t(($) => $.ui.modal.closeBtn)
53
+ label: t(($) => $.ui.modal.closeBtn),
54
+ disableTooltip: true
53
55
  }
54
56
  ),
55
57
  children
@@ -218,7 +218,7 @@ const Table = ({
218
218
  className: clsx("w-full", className),
219
219
  ...listeners,
220
220
  children: [
221
- /* @__PURE__ */ jsx("thead", { className: "sticky top-0 border-b border-b-elevation-outline-default-1", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(
221
+ /* @__PURE__ */ jsx("thead", { className: "sticky top-0 z-10 bg-elevation-fill-default-1 shadow-2", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(
222
222
  "tr",
223
223
  {
224
224
  className: clsx(tableHeadRowCva({})),
@@ -21,7 +21,7 @@ const tableRow = cva(
21
21
  const tableHeadRow = cva(["h-8 w-full"]);
22
22
  const tableHeadData = cva(
23
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"
24
+ "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"
25
25
  ],
26
26
  {
27
27
  variants: {
@@ -19,7 +19,7 @@ export declare namespace UIConfig {
19
19
  select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType">;
20
20
  toggle: Pick<ToggleProps, "variant">;
21
21
  slider: Pick<SliderProps, "minValue" | "maxValue">;
22
- dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros">;
22
+ dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros" | "disableManualEntry">;
23
23
  }
24
24
  interface ProviderProps {
25
25
  config?: Partial<Options>;
@@ -40,7 +40,8 @@ var UIConfig;
40
40
  },
41
41
  dateInput: {
42
42
  todayIcon: false,
43
- shouldForceLeadingZeros: false
43
+ shouldForceLeadingZeros: false,
44
+ disableManualEntry: false
44
45
  }
45
46
  };
46
47
  const Context = createContext(DEFAULT_CONFIG);
@@ -1,3 +1,3 @@
1
- type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl";
1
+ type Breakpoint = "sm" | "md" | "lg" | "xl";
2
2
  export declare function useBreakpoint(breakpointKey: Breakpoint): boolean;
3
3
  export {};
@@ -5,6 +5,14 @@ function getBreakpoints() {
5
5
  if (breakpoints) {
6
6
  return breakpoints;
7
7
  }
8
+ if (typeof window === "undefined") {
9
+ return {
10
+ sm: "23.75rem",
11
+ md: "37.5rem",
12
+ lg: "80rem",
13
+ xl: "105rem"
14
+ };
15
+ }
8
16
  const cs = getComputedStyle(document.documentElement);
9
17
  const entries = ["sm", "md", "lg", "xl", "2xl"].map((k) => [k, cs.getPropertyValue(`--breakpoint-${k}`).trim()]).filter(([, v]) => !!v);
10
18
  breakpoints = Object.fromEntries(entries);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.1.12",
3
+ "version": "2.1.14",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",