@cube-dev/ui-kit 0.6.62 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/cjs/components/content/PrismCode/PrismCode.d.ts +2 -2
  2. package/dist/cjs/components/content/Text.d.ts +0 -2
  3. package/dist/cjs/components/forms/TextInput/TextInputBase.d.ts +1 -1
  4. package/dist/cjs/components/layout/Flex.d.ts +2 -2
  5. package/dist/cjs/components/layout/Grid.d.ts +2 -2
  6. package/dist/cjs/components/layout/Space.d.ts +2 -2
  7. package/dist/cjs/components/pickers/ComboBox/ComboBox.d.ts +1 -1
  8. package/dist/cjs/components/pickers/Select/Select.d.ts +1 -2
  9. package/dist/cjs/components/types.d.ts +19 -6
  10. package/dist/cjs/css-properties.d.ts +1 -0
  11. package/dist/cjs/index.d.ts +1 -1
  12. package/dist/cjs/index.js +14 -11
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/cjs/providers/BreakpointsProvider.d.ts +7 -5
  15. package/dist/cjs/providers/StylesProvider.d.ts +8 -6
  16. package/dist/cjs/shared/form.d.ts +7 -0
  17. package/dist/cjs/stories/components/StyledButton.d.ts +4 -0
  18. package/dist/cjs/styled.d.ts +7 -26
  19. package/dist/cjs/styles/align.d.ts +9 -0
  20. package/dist/cjs/styles/justify.d.ts +9 -0
  21. package/dist/cjs/styles/list.d.ts +2 -2
  22. package/dist/cjs/styles/margin.d.ts +7 -1
  23. package/dist/cjs/styles/marginBlock.d.ts +8 -0
  24. package/dist/cjs/styles/marginInline.d.ts +8 -0
  25. package/dist/cjs/styles/types.d.ts +13 -4
  26. package/dist/cjs/utils/mergeStyles.d.ts +2 -0
  27. package/dist/cjs/utils/renderStyles.d.ts +1 -0
  28. package/dist/cjs/utils/responsive.d.ts +1 -1
  29. package/dist/cjs/utils/styles.d.ts +3 -3
  30. package/dist/mjs/components/content/PrismCode/PrismCode.d.ts +2 -2
  31. package/dist/mjs/components/content/Text.d.ts +0 -2
  32. package/dist/mjs/components/forms/TextInput/TextInputBase.d.ts +1 -1
  33. package/dist/mjs/components/layout/Flex.d.ts +2 -2
  34. package/dist/mjs/components/layout/Grid.d.ts +2 -2
  35. package/dist/mjs/components/layout/Space.d.ts +2 -2
  36. package/dist/mjs/components/pickers/ComboBox/ComboBox.d.ts +1 -1
  37. package/dist/mjs/components/pickers/Select/Select.d.ts +1 -2
  38. package/dist/mjs/components/types.d.ts +19 -6
  39. package/dist/mjs/css-properties.d.ts +1 -0
  40. package/dist/mjs/index.d.ts +1 -1
  41. package/dist/mjs/index.js +15 -12
  42. package/dist/mjs/index.js.map +1 -1
  43. package/dist/mjs/providers/BreakpointsProvider.d.ts +7 -5
  44. package/dist/mjs/providers/StylesProvider.d.ts +8 -6
  45. package/dist/mjs/shared/form.d.ts +7 -0
  46. package/dist/mjs/stories/components/StyledButton.d.ts +4 -0
  47. package/dist/mjs/styled.d.ts +7 -26
  48. package/dist/mjs/styles/align.d.ts +9 -0
  49. package/dist/mjs/styles/justify.d.ts +9 -0
  50. package/dist/mjs/styles/list.d.ts +2 -2
  51. package/dist/mjs/styles/margin.d.ts +7 -1
  52. package/dist/mjs/styles/marginBlock.d.ts +8 -0
  53. package/dist/mjs/styles/marginInline.d.ts +8 -0
  54. package/dist/mjs/styles/types.d.ts +13 -4
  55. package/dist/mjs/utils/mergeStyles.d.ts +2 -0
  56. package/dist/mjs/utils/renderStyles.d.ts +1 -0
  57. package/dist/mjs/utils/responsive.d.ts +1 -1
  58. package/dist/mjs/utils/styles.d.ts +3 -3
  59. package/package.json +82 -81
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { BaseProps } from '../../types';
2
+ import { BaseProps, ContainerStyleProps } from '../../types';
3
3
  import { Styles } from '../../../styles/types';
4
- export interface CubePrismCodeProps {
4
+ export interface CubePrismCodeProps extends ContainerStyleProps {
5
5
  /** The CSS style map */
6
6
  style?: BaseProps['style'];
7
7
  styles?: Styles;
@@ -2,7 +2,6 @@ import { CSSProperties } from 'react';
2
2
  import { ResponsiveStyleValue } from '../../utils/styles';
3
3
  import { BaseProps, BaseStyleProps, ColorStyleProps, TagNameProps, TextStyleProps } from '../types';
4
4
  export declare const TEXT_PROP_MAP: {
5
- readonly align: "textAlign";
6
5
  readonly transform: "textTransform";
7
6
  readonly weight: "fontWeight";
8
7
  readonly italic: "fontStyle";
@@ -25,7 +24,6 @@ export interface CubeTextProps extends BaseProps, TagNameProps, TextStyleProps,
25
24
  */
26
25
  italic?: ResponsiveStyleValue<CSSProperties['fontStyle']>;
27
26
  weight?: string | number;
28
- align?: ResponsiveStyleValue<CSSProperties['textAlign']>;
29
27
  transform?: ResponsiveStyleValue<CSSProperties['textTransform']>;
30
28
  }
31
29
  declare const Text: import("react").ForwardRefExoticComponent<CubeTextProps & import("react").RefAttributes<unknown>> & {
@@ -20,7 +20,7 @@ export interface CubeTextInputBaseProps extends BaseProps, PositionStyleProps, D
20
20
  /** Direct input wrapper props */
21
21
  wrapperProps?: Props;
22
22
  /** The input ref */
23
- inputRef?: RefObject<HTMLInputElement>;
23
+ inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement>;
24
24
  /** The wrapper ref */
25
25
  wrapperRef?: RefObject<HTMLDivElement>;
26
26
  /** Whether the input has the loading status */
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { BaseProps, ContainerStyleProps, ShortItemsStyles } from '../types';
3
- export interface CubeFlexProps extends BaseProps, ContainerStyleProps, ShortItemsStyles {
2
+ import { BaseProps, ContainerStyleProps } from '../types';
3
+ export interface CubeFlexProps extends BaseProps, ContainerStyleProps {
4
4
  }
5
5
  export declare const Flex: import("react").ForwardRefExoticComponent<CubeFlexProps & import("react").RefAttributes<unknown>>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { BaseProps, ContainerStyleProps, ShortGridStyles, ShortItemsStyles } from '../types';
3
- export interface CubeGridProps extends BaseProps, ContainerStyleProps, ShortItemsStyles, ShortGridStyles {
2
+ import { BaseProps, ContainerStyleProps, ShortGridStyles } from '../types';
3
+ export interface CubeGridProps extends BaseProps, ContainerStyleProps, ShortGridStyles {
4
4
  }
5
5
  export declare const Grid: import("react").ForwardRefExoticComponent<CubeGridProps & import("react").RefAttributes<unknown>>;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { BaseProps, ContainerStyleProps, ShortItemsStyles } from '../types';
3
- export interface CubeSpaceProps extends BaseProps, ContainerStyleProps, ShortItemsStyles {
2
+ import { BaseProps, ContainerStyleProps } from '../types';
3
+ export interface CubeSpaceProps extends BaseProps, ContainerStyleProps {
4
4
  direction?: 'vertical' | 'horizontal';
5
5
  }
6
6
  export declare const Space: import("react").ForwardRefExoticComponent<CubeSpaceProps & import("react").RefAttributes<unknown>>;
@@ -5,7 +5,7 @@ import { ComboBoxProps } from '@react-types/combobox';
5
5
  export interface CubeComboBoxProps<T> extends Omit<CubeSelectBaseProps<T>, 'onOpenChange'>, ComboBoxProps<T>, CollectionBase<T> {
6
6
  multiLine?: boolean;
7
7
  autoComplete?: string;
8
- inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement>;
8
+ inputRef?: RefObject<HTMLInputElement>;
9
9
  /** The ref for the list box popover. */
10
10
  popoverRef?: RefObject<HTMLDivElement>;
11
11
  /** The ref for the list box. */
@@ -26,7 +26,7 @@ export interface CubeSelectProps<T> extends CubeSelectBaseProps<T> {
26
26
  listBoxRef?: RefObject<HTMLElement>;
27
27
  size?: 'small' | 'default' | 'large' | string;
28
28
  }
29
- export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxStyles, overlayStyles, optionStyles, overlayProps: parentOverlayProps, disallowEmptySelection, shouldUseVirtualFocus, placement, minWidth, ...otherProps }: {
29
+ export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxStyles, overlayStyles, optionStyles, overlayProps: parentOverlayProps, shouldUseVirtualFocus, placement, minWidth, ...otherProps }: {
30
30
  [x: string]: any;
31
31
  state: any;
32
32
  popoverRef: any;
@@ -35,7 +35,6 @@ export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxSty
35
35
  overlayStyles: any;
36
36
  optionStyles: any;
37
37
  overlayProps: any;
38
- disallowEmptySelection: any;
39
38
  shouldUseVirtualFocus?: boolean | undefined;
40
39
  placement: any;
41
40
  minWidth: any;
@@ -1,6 +1,23 @@
1
1
  import { AllHTMLAttributes, CSSProperties } from 'react';
2
- import { Styles } from '../styles/types';
2
+ import { Styles, StylesInterface } from '../styles/types';
3
3
  import { BASE_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES } from '../styles/list';
4
+ export interface GlobalStyledProps {
5
+ breakpoints?: number[];
6
+ }
7
+ export interface StyledProps<K extends (keyof StylesInterface)[]> {
8
+ /** The name of the element. It can be used to override styles in context. */
9
+ name?: string;
10
+ /** The tag name of the element. */
11
+ tag?: string;
12
+ /** Default styles of the element. */
13
+ styles?: Styles;
14
+ /** Default css of the element. */
15
+ css?: string | ((props: Props) => string);
16
+ /** Default properties/attributes */
17
+ props?: Record<string, any>;
18
+ /** The list of styles that can be provided by props */
19
+ styleProps?: K;
20
+ }
4
21
  export interface BasePropsWithoutChildren extends Pick<AllHTMLAttributes<HTMLElement>, 'className' | 'role' | 'id'> {
5
22
  /** QA ID for e2e testing. An alias for `data-qa` attribute. */
6
23
  qa?: string;
@@ -35,7 +52,7 @@ export interface BasePropsWithoutChildren extends Pick<AllHTMLAttributes<HTMLEle
35
52
  }
36
53
  export interface BaseProps extends BasePropsWithoutChildren, Pick<AllHTMLAttributes<HTMLElementTagNameMap['div']>, 'children'> {
37
54
  }
38
- export interface AllBaseProps<K extends keyof HTMLElementTagNameMap = 'div'> extends BaseProps, Omit<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'style' | 'size' | 'disabled' | 'hidden' | 'css'> {
55
+ export interface AllBaseProps<K extends keyof HTMLElementTagNameMap = 'div'> extends BaseProps, Omit<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'style' | 'size' | 'disabled' | 'hidden' | 'css' | 'color' | 'height' | 'width'> {
39
56
  as?: string;
40
57
  }
41
58
  export declare type BaseStyleProps = Pick<Styles, typeof BASE_STYLES[number]>;
@@ -47,10 +64,6 @@ export declare type DimensionStyleProps = Pick<Styles, typeof DIMENSION_STYLES[n
47
64
  export declare type FlowStyleProps = Pick<Styles, typeof FLOW_STYLES[number]>;
48
65
  export declare type ContainerStyleProps = Pick<Styles, typeof CONTAINER_STYLES[number]>;
49
66
  export declare type OuterStyleProps = Pick<Styles, typeof OUTER_STYLES[number]>;
50
- export declare type ShortItemsStyles = {
51
- align?: Styles['alignItems'];
52
- justify?: Styles['justifyItems'];
53
- };
54
67
  export declare type ShortGridStyles = {
55
68
  template?: Styles['gridTemplate'];
56
69
  columns?: Styles['gridColumns'];
@@ -9,6 +9,7 @@ declare const PROPS: {
9
9
  'outline-width': string;
10
10
  'border-width': string;
11
11
  radius: string;
12
+ 'leaf-sharp-radius': string;
12
13
  transition: string;
13
14
  'clear-color': string;
14
15
  'border-color': string;
@@ -166,7 +166,7 @@ declare const Input: import("react").ForwardRefExoticComponent<import("./compone
166
166
  File: import("react").ForwardRefExoticComponent<import("./components/forms/FileInput/FileInput").CubeFileInputProps & import("react").RefAttributes<unknown>>;
167
167
  };
168
168
  export { Input };
169
- export type { TagName, TagNameProps, AllBaseProps, BaseProps, BaseStyleProps, DimensionStyleProps, ColorStyleProps, OuterStyleProps, PositionStyleProps, TextStyleProps, BlockStyleProps, ContainerStyleProps, BasePropsWithoutChildren, Props, FlowStyleProps, ShortItemsStyles, ShortGridStyles, } from './components/types';
169
+ export type { TagName, TagNameProps, AllBaseProps, BaseProps, BaseStyleProps, DimensionStyleProps, ColorStyleProps, OuterStyleProps, PositionStyleProps, TextStyleProps, BlockStyleProps, ContainerStyleProps, BasePropsWithoutChildren, Props, FlowStyleProps, ShortGridStyles, } from './components/types';
170
170
  export * from './styles/types';
171
171
  export * from './styles/list';
172
172
  export * from './styles/index';