@koobiq/react-components 0.0.1-beta.13 → 0.0.1-beta.14
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/Collections/Item.d.ts +3 -3
- package/dist/components/Collections/Item.js +1 -1
- package/dist/components/Collections/Section.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts +9 -1
- package/dist/components/Dialog/Dialog.js +31 -17
- package/dist/components/Dialog/components/DialogBody.d.ts +13 -0
- package/dist/components/Dialog/components/{DialogContent.js → DialogBody.js} +9 -8
- package/dist/components/Dialog/components/DialogCloseButton.js +3 -6
- package/dist/components/Dialog/components/index.d.ts +1 -1
- package/dist/components/Dialog/index.d.ts +0 -1
- package/dist/components/Divider/Divider.d.ts +4 -0
- package/dist/components/Divider/Divider.js +44 -0
- package/dist/components/Divider/Divider.module.css.js +29 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Divider/types.d.ts +26 -0
- package/dist/components/Divider/types.js +6 -0
- package/dist/components/FieldComponents/FieldControl/FieldControl.d.ts +1 -1
- package/dist/components/FieldComponents/FieldNumberControl/FieldNumberControl.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts +4 -4
- package/dist/components/Modal/Modal.js +3 -6
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.js +4 -6
- package/dist/components/Popover/Popover.d.ts +4 -4
- package/dist/components/Popover/Popover.js +3 -6
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Popover/index.js +4 -6
- package/dist/components/SidePanel/SidePanel.d.ts +4 -4
- package/dist/components/SidePanel/SidePanel.js +3 -6
- package/dist/components/SidePanel/index.d.ts +1 -1
- package/dist/components/SidePanel/index.js +4 -6
- package/dist/components/Typography/types.d.ts +6 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/dist/style.css +41 -0
- package/package.json +5 -5
- package/dist/components/Dialog/DialogContext.d.ts +0 -9
- package/dist/components/Dialog/DialogContext.js +0 -12
- package/dist/components/Dialog/components/DialogContent.d.ts +0 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
-
import type { ItemProps } from '@koobiq/react-primitives';
|
|
3
|
-
export type
|
|
2
|
+
import type { ItemProps as AriaItemProps } from '@koobiq/react-primitives';
|
|
3
|
+
export type ItemProps<T> = AriaItemProps<T> & {
|
|
4
4
|
/** Additional CSS-classes. */
|
|
5
5
|
className?: string;
|
|
6
6
|
/** Inline styles. */
|
|
@@ -8,7 +8,7 @@ export type ListItemProps<T> = ItemProps<T> & {
|
|
|
8
8
|
/** Unique identifier for testing purposes. */
|
|
9
9
|
'data-testid'?: string | number;
|
|
10
10
|
};
|
|
11
|
-
export declare function Item<T>(props:
|
|
11
|
+
export declare function Item<T>(props: ItemProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export declare namespace Item {
|
|
13
13
|
var getCollectionNode: unknown;
|
|
14
14
|
}
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Item as Item$1 } from "@koobiq/react-primitives";
|
|
4
4
|
const ItemInner = Item$1;
|
|
5
5
|
function Item(props) {
|
|
6
|
-
return /* @__PURE__ */ jsx(Item, { ...props });
|
|
6
|
+
return /* @__PURE__ */ jsx(Item$1, { ...props });
|
|
7
7
|
}
|
|
8
8
|
Item.getCollectionNode = ItemInner.getCollectionNode;
|
|
9
9
|
export {
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Section as Section$1 } from "@koobiq/react-primitives";
|
|
4
4
|
const SectionInner = Section$1;
|
|
5
5
|
function Section(props) {
|
|
6
|
-
return /* @__PURE__ */ jsx(Section, { ...props });
|
|
6
|
+
return /* @__PURE__ */ jsx(Section$1, { ...props });
|
|
7
7
|
}
|
|
8
8
|
Section.getCollectionNode = SectionInner.getCollectionNode;
|
|
9
9
|
export {
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
import { DialogBody, DialogFooter, DialogHeader } from './components';
|
|
1
2
|
import type { DialogProps } from './types';
|
|
2
|
-
|
|
3
|
+
declare const DialogComponent: import("react").ForwardRefExoticComponent<Omit<DialogProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
4
|
+
type CompoundedComponent = typeof DialogComponent & {
|
|
5
|
+
Header: typeof DialogHeader;
|
|
6
|
+
Body: typeof DialogBody;
|
|
7
|
+
Footer: typeof DialogFooter;
|
|
8
|
+
};
|
|
9
|
+
export declare const Dialog: CompoundedComponent;
|
|
10
|
+
export {};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef,
|
|
4
|
-
import { useBoolean, useDOMRef, mergeProps, clsx, useElementSize, useEventListener
|
|
5
|
-
import { useDialog } from "@koobiq/react-primitives";
|
|
3
|
+
import { forwardRef, useEffect } from "react";
|
|
4
|
+
import { useBoolean, useDOMRef, mergeProps, clsx, useElementSize, useEventListener } from "@koobiq/react-core";
|
|
5
|
+
import { useDialog, Provider, ButtonContext } from "@koobiq/react-primitives";
|
|
6
6
|
import { utilClasses } from "../../styles/utility.js";
|
|
7
7
|
import s from "./Dialog.module.css.js";
|
|
8
|
-
import {
|
|
8
|
+
import { DialogBodyContext, DialogBody } from "./components/DialogBody.js";
|
|
9
9
|
import { DialogCloseButton } from "./components/DialogCloseButton.js";
|
|
10
|
-
|
|
10
|
+
import { DialogHeader } from "./components/DialoglHeader.js";
|
|
11
|
+
import { DialogFooter } from "./components/DialogFooter.js";
|
|
12
|
+
const DialogComponent = forwardRef(
|
|
11
13
|
({ onClose, children, slotProps, hideCloseButton, ...other }, ref) => {
|
|
12
14
|
const [topOverflow, { set: setTopOverflow }] = useBoolean();
|
|
13
15
|
const [bottomOverflow, { set: setBottomOverflow }] = useBoolean();
|
|
14
|
-
const contentRef = useRef(null);
|
|
15
16
|
const domRef = useDOMRef(ref);
|
|
16
17
|
const { dialogProps } = useDialog(other, domRef);
|
|
17
18
|
const showCloseButton = !hideCloseButton;
|
|
@@ -35,24 +36,33 @@ const Dialog = forwardRef(
|
|
|
35
36
|
element.scrollTop + element.clientHeight < element.scrollHeight
|
|
36
37
|
);
|
|
37
38
|
};
|
|
38
|
-
const { ref:
|
|
39
|
+
const { ref: bodyRef, height } = useElementSize();
|
|
39
40
|
useEffect(() => {
|
|
40
|
-
if (
|
|
41
|
-
}, [
|
|
41
|
+
if (bodyRef.current) updateOverflow(bodyRef.current);
|
|
42
|
+
}, [bodyRef.current, height]);
|
|
42
43
|
useEventListener({
|
|
43
|
-
element:
|
|
44
|
+
element: bodyRef,
|
|
44
45
|
eventName: "scroll",
|
|
45
46
|
handler: () => {
|
|
46
|
-
updateOverflow(
|
|
47
|
+
updateOverflow(bodyRef.current);
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
return /* @__PURE__ */ jsx(
|
|
50
|
-
|
|
51
|
+
Provider,
|
|
51
52
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
values: [
|
|
54
|
+
[DialogBodyContext, { ref: bodyRef }],
|
|
55
|
+
[
|
|
56
|
+
ButtonContext,
|
|
57
|
+
{
|
|
58
|
+
slots: {
|
|
59
|
+
close: {
|
|
60
|
+
onPress: onClose
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
],
|
|
56
66
|
children: /* @__PURE__ */ jsxs("section", { ...rootProps, ref: domRef, children: [
|
|
57
67
|
showCloseButton && /* @__PURE__ */ jsx(DialogCloseButton, { ...slotProps?.["close-button"] }),
|
|
58
68
|
/* @__PURE__ */ jsx("div", { ...containerProps, children })
|
|
@@ -61,7 +71,11 @@ const Dialog = forwardRef(
|
|
|
61
71
|
);
|
|
62
72
|
}
|
|
63
73
|
);
|
|
64
|
-
|
|
74
|
+
DialogComponent.displayName = "Dialog";
|
|
75
|
+
const Dialog = DialogComponent;
|
|
76
|
+
Dialog.Header = DialogHeader;
|
|
77
|
+
Dialog.Body = DialogBody;
|
|
78
|
+
Dialog.Footer = DialogFooter;
|
|
65
79
|
export {
|
|
66
80
|
Dialog
|
|
67
81
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode, ComponentRef } from 'react';
|
|
2
|
+
import { type ExtendableComponentPropsWithRef } from '@koobiq/react-core';
|
|
3
|
+
export type DialogBodyRef = ComponentRef<'div'>;
|
|
4
|
+
export type DialogBodyProps = ExtendableComponentPropsWithRef<{
|
|
5
|
+
/** Additional CSS-classes. */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** The content of the component. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Unique identifier for testing purposes. */
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
}, 'div'>;
|
|
12
|
+
export declare const DialogBodyContext: import("react").Context<DialogBodyProps>;
|
|
13
|
+
export declare const DialogBody: import("react").ForwardRefExoticComponent<Omit<DialogBodyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import { clsx, useMultiRef } from "@koobiq/react-core";
|
|
3
|
+
import { createContext, forwardRef, useContext } from "react";
|
|
4
|
+
import { mergeProps, clsx, useMultiRef } from "@koobiq/react-core";
|
|
5
5
|
import { utilClasses } from "../../../styles/utility.js";
|
|
6
6
|
import s from "../Dialog.module.css.js";
|
|
7
|
-
|
|
8
|
-
const
|
|
7
|
+
const DialogBodyContext = createContext({});
|
|
8
|
+
const DialogBody = forwardRef(
|
|
9
9
|
({ children, className, ...other }, ref) => {
|
|
10
|
-
const
|
|
11
|
-
const {
|
|
10
|
+
const defaultProps = useContext(DialogBodyContext);
|
|
11
|
+
const { ref: contextRef } = mergeProps(defaultProps, other);
|
|
12
12
|
return /* @__PURE__ */ jsx(
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
@@ -24,7 +24,8 @@ const DialogContent = forwardRef(
|
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
|
-
|
|
27
|
+
DialogBody.displayName = "DialogBody";
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
DialogBody,
|
|
30
|
+
DialogBodyContext
|
|
30
31
|
};
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import { mergeProps } from "@koobiq/react-core";
|
|
5
4
|
import { IconXmark16 } from "@koobiq/react-icons";
|
|
6
5
|
import { useLocalizedStringFormatter } from "@koobiq/react-primitives";
|
|
7
6
|
import s from "../Dialog.module.css.js";
|
|
8
7
|
import intlMessages from "../intl.json.js";
|
|
9
|
-
import { useDialogProvider } from "../DialogContext.js";
|
|
10
8
|
import { Button } from "../../Button/Button.js";
|
|
11
|
-
const DialogCloseButton = forwardRef((
|
|
12
|
-
const { close } = useDialogProvider();
|
|
9
|
+
const DialogCloseButton = forwardRef((props, ref) => {
|
|
13
10
|
const stringFormatter = useLocalizedStringFormatter(intlMessages);
|
|
14
11
|
return /* @__PURE__ */ jsx("div", { className: s.closeButton, children: /* @__PURE__ */ jsx(
|
|
15
12
|
Button,
|
|
16
13
|
{
|
|
17
|
-
...mergeProps({ onPress: close }, { onPress }),
|
|
18
14
|
"aria-label": stringFormatter.format("close"),
|
|
19
15
|
startIcon: /* @__PURE__ */ jsx(IconXmark16, {}),
|
|
20
16
|
variant: "contrast-transparent",
|
|
17
|
+
slot: "close",
|
|
21
18
|
onlyIcon: true,
|
|
22
|
-
...
|
|
19
|
+
...props,
|
|
23
20
|
ref
|
|
24
21
|
}
|
|
25
22
|
) });
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
+
import type { DividerBaseProps } from './index';
|
|
3
|
+
export declare const Divider: import("@koobiq/react-core").PolyForwardComponent<"div", DividerBaseProps, ElementType>;
|
|
4
|
+
export type DividerProps<As extends ElementType = 'div'> = ComponentPropsWithRef<typeof Divider<As>>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
|
|
4
|
+
import { useSeparator } from "@koobiq/react-primitives";
|
|
5
|
+
import s from "./Divider.module.css.js";
|
|
6
|
+
const Divider = polymorphicForwardRef(
|
|
7
|
+
(props, ref) => {
|
|
8
|
+
const {
|
|
9
|
+
as: Tag = "div",
|
|
10
|
+
orientation = "horizontal",
|
|
11
|
+
disablePaddings = false,
|
|
12
|
+
flexItem = false,
|
|
13
|
+
display,
|
|
14
|
+
className,
|
|
15
|
+
...other
|
|
16
|
+
} = props;
|
|
17
|
+
const { separatorProps } = useSeparator({
|
|
18
|
+
...other,
|
|
19
|
+
orientation,
|
|
20
|
+
elementType: Tag
|
|
21
|
+
});
|
|
22
|
+
const hasPaddings = !disablePaddings;
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
Tag,
|
|
25
|
+
{
|
|
26
|
+
...separatorProps,
|
|
27
|
+
className: clsx(
|
|
28
|
+
s.base,
|
|
29
|
+
s[orientation],
|
|
30
|
+
display && s[display],
|
|
31
|
+
hasPaddings && s.hasPaddings,
|
|
32
|
+
flexItem && s.flexItem,
|
|
33
|
+
className
|
|
34
|
+
),
|
|
35
|
+
ref,
|
|
36
|
+
...other
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
Divider.displayName = "Divider";
|
|
42
|
+
export {
|
|
43
|
+
Divider
|
|
44
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const base = "kbq-divider-16da20";
|
|
2
|
+
const block = "kbq-divider-block-72e3e3";
|
|
3
|
+
const inlineBlock = "kbq-divider-inlineBlock-0f06d1";
|
|
4
|
+
const inline = "kbq-divider-inline-2d4752";
|
|
5
|
+
const vertical = "kbq-divider-vertical-a4e613";
|
|
6
|
+
const horizontal = "kbq-divider-horizontal-22c78d";
|
|
7
|
+
const hasPaddings = "kbq-divider-hasPaddings-d8f601";
|
|
8
|
+
const flexItem = "kbq-divider-flexItem-af9975";
|
|
9
|
+
const s = {
|
|
10
|
+
base,
|
|
11
|
+
block,
|
|
12
|
+
inlineBlock,
|
|
13
|
+
inline,
|
|
14
|
+
vertical,
|
|
15
|
+
horizontal,
|
|
16
|
+
hasPaddings,
|
|
17
|
+
flexItem
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
base,
|
|
21
|
+
block,
|
|
22
|
+
s as default,
|
|
23
|
+
flexItem,
|
|
24
|
+
hasPaddings,
|
|
25
|
+
horizontal,
|
|
26
|
+
inline,
|
|
27
|
+
inlineBlock,
|
|
28
|
+
vertical
|
|
29
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const dividerPropDisplay: readonly ["block", "inline", "inlineBlock"];
|
|
2
|
+
export declare const dividerPropOrientation: readonly ["horizontal", "vertical"];
|
|
3
|
+
export type DividerPropOrientation = (typeof dividerPropOrientation)[number];
|
|
4
|
+
export type DividerPropDisplay = (typeof dividerPropDisplay)[number];
|
|
5
|
+
export type DividerBaseProps = {
|
|
6
|
+
/** Additional CSS-classes. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The orientation of the separator.
|
|
10
|
+
* @default 'horizontal'
|
|
11
|
+
*/
|
|
12
|
+
orientation?: DividerPropOrientation;
|
|
13
|
+
/** Set the display for the component. */
|
|
14
|
+
display?: DividerPropDisplay;
|
|
15
|
+
/**
|
|
16
|
+
* Indicates if the divider is a child of a flex container.
|
|
17
|
+
* Mainly used for vertical layout.
|
|
18
|
+
* Used when the block does not have a fixed height.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
flexItem?: boolean;
|
|
22
|
+
/** If `true`, it disables the default paddings.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
disablePaddings?: boolean;
|
|
26
|
+
};
|
|
@@ -4,7 +4,7 @@ export type FieldControlProps = TextFieldProps & {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
6
6
|
export type FieldControlRef = TextFieldRef;
|
|
7
|
-
export declare const FieldControl: import("react").ForwardRefExoticComponent<Omit<import("@koobiq/react-primitives").UseTextFieldProps, keyof import("
|
|
7
|
+
export declare const FieldControl: import("react").ForwardRefExoticComponent<Omit<import("@koobiq/react-primitives").UseTextFieldProps, keyof import("@koobiq/react-primitives").RenderProps<import("@koobiq/react-primitives").TextFieldRenderProps>> & import("@koobiq/react-primitives").RenderProps<import("@koobiq/react-primitives").TextFieldRenderProps> & {
|
|
8
8
|
fullWidth?: boolean;
|
|
9
9
|
className?: string;
|
|
10
10
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -4,7 +4,7 @@ export type FieldNumberControlProps = NumberFieldProps & {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
6
6
|
export type FieldNumberControlRef = NumberFieldRef;
|
|
7
|
-
export declare const FieldNumberControl: import("react").ForwardRefExoticComponent<Omit<import("@koobiq/react-primitives").UseNumberFieldProps, keyof import("
|
|
7
|
+
export declare const FieldNumberControl: import("react").ForwardRefExoticComponent<Omit<import("@koobiq/react-primitives").UseNumberFieldProps, keyof import("@koobiq/react-primitives").RenderProps<import("@koobiq/react-primitives").NumberFieldRenderProps>> & import("@koobiq/react-primitives").RenderProps<import("@koobiq/react-primitives").NumberFieldRenderProps> & {
|
|
8
8
|
fullWidth?: boolean;
|
|
9
9
|
className?: string;
|
|
10
10
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dialog } from '../Dialog';
|
|
2
2
|
import type { ModalProps } from './types';
|
|
3
3
|
declare const ModalComponent: import("react").ForwardRefExoticComponent<ModalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
4
|
type CompoundedComponent = typeof ModalComponent & {
|
|
5
|
-
Header: typeof
|
|
6
|
-
Body: typeof
|
|
7
|
-
Footer: typeof
|
|
5
|
+
Header: typeof Dialog.Header;
|
|
6
|
+
Body: typeof Dialog.Body;
|
|
7
|
+
Footer: typeof Dialog.Footer;
|
|
8
8
|
};
|
|
9
9
|
export declare const Modal: CompoundedComponent;
|
|
10
10
|
export {};
|
|
@@ -7,9 +7,6 @@ import { Transition } from "react-transition-group";
|
|
|
7
7
|
import s from "./Modal.module.css.js";
|
|
8
8
|
import { Backdrop } from "../Backdrop/Backdrop.js";
|
|
9
9
|
import { Dialog } from "../Dialog/Dialog.js";
|
|
10
|
-
import { DialogHeader } from "../Dialog/components/DialoglHeader.js";
|
|
11
|
-
import { DialogContent } from "../Dialog/components/DialogContent.js";
|
|
12
|
-
import { DialogFooter } from "../Dialog/components/DialogFooter.js";
|
|
13
10
|
const ModalComponent = forwardRef((props, ref) => {
|
|
14
11
|
const {
|
|
15
12
|
size = "medium",
|
|
@@ -121,9 +118,9 @@ const ModalComponent = forwardRef((props, ref) => {
|
|
|
121
118
|
});
|
|
122
119
|
ModalComponent.displayName = "Modal";
|
|
123
120
|
const Modal = ModalComponent;
|
|
124
|
-
Modal.Header =
|
|
125
|
-
Modal.Body =
|
|
126
|
-
Modal.Footer =
|
|
121
|
+
Modal.Header = Dialog.Header;
|
|
122
|
+
Modal.Body = Dialog.Body;
|
|
123
|
+
Modal.Footer = Dialog.Footer;
|
|
127
124
|
export {
|
|
128
125
|
Modal
|
|
129
126
|
};
|
|
@@ -9,7 +9,7 @@ export declare const ModalHeader: import("react").ForwardRefExoticComponent<Omit
|
|
|
9
9
|
* @deprecated
|
|
10
10
|
* This component has been deprecated, please use `Modal.Body` instead.
|
|
11
11
|
*/
|
|
12
|
-
export declare const ModalContent: import("react").ForwardRefExoticComponent<Omit<import("../Dialog").
|
|
12
|
+
export declare const ModalContent: import("react").ForwardRefExoticComponent<Omit<import("../Dialog").DialogBodyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated
|
|
15
15
|
* This component has been deprecated, please use `Modal.Footer` instead.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const ModalContent = DialogContent;
|
|
6
|
-
const ModalFooter = DialogFooter;
|
|
1
|
+
import { Dialog } from "../Dialog/Dialog.js";
|
|
2
|
+
const ModalHeader = Dialog.Header;
|
|
3
|
+
const ModalContent = Dialog.Body;
|
|
4
|
+
const ModalFooter = Dialog.Footer;
|
|
7
5
|
export {
|
|
8
6
|
ModalContent,
|
|
9
7
|
ModalFooter,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Dialog } from '../Dialog';
|
|
3
3
|
import type { PopoverInnerProps } from './types';
|
|
4
4
|
export declare const PopoverInner: FC<PopoverInnerProps>;
|
|
5
5
|
declare const PopoverComponent: import("react").ForwardRefExoticComponent<import("./types").PopoverBaseProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
6
|
type CompoundedComponent = typeof PopoverComponent & {
|
|
7
|
-
Header: typeof
|
|
8
|
-
Body: typeof
|
|
9
|
-
Footer: typeof
|
|
7
|
+
Header: typeof Dialog.Header;
|
|
8
|
+
Body: typeof Dialog.Body;
|
|
9
|
+
Footer: typeof Dialog.Footer;
|
|
10
10
|
};
|
|
11
11
|
export declare const Popover: CompoundedComponent;
|
|
12
12
|
export {};
|
|
@@ -7,9 +7,6 @@ import { Transition } from "react-transition-group";
|
|
|
7
7
|
import s from "./Popover.module.css.js";
|
|
8
8
|
import { normalizeInlineSize } from "./utils.js";
|
|
9
9
|
import { Dialog } from "../Dialog/Dialog.js";
|
|
10
|
-
import { DialogHeader } from "../Dialog/components/DialoglHeader.js";
|
|
11
|
-
import { DialogContent } from "../Dialog/components/DialogContent.js";
|
|
12
|
-
import { DialogFooter } from "../Dialog/components/DialogFooter.js";
|
|
13
10
|
const PopoverInner = (props) => {
|
|
14
11
|
const {
|
|
15
12
|
offset = 0,
|
|
@@ -156,9 +153,9 @@ const PopoverComponent = forwardRef(
|
|
|
156
153
|
);
|
|
157
154
|
PopoverComponent.displayName = "Popover";
|
|
158
155
|
const Popover = PopoverComponent;
|
|
159
|
-
Popover.Header =
|
|
160
|
-
Popover.Body =
|
|
161
|
-
Popover.Footer =
|
|
156
|
+
Popover.Header = Dialog.Header;
|
|
157
|
+
Popover.Body = Dialog.Body;
|
|
158
|
+
Popover.Footer = Dialog.Footer;
|
|
162
159
|
export {
|
|
163
160
|
Popover,
|
|
164
161
|
PopoverInner
|
|
@@ -9,7 +9,7 @@ export declare const PopoverHeader: import("react").ForwardRefExoticComponent<Om
|
|
|
9
9
|
* @deprecated
|
|
10
10
|
* This component has been deprecated, please use `Popover.Body` instead.
|
|
11
11
|
*/
|
|
12
|
-
export declare const PopoverContent: import("react").ForwardRefExoticComponent<Omit<import("../Dialog").
|
|
12
|
+
export declare const PopoverContent: import("react").ForwardRefExoticComponent<Omit<import("../Dialog").DialogBodyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated
|
|
15
15
|
* This component has been deprecated, please use `Popover.Footer` instead.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const PopoverContent = DialogContent;
|
|
6
|
-
const PopoverFooter = DialogFooter;
|
|
1
|
+
import { Dialog } from "../Dialog/Dialog.js";
|
|
2
|
+
const PopoverHeader = Dialog.Header;
|
|
3
|
+
const PopoverContent = Dialog.Body;
|
|
4
|
+
const PopoverFooter = Dialog.Footer;
|
|
7
5
|
export {
|
|
8
6
|
PopoverContent,
|
|
9
7
|
PopoverFooter,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dialog } from '../Dialog';
|
|
2
2
|
import type { SidePanelProps } from './types';
|
|
3
3
|
declare const SidePanelComponent: import("react").ForwardRefExoticComponent<SidePanelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
4
|
type CompoundedComponent = typeof SidePanelComponent & {
|
|
5
|
-
Header: typeof
|
|
6
|
-
Body: typeof
|
|
7
|
-
Footer: typeof
|
|
5
|
+
Header: typeof Dialog.Header;
|
|
6
|
+
Body: typeof Dialog.Body;
|
|
7
|
+
Footer: typeof Dialog.Footer;
|
|
8
8
|
};
|
|
9
9
|
export declare const SidePanel: CompoundedComponent;
|
|
10
10
|
export {};
|
|
@@ -7,9 +7,6 @@ import { Transition } from "react-transition-group";
|
|
|
7
7
|
import s from "./SidePanel.module.css.js";
|
|
8
8
|
import { Backdrop } from "../Backdrop/Backdrop.js";
|
|
9
9
|
import { Dialog } from "../Dialog/Dialog.js";
|
|
10
|
-
import { DialogHeader } from "../Dialog/components/DialoglHeader.js";
|
|
11
|
-
import { DialogContent } from "../Dialog/components/DialogContent.js";
|
|
12
|
-
import { DialogFooter } from "../Dialog/components/DialogFooter.js";
|
|
13
10
|
const SidePanelComponent = forwardRef(
|
|
14
11
|
(props, ref) => {
|
|
15
12
|
const {
|
|
@@ -125,9 +122,9 @@ const SidePanelComponent = forwardRef(
|
|
|
125
122
|
);
|
|
126
123
|
SidePanelComponent.displayName = "SidePanel";
|
|
127
124
|
const SidePanel = SidePanelComponent;
|
|
128
|
-
SidePanel.Header =
|
|
129
|
-
SidePanel.Body =
|
|
130
|
-
SidePanel.Footer =
|
|
125
|
+
SidePanel.Header = Dialog.Header;
|
|
126
|
+
SidePanel.Body = Dialog.Body;
|
|
127
|
+
SidePanel.Footer = Dialog.Footer;
|
|
131
128
|
export {
|
|
132
129
|
SidePanel
|
|
133
130
|
};
|
|
@@ -9,7 +9,7 @@ export declare const SidePanelHeader: import("react").ForwardRefExoticComponent<
|
|
|
9
9
|
* @deprecated
|
|
10
10
|
* This component has been deprecated, please use `SidePanel.Body` instead.
|
|
11
11
|
*/
|
|
12
|
-
export declare const SidePanelContent: import("react").ForwardRefExoticComponent<Omit<import("../Dialog").
|
|
12
|
+
export declare const SidePanelContent: import("react").ForwardRefExoticComponent<Omit<import("../Dialog").DialogBodyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated
|
|
15
15
|
* This component has been deprecated, please use `SidePanel.Footer` instead.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const SidePanelContent = DialogContent;
|
|
6
|
-
const SidePanelFooter = DialogFooter;
|
|
1
|
+
import { Dialog } from "../Dialog/Dialog.js";
|
|
2
|
+
const SidePanelHeader = Dialog.Header;
|
|
3
|
+
const SidePanelContent = Dialog.Body;
|
|
4
|
+
const SidePanelFooter = Dialog.Footer;
|
|
7
5
|
export {
|
|
8
6
|
SidePanelContent,
|
|
9
7
|
SidePanelFooter,
|
|
@@ -2,7 +2,12 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
export declare const typographyPropVariant: readonly ["display-big", "display-normal", "display-compact", "display-big-strong", "display-normal-strong", "display-compact-strong", "headline", "title", "subheading", "text-big", "text-big-strong", "text-big-medium", "text-normal", "text-normal-strong", "text-normal-medium", "text-compact", "text-compact-strong", "text-compact-medium", "caps-big", "caps-big-strong", "caps-normal", "caps-normal-strong", "caps-compact", "caps-compact-strong", "mono-big", "mono-big-strong", "mono-normal", "mono-normal-strong", "mono-compact", "mono-compact-strong", "mono-codeblock", "tabular-big", "tabular-big-strong", "tabular-normal", "tabular-normal-strong", "tabular-compact", "tabular-compact-strong", "italic-big", "italic-big-strong", "italic-normal", "italic-normal-strong", "italic-compact", "italic-compact-strong", "inherit"];
|
|
3
3
|
export type TypographyPropVariant = (typeof typographyPropVariant)[number];
|
|
4
4
|
export declare const typographyPropDisplay: readonly ["block", "inline", "inline-block"];
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
* This type has been deprecated, please use `TypographyPropDisplay` instead.
|
|
8
|
+
*/
|
|
5
9
|
export type TypographyDisplayVariant = (typeof typographyPropDisplay)[number];
|
|
10
|
+
export type TypographyPropDisplay = (typeof typographyPropDisplay)[number];
|
|
6
11
|
export declare const typographyPropAlign: readonly ["start", "center", "end", "initial", "inherit"];
|
|
7
12
|
export type TypographyPropAlign = (typeof typographyPropAlign)[number];
|
|
8
13
|
export declare const typographyPropColor: readonly ["white", "white-secondary", "theme", "theme-secondary", "contrast", "on-contrast", "contrast-secondary", "contrast-tertiary", "error", "error-secondary", "error-tertiary", "error-less", "success", "success-less", "success-secondary", "warning", "warning-secondary", "visited", "inherit"];
|
|
@@ -14,7 +19,7 @@ export type TypographyBaseProps = {
|
|
|
14
19
|
* */
|
|
15
20
|
variant?: TypographyPropVariant;
|
|
16
21
|
/** Set the display for the component. */
|
|
17
|
-
display?:
|
|
22
|
+
display?: TypographyPropDisplay;
|
|
18
23
|
/** Set the text-align on the component. */
|
|
19
24
|
align?: TypographyPropAlign;
|
|
20
25
|
/** Hidden overflow content will be replaced by an ellipsis. */
|
package/dist/index.js
CHANGED
|
@@ -61,6 +61,8 @@ import { ListItemText } from "./components/List/components/ListItemText/ListItem
|
|
|
61
61
|
import { listPropSelectionMode } from "./components/List/types.js";
|
|
62
62
|
import { AnimatedIcon } from "./components/AnimatedIcon/AnimatedIcon.js";
|
|
63
63
|
import { Select } from "./components/Select/Select.js";
|
|
64
|
+
import { Divider } from "./components/Divider/Divider.js";
|
|
65
|
+
import { dividerPropDisplay, dividerPropOrientation } from "./components/Divider/types.js";
|
|
64
66
|
import { flex, flexPropAlignItems, flexPropDirection, flexPropFlex, flexPropGap, flexPropJustifyContent, flexPropOrder, flexPropWrap } from "./components/layout/flex/flex.js";
|
|
65
67
|
import { spacing, spacingGap } from "./components/layout/spacing/spacing.js";
|
|
66
68
|
export {
|
|
@@ -72,6 +74,7 @@ export {
|
|
|
72
74
|
Button,
|
|
73
75
|
Checkbox,
|
|
74
76
|
Container,
|
|
77
|
+
Divider,
|
|
75
78
|
FlexBox,
|
|
76
79
|
Grid,
|
|
77
80
|
GridItem,
|
|
@@ -122,6 +125,8 @@ export {
|
|
|
122
125
|
containerMarginsProp,
|
|
123
126
|
containerPositionProp,
|
|
124
127
|
defaultBreakpoints,
|
|
128
|
+
dividerPropDisplay,
|
|
129
|
+
dividerPropOrientation,
|
|
125
130
|
flex,
|
|
126
131
|
flexPropAlignItems,
|
|
127
132
|
flexPropDirection,
|
package/dist/style.css
CHANGED
|
@@ -3121,6 +3121,47 @@
|
|
|
3121
3121
|
.kbq-fieldselect-hasPlaceholder-7b7518 {
|
|
3122
3122
|
--field-input-color: var(--field-input-placeholder-color);
|
|
3123
3123
|
}
|
|
3124
|
+
.kbq-divider-16da20 {
|
|
3125
|
+
border-style: solid;
|
|
3126
|
+
border-color: var(--kbq-line-contrast-less);
|
|
3127
|
+
flex-shrink: 0;
|
|
3128
|
+
margin: 0;
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
.kbq-divider-block-72e3e3 {
|
|
3132
|
+
display: block;
|
|
3133
|
+
}
|
|
3134
|
+
|
|
3135
|
+
.kbq-divider-inlineBlock-0f06d1 {
|
|
3136
|
+
display: inline-block;
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
.kbq-divider-inline-2d4752 {
|
|
3140
|
+
display: inline;
|
|
3141
|
+
}
|
|
3142
|
+
|
|
3143
|
+
.kbq-divider-vertical-a4e613 {
|
|
3144
|
+
--divider-paddings: 0 var(--kbq-size-xxs);
|
|
3145
|
+
border-width: 0 1px 0 0;
|
|
3146
|
+
block-size: 100%;
|
|
3147
|
+
inline-size: 0;
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3150
|
+
.kbq-divider-horizontal-22c78d {
|
|
3151
|
+
--divider-paddings: var(--kbq-size-xxs) 0;
|
|
3152
|
+
border-width: 0 0 1px;
|
|
3153
|
+
block-size: 0;
|
|
3154
|
+
inline-size: 100%;
|
|
3155
|
+
}
|
|
3156
|
+
|
|
3157
|
+
.kbq-divider-hasPaddings-d8f601 {
|
|
3158
|
+
margin: var(--divider-paddings);
|
|
3159
|
+
}
|
|
3160
|
+
|
|
3161
|
+
.kbq-divider-flexItem-af9975 {
|
|
3162
|
+
align-self: stretch;
|
|
3163
|
+
block-size: auto;
|
|
3164
|
+
}
|
|
3124
3165
|
.kbq-spacing-mbs_0-be7021 {
|
|
3125
3166
|
margin-block-start: 0;
|
|
3126
3167
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/react-components",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.14",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"@koobiq/design-tokens": "^3.12.1",
|
|
28
28
|
"@types/react-transition-group": "^4.4.12",
|
|
29
29
|
"react-transition-group": "^4.4.5",
|
|
30
|
-
"@koobiq/
|
|
31
|
-
"@koobiq/react-
|
|
32
|
-
"@koobiq/react-
|
|
33
|
-
"@koobiq/
|
|
30
|
+
"@koobiq/react-core": "0.0.1-beta.14",
|
|
31
|
+
"@koobiq/react-icons": "0.0.1-beta.14",
|
|
32
|
+
"@koobiq/react-primitives": "0.0.1-beta.14",
|
|
33
|
+
"@koobiq/logger": "0.0.1-beta.14"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@koobiq/design-tokens": "^3.11.2",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { DialogContentProps } from './components';
|
|
2
|
-
export type DialogContextProps = {
|
|
3
|
-
close?(): void;
|
|
4
|
-
slots?: {
|
|
5
|
-
content?: DialogContentProps;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare const DialogContext: import("react").Context<DialogContextProps>;
|
|
9
|
-
export declare function useDialogProvider(): DialogContextProps;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ReactNode, ComponentRef } from 'react';
|
|
2
|
-
import { type ExtendableComponentPropsWithRef } from '@koobiq/react-core';
|
|
3
|
-
export type DialogContentRef = ComponentRef<'div'>;
|
|
4
|
-
export type DialogContentProps = ExtendableComponentPropsWithRef<{
|
|
5
|
-
/** Additional CSS-classes. */
|
|
6
|
-
className?: string;
|
|
7
|
-
/** The content of the component. */
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
/** Unique identifier for testing purposes. */
|
|
10
|
-
'data-testid'?: string;
|
|
11
|
-
}, 'div'>;
|
|
12
|
-
export declare const DialogContent: import("react").ForwardRefExoticComponent<Omit<DialogContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|