@zuzjs/ui 0.8.1 → 0.8.2

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
@@ -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;
@@ -4,7 +4,7 @@ declare const Search: import("react").ForwardRefExoticComponent<import("../..").
4
4
  numeric?: boolean;
5
5
  size?: import("../..").Size;
6
6
  variant?: Variant;
7
- with?: import("../..").FORMVALIDATION;
7
+ with?: import("../..").FORMVALIDATION | `${import("../..").FORMVALIDATION}${string}`;
8
8
  } & {
9
9
  onSubmit?: (value: string) => void;
10
10
  onChange?: (value: string) => void;
@@ -38,5 +38,5 @@ const Search = forwardRef((props, ref) => {
38
38
  useEffect(() => { }, []);
39
39
  return _jsxs(Box, { style: style, className: `--search ${reverse ? `--search-rev` : ``} --${props.variant || Variant.Small} flex aic ${props.as?.includes(`abs`) ? `` : `rel`} ${className}`.trim(), children: [reverse && _jsx(Button, { tabIndex: -1, onClick: e => handleSubmit(), className: `--send flex aic jcc`, variant: props.variant || Variant.Small, children: query !== `` ? SVGIcons.close : SVGIcons.search }), _jsx(Input, { ref: innerRef, onChange: handleChange, className: `--${props.variant || Variant.Small}`, ...pops }), props.shortcut && _jsx(KeyBoardKeys, { keys: props.shortcut, as: `abs` }), !reverse && _jsx(Button, { tabIndex: -1, onClick: e => handleSubmit(), className: `--send flex aic jcc`, variant: props.variant || Variant.Small, children: query !== `` ? SVGIcons.close : SVGIcons.search })] });
40
40
  });
41
- Search.displayName = `Search`;
41
+ Search.displayName = `Zuz.Search`;
42
42
  export default Search;
@@ -59,5 +59,5 @@ const Segmented = forwardRef((props, ref) => {
59
59
  index: i
60
60
  } }, `segment-${item.label}-${i}`))] });
61
61
  });
62
- Segmented.displayName = `ZuzUI.SelectTabs`;
62
+ Segmented.displayName = `Zuz.SelectTabs`;
63
63
  export default Segmented;
@@ -1,5 +1,6 @@
1
1
  import { Option } from "./types";
2
2
  declare const Select: import("react").ForwardRefExoticComponent<Omit<import("..").BoxProps, "onChange"> & {
3
+ variant?: import("../..").Variant;
3
4
  required?: import("../..").FORMVALIDATION;
4
5
  options: Option[];
5
6
  label?: string;
@@ -9,7 +9,7 @@ import SVGIcons from "../svgicons";
9
9
  import Text from "../Text";
10
10
  import OptionItem from "./optionItem";
11
11
  const Select = forwardRef((props, ref) => {
12
- const { selected, options, label, name, search: withSearch, searchPlaceholder, onChange, ...pops } = props;
12
+ const { selected, options, label, name, variant, search: withSearch, searchPlaceholder, onChange, ...pops } = props;
13
13
  const [value, setValue] = useState(selected ?
14
14
  typeof selected === `string` ? options.find(fo => fo.value === selected) : selected
15
15
  : options[0]);
@@ -40,7 +40,7 @@ const Select = forwardRef((props, ref) => {
40
40
  setQuery(null);
41
41
  }
42
42
  }, [choosing]);
43
- return _jsxs(Box, { className: `--select ${name ? `--${name}` : ``} rel`.trim(), name: _id, children: [_jsxs(Button, { "data-value": value ? `string` == typeof value ? value : value.value : value || `-1`, className: `--selected flex aic rel ${className}`.trim(), withLabel: false, style: style, onClick: (e) => setChoosing(prev => !prev), ...rest, children: [_jsx(Text, { className: `--label`, children: value ? `string` == typeof value ? value : value.label : label || `Choose` }), _jsx(Box, { className: `--svg-arrow rel flex aic jcc`, children: choosing ? SVGIcons.arrowUp : SVGIcons.arrowDown })] }), _jsxs(Box, { id: _id, className: `--options-list flex cols abs`, style: {
43
+ return _jsxs(Box, { className: `--select ${variant ? `--${variant}` : ``} ${name ? `--${name}` : ``} rel`.trim(), name: _id, children: [_jsxs(Button, { "data-value": value ? `string` == typeof value ? value : value.value : value || `-1`, className: `--selected flex aic rel ${className}`.trim(), withLabel: false, style: style, onClick: (e) => setChoosing(prev => !prev), ...rest, children: [_jsx(Text, { className: `--label`, children: value ? `string` == typeof value ? value : value.label : label || `Choose` }), _jsx(Box, { className: `--svg-arrow rel flex aic jcc`, children: choosing ? SVGIcons.arrowUp : SVGIcons.arrowDown })] }), _jsxs(Box, { id: _id, className: `--options-list flex cols abs`, style: {
44
44
  pointerEvents: choosing ? `auto` : `none`,
45
45
  }, animate: {
46
46
  from: { y: 5, opacity: 0 },
@@ -58,5 +58,5 @@ const Select = forwardRef((props, ref) => {
58
58
  }))
59
59
  .map((o) => _jsx(OptionItem, { updateValue: updateValue, value: value, o: o }, `option-${(`string` == typeof o ? o : o.label).replace(/\s+/g, `-`)}-${`string` == typeof o ? o : o.value}`))] })] });
60
60
  });
61
- Select.displayName = `Select`;
61
+ Select.displayName = `Zuz.Select`;
62
62
  export default Select;
@@ -1,5 +1,5 @@
1
1
  import { FormEventHandler } from "react";
2
- import { FORMVALIDATION } from "../../types/enums";
2
+ import { FORMVALIDATION, Variant } from "../../types/enums";
3
3
  import { BoxProps } from "../Box";
4
4
  /**
5
5
  * Represents an option which can be either a string or an OptionObject.
@@ -21,6 +21,11 @@ export interface OptionItemProps {
21
21
  * Props for the Select component.
22
22
  */
23
23
  export type SelectProps = Omit<BoxProps, "onChange"> & {
24
+ /**
25
+ * Size of the select field.
26
+ * @default "md"
27
+ */
28
+ variant?: Variant;
24
29
  /**
25
30
  * Indicates if the select field is required and its validation type.
26
31
  */
@@ -189,5 +189,5 @@ export const isSheetHandler = (src) => {
189
189
  && `success` in src
190
190
  && `error` in src;
191
191
  };
192
- Sheet.displayName = `Sheet`;
192
+ Sheet.displayName = `Zuz.Sheet`;
193
193
  export default Sheet;
@@ -5,5 +5,5 @@ const Sidebar = forwardRef((props, ref) => {
5
5
  const { layout, logo } = props;
6
6
  return _jsxs(Box, { ref: ref, className: `--sidebar --${layout || `2-columns`} flex cols`, children: [_jsx(Box, { as: `--logo`, children: logo }), _jsx(Box, { as: `--nav flex cols` })] });
7
7
  });
8
- Sidebar.displayName = `Sidebar`;
8
+ Sidebar.displayName = `Zuz.Sidebar`;
9
9
  export default Sidebar;
@@ -78,5 +78,5 @@ const Slider = forwardRef((props, ref) => {
78
78
  }, [isDragging]);
79
79
  return _jsx(Box, { ref: slider, "data-value": value || 0, className: `--slider --${type || SLIDER.Default} flex rel ${className}`.trim(), style: { ...style }, children: SLIDER.Text === type ? _jsx(_Fragment, { children: _jsx(Text, { ref: text, onMouseDown: handleMouseDown, className: `--slider-text`, children: value || 0 }) }) : _jsxs(_Fragment, { children: [_jsx(Box, { ref: track, className: `--slider-track abs fill` }), _jsx(Box, { ref: knob, className: `--slider-knob abs` }), _jsx(Input, { ref: input, onInput: handleInput, className: `abs fill`, tabIndex: 0, type: type || SLIDER.Default, defaultValue: value || 0, step: step, max: max, min: min })] }) });
80
80
  });
81
- Slider.displayName = `Slider`;
81
+ Slider.displayName = `Zuz.Slider`;
82
82
  export default Slider;
@@ -7,5 +7,5 @@ const Span = forwardRef((props, ref) => {
7
7
  const { style: _style, className, rest } = useBase(pops);
8
8
  return _jsx("span", { ref: ref, style: style, className: className, ...rest });
9
9
  });
10
- Span.displayName = `Span`;
10
+ Span.displayName = `Zuz.Span`;
11
11
  export default Span;
@@ -49,5 +49,5 @@ const Spinner = forwardRef((props, ref) => {
49
49
  ...build()
50
50
  }, ...rest, children: child() });
51
51
  });
52
- Spinner.displayName = `ZuzUI.Spinner`;
52
+ Spinner.displayName = `Zuz.Spinner`;
53
53
  export default Spinner;
@@ -4,6 +4,7 @@ declare const Switch: import("react").ForwardRefExoticComponent<import("../..").
4
4
  type?: CHECKBOX;
5
5
  size?: import("../..").Size;
6
6
  variant?: import("../..").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 Switch;
@@ -5,5 +5,5 @@ import CheckBox from "../CheckBox";
5
5
  const Switch = forwardRef((props, ref) => {
6
6
  return _jsx(CheckBox, { type: CHECKBOX.Switch, ...props, ref: ref });
7
7
  });
8
- Switch.displayName = `Switch`;
8
+ Switch.displayName = `Zuz.Switch`;
9
9
  export default Switch;
@@ -21,5 +21,5 @@ const TabBody = ({ size, index, active, render, content }) => {
21
21
  ...style
22
22
  }, className: `--content`, children: (render || active) && content });
23
23
  };
24
- TabBody.displayName = `TabBody`;
24
+ TabBody.displayName = `Zuz.TabBody`;
25
25
  export default TabBody;
@@ -46,5 +46,5 @@ const TabView = forwardRef((props, ref) => {
46
46
  transition: `all ${speed || 0.3}s ease-in-out 0s`, transform: `translate(-${activeTab * size.width}px, 0)`
47
47
  }, children: tabs.map((tab, index) => _jsx(TabBody, { index: index, active: index === activeTab, size: size, render: render, content: tab.body }, `tab-body-${tab.key || index}-${tabViewID}`)) }) })] });
48
48
  });
49
- TabView.displayName = `TabView`;
49
+ TabView.displayName = `Zuz.TabView`;
50
50
  export default TabView;
@@ -6,5 +6,5 @@ const TabItem = ({ tab, index, activeTab, onClick }) => {
6
6
  const { icon, label } = tab;
7
7
  return _jsxs(Button, { onClick: e => onClick(index), className: `--tab jcc ${index === activeTab ? '--active' : ''}`.trim(), children: [icon && (typeof icon === 'string' ? _jsx(Icon, { className: `--icon`, name: icon }) : icon), _jsx(Text, { className: `--label rel`, children: label })] });
8
8
  };
9
- TabItem.displayName = `TabItem`;
9
+ TabItem.displayName = `Zuz.TabItem`;
10
10
  export default TabItem;
@@ -19,5 +19,5 @@ const TColumn = (props) => {
19
19
  && sortBy == id
20
20
  && _jsx(Box, { as: `--arrow flex aib`, children: _sort == 1 ? SVGIcons.arrowUp : SVGIcons.arrowDown })] });
21
21
  };
22
- TColumn.displayName = `Column`;
22
+ TColumn.displayName = `Zuz.Column`;
23
23
  export default TColumn;
@@ -7,7 +7,61 @@ import Box from "../Box";
7
7
  import Pagination from "../Pagination";
8
8
  import { PaginationStyle } from "../Pagination/types";
9
9
  import TRow from "./row";
10
- // const Table = forwardRef<HTMLDivElement, TableProps>((props, ref) => {
10
+ /**
11
+ * `Table` is a highly flexible and customizable generic component for rendering data in a tabular format.
12
+ *
13
+ * This component supports features such as:
14
+ * - Dynamic column schema and row data.
15
+ * - Sortable and selectable rows.
16
+ * - Optional pagination with custom control.
17
+ * - Row-level animation and hover states.
18
+ * - Loading placeholders and spinners.
19
+ * - Context menu support for rows.
20
+ *
21
+ * @template T - The shape of the row data object.
22
+ *
23
+ * @param props - The props for configuring the table behavior and appearance.
24
+ * @param props.schema - Column definitions used to render the table header and body.
25
+ * @param props.rows - The array of row data to display.
26
+ * @param props.rowCount - Optional total row count for server-side pagination.
27
+ * @param props.rowsPerPage - Number of rows shown per page.
28
+ * @param props.currentPage - Current page index (for pagination control).
29
+ * @param props.pagination - Whether pagination is enabled.
30
+ * @param props.paginationHash - A value to force pagination re-render.
31
+ * @param props.showPaginationOnZeroPageCount - Show pagination controls even with 0 rows.
32
+ * @param props.animateRows - Whether to animate rows on render/update.
33
+ * @param props.header - Whether to show the header row.
34
+ * @param props.rowClassName - CSS class name to apply to each row.
35
+ * @param props.selectableRows - Whether rows are selectable.
36
+ * @param props.hoverable - Whether rows should show hover styles.
37
+ * @param props.sortBy - Default column key to sort rows.
38
+ * @param props.loading - Enables loading state with placeholder rows and spinner.
39
+ * @param props.loadingRowCount - Number of placeholder rows to render during loading.
40
+ * @param props.loadingMessage - Optional loading text to show next to spinner.
41
+ * @param props.spinner - Spinner type to use when loading.
42
+ * @param props.onSort - Callback when a column header triggers sorting.
43
+ * @param props.onRowSelectToggle - Callback when a row’s selected state changes.
44
+ * @param props.onPageChange - Callback when pagination state changes.
45
+ * @param props.onRowContextMenu - Callback when a row is right-clicked.
46
+ * @param props.className - Additional class names to apply to the root table container.
47
+ * @param props.style - Inline styles to apply to the root table container.
48
+ *
49
+ * @returns The rendered table component.
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * <Table
54
+ * schema={[
55
+ * { id: 'name', value: 'Name', sortable: true },
56
+ * { id: 'email', value: 'Email' },
57
+ * ]}
58
+ * rows={[{ name: 'Kamran', email: 'kamran@example.com' }]}
59
+ * selectableRows
60
+ * pagination
61
+ * loading={false}
62
+ * />
63
+ * ```
64
+ */
11
65
  const Table = (props, ref) => {
12
66
  const { schema, rows, rowCount, rowsPerPage, currentPage, pagination, paginationHash, showPaginationOnZeroPageCount, animateRows, header, rowClassName, selectableRows, hoverable, sortBy, loading, loadingRowCount, loadingMessage, spinner, onSort, onRowSelectToggle, onPageChange, onRowContextMenu, ...pops } = props;
13
67
  const _pagination = useRef(null);
@@ -43,6 +97,6 @@ const Table = (props, ref) => {
43
97
  const _paginated = useMemo(() => _jsx(Pagination, { hash: paginationHash, ref: _pagination, renderOnZeroPageCount: showPaginationOnZeroPageCount, onPageChange: onPageChange, paginationStyle: PaginationStyle.Table, startPage: currentPage, itemCount: rowCount || (rows ? rows.length : 0), itemsPerPage: rowsPerPage || 10 }), []);
44
98
  return _jsxs(Box, { as: `--table ${(hoverable ?? true) ? `--hoverable` : ``} flex cols rel ${className}`, ref: _tableRef, children: [_header == true && _jsx(TRow, { sortBy: _sortBy, onSort: handleSort, tableRef: _tableRef, pubsub: pubsub, selectable: selectableRows, index: -1, schema: schema, loading: true, styles: _schemaParsed }), loading && _jsxs(Box, { as: `abs center-x flex aic --table-spinner`, children: [_jsx(Spinner, { type: spinner || SPINNER.Simple }), loadingMessage && _jsx(Text, { as: `--table-loading-message`, children: loadingMessage })] }), loading && Array(loadingRowCount || 5).fill({}).map((row, index) => _jsx(TRow, { tableRef: _tableRef, index: index, pubsub: pubsub, schema: schema, styles: _schemaParsed, loading: true, animate: animateRows }, `--trow-loading-${index}-${schema[0].id}`)), !loading && rows && rows.map((row, index) => _jsx(TRow, { tableRef: _tableRef, pubsub: pubsub, loading: false, index: index, schema: schema, ids: _cols, styles: _schemaParsed, animate: animateRows, data: row, rowClassName: rowClassName, selectable: selectableRows, onSelect: onRowSelectToggle, onContextMenu: onRowContextMenu }, `--trow-${rowKeys.current[index] || index}-${schema[0].id}`)), pagination && _pagination.current != null && _jsx(Box, { as: `--row flex aic --row-footer`, children: _paginated })] });
45
99
  };
46
- Table.displayName = `Table`;
100
+ Table.displayName = `Zuz.Table`;
47
101
  const ForwardedTable = forwardRef(Table);
48
102
  export default ForwardedTable;
@@ -83,5 +83,5 @@ const TRow = (props) => {
83
83
  return _jsxs(Fragment, { children: [selectable && i == 0 && Selector(i, `--selector-${c.id}`, c.id.toString()), ids.includes(String(c.id)) ? _jsx(TColumn, { pubsub: pubsub, idx: i, id: String(c.id), style: styles[String(c.id)], value: c.render ? c.render(data, index) : data[String(c.id).includes(`.`) ? String(c.id).split(`.`).reverse()[0] : c.id] }) : null] }, `--${String(c.id)}-val-${i}`);
84
84
  })] });
85
85
  };
86
- TRow.displayName = `Row`;
86
+ TRow.displayName = `Zuz.Row`;
87
87
  export default TRow;
@@ -10,5 +10,5 @@ const Text = forwardRef((props, ref) => {
10
10
  const Tag = `h${props.h || 1}`;
11
11
  return _jsx(Tag, { ref: ref, style: style, className: className, ...rest, children: html ? _jsx(Span, { dangerouslySetInnerHTML: { __html: html } }) : children });
12
12
  });
13
- Text.displayName = `ZuzUI.Text`;
13
+ Text.displayName = `Zuz.Text`;
14
14
  export default Text;
@@ -9,5 +9,5 @@ const TextArea = forwardRef((props, ref) => {
9
9
  };
10
10
  return _jsx("textarea", { className: `--input --textarea --${variant || Variant.Small} flex ${className}`.trim(), style: { ...style, resize: resize || `none` }, onInput: handleInput, ref: ref, ...rest });
11
11
  });
12
- TextArea.displayName = `ZuzUI.TextArea`;
12
+ TextArea.displayName = `Zuz.TextArea`;
13
13
  export default TextArea;