@koobiq/react-components 0.0.1-beta.13 → 0.0.1-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/components/Collections/Item.d.ts +3 -3
  2. package/dist/components/Collections/Item.js +2 -3
  3. package/dist/components/Collections/Section.d.ts +1 -1
  4. package/dist/components/Collections/Section.js +2 -3
  5. package/dist/components/Dialog/Dialog.d.ts +9 -1
  6. package/dist/components/Dialog/Dialog.js +31 -17
  7. package/dist/components/Dialog/components/DialogBody.d.ts +13 -0
  8. package/dist/components/Dialog/components/{DialogContent.js → DialogBody.js} +9 -8
  9. package/dist/components/Dialog/components/DialogCloseButton.d.ts +2 -2
  10. package/dist/components/Dialog/components/DialogCloseButton.js +3 -6
  11. package/dist/components/Dialog/components/index.d.ts +1 -1
  12. package/dist/components/Dialog/index.d.ts +0 -1
  13. package/dist/components/Divider/Divider.d.ts +4 -0
  14. package/dist/components/Divider/Divider.js +44 -0
  15. package/dist/components/Divider/Divider.module.css.js +29 -0
  16. package/dist/components/Divider/index.d.ts +2 -0
  17. package/dist/components/Divider/types.d.ts +26 -0
  18. package/dist/components/Divider/types.js +6 -0
  19. package/dist/components/FieldComponents/FieldControl/FieldControl.d.ts +1 -1
  20. package/dist/components/FieldComponents/FieldNumberControl/FieldNumberControl.d.ts +1 -1
  21. package/dist/components/Modal/Modal.d.ts +4 -4
  22. package/dist/components/Modal/Modal.js +3 -6
  23. package/dist/components/Modal/index.d.ts +1 -1
  24. package/dist/components/Modal/index.js +4 -6
  25. package/dist/components/Popover/Popover.d.ts +4 -4
  26. package/dist/components/Popover/Popover.js +3 -6
  27. package/dist/components/Popover/index.d.ts +1 -1
  28. package/dist/components/Popover/index.js +4 -6
  29. package/dist/components/SidePanel/SidePanel.d.ts +4 -4
  30. package/dist/components/SidePanel/SidePanel.js +3 -6
  31. package/dist/components/SidePanel/index.d.ts +1 -1
  32. package/dist/components/SidePanel/index.js +4 -6
  33. package/dist/components/Typography/types.d.ts +6 -1
  34. package/dist/components/index.d.ts +1 -0
  35. package/dist/index.js +5 -0
  36. package/dist/style.css +44 -0
  37. package/package.json +5 -5
  38. package/dist/components/Dialog/DialogContext.d.ts +0 -9
  39. package/dist/components/Dialog/DialogContext.js +0 -12
  40. 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 ListItemProps<T> = ItemProps<T> & {
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: ListItemProps<T>): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Item<T>(_props: ItemProps<T>): null;
12
12
  export declare namespace Item {
13
13
  var getCollectionNode: unknown;
14
14
  }
@@ -1,9 +1,8 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { Item as Item$1 } from "@koobiq/react-primitives";
4
3
  const ItemInner = Item$1;
5
- function Item(props) {
6
- return /* @__PURE__ */ jsx(Item, { ...props });
4
+ function Item(_props) {
5
+ return null;
7
6
  }
8
7
  Item.getCollectionNode = ItemInner.getCollectionNode;
9
8
  export {
@@ -10,7 +10,7 @@ export type SectionProps<T> = {
10
10
  /** Item objects in the section. */
11
11
  items?: AriaSectionProps<T>['items'];
12
12
  };
13
- export declare function Section<T>(props: SectionProps<T>): import("react/jsx-runtime").JSX.Element;
13
+ export declare function Section<T>(_props: SectionProps<T>): null;
14
14
  export declare namespace Section {
15
15
  var getCollectionNode: unknown;
16
16
  }
@@ -1,9 +1,8 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { Section as Section$1 } from "@koobiq/react-primitives";
4
3
  const SectionInner = Section$1;
5
- function Section(props) {
6
- return /* @__PURE__ */ jsx(Section, { ...props });
4
+ function Section(_props) {
5
+ return null;
7
6
  }
8
7
  Section.getCollectionNode = SectionInner.getCollectionNode;
9
8
  export {
@@ -1,2 +1,10 @@
1
+ import { DialogBody, DialogFooter, DialogHeader } from './components';
1
2
  import type { DialogProps } from './types';
2
- export declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DialogProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
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, useRef, useEffect } from "react";
4
- import { useBoolean, useDOMRef, mergeProps, clsx, useElementSize, useEventListener, useMultiRef } from "@koobiq/react-core";
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 { DialogContext } from "./DialogContext.js";
8
+ import { DialogBodyContext, DialogBody } from "./components/DialogBody.js";
9
9
  import { DialogCloseButton } from "./components/DialogCloseButton.js";
10
- const Dialog = forwardRef(
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: innerRef, height } = useElementSize();
39
+ const { ref: bodyRef, height } = useElementSize();
39
40
  useEffect(() => {
40
- if (contentRef.current) updateOverflow(contentRef.current);
41
- }, [contentRef.current, height]);
41
+ if (bodyRef.current) updateOverflow(bodyRef.current);
42
+ }, [bodyRef.current, height]);
42
43
  useEventListener({
43
- element: contentRef,
44
+ element: bodyRef,
44
45
  eventName: "scroll",
45
46
  handler: () => {
46
- updateOverflow(contentRef.current);
47
+ updateOverflow(bodyRef.current);
47
48
  }
48
49
  });
49
50
  return /* @__PURE__ */ jsx(
50
- DialogContext.Provider,
51
+ Provider,
51
52
  {
52
- value: {
53
- close: onClose,
54
- slots: { content: { ref: useMultiRef([contentRef, innerRef]) } }
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
- Dialog.displayName = "Dialog";
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
- import { useDialogProvider } from "../DialogContext.js";
8
- const DialogContent = forwardRef(
7
+ const DialogBodyContext = createContext({});
8
+ const DialogBody = forwardRef(
9
9
  ({ children, className, ...other }, ref) => {
10
- const { slots } = useDialogProvider();
11
- const { content: { ref: contextRef } = {} } = slots || {};
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
- DialogContent.displayName = "DialogContent";
27
+ DialogBody.displayName = "DialogBody";
28
28
  export {
29
- DialogContent
29
+ DialogBody,
30
+ DialogBodyContext
30
31
  };
@@ -15,8 +15,8 @@ export declare const DialogCloseButton: import("react").ForwardRefExoticComponen
15
15
  startIcon?: import("react").ReactNode;
16
16
  endIcon?: import("react").ReactNode;
17
17
  'data-testid'?: string | number;
18
- onHoverStart?: (e: import("@react-types/shared").HoverEvent) => void;
19
- onHoverEnd?: (e: import("@react-types/shared").HoverEvent) => void;
18
+ onHoverStart?: (e: import("@koobiq/react-primitives").HoverEvent) => void;
19
+ onHoverEnd?: (e: import("@koobiq/react-primitives").HoverEvent) => void;
20
20
  } & {
21
21
  as?: "button" | undefined;
22
22
  }, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -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(({ onPress, ...other }, ref) => {
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
- ...other,
19
+ ...props,
23
20
  ref
24
21
  }
25
22
  ) });
@@ -1,4 +1,4 @@
1
1
  export * from './DialoglHeader';
2
- export * from './DialogContent';
2
+ export * from './DialogBody';
3
3
  export * from './DialogFooter';
4
4
  export * from './DialogCloseButton';
@@ -1,4 +1,3 @@
1
1
  export * from './types';
2
2
  export * from './Dialog';
3
3
  export * from './components';
4
- export * from './DialogContext';
@@ -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,2 @@
1
+ export * from './Divider';
2
+ export * from './types';
@@ -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
+ };
@@ -0,0 +1,6 @@
1
+ const dividerPropDisplay = ["block", "inline", "inlineBlock"];
2
+ const dividerPropOrientation = ["horizontal", "vertical"];
3
+ export {
4
+ dividerPropDisplay,
5
+ dividerPropOrientation
6
+ };
@@ -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("node_modules/@koobiq/react-primitives/dist/utils").RenderProps<import("@koobiq/react-primitives").TextFieldRenderProps>> & import("node_modules/@koobiq/react-primitives/dist/utils").RenderProps<import("@koobiq/react-primitives").TextFieldRenderProps> & {
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("node_modules/@koobiq/react-primitives/dist/utils").RenderProps<import("@koobiq/react-primitives").NumberFieldRenderProps>> & import("node_modules/@koobiq/react-primitives/dist/utils").RenderProps<import("@koobiq/react-primitives").NumberFieldRenderProps> & {
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 { DialogHeader, DialogFooter, DialogContent } from '../Dialog';
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 DialogHeader;
6
- Body: typeof DialogContent;
7
- Footer: typeof DialogFooter;
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 = DialogHeader;
125
- Modal.Body = DialogContent;
126
- Modal.Footer = DialogFooter;
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").DialogContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
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 { DialogHeader } from "../Dialog/components/DialoglHeader.js";
2
- import { DialogContent } from "../Dialog/components/DialogContent.js";
3
- import { DialogFooter } from "../Dialog/components/DialogFooter.js";
4
- const ModalHeader = DialogHeader;
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 { DialogContent, DialogFooter, DialogHeader } from '../Dialog';
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 DialogHeader;
8
- Body: typeof DialogContent;
9
- Footer: typeof DialogFooter;
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 = DialogHeader;
160
- Popover.Body = DialogContent;
161
- Popover.Footer = DialogFooter;
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").DialogContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
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 { DialogHeader } from "../Dialog/components/DialoglHeader.js";
2
- import { DialogContent } from "../Dialog/components/DialogContent.js";
3
- import { DialogFooter } from "../Dialog/components/DialogFooter.js";
4
- const PopoverHeader = DialogHeader;
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 { DialogContent, DialogFooter, DialogHeader } from '../Dialog';
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 DialogHeader;
6
- Body: typeof DialogContent;
7
- Footer: typeof DialogFooter;
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 = DialogHeader;
129
- SidePanel.Body = DialogContent;
130
- SidePanel.Footer = DialogFooter;
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").DialogContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
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 { DialogHeader } from "../Dialog/components/DialoglHeader.js";
2
- import { DialogContent } from "../Dialog/components/DialogContent.js";
3
- import { DialogFooter } from "../Dialog/components/DialogFooter.js";
4
- const SidePanelHeader = DialogHeader;
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?: TypographyDisplayVariant;
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. */
@@ -25,4 +25,5 @@ export * from './Tooltip';
25
25
  export * from './List';
26
26
  export * from './AnimatedIcon';
27
27
  export * from './Select';
28
+ export * from './Divider';
28
29
  export * from './layout';
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
@@ -1435,6 +1435,7 @@
1435
1435
  color: var(--checkbox-color);
1436
1436
  align-items: flex-start;
1437
1437
  display: inline-flex;
1438
+ position: relative;
1438
1439
  }
1439
1440
 
1440
1441
  .kbq-checkbox-checkbox-dbb3d9 {
@@ -2188,6 +2189,7 @@
2188
2189
  color: var(--radio-color);
2189
2190
  align-items: flex-start;
2190
2191
  display: inline-flex;
2192
+ position: relative;
2191
2193
  }
2192
2194
 
2193
2195
  .kbq-radio-circle-a0903b {
@@ -2332,6 +2334,7 @@
2332
2334
  gap: var(--kbq-size-s);
2333
2335
  align-items: flex-start;
2334
2336
  display: inline-flex;
2337
+ position: relative;
2335
2338
  }
2336
2339
 
2337
2340
  .kbq-toggle-track-03a806 {
@@ -3121,6 +3124,47 @@
3121
3124
  .kbq-fieldselect-hasPlaceholder-7b7518 {
3122
3125
  --field-input-color: var(--field-input-placeholder-color);
3123
3126
  }
3127
+ .kbq-divider-16da20 {
3128
+ border-style: solid;
3129
+ border-color: var(--kbq-line-contrast-less);
3130
+ flex-shrink: 0;
3131
+ margin: 0;
3132
+ }
3133
+
3134
+ .kbq-divider-block-72e3e3 {
3135
+ display: block;
3136
+ }
3137
+
3138
+ .kbq-divider-inlineBlock-0f06d1 {
3139
+ display: inline-block;
3140
+ }
3141
+
3142
+ .kbq-divider-inline-2d4752 {
3143
+ display: inline;
3144
+ }
3145
+
3146
+ .kbq-divider-vertical-a4e613 {
3147
+ --divider-paddings: 0 var(--kbq-size-xxs);
3148
+ border-width: 0 1px 0 0;
3149
+ block-size: 100%;
3150
+ inline-size: 0;
3151
+ }
3152
+
3153
+ .kbq-divider-horizontal-22c78d {
3154
+ --divider-paddings: var(--kbq-size-xxs) 0;
3155
+ border-width: 0 0 1px;
3156
+ block-size: 0;
3157
+ inline-size: 100%;
3158
+ }
3159
+
3160
+ .kbq-divider-hasPaddings-d8f601 {
3161
+ margin: var(--divider-paddings);
3162
+ }
3163
+
3164
+ .kbq-divider-flexItem-af9975 {
3165
+ align-self: stretch;
3166
+ block-size: auto;
3167
+ }
3124
3168
  .kbq-spacing-mbs_0-be7021 {
3125
3169
  margin-block-start: 0;
3126
3170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koobiq/react-components",
3
- "version": "0.0.1-beta.13",
3
+ "version": "0.0.1-beta.15",
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/logger": "0.0.1-beta.13",
31
- "@koobiq/react-core": "0.0.1-beta.13",
32
- "@koobiq/react-icons": "0.0.1-beta.13",
33
- "@koobiq/react-primitives": "0.0.1-beta.13"
30
+ "@koobiq/logger": "0.0.1-beta.15",
31
+ "@koobiq/react-core": "0.0.1-beta.15",
32
+ "@koobiq/react-icons": "0.0.1-beta.15",
33
+ "@koobiq/react-primitives": "0.0.1-beta.15"
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
- "use client";
2
- import { createContext, useContext } from "react";
3
- const DialogContext = createContext(
4
- {}
5
- );
6
- function useDialogProvider() {
7
- return useContext(DialogContext);
8
- }
9
- export {
10
- DialogContext,
11
- useDialogProvider
12
- };
@@ -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>>;