@cube-dev/ui-kit 0.1.5 → 0.2.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.
- package/README.md +3 -1
- package/dist/cjs/components/actions/Action.d.ts +2 -2
- package/dist/cjs/components/content/Tag/Tag.d.ts +10 -0
- package/dist/cjs/components/content/Text.d.ts +1 -1
- package/dist/cjs/components/content/Title.d.ts +2 -5
- package/dist/cjs/components/types.d.ts +3 -4
- package/dist/cjs/css-properties.d.ts +62 -0
- package/dist/cjs/data/themes.d.ts +1 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/styles/color.d.ts +1 -3
- package/dist/cjs/styles/list.d.ts +4 -4
- package/dist/cjs/styles/preset.d.ts +17 -0
- package/dist/cjs/styles/size.d.ts +3 -0
- package/dist/cjs/styles/types.d.ts +4 -0
- package/dist/cjs/utils/react/Slots.d.ts +1 -2
- package/dist/mjs/components/actions/Action.d.ts +2 -2
- package/dist/mjs/components/content/Tag/Tag.d.ts +10 -0
- package/dist/mjs/components/content/Text.d.ts +1 -1
- package/dist/mjs/components/content/Title.d.ts +2 -5
- package/dist/mjs/components/types.d.ts +3 -4
- package/dist/mjs/css-properties.d.ts +62 -0
- package/dist/mjs/data/themes.d.ts +1 -1
- package/dist/mjs/index.d.ts +2 -0
- package/dist/mjs/index.js +7 -7
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/styles/color.d.ts +1 -3
- package/dist/mjs/styles/list.d.ts +4 -4
- package/dist/mjs/styles/preset.d.ts +17 -0
- package/dist/mjs/styles/size.d.ts +3 -0
- package/dist/mjs/styles/types.d.ts +4 -0
- package/dist/mjs/utils/react/Slots.d.ts +1 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const BASE_STYLES: readonly ["display", "size", "font"];
|
|
1
|
+
export declare const BASE_STYLES: readonly ["display", "size", "font", "preset"];
|
|
2
2
|
export declare const POSITION_STYLES: readonly ["gridArea", "flexGrow", "flexShrink", "order", "gridColumn", "gridRow", "placeSelf", "zIndex", "margin"];
|
|
3
|
-
export declare const BLOCK_STYLES: readonly ["reset", "padding", "shadow", "border", "radius", "opacity", "overflow", "styledScrollbar", "hide", "outline"];
|
|
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
|
-
export declare const TEXT_STYLES: readonly ["
|
|
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", "color", "fill", "width", "height", "flexBasis", "gridArea", "flexGrow", "flexShrink", "order", "gridColumn", "gridRow", "placeSelf", "zIndex", "margin", "reset", "padding", "shadow", "border", "radius", "opacity", "overflow", "styledScrollbar", "hide", "outline", "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"];
|
|
9
9
|
export declare const OUTER_STYLES: readonly ["gridArea", "flexGrow", "flexShrink", "order", "gridColumn", "gridRow", "placeSelf", "zIndex", "margin", "width", "height", "flexBasis"];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare function presetStyle({ preset }: {
|
|
2
|
+
preset: any;
|
|
3
|
+
}): "" | {
|
|
4
|
+
'font-size': any;
|
|
5
|
+
'line-height': any;
|
|
6
|
+
'letter-spacing': any;
|
|
7
|
+
'font-weight': any;
|
|
8
|
+
'text-transform': any;
|
|
9
|
+
'--font-size': any;
|
|
10
|
+
'--line-height': any;
|
|
11
|
+
'--letter-spacing': any;
|
|
12
|
+
'--font-weight': any;
|
|
13
|
+
'--text-transform': any;
|
|
14
|
+
};
|
|
15
|
+
export declare namespace presetStyle {
|
|
16
|
+
var __lookupStyles: string[];
|
|
17
|
+
}
|
|
@@ -92,6 +92,10 @@ export interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' |
|
|
|
92
92
|
* Syntax: <value> 'inset'?
|
|
93
93
|
*/
|
|
94
94
|
outline?: CSSProperties['fontFamily'] | boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The preset style sets the base text settings according to the names preset. Affected styles: `font-size`, `line-height`, `letter-spacing`, `font-weight` and `text-transform`.
|
|
97
|
+
*/
|
|
98
|
+
preset?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h5s' | 'h5m' | 'h6' | 't1' | 't2' | 't3' | 't4' | 't4m' | 'p1' | 'p2' | 'p3' | 'p4' | 'tag' | 'default' | string;
|
|
95
99
|
}
|
|
96
100
|
export declare type Styles = {
|
|
97
101
|
[key in keyof StylesInterface]?: ResponsiveStyleValue<StylesInterface[key]>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
export declare function useSlotProps(props: Props, defaultSlot: any): Props;
|
|
2
|
+
export declare function useSlotProps(props: Record<string, any>, defaultSlot: any): Record<string, any>;
|
|
4
3
|
export declare function SlotProvider(props: any): JSX.Element;
|
|
5
4
|
export declare function ClearSlots(props: any): JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MouseEventHandler } from 'react';
|
|
2
|
-
import { BaseProps, ContainerStyleProps, TagNameProps, TextStyleProps } from '../types';
|
|
2
|
+
import { BaseProps, BaseStyleProps, ContainerStyleProps, TagNameProps, TextStyleProps } from '../types';
|
|
3
3
|
import { AriaButtonProps } from '@react-types/button';
|
|
4
|
-
export interface CubeActionProps extends BaseProps, TagNameProps, ContainerStyleProps, TextStyleProps, Omit<AriaButtonProps, 'type'> {
|
|
4
|
+
export interface CubeActionProps extends BaseProps, TagNameProps, BaseStyleProps, ContainerStyleProps, TextStyleProps, Omit<AriaButtonProps, 'type'> {
|
|
5
5
|
to?: string;
|
|
6
6
|
label?: string;
|
|
7
7
|
skipWarnings?: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import THEMES from '../../../data/themes';
|
|
3
|
+
import { BaseProps, ContainerStyleProps } from '../../types';
|
|
4
|
+
export interface CubeTagProps extends BaseProps, ContainerStyleProps {
|
|
5
|
+
type?: keyof typeof THEMES;
|
|
6
|
+
isClosable?: boolean;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const _Tag: import("react").ForwardRefExoticComponent<CubeTagProps & import("react").RefAttributes<unknown>>;
|
|
10
|
+
export { _Tag as Tag };
|
|
@@ -18,7 +18,7 @@ export interface CubeTextProps extends BaseProps, TagNameProps, TextStyleProps,
|
|
|
18
18
|
* Whether the text has italic style
|
|
19
19
|
*/
|
|
20
20
|
italic?: ResponsiveStyleValue<CSSProperties['fontStyle']>;
|
|
21
|
-
weight?:
|
|
21
|
+
weight?: string | number;
|
|
22
22
|
align?: ResponsiveStyleValue<CSSProperties['textAlign']>;
|
|
23
23
|
transform?: ResponsiveStyleValue<CSSProperties['textTransform']>;
|
|
24
24
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CubeTextProps } from './Text';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export interface CubeTitleProps extends CubeTextProps, TagNameProps, BlockStyleProps, PositionStyleProps {
|
|
3
|
+
import { BaseProps, BlockStyleProps, PositionStyleProps, TagNameProps } from '../types';
|
|
4
|
+
export interface CubeTitleProps extends BaseProps, CubeTextProps, TagNameProps, BlockStyleProps, PositionStyleProps {
|
|
6
5
|
/** The level of the heading **/
|
|
7
6
|
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
8
|
-
/** The size style for the heading **/
|
|
9
|
-
size?: ResponsiveStyleValue<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | string>;
|
|
10
7
|
}
|
|
11
8
|
declare const Title: import("react").ForwardRefExoticComponent<CubeTitleProps & import("react").RefAttributes<unknown>> & {
|
|
12
9
|
Danger: import("react").ForwardRefExoticComponent<CubeTitleProps & import("react").RefAttributes<unknown>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllHTMLAttributes, CSSProperties
|
|
1
|
+
import { AllHTMLAttributes, CSSProperties } from 'react';
|
|
2
2
|
import { Styles } 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
4
|
export interface BasePropsWithoutChildren extends Pick<AllHTMLAttributes<HTMLElement>, 'className' | 'role' | 'id'> {
|
|
@@ -34,11 +34,10 @@ export interface BasePropsWithoutChildren extends Pick<AllHTMLAttributes<HTMLEle
|
|
|
34
34
|
[key: string]: string | number | null;
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
export interface BaseProps extends BasePropsWithoutChildren {
|
|
38
|
-
children?: ReactElement<any, string | JSXElementConstructor<any>> | string | number | {} | ReactNodeArray | ReactPortal | boolean | null | undefined;
|
|
37
|
+
export interface BaseProps extends BasePropsWithoutChildren, Pick<AllHTMLAttributes<HTMLElementTagNameMap['div']>, 'children'> {
|
|
39
38
|
}
|
|
40
39
|
export interface AllBaseProps<K extends keyof HTMLElementTagNameMap = 'div'> extends BaseProps, Omit<AllHTMLAttributes<HTMLElementTagNameMap[K]>, 'style'> {
|
|
41
|
-
as?:
|
|
40
|
+
as?: string;
|
|
42
41
|
}
|
|
43
42
|
export declare type BaseStyleProps = Pick<Styles, typeof BASE_STYLES[number]>;
|
|
44
43
|
export declare type PositionStyleProps = Pick<Styles, typeof POSITION_STYLES[number]>;
|
|
@@ -17,6 +17,7 @@ declare const PROPS: {
|
|
|
17
17
|
'minor-color': string;
|
|
18
18
|
'success-bg-color': string;
|
|
19
19
|
'note-bg-color': string;
|
|
20
|
+
'note-text-color': string;
|
|
20
21
|
'danger-bg-color': string;
|
|
21
22
|
'danger-bg-hover-color': string;
|
|
22
23
|
'primary-1': string;
|
|
@@ -64,15 +65,76 @@ declare const PROPS: {
|
|
|
64
65
|
'h1-font-size': string;
|
|
65
66
|
'h1-line-height': string;
|
|
66
67
|
'h1-letter-spacing': string;
|
|
68
|
+
'h1-font-weight': string;
|
|
67
69
|
'h2-font-size': string;
|
|
68
70
|
'h2-line-height': string;
|
|
71
|
+
'h2-letter-spacing': string;
|
|
72
|
+
'h2-font-weight': string;
|
|
69
73
|
'h3-font-size': string;
|
|
70
74
|
'h3-line-height': string;
|
|
75
|
+
'h3-letter-spacing': string;
|
|
76
|
+
'h3-font-weight': string;
|
|
71
77
|
'h4-font-size': string;
|
|
72
78
|
'h4-line-height': string;
|
|
79
|
+
'h4-letter-spacing': string;
|
|
80
|
+
'h4-font-weight': string;
|
|
73
81
|
'h5-font-size': string;
|
|
74
82
|
'h5-line-height': string;
|
|
83
|
+
'h5-letter-spacing': string;
|
|
84
|
+
'h5-font-weight': string;
|
|
85
|
+
'h5s-font-size': string;
|
|
86
|
+
'h5s-line-height': string;
|
|
87
|
+
'h5s-letter-spacing': string;
|
|
88
|
+
'h5s-font-weight': string;
|
|
89
|
+
'h5m-font-size': string;
|
|
90
|
+
'h5m-line-height': string;
|
|
91
|
+
'h5m-letter-spacing': string;
|
|
92
|
+
'h5m-font-weight': string;
|
|
75
93
|
'h6-font-size': string;
|
|
76
94
|
'h6-line-height': string;
|
|
95
|
+
't1-font-size': string;
|
|
96
|
+
't1-line-height': string;
|
|
97
|
+
't1-letter-spacing': string;
|
|
98
|
+
't1-font-weight': string;
|
|
99
|
+
't2-font-size': string;
|
|
100
|
+
't2-line-height': string;
|
|
101
|
+
't2-letter-spacing': string;
|
|
102
|
+
't2-font-weight': string;
|
|
103
|
+
't3-font-size': string;
|
|
104
|
+
't3-line-height': string;
|
|
105
|
+
't3-letter-spacing': string;
|
|
106
|
+
't3-font-weight': string;
|
|
107
|
+
't4-font-size': string;
|
|
108
|
+
't4-line-height': string;
|
|
109
|
+
't4-letter-spacing': string;
|
|
110
|
+
't4-font-weight': string;
|
|
111
|
+
't4m-font-size': string;
|
|
112
|
+
't4m-line-height': string;
|
|
113
|
+
't4m-letter-spacing': string;
|
|
114
|
+
't4m-font-weight': string;
|
|
115
|
+
'p1-font-size': string;
|
|
116
|
+
'p1-line-height': string;
|
|
117
|
+
'p1-letter-spacing': string;
|
|
118
|
+
'p1-font-weight': string;
|
|
119
|
+
'p2-font-size': string;
|
|
120
|
+
'p2-line-height': string;
|
|
121
|
+
'p2-letter-spacing': string;
|
|
122
|
+
'p2-font-weight': string;
|
|
123
|
+
'p3-font-size': string;
|
|
124
|
+
'p3-line-height': string;
|
|
125
|
+
'p3-letter-spacing': string;
|
|
126
|
+
'p3-font-weight': string;
|
|
127
|
+
'p4-font-size': string;
|
|
128
|
+
'p4-line-height': string;
|
|
129
|
+
'p4-letter-spacing': string;
|
|
130
|
+
'p4-font-weight': string;
|
|
131
|
+
'tag-font-size': string;
|
|
132
|
+
'tag-line-height': string;
|
|
133
|
+
'tag-letter-spacing': string;
|
|
134
|
+
'tag-font-weight': string;
|
|
135
|
+
'default-font-size': string;
|
|
136
|
+
'default-line-height': string;
|
|
137
|
+
'default-letter-spacing': string;
|
|
138
|
+
'default-font-weight': string;
|
|
77
139
|
};
|
|
78
140
|
export default PROPS;
|
package/dist/mjs/index.d.ts
CHANGED
|
@@ -64,6 +64,8 @@ export type { CubeSkeletonProps } from './components/content/Skeleton/Skeleton';
|
|
|
64
64
|
export { CloudLogo } from './components/other/CloudLogo/CloudLogo';
|
|
65
65
|
export { Badge } from './components/content/Badge/Badge';
|
|
66
66
|
export type { CubeBadgeProps } from './components/content/Badge/Badge';
|
|
67
|
+
export { Tag } from './components/content/Tag/Tag';
|
|
68
|
+
export type { CubeTagProps } from './components/content/Tag/Tag';
|
|
67
69
|
export { SearchInput } from './components/forms/SearchInput/SearchInput';
|
|
68
70
|
export type { CubeSearchInputProps } from './components/forms/SearchInput/SearchInput';
|
|
69
71
|
export { Submit } from './components/actions/Button/Submit';
|