onecart-ui-components 0.1.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/dist/Button/Button.mobile.d.ts +4 -0
- package/dist/Button/Button.types.d.ts +43 -0
- package/dist/Button/Button.web.d.ts +4 -0
- package/dist/Button/buttonStyles.d.ts +12 -0
- package/dist/Button/index.d.ts +1 -0
- package/dist/Button/index.mobile.d.ts +1 -0
- package/dist/Typography/Body/index.d.ts +3 -0
- package/dist/Typography/Display/index.d.ts +3 -0
- package/dist/Typography/Heading/index.d.ts +3 -0
- package/dist/Typography/Utility/index.d.ts +3 -0
- package/dist/Typography/index.d.ts +4 -0
- package/dist/components/Button.d.ts +1 -0
- package/dist/components/Icon.d.ts +10 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2057 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mobile.js +1803 -0
- package/dist/index.mobile.js.map +1 -0
- package/dist/mobile/index.d.ts +2 -0
- package/dist/src/Button/Button.mobile.d.ts +4 -0
- package/dist/src/Button/Button.types.d.ts +43 -0
- package/dist/src/Button/Button.web.d.ts +4 -0
- package/dist/src/Button/buttonStyles.d.ts +12 -0
- package/dist/src/Button/index.d.ts +2 -0
- package/dist/src/Button/index.mobile.d.ts +2 -0
- package/dist/src/Typography/Body/Body.mobile.d.ts +3 -0
- package/dist/src/Typography/Body/Body.web.d.ts +3 -0
- package/dist/src/Typography/Body/index.d.ts +1 -0
- package/dist/src/Typography/Body/index.mobile.d.ts +1 -0
- package/dist/src/Typography/Display/Display.mobile.d.ts +3 -0
- package/dist/src/Typography/Display/Display.web.d.ts +3 -0
- package/dist/src/Typography/Display/index.d.ts +1 -0
- package/dist/src/Typography/Display/index.mobile.d.ts +1 -0
- package/dist/src/Typography/Heading/Heading.mobile.d.ts +3 -0
- package/dist/src/Typography/Heading/Heading.web.d.ts +3 -0
- package/dist/src/Typography/Heading/index.d.ts +1 -0
- package/dist/src/Typography/Heading/index.mobile.d.ts +1 -0
- package/dist/src/Typography/Typography.types.d.ts +51 -0
- package/dist/src/Typography/Utility/Utility.mobile.d.ts +3 -0
- package/dist/src/Typography/Utility/Utility.web.d.ts +3 -0
- package/dist/src/Typography/Utility/index.d.ts +1 -0
- package/dist/src/Typography/Utility/index.mobile.d.ts +1 -0
- package/dist/src/Typography/index.d.ts +5 -0
- package/dist/src/Typography/index.mobile.d.ts +5 -0
- package/dist/src/components/Button.d.ts +1 -0
- package/dist/src/components/Icon.d.ts +10 -0
- package/dist/src/components/index.d.ts +4 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/styles/tokens/typography.d.ts +138 -0
- package/dist/src/theme/ThemeProvider.d.ts +5 -0
- package/dist/src/tokens/design-tokens.d.ts +54 -0
- package/dist/styles/tokens/typography.d.ts +138 -0
- package/dist/theme/ThemeProvider.d.ts +5 -0
- package/dist/tokens/design-tokens.d.ts +54 -0
- package/dist/types/Button.d.ts +24 -0
- package/dist/types/Typography.d.ts +32 -0
- package/package.json +56 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type ButtonType = "primary" | "outline" | "ghost" | "destructive";
|
|
2
|
+
export type ButtonSize = "large" | "small" | "medium";
|
|
3
|
+
export type ButtonState = "default" | "hover" | "active" | "disabled";
|
|
4
|
+
export interface ButtonProps {
|
|
5
|
+
/** Visible text label (also used as accessible name fallback). */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Visual variant; defaults to `primary`. */
|
|
8
|
+
type?: ButtonType;
|
|
9
|
+
/** Size scale; defaults to `large`. */
|
|
10
|
+
size?: ButtonSize;
|
|
11
|
+
/** Disables interaction and applies disabled styling. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Icon name rendered to the left of label (ignored if `icon` provided). */
|
|
14
|
+
leftIcon?: string;
|
|
15
|
+
/** Icon name rendered to the right of label (ignored if `icon` provided). */
|
|
16
|
+
rightIcon?: string;
|
|
17
|
+
/** Single icon (icon‑only button); when set, label text is visually hidden. */
|
|
18
|
+
icon?: string;
|
|
19
|
+
/** Stretches button to width:100%. */
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
/** Underlines text for `ghost` variant when not disabled (default true). */
|
|
22
|
+
ghostUnderline?: boolean;
|
|
23
|
+
/** Explicit accessible label (overrides fallback to `label`). */
|
|
24
|
+
accessibilityLabel?: string;
|
|
25
|
+
/** Test identifier (data-testid on web). */
|
|
26
|
+
testID?: string;
|
|
27
|
+
/** Additional CSS class name for web implementation only. */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Style override: React.CSSProperties (web) or RN style object (mobile). */
|
|
30
|
+
style?: React.CSSProperties | Record<string, unknown>;
|
|
31
|
+
/** Web click handler; executes alongside `onPress` if both supplied. */
|
|
32
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
33
|
+
/** Platform‑agnostic press handler (used by mobile; also invoked on web clicks). */
|
|
34
|
+
onPress?: () => void;
|
|
35
|
+
/** Mouse enter hook (web only). */
|
|
36
|
+
onMouseEnter?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
37
|
+
/** Mouse leave hook (web only). */
|
|
38
|
+
onMouseLeave?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
39
|
+
/** Mouse down hook (web only). */
|
|
40
|
+
onMouseDown?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
41
|
+
/** Mouse up hook (web only). */
|
|
42
|
+
onMouseUp?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
43
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ButtonState, ButtonType, ButtonSize } from "./Button.types";
|
|
2
|
+
import type { ViewStyle, TextStyle } from "react-native";
|
|
3
|
+
export interface ComputedButtonStyles {
|
|
4
|
+
base: React.CSSProperties;
|
|
5
|
+
text: React.CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
export declare const computeWebButtonStyles: (type: ButtonType, state: ButtonState, size: ButtonSize, isIconOnly: boolean, fullWidth: boolean, hasBothIcons: boolean, overrides?: Partial<React.CSSProperties>) => ComputedButtonStyles;
|
|
8
|
+
export interface MobileButtonStyles {
|
|
9
|
+
container: ViewStyle;
|
|
10
|
+
label: TextStyle;
|
|
11
|
+
}
|
|
12
|
+
export declare const computeMobileButtonStyles: (type: ButtonType, state: ButtonState, size: ButtonSize, overrides?: Partial<ViewStyle>) => MobileButtonStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Button.web";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Button.mobile";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from "../Button/Button.web";
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Button";
|