@nexub/react 6.9.0 → 7.0.1

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "6.9.0",
2
+ "version": "7.0.1",
3
3
  "standard": "WCAG 2.2 Level AA",
4
4
  "method": {
5
5
  "automated": "axe-core rules tagged wcag2a, wcag2aa, wcag21a, wcag21aa and wcag22aa, run on every Storybook story in light and dark, and on open popups (menus, listboxes, dialogs), on every pull request; a new violation fails the build.",
@@ -17,20 +17,13 @@ export interface AutocompleteProps {
17
17
  * filtered (fetched for this text), so the built-in filtering is off.
18
18
  */
19
19
  onInputChange?: (text: string) => void;
20
- /**
21
- * `'popover'` (default): a field whose list opens below it while typing.
22
- * `'inline'`: the list always shows under the input (the 5.x default).
23
- * @deprecated `mode` is removed in 7.0 with the inline layout; the popover stays.
24
- * For an always-open list, use the Combobox parts.
25
- */
26
- mode?: 'inline' | 'popover';
27
20
  /** Adds a "Create “text”" option when the text matches no option exactly. */
28
21
  onCreate?: (text: string) => void;
29
22
  disabled?: boolean;
30
23
  className?: string;
31
24
  'aria-label'?: string;
32
25
  }
33
- export declare function Autocomplete({ options, value, onValueChange, placeholder, emptyText, loading, inputValue, onInputChange, mode, onCreate, disabled, className, 'aria-label': ariaLabel, }: AutocompleteProps): React.JSX.Element;
26
+ export declare function Autocomplete({ options, value, onValueChange, placeholder, emptyText, loading, inputValue, onInputChange, onCreate, disabled, className, 'aria-label': ariaLabel, }: AutocompleteProps): React.JSX.Element;
34
27
  export declare namespace Autocomplete {
35
28
  var displayName: string;
36
29
  }
@@ -15,7 +15,6 @@ function Autocomplete({
15
15
  loading = false,
16
16
  inputValue,
17
17
  onInputChange,
18
- mode = "popover",
19
18
  onCreate,
20
19
  disabled,
21
20
  className,
@@ -79,21 +78,15 @@ function Autocomplete({
79
78
  setOpen(true);
80
79
  }
81
80
  };
82
- if (mode === "popover") {
83
- return /* @__PURE__ */ jsx(
84
- Combobox.Root,
85
- {
86
- label: ariaLabel,
87
- className: cn("overflow-visible rounded-none bg-transparent", className),
88
- shouldFilter: !onInputChange,
89
- children: /* @__PURE__ */ jsx(ComboboxPopover, { open: open && !disabled, onOpenChange: setOpen, input, disabled, children: list })
90
- }
91
- );
92
- }
93
- return /* @__PURE__ */ jsxs(Combobox.Root, { label: ariaLabel, className, shouldFilter: !onInputChange, children: [
94
- /* @__PURE__ */ jsx(Combobox.Input, { ...input, disabled }),
95
- list
96
- ] });
81
+ return /* @__PURE__ */ jsx(
82
+ Combobox.Root,
83
+ {
84
+ label: ariaLabel,
85
+ className: cn("overflow-visible rounded-none bg-transparent", className),
86
+ shouldFilter: !onInputChange,
87
+ children: /* @__PURE__ */ jsx(ComboboxPopover, { open: open && !disabled, onOpenChange: setOpen, input, disabled, children: list })
88
+ }
89
+ );
97
90
  }
98
91
  Autocomplete.displayName = "Autocomplete";
99
92
  export {
@@ -30,10 +30,14 @@ const PasswordInput = React.forwardRef(
30
30
  Input,
31
31
  {
32
32
  ref,
33
+ autoComplete: "current-password",
34
+ ...props,
33
35
  type: showPassword ? "text" : "password",
34
36
  className,
35
37
  trailingIcon: toggleButton,
36
- ...props
38
+ spellCheck: false,
39
+ autoCorrect: "off",
40
+ autoCapitalize: "off"
37
41
  }
38
42
  );
39
43
  }
@@ -48,18 +48,18 @@ const Progress = React.forwardRef(
48
48
  className,
49
49
  size,
50
50
  tone = "neutral",
51
- value = 0,
51
+ value,
52
52
  max = 100,
53
53
  animated = false,
54
54
  ...props
55
55
  }, ref) => {
56
- const clampedValue = Math.min(Math.max(value, 0), max);
57
- const percentage = clampedValue / max * 100;
56
+ const isIndeterminate = value === void 0 || value === null;
57
+ const clampedValue = isIndeterminate ? 0 : Math.min(Math.max(value, 0), max);
58
+ const percentage = isIndeterminate ? 40 : clampedValue / max * 100;
58
59
  const fillRef = React.useRef(null);
59
60
  useIsomorphicLayoutEffect(() => {
60
61
  fillRef.current?.style.setProperty("width", `${percentage}%`);
61
62
  }, [percentage]);
62
- const isIndeterminate = value === void 0 || value === null;
63
63
  return /* @__PURE__ */ jsx(
64
64
  "div",
65
65
  {
@@ -75,10 +75,12 @@ const Progress = React.forwardRef(
75
75
  {
76
76
  className: cn(
77
77
  progressFillVariants({ tone }),
78
- animated && "animate-pulse"
78
+ animated && "animate-pulse",
79
+ isIndeterminate && "animate-[nx-progress-indeterminate_1.4s_ease-in-out_infinite]"
79
80
  ),
80
81
  ref: fillRef,
81
- "data-part": "fill"
82
+ "data-part": "fill",
83
+ "data-indeterminate": isIndeterminate || void 0
82
84
  }
83
85
  )
84
86
  }