@cube-dev/ui-kit 0.3.2 → 0.4.3

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 (37) hide show
  1. package/dist/cjs/components/Root.d.ts +1 -1
  2. package/dist/cjs/components/actions/Button/Button.d.ts +1 -0
  3. package/dist/cjs/components/content/Badge/Badge.d.ts +1 -1
  4. package/dist/cjs/components/content/Placeholder/Placeholder.d.ts +1 -1
  5. package/dist/cjs/components/content/Tag/Tag.d.ts +1 -1
  6. package/dist/cjs/components/forms/TextInput/TextInputBase.d.ts +1 -0
  7. package/dist/cjs/components/pickers/ComboBox/ComboBox.d.ts +1 -0
  8. package/dist/cjs/components/pickers/Select/Select.d.ts +1 -1
  9. package/dist/cjs/components/types.d.ts +1 -1
  10. package/dist/cjs/css-properties.d.ts +5 -0
  11. package/dist/cjs/index.js +4 -4
  12. package/dist/cjs/index.js.map +1 -1
  13. package/dist/cjs/provider.d.ts +6 -3
  14. package/dist/cjs/stories/FormFieldArgs.d.ts +18 -0
  15. package/dist/cjs/styles/list.d.ts +2 -2
  16. package/dist/cjs/styles/types.d.ts +0 -6
  17. package/dist/cjs/utils/renderStyles.d.ts +1 -1
  18. package/dist/cjs/utils/styles.d.ts +0 -20
  19. package/dist/mjs/components/Root.d.ts +1 -1
  20. package/dist/mjs/components/actions/Button/Button.d.ts +1 -0
  21. package/dist/mjs/components/content/Badge/Badge.d.ts +1 -1
  22. package/dist/mjs/components/content/Placeholder/Placeholder.d.ts +1 -1
  23. package/dist/mjs/components/content/Tag/Tag.d.ts +1 -1
  24. package/dist/mjs/components/forms/TextInput/TextInputBase.d.ts +1 -0
  25. package/dist/mjs/components/pickers/ComboBox/ComboBox.d.ts +1 -0
  26. package/dist/mjs/components/pickers/Select/Select.d.ts +1 -1
  27. package/dist/mjs/components/types.d.ts +1 -1
  28. package/dist/mjs/css-properties.d.ts +5 -0
  29. package/dist/mjs/index.js +7 -7
  30. package/dist/mjs/index.js.map +1 -1
  31. package/dist/mjs/provider.d.ts +6 -3
  32. package/dist/mjs/stories/FormFieldArgs.d.ts +18 -0
  33. package/dist/mjs/styles/list.d.ts +2 -2
  34. package/dist/mjs/styles/types.d.ts +0 -6
  35. package/dist/mjs/utils/renderStyles.d.ts +1 -1
  36. package/dist/mjs/utils/styles.d.ts +0 -20
  37. package/package.json +1 -1
@@ -1,7 +1,6 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { ForwardedRef, PropsWithChildren } from 'react';
2
2
  import { ResponsiveStyleValue } from './utils/styles';
3
3
  import { Props } from './components/types';
4
- export declare const UIKitContext: import("react").Context<ProviderProps>;
5
4
  export interface ProviderProps extends Props {
6
5
  breakpoints?: number[];
7
6
  insideForm?: boolean;
@@ -16,6 +15,10 @@ export interface ProviderProps extends Props {
16
15
  } | Function;
17
16
  };
18
17
  ref?: JSX.Element;
18
+ root?: ForwardedRef<any>;
19
19
  }
20
+ export interface ProviderInsideProps extends Omit<ProviderProps, 'styles' | 'breakpoints'> {
21
+ }
22
+ export declare const UIKitContext: import("react").Context<ProviderInsideProps>;
20
23
  export declare function Provider(allProps: PropsWithChildren<ProviderProps>): JSX.Element;
21
- export declare function useProviderProps<T = Props>(props: T): T;
24
+ export declare function useProviderProps<T extends Props = Props>(props: T): T;
@@ -137,6 +137,24 @@ export declare const IS_DISABLED_ARG: {
137
137
  };
138
138
  };
139
139
  };
140
+ export declare const SIZE_ARG: {
141
+ size: {
142
+ defaultValue: undefined;
143
+ description: string;
144
+ control: {
145
+ type: string;
146
+ options: (string | undefined)[];
147
+ };
148
+ table: {
149
+ type: {
150
+ summary: string;
151
+ };
152
+ defaultValue: {
153
+ summary: string;
154
+ };
155
+ };
156
+ };
157
+ };
140
158
  export declare const MULTILINE_ARG: {
141
159
  multiLine: {
142
160
  defaultValue: boolean;
@@ -1,9 +1,9 @@
1
- export declare const BASE_STYLES: readonly ["display", "size", "font", "preset"];
1
+ export declare const BASE_STYLES: readonly ["display", "font", "preset"];
2
2
  export declare const POSITION_STYLES: readonly ["gridArea", "flexGrow", "flexShrink", "order", "gridColumn", "gridRow", "placeSelf", "zIndex", "margin"];
3
3
  export declare const BLOCK_STYLES: readonly ["reset", "padding", "shadow", "border", "radius", "opacity", "overflow", "styledScrollbar", "hide", "outline", "textAlign"];
4
4
  export declare const COLOR_STYLES: readonly ["color", "fill"];
5
5
  export declare const TEXT_STYLES: readonly ["textTransform", "fontWeight", "fontStyle"];
6
6
  export declare const DIMENSION_STYLES: readonly ["width", "height", "flexBasis"];
7
7
  export declare const FLOW_STYLES: readonly ["flow", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "gap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
8
- export declare const CONTAINER_STYLES: readonly ["display", "size", "font", "preset", "color", "fill", "width", "height", "flexBasis", "gridArea", "flexGrow", "flexShrink", "order", "gridColumn", "gridRow", "placeSelf", "zIndex", "margin", "reset", "padding", "shadow", "border", "radius", "opacity", "overflow", "styledScrollbar", "hide", "outline", "textAlign", "flow", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "gap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
8
+ export declare const CONTAINER_STYLES: readonly ["display", "font", "preset", "color", "fill", "width", "height", "flexBasis", "gridArea", "flexGrow", "flexShrink", "order", "gridColumn", "gridRow", "placeSelf", "zIndex", "margin", "reset", "padding", "shadow", "border", "radius", "opacity", "overflow", "styledScrollbar", "hide", "outline", "textAlign", "flow", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "gap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
9
9
  export declare const OUTER_STYLES: readonly ["gridArea", "flexGrow", "flexShrink", "order", "gridColumn", "gridRow", "placeSelf", "zIndex", "margin", "width", "height", "flexBasis"];
@@ -23,12 +23,6 @@ export interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' |
23
23
  * ```
24
24
  */
25
25
  color?: `#${NamedColor}${OpaquePercentage}` | `rgb(${string})` | `rgba(${string})` | boolean | string;
26
- /**
27
- * The font-size, line-height, and letter-spacing of the element with ability to apply presets.
28
- * Syntax: `<fontSize> <lineHeight>? <letterSpacing>?`.
29
- * Syntax: `<presetName>`
30
- */
31
- size?: 'md' | 'sm' | 'lg' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h5s' | 'h5m' | 'h6' | 't1' | 't2' | 't3' | 't4' | 't4m' | 'p1' | 'p2' | 'p3' | 'p4' | 'tag' | 'default' | 'text' | string;
32
26
  /**
33
27
  * Whether styles of the element should be reset.
34
28
  * Possible values: `input`, `button`.
@@ -5,4 +5,4 @@ import { Styles } from '../styles/types';
5
5
  * @param responsive - A list of responsive zones
6
6
  * @return {string}
7
7
  */
8
- export declare function renderStyles(styles: Styles, responsive: number[]): string;
8
+ export declare function renderStyles(styles: Styles, responsive: number[]): any;
@@ -48,8 +48,6 @@ export declare type StyleStateMapList = StyleStateMap[];
48
48
  export declare type StyleStateListMap = {
49
49
  [key: string]: StyleStateList;
50
50
  };
51
- export declare const NO_VALUES: (string | boolean)[];
52
- export declare const YES_VALUES: (string | boolean)[];
53
51
  export declare const CUSTOM_UNITS: {
54
52
  r: string;
55
53
  bw: string;
@@ -106,18 +104,6 @@ export declare function hexToRgb(hex: any): string | null;
106
104
  export declare function transferMods(mods: any, from: any, to: any): void;
107
105
  export declare function filterMods(mods: any, allowedMods: any): any;
108
106
  export declare function customUnit(value: any, unit: any): any;
109
- /**
110
- * Check for "no" value.
111
- * @param {string} value - original attribute value.
112
- * @return {boolean}
113
- */
114
- export declare function isNoValue(value: any): boolean;
115
- /**
116
- * Check for "yes" value.
117
- * @param {string} value - original attribute value.
118
- * @return {boolean}
119
- */
120
- export declare function isYesValue(value: any): boolean;
121
107
  export declare function extendStyles(defaultStyles: any, newStyles: any): {};
122
108
  /**
123
109
  * Split properties into style and non-style properties.
@@ -209,9 +195,3 @@ export declare function computeState(computeModel: ComputeModel, valueMap: (numb
209
195
  [key: string]: boolean;
210
196
  } | Function): any;
211
197
  export declare function cacheWrapper(handler: Function, limit?: number): (arg: any) => any;
212
- /**
213
- * Check for "no" value in modifiers.
214
- * @param mods {Array<String>} - original attribute value.
215
- * @return {boolean}
216
- */
217
- export declare function hasNegativeMod(mods: any): boolean;
@@ -10,4 +10,4 @@ export interface CubeRootProps extends BaseProps {
10
10
  font?: string;
11
11
  monospaceFont?: string;
12
12
  }
13
- export declare const Root: import("react").ForwardRefExoticComponent<CubeRootProps & import("react").RefAttributes<unknown>>;
13
+ export declare const Root: (allProps: CubeRootProps) => JSX.Element;
@@ -6,6 +6,7 @@ export interface CubeButtonProps extends CubeActionProps {
6
6
  isSelected?: boolean;
7
7
  type?: 'primary' | 'default' | 'danger' | 'link' | 'clear' | 'outline' | 'neutral' | string;
8
8
  theme?: 'default' | 'danger' | string;
9
+ size?: 'small' | 'default' | 'large' | string;
9
10
  }
10
11
  export declare function provideStyles({ size, type, theme, isLoading, icon, children, }: {
11
12
  size: any;
@@ -2,6 +2,6 @@
2
2
  import THEMES from '../../../data/themes';
3
3
  import { BaseProps, ContainerStyleProps } from '../../types';
4
4
  export interface CubeBadgeProps extends BaseProps, ContainerStyleProps {
5
- type?: keyof typeof THEMES;
5
+ type?: keyof typeof THEMES | string;
6
6
  }
7
7
  export declare const Badge: import("react").ForwardRefExoticComponent<CubeBadgeProps & import("react").RefAttributes<unknown>>;
@@ -2,7 +2,7 @@
2
2
  import { Styles } from '../../../styles/types';
3
3
  import { BaseProps, ContainerStyleProps } from '../../types';
4
4
  export interface CubePlaceholderProps extends BaseProps, ContainerStyleProps {
5
- size?: Styles['size'];
5
+ size?: Styles['fontSize'];
6
6
  circle?: boolean;
7
7
  }
8
8
  export declare const Placeholder: import("react").ForwardRefExoticComponent<CubePlaceholderProps & import("react").RefAttributes<unknown>>;
@@ -2,7 +2,7 @@
2
2
  import THEMES from '../../../data/themes';
3
3
  import { BaseProps, ContainerStyleProps } from '../../types';
4
4
  export interface CubeTagProps extends BaseProps, ContainerStyleProps {
5
- type?: keyof typeof THEMES;
5
+ type?: keyof typeof THEMES | string;
6
6
  isClosable?: boolean;
7
7
  onClose?: () => void;
8
8
  }
@@ -35,6 +35,7 @@ export interface CubeTextInputBaseProps extends BaseProps, PositionStyleProps, B
35
35
  rows?: number;
36
36
  /** The resize CSS property sets whether an element is resizable, and if so, in which directions. */
37
37
  resize?: Styles['resize'];
38
+ size?: 'small' | 'default' | 'large' | string;
38
39
  }
39
40
  declare const _TextInputBase: import("react").ForwardRefExoticComponent<CubeTextInputBaseProps & import("react").RefAttributes<unknown>>;
40
41
  export { _TextInputBase as TextInputBase };
@@ -14,6 +14,7 @@ export interface CubeComboBoxProps<T> extends Omit<CubeSelectBaseProps<T>, 'onOp
14
14
  keyboardDelegate?: KeyboardDelegate;
15
15
  loadingState?: LoadingState;
16
16
  filter?: (val: any, str: string) => boolean;
17
+ size?: 'small' | 'default' | 'large' | string;
17
18
  }
18
19
  declare const _ComboBox: import("react").ForwardRefExoticComponent<CubeComboBoxProps<object> & import("react").RefAttributes<unknown>> & {
19
20
  cubeInputType: string;
@@ -24,7 +24,7 @@ export interface CubeSelectProps<T> extends CubeSelectBaseProps<T> {
24
24
  popoverRef?: RefObject<HTMLInputElement>;
25
25
  /** The ref for the list box. */
26
26
  listBoxRef?: RefObject<HTMLElement>;
27
- size?: 'small' | 'default' | Styles['size'];
27
+ size?: 'small' | 'default' | 'large' | string;
28
28
  }
29
29
  export declare function ListBoxPopup({ state, popoverRef, listBoxRef, listBoxStyles, overlayStyles, optionStyles, overlayProps: parentOverlayProps, disallowEmptySelection, shouldUseVirtualFocus, placement, minWidth, ...otherProps }: {
30
30
  [x: string]: any;
@@ -36,7 +36,7 @@ export interface BasePropsWithoutChildren extends Pick<AllHTMLAttributes<HTMLEle
36
36
  }
37
37
  export interface BaseProps extends BasePropsWithoutChildren, Pick<AllHTMLAttributes<HTMLElementTagNameMap['div']>, 'children'> {
38
38
  }
39
- export interface AllBaseProps<K extends keyof HTMLElementTagNameMap = 'div'> extends BaseProps, Omit<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'style'> {
39
+ export interface AllBaseProps<K extends keyof HTMLElementTagNameMap = 'div'> extends BaseProps, Omit<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'style' | 'size'> {
40
40
  as?: string;
41
41
  }
42
42
  export declare type BaseStyleProps = Pick<Styles, typeof BASE_STYLES[number]>;
@@ -76,6 +76,7 @@ declare const PROPS: {
76
76
  'h5m-font-weight': string;
77
77
  'h6-font-size': string;
78
78
  'h6-line-height': string;
79
+ 'h6-font-weight': string;
79
80
  't1-font-size': string;
80
81
  't1-line-height': string;
81
82
  't1-letter-spacing': string;
@@ -88,6 +89,10 @@ declare const PROPS: {
88
89
  't3-line-height': string;
89
90
  't3-letter-spacing': string;
90
91
  't3-font-weight': string;
92
+ 't3m-font-size': string;
93
+ 't3m-line-height': string;
94
+ 't3m-letter-spacing': string;
95
+ 't3m-font-weight': string;
91
96
  't4-font-size': string;
92
97
  't4-line-height': string;
93
98
  't4-letter-spacing': string;