@zuzjs/ui 0.7.7 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/comps/Accordion/index.js +2 -1
- package/dist/cjs/comps/Actionbar/index.d.ts +1 -1
- package/dist/cjs/comps/Actionbar/index.js +3 -2
- package/dist/cjs/comps/Alert/index.d.ts +1 -1
- package/dist/cjs/comps/Alert/index.js +1 -0
- package/dist/cjs/comps/AutoComplete/index.js +1 -0
- package/dist/cjs/comps/Avatar/index.js +3 -2
- package/dist/cjs/comps/Box/index.js +1 -1
- package/dist/cjs/comps/Button/index.d.ts +1 -1
- package/dist/cjs/comps/Button/index.js +4 -3
- package/dist/cjs/comps/CheckBox/index.d.ts +2 -2
- package/dist/cjs/comps/CheckBox/index.js +2 -1
- package/dist/cjs/comps/ColorScheme/index.d.ts +1 -1
- package/dist/cjs/comps/ColorScheme/index.js +7 -2
- package/dist/cjs/comps/ContextMenu/index.js +3 -2
- package/dist/cjs/comps/CookiesConsent/index.js +3 -2
- package/dist/cjs/comps/Cover/index.d.ts +1 -1
- package/dist/cjs/comps/Cover/index.js +3 -2
- package/dist/cjs/comps/Drawer/index.js +1 -0
- package/dist/cjs/comps/Editor/Timeline/index.js +4 -3
- package/dist/cjs/comps/Editor/index.js +2 -1
- package/dist/cjs/comps/Fab/index.d.ts +1 -2
- package/dist/cjs/comps/Fab/index.js +2 -1
- package/dist/cjs/comps/Filters/index.d.ts +4 -1
- package/dist/cjs/comps/Filters/index.js +1 -0
- package/dist/cjs/comps/Form/index.d.ts +2 -2
- package/dist/cjs/comps/Form/index.js +5 -7
- package/dist/cjs/comps/Icon/index.d.ts +1 -1
- package/dist/cjs/comps/Icon/index.js +2 -1
- package/dist/cjs/comps/Image/index.js +1 -0
- package/dist/cjs/comps/Input/index.js +1 -0
- package/dist/cjs/comps/Label/index.js +1 -0
- package/dist/cjs/comps/List/index.d.ts +1 -1
- package/dist/cjs/comps/List/index.js +1 -0
- package/dist/cjs/comps/List/item.d.ts +6 -3
- package/dist/cjs/comps/List/item.js +1 -0
- package/dist/cjs/comps/Network/index.js +4 -3
- package/dist/cjs/comps/Overlay/index.js +2 -1
- package/dist/cjs/comps/Pagination/index.js +1 -0
- package/dist/cjs/comps/Password/index.js +2 -1
- package/dist/cjs/comps/PinInput/index.js +2 -1
- package/dist/cjs/comps/ProgressBar/index.js +1 -0
- package/dist/cjs/comps/Radio/index.js +1 -0
- package/dist/cjs/comps/Search/index.d.ts +1 -1
- package/dist/cjs/comps/Search/index.js +3 -2
- package/dist/cjs/comps/Segmented/index.js +2 -2
- package/dist/cjs/comps/Segmented/item.d.ts +4 -1
- package/dist/cjs/comps/Segmented/item.js +8 -15
- package/dist/cjs/comps/Select/index.d.ts +2 -4
- package/dist/cjs/comps/Select/index.js +4 -3
- package/dist/cjs/comps/Select/optionItem.d.ts +4 -1
- package/dist/cjs/comps/Select/optionItem.js +1 -0
- package/dist/cjs/comps/Sheet/index.d.ts +1 -1
- package/dist/cjs/comps/Sheet/index.js +4 -3
- package/dist/cjs/comps/Sidebar/index.js +1 -0
- package/dist/cjs/comps/Slider/index.d.ts +1 -1
- package/dist/cjs/comps/Slider/index.js +3 -2
- package/dist/cjs/comps/Span/index.js +1 -0
- package/dist/cjs/comps/Spinner/index.d.ts +1 -1
- package/dist/cjs/comps/Spinner/index.js +4 -6
- package/dist/cjs/comps/Switch/index.d.ts +1 -1
- package/dist/cjs/comps/Switch/index.js +2 -1
- package/dist/cjs/comps/TabView/body.js +1 -0
- package/dist/cjs/comps/TabView/index.js +1 -0
- package/dist/cjs/comps/TabView/tab.d.ts +4 -1
- package/dist/cjs/comps/TabView/tab.js +1 -0
- package/dist/cjs/comps/Table/col.d.ts +9 -6
- package/dist/cjs/comps/Table/col.js +1 -0
- package/dist/cjs/comps/Table/index.js +1 -0
- package/dist/cjs/comps/Table/row.d.ts +4 -1
- package/dist/cjs/comps/Table/row.js +2 -1
- package/dist/cjs/comps/Text/index.js +1 -1
- package/dist/cjs/comps/TextArea/index.js +1 -0
- package/dist/cjs/comps/TextWheel/index.js +1 -0
- package/dist/cjs/comps/Tooltip/index.d.ts +1 -2
- package/dist/cjs/comps/Tooltip/index.js +2 -1
- package/dist/cjs/comps/Treeview/index.d.ts +1 -2
- package/dist/cjs/comps/Treeview/index.js +2 -1
- package/dist/cjs/comps/Treeview/item.d.ts +3 -2
- package/dist/cjs/comps/Treeview/item.js +11 -7
- package/dist/cjs/comps/Treeview/types.d.ts +6 -2
- package/dist/cjs/funs/index.d.ts +2 -1
- package/dist/cjs/funs/index.js +4 -3
- package/dist/cjs/hooks/index.d.ts +4 -5
- package/dist/cjs/hooks/index.js +2 -2
- package/dist/cjs/hooks/useDelayed.d.ts +17 -0
- package/dist/cjs/hooks/useDelayed.js +25 -0
- package/dist/cjs/index.js +1 -0
- package/dist/css/styles.css +1 -1
- package/dist/esm/comps/Accordion/index.js +2 -1
- package/dist/esm/comps/Actionbar/index.d.ts +1 -1
- package/dist/esm/comps/Actionbar/index.js +3 -2
- package/dist/esm/comps/Alert/index.d.ts +1 -1
- package/dist/esm/comps/Alert/index.js +1 -0
- package/dist/esm/comps/AutoComplete/index.js +1 -0
- package/dist/esm/comps/Avatar/index.js +3 -2
- package/dist/esm/comps/Box/index.js +1 -1
- package/dist/esm/comps/Button/index.d.ts +1 -1
- package/dist/esm/comps/Button/index.js +4 -3
- package/dist/esm/comps/CheckBox/index.d.ts +2 -2
- package/dist/esm/comps/CheckBox/index.js +2 -1
- package/dist/esm/comps/ColorScheme/index.d.ts +1 -1
- package/dist/esm/comps/ColorScheme/index.js +7 -2
- package/dist/esm/comps/ContextMenu/index.js +3 -2
- package/dist/esm/comps/CookiesConsent/index.js +3 -2
- package/dist/esm/comps/Cover/index.d.ts +1 -1
- package/dist/esm/comps/Cover/index.js +3 -2
- package/dist/esm/comps/Drawer/index.js +1 -0
- package/dist/esm/comps/Editor/Timeline/index.js +4 -3
- package/dist/esm/comps/Editor/index.js +2 -1
- package/dist/esm/comps/Fab/index.d.ts +1 -2
- package/dist/esm/comps/Fab/index.js +2 -1
- package/dist/esm/comps/Filters/index.d.ts +4 -1
- package/dist/esm/comps/Filters/index.js +1 -0
- package/dist/esm/comps/Form/index.d.ts +2 -2
- package/dist/esm/comps/Form/index.js +5 -7
- package/dist/esm/comps/Icon/index.d.ts +1 -1
- package/dist/esm/comps/Icon/index.js +2 -1
- package/dist/esm/comps/Image/index.js +1 -0
- package/dist/esm/comps/Input/index.js +1 -0
- package/dist/esm/comps/Label/index.js +1 -0
- package/dist/esm/comps/List/index.d.ts +1 -1
- package/dist/esm/comps/List/index.js +1 -0
- package/dist/esm/comps/List/item.d.ts +6 -3
- package/dist/esm/comps/List/item.js +1 -0
- package/dist/esm/comps/Network/index.js +4 -3
- package/dist/esm/comps/Overlay/index.js +2 -1
- package/dist/esm/comps/Pagination/index.js +1 -0
- package/dist/esm/comps/Password/index.js +2 -1
- package/dist/esm/comps/PinInput/index.js +2 -1
- package/dist/esm/comps/ProgressBar/index.js +1 -0
- package/dist/esm/comps/Radio/index.js +1 -0
- package/dist/esm/comps/Search/index.d.ts +1 -1
- package/dist/esm/comps/Search/index.js +3 -2
- package/dist/esm/comps/Segmented/index.js +2 -2
- package/dist/esm/comps/Segmented/item.d.ts +4 -1
- package/dist/esm/comps/Segmented/item.js +8 -15
- package/dist/esm/comps/Select/index.d.ts +2 -4
- package/dist/esm/comps/Select/index.js +4 -3
- package/dist/esm/comps/Select/optionItem.d.ts +4 -1
- package/dist/esm/comps/Select/optionItem.js +1 -0
- package/dist/esm/comps/Sheet/index.d.ts +1 -1
- package/dist/esm/comps/Sheet/index.js +4 -3
- package/dist/esm/comps/Sidebar/index.js +1 -0
- package/dist/esm/comps/Slider/index.d.ts +1 -1
- package/dist/esm/comps/Slider/index.js +3 -2
- package/dist/esm/comps/Span/index.js +1 -0
- package/dist/esm/comps/Spinner/index.d.ts +1 -1
- package/dist/esm/comps/Spinner/index.js +4 -6
- package/dist/esm/comps/Switch/index.d.ts +1 -1
- package/dist/esm/comps/Switch/index.js +2 -1
- package/dist/esm/comps/TabView/body.js +1 -0
- package/dist/esm/comps/TabView/index.js +1 -0
- package/dist/esm/comps/TabView/tab.d.ts +4 -1
- package/dist/esm/comps/TabView/tab.js +1 -0
- package/dist/esm/comps/Table/col.d.ts +9 -6
- package/dist/esm/comps/Table/col.js +1 -0
- package/dist/esm/comps/Table/index.js +1 -0
- package/dist/esm/comps/Table/row.d.ts +4 -1
- package/dist/esm/comps/Table/row.js +2 -1
- package/dist/esm/comps/Text/index.js +1 -1
- package/dist/esm/comps/TextArea/index.js +1 -0
- package/dist/esm/comps/TextWheel/index.js +1 -0
- package/dist/esm/comps/Tooltip/index.d.ts +1 -2
- package/dist/esm/comps/Tooltip/index.js +2 -1
- package/dist/esm/comps/Treeview/index.d.ts +1 -2
- package/dist/esm/comps/Treeview/index.js +2 -1
- package/dist/esm/comps/Treeview/item.d.ts +3 -2
- package/dist/esm/comps/Treeview/item.js +11 -7
- package/dist/esm/comps/Treeview/types.d.ts +6 -2
- package/dist/esm/funs/index.d.ts +2 -1
- package/dist/esm/funs/index.js +4 -3
- package/dist/esm/hooks/index.d.ts +4 -5
- package/dist/esm/hooks/index.js +2 -2
- package/dist/esm/hooks/useDelayed.d.ts +17 -0
- package/dist/esm/hooks/useDelayed.js +25 -0
- package/dist/esm/index.js +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useState } from "react";
|
|
4
4
|
import Box from "../Box";
|
|
5
|
+
import Button from "../Button";
|
|
5
6
|
import Text from "../Text";
|
|
6
7
|
import SVGIcons from "../svgicons";
|
|
7
|
-
import Button from "../Button";
|
|
8
8
|
const Accordion = forwardRef((props, ref) => {
|
|
9
9
|
const { title, message, ...rest } = props;
|
|
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
14
|
export default Accordion;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
-
import Box from "../Box";
|
|
5
4
|
import { useBase } from "../../hooks";
|
|
6
|
-
import ActionItem from "./item";
|
|
7
5
|
import { Position } from "../../types/enums";
|
|
6
|
+
import Box from "../Box";
|
|
7
|
+
import ActionItem from "./item";
|
|
8
8
|
/**
|
|
9
9
|
* ActionBar renders a list of buttons with tooltips.
|
|
10
10
|
*
|
|
@@ -59,4 +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
63
|
export default ActionBar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AlertHandler } from "./types";
|
|
2
1
|
import { ALERT } from "../../types/enums";
|
|
3
2
|
import { BoxProps } from "../Box";
|
|
3
|
+
import { AlertHandler } from "./types";
|
|
4
4
|
declare const Alert: import("react").ForwardRefExoticComponent<BoxProps & {
|
|
5
5
|
type?: ALERT;
|
|
6
6
|
icon?: string;
|
|
@@ -10,4 +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 ? { 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
14
|
export default Alert;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect } from "react";
|
|
4
|
-
import { AVATAR, Size } from "../../types/enums";
|
|
5
4
|
import { useBase, useImage } from "../../hooks";
|
|
6
|
-
import
|
|
5
|
+
import { AVATAR, Size } from "../../types/enums";
|
|
7
6
|
import Box from "../Box";
|
|
7
|
+
import Image from "../Image";
|
|
8
8
|
import Text from "../Text";
|
|
9
9
|
const Avatar = forwardRef((props, ref) => {
|
|
10
10
|
const { src, size, variant, type, crossOrigin, referrerPolicy, animate, as, alt, color, ...pops } = props;
|
|
@@ -33,4 +33,5 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
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
37
|
export default Avatar;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { forwardRef } from "react";
|
|
4
3
|
import { useBase } from "../../hooks";
|
|
@@ -21,4 +20,5 @@ const Box = forwardRef((props, ref) => {
|
|
|
21
20
|
...(style || {})
|
|
22
21
|
}, ...rest });
|
|
23
22
|
});
|
|
23
|
+
Box.displayName = `Box`;
|
|
24
24
|
export default Box;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ButtonState } from './types';
|
|
2
1
|
import { Size, SPINNER } from '../../types/enums';
|
|
2
|
+
import { ButtonState } from './types';
|
|
3
3
|
declare const Button: import("react").ForwardRefExoticComponent<import("../..").ZuzProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, keyof import("../..").ZuzProps> & {
|
|
4
4
|
icon?: string;
|
|
5
5
|
iconSize?: Size;
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { useBase } from '../../hooks';
|
|
5
|
+
import { Size, SPINNER } from '../../types/enums';
|
|
5
6
|
import Icon from '../Icon';
|
|
6
7
|
import Span from '../Span';
|
|
7
|
-
import { ButtonState } from './types';
|
|
8
8
|
import Spinner from '../Spinner';
|
|
9
|
-
import {
|
|
9
|
+
import { ButtonState } from './types';
|
|
10
10
|
const Button = forwardRef((props, ref) => {
|
|
11
11
|
const { reset, size, variant, icon, iconSize, children, withLabel, spinner, state, disabled, ...pops } = props;
|
|
12
12
|
const { style, className, rest } = useBase(pops);
|
|
13
|
-
return _jsxs("button", { className: `--button ${variant ? `--${variant}` : ``} ${size ? `--${size}` : ``} flex aic ${!reset ? `jcc` : ``} ${icon ? `ico-btn` : ``} ${className}`.trim(), 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] })] });
|
|
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
16
|
export default Button;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CHECKBOX,
|
|
1
|
+
import { CHECKBOX, Variant } from "../../types/enums";
|
|
2
2
|
import { CheckboxHandler } from "./types";
|
|
3
3
|
declare const CheckBox: import("react").ForwardRefExoticComponent<import("../..").ZuzProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, keyof import("../..").ZuzProps> & {
|
|
4
4
|
type?: CHECKBOX;
|
|
5
|
-
size?: Size;
|
|
5
|
+
size?: import("../..").Size;
|
|
6
6
|
variant?: Variant;
|
|
7
7
|
onSwitch?: (checked: boolean, value: string | number | readonly string[]) => void;
|
|
8
8
|
} & import("react").RefAttributes<CheckboxHandler>>;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
|
|
4
4
|
import { CHECKBOX, Variant } from "../../types/enums";
|
|
5
|
-
import Label from "../Label";
|
|
6
5
|
import Input from "../Input";
|
|
6
|
+
import Label from "../Label";
|
|
7
7
|
import SVGIcons from "../svgicons";
|
|
8
8
|
const CheckBox = forwardRef((props, ref) => {
|
|
9
9
|
const { name, required, type, value, size, variant, checked: defaultCheck, onSwitch, ...pops } = props;
|
|
@@ -31,4 +31,5 @@ const CheckBox = forwardRef((props, ref) => {
|
|
|
31
31
|
_setChecked(e.target.checked);
|
|
32
32
|
} })] });
|
|
33
33
|
});
|
|
34
|
+
CheckBox.displayName = `CheckBox`;
|
|
34
35
|
export default CheckBox;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SegmentProps } from "../Segmented/types";
|
|
2
1
|
import { ColorScheme } from "../../hooks/useColorScheme";
|
|
2
|
+
import { SegmentProps } from "../Segmented/types";
|
|
3
3
|
declare const ColorScheme: import("react").ForwardRefExoticComponent<Omit<SegmentProps, "items"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export default ColorScheme;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useMemo } from "react";
|
|
4
|
+
import { useDelayed } from "../..";
|
|
5
|
+
import { useColorScheme } from "../../hooks/useColorScheme";
|
|
4
6
|
import Segmented from "../Segmented";
|
|
5
7
|
import SVGIcons from "../svgicons";
|
|
6
|
-
import { useColorScheme } from "../../hooks/useColorScheme";
|
|
7
8
|
const ColorScheme = forwardRef((props, ref) => {
|
|
9
|
+
const mounted = useDelayed();
|
|
8
10
|
const { colorScheme, setColorScheme } = useColorScheme();
|
|
9
11
|
const items = useMemo(() => [
|
|
10
12
|
{ tag: `light`, index: 0, label: "", icon: SVGIcons.colorSchemeLight },
|
|
@@ -12,8 +14,11 @@ const ColorScheme = forwardRef((props, ref) => {
|
|
|
12
14
|
{ tag: `dark`, index: 2, label: "", icon: SVGIcons.colorSchemeDark },
|
|
13
15
|
], []);
|
|
14
16
|
const selected = useMemo(() => [`light`, `system`, `dark`].indexOf(colorScheme), [colorScheme]);
|
|
15
|
-
|
|
17
|
+
if (!mounted || selected == -1)
|
|
18
|
+
return null;
|
|
19
|
+
return _jsx(Segmented, { className: `--color-scheme`, onSwitch: ({ tag }) => {
|
|
16
20
|
setColorScheme(tag);
|
|
17
21
|
}, selected: selected, items: items, ...props });
|
|
18
22
|
});
|
|
23
|
+
ColorScheme.displayName = `ColorScheme`;
|
|
19
24
|
export default ColorScheme;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
|
|
4
|
-
import Box from "../Box";
|
|
5
4
|
import { useAnchorPosition, useBase } from "../../hooks";
|
|
6
|
-
import MenuItem from "./item";
|
|
7
5
|
import { TRANSITION_CURVES } from "../../types/enums";
|
|
6
|
+
import Box from "../Box";
|
|
7
|
+
import MenuItem from "./item";
|
|
8
8
|
// import { dynamicObject } from "../../types";
|
|
9
9
|
const ContextMenu = forwardRef((props, ref) => {
|
|
10
10
|
const { as, offsetX, offsetY, parent, items: _items, ...pops } = props;
|
|
@@ -38,4 +38,5 @@ const ContextMenu = forwardRef((props, ref) => {
|
|
|
38
38
|
when: visible
|
|
39
39
|
}, ref: targetRef, ...rest, children: items.map((item, index) => _jsx(MenuItem, { ...{ ...item, index } }, `context-${item.label.toLowerCase()}-${index}`)) });
|
|
40
40
|
});
|
|
41
|
+
ContextMenu.displayName = `ContextMenu`;
|
|
41
42
|
export default ContextMenu;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useState } from "react";
|
|
4
|
+
import { Position, TRANSITION_CURVES } from "../../types/enums";
|
|
4
5
|
import Box from "../Box";
|
|
5
|
-
import Text from "../Text";
|
|
6
6
|
import Button from "../Button";
|
|
7
|
-
import
|
|
7
|
+
import Text from "../Text";
|
|
8
8
|
const CookiesConsent = forwardRef((props, ref) => {
|
|
9
9
|
const [accepted, setAccepted] = useState(`wait`);
|
|
10
10
|
const { title, message, acceptLabel, rejectLabel, position } = props;
|
|
@@ -25,4 +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
29
|
export default CookiesConsent;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import Box from "../Box";
|
|
5
|
-
import { SPINNER } from "../../types/enums";
|
|
6
4
|
import { useBase } from "../../hooks";
|
|
5
|
+
import { SPINNER } from "../../types/enums";
|
|
6
|
+
import Box from "../Box";
|
|
7
7
|
import Spinner from "../Spinner";
|
|
8
8
|
import Text from "../Text";
|
|
9
9
|
const Cover = forwardRef((props, ref) => {
|
|
@@ -17,4 +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
21
|
export default Cover;
|
|
@@ -60,4 +60,5 @@ const Drawer = forwardRef((props, ref) => {
|
|
|
60
60
|
duration: speed || .5,
|
|
61
61
|
}, ...pops, children: [from == DRAWER_SIDE.Top || from == DRAWER_SIDE.Bottom ? _jsx(Box, { className: `--handle` }) : null, render ? content : visible ? content : null] })] });
|
|
62
62
|
});
|
|
63
|
+
Drawer.displayName = `Drawer`;
|
|
63
64
|
export default Drawer;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { DRAG_DIRECTION, SLIDER } from "../../../types/enums";
|
|
4
5
|
import Box from "../../Box";
|
|
5
6
|
import Button from "../../Button";
|
|
7
|
+
import Slider from "../../Slider";
|
|
6
8
|
import SVGIcons from "../../svgicons";
|
|
7
9
|
import Text from "../../Text";
|
|
8
|
-
import Layer from "./layer";
|
|
9
|
-
import Slider from "../../Slider";
|
|
10
|
-
import { DRAG_DIRECTION, SLIDER } from "../../../types/enums";
|
|
11
10
|
import ToolTip from "../../Tooltip";
|
|
11
|
+
import Layer from "./layer";
|
|
12
12
|
const Timeline = forwardRef((props, ref) => {
|
|
13
13
|
const { layers } = props;
|
|
14
14
|
const [selected, setSelected] = useState([]);
|
|
@@ -55,4 +55,5 @@ const Timeline = forwardRef((props, ref) => {
|
|
|
55
55
|
}
|
|
56
56
|
}, className: `--cursor abs` })] });
|
|
57
57
|
});
|
|
58
|
+
Timeline.displayName = `Timeline`;
|
|
58
59
|
export default Timeline;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { forwardRef } from 'react';
|
|
4
|
-
import { EditorMode } from './types';
|
|
5
4
|
import Box from '../Box';
|
|
5
|
+
import { EditorMode } from './types';
|
|
6
6
|
const Editor = forwardRef((props, ref) => {
|
|
7
7
|
const [mode, setMode] = React.useState(EditorMode.Select);
|
|
8
8
|
return _jsx(Box, { as: `--ui-builder rel` });
|
|
9
9
|
});
|
|
10
|
+
Editor.displayName = `Editor`;
|
|
10
11
|
export default Editor;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import SVGIcons from "../svgicons";
|
|
2
|
-
import { Position } from "../../types/enums";
|
|
3
2
|
declare const Fab: import("react").ForwardRefExoticComponent<Omit<import("..").ButtonProps, "icon"> & {
|
|
4
3
|
icon?: string | keyof typeof SVGIcons;
|
|
5
|
-
position?: `${Position.Top | Position.Bottom}${Position.Left | Position.Right}`;
|
|
4
|
+
position?: `${import("../..").Position.Top | import("../..").Position.Bottom}${import("../..").Position.Left | import("../..").Position.Right}`;
|
|
6
5
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
6
|
export default Fab;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
+
import { Size } from "../../types/enums";
|
|
3
4
|
import Button from "../Button";
|
|
4
5
|
import SVGIcons from "../svgicons";
|
|
5
|
-
import { Size } from "../../types/enums";
|
|
6
6
|
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
11
|
export default Fab;
|
|
@@ -3,5 +3,8 @@ export type FilterProps = {
|
|
|
3
3
|
names?: FILTER[];
|
|
4
4
|
strength?: number;
|
|
5
5
|
};
|
|
6
|
-
declare const Filters:
|
|
6
|
+
declare const Filters: {
|
|
7
|
+
(props: FilterProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
7
10
|
export default Filters;
|
|
@@ -10,4 +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
14
|
export default Filters;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BoxProps } from "../Box";
|
|
2
1
|
import { dynamicObject } from "../../types";
|
|
3
|
-
import { SheetHandler } from "../Sheet";
|
|
4
2
|
import { SPINNER } from "../../types/enums";
|
|
3
|
+
import { BoxProps } from "../Box";
|
|
4
|
+
import { SheetHandler } from "../Sheet";
|
|
5
5
|
export type FormProps = BoxProps & {
|
|
6
6
|
/** Name of form, will be appended to --form-{name} in className
|
|
7
7
|
* whitespace will be replaced with dash (-)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, startTransition, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
4
|
-
import
|
|
4
|
+
import { addPropsToChildren, isEmail, withPost } from "../../funs";
|
|
5
5
|
import { useBase } from "../../hooks";
|
|
6
|
-
import Sheet, { isSheetHandler } from "../Sheet";
|
|
7
|
-
import Cover from "../Cover";
|
|
8
6
|
import { FORMVALIDATION, SHEET } from "../../types/enums";
|
|
9
|
-
import
|
|
7
|
+
import Box from "../Box";
|
|
8
|
+
import Cover from "../Cover";
|
|
9
|
+
import Sheet, { isSheetHandler } from "../Sheet";
|
|
10
10
|
/**
|
|
11
11
|
* {@link Form} is a controlled component designed to handle form data submission, validation, and display of loading or error states.
|
|
12
12
|
* It allows for optional server-side submission through an action endpoint and customizable success/error handling callbacks.
|
|
@@ -89,15 +89,12 @@ const Form = forwardRef((props, ref) => {
|
|
|
89
89
|
switch (_with.toUpperCase()) {
|
|
90
90
|
case FORMVALIDATION.Email:
|
|
91
91
|
return isEmail(el.value);
|
|
92
|
-
break;
|
|
93
92
|
case FORMVALIDATION.Uri:
|
|
94
93
|
console.log(`Add FORMVALIDATION.Uri`);
|
|
95
94
|
return false;
|
|
96
|
-
break;
|
|
97
95
|
case FORMVALIDATION.Password:
|
|
98
96
|
console.log(`Add FORMVALIDATION.Password`);
|
|
99
97
|
return false;
|
|
100
|
-
break;
|
|
101
98
|
case FORMVALIDATION.MatchField:
|
|
102
99
|
const [__, field] = el.getAttribute(`with`).split(`@`);
|
|
103
100
|
const _el = document.querySelector(`[name=${field.trim()}]`);
|
|
@@ -264,4 +261,5 @@ const Form = forwardRef((props, ref) => {
|
|
|
264
261
|
useEffect(_init, []);
|
|
265
262
|
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] });
|
|
266
263
|
});
|
|
264
|
+
Form.displayName = `Form`;
|
|
267
265
|
export default Form;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { useBase } from "../../hooks";
|
|
5
|
-
import Span from "../Span";
|
|
6
5
|
import { Size } from "../../types/enums";
|
|
6
|
+
import Span from "../Span";
|
|
7
7
|
const Icon = forwardRef((props, ref) => {
|
|
8
8
|
const { name, pathCount, size, ...pops } = props;
|
|
9
9
|
const { className, style, rest } = useBase(pops);
|
|
10
10
|
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}`)) });
|
|
11
11
|
});
|
|
12
|
+
Icon.displayName = `Icon`;
|
|
12
13
|
export default Icon;
|
|
@@ -12,4 +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
16
|
export default Input;
|
|
@@ -3,5 +3,5 @@ declare const List: import("react").ForwardRefExoticComponent<import("../..").Zu
|
|
|
3
3
|
size?: Size;
|
|
4
4
|
items: import("./types").ListItem[];
|
|
5
5
|
ol?: boolean;
|
|
6
|
-
} & import("react").RefAttributes<
|
|
6
|
+
} & import("react").RefAttributes<HTMLUListElement | HTMLOListElement>>;
|
|
7
7
|
export default List;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type ListItem } from "./types";
|
|
2
|
-
declare const Item:
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
declare const Item: {
|
|
3
|
+
(props: {
|
|
4
|
+
meta: ListItem;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
5
8
|
export default Item;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useEffect } from "react";
|
|
3
|
-
import Box from "../Box";
|
|
4
|
-
import Text from "../Text";
|
|
5
|
-
import { ALERT, Size, TRANSITION_CURVES } from "../../types/enums";
|
|
6
3
|
import { useNetworkStatus } from "../../hooks";
|
|
4
|
+
import { ALERT, Size, TRANSITION_CURVES } from "../../types/enums";
|
|
5
|
+
import Box from "../Box";
|
|
7
6
|
import SVGIcons from "../svgicons";
|
|
7
|
+
import Text from "../Text";
|
|
8
8
|
const NetworkManager = forwardRef((props, ref) => {
|
|
9
9
|
const isOnline = useNetworkStatus();
|
|
10
10
|
const { onlineMessage, offlineMessage, size } = props;
|
|
@@ -19,4 +19,5 @@ const NetworkManager = forwardRef((props, ref) => {
|
|
|
19
19
|
delay: 2
|
|
20
20
|
}, 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` })] });
|
|
21
21
|
});
|
|
22
|
+
NetworkManager.displayName = `NetWorkManager`;
|
|
22
23
|
export default NetworkManager;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import Box from "../Box";
|
|
4
3
|
import { TRANSITIONS } from "../../types/enums";
|
|
4
|
+
import Box from "../Box";
|
|
5
5
|
export const Overlay = forwardRef((props, ref) => {
|
|
6
6
|
const { when, ...pops } = props;
|
|
7
7
|
return _jsx(Box, { ref: ref, "aria-hidden": !when, className: `--overlay fixed fill`, animate: {
|
|
@@ -9,4 +9,5 @@ export const Overlay = forwardRef((props, ref) => {
|
|
|
9
9
|
when,
|
|
10
10
|
}, ...pops });
|
|
11
11
|
});
|
|
12
|
+
Overlay.displayName = `Overlay`;
|
|
12
13
|
export default Overlay;
|
|
@@ -59,4 +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
63
|
export default Pagination;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useState } from 'react';
|
|
4
4
|
import { useBase } from '../../hooks';
|
|
5
|
-
import Input from '../Input';
|
|
6
5
|
import Box from '../Box';
|
|
7
6
|
import Button from '../Button';
|
|
7
|
+
import Input from '../Input';
|
|
8
8
|
import SVGIcons from '../svgicons';
|
|
9
9
|
const Password = forwardRef((props, ref) => {
|
|
10
10
|
const { ...pops } = props;
|
|
@@ -15,4 +15,5 @@ const Password = forwardRef((props, ref) => {
|
|
|
15
15
|
const [visible, setVisible] = useState(false);
|
|
16
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 })] });
|
|
17
17
|
});
|
|
18
|
+
Password.displayName = `Password`;
|
|
18
19
|
export default Password;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useRef } from 'react';
|
|
4
4
|
import { useBase } from '../../hooks';
|
|
5
|
-
import Input from '../Input';
|
|
6
5
|
import Box from '../Box';
|
|
6
|
+
import Input from '../Input';
|
|
7
7
|
const PinInput = forwardRef((props, ref) => {
|
|
8
8
|
const { size, length, mask, ...pops } = props;
|
|
9
9
|
const inputs = useRef([]);
|
|
@@ -39,4 +39,5 @@ const PinInput = forwardRef((props, ref) => {
|
|
|
39
39
|
inputs.current[i] = el;
|
|
40
40
|
}, numeric: true, onChange: handleInput, maxLength: 1, placeholder: `0`, type: mask ? `password` : 'text', ...pops }, `pin-${i}`)) });
|
|
41
41
|
});
|
|
42
|
+
PinInput.displayName = `PinInput`;
|
|
42
43
|
export default PinInput;
|
|
@@ -19,4 +19,5 @@ const ProgressBar = forwardRef((props, ref) => {
|
|
|
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
23
|
export default ProgressBar;
|
|
@@ -15,4 +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
19
|
export default Radio;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { useBase } from '../../hooks';
|
|
5
|
-
import
|
|
5
|
+
import { Size } from '../../types/enums';
|
|
6
6
|
import Box from '../Box';
|
|
7
7
|
import Button from '../Button';
|
|
8
|
+
import Input from '../Input';
|
|
8
9
|
import SVGIcons from '../svgicons';
|
|
9
|
-
import { Size } from '../../types/enums';
|
|
10
10
|
const Search = forwardRef((props, ref) => {
|
|
11
11
|
const { animate, withStyle, onChange, ...pops } = props;
|
|
12
12
|
const { style } = useBase(pops);
|
|
@@ -34,4 +34,5 @@ const Search = forwardRef((props, ref) => {
|
|
|
34
34
|
useEffect(() => { }, []);
|
|
35
35
|
return _jsxs(Box, { style: style, className: `--search --${props.size || Size.Small} flex aic rel ${searchStyle}`.trim(), children: [_jsx(Input, { ref: innerRef, onChange: handleChange, className: `--${props.size || Size.Small}`, ...pops }), _jsx(Button, { tabIndex: -1, onClick: e => handleSubmit(), className: `--send flex aic jcc abs`, size: props.size || Size.Small, children: query !== `` ? SVGIcons.close : SVGIcons.search })] });
|
|
36
36
|
});
|
|
37
|
+
Search.displayName = `Search`;
|
|
37
38
|
export default Search;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
4
3
|
import { useBase } from "../../hooks";
|
|
@@ -54,9 +53,10 @@ const Segmented = forwardRef((props, ref) => {
|
|
|
54
53
|
setSelected(selected);
|
|
55
54
|
}
|
|
56
55
|
}, [selected, _selected]);
|
|
57
|
-
return _jsxs(Box, {
|
|
56
|
+
return _jsxs(Box, { ref: _segmented, "data-selected": _selected, className: `${className} --segmented --${size || Size.Small} flex aic rel`, style: style, ...rest, children: [_jsx(Box, { ref: _tab, className: `--segment-tab abs` }), items.map((item, i) => _jsx(SegmentItem, { onSelect: handleSelect, selected: _selected == i, meta: {
|
|
58
57
|
...item,
|
|
59
58
|
index: i
|
|
60
59
|
} }, `segment-${item.label}-${i}`))] });
|
|
61
60
|
});
|
|
61
|
+
Segmented.displayName = `SelectTabs`;
|
|
62
62
|
export default Segmented;
|