@zuzjs/ui 0.8.1 → 0.8.3

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 (188) hide show
  1. package/dist/cjs/comps/Accordion/index.js +1 -1
  2. package/dist/cjs/comps/Actionbar/index.js +1 -1
  3. package/dist/cjs/comps/Alert/index.js +1 -1
  4. package/dist/cjs/comps/AutoComplete/index.d.ts +1 -1
  5. package/dist/cjs/comps/AutoComplete/index.js +3 -2
  6. package/dist/cjs/comps/Avatar/index.js +5 -5
  7. package/dist/cjs/comps/Box/index.js +1 -1
  8. package/dist/cjs/comps/Button/index.js +1 -1
  9. package/dist/cjs/comps/CheckBox/index.d.ts +1 -0
  10. package/dist/cjs/comps/CheckBox/index.js +1 -1
  11. package/dist/cjs/comps/CheckBox/types.d.ts +1 -0
  12. package/dist/cjs/comps/ColorScheme/index.js +1 -1
  13. package/dist/cjs/comps/ContextMenu/index.d.ts +2 -0
  14. package/dist/cjs/comps/ContextMenu/index.js +6 -6
  15. package/dist/cjs/comps/ContextMenu/item.js +1 -1
  16. package/dist/cjs/comps/ContextMenu/types.d.ts +3 -1
  17. package/dist/cjs/comps/CookiesConsent/index.js +1 -1
  18. package/dist/cjs/comps/Cover/index.js +1 -1
  19. package/dist/cjs/comps/Cropper/index.d.ts +8 -0
  20. package/dist/cjs/comps/Cropper/index.js +20 -0
  21. package/dist/cjs/comps/Cropper/types.d.ts +14 -0
  22. package/dist/cjs/comps/Cropper/types.js +5 -0
  23. package/dist/cjs/comps/Crumb/index.d.ts +2 -1
  24. package/dist/cjs/comps/Crumb/index.js +13 -3
  25. package/dist/cjs/comps/Crumb/types.d.ts +1 -0
  26. package/dist/cjs/comps/Drawer/index.js +1 -1
  27. package/dist/cjs/comps/Fab/index.js +1 -1
  28. package/dist/cjs/comps/Filters/index.js +1 -1
  29. package/dist/cjs/comps/Form/index.js +22 -6
  30. package/dist/cjs/comps/Icon/index.js +1 -1
  31. package/dist/cjs/comps/Image/index.js +1 -1
  32. package/dist/cjs/comps/Input/index.d.ts +2 -2
  33. package/dist/cjs/comps/Input/index.js +1 -1
  34. package/dist/cjs/comps/KeyboardKeys/index.js +1 -1
  35. package/dist/cjs/comps/Label/index.js +1 -1
  36. package/dist/cjs/comps/List/index.d.ts +1 -1
  37. package/dist/cjs/comps/List/index.js +1 -1
  38. package/dist/cjs/comps/Network/index.js +1 -1
  39. package/dist/cjs/comps/Overlay/index.js +1 -1
  40. package/dist/cjs/comps/Pagination/index.js +1 -1
  41. package/dist/cjs/comps/Password/index.d.ts +6 -2
  42. package/dist/cjs/comps/Password/index.js +15 -5
  43. package/dist/cjs/comps/PinInput/index.d.ts +1 -1
  44. package/dist/cjs/comps/PinInput/index.js +8 -3
  45. package/dist/cjs/comps/ProgressBar/index.js +2 -2
  46. package/dist/cjs/comps/Radio/index.js +1 -1
  47. package/dist/cjs/comps/ScrollView/index.js +1 -1
  48. package/dist/cjs/comps/Search/index.d.ts +1 -1
  49. package/dist/cjs/comps/Search/index.js +1 -1
  50. package/dist/cjs/comps/Segmented/index.js +1 -1
  51. package/dist/cjs/comps/Select/index.d.ts +1 -0
  52. package/dist/cjs/comps/Select/index.js +3 -3
  53. package/dist/cjs/comps/Select/types.d.ts +6 -1
  54. package/dist/cjs/comps/Sheet/index.js +1 -1
  55. package/dist/cjs/comps/Sidebar/index.js +1 -1
  56. package/dist/cjs/comps/Slider/index.js +1 -1
  57. package/dist/cjs/comps/Span/index.js +1 -1
  58. package/dist/cjs/comps/Spinner/index.js +1 -1
  59. package/dist/cjs/comps/Switch/index.d.ts +1 -0
  60. package/dist/cjs/comps/Switch/index.js +1 -1
  61. package/dist/cjs/comps/TabView/body.js +1 -1
  62. package/dist/cjs/comps/TabView/index.js +1 -1
  63. package/dist/cjs/comps/TabView/tab.js +1 -1
  64. package/dist/cjs/comps/Table/col.js +1 -1
  65. package/dist/cjs/comps/Table/index.js +56 -2
  66. package/dist/cjs/comps/Table/row.js +1 -1
  67. package/dist/cjs/comps/Text/index.js +1 -1
  68. package/dist/cjs/comps/TextArea/index.js +1 -1
  69. package/dist/cjs/comps/TextWheel/index.js +3 -3
  70. package/dist/cjs/comps/Tooltip/index.js +1 -1
  71. package/dist/cjs/comps/Treeview/index.js +1 -1
  72. package/dist/cjs/comps/Treeview/item.js +1 -1
  73. package/dist/cjs/comps/VideoPlayer/index.js +1 -0
  74. package/dist/cjs/comps/index.d.ts +2 -0
  75. package/dist/cjs/comps/index.js +2 -0
  76. package/dist/cjs/funs/events.d.ts +31 -7
  77. package/dist/cjs/funs/events.js +57 -19
  78. package/dist/cjs/funs/index.d.ts +5 -3
  79. package/dist/cjs/funs/index.js +39 -84
  80. package/dist/cjs/hooks/index.d.ts +2 -0
  81. package/dist/cjs/hooks/index.js +2 -0
  82. package/dist/cjs/hooks/useDB.d.ts +5 -1
  83. package/dist/cjs/hooks/useDB.js +52 -4
  84. package/dist/cjs/hooks/useImage.js +2 -2
  85. package/dist/cjs/hooks/useImageCropper.d.ts +10 -0
  86. package/dist/cjs/hooks/useImageCropper.js +67 -0
  87. package/dist/cjs/hooks/useSlider.d.ts +1 -1
  88. package/dist/cjs/hooks/useUploader.d.ts +46 -0
  89. package/dist/cjs/hooks/useUploader.js +101 -0
  90. package/dist/cjs/hooks/useWebSocket.d.ts +2 -2
  91. package/dist/cjs/hooks/useWebSocket.js +13 -2
  92. package/dist/cjs/types/index.d.ts +3 -0
  93. package/dist/css/styles.css +1 -1
  94. package/dist/esm/comps/Accordion/index.js +1 -1
  95. package/dist/esm/comps/Actionbar/index.js +1 -1
  96. package/dist/esm/comps/Alert/index.js +1 -1
  97. package/dist/esm/comps/AutoComplete/index.d.ts +1 -1
  98. package/dist/esm/comps/AutoComplete/index.js +3 -2
  99. package/dist/esm/comps/Avatar/index.js +5 -5
  100. package/dist/esm/comps/Box/index.js +1 -1
  101. package/dist/esm/comps/Button/index.js +1 -1
  102. package/dist/esm/comps/CheckBox/index.d.ts +1 -0
  103. package/dist/esm/comps/CheckBox/index.js +1 -1
  104. package/dist/esm/comps/CheckBox/types.d.ts +1 -0
  105. package/dist/esm/comps/ColorScheme/index.js +1 -1
  106. package/dist/esm/comps/ContextMenu/index.d.ts +2 -0
  107. package/dist/esm/comps/ContextMenu/index.js +6 -6
  108. package/dist/esm/comps/ContextMenu/item.js +1 -1
  109. package/dist/esm/comps/ContextMenu/types.d.ts +3 -1
  110. package/dist/esm/comps/CookiesConsent/index.js +1 -1
  111. package/dist/esm/comps/Cover/index.js +1 -1
  112. package/dist/esm/comps/Cropper/index.d.ts +8 -0
  113. package/dist/esm/comps/Cropper/index.js +20 -0
  114. package/dist/esm/comps/Cropper/types.d.ts +14 -0
  115. package/dist/esm/comps/Cropper/types.js +5 -0
  116. package/dist/esm/comps/Crumb/index.d.ts +2 -1
  117. package/dist/esm/comps/Crumb/index.js +13 -3
  118. package/dist/esm/comps/Crumb/types.d.ts +1 -0
  119. package/dist/esm/comps/Drawer/index.js +1 -1
  120. package/dist/esm/comps/Fab/index.js +1 -1
  121. package/dist/esm/comps/Filters/index.js +1 -1
  122. package/dist/esm/comps/Form/index.js +22 -6
  123. package/dist/esm/comps/Icon/index.js +1 -1
  124. package/dist/esm/comps/Image/index.js +1 -1
  125. package/dist/esm/comps/Input/index.d.ts +2 -2
  126. package/dist/esm/comps/Input/index.js +1 -1
  127. package/dist/esm/comps/KeyboardKeys/index.js +1 -1
  128. package/dist/esm/comps/Label/index.js +1 -1
  129. package/dist/esm/comps/List/index.d.ts +1 -1
  130. package/dist/esm/comps/List/index.js +1 -1
  131. package/dist/esm/comps/Network/index.js +1 -1
  132. package/dist/esm/comps/Overlay/index.js +1 -1
  133. package/dist/esm/comps/Pagination/index.js +1 -1
  134. package/dist/esm/comps/Password/index.d.ts +6 -2
  135. package/dist/esm/comps/Password/index.js +15 -5
  136. package/dist/esm/comps/PinInput/index.d.ts +1 -1
  137. package/dist/esm/comps/PinInput/index.js +8 -3
  138. package/dist/esm/comps/ProgressBar/index.js +2 -2
  139. package/dist/esm/comps/Radio/index.js +1 -1
  140. package/dist/esm/comps/ScrollView/index.js +1 -1
  141. package/dist/esm/comps/Search/index.d.ts +1 -1
  142. package/dist/esm/comps/Search/index.js +1 -1
  143. package/dist/esm/comps/Segmented/index.js +1 -1
  144. package/dist/esm/comps/Select/index.d.ts +1 -0
  145. package/dist/esm/comps/Select/index.js +3 -3
  146. package/dist/esm/comps/Select/types.d.ts +6 -1
  147. package/dist/esm/comps/Sheet/index.js +1 -1
  148. package/dist/esm/comps/Sidebar/index.js +1 -1
  149. package/dist/esm/comps/Slider/index.js +1 -1
  150. package/dist/esm/comps/Span/index.js +1 -1
  151. package/dist/esm/comps/Spinner/index.js +1 -1
  152. package/dist/esm/comps/Switch/index.d.ts +1 -0
  153. package/dist/esm/comps/Switch/index.js +1 -1
  154. package/dist/esm/comps/TabView/body.js +1 -1
  155. package/dist/esm/comps/TabView/index.js +1 -1
  156. package/dist/esm/comps/TabView/tab.js +1 -1
  157. package/dist/esm/comps/Table/col.js +1 -1
  158. package/dist/esm/comps/Table/index.js +56 -2
  159. package/dist/esm/comps/Table/row.js +1 -1
  160. package/dist/esm/comps/Text/index.js +1 -1
  161. package/dist/esm/comps/TextArea/index.js +1 -1
  162. package/dist/esm/comps/TextWheel/index.js +3 -3
  163. package/dist/esm/comps/Tooltip/index.js +1 -1
  164. package/dist/esm/comps/Treeview/index.js +1 -1
  165. package/dist/esm/comps/Treeview/item.js +1 -1
  166. package/dist/esm/comps/VideoPlayer/index.js +1 -0
  167. package/dist/esm/comps/index.d.ts +2 -0
  168. package/dist/esm/comps/index.js +2 -0
  169. package/dist/esm/funs/events.d.ts +31 -7
  170. package/dist/esm/funs/events.js +57 -19
  171. package/dist/esm/funs/index.d.ts +5 -3
  172. package/dist/esm/funs/index.js +39 -84
  173. package/dist/esm/hooks/index.d.ts +2 -0
  174. package/dist/esm/hooks/index.js +2 -0
  175. package/dist/esm/hooks/useDB.d.ts +5 -1
  176. package/dist/esm/hooks/useDB.js +52 -4
  177. package/dist/esm/hooks/useImage.js +2 -2
  178. package/dist/esm/hooks/useImageCropper.d.ts +10 -0
  179. package/dist/esm/hooks/useImageCropper.js +67 -0
  180. package/dist/esm/hooks/useSlider.d.ts +1 -1
  181. package/dist/esm/hooks/useUploader.d.ts +46 -0
  182. package/dist/esm/hooks/useUploader.js +101 -0
  183. package/dist/esm/hooks/useWebSocket.d.ts +2 -2
  184. package/dist/esm/hooks/useWebSocket.js +13 -2
  185. package/dist/esm/types/index.d.ts +3 -0
  186. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  187. package/dist/tsconfig.tsbuildinfo +1 -1
  188. package/package.json +2 -2
@@ -10,5 +10,5 @@ const Accordion = forwardRef((props, ref) => {
10
10
  const [visible, setVisible] = useState(false);
11
11
  return _jsxs(Box, { className: `--accordion flex cols`, ...rest, children: [_jsxs(Button, { onClick: (e) => setVisible(!visible), className: `--toggle flex aic ${visible ? `--open` : ``}`.trim(), children: [_jsx(Text, { className: `--label flex`, children: title }), _jsx(Box, { className: `--arrow flex`, children: visible ? SVGIcons.arrowUp : SVGIcons.arrowDown })] }), visible && _jsx(Box, { className: `--detail`, children: message })] });
12
12
  });
13
- Accordion.displayName = `Accordion`;
13
+ Accordion.displayName = `Zuz.Accordion`;
14
14
  export default Accordion;
@@ -59,5 +59,5 @@ const ActionBar = forwardRef((props, ref) => {
59
59
  `${!position || position == Position.Auto ? `rel` : `--${position}`}`
60
60
  ].join(` `).trim(), ...rest, children: [items.map((item, index) => _jsx(ActionItem, { selected: _selected === item.tag || selected == index, ...item, idx: index }, `actionbar-action-${item.label.toLowerCase().replace(/\s+/g, `-`)}`)), _jsx(Box, { className: `--tip abs`, children: _jsx(Box, { className: `--track flex aic`, children: items.map(({ label }) => _jsx(Box, { className: `--lb`, children: label }, `tool-tip-${label.toLowerCase().replace(/\s+/g, `-`)}`)) }) })] });
61
61
  });
62
- ActionBar.displayName = `ActionBar`;
62
+ ActionBar.displayName = `Zuz.ActionBar`;
63
63
  export default ActionBar;
@@ -10,5 +10,5 @@ const Alert = forwardRef((props, ref) => {
10
10
  const { className, style, rest } = useBase(pops);
11
11
  return _jsxs(Box, { className: `--alert --${(type || ALERT.Info)} flex aic ${className}`.trim(), style: style, ...rest, children: [_jsx(Box, { className: `--icon icon-${icon || `auto-matic`}`, style: iconSize ? { fontSize: iconSize, width: iconSize, height: iconSize } : {}, children: !icon && SVGIcons[type || ALERT.Info] }), _jsxs(Box, { className: `--meta flex cols`, children: [_jsx(Text, { className: `--title ${message ? `--tm` : ``}`, children: title || `Lorem ipsum dolor sit amet, consectetur adipiscing elit.` }), message && _jsx(Text, { className: `--message`, h: 2, children: message })] })] });
12
12
  });
13
- Alert.displayName = `Alert`;
13
+ Alert.displayName = `Zuz.Alert`;
14
14
  export default Alert;
@@ -3,7 +3,7 @@ declare const AutoComplete: import("react").ForwardRefExoticComponent<import("..
3
3
  numeric?: boolean;
4
4
  size?: Size;
5
5
  variant?: import("../..").Variant;
6
- with?: import("../..").FORMVALIDATION;
6
+ with?: import("../..").FORMVALIDATION | `${import("../..").FORMVALIDATION}${string}`;
7
7
  } & {
8
8
  action?: string;
9
9
  data?: string[];
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { withPost } from "@zuzjs/core";
3
4
  import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
4
- import { clamp, isArray, uuid, withPost } from "../../funs";
5
+ import { clamp, isArray, uuid } from "../../funs";
5
6
  import { useBase, useDebounce } from "../../hooks";
6
7
  import { Size, TRANSITION_CURVES, TRANSITIONS } from "../../types/enums";
7
8
  import Box from "../Box";
@@ -171,5 +172,5 @@ const AutoComplete = forwardRef((props, ref) => {
171
172
  }
172
173
  })) })] });
173
174
  });
174
- AutoComplete.displayName = `AutoComplete`;
175
+ AutoComplete.displayName = `Zuz.AutoComplete`;
175
176
  export default AutoComplete;
@@ -7,9 +7,9 @@ import Box from "../Box";
7
7
  import Image from "../Image";
8
8
  import Text from "../Text";
9
9
  const Avatar = forwardRef((props, ref) => {
10
- const { src, size, variant, type, crossOrigin, referrerPolicy, animate, as, alt, color, ...pops } = props;
11
- const [img, imgStatus, imgError] = src ? useImage(src, crossOrigin, referrerPolicy) : [`x`, `y`, `z`];
12
- const { className, style, rest } = useBase({ animate, as });
10
+ const { src, size, variant, type, crossOrigin, referrerPolicy, fx, as, alt, color, ...pops } = props;
11
+ const [img, imgStatus, imgError] = useImage(src ?? "", crossOrigin, referrerPolicy);
12
+ const { className, style, rest } = useBase({ fx, as });
13
13
  useEffect(() => {
14
14
  if (type == AVATAR.Square && !document.getElementById('squareRadiusClipPath')) {
15
15
  const svgNS = "http://www.w3.org/2000/svg";
@@ -27,11 +27,11 @@ const Avatar = forwardRef((props, ref) => {
27
27
  svg.appendChild(defs);
28
28
  document.body.appendChild(svg);
29
29
  }
30
- }, []);
30
+ }, [src]);
31
31
  return _jsx(Box, { className: `--avatar --${variant || Size.Small} --${(type || AVATAR.Circle).toLowerCase()} rel flex aic jcc ${className}`.trim(), style: {
32
32
  background: color || `var(--primary)`,
33
33
  ...style,
34
34
  }, ...rest, children: src ? _jsx(Image, { src: img, crossOrigin: crossOrigin, referrerPolicy: referrerPolicy, ...pops }) : _jsx(Text, { className: `--avatar-label`, children: (alt ? alt.charAt(0) : `A`).toUpperCase() }) });
35
35
  });
36
- Avatar.displayName = `Avatar`;
36
+ Avatar.displayName = `Zuz.Avatar`;
37
37
  export default Avatar;
@@ -22,5 +22,5 @@ const Box = forwardRef((props, ref) => {
22
22
  ...(style || {})
23
23
  }, ...rest });
24
24
  });
25
- Box.displayName = `Box`;
25
+ Box.displayName = `Zuz.Box`;
26
26
  export default Box;
@@ -12,5 +12,5 @@ const Button = forwardRef((props, ref) => {
12
12
  const { style, className, rest } = useBase(pops);
13
13
  return _jsxs("button", { className: `--button ${variant ? `--${variant}` : ``} ${size ? `--${size}` : ``} flex aic ${!reset ? `jcc` : ``} ${icon ? `ico-btn` : ``} ${className}`.trim().replace(/\s+/g, ' '), style: style, ref: ref, disabled: state == ButtonState.Loading || props.skeleton?.enabled || disabled, ...rest, children: [state == ButtonState.Loading && _jsx(Spinner, { size: Size.Small, type: spinner || SPINNER.Simple }), (!state || state == ButtonState.Normal) && _jsxs(_Fragment, { children: [icon && _jsx(Icon, { size: iconSize, name: icon }), withLabel === true ? _jsx(Span, { children: children }) : children] })] });
14
14
  });
15
- Button.displayName = `Button`;
15
+ Button.displayName = `Zuz.Button`;
16
16
  export default Button;
@@ -4,6 +4,7 @@ declare const CheckBox: import("react").ForwardRefExoticComponent<import("../.."
4
4
  type?: CHECKBOX;
5
5
  size?: import("../..").Size;
6
6
  variant?: Variant;
7
+ checked?: boolean;
7
8
  onSwitch?: (checked: boolean, value: string | number | readonly string[]) => void;
8
9
  } & import("react").RefAttributes<CheckboxHandler>>;
9
10
  export default CheckBox;
@@ -31,5 +31,5 @@ const CheckBox = forwardRef((props, ref) => {
31
31
  _setChecked(e.target.checked);
32
32
  } })] });
33
33
  });
34
- CheckBox.displayName = `CheckBox`;
34
+ CheckBox.displayName = `Zuz.CheckBox`;
35
35
  export default CheckBox;
@@ -12,6 +12,7 @@ export type CheckBoxProps = Props<"input"> & {
12
12
  type?: CHECKBOX;
13
13
  size?: Size;
14
14
  variant?: Variant;
15
+ checked?: boolean;
15
16
  onSwitch?: (checked: boolean, value: string | number | readonly string[]) => void;
16
17
  };
17
18
  /**
@@ -35,5 +35,5 @@ const ColorScheme = forwardRef((props, ref) => {
35
35
  : colorScheme == `light` ? SVGIcons.colorSchemeLight
36
36
  : SVGIcons.colorSchemeDark });
37
37
  });
38
- ColorScheme.displayName = `ColorScheme`;
38
+ ColorScheme.displayName = `Zuz.ColorScheme`;
39
39
  export default ColorScheme;
@@ -5,5 +5,7 @@ declare const ContextMenu: import("react").ForwardRefExoticComponent<BoxProps &
5
5
  items?: ContextItem[];
6
6
  offsetX?: number;
7
7
  offsetY?: number;
8
+ header?: import("react").ReactNode | import("react").FC;
9
+ footer?: import("react").ReactNode | import("react").FC;
8
10
  } & import("react").RefAttributes<ContextMenuHandler>>;
9
11
  export default ContextMenu;
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { forwardRef, useImperativeHandle, useRef, useState } from "react";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { createElement, forwardRef, useImperativeHandle, useRef, useState } from "react";
4
4
  import { useAnchorPosition, useBase } from "../../hooks";
5
5
  import { TRANSITION_CURVES } from "../../types/enums";
6
6
  import Box from "../Box";
7
7
  import MenuItem from "./item";
8
8
  const ContextMenu = forwardRef((props, ref) => {
9
- const { as, offsetX, offsetY, parent, items: _items, ...pops } = props;
9
+ const { as, offsetX, offsetY, parent, items: _items, header, footer, ...pops } = props;
10
10
  const { className, style, rest } = useBase(pops);
11
11
  const event = useRef(undefined);
12
12
  const [visible, setVisible] = useState(false);
@@ -25,7 +25,7 @@ const ContextMenu = forwardRef((props, ref) => {
25
25
  },
26
26
  hide: (e) => setVisible(false),
27
27
  }));
28
- return _jsx(Box, { className: `--contextmenu abs flex cols ${className}`.trim(), "aria-hidden": !visible, style: {
28
+ return _jsxs(Box, { className: `--contextmenu abs flex cols ${className}`.trim(), "aria-hidden": !visible, style: {
29
29
  ...style,
30
30
  top: position.top,
31
31
  left: position.left
@@ -35,7 +35,7 @@ const ContextMenu = forwardRef((props, ref) => {
35
35
  curve: TRANSITION_CURVES.EaseInOut,
36
36
  duration: 0.05,
37
37
  when: visible
38
- }, ref: targetRef, ...rest, children: items.map((item, index) => _jsx(MenuItem, { ...{ ...item, index } }, `context-${item.label.toLowerCase()}-${index}`)) });
38
+ }, ref: targetRef, ...rest, children: [typeof header == `function` ? createElement(header) : header, items.map((item, index) => _jsx(MenuItem, { ...{ ...item, index } }, `context-${item.label.toLowerCase()}-${index}`)), typeof footer == `function` ? createElement(footer) : footer] });
39
39
  });
40
- ContextMenu.displayName = `ContextMenu`;
40
+ ContextMenu.displayName = `Zuz.ContextMenu`;
41
41
  export default ContextMenu;
@@ -6,6 +6,6 @@ import Text from "../Text";
6
6
  const MenuItem = (props) => {
7
7
  const { label, labelColor, icon, iconColor, index, className, onSelect } = props;
8
8
  return label == `-` ? _jsx(Box, { className: `--line` })
9
- : _jsxs(Button, { reset: true, onClick: e => onSelect(), className: `--item ${className || ``}`.trim(), children: [_jsx(Icon, { name: icon, className: `--ico`, style: iconColor ? { color: iconColor } : {} }), _jsx(Text, { className: `--lbl flex aic`, style: labelColor ? { color: labelColor } : {}, children: label })] });
9
+ : _jsxs(Button, { reset: true, onClick: e => onSelect(), className: `--item ${className || ``}`.trim(), children: [_jsx(Box, { as: `--icon`, children: _jsx(Icon, { name: icon, className: `--ico`, style: iconColor ? { color: iconColor } : {} }) }), _jsx(Text, { className: `--lbl flex aic`, style: labelColor ? { color: labelColor } : {}, children: label })] });
10
10
  };
11
11
  export default MenuItem;
@@ -1,4 +1,4 @@
1
- import { MouseEvent } from "react";
1
+ import { FC, MouseEvent, ReactNode } from "react";
2
2
  import { BoxProps } from "../Box";
3
3
  export interface ContextItem {
4
4
  label: string;
@@ -14,6 +14,8 @@ export type ContextMenuProps = BoxProps & {
14
14
  items?: ContextItem[];
15
15
  offsetX?: number;
16
16
  offsetY?: number;
17
+ header?: ReactNode | FC;
18
+ footer?: ReactNode | FC;
17
19
  };
18
20
  export type MenuItemProps = ContextItem & {
19
21
  index: number;
@@ -25,5 +25,5 @@ const CookiesConsent = forwardRef((props, ref) => {
25
25
  delay: accepted == `accepted` ? 0 : 3
26
26
  }, as: `--cookie-consent --${accepted} --${position || Position.Left} flex cols`, children: [_jsx(Text, { as: `--title`, children: title || `This site uses cookies` }), _jsx(Text, { as: `--message`, children: message || `We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts` }), _jsxs(Box, { as: `--footer flex aic`, children: [_jsx(Button, { onClick: e => handleAction(1), as: `--accept`, children: acceptLabel || `Accept All` }), _jsx(Button, { onClick: e => handleAction(0), as: `--reject`, children: rejectLabel || `Cancel` })] })] });
27
27
  });
28
- CookiesConsent.displayName = `CookiesConsent`;
28
+ CookiesConsent.displayName = `Zuz.CookiesConsent`;
29
29
  export default CookiesConsent;
@@ -17,5 +17,5 @@ const Cover = forwardRef((props, ref) => {
17
17
  backgroundColor: `var(--cover-bg)`
18
18
  }, ...rest, children: [_jsx(Spinner, { type: spinner || SPINNER.Simple }), !hideMessage && _jsx(Text, { className: `--label`, style: { color: `var(--cover-label)` }, children: message || `loading` })] });
19
19
  });
20
- Cover.displayName = `Cover`;
20
+ Cover.displayName = `Zuz.Cover`;
21
21
  export default Cover;
@@ -0,0 +1,8 @@
1
+ import { CropHandler, CropShape } from "../..";
2
+ import { BoxProps } from "../Box";
3
+ declare const Cropper: import("react").ForwardRefExoticComponent<BoxProps & {
4
+ src: string;
5
+ shape?: CropShape;
6
+ size?: number;
7
+ } & import("react").RefAttributes<CropHandler>>;
8
+ export default Cropper;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useImperativeHandle } from "react";
3
+ import { CropShape, Slider, useBase, useImageCropper } from "../..";
4
+ import Box from "../Box";
5
+ const Cropper = forwardRef((props, ref) => {
6
+ const { src, shape, size, ...pops } = props;
7
+ const { style, className, rest } = useBase(pops);
8
+ const { canvasRef, crop, setScale, handleMouseDown, handleMouseUp, handleMouseMove } = useImageCropper(src, size || 200, shape || CropShape.Circle);
9
+ useImperativeHandle(ref, () => ({
10
+ getCropped() {
11
+ return crop();
12
+ },
13
+ setScale(scale) {
14
+ setScale(scale);
15
+ }
16
+ }));
17
+ return _jsxs(Box, { as: `--cropper --${shape || CropShape.Circle} ${className}`, style: style, ...rest, children: [_jsx("canvas", { ref: canvasRef, width: size || 200, height: size || 200, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onMouseMove: handleMouseMove }), _jsx(Box, { as: `--cropper-slider`, children: _jsx(Slider, { onChange: num => setScale(num), min: 0, max: 1, step: 0.01, value: 1 }) })] });
18
+ });
19
+ Cropper.displayName = `Zuz.Cropper`;
20
+ export default Cropper;
@@ -0,0 +1,14 @@
1
+ import { BoxProps } from "../Box";
2
+ export declare enum CropShape {
3
+ Circle = "circle",
4
+ Square = "square"
5
+ }
6
+ export type CropperProps = BoxProps & {
7
+ src: string;
8
+ shape?: CropShape;
9
+ size?: number;
10
+ };
11
+ export interface CropHandler {
12
+ getCropped: () => string;
13
+ setScale: (scale: number) => void;
14
+ }
@@ -0,0 +1,5 @@
1
+ export var CropShape;
2
+ (function (CropShape) {
3
+ CropShape["Circle"] = "circle";
4
+ CropShape["Square"] = "square";
5
+ })(CropShape || (CropShape = {}));
@@ -1,4 +1,5 @@
1
1
  declare const Crumb: import("react").ForwardRefExoticComponent<import("..").BoxProps & {
2
2
  items: import("./types").CrumbItem[];
3
- } & import("react").RefAttributes<HTMLUListElement | HTMLOListElement>>;
3
+ maxItems?: number;
4
+ } & import("react").RefAttributes<HTMLOListElement | HTMLUListElement>>;
4
5
  export default Crumb;
@@ -1,5 +1,6 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
+ import { forwardRef, useMemo } from "react";
3
4
  import Box from "../Box";
4
5
  import Button from "../Button";
5
6
  import Icon from "../Icon";
@@ -7,7 +8,16 @@ import List from "../List";
7
8
  import SVGIcons from "../svgicons";
8
9
  import Text from "../Text";
9
10
  const Crumb = forwardRef((props, ref) => {
10
- const { items } = props;
11
- return _jsx(List, { ref: ref, className: `--crumb flex aic`, direction: `rows`, seperator: _jsx(Box, { as: `--crumb-chevron`, children: SVGIcons.chevronRightOutline }), items: items.map((item, index, _items) => _jsxs(Button, { onClick: () => item.action?.(), className: `--crumb-item`, disabled: !_items[index + 1], children: [item.icon && _jsx(Icon, { as: `--crumb-icon`, name: item.icon }), _jsx(Text, { as: `--crumb-label`, children: item.label })] })) });
11
+ const { items: crumbItems, maxItems } = props;
12
+ const canSlice = useMemo(() => maxItems && maxItems > 0 && crumbItems.length > maxItems - 1, [crumbItems, maxItems]);
13
+ const items = canSlice ? [
14
+ ...crumbItems.slice(0, 2),
15
+ { ID: `.`, label: `...`, icon: `ellipsis`, action: () => { } },
16
+ ...crumbItems.slice(-maxItems)
17
+ ] : crumbItems;
18
+ return _jsx(List, { ref: ref, className: `--crumb flex aic`, direction: `rows`, seperator: _jsx(Box, { as: `--crumb-chevron`, children: SVGIcons.chevronRightOutline }), items: items.map((item, index, _items) => item.ID == `.` ?
19
+ _jsx(Box, { as: `flex aic gap:3`, children: Array(3).fill(null).map(() => _jsx(Box, { as: `w:4 h:4 bg:$text r:10` })) })
20
+ : _jsxs(Button, { onClick: () => item.action?.(), className: `--crumb-item`, disabled: !_items[index + 1], children: [item.icon && _jsx(Icon, { as: `--crumb-icon`, name: item.icon }), _jsx(Text, { as: `--crumb-label`, children: item.label })] })) });
12
21
  });
22
+ Crumb.displayName = `Zuz.Crumb`;
13
23
  export default Crumb;
@@ -8,4 +8,5 @@ export type CrumbItem = {
8
8
  };
9
9
  export type CrumbProps = BoxProps & {
10
10
  items: CrumbItem[];
11
+ maxItems?: number;
11
12
  };
@@ -61,5 +61,5 @@ const Drawer = forwardRef((props, ref) => {
61
61
  duration: speed || .5,
62
62
  }, ...rest, children: [from == DRAWER_SIDE.Top || from == DRAWER_SIDE.Bottom ? _jsx(Box, { className: `--handle` }) : null, render ? content : visible ? content : null] })] });
63
63
  });
64
- Drawer.displayName = `Drawer`;
64
+ Drawer.displayName = `Zuz.Drawer`;
65
65
  export default Drawer;
@@ -7,5 +7,5 @@ const Fab = forwardRef((props, ref) => {
7
7
  const { icon, size, position } = props;
8
8
  return _jsx(Button, { className: `--fab fixed --${size || Size.Large} --${position || `bottomright`}`, children: icon || SVGIcons.plus });
9
9
  });
10
- Fab.displayName = `Fab`;
10
+ Fab.displayName = `Zuz.Fab`;
11
11
  export default Fab;
@@ -10,5 +10,5 @@ const Filters = (props) => {
10
10
  useEffect(() => { }, [names]);
11
11
  return _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", version: "1.1", children: _jsx("defs", { children: (names || [FILTER.Gooey]).map(name => filters[name](strength)) }) });
12
12
  };
13
- Filters.displayName = `Filters`;
13
+ Filters.displayName = `Zuz.Filters`;
14
14
  export default Filters;
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { withPost } from "@zuzjs/core";
3
4
  import { forwardRef, startTransition, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
4
- import { addPropsToChildren, isEmail, withPost } from "../../funs";
5
+ import { addPropsToChildren, isEmail, isEmpty } from "../../funs";
5
6
  import { useBase } from "../../hooks";
6
7
  import { FORMVALIDATION, SHEET } from "../../types/enums";
7
8
  import Box from "../Box";
@@ -96,13 +97,28 @@ const Form = forwardRef((props, ref) => {
96
97
  console.log(`Add FORMVALIDATION.Password`);
97
98
  return false;
98
99
  case FORMVALIDATION.MatchField:
99
- const [__, field] = el.getAttribute(`with`).split(`@`);
100
+ const [__, field, condition] = el.getAttribute(`with`).split(`@`);
100
101
  const _el = document.querySelector(`[name=${field.trim()}]`);
101
102
  if (!_el)
102
103
  return false;
103
- // console.log(`matching`, _el.name, _el.value, el.name, el.value)
104
- if (_el && _el.value != el.value) {
105
- return false;
104
+ switch (condition || `direct-match`) {
105
+ //Self should not empty
106
+ case "if-not-empty":
107
+ if (_el && !isEmpty(_el.value) && _el.value != el.value) {
108
+ return false;
109
+ }
110
+ break;
111
+ case "direct-match":
112
+ if (_el &&
113
+ _el.classList.contains(`--otp`) &&
114
+ el.classList.contains(`--otp`) &&
115
+ _getPinValue(_el) != _getPinValue(el)) {
116
+ return false;
117
+ }
118
+ else if (_el && _el.value != el.value) {
119
+ return false;
120
+ }
121
+ break;
106
122
  }
107
123
  break;
108
124
  default:
@@ -261,5 +277,5 @@ const Form = forwardRef((props, ref) => {
261
277
  useEffect(_init, []);
262
278
  return _jsxs(Box, { ref: innerRef, style: style, className: `--form flex rel ${className} ${name ? `--form-${name.replace(/\s+/g, `-`)}` : ``}`, propsToRemove: [`withData`, `action`, `onSubmit`, `onSuccess`, `onError`], children: [_jsx(Sheet, { ref: sheet, as: `--sheet-form` }), !isSheetHandler(cover) && _jsx(Cover, { message: cover ? cover.message || undefined : `working`, spinner: spinner, color: cover ? `color` in cover ? cover.color : `#ffffff` : `#ffffff`, when: loading }), buildChildren] });
263
279
  });
264
- Form.displayName = `Form`;
280
+ Form.displayName = `Zuz.Form`;
265
281
  export default Form;
@@ -8,5 +8,5 @@ const Icon = forwardRef((props, ref) => {
8
8
  const { className, style, rest } = useBase(pops);
9
9
  return _jsx("div", { style: style, className: `icon-${name} --icon --${size || Size.Default} ${className}`.trim(), ref: ref, ...rest, children: Array(pathCount || 0).fill(0).map((p, i) => _jsx(Span, { className: `path${i + 1}` }, `${name}-layer-${i}`)) });
10
10
  });
11
- Icon.displayName = `Icon`;
11
+ Icon.displayName = `Zuz.Icon`;
12
12
  export default Icon;
@@ -7,5 +7,5 @@ const Image = forwardRef((props, ref) => {
7
7
  return null;
8
8
  return _jsx("img", { ref: ref, style: style, className: `${className} flex`, ...rest });
9
9
  });
10
- Image.displayName = `Image`;
10
+ Image.displayName = `Zuz.Image`;
11
11
  export default Image;
@@ -4,12 +4,12 @@ export type InputProps = Props<`input`> & {
4
4
  numeric?: boolean;
5
5
  size?: Size;
6
6
  variant?: Variant;
7
- with?: FORMVALIDATION;
7
+ with?: FORMVALIDATION | `${FORMVALIDATION}${string}`;
8
8
  };
9
9
  declare const Input: import("react").ForwardRefExoticComponent<import("../..").ZuzProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, keyof import("../..").ZuzProps> & {
10
10
  numeric?: boolean;
11
11
  size?: Size;
12
12
  variant?: Variant;
13
- with?: FORMVALIDATION;
13
+ with?: FORMVALIDATION | `${FORMVALIDATION}${string}`;
14
14
  } & import("react").RefAttributes<HTMLInputElement>>;
15
15
  export default Input;
@@ -12,5 +12,5 @@ const Input = forwardRef((props, ref) => {
12
12
  };
13
13
  return _jsx("input", { className: `--input ${size || variant ? `--${size || variant}` : ``} flex ${className}`.trim(), style: style, onInput: handleInput, ref: ref, ...rest });
14
14
  });
15
- Input.displayName = `Input`;
15
+ Input.displayName = `Zuz.Input`;
16
16
  export default Input;
@@ -29,5 +29,5 @@ const KeyBoardKeys = forwardRef(({ children, keys, variant }, ref) => {
29
29
  }, [keys]);
30
30
  return _jsxs(Box, { as: `--keyboard-keys --${variant || Variant.Small} flex aic`, children: [(Array.isArray(_meta.keys) ? _meta.keys : [_meta.keys]).map((k) => _jsx("abbr", { title: KeysLabelMap[k], children: KeysMap[k] }, k)), _jsx(Span, { children: _meta?.children ?? children })] });
31
31
  });
32
- KeyBoardKeys.displayName = `ZuzUI.KeyboardKeys`;
32
+ KeyBoardKeys.displayName = `Zuz.KeyboardKeys`;
33
33
  export default KeyBoardKeys;
@@ -5,5 +5,5 @@ const Label = forwardRef((props, ref) => {
5
5
  const { style, className, rest } = useBase(props);
6
6
  return _jsx("label", { ref: ref, style: style, className: className, ...rest });
7
7
  });
8
- Label.displayName = `Label`;
8
+ Label.displayName = `Zuz.Label`;
9
9
  export default Label;
@@ -6,5 +6,5 @@ declare const List: import("react").ForwardRefExoticComponent<import("../..").Zu
6
6
  direction?: "cols" | "rows";
7
7
  seperator?: import("react").ReactNode;
8
8
  ol?: boolean;
9
- } & import("react").RefAttributes<HTMLUListElement | HTMLOListElement>>;
9
+ } & import("react").RefAttributes<HTMLOListElement | HTMLUListElement>>;
10
10
  export default List;
@@ -14,5 +14,5 @@ const List = forwardRef((props, ref) => {
14
14
  children: items.map((item, index, _items) => _jsxs(_Fragment, { children: [_jsx(Item, { meta: item }, `list-item-${typeof item == `string` ? String(item) : item.label}-${index}`), seperator && _items[index + 1] ? _jsx("li", { className: `--list-seperator`, children: seperator }) : null] }))
15
15
  });
16
16
  });
17
- List.displayName = `List`;
17
+ List.displayName = `Zuz.List`;
18
18
  export default List;
@@ -17,5 +17,5 @@ const NetworkManager = forwardRef((props, ref) => {
17
17
  delay: 2
18
18
  }, className: `--network-manager --${isOnline == true ? `online` : `offline`} --${size || Size.Small} fixed flex`, children: [_jsx(Box, { className: `--ico`, children: isOnline ? SVGIcons[ALERT.Success] : SVGIcons[ALERT.Error] }), _jsx(Text, { as: `--message`, children: isOnline ? onlineMessage || `internet connection restored :)` : offlineMessage || `no internet connection` })] });
19
19
  });
20
- NetworkManager.displayName = `ZuzUI.NetWorkManager`;
20
+ NetworkManager.displayName = `Zuz.NetWorkManager`;
21
21
  export default NetworkManager;
@@ -9,5 +9,5 @@ export const Overlay = forwardRef((props, ref) => {
9
9
  when,
10
10
  }, ...pops });
11
11
  });
12
- Overlay.displayName = `Overlay`;
12
+ Overlay.displayName = `Zuz.Overlay`;
13
13
  export default Overlay;
@@ -59,5 +59,5 @@ const Pagination = forwardRef((props, ref) => {
59
59
  `${Math.min(getPageValue(_currentPage) * itemsPerPage, itemCount)} of ${itemCount} items`
60
60
  ].join(` `) }), _jsxs(Box, { as: `flex aic jce flex:1 --pgt-btns --pgt-nav`, children: [_jsx(Button, { disabled: getPageValue(_currentPage) <= 1, onClick: (ev) => handlePage({ id: hash ? _hash(getPageValue(_currentPage) - 1) : getPageValue(_currentPage) - 1, label: getPageValue(_currentPage) - 1 }), children: SVGIcons.chevronLeftOutline }), _jsx(Button, { disabled: pages.length <= 1 || getPageValue(_currentPage) == getPageValue(pages[pages.length - 1]), onClick: (ev) => handlePage({ id: hash ? _hash(getPageValue(_currentPage) + 1) : getPageValue(_currentPage) + 1, label: getPageValue(_currentPage) + 1 }), children: SVGIcons.chevronRightOutline })] })] });
61
61
  });
62
- Pagination.displayName = `Pagination`;
62
+ Pagination.displayName = `Zuz.Pagination`;
63
63
  export default Pagination;
@@ -1,4 +1,8 @@
1
1
  import { InputProps } from '../Input';
2
- export type PasswordProps = Omit<InputProps, `type` | `numeric`> & {};
3
- declare const Password: import("react").ForwardRefExoticComponent<Omit<InputProps, "type" | "numeric"> & import("react").RefAttributes<HTMLInputElement>>;
2
+ export type PasswordProps = Omit<InputProps, `type` | `numeric`> & {
3
+ strenthMeter?: boolean;
4
+ };
5
+ declare const Password: import("react").ForwardRefExoticComponent<Omit<InputProps, "type" | "numeric"> & {
6
+ strenthMeter?: boolean;
7
+ } & import("react").RefAttributes<HTMLInputElement>>;
4
8
  export default Password;
@@ -1,19 +1,29 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { forwardRef, useState } from 'react';
4
- import { useBase } from '../../hooks';
3
+ import { forwardRef, useEffect, useMemo, useState } from 'react';
4
+ import { checkPasswordStrength } from '../../funs';
5
+ import { useBase, useDebounce } from '../../hooks';
5
6
  import Box from '../Box';
6
7
  import Button from '../Button';
7
8
  import Input from '../Input';
8
9
  import SVGIcons from '../svgicons';
10
+ import Text from '../Text';
9
11
  const Password = forwardRef((props, ref) => {
10
- const { ...pops } = props;
12
+ const { strenthMeter, onChange, ...pops } = props;
11
13
  if (`type` in pops) {
12
14
  delete pops[`type`];
13
15
  }
14
16
  const { style, className, rest } = useBase(pops);
15
17
  const [visible, setVisible] = useState(false);
16
- return _jsxs(Box, { style: style, className: `--password flex aic rel`, children: [_jsx(Input, { ref: ref, type: visible ? 'text' : 'password', className: className, ...rest }), _jsx(Button, { tabIndex: -1, onClick: () => setVisible(prev => !prev), className: `--toggle flex aic jcc abs`, children: visible ? SVGIcons.eye : SVGIcons.eyeSlash })] });
18
+ const [passw, setPassw] = useState("");
19
+ const strenth = useMemo(() => checkPasswordStrength(passw), [passw]);
20
+ const debounce = useDebounce((ev) => {
21
+ if (strenthMeter)
22
+ setPassw(ev.target.value);
23
+ onChange && onChange(ev);
24
+ }, 100);
25
+ useEffect(() => { }, []);
26
+ return _jsxs(Box, { as: `w:100% flex cols`, children: [_jsxs(Box, { style: style, className: `--password flex aic rel`, children: [_jsx(Input, { ref: ref, type: visible ? 'text' : 'password', className: className, onChange: debounce, ...rest }), _jsx(Button, { tabIndex: -1, onClick: () => setVisible(prev => !prev), className: `--toggle flex aic jcc abs`, children: visible ? SVGIcons.eye : SVGIcons.eyeSlash })] }), strenthMeter && _jsxs(Box, { as: `flex aic --password-meter --pb-score-${strenth.score}`, children: [_jsxs(Box, { as: `--password-bars flex aic`, children: [_jsx(Box, { as: `--pbar ${strenth.score >= 1 ? `--pb-on` : ``}`.trim() }), _jsx(Box, { as: `--pbar ${strenth.score >= 2 ? `--pb-on` : ``}`.trim() }), _jsx(Box, { as: `--pbar ${strenth.score >= 3 ? `--pb-on` : ``}`.trim() }), _jsx(Box, { as: `--pbar ${strenth.score >= 4 ? `--pb-on` : ``}`.trim() }), _jsx(Box, { as: `--pbar ${strenth.score >= 5 ? `--pb-on` : ``}`.trim() })] }), _jsx(Text, { as: `--password-meter-label`, "aria-hidden": true, children: strenth.result })] })] });
17
27
  });
18
- Password.displayName = `Password`;
28
+ Password.displayName = `Zuz.Password`;
19
29
  export default Password;
@@ -8,7 +8,7 @@ declare const PinInput: import("react").ForwardRefExoticComponent<import("../.."
8
8
  numeric?: boolean;
9
9
  size?: import("../..").Size;
10
10
  variant?: import("../..").Variant;
11
- with?: import("../..").FORMVALIDATION;
11
+ with?: import("../..").FORMVALIDATION | `${import("../..").FORMVALIDATION}${string}`;
12
12
  } & {
13
13
  mask?: boolean;
14
14
  size?: number;
@@ -9,6 +9,11 @@ const PinInput = forwardRef((props, ref) => {
9
9
  const inputs = useRef([]);
10
10
  let name = `pinput`;
11
11
  let required = false;
12
+ let _with = {};
13
+ if (`with` in pops) {
14
+ _with = { with: pops.with };
15
+ delete pops.with;
16
+ }
12
17
  if (`type` in pops) {
13
18
  delete pops.type;
14
19
  }
@@ -35,9 +40,9 @@ const PinInput = forwardRef((props, ref) => {
35
40
  useEffect(() => {
36
41
  inputs.current = inputs.current.slice(0, size || length);
37
42
  }, [size || length]);
38
- return _jsx(Box, { name: name, style: style, className: `--otp flex aic rel`, "data-required": required, "data-size": size || length || 4, children: Array(size || length || 4).fill(1).map((a, i) => _jsx(Input, { "data-index": i, ref: (el) => {
43
+ return _jsx(Box, { name: name, style: style, className: `--otp flex aic rel`, "data-required": required, "data-size": size || length || 4, ..._with, children: Array(size || length || 4).fill(1).map((a, i) => _jsx(Input, { autoComplete: "new-password", "data-index": i, ref: (el) => {
39
44
  inputs.current[i] = el;
40
- }, numeric: true, onChange: handleInput, maxLength: 1, placeholder: `0`, type: mask ? `password` : 'text', ...pops }, `pin-${i}`)) });
45
+ }, numeric: true, onChange: handleInput, maxLength: 1, placeholder: mask ? `·` : `0`, type: mask ? `password` : 'text', ...pops }, `pin-${i}`)) });
41
46
  });
42
- PinInput.displayName = `PinInput`;
47
+ PinInput.displayName = `Zuz.PinInput`;
43
48
  export default PinInput;
@@ -15,9 +15,9 @@ const ProgressBar = forwardRef((props, ref) => {
15
15
  if (progress && bar.current) {
16
16
  bar.current.style.width = `${progress * 100}%`;
17
17
  }
18
- }, []);
18
+ }, [progress, bar.current]);
19
19
  const { className, style, rest } = useBase(pops);
20
20
  return _jsx(Box, { className: `--progress flex rel ${className}`.trim(), style: style, ...rest, children: _jsx(Box, { ref: bar, className: `--bar rel` }) });
21
21
  });
22
- ProgressBar.displayName = `ProgressBar`;
22
+ ProgressBar.displayName = `Zuz.ProgressBar`;
23
23
  export default ProgressBar;
@@ -15,5 +15,5 @@ const Radio = forwardRef((props, _ref) => {
15
15
  _setChecked(e.target.checked);
16
16
  } }), _jsx(Box, { className: `--dot rel`, children: _jsx(Box, { className: `--rod abs abc` }) }), _jsx(Box, { className: `--value`, children: children })] });
17
17
  });
18
- Radio.displayName = `Radio`;
18
+ Radio.displayName = `Zuz.Radio`;
19
19
  export default Radio;
@@ -9,5 +9,5 @@ const ScrollView = forwardRef((props, ref) => {
9
9
  // useEffect(() => { }, [])
10
10
  return _jsxs(Box, { ref: rootRef, className: className.trim(), as: `--scrollview rel`, children: [_jsx(Box, { as: `--scroll-content`, ref: containerRef, style: _style || {}, children: rest.children }), _jsx(Box, { as: `--scroll-track --track-y abs`, children: _jsx(Box, { as: `--scroll-thumb abs`, ref: thumbY, onMouseDown: onScrollY }) }), _jsx(Box, { as: `--scroll-track --track-x abs`, children: _jsx(Box, { as: `--scroll-thumb abs`, ref: thumbX, onMouseDown: onScrollX }) })] });
11
11
  });
12
- ScrollView.displayName = `ZuzUI.ScrollView`;
12
+ ScrollView.displayName = `Zuz.ScrollView`;
13
13
  export default ScrollView;