@koobiq/react-components 0.0.1-beta.4 → 0.0.1-beta.6

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 (32) hide show
  1. package/dist/components/Container/Container.js +1 -0
  2. package/dist/components/Container/utils.d.ts +1 -1
  3. package/dist/components/FlexBox/FlexBox.d.ts +4 -0
  4. package/dist/components/FlexBox/FlexBox.js +47 -0
  5. package/dist/components/FlexBox/index.d.ts +2 -0
  6. package/dist/components/FlexBox/types.d.ts +27 -0
  7. package/dist/components/List/List.js +14 -12
  8. package/dist/components/List/types.d.ts +10 -1
  9. package/dist/components/Popover/Popover.js +10 -2
  10. package/dist/components/Popover/types.d.ts +8 -1
  11. package/dist/components/Provider/BreakpointsProvider.d.ts +2 -1
  12. package/dist/components/Provider/BreakpointsProvider.js +8 -1
  13. package/dist/components/Provider/Provider.d.ts +1 -1
  14. package/dist/components/Provider/Provider.js +9 -1
  15. package/dist/components/Provider/types.d.ts +5 -0
  16. package/dist/components/Provider/utils/useBreakpoints.d.ts +2 -1
  17. package/dist/components/Provider/utils/useBreakpoints.js +2 -2
  18. package/dist/components/RadioGroup/RadioContext.js +1 -0
  19. package/dist/components/RadioGroup/RadioGroup.js +2 -1
  20. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  21. package/dist/components/Tooltip/types.d.ts +1 -1
  22. package/dist/components/Typography/Typography.js +2 -2
  23. package/dist/components/Typography/Typography.module.css.js +2 -1
  24. package/dist/components/Typography/types.d.ts +1 -1
  25. package/dist/components/Typography/types.js +2 -1
  26. package/dist/components/index.d.ts +1 -0
  27. package/dist/components/layout/flex/flex.d.ts +15 -4
  28. package/dist/components/layout/flex/flex.js +6 -1
  29. package/dist/components/layout/flex/flex.module.css.js +78 -39
  30. package/dist/index.js +2 -0
  31. package/dist/style.css +215 -159
  32. package/package.json +5 -5
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
3
4
  import s from "./Container.module.css.js";
@@ -1,4 +1,4 @@
1
1
  import type { ContainerMarginsProp, ContainerMaxInlineSizeProp, ContainerPositionProp } from './types';
2
2
  export declare const normalizeMargins: (value: ContainerMarginsProp | undefined) => string | 0 | undefined;
3
3
  export declare const normalizeMaxInlineSize: (value: ContainerMaxInlineSizeProp | undefined) => string | undefined;
4
- export declare const normalizePosition: (value: ContainerPositionProp | undefined) => "0 auto" | "auto 0" | "auto";
4
+ export declare const normalizePosition: (value: ContainerPositionProp | undefined) => "auto" | "0 auto" | "auto 0";
@@ -0,0 +1,4 @@
1
+ import type { ComponentPropsWithRef, ElementType } from 'react';
2
+ import type { FlexBoxBaseProps } from './index';
3
+ export declare const FlexBox: import("@koobiq/react-core").PolyForwardComponent<"div", FlexBoxBaseProps, ElementType>;
4
+ export type FlexBoxProps<As extends ElementType = 'div'> = ComponentPropsWithRef<typeof FlexBox<As>>;
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
4
+ import { useMatchedBreakpoints } from "../Provider/BreakpointsContext.js";
5
+ import { getResponsiveValue } from "../../utils/getResponsiveValue/getResponsiveValue.js";
6
+ import { flex } from "../layout/flex/flex.js";
7
+ const FlexBox = polymorphicForwardRef(
8
+ ({
9
+ as: Tag = "div",
10
+ gap: gapProp,
11
+ wrap: wrapProp,
12
+ flex: flexProp,
13
+ colGap: colGapProp,
14
+ rowGap: rowGapProp,
15
+ direction: directionProp,
16
+ alignItems: alignItemsProp,
17
+ justifyContent: justifyContentProp,
18
+ children,
19
+ className,
20
+ ...other
21
+ }, ref) => {
22
+ const breakpoints = useMatchedBreakpoints();
23
+ const flex$1 = getResponsiveValue(flexProp, breakpoints);
24
+ const gap = getResponsiveValue(gapProp, breakpoints);
25
+ const colGap = getResponsiveValue(colGapProp, breakpoints);
26
+ const rowGap = getResponsiveValue(rowGapProp, breakpoints);
27
+ const wrap = getResponsiveValue(wrapProp, breakpoints);
28
+ const alignItems = getResponsiveValue(alignItemsProp, breakpoints);
29
+ const direction = getResponsiveValue(directionProp, breakpoints);
30
+ const justifyContent = getResponsiveValue(justifyContentProp, breakpoints);
31
+ const flexCn = flex({
32
+ gap,
33
+ flex: flex$1,
34
+ wrap,
35
+ colGap,
36
+ rowGap,
37
+ direction,
38
+ alignItems,
39
+ justifyContent
40
+ });
41
+ return /* @__PURE__ */ jsx(Tag, { className: clsx(flexCn, className), ...other, ref, children });
42
+ }
43
+ );
44
+ FlexBox.displayName = "FlexBox";
45
+ export {
46
+ FlexBox
47
+ };
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './FlexBox';
@@ -0,0 +1,27 @@
1
+ import type { CSSProperties, ReactNode } from 'react';
2
+ import type { ResponsiveValue } from '../../utils';
3
+ import type { FlexPropGap, FlexPropWrap, FlexPropFlex, FlexPropDirection, FlexPropAlignItems, FlexPropJustifyContent } from '../layout';
4
+ export type FlexBoxBaseProps = {
5
+ /** Defines the `display` property with `flex` or `inline-flex` value. */
6
+ flex?: FlexPropFlex | ResponsiveValue<FlexPropFlex>;
7
+ /** Defines the `flex-wrap` property. */
8
+ wrap?: FlexPropWrap | ResponsiveValue<FlexPropWrap>;
9
+ /** Defines the `flex-direction` property. */
10
+ direction?: FlexPropDirection | ResponsiveValue<FlexPropDirection>;
11
+ /** Defines the `gap` property. */
12
+ gap?: FlexPropGap | ResponsiveValue<FlexPropGap>;
13
+ /** Defines the `column-gap` property. */
14
+ colGap?: FlexPropGap | ResponsiveValue<FlexPropGap>;
15
+ /** Defines the `row-gap` property. */
16
+ rowGap?: FlexPropGap | ResponsiveValue<FlexPropGap>;
17
+ /** Defines the `justify-content` property. */
18
+ justifyContent?: FlexPropJustifyContent | ResponsiveValue<FlexPropJustifyContent>;
19
+ /** Defines the `align-items` property. */
20
+ alignItems?: FlexPropAlignItems | ResponsiveValue<FlexPropAlignItems>;
21
+ /** Additional CSS-classes. */
22
+ className?: string;
23
+ /** The content of the component. */
24
+ children?: ReactNode;
25
+ /** Inline styles. */
26
+ style?: CSSProperties;
27
+ };
@@ -8,27 +8,29 @@ import { ListSection } from "./components/ListSection/ListSection.js";
8
8
  import { Typography } from "../Typography/Typography.js";
9
9
  import { ListOption } from "./components/ListOption/ListOption.js";
10
10
  function ListRender(props, ref) {
11
- const { className, label } = props;
11
+ const { label, className, style, slotProps } = props;
12
12
  const domRef = useDOMRef(ref);
13
13
  const state = useListState(props);
14
14
  const { listBoxProps, labelProps } = useListBox(props, state, domRef);
15
+ const titleProps = mergeProps(
16
+ {
17
+ className: s.label,
18
+ variant: "text-normal-strong"
19
+ },
20
+ slotProps?.label,
21
+ labelProps
22
+ );
15
23
  const listProps = mergeProps(
16
24
  {
17
- className: clsx(s.base, className),
18
- ref: domRef
25
+ style,
26
+ ref: domRef,
27
+ className: clsx(s.base, className)
19
28
  },
29
+ slotProps?.list,
20
30
  listBoxProps
21
31
  );
22
32
  return /* @__PURE__ */ jsxs(Fragment, { children: [
23
- isNotNil(label) && /* @__PURE__ */ jsx(
24
- Typography,
25
- {
26
- variant: "text-normal-strong",
27
- className: s.label,
28
- ...labelProps,
29
- children: label
30
- }
31
- ),
33
+ isNotNil(label) && /* @__PURE__ */ jsx(Typography, { ...titleProps, children: label }),
32
34
  /* @__PURE__ */ jsx("ul", { ...listProps, children: [...state.collection].map(
33
35
  (item) => item.type === "section" ? /* @__PURE__ */ jsx(ListSection, { section: item, state }, item.key) : /* @__PURE__ */ jsx(ListOption, { item, state }, item.key)
34
36
  ) })
@@ -1,5 +1,6 @@
1
- import type { ComponentRef, ReactElement, ReactNode, Ref } from 'react';
1
+ import type { ComponentPropsWithRef, ComponentRef, CSSProperties, ReactElement, ReactNode, Ref } from 'react';
2
2
  import type { AriaListBoxProps } from '@koobiq/react-primitives';
3
+ import type { TypographyProps } from '../Typography';
3
4
  export declare const listPropSelectionMode: readonly ["none", "single", "multiple"];
4
5
  export type ListPropSelectionMode = (typeof listPropSelectionMode)[number];
5
6
  export type ListPropItems<T extends object> = AriaListBoxProps<T>['items'];
@@ -14,8 +15,11 @@ export type ListBaseProps<T extends object> = {
14
15
  label?: ReactNode;
15
16
  /** Additional CSS-classes. */
16
17
  className?: string;
18
+ /** Inline styles. */
19
+ style?: CSSProperties;
17
20
  /** The type of selection that is allowed in the collection. */
18
21
  selectionMode?: ListPropSelectionMode;
22
+ /** Ref to the HTML ul-element. */
19
23
  ref?: Ref<HTMLElement>;
20
24
  /** The contents of the collection. */
21
25
  children?: ListPropChildren<T>;
@@ -36,6 +40,11 @@ export type ListBaseProps<T extends object> = {
36
40
  onAction?: ListPropOnAction<T>;
37
41
  /** How multiple selection should behave in the collection. */
38
42
  selectionBehavior?: ListPropSelectionBehavior<T>;
43
+ /** The props used for each slot inside. */
44
+ slotProps?: {
45
+ label?: TypographyProps;
46
+ list?: ComponentPropsWithRef<'div'>;
47
+ };
39
48
  };
40
49
  export type ListProps<T extends object> = ListBaseProps<T>;
41
50
  export type ListRef = ComponentRef<'ul'>;
@@ -12,6 +12,7 @@ const Popover = forwardRef(
12
12
  const {
13
13
  placement: placementProp = "top",
14
14
  arrowBoundaryOffset = 20,
15
+ containerPadding = 12,
15
16
  hideArrow = false,
16
17
  size = "medium",
17
18
  crossOffset = 0,
@@ -58,9 +59,9 @@ const Popover = forwardRef(
58
59
  isNonModal,
59
60
  crossOffset,
60
61
  maxHeight: 480,
62
+ containerPadding,
61
63
  popoverRef: domRef,
62
64
  arrowBoundaryOffset,
63
- containerPadding: 24,
64
65
  placement: placementProp,
65
66
  isKeyboardDismissDisabled: disableExitOnEscapeKeyDown,
66
67
  triggerRef: anchorRef || controlRef
@@ -88,6 +89,13 @@ const Popover = forwardRef(
88
89
  },
89
90
  slotProps?.dialog
90
91
  );
92
+ const backdropProps = mergeProps(
93
+ {
94
+ className: s.underlay
95
+ },
96
+ slotProps?.backdrop,
97
+ underlayProps
98
+ );
91
99
  return /* @__PURE__ */ jsxs(Fragment, { children: [
92
100
  control?.({
93
101
  onClick: onPress,
@@ -111,7 +119,7 @@ const Popover = forwardRef(
111
119
  portalContainer,
112
120
  disableFocusManagement,
113
121
  children: [
114
- /* @__PURE__ */ jsx("div", { ...underlayProps, className: s.underlay }),
122
+ /* @__PURE__ */ jsx("div", { ...backdropProps }),
115
123
  /* @__PURE__ */ jsxs(
116
124
  "div",
117
125
  {
@@ -57,7 +57,7 @@ export type PopoverProps = {
57
57
  * */
58
58
  placement?: PopoverPropPlacement;
59
59
  /** The ref for the element which the popover positions itself with respect to. */
60
- anchorRef?: RefObject<HTMLElement>;
60
+ anchorRef?: RefObject<HTMLElement | null>;
61
61
  /**
62
62
  * If `true`, the arrow isn't shown.
63
63
  * @default false
@@ -77,6 +77,12 @@ export type PopoverProps = {
77
77
  * @default 0
78
78
  */
79
79
  arrowBoundaryOffset?: number;
80
+ /**
81
+ * The placement padding that should be applied between the element and its
82
+ * surrounding container.
83
+ * @default 12
84
+ */
85
+ containerPadding?: number;
80
86
  /**
81
87
  * The additional offset applied along the main axis between the element and its
82
88
  * anchor element.
@@ -93,5 +99,6 @@ export type PopoverProps = {
93
99
  slotProps?: {
94
100
  dialog?: DialogProps;
95
101
  arrow?: ComponentPropsWithRef<'div'>;
102
+ backdrop?: ComponentPropsWithRef<'div'>;
96
103
  };
97
104
  };
@@ -3,8 +3,9 @@ import type { Breakpoints } from './types';
3
3
  export type BreakpointsProviderProps = {
4
4
  children: ReactNode;
5
5
  breakpoints: Breakpoints;
6
+ defaultMatches?: boolean[];
6
7
  };
7
8
  export declare const BreakpointsProvider: {
8
- ({ children, breakpoints: _breakpoints, }: BreakpointsProviderProps): import("react/jsx-runtime").JSX.Element;
9
+ ({ children, defaultMatches, breakpoints: _breakpoints, }: BreakpointsProviderProps): import("react/jsx-runtime").JSX.Element;
9
10
  displayName: string;
10
11
  };
@@ -4,9 +4,16 @@ import { BreakpointsContext } from "./BreakpointsContext.js";
4
4
  import { useBreakpoints } from "./utils/useBreakpoints.js";
5
5
  const BreakpointsProvider = ({
6
6
  children,
7
+ defaultMatches,
7
8
  breakpoints: _breakpoints
8
9
  }) => {
9
- const breakpoints = useBreakpoints(_breakpoints);
10
+ const breakpoints = useBreakpoints(
11
+ _breakpoints,
12
+ defaultMatches && {
13
+ ssr: true,
14
+ defaultMatches
15
+ }
16
+ );
10
17
  return /* @__PURE__ */ jsx(BreakpointsContext.Provider, { value: breakpoints, children });
11
18
  };
12
19
  BreakpointsProvider.displayName = "BreakpointsProvider";
@@ -1,6 +1,6 @@
1
1
  import type { Breakpoints, ProviderProps } from './types';
2
2
  export declare const defaultBreakpoints: Breakpoints;
3
3
  export declare const Provider: {
4
- ({ breakpoints, children, locale, }: ProviderProps): import("react/jsx-runtime").JSX.Element;
4
+ ({ breakpoints, breakpointsFallback, children, locale, }: ProviderProps): import("react/jsx-runtime").JSX.Element;
5
5
  displayName: string;
6
6
  };
@@ -19,9 +19,17 @@ const defaultBreakpoints = {
19
19
  };
20
20
  const Provider = ({
21
21
  breakpoints = defaultBreakpoints,
22
+ breakpointsFallback,
22
23
  children,
23
24
  locale
24
- }) => /* @__PURE__ */ jsx(ProviderContext.Provider, { value: { breakpoints, locale }, children: /* @__PURE__ */ jsx(I18nProvider, { locale, children: /* @__PURE__ */ jsx(BreakpointsProvider, { breakpoints, children }) }) });
25
+ }) => /* @__PURE__ */ jsx(ProviderContext.Provider, { value: { breakpoints, locale }, children: /* @__PURE__ */ jsx(I18nProvider, { locale, children: /* @__PURE__ */ jsx(
26
+ BreakpointsProvider,
27
+ {
28
+ breakpoints,
29
+ defaultMatches: breakpointsFallback,
30
+ children
31
+ }
32
+ ) }) });
25
33
  Provider.displayName = "Provider";
26
34
  export {
27
35
  Provider,
@@ -10,7 +10,12 @@ export type Breakpoints = {
10
10
  [custom: string]: number | undefined;
11
11
  };
12
12
  export type ProviderProps = {
13
+ /** The content of the component. */
13
14
  children?: ReactNode;
15
+ /** Responsive breakpoints for your application. */
14
16
  breakpoints?: Breakpoints;
17
+ /** SSR-fallback for responsive breakpoints for your application. */
18
+ breakpointsFallback?: boolean[];
19
+ /** The locale for your application as a [BCP 47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code. Defaults to the browser/OS language setting. */
15
20
  locale?: I18nProviderProps['locale'];
16
21
  };
@@ -1,2 +1,3 @@
1
+ import type { UseMediaQueryOptions } from '@koobiq/react-core';
1
2
  import type { Breakpoints } from '../types';
2
- export declare function useBreakpoints(breakpoints: Breakpoints): {};
3
+ export declare function useBreakpoints(breakpoints: Breakpoints, options?: UseMediaQueryOptions): {};
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { useMediaQuery } from "@koobiq/react-core";
3
- function useBreakpoints(breakpoints) {
3
+ function useBreakpoints(breakpoints, options) {
4
4
  const queries = Object.values(breakpoints).map(
5
5
  (width) => `(min-width: ${width}px)`
6
6
  );
7
- const matches = useMediaQuery(queries);
7
+ const matches = useMediaQuery(queries, options);
8
8
  return Object.keys(breakpoints).reduce(
9
9
  (acc, item, index) => ({ ...acc, [item]: matches[index] }),
10
10
  {}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { createContext, useContext } from "react";
2
3
  const RadioGroupContext = createContext(
3
4
  {}
@@ -1,11 +1,12 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { mergeProps, clsx } from "@koobiq/react-core";
4
5
  import { RadioGroup as RadioGroup$1 } from "@koobiq/react-primitives";
5
- import { flex } from "../layout/flex/flex.js";
6
6
  import { RadioGroupLabel } from "./components/RadioGroupLabel/RadioGroupLabel.js";
7
7
  import { RadioGroupContext } from "./RadioContext.js";
8
8
  import { RadioGroupDescription } from "./components/RadioGroupDescription/RadioGroupDescription.js";
9
+ import { flex } from "../layout/flex/flex.js";
9
10
  const RadioGroup = forwardRef(
10
11
  (props, ref) => {
11
12
  const { size, label, children, slotProps, description, orientation } = props;
@@ -7,7 +7,7 @@ export declare const Tooltip: import("react").ForwardRefExoticComponent<{
7
7
  children?: import("react").ReactNode;
8
8
  control?: import("./types").TooltipPropControl;
9
9
  placement?: import("./types").TooltipPropPlacement;
10
- anchorRef?: import("react").RefObject<HTMLElement>;
10
+ anchorRef?: import("react").RefObject<HTMLElement | null>;
11
11
  arrowBoundaryOffset?: number;
12
12
  offset?: number;
13
13
  crossOffset?: number;
@@ -34,7 +34,7 @@ export type TooltipProps = {
34
34
  * */
35
35
  placement?: TooltipPropPlacement;
36
36
  /** The ref for the element which the popover positions itself with respect to. */
37
- anchorRef?: RefObject<HTMLElement>;
37
+ anchorRef?: RefObject<HTMLElement | null>;
38
38
  /**
39
39
  * The minimum distance the arrow's edge should be from the edge of the overlay element.
40
40
  * @default 0
@@ -27,11 +27,11 @@ const Typography = polymorphicForwardRef(
27
27
  "data-ellipsis": ellipsis,
28
28
  className: clsx(
29
29
  s.base,
30
+ textVariant[variant],
30
31
  display && s[display],
31
32
  ellipsis && s.ellipsis,
32
33
  align && s[`align-${align}`],
33
- textVariant[variant],
34
- foregroundColor[color],
34
+ color === "inherit" ? s["color-inherit"] : foregroundColor[color],
35
35
  className
36
36
  ),
37
37
  ...other,
@@ -12,7 +12,8 @@ const s = {
12
12
  "align-center": "kbq-typography-align-center-2d47fd",
13
13
  "align-initial": "kbq-typography-align-initial-faf6dd",
14
14
  "align-inherit": "kbq-typography-align-inherit-00f946",
15
- ellipsis
15
+ ellipsis,
16
+ "color-inherit": "kbq-typography-color-inherit-35de13"
16
17
  };
17
18
  export {
18
19
  base,
@@ -5,7 +5,7 @@ export declare const typographyPropDisplay: readonly ["block", "inline", "inline
5
5
  export type TypographyDisplayVariant = (typeof typographyPropDisplay)[number];
6
6
  export declare const typographyPropAlign: readonly ["start", "center", "end", "initial", "inherit"];
7
7
  export type TypographyPropAlign = (typeof typographyPropAlign)[number];
8
- 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"];
8
+ 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"];
9
9
  export type TypographyPropColor = (typeof typographyPropColor)[number];
10
10
  export type TypographyBaseProps = {
11
11
  /**
@@ -74,7 +74,8 @@ const typographyPropColor = [
74
74
  "success-secondary",
75
75
  "warning",
76
76
  "warning-secondary",
77
- "visited"
77
+ "visited",
78
+ "inherit"
78
79
  ];
79
80
  export {
80
81
  typographyPropAlign,
@@ -1,4 +1,5 @@
1
1
  export * from './Provider';
2
+ export * from './FlexBox';
2
3
  export * from './Container';
3
4
  export * from './Alert';
4
5
  export * from './Button';
@@ -13,13 +13,24 @@ export type FlexPropDirection = (typeof flexPropDirection)[number];
13
13
  export declare const flexPropOrder: readonly [-1, 0, 1];
14
14
  export type FlexPropOrder = (typeof flexPropOrder)[number];
15
15
  export type FlexProps = {
16
- alignItems?: FlexPropAlignItems;
17
- justifyContent?: FlexPropJustifyContent;
16
+ /** Defines the `gap` property. */
17
+ gap?: FlexPropGap;
18
+ /** Defines the `column-gap` property. */
19
+ colGap?: FlexPropGap;
20
+ /** Defines the `row-gap` property. */
21
+ rowGap?: FlexPropGap;
22
+ /** Defines the `display` property with `flex` or `inline-flex` value. */
18
23
  flex?: FlexPropFlex;
24
+ /** Defines the `flex-wrap` property. */
19
25
  wrap?: FlexPropWrap;
20
- direction?: FlexPropDirection;
21
- gap?: FlexPropGap;
26
+ /** Defines the `order` property. */
22
27
  order?: FlexPropOrder;
28
+ /** Defines the `flex-direction` property. */
29
+ direction?: FlexPropDirection;
30
+ /** Defines the `align-items` property. */
31
+ alignItems?: FlexPropAlignItems;
32
+ /** Defines the `justify-content` property. */
33
+ justifyContent?: FlexPropJustifyContent;
23
34
  };
24
35
  export type FlexParams = (props: FlexProps, className?: string) => string;
25
36
  export declare const flex: FlexParams;
@@ -47,15 +47,20 @@ const flex = (props, className) => {
47
47
  wrap,
48
48
  direction,
49
49
  gap,
50
+ rowGap: rowGapProp,
51
+ colGap: colGapProp,
50
52
  order: orderProp
51
53
  } = props;
52
54
  const order = String(orderProp);
55
+ const colGap = colGapProp ?? gap;
56
+ const rowGap = rowGapProp ?? gap;
53
57
  return clsx(
54
58
  s.base,
55
- gap && s[`gap_${gap}`],
56
59
  flex2 && s[`flex_${flex2}`],
57
60
  wrap && s[`wrap_${wrap}`],
58
61
  order && s[`order_${order}`],
62
+ rowGap && s[`gap_row_${rowGap}`],
63
+ colGap && s[`gap_column_${colGap}`],
59
64
  direction && s[`direction_${direction}`],
60
65
  alignItems && s[`alignItems_${alignItems}`],
61
66
  justifyContent && s[`justifyContent_${justifyContent}`],
@@ -10,19 +10,32 @@ const direction_row = "kbq-flex-direction_row-8fff0d";
10
10
  const direction_column = "kbq-flex-direction_column-29b97b";
11
11
  const order_0 = "kbq-flex-order_0-4a6164";
12
12
  const order_1 = "kbq-flex-order_1-b5e24c";
13
- const gap_3xs = "kbq-flex-gap_3xs-5c9d4e";
14
- const gap_xxs = "kbq-flex-gap_xxs-035614";
15
- const gap_xs = "kbq-flex-gap_xs-970b31";
16
- const gap_s = "kbq-flex-gap_s-e9d292";
17
- const gap_m = "kbq-flex-gap_m-21a099";
18
- const gap_l = "kbq-flex-gap_l-47c05c";
19
- const gap_xl = "kbq-flex-gap_xl-d76274";
20
- const gap_xxl = "kbq-flex-gap_xxl-0e68cb";
21
- const gap_3xl = "kbq-flex-gap_3xl-497012";
22
- const gap_4xl = "kbq-flex-gap_4xl-0b7c71";
23
- const gap_5xl = "kbq-flex-gap_5xl-ed56fe";
24
- const gap_6xl = "kbq-flex-gap_6xl-0749d1";
25
- const gap_7xl = "kbq-flex-gap_7xl-0a1536";
13
+ const gap_column_3xs = "kbq-flex-gap_column_3xs-2aea22";
14
+ const gap_column_xxs = "kbq-flex-gap_column_xxs-7586e8";
15
+ const gap_column_xs = "kbq-flex-gap_column_xs-911f68";
16
+ const gap_column_s = "kbq-flex-gap_column_s-a389c1";
17
+ const gap_column_m = "kbq-flex-gap_column_m-21736b";
18
+ const gap_column_l = "kbq-flex-gap_column_l-390cf2";
19
+ const gap_column_xl = "kbq-flex-gap_column_xl-47b33c";
20
+ const gap_column_xxl = "kbq-flex-gap_column_xxl-2f762a";
21
+ const gap_column_3xl = "kbq-flex-gap_column_3xl-e81ba4";
22
+ const gap_column_4xl = "kbq-flex-gap_column_4xl-502e67";
23
+ const gap_column_5xl = "kbq-flex-gap_column_5xl-028451";
24
+ const gap_column_6xl = "kbq-flex-gap_column_6xl-2f1bfa";
25
+ const gap_column_7xl = "kbq-flex-gap_column_7xl-057b8a";
26
+ const gap_row_3xs = "kbq-flex-gap_row_3xs-ea5984";
27
+ const gap_row_xxs = "kbq-flex-gap_row_xxs-a520f4";
28
+ const gap_row_xs = "kbq-flex-gap_row_xs-e62321";
29
+ const gap_row_s = "kbq-flex-gap_row_s-2dab73";
30
+ const gap_row_m = "kbq-flex-gap_row_m-6423db";
31
+ const gap_row_l = "kbq-flex-gap_row_l-f312fe";
32
+ const gap_row_xl = "kbq-flex-gap_row_xl-e85171";
33
+ const gap_row_xxl = "kbq-flex-gap_row_xxl-c2548b";
34
+ const gap_row_3xl = "kbq-flex-gap_row_3xl-34ef28";
35
+ const gap_row_4xl = "kbq-flex-gap_row_4xl-29ec96";
36
+ const gap_row_5xl = "kbq-flex-gap_row_5xl-c7e969";
37
+ const gap_row_6xl = "kbq-flex-gap_row_6xl-afc87a";
38
+ const gap_row_7xl = "kbq-flex-gap_row_7xl-d67bcc";
26
39
  const s = {
27
40
  base,
28
41
  "alignItems_flex-start": "kbq-flex-alignItems_flex-start-56df74",
@@ -48,19 +61,32 @@ const s = {
48
61
  "order_-1": "kbq-flex-order_-1-4f5108",
49
62
  order_0,
50
63
  order_1,
51
- gap_3xs,
52
- gap_xxs,
53
- gap_xs,
54
- gap_s,
55
- gap_m,
56
- gap_l,
57
- gap_xl,
58
- gap_xxl,
59
- gap_3xl,
60
- gap_4xl,
61
- gap_5xl,
62
- gap_6xl,
63
- gap_7xl
64
+ gap_column_3xs,
65
+ gap_column_xxs,
66
+ gap_column_xs,
67
+ gap_column_s,
68
+ gap_column_m,
69
+ gap_column_l,
70
+ gap_column_xl,
71
+ gap_column_xxl,
72
+ gap_column_3xl,
73
+ gap_column_4xl,
74
+ gap_column_5xl,
75
+ gap_column_6xl,
76
+ gap_column_7xl,
77
+ gap_row_3xs,
78
+ gap_row_xxs,
79
+ gap_row_xs,
80
+ gap_row_s,
81
+ gap_row_m,
82
+ gap_row_l,
83
+ gap_row_xl,
84
+ gap_row_xxl,
85
+ gap_row_3xl,
86
+ gap_row_4xl,
87
+ gap_row_5xl,
88
+ gap_row_6xl,
89
+ gap_row_7xl
64
90
  };
65
91
  export {
66
92
  alignItems_baseline,
@@ -71,19 +97,32 @@ export {
71
97
  direction_column,
72
98
  direction_row,
73
99
  flex_flex,
74
- gap_3xl,
75
- gap_3xs,
76
- gap_4xl,
77
- gap_5xl,
78
- gap_6xl,
79
- gap_7xl,
80
- gap_l,
81
- gap_m,
82
- gap_s,
83
- gap_xl,
84
- gap_xs,
85
- gap_xxl,
86
- gap_xxs,
100
+ gap_column_3xl,
101
+ gap_column_3xs,
102
+ gap_column_4xl,
103
+ gap_column_5xl,
104
+ gap_column_6xl,
105
+ gap_column_7xl,
106
+ gap_column_l,
107
+ gap_column_m,
108
+ gap_column_s,
109
+ gap_column_xl,
110
+ gap_column_xs,
111
+ gap_column_xxl,
112
+ gap_column_xxs,
113
+ gap_row_3xl,
114
+ gap_row_3xs,
115
+ gap_row_4xl,
116
+ gap_row_5xl,
117
+ gap_row_6xl,
118
+ gap_row_7xl,
119
+ gap_row_l,
120
+ gap_row_m,
121
+ gap_row_s,
122
+ gap_row_xl,
123
+ gap_row_xs,
124
+ gap_row_xxl,
125
+ gap_row_xxs,
87
126
  justifyContent_center,
88
127
  order_0,
89
128
  order_1,
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import { Provider, defaultBreakpoints } from "./components/Provider/Provider.js"
3
3
  import { BreakpointsProvider } from "./components/Provider/BreakpointsProvider.js";
4
4
  import { ProviderContext, useProvider } from "./components/Provider/ProviderContext.js";
5
5
  import { BreakpointsContext, useBreakpoints, useMatchedBreakpoints } from "./components/Provider/BreakpointsContext.js";
6
+ import { FlexBox } from "./components/FlexBox/FlexBox.js";
6
7
  import { Container } from "./components/Container/Container.js";
7
8
  import { containerMarginsProp, containerPositionProp } from "./components/Container/types.js";
8
9
  import { Alert } from "./components/Alert/Alert.js";
@@ -70,6 +71,7 @@ export {
70
71
  DialogContent,
71
72
  DialogFooter,
72
73
  DialogHeader,
74
+ FlexBox,
73
75
  Grid,
74
76
  GridItem,
75
77
  IconButton,
package/dist/style.css CHANGED
@@ -51,6 +51,217 @@
51
51
  *::-webkit-scrollbar-corner {
52
52
  background: none;
53
53
  }
54
+ .kbq-flex-7624b3 {
55
+ --flex-gap: 0;
56
+ --flex-order: 0;
57
+ --flex-type: flex;
58
+ --flex-wrap: nowrap;
59
+ --flex-direction: row;
60
+ --flex-align-items: flex-start;
61
+ --flex-justify-content: flex-start;
62
+ gap: var(--flex-row-gap) var(--flex-column-gap);
63
+ order: var(--flex-order);
64
+ display: var(--flex-type);
65
+ align-items: var(--flex-align-items);
66
+ justify-content: var(--flex-justify-content);
67
+ flex-flow: var(--flex-direction) var(--flex-wrap);
68
+ }
69
+
70
+ .kbq-flex-alignItems_flex-start-56df74 {
71
+ --flex-align-items: flex-start;
72
+ }
73
+
74
+ .kbq-flex-alignItems_flex-end-951e7a {
75
+ --flex-align-items: flex-end;
76
+ }
77
+
78
+ .kbq-flex-alignItems_center-05836e {
79
+ --flex-align-items: center;
80
+ }
81
+
82
+ .kbq-flex-alignItems_baseline-1e77c2 {
83
+ --flex-align-items: baseline;
84
+ }
85
+
86
+ .kbq-flex-alignItems_stretch-f031de {
87
+ --flex-align-items: stretch;
88
+ }
89
+
90
+ .kbq-flex-justifyContent_flex-start-05ff2a {
91
+ --flex-justify-content: flex-start;
92
+ }
93
+
94
+ .kbq-flex-justifyContent_flex-end-06a105 {
95
+ --flex-justify-content: flex-end;
96
+ }
97
+
98
+ .kbq-flex-justifyContent_center-5134e2 {
99
+ --flex-justify-content: center;
100
+ }
101
+
102
+ .kbq-flex-justifyContent_space-between-02a3e5 {
103
+ --flex-justify-content: space-between;
104
+ }
105
+
106
+ .kbq-flex-justifyContent_space-around-42e955 {
107
+ --flex-justify-content: space-around;
108
+ }
109
+
110
+ .kbq-flex-justifyContent_space-evenly-b84975 {
111
+ --flex-justify-content: space-evenly;
112
+ }
113
+
114
+ .kbq-flex-flex_flex-de4f74 {
115
+ --flex-type: flex;
116
+ }
117
+
118
+ .kbq-flex-flex_inline-flex-a712ef {
119
+ --flex-type: inline-flex;
120
+ }
121
+
122
+ .kbq-flex-wrap_wrap-78b98d {
123
+ --flex-wrap: wrap;
124
+ }
125
+
126
+ .kbq-flex-wrap_nowrap-902a73 {
127
+ --flex-wrap: nowrap;
128
+ }
129
+
130
+ .kbq-flex-wrap_wrap-reverse-dbacf6 {
131
+ --flex-wrap: wrap-reverse;
132
+ }
133
+
134
+ .kbq-flex-direction_row-8fff0d {
135
+ --flex-direction: row;
136
+ }
137
+
138
+ .kbq-flex-direction_row-reverse-7fa95e {
139
+ --flex-direction: row-reverse;
140
+ }
141
+
142
+ .kbq-flex-direction_column-29b97b {
143
+ --flex-direction: column;
144
+ }
145
+
146
+ .kbq-flex-direction_column-reverse-04ecc6 {
147
+ --flex-direction: column-reverse;
148
+ }
149
+
150
+ .kbq-flex-order_-1-4f5108 {
151
+ --flex-order: -1;
152
+ }
153
+
154
+ .kbq-flex-order_0-4a6164 {
155
+ --flex-order: 0;
156
+ }
157
+
158
+ .kbq-flex-order_1-b5e24c {
159
+ --flex-order: 1;
160
+ }
161
+
162
+ .kbq-flex-gap_column_3xs-2aea22 {
163
+ --flex-column-gap: var(--kbq-size-3xs);
164
+ }
165
+
166
+ .kbq-flex-gap_column_xxs-7586e8 {
167
+ --flex-column-gap: var(--kbq-size-xxs);
168
+ }
169
+
170
+ .kbq-flex-gap_column_xs-911f68 {
171
+ --flex-column-gap: var(--kbq-size-xs);
172
+ }
173
+
174
+ .kbq-flex-gap_column_s-a389c1 {
175
+ --flex-column-gap: var(--kbq-size-s);
176
+ }
177
+
178
+ .kbq-flex-gap_column_m-21736b {
179
+ --flex-column-gap: var(--kbq-size-m);
180
+ }
181
+
182
+ .kbq-flex-gap_column_l-390cf2 {
183
+ --flex-column-gap: var(--kbq-size-l);
184
+ }
185
+
186
+ .kbq-flex-gap_column_xl-47b33c {
187
+ --flex-column-gap: var(--kbq-size-xl);
188
+ }
189
+
190
+ .kbq-flex-gap_column_xxl-2f762a {
191
+ --flex-column-gap: var(--kbq-size-xxl);
192
+ }
193
+
194
+ .kbq-flex-gap_column_3xl-e81ba4 {
195
+ --flex-column-gap: var(--kbq-size-3xl);
196
+ }
197
+
198
+ .kbq-flex-gap_column_4xl-502e67 {
199
+ --flex-column-gap: var(--kbq-size-4xl);
200
+ }
201
+
202
+ .kbq-flex-gap_column_5xl-028451 {
203
+ --flex-column-gap: var(--kbq-size-5xl);
204
+ }
205
+
206
+ .kbq-flex-gap_column_6xl-2f1bfa {
207
+ --flex-column-gap: var(--kbq-size-6xl);
208
+ }
209
+
210
+ .kbq-flex-gap_column_7xl-057b8a {
211
+ --flex-column-gap: var(--kbq-size-7xl);
212
+ }
213
+
214
+ .kbq-flex-gap_row_3xs-ea5984 {
215
+ --flex-row-gap: var(--kbq-size-3xs);
216
+ }
217
+
218
+ .kbq-flex-gap_row_xxs-a520f4 {
219
+ --flex-row-gap: var(--kbq-size-xxs);
220
+ }
221
+
222
+ .kbq-flex-gap_row_xs-e62321 {
223
+ --flex-row-gap: var(--kbq-size-xs);
224
+ }
225
+
226
+ .kbq-flex-gap_row_s-2dab73 {
227
+ --flex-row-gap: var(--kbq-size-s);
228
+ }
229
+
230
+ .kbq-flex-gap_row_m-6423db {
231
+ --flex-row-gap: var(--kbq-size-m);
232
+ }
233
+
234
+ .kbq-flex-gap_row_l-f312fe {
235
+ --flex-row-gap: var(--kbq-size-l);
236
+ }
237
+
238
+ .kbq-flex-gap_row_xl-e85171 {
239
+ --flex-row-gap: var(--kbq-size-xl);
240
+ }
241
+
242
+ .kbq-flex-gap_row_xxl-c2548b {
243
+ --flex-row-gap: var(--kbq-size-xxl);
244
+ }
245
+
246
+ .kbq-flex-gap_row_3xl-34ef28 {
247
+ --flex-row-gap: var(--kbq-size-3xl);
248
+ }
249
+
250
+ .kbq-flex-gap_row_4xl-29ec96 {
251
+ --flex-row-gap: var(--kbq-size-4xl);
252
+ }
253
+
254
+ .kbq-flex-gap_row_5xl-c7e969 {
255
+ --flex-row-gap: var(--kbq-size-5xl);
256
+ }
257
+
258
+ .kbq-flex-gap_row_6xl-afc87a {
259
+ --flex-row-gap: var(--kbq-size-6xl);
260
+ }
261
+
262
+ .kbq-flex-gap_row_7xl-d67bcc {
263
+ --flex-row-gap: var(--kbq-size-7xl);
264
+ }
54
265
  .kbq-container-136c61 {
55
266
  --container-max-inline-size: intial;
56
267
  --container-position: intial;
@@ -1135,6 +1346,10 @@
1135
1346
  text-overflow: ellipsis;
1136
1347
  overflow: hidden;
1137
1348
  }
1349
+
1350
+ .kbq-typography-color-inherit-35de13 {
1351
+ color: inherit;
1352
+ }
1138
1353
  .kbq-checkbox-72cf70 {
1139
1354
  --checkbox-bg-color: var(--kbq-background-bg);
1140
1355
  --checkbox-outline-width: var(--kbq-size-3xs);
@@ -1840,165 +2055,6 @@
1840
2055
  .kbq-inputnumbercountercontrols-counter-1126db {
1841
2056
  inline-size: var(--kbq-size-3xl);
1842
2057
  }
1843
- .kbq-flex-7624b3 {
1844
- --flex-gap: 0;
1845
- --flex-order: 0;
1846
- --flex-type: flex;
1847
- --flex-wrap: nowrap;
1848
- --flex-direction: row;
1849
- --flex-align-items: flex-start;
1850
- --flex-justify-content: flex-start;
1851
- gap: var(--flex-gap);
1852
- order: var(--flex-order);
1853
- display: var(--flex-type);
1854
- align-items: var(--flex-align-items);
1855
- justify-content: var(--flex-justify-content);
1856
- flex-flow: var(--flex-direction) var(--flex-wrap);
1857
- }
1858
-
1859
- .kbq-flex-alignItems_flex-start-56df74 {
1860
- --flex-align-items: flex-start;
1861
- }
1862
-
1863
- .kbq-flex-alignItems_flex-end-951e7a {
1864
- --flex-align-items: flex-end;
1865
- }
1866
-
1867
- .kbq-flex-alignItems_center-05836e {
1868
- --flex-align-items: center;
1869
- }
1870
-
1871
- .kbq-flex-alignItems_baseline-1e77c2 {
1872
- --flex-align-items: baseline;
1873
- }
1874
-
1875
- .kbq-flex-alignItems_stretch-f031de {
1876
- --flex-align-items: stretch;
1877
- }
1878
-
1879
- .kbq-flex-justifyContent_flex-start-05ff2a {
1880
- --flex-justify-content: flex-start;
1881
- }
1882
-
1883
- .kbq-flex-justifyContent_flex-end-06a105 {
1884
- --flex-justify-content: flex-end;
1885
- }
1886
-
1887
- .kbq-flex-justifyContent_center-5134e2 {
1888
- --flex-justify-content: center;
1889
- }
1890
-
1891
- .kbq-flex-justifyContent_space-between-02a3e5 {
1892
- --flex-justify-content: space-between;
1893
- }
1894
-
1895
- .kbq-flex-justifyContent_space-around-42e955 {
1896
- --flex-justify-content: space-around;
1897
- }
1898
-
1899
- .kbq-flex-justifyContent_space-evenly-b84975 {
1900
- --flex-justify-content: space-evenly;
1901
- }
1902
-
1903
- .kbq-flex-flex_flex-de4f74 {
1904
- --flex-type: flex;
1905
- }
1906
-
1907
- .kbq-flex-flex_inline-flex-a712ef {
1908
- --flex-type: inline-flex;
1909
- }
1910
-
1911
- .kbq-flex-wrap_wrap-78b98d {
1912
- --flex-wrap: wrap;
1913
- }
1914
-
1915
- .kbq-flex-wrap_nowrap-902a73 {
1916
- --flex-wrap: nowrap;
1917
- }
1918
-
1919
- .kbq-flex-wrap_wrap-reverse-dbacf6 {
1920
- --flex-wrap: wrap-reverse;
1921
- }
1922
-
1923
- .kbq-flex-direction_row-8fff0d {
1924
- --flex-direction: row;
1925
- }
1926
-
1927
- .kbq-flex-direction_row-reverse-7fa95e {
1928
- --flex-direction: row-reverse;
1929
- }
1930
-
1931
- .kbq-flex-direction_column-29b97b {
1932
- --flex-direction: column;
1933
- }
1934
-
1935
- .kbq-flex-direction_column-reverse-04ecc6 {
1936
- --flex-direction: column-reverse;
1937
- }
1938
-
1939
- .kbq-flex-order_-1-4f5108 {
1940
- --flex-order: -1;
1941
- }
1942
-
1943
- .kbq-flex-order_0-4a6164 {
1944
- --flex-order: 0;
1945
- }
1946
-
1947
- .kbq-flex-order_1-b5e24c {
1948
- --flex-order: 1;
1949
- }
1950
-
1951
- .kbq-flex-gap_3xs-5c9d4e {
1952
- --flex-gap: var(--kbq-size-3xs);
1953
- }
1954
-
1955
- .kbq-flex-gap_xxs-035614 {
1956
- --flex-gap: var(--kbq-size-xxs);
1957
- }
1958
-
1959
- .kbq-flex-gap_xs-970b31 {
1960
- --flex-gap: var(--kbq-size-xs);
1961
- }
1962
-
1963
- .kbq-flex-gap_s-e9d292 {
1964
- --flex-gap: var(--kbq-size-s);
1965
- }
1966
-
1967
- .kbq-flex-gap_m-21a099 {
1968
- --flex-gap: var(--kbq-size-m);
1969
- }
1970
-
1971
- .kbq-flex-gap_l-47c05c {
1972
- --flex-gap: var(--kbq-size-l);
1973
- }
1974
-
1975
- .kbq-flex-gap_xl-d76274 {
1976
- --flex-gap: var(--kbq-size-xl);
1977
- }
1978
-
1979
- .kbq-flex-gap_xxl-0e68cb {
1980
- --flex-gap: var(--kbq-size-xxl);
1981
- }
1982
-
1983
- .kbq-flex-gap_3xl-497012 {
1984
- --flex-gap: var(--kbq-size-3xl);
1985
- }
1986
-
1987
- .kbq-flex-gap_4xl-0b7c71 {
1988
- --flex-gap: var(--kbq-size-4xl);
1989
- }
1990
-
1991
- .kbq-flex-gap_5xl-ed56fe {
1992
- --flex-gap: var(--kbq-size-5xl);
1993
- }
1994
-
1995
- .kbq-flex-gap_6xl-0749d1 {
1996
- --flex-gap: var(--kbq-size-6xl);
1997
- }
1998
-
1999
- .kbq-flex-gap_7xl-0a1536 {
2000
- --flex-gap: var(--kbq-size-7xl);
2001
- }
2002
2058
  .kbq-radio-c3ed31 {
2003
2059
  --radio-size: ;
2004
2060
  --radio-opacity: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koobiq/react-components",
3
- "version": "0.0.1-beta.4",
3
+ "version": "0.0.1-beta.6",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {
@@ -22,10 +22,10 @@
22
22
  "@koobiq/design-tokens": "^3.12.1",
23
23
  "@types/react-transition-group": "^4.4.12",
24
24
  "react-transition-group": "^4.4.5",
25
- "@koobiq/react-primitives": "0.0.1-beta.4",
26
- "@koobiq/react-core": "0.0.1-beta.4",
27
- "@koobiq/react-icons": "0.0.1-beta.4",
28
- "@koobiq/logger": "0.0.1-beta.4"
25
+ "@koobiq/logger": "0.0.1-beta.6",
26
+ "@koobiq/react-icons": "0.0.1-beta.6",
27
+ "@koobiq/react-primitives": "0.0.1-beta.6",
28
+ "@koobiq/react-core": "0.0.1-beta.6"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@koobiq/design-tokens": "^3.11.2",