@newtonedev/components 0.1.0 → 0.1.1
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/AppShell/AppShell.d.ts +4 -0
- package/dist/AppShell/AppShell.d.ts.map +1 -0
- package/dist/AppShell/AppShell.styles.d.ts +16 -0
- package/dist/AppShell/AppShell.styles.d.ts.map +1 -0
- package/dist/AppShell/AppShell.types.d.ts +8 -0
- package/dist/AppShell/AppShell.types.d.ts.map +1 -0
- package/dist/AppShell/index.d.ts +3 -0
- package/dist/AppShell/index.d.ts.map +1 -0
- package/dist/Button/Button.d.ts +9 -4
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.styles.d.ts +33 -26
- package/dist/Button/Button.styles.d.ts.map +1 -1
- package/dist/Button/Button.types.d.ts +17 -2
- package/dist/Button/Button.types.d.ts.map +1 -1
- package/dist/ColorScaleSlider/ColorScaleSlider.d.ts +13 -0
- package/dist/ColorScaleSlider/ColorScaleSlider.d.ts.map +1 -0
- package/dist/ColorScaleSlider/ColorScaleSlider.styles.d.ts +54 -0
- package/dist/ColorScaleSlider/ColorScaleSlider.styles.d.ts.map +1 -0
- package/dist/ColorScaleSlider/ColorScaleSlider.types.d.ts +25 -0
- package/dist/ColorScaleSlider/ColorScaleSlider.types.d.ts.map +1 -0
- package/dist/ColorScaleSlider/index.d.ts +3 -0
- package/dist/ColorScaleSlider/index.d.ts.map +1 -0
- package/dist/Frame/Frame.d.ts +48 -0
- package/dist/Frame/Frame.d.ts.map +1 -0
- package/dist/Frame/Frame.styles.d.ts +39 -0
- package/dist/Frame/Frame.styles.d.ts.map +1 -0
- package/dist/Frame/Frame.types.d.ts +115 -0
- package/dist/Frame/Frame.types.d.ts.map +1 -0
- package/dist/Frame/Frame.utils.d.ts +39 -0
- package/dist/Frame/Frame.utils.d.ts.map +1 -0
- package/dist/Frame/index.d.ts +4 -0
- package/dist/Frame/index.d.ts.map +1 -0
- package/dist/HueSlider/HueSlider.d.ts +1 -1
- package/dist/HueSlider/HueSlider.d.ts.map +1 -1
- package/dist/HueSlider/HueSlider.styles.d.ts +47 -5
- package/dist/HueSlider/HueSlider.styles.d.ts.map +1 -1
- package/dist/HueSlider/HueSlider.types.d.ts +1 -0
- package/dist/HueSlider/HueSlider.types.d.ts.map +1 -1
- package/dist/Icon/Icon.d.ts +36 -0
- package/dist/Icon/Icon.d.ts.map +1 -0
- package/dist/Navbar/Navbar.d.ts +4 -0
- package/dist/Navbar/Navbar.d.ts.map +1 -0
- package/dist/Navbar/Navbar.styles.d.ts +31 -0
- package/dist/Navbar/Navbar.styles.d.ts.map +1 -0
- package/dist/Navbar/Navbar.types.d.ts +14 -0
- package/dist/Navbar/Navbar.types.d.ts.map +1 -0
- package/dist/Navbar/index.d.ts +3 -0
- package/dist/Navbar/index.d.ts.map +1 -0
- package/dist/Popover/Popover.d.ts +4 -0
- package/dist/Popover/Popover.d.ts.map +1 -0
- package/dist/Popover/Popover.styles.d.ts +9 -0
- package/dist/Popover/Popover.styles.d.ts.map +1 -0
- package/dist/Popover/Popover.types.d.ts +37 -0
- package/dist/Popover/Popover.types.d.ts.map +1 -0
- package/dist/Popover/index.d.ts +4 -0
- package/dist/Popover/index.d.ts.map +1 -0
- package/dist/Popover/usePopover.d.ts +3 -0
- package/dist/Popover/usePopover.d.ts.map +1 -0
- package/dist/Select/Select.d.ts +1 -8
- package/dist/Select/Select.d.ts.map +1 -1
- package/dist/Select/Select.styles.d.ts +32 -5
- package/dist/Select/Select.styles.d.ts.map +1 -1
- package/dist/Select/Select.types.d.ts +25 -1
- package/dist/Select/Select.types.d.ts.map +1 -1
- package/dist/Select/SelectOption.d.ts +13 -0
- package/dist/Select/SelectOption.d.ts.map +1 -0
- package/dist/Select/useSelect.d.ts +15 -0
- package/dist/Select/useSelect.d.ts.map +1 -0
- package/dist/Sidebar/Sidebar.d.ts +4 -0
- package/dist/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/Sidebar/Sidebar.styles.d.ts +32 -0
- package/dist/Sidebar/Sidebar.styles.d.ts.map +1 -0
- package/dist/Sidebar/Sidebar.types.d.ts +14 -0
- package/dist/Sidebar/Sidebar.types.d.ts.map +1 -0
- package/dist/Sidebar/index.d.ts +3 -0
- package/dist/Sidebar/index.d.ts.map +1 -0
- package/dist/Slider/Slider.d.ts +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.styles.d.ts +48 -8
- package/dist/Slider/Slider.styles.d.ts.map +1 -1
- package/dist/Slider/Slider.types.d.ts +1 -0
- package/dist/Slider/Slider.types.d.ts.map +1 -1
- package/dist/TextInput/TextInput.styles.d.ts +3 -1
- package/dist/TextInput/TextInput.styles.d.ts.map +1 -1
- package/dist/Toggle/Toggle.styles.d.ts +2 -1
- package/dist/Toggle/Toggle.styles.d.ts.map +1 -1
- package/dist/fonts/GoogleFontLoader.d.ts +19 -0
- package/dist/fonts/GoogleFontLoader.d.ts.map +1 -0
- package/dist/fonts/IconFontLoader.d.ts +13 -0
- package/dist/fonts/IconFontLoader.d.ts.map +1 -0
- package/dist/fonts/buildGoogleFontsUrl.d.ts +17 -0
- package/dist/fonts/buildGoogleFontsUrl.d.ts.map +1 -0
- package/dist/fonts/googleFonts.d.ts +20 -0
- package/dist/fonts/googleFonts.d.ts.map +1 -0
- package/dist/index.cjs +2304 -205
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +27 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2280 -200
- package/dist/index.js.map +1 -1
- package/dist/registry/codegen.d.ts +11 -0
- package/dist/registry/codegen.d.ts.map +1 -0
- package/dist/registry/index.d.ts +4 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/registry.d.ts +7 -0
- package/dist/registry/registry.d.ts.map +1 -0
- package/dist/registry/types.d.ts +32 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/theme/FrameContext.d.ts +24 -0
- package/dist/theme/FrameContext.d.ts.map +1 -0
- package/dist/theme/NewtoneProvider.d.ts.map +1 -1
- package/dist/theme/defaults.d.ts.map +1 -1
- package/dist/theme/types.d.ts +64 -1
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/tokens/computeTokens.d.ts +55 -3
- package/dist/tokens/computeTokens.d.ts.map +1 -1
- package/dist/tokens/types.d.ts +52 -0
- package/dist/tokens/types.d.ts.map +1 -1
- package/dist/tokens/useTokens.d.ts +12 -9
- package/dist/tokens/useTokens.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/AppShell/AppShell.styles.ts +20 -0
- package/src/AppShell/AppShell.tsx +17 -0
- package/src/AppShell/AppShell.types.ts +8 -0
- package/src/AppShell/index.ts +2 -0
- package/src/Button/Button.styles.ts +74 -41
- package/src/Button/Button.tsx +36 -17
- package/src/Button/Button.types.ts +20 -2
- package/src/Card/Card.styles.ts +2 -2
- package/src/ColorScaleSlider/ColorScaleSlider.styles.ts +60 -0
- package/src/ColorScaleSlider/ColorScaleSlider.tsx +156 -0
- package/src/ColorScaleSlider/ColorScaleSlider.types.ts +25 -0
- package/src/ColorScaleSlider/index.ts +2 -0
- package/src/Frame/Frame.styles.ts +213 -0
- package/src/Frame/Frame.tsx +242 -0
- package/src/Frame/Frame.types.ts +181 -0
- package/src/Frame/Frame.utils.ts +189 -0
- package/src/Frame/index.ts +21 -0
- package/src/HueSlider/HueSlider.styles.ts +58 -39
- package/src/HueSlider/HueSlider.tsx +97 -25
- package/src/HueSlider/HueSlider.types.ts +1 -0
- package/src/Icon/Icon.tsx +76 -0
- package/src/Navbar/Navbar.styles.ts +37 -0
- package/src/Navbar/Navbar.tsx +32 -0
- package/src/Navbar/Navbar.types.ts +14 -0
- package/src/Navbar/index.ts +2 -0
- package/src/Popover/Popover.styles.ts +39 -0
- package/src/Popover/Popover.tsx +103 -0
- package/src/Popover/Popover.types.ts +40 -0
- package/src/Popover/index.ts +3 -0
- package/src/Popover/usePopover.ts +26 -0
- package/src/Select/Select.styles.ts +49 -10
- package/src/Select/Select.tsx +127 -36
- package/src/Select/Select.types.ts +30 -1
- package/src/Select/SelectOption.tsx +104 -0
- package/src/Select/useSelect.ts +129 -0
- package/src/Sidebar/Sidebar.styles.ts +38 -0
- package/src/Sidebar/Sidebar.tsx +27 -0
- package/src/Sidebar/Sidebar.types.ts +14 -0
- package/src/Sidebar/index.ts +2 -0
- package/src/Slider/Slider.styles.ts +53 -25
- package/src/Slider/Slider.tsx +89 -24
- package/src/Slider/Slider.types.ts +1 -0
- package/src/TextInput/TextInput.styles.ts +9 -7
- package/src/Toggle/Toggle.styles.ts +4 -3
- package/src/fonts/GoogleFontLoader.tsx +63 -0
- package/src/fonts/IconFontLoader.tsx +49 -0
- package/src/fonts/buildGoogleFontsUrl.ts +31 -0
- package/src/fonts/googleFonts.ts +87 -0
- package/src/index.ts +70 -2
- package/src/registry/codegen.ts +132 -0
- package/src/registry/index.ts +17 -0
- package/src/registry/registry.ts +402 -0
- package/src/registry/types.ts +35 -0
- package/src/theme/FrameContext.tsx +29 -0
- package/src/theme/NewtoneProvider.tsx +9 -1
- package/src/theme/defaults.ts +51 -0
- package/src/theme/types.ts +66 -1
- package/src/tokens/computeTokens.ts +103 -46
- package/src/tokens/types.ts +52 -0
- package/src/tokens/useTokens.ts +30 -15
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../src/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,aAAa,qBAU5D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ResolvedTokens } from '../tokens/types';
|
|
2
|
+
export declare function getAppShellStyles(tokens: ResolvedTokens): {
|
|
3
|
+
container: {
|
|
4
|
+
flex: number;
|
|
5
|
+
flexDirection: "row";
|
|
6
|
+
overflow: "hidden";
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
};
|
|
9
|
+
main: {
|
|
10
|
+
flex: number;
|
|
11
|
+
flexDirection: "column";
|
|
12
|
+
minWidth: number;
|
|
13
|
+
overflow: "hidden";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=AppShell.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShell.styles.d.ts","sourceRoot":"","sources":["../../src/AppShell/AppShell.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;;;;EAevD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface AppShellProps {
|
|
3
|
+
/** Sidebar element rendered on the left */
|
|
4
|
+
readonly sidebar?: ReactNode;
|
|
5
|
+
/** Main content area (navbar + page content) */
|
|
6
|
+
readonly children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=AppShell.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShell.types.d.ts","sourceRoot":"","sources":["../../src/AppShell/AppShell.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ButtonProps } from './Button.types';
|
|
3
3
|
/**
|
|
4
|
-
* Button component with support for multiple variants and
|
|
4
|
+
* Button component with support for multiple variants, sizes, and optional icons.
|
|
5
5
|
*
|
|
6
6
|
* Automatically adapts to the current theme and mode from NewtoneProvider.
|
|
7
7
|
*
|
|
@@ -14,10 +14,15 @@ import type { ButtonProps } from './Button.types';
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```tsx
|
|
17
|
-
* <Button
|
|
18
|
-
*
|
|
17
|
+
* <Button icon="add" variant="primary" onPress={handleAdd}>
|
|
18
|
+
* New Item
|
|
19
19
|
* </Button>
|
|
20
20
|
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <Button icon="delete" variant="ghost" size="sm" onPress={handleDelete} />
|
|
25
|
+
* ```
|
|
21
26
|
*/
|
|
22
|
-
export declare function Button({ children, variant, size, disabled, style, textStyle, ...pressableProps }: ButtonProps): React.JSX.Element;
|
|
27
|
+
export declare function Button({ children, icon, iconPosition, variant, size, disabled, style, textStyle, ...pressableProps }: ButtonProps): React.JSX.Element;
|
|
23
28
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,IAAI,EACJ,YAAqB,EACrB,OAAmB,EACnB,IAAW,EACX,QAAgB,EAChB,KAAK,EACL,SAAS,EACT,GAAG,cAAc,EAClB,EAAE,WAAW,qBA4Cb"}
|
|
@@ -7,33 +7,40 @@ import type { ButtonVariant, ButtonSize } from './Button.types';
|
|
|
7
7
|
* @param variant - Button variant (primary, secondary, ghost, outline)
|
|
8
8
|
* @param size - Button size (sm, md, lg)
|
|
9
9
|
* @param disabled - Whether button is disabled
|
|
10
|
-
* @
|
|
10
|
+
* @param isIconOnly - Whether the button shows only an icon (no text)
|
|
11
|
+
* @returns StyleSheet with button styles + iconColor for the Icon component
|
|
11
12
|
*/
|
|
12
|
-
export declare function getButtonStyles(tokens: ResolvedTokens, variant: ButtonVariant, size: ButtonSize, disabled: boolean): {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
export declare function getButtonStyles(tokens: ResolvedTokens, variant: ButtonVariant, size: ButtonSize, disabled: boolean, isIconOnly: boolean): {
|
|
14
|
+
iconColor: string;
|
|
15
|
+
iconSize: number;
|
|
16
|
+
styles: {
|
|
17
|
+
base: {
|
|
18
|
+
borderColor?: string | undefined;
|
|
19
|
+
backgroundColor: string;
|
|
20
|
+
borderWidth: number;
|
|
21
|
+
paddingVertical: number;
|
|
22
|
+
paddingHorizontal: number;
|
|
23
|
+
borderRadius: number;
|
|
24
|
+
alignItems: "center";
|
|
25
|
+
justifyContent: "center";
|
|
26
|
+
flexDirection: "row";
|
|
27
|
+
gap: number;
|
|
28
|
+
};
|
|
29
|
+
pressed: {
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
opacity: number;
|
|
32
|
+
};
|
|
33
|
+
disabled: {
|
|
34
|
+
opacity: number;
|
|
35
|
+
};
|
|
36
|
+
text: {
|
|
37
|
+
fontFamily: string;
|
|
38
|
+
fontSize: number;
|
|
39
|
+
fontWeight: any;
|
|
40
|
+
color: string;
|
|
41
|
+
};
|
|
42
|
+
textPressed: {};
|
|
43
|
+
textDisabled: {};
|
|
23
44
|
};
|
|
24
|
-
pressed: {
|
|
25
|
-
backgroundColor: string;
|
|
26
|
-
opacity: number;
|
|
27
|
-
};
|
|
28
|
-
disabled: {
|
|
29
|
-
opacity: number;
|
|
30
|
-
};
|
|
31
|
-
text: {
|
|
32
|
-
fontSize: 12 | 14 | 16;
|
|
33
|
-
fontWeight: "600";
|
|
34
|
-
color: string;
|
|
35
|
-
};
|
|
36
|
-
textPressed: {};
|
|
37
|
-
textDisabled: {};
|
|
38
45
|
};
|
|
39
46
|
//# sourceMappingURL=Button.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../src/Button/Button.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../src/Button/Button.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAkChE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqEoC,GAAG;;;;;;EAW3D"}
|
|
@@ -7,14 +7,29 @@ export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline';
|
|
|
7
7
|
* Size presets for the Button component
|
|
8
8
|
*/
|
|
9
9
|
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
10
|
+
/**
|
|
11
|
+
* Icon position relative to button text
|
|
12
|
+
*/
|
|
13
|
+
export type ButtonIconPosition = 'left' | 'right';
|
|
10
14
|
/**
|
|
11
15
|
* Props for the Button component
|
|
12
16
|
*/
|
|
13
17
|
export interface ButtonProps extends Omit<PressableProps, 'children' | 'style'> {
|
|
14
18
|
/**
|
|
15
|
-
* Button text or custom content
|
|
19
|
+
* Button text or custom content.
|
|
20
|
+
* Optional when `icon` is provided (renders icon-only button).
|
|
21
|
+
*/
|
|
22
|
+
readonly children?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Material Symbol icon name (e.g. 'add', 'delete', 'check').
|
|
25
|
+
* When provided without children, renders an icon-only button.
|
|
26
|
+
*/
|
|
27
|
+
readonly icon?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Position of the icon relative to text
|
|
30
|
+
* @default 'left'
|
|
16
31
|
*/
|
|
17
|
-
readonly
|
|
32
|
+
readonly iconPosition?: ButtonIconPosition;
|
|
18
33
|
/**
|
|
19
34
|
* Visual variant
|
|
20
35
|
* @default 'primary'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../src/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC;IAC7E
|
|
1
|
+
{"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../src/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC;IAC7E;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEpC;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAE3C;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAEjC;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CAC9C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ColorScaleSliderProps } from './ColorScaleSlider.types';
|
|
3
|
+
/**
|
|
4
|
+
* Interactive color scale slider.
|
|
5
|
+
*
|
|
6
|
+
* Renders an array of colors as the track (lightest on left, darkest on right)
|
|
7
|
+
* with a draggable thumb. The value is a normalizedValue [0, 1] where
|
|
8
|
+
* 0 = darkest (right) and 1 = lightest (left).
|
|
9
|
+
*
|
|
10
|
+
* Used by PalettePanel for key color selection on non-neutral palettes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ColorScaleSlider({ colors, value, onValueChange, label, warning, trimEnds, snap, disabled, animateValue, style, }: ColorScaleSliderProps): React.JSX.Element;
|
|
13
|
+
//# sourceMappingURL=ColorScaleSlider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorScaleSlider.d.ts","sourceRoot":"","sources":["../../src/ColorScaleSlider/ColorScaleSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAItE;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,KAAK,EACL,aAAa,EACb,KAAK,EACL,OAAO,EACP,QAAgB,EAChB,IAAY,EACZ,QAAgB,EAChB,YAAoB,EACpB,KAAK,GACN,EAAE,qBAAqB,qBAgIvB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ResolvedTokens } from '../tokens/types';
|
|
2
|
+
declare const TRACK_HEIGHT = 22;
|
|
3
|
+
export declare const THUMB_SIZE = 18;
|
|
4
|
+
export declare function getColorScaleSliderStyles(tokens: ResolvedTokens, disabled: boolean): {
|
|
5
|
+
container: {
|
|
6
|
+
gap: number;
|
|
7
|
+
opacity: number;
|
|
8
|
+
};
|
|
9
|
+
labelRow: {
|
|
10
|
+
flexDirection: "row";
|
|
11
|
+
justifyContent: "space-between";
|
|
12
|
+
alignItems: "center";
|
|
13
|
+
};
|
|
14
|
+
label: {
|
|
15
|
+
fontFamily: string;
|
|
16
|
+
fontSize: number;
|
|
17
|
+
fontWeight: any;
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
trackContainer: {
|
|
21
|
+
height: number;
|
|
22
|
+
justifyContent: "center";
|
|
23
|
+
position: "relative";
|
|
24
|
+
};
|
|
25
|
+
gradientTrack: {
|
|
26
|
+
position: "absolute";
|
|
27
|
+
left: number;
|
|
28
|
+
right: number;
|
|
29
|
+
height: number;
|
|
30
|
+
borderRadius: number;
|
|
31
|
+
flexDirection: "row";
|
|
32
|
+
overflow: "hidden";
|
|
33
|
+
};
|
|
34
|
+
segment: {
|
|
35
|
+
flex: number;
|
|
36
|
+
};
|
|
37
|
+
thumb: {
|
|
38
|
+
position: "absolute";
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
borderRadius: number;
|
|
42
|
+
backgroundColor: string;
|
|
43
|
+
borderWidth: number;
|
|
44
|
+
borderColor: string;
|
|
45
|
+
};
|
|
46
|
+
warning: {
|
|
47
|
+
fontFamily: string;
|
|
48
|
+
fontSize: number;
|
|
49
|
+
fontWeight: any;
|
|
50
|
+
color: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export { TRACK_HEIGHT };
|
|
54
|
+
//# sourceMappingURL=ColorScaleSlider.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorScaleSlider.styles.d.ts","sourceRoot":"","sources":["../../src/ColorScaleSlider/ColorScaleSlider.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,QAAA,MAAM,YAAY,KAAK,CAAC;AACxB,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO;;;;;;;;;;;;;oBAc5B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAgCL,GAAG;;;EAIvD;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
2
|
+
import type { ColorResult } from 'newtone';
|
|
3
|
+
export interface ColorScaleSliderProps {
|
|
4
|
+
/** Preview colors for the track (index 0 = lightest, last = darkest) */
|
|
5
|
+
readonly colors: readonly ColorResult[];
|
|
6
|
+
/** Current normalizedValue [0, 1] (0 = darkest, 1 = lightest) */
|
|
7
|
+
readonly value?: number;
|
|
8
|
+
/** Called when the user drags the thumb */
|
|
9
|
+
readonly onValueChange: (normalizedValue: number) => void;
|
|
10
|
+
/** Optional label text above the slider */
|
|
11
|
+
readonly label?: string;
|
|
12
|
+
/** WCAG warning text shown below the slider */
|
|
13
|
+
readonly warning?: string;
|
|
14
|
+
/** Hide the first and last colors (interpolation endpoints, not selectable) */
|
|
15
|
+
readonly trimEnds?: boolean;
|
|
16
|
+
/** Snap thumb to the nearest color step instead of continuous dragging */
|
|
17
|
+
readonly snap?: boolean;
|
|
18
|
+
/** Whether the slider is disabled */
|
|
19
|
+
readonly disabled?: boolean;
|
|
20
|
+
/** Animate thumb position on prop-driven value changes (e.g., mode switch). Default: false */
|
|
21
|
+
readonly animateValue?: boolean;
|
|
22
|
+
/** Optional style override */
|
|
23
|
+
readonly style?: ViewStyle | ViewStyle[];
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ColorScaleSlider.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorScaleSlider.types.d.ts","sourceRoot":"","sources":["../../src/ColorScaleSlider/ColorScaleSlider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IACxC,iEAAiE;IACjE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,2CAA2C;IAC3C,QAAQ,CAAC,aAAa,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,qCAAqC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,8FAA8F;IAC9F,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CAC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ColorScaleSlider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FrameProps } from './Frame.types';
|
|
3
|
+
/**
|
|
4
|
+
* Frame — Foundational layout building block.
|
|
5
|
+
*
|
|
6
|
+
* Frame is a container that provides theme and elevation context to all
|
|
7
|
+
* descendants, plus layout (flex/grid), spacing, sizing, appearance,
|
|
8
|
+
* and interactivity capabilities.
|
|
9
|
+
*
|
|
10
|
+
* Frames can be nested. Inner frames override outer frames for their subtree.
|
|
11
|
+
* Unspecified props inherit from the nearest parent Frame.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Basic layout
|
|
16
|
+
* <Frame direction="horizontal" gap="md" padding="lg" align="center">
|
|
17
|
+
* <Button onPress={() => {}}>Save</Button>
|
|
18
|
+
* <Button variant="ghost" onPress={() => {}}>Cancel</Button>
|
|
19
|
+
* </Frame>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // Card-like frame
|
|
25
|
+
* <Frame
|
|
26
|
+
* theme="primary"
|
|
27
|
+
* elevation={2}
|
|
28
|
+
* radius="lg"
|
|
29
|
+
* padding="xl"
|
|
30
|
+
* bordered
|
|
31
|
+
* onPress={() => navigate('/details')}
|
|
32
|
+
* >
|
|
33
|
+
* <Text>Clickable card</Text>
|
|
34
|
+
* </Frame>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* // Grid layout (web)
|
|
40
|
+
* <Frame layout="grid" columns={3} gap="md" padding="lg">
|
|
41
|
+
* <Frame radius="md" padding="md" bordered>Cell 1</Frame>
|
|
42
|
+
* <Frame radius="md" padding="md" bordered>Cell 2</Frame>
|
|
43
|
+
* <Frame radius="md" padding="md" bordered>Cell 3</Frame>
|
|
44
|
+
* </Frame>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function Frame({ children, theme, elevation, layout, direction, wrap, reverse, columns, rows, align, justify, padding, gap, width, height, minWidth, maxWidth, minHeight, maxHeight, radius, bordered, onPress, href, disabled, style, }: FrameProps): React.JSX.Element;
|
|
48
|
+
//# sourceMappingURL=Frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Frame.d.ts","sourceRoot":"","sources":["../../src/Frame/Frame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAyChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EAER,KAAK,EACL,SAAS,EAET,MAAM,EACN,SAAS,EACT,IAAI,EACJ,OAAO,EACP,OAAO,EACP,IAAI,EAEJ,KAAK,EACL,OAAO,EAEP,OAAO,EACP,GAAG,EAEH,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EAET,MAAM,EACN,QAAQ,EAER,OAAO,EACP,IAAI,EACJ,QAAgB,EAEhB,KAAK,GACN,EAAE,UAAU,qBAuHZ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
2
|
+
import type { ResolvedTokens } from '../tokens/types';
|
|
3
|
+
import type { FrameElevation } from '../theme/types';
|
|
4
|
+
import type { PaddingProp, GapProp, SizingMode, Direction, Alignment, Justification, RadiusProp, LayoutMode } from './Frame.types';
|
|
5
|
+
export interface FrameStyleInput {
|
|
6
|
+
readonly tokens: ResolvedTokens;
|
|
7
|
+
readonly frameElevation: FrameElevation;
|
|
8
|
+
readonly layout?: LayoutMode;
|
|
9
|
+
readonly direction?: Direction;
|
|
10
|
+
readonly wrap?: boolean;
|
|
11
|
+
readonly reverse?: boolean;
|
|
12
|
+
readonly columns?: number;
|
|
13
|
+
readonly rows?: number;
|
|
14
|
+
readonly align?: Alignment;
|
|
15
|
+
readonly justify?: Justification;
|
|
16
|
+
readonly padding?: PaddingProp;
|
|
17
|
+
readonly gap?: GapProp;
|
|
18
|
+
readonly width?: SizingMode;
|
|
19
|
+
readonly height?: SizingMode;
|
|
20
|
+
readonly minWidth?: number;
|
|
21
|
+
readonly maxWidth?: number;
|
|
22
|
+
readonly minHeight?: number;
|
|
23
|
+
readonly maxHeight?: number;
|
|
24
|
+
readonly radius?: RadiusProp;
|
|
25
|
+
readonly bordered?: boolean;
|
|
26
|
+
readonly disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface FrameStyles {
|
|
29
|
+
/** Main container style (ViewStyle) */
|
|
30
|
+
readonly container: ViewStyle;
|
|
31
|
+
/** Style applied when pressed (background shift) */
|
|
32
|
+
readonly pressed: ViewStyle;
|
|
33
|
+
/** Web-only CSS Grid properties (cast to ViewStyle at render) */
|
|
34
|
+
readonly gridWebStyle: React.CSSProperties | null;
|
|
35
|
+
/** Web-only inset box-shadow string for elevation -2 */
|
|
36
|
+
readonly insetBoxShadow: string | null;
|
|
37
|
+
}
|
|
38
|
+
export declare function getFrameStyles(input: FrameStyleInput): FrameStyles;
|
|
39
|
+
//# sourceMappingURL=Frame.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Frame.styles.d.ts","sourceRoot":"","sources":["../../src/Frame/Frame.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACX,MAAM,eAAe,CAAC;AAcvB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAGxC,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAGvB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAGjC,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAGvB,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAG5B,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAID,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;IAClD,wDAAwD;IACxD,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,WAAW,CAuIlE"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ViewStyle, GestureResponderEvent } from 'react-native';
|
|
2
|
+
import type { ThemeName, FrameElevation } from '../theme/types';
|
|
3
|
+
/** Design system spacing tokens */
|
|
4
|
+
export type SpacingToken = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
5
|
+
/** A spacing value: either a design token name or a pixel number */
|
|
6
|
+
export type SpacingValue = SpacingToken | number;
|
|
7
|
+
/** Per-side spacing */
|
|
8
|
+
export interface SpacingSides {
|
|
9
|
+
readonly top?: SpacingValue;
|
|
10
|
+
readonly right?: SpacingValue;
|
|
11
|
+
readonly bottom?: SpacingValue;
|
|
12
|
+
readonly left?: SpacingValue;
|
|
13
|
+
}
|
|
14
|
+
/** Axis-based spacing shorthand */
|
|
15
|
+
export interface SpacingAxes {
|
|
16
|
+
readonly x?: SpacingValue;
|
|
17
|
+
readonly y?: SpacingValue;
|
|
18
|
+
}
|
|
19
|
+
/** Padding: uniform, axis shorthand, or per-side */
|
|
20
|
+
export type PaddingProp = SpacingValue | SpacingAxes | SpacingSides;
|
|
21
|
+
/** Gap axis shorthand */
|
|
22
|
+
export interface GapAxes {
|
|
23
|
+
readonly row?: SpacingValue;
|
|
24
|
+
readonly column?: SpacingValue;
|
|
25
|
+
}
|
|
26
|
+
/** Gap: uniform or row/column */
|
|
27
|
+
export type GapProp = SpacingValue | GapAxes;
|
|
28
|
+
/** Design system radius tokens */
|
|
29
|
+
export type RadiusToken = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'pill';
|
|
30
|
+
/** A radius value: either a design token name or a pixel number */
|
|
31
|
+
export type RadiusValue = RadiusToken | number;
|
|
32
|
+
/** Per-corner radius */
|
|
33
|
+
export interface RadiusCorners {
|
|
34
|
+
readonly topLeft?: RadiusValue;
|
|
35
|
+
readonly topRight?: RadiusValue;
|
|
36
|
+
readonly bottomLeft?: RadiusValue;
|
|
37
|
+
readonly bottomRight?: RadiusValue;
|
|
38
|
+
}
|
|
39
|
+
/** Radius: uniform or per-corner */
|
|
40
|
+
export type RadiusProp = RadiusValue | RadiusCorners;
|
|
41
|
+
/**
|
|
42
|
+
* Figma-like sizing mode:
|
|
43
|
+
* - 'hug': shrink to content (default)
|
|
44
|
+
* - 'fill': expand to fill available space
|
|
45
|
+
* - number: fixed pixel dimension
|
|
46
|
+
*/
|
|
47
|
+
export type SizingMode = 'hug' | 'fill' | number;
|
|
48
|
+
/** Layout mode */
|
|
49
|
+
export type LayoutMode = 'flex' | 'grid';
|
|
50
|
+
/** Flex direction (Figma-like naming) */
|
|
51
|
+
export type Direction = 'horizontal' | 'vertical';
|
|
52
|
+
/** Cross-axis alignment */
|
|
53
|
+
export type Alignment = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
54
|
+
/** Main-axis justification */
|
|
55
|
+
export type Justification = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
56
|
+
export interface FrameProps {
|
|
57
|
+
/** Child elements that inherit this Frame's theme and elevation context */
|
|
58
|
+
readonly children: React.ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* Theme override for this frame and all descendants.
|
|
61
|
+
* When omitted, inherits from parent Frame or NewtoneProvider.
|
|
62
|
+
*/
|
|
63
|
+
readonly theme?: ThemeName;
|
|
64
|
+
/**
|
|
65
|
+
* Surface elevation: -2 (deeply sunken with inset shadow), -1 (sunken),
|
|
66
|
+
* 0 (default), 1 (elevated), 2 (prominently elevated with drop shadow).
|
|
67
|
+
* When omitted, inherits from parent Frame or defaults to 0.
|
|
68
|
+
*/
|
|
69
|
+
readonly elevation?: FrameElevation;
|
|
70
|
+
/** Layout mode. @default 'flex' */
|
|
71
|
+
readonly layout?: LayoutMode;
|
|
72
|
+
/** Flex direction. @default 'vertical' */
|
|
73
|
+
readonly direction?: Direction;
|
|
74
|
+
/** Enable flex wrap. @default false */
|
|
75
|
+
readonly wrap?: boolean;
|
|
76
|
+
/** Reverse flex direction. @default false */
|
|
77
|
+
readonly reverse?: boolean;
|
|
78
|
+
/** CSS Grid column count (web-only, requires layout='grid') */
|
|
79
|
+
readonly columns?: number;
|
|
80
|
+
/** CSS Grid row count (web-only, requires layout='grid') */
|
|
81
|
+
readonly rows?: number;
|
|
82
|
+
/** Cross-axis alignment of children */
|
|
83
|
+
readonly align?: Alignment;
|
|
84
|
+
/** Main-axis justification of children */
|
|
85
|
+
readonly justify?: Justification;
|
|
86
|
+
/** Padding: uniform token/number, axis shorthand, or per-side */
|
|
87
|
+
readonly padding?: PaddingProp;
|
|
88
|
+
/** Gap between children: uniform or row/column */
|
|
89
|
+
readonly gap?: GapProp;
|
|
90
|
+
/** Width: 'hug' (content-sized), 'fill' (expand), or fixed number */
|
|
91
|
+
readonly width?: SizingMode;
|
|
92
|
+
/** Height: 'hug' (content-sized), 'fill' (expand), or fixed number */
|
|
93
|
+
readonly height?: SizingMode;
|
|
94
|
+
/** Minimum width in pixels */
|
|
95
|
+
readonly minWidth?: number;
|
|
96
|
+
/** Maximum width in pixels */
|
|
97
|
+
readonly maxWidth?: number;
|
|
98
|
+
/** Minimum height in pixels */
|
|
99
|
+
readonly minHeight?: number;
|
|
100
|
+
/** Maximum height in pixels */
|
|
101
|
+
readonly maxHeight?: number;
|
|
102
|
+
/** Border radius: token, number, or per-corner object */
|
|
103
|
+
readonly radius?: RadiusProp;
|
|
104
|
+
/** Show 1px border using theme border color. @default false */
|
|
105
|
+
readonly bordered?: boolean;
|
|
106
|
+
/** Press handler — switches rendering from View to Pressable */
|
|
107
|
+
readonly onPress?: (event: GestureResponderEvent) => void;
|
|
108
|
+
/** Navigation URL — switches rendering to Pressable with link role */
|
|
109
|
+
readonly href?: string;
|
|
110
|
+
/** Disable interaction. @default false */
|
|
111
|
+
readonly disabled?: boolean;
|
|
112
|
+
/** Custom style overrides (applied last) */
|
|
113
|
+
readonly style?: ViewStyle | ViewStyle[];
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=Frame.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Frame.types.d.ts","sourceRoot":"","sources":["../../src/Frame/Frame.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KA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edTokens } from '../tokens/types';
|
|
3
|
+
import type { SpacingValue, PaddingProp, GapProp, RadiusValue, RadiusProp, SizingMode, Direction, Alignment, Justification } from './Frame.types';
|
|
4
|
+
/** Resolve a spacing token or number to a pixel value */
|
|
5
|
+
export declare function resolveSpacing(value: SpacingValue, tokens: ResolvedTokens): number;
|
|
6
|
+
/** Resolve padding prop to per-side pixel values */
|
|
7
|
+
export declare function resolvePadding(prop: PaddingProp, tokens: ResolvedTokens): {
|
|
8
|
+
readonly top: number;
|
|
9
|
+
readonly right: number;
|
|
10
|
+
readonly bottom: number;
|
|
11
|
+
readonly left: number;
|
|
12
|
+
};
|
|
13
|
+
/** Resolve gap prop to rowGap/columnGap pixel values */
|
|
14
|
+
export declare function resolveGap(prop: GapProp, tokens: ResolvedTokens): {
|
|
15
|
+
readonly rowGap: number;
|
|
16
|
+
readonly columnGap: number;
|
|
17
|
+
};
|
|
18
|
+
/** Resolve a radius token or number to a pixel value */
|
|
19
|
+
export declare function resolveRadius(value: RadiusValue, tokens: ResolvedTokens): number;
|
|
20
|
+
/** Resolved per-corner radius values */
|
|
21
|
+
export interface ResolvedCorners {
|
|
22
|
+
readonly topLeft: number;
|
|
23
|
+
readonly topRight: number;
|
|
24
|
+
readonly bottomLeft: number;
|
|
25
|
+
readonly bottomRight: number;
|
|
26
|
+
}
|
|
27
|
+
/** Resolve radius prop to per-corner pixel values */
|
|
28
|
+
export declare function resolveRadiusCorners(prop: RadiusProp, tokens: ResolvedTokens): ResolvedCorners;
|
|
29
|
+
/** Check if any corner has a positive radius (for auto-clip) */
|
|
30
|
+
export declare function hasPositiveRadius(corners: ResolvedCorners): boolean;
|
|
31
|
+
/** Resolve width/height sizing modes to ViewStyle properties */
|
|
32
|
+
export declare function resolveSizing(width: SizingMode | undefined, height: SizingMode | undefined): ViewStyle;
|
|
33
|
+
/** Resolve alignment prop to ViewStyle alignItems */
|
|
34
|
+
export declare function resolveAlignment(align: Alignment): ViewStyle['alignItems'];
|
|
35
|
+
/** Resolve justification prop to ViewStyle justifyContent */
|
|
36
|
+
export declare function resolveJustification(justify: Justification): ViewStyle['justifyContent'];
|
|
37
|
+
/** Resolve direction + reverse to ViewStyle flexDirection */
|
|
38
|
+
export declare function resolveFlexDirection(direction: Direction, reverse: boolean): ViewStyle['flexDirection'];
|
|
39
|
+
//# sourceMappingURL=Frame.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Frame.utils.d.ts","sourceRoot":"","sources":["../../src/Frame/Frame.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EACV,YAAY,EAGZ,WAAW,EACX,OAAO,EACP,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACd,MAAM,eAAe,CAAC;AAIvB,yDAAyD;AACzD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,cAAc,GACrB,MAAM,CAGR;AAED,oDAAoD;AACpD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,cAAc,GACrB;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAsBlG;AAED,wDAAwD;AACxD,wBAAgB,UAAU,CACxB,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,cAAc,GACrB;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAWzD;AAID,wDAAwD;AACxD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,cAAc,GACrB,MAAM,CAGR;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,qDAAqD;AACrD,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,cAAc,GACrB,eAAe,CAajB;AAED,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAKnE;AAID,gEAAgE;AAChE,wBAAgB,aAAa,CAC3B,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,MAAM,EAAE,UAAU,GAAG,SAAS,GAC7B,SAAS,CAwBX;AAqBD,qDAAqD;AACrD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC,CAE1E;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAExF;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,GACf,SAAS,CAAC,eAAe,CAAC,CAK5B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Frame } from './Frame';
|
|
2
|
+
export type { FrameProps, SpacingToken, SpacingValue, SpacingSides, SpacingAxes, PaddingProp, GapAxes, GapProp, RadiusToken, RadiusValue, RadiusCorners, RadiusProp, SizingMode, LayoutMode, Direction, Alignment, Justification, } from './Frame.types';
|
|
3
|
+
export type { ResolvedCorners } from './Frame.utils';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Frame/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,OAAO,EACP,WAAW,EACX,WAAW,EACX,aAAa,EACb,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -10,5 +10,5 @@ import type { HueSliderProps } from './HueSlider.types';
|
|
|
10
10
|
* For wrapping ranges (e.g. red: min=345 max=375), max may exceed 359;
|
|
11
11
|
* the returned value is always normalized to [0, 359].
|
|
12
12
|
*/
|
|
13
|
-
export declare function HueSlider({ value, onValueChange, min, max, label, showValue, disabled, style, }: HueSliderProps): React.JSX.Element;
|
|
13
|
+
export declare function HueSlider({ value, onValueChange, min, max, label, showValue, editableValue, disabled, style, }: HueSliderProps): React.JSX.Element;
|
|
14
14
|
//# sourceMappingURL=HueSlider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HueSlider.d.ts","sourceRoot":"","sources":["../../src/HueSlider/HueSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"HueSlider.d.ts","sourceRoot":"","sources":["../../src/HueSlider/HueSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAQxD;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAa,EACb,GAAO,EACP,GAAS,EACT,KAAK,EACL,SAAiB,EACjB,aAAqB,EACrB,QAAgB,EAChB,KAAK,GACN,EAAE,cAAc,qBA+GhB"}
|