@campxdev/react-native-blueprint 0.1.1 → 0.1.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.
- package/lib/module/app/_layout.js +1 -1
- package/lib/module/app/_layout.js.map +1 -1
- package/lib/module/components/ui/index.js +1 -0
- package/lib/module/components/ui/index.js.map +1 -1
- package/lib/module/global.css +417 -0
- package/lib/module/types/global.d.js +6 -0
- package/lib/module/types/global.d.js.map +1 -0
- package/lib/module/types/rn-primitives.d.js +6 -0
- package/lib/module/types/rn-primitives.d.js.map +1 -0
- package/lib/typescript/src/app/_layout.d.ts +7 -8
- package/lib/typescript/src/components/ui/Accordion.d.ts +103 -11
- package/lib/typescript/src/components/ui/Alert-Dialog.d.ts +167 -10
- package/lib/typescript/src/components/ui/Alert-Dialog.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Alert.d.ts +59 -10
- package/lib/typescript/src/components/ui/Avatar.d.ts +1350 -10
- package/lib/typescript/src/components/ui/Badge.d.ts +203 -10
- package/lib/typescript/src/components/ui/Bottom-Sheet.d.ts +43 -11
- package/lib/typescript/src/components/ui/Button.d.ts +175 -10
- package/lib/typescript/src/components/ui/Card.d.ts +853 -10
- package/lib/typescript/src/components/ui/Checkbox.d.ts +36 -11
- package/lib/typescript/src/components/ui/Collapsible.d.ts +1 -147
- package/lib/typescript/src/components/ui/Collapsible.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Context-Menu.d.ts +149 -10
- package/lib/typescript/src/components/ui/Context-Menu.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Custom-Card.d.ts +863 -10
- package/lib/typescript/src/components/ui/Dialog.d.ts +125 -10
- package/lib/typescript/src/components/ui/Dialog.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Dropdown-Menu.d.ts +283 -10
- package/lib/typescript/src/components/ui/Dropdown-Menu.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Greeting-Card.d.ts +152 -10
- package/lib/typescript/src/components/ui/Hover-Card.d.ts +67 -10
- package/lib/typescript/src/components/ui/Hover-Card.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Icon.d.ts +43 -11
- package/lib/typescript/src/components/ui/Input.d.ts +51 -10
- package/lib/typescript/src/components/ui/Label.d.ts +104 -10
- package/lib/typescript/src/components/ui/Menubar.d.ts +174 -10
- package/lib/typescript/src/components/ui/NavBar.d.ts +271 -9
- package/lib/typescript/src/components/ui/Popover.d.ts +70 -10
- package/lib/typescript/src/components/ui/Popover.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/Progress.d.ts +27 -11
- package/lib/typescript/src/components/ui/Radio-Group.d.ts +47 -11
- package/lib/typescript/src/components/ui/Select.d.ts +106 -10
- package/lib/typescript/src/components/ui/Separator.d.ts +165 -10
- package/lib/typescript/src/components/ui/Skeleton.d.ts +40 -11
- package/lib/typescript/src/components/ui/Slider.d.ts +52 -8
- package/lib/typescript/src/components/ui/Switch.d.ts +34 -11
- package/lib/typescript/src/components/ui/Table.d.ts +69 -10
- package/lib/typescript/src/components/ui/Tabs.d.ts +51 -11
- package/lib/typescript/src/components/ui/Text.d.ts +115 -10
- package/lib/typescript/src/components/ui/Textarea.d.ts +60 -10
- package/lib/typescript/src/components/ui/Theme-Toggle.d.ts +193 -10
- package/lib/typescript/src/components/ui/Toast.d.ts +54 -10
- package/lib/typescript/src/components/ui/Toggle-Group.d.ts +48 -10
- package/lib/typescript/src/components/ui/Toggle.d.ts +52 -10
- package/lib/typescript/src/components/ui/Tooltip.d.ts +70 -10
- package/lib/typescript/src/components/ui/Tooltip.d.ts.map +1 -1
- package/lib/typescript/src/components/ui/index.d.ts +7 -2
- package/lib/typescript/src/components/ui/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +7 -93
- package/lib/typescript/src/lib/ThemeProvider.d.ts +136 -13
- package/lib/typescript/src/lib/cornerRadius.d.ts +112 -21
- package/lib/typescript/src/lib/fonts.d.ts +21 -30
- package/lib/typescript/src/lib/theme.d.ts +86 -8
- package/lib/typescript/src/lib/utils.d.ts +111 -1
- package/package.json +2 -9
- package/src/app/_layout.tsx +1 -1
- package/src/components/ui/index.ts +1 -0
- package/src/global.css +417 -0
- package/src/types/global.d.ts +44 -0
- package/src/types/rn-primitives.d.ts +70 -0
- package/lib/typescript/babel.config.d.ts +0 -13
- package/lib/typescript/babel.config.d.ts.map +0 -1
- package/lib/typescript/metro.config.d.ts +0 -3
- package/lib/typescript/metro.config.d.ts.map +0 -1
- package/lib/typescript/src/components/ui/Floating-Action-Button.d.ts +0 -11
- package/lib/typescript/src/components/ui.d.ts +0 -49
- package/lib/typescript/tailwind.config.d.ts +0 -3
- package/lib/typescript/tailwind.config.d.ts.map +0 -1
|
@@ -1,11 +1,53 @@
|
|
|
1
|
+
import { Icon } from './Icon';
|
|
2
|
+
import * as TogglePrimitive from '@rn-primitives/toggle';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
1
4
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Toggle button style variants using class-variance-authority
|
|
7
|
+
*
|
|
8
|
+
* @variant default - Standard toggle with transparent background
|
|
9
|
+
* @variant outline - Toggle with border and background
|
|
10
|
+
*
|
|
11
|
+
* @size default - Standard size (40px/36px)
|
|
12
|
+
* @size sm - Small size (36px/32px)
|
|
13
|
+
* @size lg - Large size (44px/40px)
|
|
14
|
+
*/
|
|
15
|
+
declare const toggleVariants: (props?: {
|
|
16
|
+
variant?: "default" | "outline";
|
|
17
|
+
size?: "default" | "sm" | "lg";
|
|
18
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Toggle button component for on/off states
|
|
21
|
+
*
|
|
22
|
+
* A two-state button that can be toggled between pressed and unpressed states.
|
|
23
|
+
* Supports multiple variants and sizes.
|
|
24
|
+
*
|
|
25
|
+
* @component
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <Toggle pressed={isBold} onPressedChange={setIsBold}>
|
|
29
|
+
* <ToggleIcon as={Bold} />
|
|
30
|
+
* <Text>Bold</Text>
|
|
31
|
+
* </Toggle>
|
|
32
|
+
*
|
|
33
|
+
* <Toggle variant="outline" size="sm">
|
|
34
|
+
* <ToggleIcon as={Italic} />
|
|
35
|
+
* </Toggle>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @accessibility
|
|
39
|
+
* - Uses proper ARIA pressed state
|
|
40
|
+
* - Disabled state prevents interaction
|
|
41
|
+
* - Focus visible states on web
|
|
42
|
+
*/
|
|
43
|
+
declare function Toggle({ className, variant, size, ...props }: TogglePrimitive.RootProps & VariantProps<typeof toggleVariants> & React.RefAttributes<TogglePrimitive.RootRef>): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Icon component for use within Toggle buttons
|
|
46
|
+
*
|
|
47
|
+
* Automatically inherits text styling from the toggle context.
|
|
48
|
+
*
|
|
49
|
+
* @component
|
|
50
|
+
*/
|
|
51
|
+
declare function ToggleIcon({ className, ...props }: React.ComponentProps<typeof Icon>): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export { Toggle, ToggleIcon, toggleVariants };
|
|
53
|
+
//# sourceMappingURL=Toggle.d.ts.map
|
|
@@ -1,11 +1,71 @@
|
|
|
1
|
+
import * as TooltipPrimitive from '@rn-primitives/tooltip';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Root tooltip component - provides context for trigger and content
|
|
5
|
+
*
|
|
6
|
+
* @component
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <Tooltip>
|
|
10
|
+
* <TooltipTrigger>
|
|
11
|
+
* <Button variant="outline">
|
|
12
|
+
* <Text>Hover me</Text>
|
|
13
|
+
* </Button>
|
|
14
|
+
* </TooltipTrigger>
|
|
15
|
+
* <TooltipContent>
|
|
16
|
+
* <Text>Helpful tooltip text</Text>
|
|
17
|
+
* </TooltipContent>
|
|
18
|
+
* </Tooltip>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const Tooltip: React.ForwardRefExoticComponent<import("react-native").ViewProps & {
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
} & {
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
delayDuration?: number;
|
|
26
|
+
skipDelayDuration?: number;
|
|
27
|
+
disableHoverableContent?: boolean;
|
|
28
|
+
} & React.RefAttributes<(props: Omit<import("react-native/types_generated/Libraries/Components/View/ViewPropTypes").ViewProps, keyof {
|
|
29
|
+
ref?: React.Ref<React.ComponentRef<typeof import("react-native/types_generated/Libraries/Components/View/ViewNativeComponent").default>>;
|
|
30
|
+
}> & {
|
|
31
|
+
ref?: React.Ref<React.ComponentRef<typeof import("react-native/types_generated/Libraries/Components/View/ViewNativeComponent").default>>;
|
|
32
|
+
}) => React.ReactNode>>;
|
|
33
|
+
/**
|
|
34
|
+
* Trigger component that shows tooltip on hover/press
|
|
35
|
+
*
|
|
36
|
+
* @component
|
|
37
|
+
*/
|
|
38
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<import("react-native").PressableProps & React.RefAttributes<(props: Omit<import("react-native/types_generated/Libraries/Components/View/ViewPropTypes").ViewProps, keyof {
|
|
39
|
+
ref?: React.Ref<React.ComponentRef<typeof import("react-native/types_generated/Libraries/Components/View/ViewNativeComponent").default>>;
|
|
40
|
+
}> & {
|
|
41
|
+
ref?: React.Ref<React.ComponentRef<typeof import("react-native/types_generated/Libraries/Components/View/ViewNativeComponent").default>>;
|
|
42
|
+
}) => React.ReactNode>, "ref"> & {
|
|
43
|
+
asChild?: boolean;
|
|
44
|
+
} & {
|
|
45
|
+
onKeyDown?: (ev: React.KeyboardEvent) => void;
|
|
46
|
+
onKeyUp?: (ev: React.KeyboardEvent) => void;
|
|
47
|
+
} & React.RefAttributes<import("@rn-primitives/tooltip").TriggerRef>>;
|
|
48
|
+
/**
|
|
49
|
+
* Tooltip content component
|
|
50
|
+
*
|
|
51
|
+
* Displays helpful text in a small popup when hovering or pressing the trigger.
|
|
52
|
+
* Includes directional animations based on positioning.
|
|
53
|
+
*
|
|
54
|
+
* @component
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* <TooltipContent side="top" sideOffset={8}>
|
|
58
|
+
* <Text>Add to favorites</Text>
|
|
59
|
+
* </TooltipContent>
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @accessibility
|
|
63
|
+
* - Content is announced by screen readers
|
|
64
|
+
* - Proper ARIA attributes for tooltips
|
|
65
|
+
* - Dismissible on escape key (web)
|
|
66
|
+
*/
|
|
67
|
+
declare function TooltipContent({ className, sideOffset, portalHost, side, ...props }: TooltipPrimitive.ContentProps & React.RefAttributes<TooltipPrimitive.ContentRef> & {
|
|
68
|
+
portalHost?: string;
|
|
69
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
export { Tooltip, TooltipContent, TooltipTrigger };
|
|
71
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/Tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,OAAO;;;;;;;;OAAD,CAAC;;OAG8B,CAAA;uBAHN,CAAC;AAEtC;;;;GAIG;AACH,QAAA,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/Tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,OAAO;;;;;;;;OAAD,CAAC;;OAG8B,CAAA;uBAHN,CAAC;AAEtC;;;;GAIG;AACH,QAAA,MAAM,cAAc;OAPR,CAAC;;OAG8B,CAAA;;;;;;qEAII,CAAC;AAQhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,UAAc,EACd,UAAU,EACV,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,gBAAgB,CAAC,YAAY,GAC9B,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,2CA4CF;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
// Re-export all UI components
|
|
2
1
|
export * from './Accordion';
|
|
3
2
|
export * from './Alert';
|
|
4
3
|
export * from './Alert-Dialog';
|
|
4
|
+
export * from './AppBar';
|
|
5
|
+
export * from './Aspect-Ratio';
|
|
5
6
|
export * from './Avatar';
|
|
6
7
|
export * from './Badge';
|
|
7
8
|
export * from './Bottom-Sheet';
|
|
8
9
|
export * from './Button';
|
|
9
10
|
export * from './Card';
|
|
10
11
|
export * from './Checkbox';
|
|
12
|
+
export * from './Collapsible';
|
|
11
13
|
export * from './Context-Menu';
|
|
12
14
|
export * from './Custom-Card';
|
|
13
15
|
export * from './Dialog';
|
|
14
16
|
export * from './Dropdown-Menu';
|
|
15
|
-
export * from './Floating-Action
|
|
17
|
+
export * from './Floating-Action';
|
|
16
18
|
export * from './Greeting-Card';
|
|
17
19
|
export * from './Hover-Card';
|
|
18
20
|
export * from './Icon';
|
|
19
21
|
export * from './Input';
|
|
20
22
|
export * from './Label';
|
|
21
23
|
export * from './Menubar';
|
|
24
|
+
export * from './Native-Only-Animated-View';
|
|
22
25
|
export * from './NavBar';
|
|
23
26
|
export * from './Popover';
|
|
24
27
|
export * from './Progress';
|
|
25
28
|
export * from './Radio-Group';
|
|
26
29
|
export * from './Select';
|
|
27
30
|
export * from './Separator';
|
|
31
|
+
export * from './SizedBox';
|
|
28
32
|
export * from './Skeleton';
|
|
29
33
|
export * from './Slider';
|
|
30
34
|
export * from './Switch';
|
|
@@ -37,3 +41,4 @@ export * from './Toast';
|
|
|
37
41
|
export * from './Toggle';
|
|
38
42
|
export * from './Toggle-Group';
|
|
39
43
|
export * from './Tooltip';
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
|
|
@@ -1,95 +1,9 @@
|
|
|
1
|
-
// Type definitions for @campxdev/react-native-blueprint
|
|
2
|
-
// Project: https://github.com/campx-org/react-native-blueprint
|
|
3
|
-
// Definitions by: CAMPX <https://github.com/Sri-Satya-M>
|
|
4
|
-
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { ViewProps, TextProps, TouchableOpacityProps } from 'react-native';
|
|
7
|
-
|
|
8
|
-
// Re-export all UI components
|
|
9
1
|
export * from './components/ui';
|
|
10
|
-
|
|
11
|
-
// Root Layout
|
|
12
2
|
export { default as RootLayout } from './app/_layout';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
dark: Record<string, string>;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const NAV_THEME: {
|
|
24
|
-
light: Record<string, string>;
|
|
25
|
-
dark: Record<string, string>;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
// Theme Provider
|
|
29
|
-
export interface ThemeContextType {
|
|
30
|
-
colorScheme: 'light' | 'dark';
|
|
31
|
-
setColorScheme: (colorScheme: 'light' | 'dark') => void;
|
|
32
|
-
toggleColorScheme: () => void;
|
|
33
|
-
isDarkColorScheme: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function ThemeProvider(props: {
|
|
37
|
-
children: React.ReactNode;
|
|
38
|
-
}): React.ReactElement;
|
|
39
|
-
|
|
40
|
-
export function useTheme(): ThemeContextType;
|
|
41
|
-
|
|
42
|
-
// Corner Radius
|
|
43
|
-
export interface RadiusPreset {
|
|
44
|
-
topLeft: number;
|
|
45
|
-
topRight: number;
|
|
46
|
-
bottomLeft: number;
|
|
47
|
-
bottomRight: number;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function getRadiusForHeight(height: number, preset?: string): RadiusPreset;
|
|
51
|
-
export function getRadiusForDimensions(
|
|
52
|
-
width: number,
|
|
53
|
-
height: number,
|
|
54
|
-
preset?: string
|
|
55
|
-
): RadiusPreset;
|
|
56
|
-
export function getCustomRadius(
|
|
57
|
-
size: number,
|
|
58
|
-
config?: Partial<RadiusPreset>
|
|
59
|
-
): RadiusPreset;
|
|
60
|
-
|
|
61
|
-
export const RADIUS: Record<string, number>;
|
|
62
|
-
export const RADIUS_PRESET: Record<string, any>;
|
|
63
|
-
export const CORNER_SMOOTHING: number;
|
|
64
|
-
|
|
65
|
-
// Fonts
|
|
66
|
-
export type FontName =
|
|
67
|
-
| 'Heebo_100Thin'
|
|
68
|
-
| 'Heebo_200ExtraLight'
|
|
69
|
-
| 'Heebo_300Light'
|
|
70
|
-
| 'Heebo_400Regular'
|
|
71
|
-
| 'Heebo_500Medium'
|
|
72
|
-
| 'Heebo_600SemiBold'
|
|
73
|
-
| 'Heebo_700Bold'
|
|
74
|
-
| 'Heebo_800ExtraBold'
|
|
75
|
-
| 'Heebo_900Black'
|
|
76
|
-
| 'Poppins_100Thin'
|
|
77
|
-
| 'Poppins_100Thin_Italic'
|
|
78
|
-
| 'Poppins_200ExtraLight'
|
|
79
|
-
| 'Poppins_200ExtraLight_Italic'
|
|
80
|
-
| 'Poppins_300Light'
|
|
81
|
-
| 'Poppins_300Light_Italic'
|
|
82
|
-
| 'Poppins_400Regular'
|
|
83
|
-
| 'Poppins_400Regular_Italic'
|
|
84
|
-
| 'Poppins_500Medium'
|
|
85
|
-
| 'Poppins_500Medium_Italic'
|
|
86
|
-
| 'Poppins_600SemiBold'
|
|
87
|
-
| 'Poppins_600SemiBold_Italic'
|
|
88
|
-
| 'Poppins_700Bold'
|
|
89
|
-
| 'Poppins_700Bold_Italic'
|
|
90
|
-
| 'Poppins_800ExtraBold'
|
|
91
|
-
| 'Poppins_800ExtraBold_Italic'
|
|
92
|
-
| 'Poppins_900Black'
|
|
93
|
-
| 'Poppins_900Black_Italic';
|
|
94
|
-
|
|
95
|
-
export const fonts: Record<FontName, any>;
|
|
3
|
+
export { cn } from './lib/utils';
|
|
4
|
+
export { THEME, NAV_THEME } from './lib/theme';
|
|
5
|
+
export { ThemeProvider, useTheme } from './lib/ThemeProvider';
|
|
6
|
+
export { getRadiusForHeight, getRadiusForDimensions, getCustomRadius, RADIUS, RADIUS_PRESET, CORNER_SMOOTHING, } from './lib/cornerRadius';
|
|
7
|
+
export { fonts } from './lib/fonts';
|
|
8
|
+
export type { FontName } from './lib/fonts';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,14 +1,137 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Available theme modes for the application
|
|
4
|
+
* @typedef {'light' | 'dark' | 'system'} ThemeMode
|
|
5
|
+
* - `light`: Force light theme regardless of system preference
|
|
6
|
+
* - `dark`: Force dark theme regardless of system preference
|
|
7
|
+
* - `system`: Automatically follow device system theme preference (default)
|
|
8
|
+
*/
|
|
9
|
+
export type ThemeMode = 'light' | 'dark' | 'system';
|
|
10
|
+
/**
|
|
11
|
+
* Context type for theme management
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
type ThemeContextType = {
|
|
15
|
+
/** Current theme mode setting */
|
|
16
|
+
mode: ThemeMode;
|
|
17
|
+
/** Whether dark mode is currently active (computed from mode and system preference) */
|
|
18
|
+
isDark: boolean;
|
|
19
|
+
/** Function to change the theme mode */
|
|
20
|
+
setMode: (mode: ThemeMode) => void;
|
|
21
|
+
/** Theme color tokens for the current mode */
|
|
22
|
+
colors: typeof import('./theme').THEME.light;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Props for ThemeProvider component
|
|
26
|
+
*/
|
|
27
|
+
type ThemeProviderProps = {
|
|
28
|
+
/** Application content to provide theme context to */
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Initial theme mode
|
|
32
|
+
* @default 'system'
|
|
33
|
+
*/
|
|
34
|
+
defaultMode?: ThemeMode;
|
|
35
|
+
/**
|
|
36
|
+
* Storage key for persisting theme preference (not yet implemented)
|
|
37
|
+
* @deprecated Currently not used - will be implemented in future version
|
|
38
|
+
*/
|
|
39
|
+
storageKey?: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Theme Provider component that manages application theme state
|
|
43
|
+
*
|
|
44
|
+
* Provides theme context to all child components, enabling dark mode support
|
|
45
|
+
* throughout the application. Automatically responds to system theme changes
|
|
46
|
+
* when mode is set to 'system'.
|
|
47
|
+
*
|
|
48
|
+
* @component
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* // Basic usage with system theme
|
|
52
|
+
* function App() {
|
|
53
|
+
* return (
|
|
54
|
+
* <ThemeProvider>
|
|
55
|
+
* <YourApp />
|
|
56
|
+
* </ThemeProvider>
|
|
57
|
+
* );
|
|
58
|
+
* }
|
|
59
|
+
*
|
|
60
|
+
* // Start with dark mode
|
|
61
|
+
* function App() {
|
|
62
|
+
* return (
|
|
63
|
+
* <ThemeProvider defaultMode="dark">
|
|
64
|
+
* <YourApp />
|
|
65
|
+
* </ThemeProvider>
|
|
66
|
+
* );
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @param {ThemeProviderProps} props - Component props
|
|
71
|
+
* @returns {JSX.Element} Provider component wrapping children with theme context
|
|
72
|
+
*
|
|
73
|
+
* @see {@link useTheme} for accessing theme in child components
|
|
74
|
+
* @see {@link useThemeMode} for optional theme access without error
|
|
75
|
+
*/
|
|
76
|
+
export declare function ThemeProvider({ children, defaultMode, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
/**
|
|
78
|
+
* Hook to access theme context and controls
|
|
79
|
+
*
|
|
80
|
+
* Provides access to the current theme state and methods to change the theme.
|
|
81
|
+
* Must be used within a ThemeProvider component tree.
|
|
82
|
+
*
|
|
83
|
+
* @returns {ThemeContextType} Theme context object
|
|
84
|
+
* @throws {Error} If used outside of ThemeProvider
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```tsx
|
|
88
|
+
* function MyComponent() {
|
|
89
|
+
* const { mode, isDark, setMode, colors } = useTheme();
|
|
90
|
+
*
|
|
91
|
+
* return (
|
|
92
|
+
* <View style={{ backgroundColor: colors.background }}>
|
|
93
|
+
* <Text style={{ color: colors.foreground }}>
|
|
94
|
+
* Current mode: {mode} (Dark: {isDark ? 'Yes' : 'No'})
|
|
95
|
+
* </Text>
|
|
96
|
+
* <Button onPress={() => setMode(isDark ? 'light' : 'dark')}>
|
|
97
|
+
* <Text>Toggle Theme</Text>
|
|
98
|
+
* </Button>
|
|
99
|
+
* </View>
|
|
100
|
+
* );
|
|
101
|
+
* }
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @see {@link ThemeProvider} for setup
|
|
105
|
+
* @see {@link useThemeMode} for optional access without error throwing
|
|
106
|
+
*/
|
|
107
|
+
export declare function useTheme(): ThemeContextType;
|
|
108
|
+
/**
|
|
109
|
+
* Optional hook to get current dark mode state
|
|
110
|
+
*
|
|
111
|
+
* Similar to useTheme but only returns the isDark boolean and doesn't throw
|
|
112
|
+
* an error if used outside ThemeProvider. Useful for components that want
|
|
113
|
+
* to adapt to theme but don't require it.
|
|
114
|
+
*
|
|
115
|
+
* @returns {boolean | undefined} Whether dark mode is active, or undefined if no provider
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```tsx
|
|
119
|
+
* function OptionalThemedComponent() {
|
|
120
|
+
* const isDark = useThemeMode();
|
|
121
|
+
*
|
|
122
|
+
* // Component works with or without ThemeProvider
|
|
123
|
+
* const backgroundColor = isDark ? '#000' : '#fff';
|
|
124
|
+
*
|
|
125
|
+
* return (
|
|
126
|
+
* <View style={{ backgroundColor }}>
|
|
127
|
+
* <Text>This component adapts if theme is available</Text>
|
|
128
|
+
* </View>
|
|
129
|
+
* );
|
|
130
|
+
* }
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @see {@link useTheme} for full theme access (requires provider)
|
|
134
|
+
*/
|
|
135
|
+
export declare function useThemeMode(): boolean | undefined;
|
|
136
|
+
export {};
|
|
137
|
+
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1,21 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Corner Radius System
|
|
3
|
+
*
|
|
4
|
+
* Automatically calculates the appropriate corner radius based on element dimensions.
|
|
5
|
+
*
|
|
6
|
+
* Design Rule:
|
|
7
|
+
* - Elements < 80px height → 12px radius
|
|
8
|
+
* - Elements ≥ 80px height → 20px radius
|
|
9
|
+
* - All corners use 100% smoothing (Apple-style squircles)
|
|
10
|
+
*
|
|
11
|
+
* Examples:
|
|
12
|
+
* - Button (50px height) → 12px
|
|
13
|
+
* - Chip (24px height) → 12px
|
|
14
|
+
* - Checkbox (16px height) → 4px (special case for very small)
|
|
15
|
+
* - Small card (60px height) → 12px
|
|
16
|
+
* - Large card (200px height) → 20px
|
|
17
|
+
* - Dialog (400px height) → 20px
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Primitive radius values from your design system
|
|
21
|
+
* Your exact values: 0, 2, 4, 8, 12, 20, 24, 32, 48
|
|
22
|
+
*/
|
|
23
|
+
export declare const RADIUS: {
|
|
24
|
+
readonly R0: 0;
|
|
25
|
+
readonly R1: 2;
|
|
26
|
+
readonly R2: 4;
|
|
27
|
+
readonly R3: 8;
|
|
28
|
+
readonly R4: 12;
|
|
29
|
+
readonly R5: 20;
|
|
30
|
+
readonly R6: 24;
|
|
31
|
+
readonly R7: 32;
|
|
32
|
+
readonly R8: 48;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Calculate corner radius based on element height
|
|
36
|
+
*
|
|
37
|
+
* @param height - Element height in pixels
|
|
38
|
+
* @returns Corner radius in pixels
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // Button (50px height)
|
|
43
|
+
* const radius = getRadiusForHeight(50); // Returns 12
|
|
44
|
+
*
|
|
45
|
+
* // Checkbox (16px height)
|
|
46
|
+
* const radius = getRadiusForHeight(16); // Returns 4
|
|
47
|
+
*
|
|
48
|
+
* // Card (160px height)
|
|
49
|
+
* const radius = getRadiusForHeight(160); // Returns 20
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function getRadiusForHeight(height: number): number;
|
|
53
|
+
/**
|
|
54
|
+
* Calculate corner radius based on smallest dimension (width or height)
|
|
55
|
+
* Useful for square or nearly-square elements
|
|
56
|
+
*
|
|
57
|
+
* @param width - Element width in pixels
|
|
58
|
+
* @param height - Element height in pixels
|
|
59
|
+
* @returns Corner radius in pixels
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* // Square checkbox (16×16)
|
|
64
|
+
* const radius = getRadiusForDimensions(16, 16); // Returns 4
|
|
65
|
+
*
|
|
66
|
+
* // Wide button (200×50)
|
|
67
|
+
* const radius = getRadiusForDimensions(200, 50); // Returns 12 (based on height)
|
|
68
|
+
*
|
|
69
|
+
* // Tall card (300×200)
|
|
70
|
+
* const radius = getRadiusForDimensions(300, 200); // Returns 20 (based on width)
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function getRadiusForDimensions(width: number, height: number): number;
|
|
74
|
+
/**
|
|
75
|
+
* Get corner radius with custom thresholds
|
|
76
|
+
* Advanced usage when you need different breakpoints
|
|
77
|
+
*
|
|
78
|
+
* @param height - Element height in pixels
|
|
79
|
+
* @param options - Custom threshold options
|
|
80
|
+
* @returns Corner radius in pixels
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* // Use 20px radius for elements ≥ 100px instead of 80px
|
|
85
|
+
* const radius = getCustomRadius(90, { largeThreshold: 100 });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function getCustomRadius(height: number, options?: {
|
|
89
|
+
tinyThreshold?: number;
|
|
90
|
+
smallThreshold?: number;
|
|
91
|
+
tinyRadius?: number;
|
|
92
|
+
smallRadius?: number;
|
|
93
|
+
largeRadius?: number;
|
|
94
|
+
}): number;
|
|
95
|
+
/**
|
|
96
|
+
* Corner smoothing value (0-1)
|
|
97
|
+
* 1.0 = 100% smoothing (Apple-style squircles)
|
|
98
|
+
*/
|
|
99
|
+
export declare const CORNER_SMOOTHING = 1;
|
|
100
|
+
/**
|
|
101
|
+
* Preset radius values for common use cases
|
|
102
|
+
* Use these when you know the exact size you want
|
|
103
|
+
*/
|
|
104
|
+
export declare const RADIUS_PRESET: {
|
|
105
|
+
readonly none: 0;
|
|
106
|
+
readonly tiny: 4;
|
|
107
|
+
readonly small: 12;
|
|
108
|
+
readonly large: 20;
|
|
109
|
+
readonly pill: 24;
|
|
110
|
+
readonly circle: 9999;
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=cornerRadius.d.ts.map
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| 'Poppins_600SemiBold_Italic'
|
|
23
|
-
| 'Poppins_700Bold'
|
|
24
|
-
| 'Poppins_700Bold_Italic'
|
|
25
|
-
| 'Poppins_800ExtraBold'
|
|
26
|
-
| 'Poppins_800ExtraBold_Italic'
|
|
27
|
-
| 'Poppins_900Black'
|
|
28
|
-
| 'Poppins_900Black_Italic';
|
|
29
|
-
|
|
30
|
-
export const fonts: Record<FontName, any>;
|
|
1
|
+
/**
|
|
2
|
+
* Font configuration for CampX Design System
|
|
3
|
+
*
|
|
4
|
+
* Fonts:
|
|
5
|
+
* - Poppins: Used for headings, buttons, labels, subtitles
|
|
6
|
+
* - Heebo: Used for body text, inputs, captions
|
|
7
|
+
*
|
|
8
|
+
* Weights:
|
|
9
|
+
* - 400 (Regular): Body text, labels, captions
|
|
10
|
+
* - 600 (Semi Bold): Subtitles, buttons, emphasized body
|
|
11
|
+
* - 800 (Extra Bold): Headings
|
|
12
|
+
*/
|
|
13
|
+
export declare const fonts: {
|
|
14
|
+
Poppins_400Regular: number;
|
|
15
|
+
Poppins_600SemiBold: number;
|
|
16
|
+
Poppins_800ExtraBold: number;
|
|
17
|
+
Heebo_400Regular: number;
|
|
18
|
+
Heebo_600SemiBold: number;
|
|
19
|
+
};
|
|
20
|
+
export type FontName = keyof typeof fonts;
|
|
21
|
+
//# sourceMappingURL=fonts.d.ts.map
|