@koobiq/react-components 0.23.0 → 0.25.0
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/components/ContenPanel/ContentPanel.d.ts +3 -2
- package/dist/components/ContenPanel/ContentPanel.js +9 -9
- package/dist/components/Divider/Divider.d.ts +14 -4
- package/dist/components/Divider/Divider.js +23 -8
- package/dist/components/Divider/types.d.ts +4 -3
- package/dist/components/Navbar/Navbar.d.ts +15 -0
- package/dist/components/Navbar/Navbar.js +80 -0
- package/dist/components/Navbar/Navbar.module.css.js +41 -0
- package/dist/components/Navbar/NavbarContext.d.ts +5 -0
- package/dist/components/Navbar/NavbarContext.js +8 -0
- package/dist/components/Navbar/components/NavbarAppItem.d.ts +7 -0
- package/dist/components/Navbar/components/NavbarAppItem.js +10 -0
- package/dist/components/Navbar/components/NavbarBody.d.ts +6 -0
- package/dist/components/Navbar/components/NavbarBody.js +15 -0
- package/dist/components/Navbar/components/NavbarFooter.d.ts +6 -0
- package/dist/components/Navbar/components/NavbarFooter.js +15 -0
- package/dist/components/Navbar/components/NavbarHeader.d.ts +6 -0
- package/dist/components/Navbar/components/NavbarHeader.js +15 -0
- package/dist/components/Navbar/components/NavbarItem.d.ts +29 -0
- package/dist/components/Navbar/components/NavbarItem.js +65 -0
- package/dist/components/Navbar/components/index.d.ts +5 -0
- package/dist/components/Navbar/index.d.ts +2 -0
- package/dist/components/Navbar/intl.json.js +7 -0
- package/dist/components/Navbar/types.d.ts +26 -0
- package/dist/components/Navbar/types.js +4 -0
- package/dist/components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +4 -0
- package/dist/components/SelectNext/Select.d.ts +13 -0
- package/dist/components/SelectNext/Select.js +258 -0
- package/dist/components/SelectNext/Select.module.css.js +23 -0
- package/dist/components/SelectNext/SelectContext.d.ts +2 -0
- package/dist/components/SelectNext/SelectContext.js +5 -0
- package/dist/components/SelectNext/components/SelectList/SelectList.d.ts +37 -0
- package/dist/components/SelectNext/components/SelectList/SelectList.js +131 -0
- package/dist/components/SelectNext/components/SelectList/SelectList.module.css.js +11 -0
- package/dist/components/SelectNext/components/SelectList/index.d.ts +1 -0
- package/dist/components/SelectNext/components/SelectOption/SelectOption.d.ts +37 -0
- package/dist/components/SelectNext/components/SelectOption/SelectOption.js +48 -0
- package/dist/components/SelectNext/components/SelectOption/index.d.ts +1 -0
- package/dist/components/SelectNext/components/SelectSection/SelectSection.d.ts +9 -0
- package/dist/components/SelectNext/components/SelectSection/SelectSection.js +51 -0
- package/dist/components/SelectNext/components/SelectSection/index.d.ts +1 -0
- package/dist/components/SelectNext/components/Tag/Tag.d.ts +18 -0
- package/dist/components/SelectNext/components/Tag/Tag.js +67 -0
- package/dist/components/SelectNext/components/Tag/index.d.ts +1 -0
- package/dist/components/SelectNext/components/Tag/intl.json.js +7 -0
- package/dist/components/SelectNext/components/Tag/utils.d.ts +3 -0
- package/dist/components/SelectNext/components/Tag/utils.js +9 -0
- package/dist/components/SelectNext/components/TagGroup/TagGroup.d.ts +13 -0
- package/dist/components/SelectNext/components/TagGroup/TagGroup.js +25 -0
- package/dist/components/SelectNext/components/TagGroup/TagGroup.module.css.js +20 -0
- package/dist/components/SelectNext/components/TagGroup/TagGroupMultiline.d.ts +3 -0
- package/dist/components/SelectNext/components/TagGroup/TagGroupMultiline.js +44 -0
- package/dist/components/SelectNext/components/TagGroup/TagGroupResponsive.d.ts +3 -0
- package/dist/components/SelectNext/components/TagGroup/TagGroupResponsive.js +65 -0
- package/dist/components/SelectNext/components/TagGroup/index.d.ts +1 -0
- package/dist/components/SelectNext/components/TagGroup/utils.d.ts +1 -0
- package/dist/components/SelectNext/components/TagGroup/utils.js +4 -0
- package/dist/components/SelectNext/components/index.d.ts +5 -0
- package/dist/components/SelectNext/index.d.ts +2 -0
- package/dist/components/SelectNext/intl.d.ts +2 -0
- package/dist/components/SelectNext/intl.js +21 -0
- package/dist/components/SelectNext/types.d.ts +99 -0
- package/dist/components/SelectNext/types.js +12 -0
- package/dist/components/SelectNext/utils.d.ts +9 -0
- package/dist/components/SelectNext/utils.js +26 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/index.js +13 -1
- package/dist/style.css +328 -43
- package/package.json +5 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DialogBody, DialogFooter, DialogHeader
|
|
1
|
+
import type { CSSProperties, ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { DialogBody, DialogFooter, DialogHeader } from '../Dialog';
|
|
3
|
+
import type { DialogProps } from '../Dialog';
|
|
3
4
|
declare const ContentPanelComponent: import("react").ForwardRefExoticComponent<{
|
|
4
5
|
children?: import("react").ReactNode;
|
|
5
6
|
width?: import("./types").ContentPanelSize | null;
|
|
@@ -26,23 +26,23 @@ const ContentPanelComponent = forwardRef(
|
|
|
26
26
|
);
|
|
27
27
|
const {
|
|
28
28
|
defaultWidth: defaultWidthProp,
|
|
29
|
+
disableExitOnEscapeKeyDown,
|
|
29
30
|
minWidth: minWidthProp,
|
|
30
31
|
maxWidth: maxWidthProp,
|
|
31
|
-
disableExitOnEscapeKeyDown,
|
|
32
|
-
onResetResize,
|
|
33
32
|
isResizable = false,
|
|
34
|
-
|
|
35
|
-
onResize,
|
|
36
|
-
onResizeEnd,
|
|
33
|
+
hideCloseButton,
|
|
37
34
|
onResizeStart,
|
|
38
|
-
|
|
35
|
+
onResetResize,
|
|
39
36
|
onOpenChange,
|
|
40
37
|
defaultOpen,
|
|
38
|
+
onResizeEnd,
|
|
39
|
+
slotProps,
|
|
41
40
|
className,
|
|
42
|
-
style,
|
|
43
41
|
children,
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
onResize,
|
|
43
|
+
isOpen,
|
|
44
|
+
width,
|
|
45
|
+
style,
|
|
46
46
|
...other
|
|
47
47
|
} = panelProps;
|
|
48
48
|
const {
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { BaseCollection } from '@koobiq/react-primitives';
|
|
3
|
+
import { CollectionNode } from '@koobiq/react-primitives';
|
|
4
|
+
export declare class DividerNode extends CollectionNode<any> {
|
|
5
|
+
static readonly type = "separator";
|
|
6
|
+
filter(collection: BaseCollection<any>, newCollection: BaseCollection<any>): CollectionNode<any> | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const Divider: (props: {
|
|
9
|
+
className?: string;
|
|
10
|
+
display?: import("./types").DividerPropDisplay;
|
|
11
|
+
flexItem?: boolean;
|
|
12
|
+
disablePaddings?: boolean;
|
|
13
|
+
as?: ElementType;
|
|
14
|
+
} & Omit<import("@react-aria/separator").SeparatorProps, "elementType"> & import("react").HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>) => import("react").ReactElement | null;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { useSeparator } from "@koobiq/react-primitives";
|
|
3
|
+
import { clsx } from "@koobiq/react-core";
|
|
4
|
+
import { createLeafComponent, CollectionNode, useSeparator } from "@koobiq/react-primitives";
|
|
5
5
|
import s from "./Divider.module.css.js";
|
|
6
|
-
const
|
|
7
|
-
(
|
|
6
|
+
const _DividerNode = class _DividerNode extends CollectionNode {
|
|
7
|
+
filter(collection, newCollection) {
|
|
8
|
+
const prevItem = newCollection.getItem(this.prevKey);
|
|
9
|
+
if (prevItem && prevItem.type !== "separator") {
|
|
10
|
+
const clone = this.clone();
|
|
11
|
+
newCollection.addDescendants(clone, collection);
|
|
12
|
+
return clone;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
_DividerNode.type = "separator";
|
|
18
|
+
let DividerNode = _DividerNode;
|
|
19
|
+
const Divider = createLeafComponent(
|
|
20
|
+
DividerNode,
|
|
21
|
+
function Separator(props, ref) {
|
|
8
22
|
const {
|
|
9
|
-
as: Tag = "div",
|
|
10
23
|
orientation = "horizontal",
|
|
24
|
+
as = "div",
|
|
11
25
|
disablePaddings,
|
|
12
26
|
flexItem,
|
|
13
27
|
display,
|
|
@@ -17,9 +31,10 @@ const Divider = polymorphicForwardRef(
|
|
|
17
31
|
const { separatorProps } = useSeparator({
|
|
18
32
|
...other,
|
|
19
33
|
orientation,
|
|
20
|
-
elementType:
|
|
34
|
+
elementType: `${as}`
|
|
21
35
|
});
|
|
22
36
|
const hasPaddings = !disablePaddings;
|
|
37
|
+
const Tag = as;
|
|
23
38
|
return /* @__PURE__ */ jsx(
|
|
24
39
|
Tag,
|
|
25
40
|
{
|
|
@@ -42,7 +57,7 @@ const Divider = polymorphicForwardRef(
|
|
|
42
57
|
);
|
|
43
58
|
}
|
|
44
59
|
);
|
|
45
|
-
Divider.displayName = "Divider";
|
|
46
60
|
export {
|
|
47
|
-
Divider
|
|
61
|
+
Divider,
|
|
62
|
+
DividerNode
|
|
48
63
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ElementType, HTMLAttributes } from 'react';
|
|
2
2
|
import type { SeparatorProps } from '@koobiq/react-primitives';
|
|
3
3
|
export declare const dividerPropDisplay: readonly ["block", "inline", "inlineBlock"];
|
|
4
4
|
export type DividerPropDisplay = (typeof dividerPropDisplay)[number];
|
|
5
|
-
export type
|
|
5
|
+
export type DividerProps = {
|
|
6
6
|
/** Additional CSS-classes. */
|
|
7
7
|
className?: string;
|
|
8
8
|
/** Set the display for the component. */
|
|
@@ -17,4 +17,5 @@ export type DividerBaseProps = ExtendableProps<{
|
|
|
17
17
|
* If `true`, it disables the default paddings.
|
|
18
18
|
*/
|
|
19
19
|
disablePaddings?: boolean;
|
|
20
|
-
|
|
20
|
+
as?: ElementType;
|
|
21
|
+
} & Omit<SeparatorProps, 'elementType'> & HTMLAttributes<HTMLElement>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NavbarAppItem, NavbarBody, NavbarFooter, NavbarHeader, NavbarItem } from './components';
|
|
2
|
+
import type { NavbarProps } from './types';
|
|
3
|
+
export declare const NavbarComponent: {
|
|
4
|
+
({ variant, isCollapsed, isToggleButtonHidden, defaultCollapsed, className, children, onCollapse, ref, ...other }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
type CompoundedComponent = typeof NavbarComponent & {
|
|
8
|
+
Header: typeof NavbarHeader;
|
|
9
|
+
Body: typeof NavbarBody;
|
|
10
|
+
Footer: typeof NavbarFooter;
|
|
11
|
+
Item: typeof NavbarItem;
|
|
12
|
+
AppItem: typeof NavbarAppItem;
|
|
13
|
+
};
|
|
14
|
+
export declare const Navbar: CompoundedComponent;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useObjectRef, useControlledState, useLocalizedStringFormatter, clsx, mergeProps } from "@koobiq/react-core";
|
|
4
|
+
import { IconChevronDoubleLeftS16 } from "@koobiq/react-icons";
|
|
5
|
+
import { useToolbar, Button } from "@koobiq/react-primitives";
|
|
6
|
+
import intlMessages from "./intl.json.js";
|
|
7
|
+
import s from "./Navbar.module.css.js";
|
|
8
|
+
import { NavbarContext } from "./NavbarContext.js";
|
|
9
|
+
import { NavbarHeader } from "./components/NavbarHeader.js";
|
|
10
|
+
import { NavbarBody } from "./components/NavbarBody.js";
|
|
11
|
+
import { NavbarFooter } from "./components/NavbarFooter.js";
|
|
12
|
+
import { NavbarItem } from "./components/NavbarItem.js";
|
|
13
|
+
import { NavbarAppItem } from "./components/NavbarAppItem.js";
|
|
14
|
+
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
15
|
+
const NavbarComponent = ({
|
|
16
|
+
variant = "vertical",
|
|
17
|
+
isCollapsed,
|
|
18
|
+
isToggleButtonHidden,
|
|
19
|
+
defaultCollapsed,
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
onCollapse,
|
|
23
|
+
ref,
|
|
24
|
+
...other
|
|
25
|
+
}) => {
|
|
26
|
+
const navbarRef = useObjectRef(ref);
|
|
27
|
+
const { toolbarProps } = useToolbar({ orientation: variant }, navbarRef);
|
|
28
|
+
const [isCollapsedActual, setIsCollapsedActual] = useControlledState(
|
|
29
|
+
isCollapsed,
|
|
30
|
+
defaultCollapsed ?? false,
|
|
31
|
+
onCollapse
|
|
32
|
+
);
|
|
33
|
+
const stringFormatter = useLocalizedStringFormatter(intlMessages);
|
|
34
|
+
return /* @__PURE__ */ jsx(NavbarContext, { value: { isCollapsed: isCollapsedActual }, children: /* @__PURE__ */ jsxs(
|
|
35
|
+
"nav",
|
|
36
|
+
{
|
|
37
|
+
...mergeProps(other, toolbarProps),
|
|
38
|
+
className: clsx(s.navbar, className),
|
|
39
|
+
role: "navigation",
|
|
40
|
+
ref: navbarRef,
|
|
41
|
+
"data-collapsed": isCollapsedActual,
|
|
42
|
+
children: [
|
|
43
|
+
children,
|
|
44
|
+
!isToggleButtonHidden && /* @__PURE__ */ jsx(
|
|
45
|
+
Tooltip,
|
|
46
|
+
{
|
|
47
|
+
offset: 8,
|
|
48
|
+
hideArrow: true,
|
|
49
|
+
placement: "end",
|
|
50
|
+
control: (tooltipProps) => /* @__PURE__ */ jsx(
|
|
51
|
+
Button,
|
|
52
|
+
{
|
|
53
|
+
...tooltipProps,
|
|
54
|
+
"aria-hidden": true,
|
|
55
|
+
tabIndex: -1,
|
|
56
|
+
className: s.toggleWrapper,
|
|
57
|
+
onPress: () => setIsCollapsedActual((is) => !is),
|
|
58
|
+
children: /* @__PURE__ */ jsx("span", { className: s.toggleButton, children: /* @__PURE__ */ jsx(IconChevronDoubleLeftS16, {}) })
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
children: stringFormatter.format(
|
|
62
|
+
isCollapsedActual ? "show navbar" : "hide navbar"
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
) });
|
|
69
|
+
};
|
|
70
|
+
NavbarComponent.displayName = "Navbar";
|
|
71
|
+
const Navbar = NavbarComponent;
|
|
72
|
+
Navbar.Header = NavbarHeader;
|
|
73
|
+
Navbar.Body = NavbarBody;
|
|
74
|
+
Navbar.Footer = NavbarFooter;
|
|
75
|
+
Navbar.Item = NavbarItem;
|
|
76
|
+
Navbar.AppItem = NavbarAppItem;
|
|
77
|
+
export {
|
|
78
|
+
Navbar,
|
|
79
|
+
NavbarComponent
|
|
80
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const navbar = "kbq-navbar-navbar-9d3c75";
|
|
2
|
+
const list = "kbq-navbar-list-42b3cd";
|
|
3
|
+
const appItem = "kbq-navbar-appItem-08f75b";
|
|
4
|
+
const header = "kbq-navbar-header-ba57bd";
|
|
5
|
+
const item = "kbq-navbar-item-1b3022";
|
|
6
|
+
const itemIcon = "kbq-navbar-itemIcon-50a6ed";
|
|
7
|
+
const itemContent = "kbq-navbar-itemContent-ca07c9";
|
|
8
|
+
const itemBadge = "kbq-navbar-itemBadge-3ef4ba";
|
|
9
|
+
const itemMenuIcon = "kbq-navbar-itemMenuIcon-dc5e9e";
|
|
10
|
+
const footer = "kbq-navbar-footer-851065";
|
|
11
|
+
const toggleWrapper = "kbq-navbar-toggleWrapper-e7247f";
|
|
12
|
+
const toggleButton = "kbq-navbar-toggleButton-2ebeeb";
|
|
13
|
+
const s = {
|
|
14
|
+
navbar,
|
|
15
|
+
list,
|
|
16
|
+
appItem,
|
|
17
|
+
header,
|
|
18
|
+
item,
|
|
19
|
+
itemIcon,
|
|
20
|
+
itemContent,
|
|
21
|
+
itemBadge,
|
|
22
|
+
itemMenuIcon,
|
|
23
|
+
footer,
|
|
24
|
+
toggleWrapper,
|
|
25
|
+
toggleButton
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
appItem,
|
|
29
|
+
s as default,
|
|
30
|
+
footer,
|
|
31
|
+
header,
|
|
32
|
+
item,
|
|
33
|
+
itemBadge,
|
|
34
|
+
itemContent,
|
|
35
|
+
itemIcon,
|
|
36
|
+
itemMenuIcon,
|
|
37
|
+
list,
|
|
38
|
+
navbar,
|
|
39
|
+
toggleButton,
|
|
40
|
+
toggleWrapper
|
|
41
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type DistributiveOmit } from '@koobiq/react-core';
|
|
2
|
+
import { type NavbarItemProps } from './NavbarItem';
|
|
3
|
+
export type NavbarAppItemProps = DistributiveOmit<NavbarItemProps, 'isMenu' | 'badge'>;
|
|
4
|
+
export declare const NavbarAppItem: {
|
|
5
|
+
({ className, ...props }: NavbarAppItemProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "@koobiq/react-core";
|
|
4
|
+
import s from "../Navbar.module.css.js";
|
|
5
|
+
import { NavbarItem } from "./NavbarItem.js";
|
|
6
|
+
const NavbarAppItem = ({ className, ...props }) => /* @__PURE__ */ jsx(NavbarItem, { ...props, className: clsx(s.appItem, className) });
|
|
7
|
+
NavbarAppItem.displayName = "NavbarAppItem";
|
|
8
|
+
export {
|
|
9
|
+
NavbarAppItem
|
|
10
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type NavbarBodyProps = ComponentPropsWithRef<'ul'>;
|
|
3
|
+
export declare const NavbarBody: {
|
|
4
|
+
({ children, className, ...props }: NavbarBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "@koobiq/react-core";
|
|
4
|
+
import { utilClasses } from "../../../styles/utility.js";
|
|
5
|
+
import s from "../Navbar.module.css.js";
|
|
6
|
+
const { list } = utilClasses;
|
|
7
|
+
const NavbarBody = ({
|
|
8
|
+
children,
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) => /* @__PURE__ */ jsx("ul", { "data-padded": "true", className: clsx(list, s.list, className), ...props, children });
|
|
12
|
+
NavbarBody.displayName = "NavbarBody";
|
|
13
|
+
export {
|
|
14
|
+
NavbarBody
|
|
15
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type NavbarFooterProps = ComponentPropsWithRef<'footer'>;
|
|
3
|
+
export declare const NavbarFooter: {
|
|
4
|
+
({ children, className, ...props }: NavbarFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "@koobiq/react-core";
|
|
4
|
+
import { utilClasses } from "../../../styles/utility.js";
|
|
5
|
+
import s from "../Navbar.module.css.js";
|
|
6
|
+
const { list } = utilClasses;
|
|
7
|
+
const NavbarFooter = ({
|
|
8
|
+
children,
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) => /* @__PURE__ */ jsx("footer", { className: clsx(s.footer, className), ...props, children: /* @__PURE__ */ jsx("ul", { "data-padded": "true", className: clsx(list, s.list, className), children }) });
|
|
12
|
+
NavbarFooter.displayName = "NavbarFooter";
|
|
13
|
+
export {
|
|
14
|
+
NavbarFooter
|
|
15
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type NavbarHeaderProps = ComponentPropsWithRef<'header'>;
|
|
3
|
+
export declare const NavbarHeader: {
|
|
4
|
+
({ className, children, ...props }: NavbarHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "@koobiq/react-core";
|
|
4
|
+
import { utilClasses } from "../../../styles/utility.js";
|
|
5
|
+
import s from "../Navbar.module.css.js";
|
|
6
|
+
const { list } = utilClasses;
|
|
7
|
+
const NavbarHeader = ({
|
|
8
|
+
className,
|
|
9
|
+
children,
|
|
10
|
+
...props
|
|
11
|
+
}) => /* @__PURE__ */ jsx("header", { className: clsx(s.header, className), ...props, children: /* @__PURE__ */ jsx("ul", { "data-padded": "true", className: clsx(list, s.list, className), children }) });
|
|
12
|
+
NavbarHeader.displayName = "NavbarHeader";
|
|
13
|
+
export {
|
|
14
|
+
NavbarHeader
|
|
15
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type LinkBaseProps } from '@koobiq/react-primitives';
|
|
3
|
+
export type NavbarItemProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the item is active.
|
|
6
|
+
*/
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the item is a menu trigger.
|
|
10
|
+
*/
|
|
11
|
+
isMenu?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Additional CSS class name.
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Icon to display before the item content.
|
|
18
|
+
*/
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Badge content to display.
|
|
22
|
+
*/
|
|
23
|
+
badge?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Item content.
|
|
26
|
+
*/
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
} & LinkBaseProps;
|
|
29
|
+
export declare const NavbarItem: import("@koobiq/react-core").PolyForwardComponent<"a", NavbarItemProps, import("react").ElementType>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { polymorphicForwardRef, mergeRefs, mergeProps, clsx } from "@koobiq/react-core";
|
|
4
|
+
import { IconChevronRight16 } from "@koobiq/react-icons";
|
|
5
|
+
import { Link } from "@koobiq/react-primitives";
|
|
6
|
+
import { utilClasses } from "../../../styles/utility.js";
|
|
7
|
+
import s from "../Navbar.module.css.js";
|
|
8
|
+
import { useNavbarState } from "../NavbarContext.js";
|
|
9
|
+
import { Tooltip } from "../../Tooltip/Tooltip.js";
|
|
10
|
+
const { listItem, typography } = utilClasses;
|
|
11
|
+
const NavbarItem = polymorphicForwardRef(
|
|
12
|
+
({
|
|
13
|
+
as,
|
|
14
|
+
className,
|
|
15
|
+
isActive,
|
|
16
|
+
isMenu = false,
|
|
17
|
+
icon,
|
|
18
|
+
badge,
|
|
19
|
+
children,
|
|
20
|
+
...other
|
|
21
|
+
}, inRef) => {
|
|
22
|
+
const { isCollapsed } = useNavbarState();
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
Tooltip,
|
|
25
|
+
{
|
|
26
|
+
offset: 8,
|
|
27
|
+
hideArrow: true,
|
|
28
|
+
placement: "end",
|
|
29
|
+
isDisabled: !isCollapsed,
|
|
30
|
+
control: (props) => /* @__PURE__ */ jsxs(
|
|
31
|
+
Link,
|
|
32
|
+
{
|
|
33
|
+
as: as || (isMenu || !other.href ? "button" : "a"),
|
|
34
|
+
className: clsx(
|
|
35
|
+
listItem,
|
|
36
|
+
typography["text-normal-medium"],
|
|
37
|
+
s.item,
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
"data-selected": isActive || void 0,
|
|
41
|
+
...mergeProps(props, other),
|
|
42
|
+
ref: mergeRefs(props.ref, inRef),
|
|
43
|
+
children: [
|
|
44
|
+
icon && /* @__PURE__ */ jsx("span", { className: s.itemIcon, children: icon }),
|
|
45
|
+
!isCollapsed && /* @__PURE__ */ jsx("span", { className: s.itemContent, children }),
|
|
46
|
+
badge && /* @__PURE__ */ jsx(
|
|
47
|
+
"span",
|
|
48
|
+
{
|
|
49
|
+
className: clsx(typography["text-compact-medium"], s.itemBadge),
|
|
50
|
+
children: badge
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
!isCollapsed && isMenu && /* @__PURE__ */ jsx(IconChevronRight16, { className: s.itemMenuIcon })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
children
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
NavbarItem.displayName = "NavbarItem";
|
|
63
|
+
export {
|
|
64
|
+
NavbarItem
|
|
65
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export declare const navbarPropVariant: readonly ["vertical", "horizontal"];
|
|
3
|
+
export type NavbarPropVariant = (typeof navbarPropVariant)[number];
|
|
4
|
+
export type NavbarProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the navbar is collapsed.
|
|
7
|
+
*/
|
|
8
|
+
isCollapsed?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the toggle button is hidden.
|
|
11
|
+
*/
|
|
12
|
+
isToggleButtonHidden?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Default collapsed state when uncontrolled.
|
|
15
|
+
*/
|
|
16
|
+
defaultCollapsed?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Navbar orientation variant.
|
|
19
|
+
* @default 'vertical'
|
|
20
|
+
*/
|
|
21
|
+
variant?: NavbarPropVariant;
|
|
22
|
+
/**
|
|
23
|
+
* Callback fired when collapse state changes.
|
|
24
|
+
*/
|
|
25
|
+
onCollapse?: (isCollapsed: boolean) => void;
|
|
26
|
+
} & ComponentPropsWithRef<'nav'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FormFieldProps, FormFieldLabelProps, FormFieldInputProps, FormFieldErrorProps, FormFieldCaptionProps, FormFieldControlGroupProps } from '../FormField';
|
|
2
|
-
export declare const SearchInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-
|
|
2
|
+
export declare const SearchInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@koobiq/react-primitives").AriaSearchFieldProps, "description" | "validationState">, "caption" | "style" | "className" | `data-${string}` | "startAddon" | "endAddon" | "variant" | "slotProps" | "labelPlacement" | "labelAlign" | "fullWidth" | "isLabelHidden"> & {
|
|
3
3
|
className?: string;
|
|
4
4
|
style?: import("react").CSSProperties;
|
|
5
5
|
isLabelHidden?: boolean;
|
|
@@ -8,5 +8,9 @@ type CompoundedComponent = typeof SelectComponent & {
|
|
|
8
8
|
Divider: typeof Divider;
|
|
9
9
|
ItemText: typeof ListItemText;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated
|
|
13
|
+
* This component has been deprecated, please use SelectNext instead.
|
|
14
|
+
*/
|
|
11
15
|
export declare const Select: CompoundedComponent;
|
|
12
16
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Divider } from '../Divider';
|
|
2
|
+
import type { ListItemText } from '../List';
|
|
3
|
+
import { SelectOption, SelectSection } from './components';
|
|
4
|
+
import { type SelectNextComponent } from './index';
|
|
5
|
+
declare const SelectComponent: SelectNextComponent;
|
|
6
|
+
type CompoundedComponent = typeof SelectComponent & {
|
|
7
|
+
Item: typeof SelectOption;
|
|
8
|
+
Section: typeof SelectSection;
|
|
9
|
+
Divider: typeof Divider;
|
|
10
|
+
ItemText: typeof ListItemText;
|
|
11
|
+
};
|
|
12
|
+
export declare const SelectNext: CompoundedComponent;
|
|
13
|
+
export {};
|