@cdx-ui/components 0.0.1-alpha.14 → 0.0.1-alpha.16
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 +1 -1
- package/lib/commonjs/components/Box/Box.js +1 -0
- package/lib/commonjs/components/Box/Box.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +28 -13
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +324 -140
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js +18 -11
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/styles.js +17 -16
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
- package/lib/commonjs/components/Heading/index.js.map +1 -1
- package/lib/commonjs/components/Heading/styles.js +3 -2
- package/lib/commonjs/components/Heading/styles.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +2 -1
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/Input/index.js +10 -16
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/components/Input/styles.js +16 -30
- package/lib/commonjs/components/Input/styles.js.map +1 -1
- package/lib/commonjs/components/Link/styles.js +6 -1
- package/lib/commonjs/components/Link/styles.js.map +1 -1
- package/lib/commonjs/components/Select/index.js +11 -12
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Select/styles.js +29 -53
- package/lib/commonjs/components/Select/styles.js.map +1 -1
- package/lib/commonjs/components/Stack/styles.js +2 -14
- package/lib/commonjs/components/Stack/styles.js.map +1 -1
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/Text/styles.js +3 -2
- package/lib/commonjs/components/Text/styles.js.map +1 -1
- package/lib/commonjs/styles/index.js +17 -0
- package/lib/commonjs/styles/index.js.map +1 -0
- package/lib/commonjs/styles/primitives.js +123 -0
- package/lib/commonjs/styles/primitives.js.map +1 -0
- package/lib/module/components/Box/Box.js +1 -0
- package/lib/module/components/Box/Box.js.map +1 -1
- package/lib/module/components/Button/index.js +29 -14
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +323 -139
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/Checkbox/index.js +19 -12
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Checkbox/styles.js +17 -16
- package/lib/module/components/Checkbox/styles.js.map +1 -1
- package/lib/module/components/Heading/index.js.map +1 -1
- package/lib/module/components/Heading/styles.js +3 -2
- package/lib/module/components/Heading/styles.js.map +1 -1
- package/lib/module/components/Icon/index.js +2 -1
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/Input/index.js +10 -16
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/Input/styles.js +16 -30
- package/lib/module/components/Input/styles.js.map +1 -1
- package/lib/module/components/Link/styles.js +6 -1
- package/lib/module/components/Link/styles.js.map +1 -1
- package/lib/module/components/Select/index.js +12 -13
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Select/styles.js +29 -53
- package/lib/module/components/Select/styles.js.map +1 -1
- package/lib/module/components/Stack/styles.js +2 -14
- package/lib/module/components/Stack/styles.js.map +1 -1
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/Text/styles.js +3 -2
- package/lib/module/components/Text/styles.js.map +1 -1
- package/lib/module/styles/index.js +4 -0
- package/lib/module/styles/index.js.map +1 -0
- package/lib/module/styles/primitives.js +119 -0
- package/lib/module/styles/primitives.js.map +1 -0
- package/lib/typescript/components/Box/Box.d.ts +1 -0
- package/lib/typescript/components/Box/Box.d.ts.map +1 -1
- package/lib/typescript/components/Button/index.d.ts +6 -3
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +14 -8
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts +6 -4
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/styles.d.ts +4 -4
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -1
- package/lib/typescript/components/Heading/index.d.ts +6 -2
- package/lib/typescript/components/Heading/index.d.ts.map +1 -1
- package/lib/typescript/components/Heading/styles.d.ts.map +1 -1
- package/lib/typescript/components/Icon/index.d.ts +1 -2
- package/lib/typescript/components/Icon/index.d.ts.map +1 -1
- package/lib/typescript/components/Input/index.d.ts +6 -4
- package/lib/typescript/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/components/Input/styles.d.ts +5 -7
- package/lib/typescript/components/Input/styles.d.ts.map +1 -1
- package/lib/typescript/components/Link/styles.d.ts.map +1 -1
- package/lib/typescript/components/Select/index.d.ts +6 -3
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/styles.d.ts +6 -8
- package/lib/typescript/components/Select/styles.d.ts.map +1 -1
- package/lib/typescript/components/Stack/styles.d.ts.map +1 -1
- package/lib/typescript/components/Text/index.d.ts +6 -2
- package/lib/typescript/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/components/Text/styles.d.ts.map +1 -1
- package/lib/typescript/styles/index.d.ts +2 -0
- package/lib/typescript/styles/index.d.ts.map +1 -0
- package/lib/typescript/styles/primitives.d.ts +85 -0
- package/lib/typescript/styles/primitives.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/components/Box/Box.tsx +1 -0
- package/src/components/Button/index.tsx +23 -15
- package/src/components/Button/styles.ts +353 -149
- package/src/components/Checkbox/index.tsx +15 -21
- package/src/components/Checkbox/styles.ts +33 -24
- package/src/components/Heading/index.tsx +4 -1
- package/src/components/Heading/styles.tsx +3 -2
- package/src/components/Icon/index.tsx +7 -2
- package/src/components/Input/index.tsx +9 -20
- package/src/components/Input/styles.ts +42 -37
- package/src/components/Link/styles.ts +10 -1
- package/src/components/Select/index.tsx +12 -11
- package/src/components/Select/styles.ts +63 -74
- package/src/components/Stack/styles.ts +2 -14
- package/src/components/Text/index.tsx +2 -1
- package/src/components/Text/styles.tsx +3 -2
- package/src/styles/index.ts +1 -0
- package/src/styles/primitives.ts +107 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,KAAK,SAAS,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,KAAK,SAAS,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAQ,SAAS,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EACL,KAAK,iBAAiB,EAMvB,MAAM,UAAU,CAAC;AAkBlB,MAAM,WAAW,UAAW,SAAQ,SAAS,EAAE,gBAAgB,EAAE,iBAAiB;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,SAAS,6FAgBd,CAAC;AAQF,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6BAA6B,CAAC,EAAE,MAAM,CAAC;CACxC,CAAC;AAEF,QAAA,MAAM,UAAU,uGAoBf,CAAC;AAQF,MAAM,WAAW,cAAe,SAAQ,SAAS,EAAE,eAAe;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,SAAS,iGAUd,CAAC;AAQF,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;CAAG;AAEtE,QAAA,MAAM,SAAS;yCAAwC,cAAc;;CAMpE,CAAC;AAQF,KAAK,sBAAsB,GAAG,OAAO,SAAS,GAAG;IAC/C,KAAK,EAAE,OAAO,UAAU,CAAC;IACzB,IAAI,EAAE,OAAO,SAAS,CAAC;IACvB,IAAI,EAAE,OAAO,SAAS,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,KAAK,EAIZ,sBAAsB,CAAC;AAE7B,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const inputRootVariants: (props?: ({
|
|
3
|
-
variant?: "outline" |
|
|
4
|
-
size?: "
|
|
3
|
+
variant?: "outline" | null | undefined;
|
|
4
|
+
size?: "default" | "small" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const inputFieldVariants: (props?: ({
|
|
7
|
-
size?: "
|
|
8
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
-
export declare const inputSlotVariants: (props?: ({
|
|
10
|
-
size?: "lg" | "md" | "sm" | null | undefined;
|
|
7
|
+
size?: "default" | "small" | null | undefined;
|
|
11
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const inputSlotVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
12
10
|
export declare const inputIconVariants: (props?: ({
|
|
13
|
-
size?: "
|
|
11
|
+
size?: "default" | "small" | null | undefined;
|
|
14
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
13
|
export declare const inputFieldPlaceholderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
16
14
|
export type InputVariantProps = VariantProps<typeof inputRootVariants>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAclE,eAAO,MAAM,iBAAiB;;;8EAmC7B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;8EAkB9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,oFAAmD,CAAC;AAElF,eAAO,MAAM,iBAAiB;;8EAU5B,CAAC;AAEH,eAAO,MAAM,6BAA6B,oFAA4B,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,oFAW3B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { Text, type TextProps, View, type ViewProps } from 'react-native';
|
|
3
3
|
import { type ISelectContentProps, type ISelectItemLabelProps, type ISelectItemProps, type ISelectProps, type ISelectTriggerProps, type ISelectValueProps } from '@cdx-ui/primitives';
|
|
4
|
+
import { IconProps } from '../Icon';
|
|
4
5
|
import { type SelectVariantProps } from './styles';
|
|
5
6
|
export interface SelectProps extends ViewProps, ISelectProps, SelectVariantProps {
|
|
6
7
|
className?: string;
|
|
@@ -15,10 +16,12 @@ export interface SelectValueProps extends TextProps, ISelectValueProps {
|
|
|
15
16
|
className?: string;
|
|
16
17
|
}
|
|
17
18
|
declare const SelectValue: import("react").ForwardRefExoticComponent<SelectValueProps & import("react").RefAttributes<Text>>;
|
|
18
|
-
export interface SelectIconProps extends
|
|
19
|
-
className?: string;
|
|
19
|
+
export interface SelectIconProps extends Omit<IconProps, 'children'> {
|
|
20
20
|
}
|
|
21
|
-
declare const SelectIcon:
|
|
21
|
+
declare const SelectIcon: {
|
|
22
|
+
({ className, style, ...props }: SelectIconProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
22
25
|
export interface SelectContentProps extends ViewProps, ISelectContentProps {
|
|
23
26
|
className?: string;
|
|
24
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAa,IAAI,EAAE,KAAK,SAAS,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAa,IAAI,EAAE,KAAK,SAAS,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAErF,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAQ,SAAS,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EACL,KAAK,kBAAkB,EAOxB,MAAM,UAAU,CAAC;AAsBlB,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,YAAY,EAAE,kBAAkB;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,8FAcf,CAAC;AAQF,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,aAAa,qGAalB,CAAC;AAQF,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,iBAAiB;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,WAAW,mGAMf,CAAC;AAQH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;CAAG;AAEvE,QAAA,MAAM,UAAU;qCAAoC,eAAe;;CAMlE,CAAC;AAQF,MAAM,WAAW,kBAAmB,SAAQ,SAAS,EAAE,mBAAmB;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,aAAa,qGAQlB,CAAC;AAQF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,UAAU,kGAYf,CAAC;AAQF,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,qBAAqB;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,eAAe,uGAUpB,CAAC;AAQF,KAAK,uBAAuB,GAAG,OAAO,UAAU,GAAG;IACjD,OAAO,EAAE,OAAO,aAAa,CAAC;IAC9B,KAAK,EAAE,OAAO,WAAW,CAAC;IAC1B,IAAI,EAAE,OAAO,UAAU,CAAC;IACxB,OAAO,EAAE,OAAO,aAAa,CAAC;IAC9B,IAAI,EAAE,OAAO,UAAU,CAAC;IACxB,SAAS,EAAE,OAAO,eAAe,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,MAAM,EAOb,uBAAuB,CAAC;AAE9B,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const selectTriggerVariants: (props?: ({
|
|
3
|
-
variant?: "outline" |
|
|
4
|
-
size?: "
|
|
3
|
+
variant?: "outline" | null | undefined;
|
|
4
|
+
size?: "default" | "small" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const selectValueVariants: (props?: ({
|
|
7
|
-
|
|
8
|
-
size?: "lg" | "md" | "sm" | null | undefined;
|
|
7
|
+
size?: "default" | "small" | null | undefined;
|
|
9
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
9
|
export declare const selectIconVariants: (props?: ({
|
|
11
|
-
|
|
12
|
-
size?: "lg" | "md" | "sm" | null | undefined;
|
|
10
|
+
size?: "default" | "small" | null | undefined;
|
|
13
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
12
|
export declare const selectContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
15
13
|
export declare const selectItemVariants: (props?: ({
|
|
16
|
-
size?: "
|
|
14
|
+
size?: "default" | "small" | null | undefined;
|
|
17
15
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
16
|
export declare const selectItemLabelVariants: (props?: ({
|
|
19
|
-
size?: "
|
|
17
|
+
size?: "default" | "small" | null | undefined;
|
|
20
18
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
21
19
|
export type SelectVariantProps = VariantProps<typeof selectTriggerVariants>;
|
|
22
20
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAkBlE,eAAO,MAAM,qBAAqB;;;8EAsCjC,CAAC;AAIF,eAAO,MAAM,mBAAmB;;8EAkB/B,CAAC;AAIF,eAAO,MAAM,kBAAkB;;8EAa9B,CAAC;AAIF,eAAO,MAAM,qBAAqB,oFAWhC,CAAC;AAIH,eAAO,MAAM,kBAAkB;;8EAsB9B,CAAC;AAIF,eAAO,MAAM,uBAAuB;;8EAanC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/styles.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAU1D,eAAO,MAAM,kBAAkB;;;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/styles.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAU1D,eAAO,MAAM,kBAAkB;;;8EAW7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;8EAW7B,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { Text as RNText } from 'react-native';
|
|
3
3
|
import { TextVariantProps } from './styles';
|
|
4
|
-
export type TextProps = TextVariantProps & ComponentPropsWithoutRef<typeof RNText
|
|
5
|
-
|
|
4
|
+
export type TextProps = TextVariantProps & ComponentPropsWithoutRef<typeof RNText> & {
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const Text: import("react").ForwardRefExoticComponent<TextVariantProps & import("react-native").TextProps & {
|
|
8
|
+
className?: string;
|
|
9
|
+
} & import("react").RefAttributes<RNText>>;
|
|
6
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAqB,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAa,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAqB,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAa,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG,gBAAgB,GACtC,wBAAwB,CAAC,OAAO,MAAM,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,eAAO,MAAM,IAAI;gBAFyC,MAAM;0CAO9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Text/styles.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Text/styles.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,eAAO,MAAM,SAAS;;8EAmBrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export declare const COLOR_BG_PRIMARY = "bg-white";
|
|
2
|
+
export declare const COLOR_BG_SUBTLE = "bg-slate-50";
|
|
3
|
+
export declare const COLOR_BG_MUTED = "bg-slate-100";
|
|
4
|
+
export declare const COLOR_BG_INVERSE = "bg-slate-900";
|
|
5
|
+
export declare const COLOR_BORDER_DEFAULT = "border-slate-200";
|
|
6
|
+
export declare const COLOR_BORDER_STRONG = "border-slate-300";
|
|
7
|
+
export declare const COLOR_BORDER_FOCUS = "border-slate-900";
|
|
8
|
+
export declare const COLOR_BORDER_INVALID = "border-red-500";
|
|
9
|
+
export declare const COLOR_TEXT_PRIMARY = "text-slate-900";
|
|
10
|
+
export declare const COLOR_TEXT_SECONDARY = "text-slate-500";
|
|
11
|
+
export declare const COLOR_TEXT_MUTED = "text-slate-400";
|
|
12
|
+
export declare const COLOR_TEXT_INVERSE = "text-white";
|
|
13
|
+
export declare const COLOR_TEXT_PLACEHOLDER = "text-slate-400";
|
|
14
|
+
export declare const COLOR_TEXT_INVALID = "text-red-600";
|
|
15
|
+
export declare const COLOR_BRAND_DEFAULT = "bg-slate-900";
|
|
16
|
+
export declare const COLOR_BRAND_HOVER = "bg-slate-800";
|
|
17
|
+
export declare const COLOR_BRAND_ACTIVE = "bg-slate-700";
|
|
18
|
+
export declare const COLOR_ACCENT_DEFAULT = "bg-slate-900";
|
|
19
|
+
export declare const COLOR_ACCENT_BORDER = "border-slate-900";
|
|
20
|
+
export declare const SEMANTIC_COLORS: {
|
|
21
|
+
readonly action: {
|
|
22
|
+
readonly bg: "bg-slate-900";
|
|
23
|
+
readonly bgHover: "bg-slate-800";
|
|
24
|
+
readonly bgActive: "bg-slate-700";
|
|
25
|
+
readonly border: "border-slate-900";
|
|
26
|
+
readonly text: "text-slate-900";
|
|
27
|
+
readonly ring: "ring-slate-400/50";
|
|
28
|
+
};
|
|
29
|
+
readonly danger: {
|
|
30
|
+
readonly bg: "bg-red-600";
|
|
31
|
+
readonly bgHover: "bg-red-700";
|
|
32
|
+
readonly bgActive: "bg-red-800";
|
|
33
|
+
readonly border: "border-red-600";
|
|
34
|
+
readonly text: "text-red-600";
|
|
35
|
+
readonly ring: "ring-red-400/50";
|
|
36
|
+
};
|
|
37
|
+
readonly warning: {
|
|
38
|
+
readonly bg: "bg-amber-500";
|
|
39
|
+
readonly bgHover: "bg-amber-600";
|
|
40
|
+
readonly bgActive: "bg-amber-700";
|
|
41
|
+
readonly border: "border-amber-500";
|
|
42
|
+
readonly text: "text-amber-600";
|
|
43
|
+
readonly ring: "ring-amber-400/50";
|
|
44
|
+
};
|
|
45
|
+
readonly success: {
|
|
46
|
+
readonly bg: "bg-green-600";
|
|
47
|
+
readonly bgHover: "bg-green-700";
|
|
48
|
+
readonly bgActive: "bg-green-800";
|
|
49
|
+
readonly border: "border-green-600";
|
|
50
|
+
readonly text: "text-green-600";
|
|
51
|
+
readonly ring: "ring-green-400/50";
|
|
52
|
+
};
|
|
53
|
+
readonly info: {
|
|
54
|
+
readonly bg: "bg-sky-500";
|
|
55
|
+
readonly bgHover: "bg-sky-600";
|
|
56
|
+
readonly bgActive: "bg-sky-700";
|
|
57
|
+
readonly border: "border-sky-500";
|
|
58
|
+
readonly text: "text-sky-600";
|
|
59
|
+
readonly ring: "ring-sky-400/50";
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const FOCUS_RING = "ring-2 ring-slate-400/50 ring-offset-2";
|
|
63
|
+
export declare const RADIUS_SM = "rounded-lg";
|
|
64
|
+
export declare const RADIUS_MD = "rounded-xl";
|
|
65
|
+
export declare const RADIUS_FULL = "rounded-full";
|
|
66
|
+
export declare const SHADOW_SM = "shadow-sm";
|
|
67
|
+
export declare const SHADOW_MD = "shadow-md";
|
|
68
|
+
export declare const SIZE_SCALE: {
|
|
69
|
+
readonly default: {
|
|
70
|
+
readonly height: "h-10";
|
|
71
|
+
readonly px: "px-4";
|
|
72
|
+
readonly gap: "gap-2";
|
|
73
|
+
readonly text: "text-base";
|
|
74
|
+
};
|
|
75
|
+
readonly small: {
|
|
76
|
+
readonly height: "h-8";
|
|
77
|
+
readonly px: "px-3";
|
|
78
|
+
readonly gap: "gap-1.5";
|
|
79
|
+
readonly text: "text-sm";
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export declare const TRANSITION_COLORS = "transition-colors duration-150";
|
|
83
|
+
export declare const DISABLED_OPACITY = "data-[disabled=true]:opacity-50";
|
|
84
|
+
export declare const DISABLED_CURSOR = "data-[disabled=true]:cursor-not-allowed data-[disabled=true]:pointer-events-none";
|
|
85
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../src/styles/primitives.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAC3C,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAC7C,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAG/C,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AACtD,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AACrD,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AAGrD,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AACnD,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AACjD,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAC/C,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAGjD,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAChD,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAGjD,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AACnD,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAItD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyClB,CAAC;AAGX,eAAO,MAAM,UAAU,2CAA2C,CAAC;AAGnE,eAAO,MAAM,SAAS,eAAe,CAAC;AACtC,eAAO,MAAM,SAAS,eAAe,CAAC;AACtC,eAAO,MAAM,WAAW,iBAAiB,CAAC;AAG1C,eAAO,MAAM,SAAS,cAAc,CAAC;AACrC,eAAO,MAAM,SAAS,cAAc,CAAC;AAMrC,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAGb,CAAC;AAGX,eAAO,MAAM,iBAAiB,mCAAmC,CAAC;AAGlE,eAAO,MAAM,gBAAgB,oCAAoC,CAAC;AAClE,eAAO,MAAM,eAAe,qFACwD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.16",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"class-variance-authority": "^0.7.1",
|
|
62
62
|
"uniwind": "1.4.1",
|
|
63
|
-
"@cdx-ui/
|
|
64
|
-
"@cdx-ui/
|
|
65
|
-
"@cdx-ui/icons": "0.0.1-alpha.
|
|
63
|
+
"@cdx-ui/utils": "0.0.1-alpha.16",
|
|
64
|
+
"@cdx-ui/primitives": "0.0.1-alpha.16",
|
|
65
|
+
"@cdx-ui/icons": "0.0.1-alpha.16"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/react": "*",
|
|
@@ -8,6 +8,7 @@ export interface BoxProps extends ViewProps {
|
|
|
8
8
|
textProps?: TextProps;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
/** @deprecated Use View instead */
|
|
11
12
|
export const Box = forwardRef<View, BoxProps>(
|
|
12
13
|
({ style, className, children, textProps, ...restProps }, ref: ForwardedRef<View>) => {
|
|
13
14
|
return (
|
|
@@ -11,10 +11,12 @@ import {
|
|
|
11
11
|
} from 'react-native';
|
|
12
12
|
import { createButton, type IButtonProps } from '@cdx-ui/primitives';
|
|
13
13
|
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
14
|
+
import { Icon, IconProps } from '../Icon';
|
|
14
15
|
import {
|
|
15
16
|
type ButtonGroupVariantProps,
|
|
16
17
|
type ButtonVariantProps,
|
|
17
18
|
buttonGroupVariants,
|
|
19
|
+
buttonIconVariants,
|
|
18
20
|
buttonRootVariants,
|
|
19
21
|
buttonSpinnerVariants,
|
|
20
22
|
buttonTextVariants,
|
|
@@ -46,9 +48,10 @@ export interface ButtonProps extends PressableProps, IButtonProps, ButtonVariant
|
|
|
46
48
|
const ButtonRoot = forwardRef<View, ButtonProps>(
|
|
47
49
|
(
|
|
48
50
|
{
|
|
49
|
-
variant = '
|
|
50
|
-
color = '
|
|
51
|
-
size = '
|
|
51
|
+
variant = 'strong',
|
|
52
|
+
color = 'action',
|
|
53
|
+
size = 'default',
|
|
54
|
+
mode = 'light',
|
|
52
55
|
fullWidth = false,
|
|
53
56
|
className,
|
|
54
57
|
children,
|
|
@@ -58,7 +61,7 @@ const ButtonRoot = forwardRef<View, ButtonProps>(
|
|
|
58
61
|
ref,
|
|
59
62
|
) => {
|
|
60
63
|
const computedClassName = cn(
|
|
61
|
-
buttonRootVariants({ variant, color, size, fullWidth }),
|
|
64
|
+
buttonRootVariants({ variant, color, size, mode, fullWidth }),
|
|
62
65
|
className,
|
|
63
66
|
);
|
|
64
67
|
|
|
@@ -67,7 +70,7 @@ const ButtonRoot = forwardRef<View, ButtonProps>(
|
|
|
67
70
|
ref={ref}
|
|
68
71
|
className={computedClassName}
|
|
69
72
|
style={style}
|
|
70
|
-
context={{ variant, color, size, fullWidth }}
|
|
73
|
+
context={{ variant, color, size, mode, fullWidth }}
|
|
71
74
|
{...props}
|
|
72
75
|
>
|
|
73
76
|
{children}
|
|
@@ -89,9 +92,9 @@ export interface ButtonTextProps extends TextProps {
|
|
|
89
92
|
|
|
90
93
|
const ButtonLabel = forwardRef<Text, ButtonTextProps>(
|
|
91
94
|
({ className, children, style, ...props }, ref) => {
|
|
92
|
-
const { variant, color, size } = useButtonStyleContext();
|
|
95
|
+
const { variant, color, size, mode } = useButtonStyleContext();
|
|
93
96
|
|
|
94
|
-
const computedClassName = cn(buttonTextVariants({ variant, color, size }), className);
|
|
97
|
+
const computedClassName = cn(buttonTextVariants({ variant, color, size, mode }), className);
|
|
95
98
|
|
|
96
99
|
return (
|
|
97
100
|
<ButtonPrimitive.Text ref={ref} className={computedClassName} style={style} {...props}>
|
|
@@ -135,13 +138,15 @@ const ButtonGroup = forwardRef<View, ButtonGroupProps>(
|
|
|
135
138
|
|
|
136
139
|
ButtonGroup.displayName = 'Button.Group';
|
|
137
140
|
|
|
138
|
-
export interface ButtonIconProps extends
|
|
139
|
-
className?: string;
|
|
140
|
-
}
|
|
141
|
+
export interface ButtonIconProps extends Omit<IconProps, 'children'> {}
|
|
141
142
|
|
|
142
|
-
const ButtonIcon =
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
const ButtonIcon = ({ className, style, as, ...props }: ButtonIconProps) => {
|
|
144
|
+
const { size } = useButtonStyleContext();
|
|
145
|
+
|
|
146
|
+
const computedClassName = cn(buttonIconVariants({ size }), className);
|
|
147
|
+
|
|
148
|
+
return <Icon as={as} className={computedClassName} style={style} {...props} />;
|
|
149
|
+
};
|
|
145
150
|
|
|
146
151
|
ButtonIcon.displayName = 'Button.Icon';
|
|
147
152
|
|
|
@@ -152,8 +157,11 @@ export interface ButtonSpinnerProps extends ActivityIndicatorProps {
|
|
|
152
157
|
|
|
153
158
|
const ButtonSpinner = forwardRef<ActivityIndicator, ButtonSpinnerProps>(
|
|
154
159
|
({ className, colorClassName, style, ...props }, ref) => {
|
|
155
|
-
const { variant, color } = useButtonStyleContext();
|
|
156
|
-
const computedColorClassName = cn(
|
|
160
|
+
const { variant, color, mode } = useButtonStyleContext();
|
|
161
|
+
const computedColorClassName = cn(
|
|
162
|
+
buttonSpinnerVariants({ variant, color, mode }),
|
|
163
|
+
colorClassName,
|
|
164
|
+
);
|
|
157
165
|
|
|
158
166
|
return (
|
|
159
167
|
<ButtonPrimitive.Spinner
|