react-native-tinyui 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -2
- package/Tinyui.podspec +7 -1
- package/ios/Core/Tinyui.mm +4 -0
- package/ios/Core/TinyuiComponentClasses.mm +35 -9
- package/ios/LiquidGlassText/GlassText-LICENSE +21 -0
- package/ios/LiquidGlassText/TinyuiLiquidGlassTextProvider.swift +250 -0
- package/ios/LiquidGlassText/TinyuiLiquidGlassTextShadowNode.h +46 -0
- package/ios/LiquidGlassText/TinyuiLiquidGlassTextShadowNode.mm +159 -0
- package/ios/LiquidGlassText/TinyuiLiquidGlassTextView.h +12 -0
- package/ios/LiquidGlassText/TinyuiLiquidGlassTextView.mm +63 -0
- package/ios/LiquidGlassText/TinyuiTextOutlineShape.swift +116 -0
- package/ios/Menu/TinyuiMenuProvider.swift +2 -2
- package/ios/Menu/TinyuiMenuView.mm +2 -1
- package/ios/Menu/TinyuiMenuViewSwift.swift +42 -124
- package/lib/module/LiquidGlassText/LiquidGlassTextNativeComponent.ts +16 -0
- package/lib/module/LiquidGlassText/index.js +87 -0
- package/lib/module/LiquidGlassText/index.js.map +1 -0
- package/lib/module/LiquidGlassText/types.js +4 -0
- package/lib/module/LiquidGlassText/types.js.map +1 -0
- package/lib/module/{MenuNativeComponent.ts → Menu/MenuNativeComponent.ts} +6 -2
- package/lib/module/{Menu.js → Menu/index.js} +3 -3
- package/lib/module/Menu/index.js.map +1 -0
- package/lib/module/{MenuOptions.js → Menu/options.js} +3 -3
- package/lib/module/Menu/options.js.map +1 -0
- package/lib/module/Menu/types.js +4 -0
- package/lib/module/Menu/types.js.map +1 -0
- package/lib/module/{PopoverPrimitives.js → Popover/PopoverClose.js} +1 -1
- package/lib/module/Popover/PopoverClose.js.map +1 -0
- package/lib/module/{Popover.js → Popover/index.js} +3 -3
- package/lib/module/Popover/index.js.map +1 -0
- package/lib/module/Popover/types.js +4 -0
- package/lib/module/Popover/types.js.map +1 -0
- package/lib/module/index.js +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/{getNativeTinyui.js → utils/getNativeTinyui.js} +1 -1
- package/lib/module/utils/getNativeTinyui.js.map +1 -0
- package/lib/module/utils/index.js +4 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/src/LiquidGlassText/LiquidGlassTextNativeComponent.d.ts +8 -0
- package/lib/typescript/src/LiquidGlassText/LiquidGlassTextNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/LiquidGlassText/index.d.ts +4 -0
- package/lib/typescript/src/LiquidGlassText/index.d.ts.map +1 -0
- package/lib/typescript/src/LiquidGlassText/types.d.ts +22 -0
- package/lib/typescript/src/LiquidGlassText/types.d.ts.map +1 -0
- package/lib/typescript/src/{MenuNativeComponent.d.ts → Menu/MenuNativeComponent.d.ts} +2 -2
- package/lib/typescript/src/Menu/MenuNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/{Menu.d.ts → Menu/index.d.ts} +3 -3
- package/lib/typescript/src/Menu/index.d.ts.map +1 -0
- package/lib/typescript/src/Menu/options.d.ts +47 -0
- package/lib/typescript/src/Menu/options.d.ts.map +1 -0
- package/lib/typescript/src/{Menu.types.d.ts → Menu/types.d.ts} +1 -1
- package/lib/typescript/src/Menu/types.d.ts.map +1 -0
- package/lib/typescript/src/{PopoverPrimitives.d.ts → Popover/PopoverClose.d.ts} +2 -2
- package/lib/typescript/src/Popover/PopoverClose.d.ts.map +1 -0
- package/lib/typescript/src/Popover/PopoverNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/Popover/index.d.ts +8 -0
- package/lib/typescript/src/Popover/index.d.ts.map +1 -0
- package/lib/typescript/src/{Popover.types.d.ts → Popover/types.d.ts} +1 -1
- package/lib/typescript/src/Popover/types.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +8 -6
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/{getNativeTinyui.d.ts → utils/getNativeTinyui.d.ts} +2 -2
- package/lib/typescript/src/utils/getNativeTinyui.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +3 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/package.json +19 -10
- package/src/LiquidGlassText/LiquidGlassTextNativeComponent.ts +16 -0
- package/src/LiquidGlassText/index.tsx +113 -0
- package/src/LiquidGlassText/types.ts +37 -0
- package/src/{MenuNativeComponent.ts → Menu/MenuNativeComponent.ts} +6 -2
- package/src/{Menu.tsx → Menu/index.tsx} +4 -4
- package/src/{MenuOptions.ts → Menu/options.ts} +7 -3
- package/src/{PopoverPrimitives.tsx → Popover/PopoverClose.tsx} +1 -1
- package/src/{Popover.tsx → Popover/index.tsx} +12 -3
- package/src/index.tsx +12 -4
- package/src/react-native.d.ts +1 -0
- package/src/{getNativeTinyui.ts → utils/getNativeTinyui.ts} +2 -2
- package/src/utils/index.ts +2 -0
- package/lib/module/Menu.js.map +0 -1
- package/lib/module/Menu.types.js +0 -4
- package/lib/module/Menu.types.js.map +0 -1
- package/lib/module/MenuOptions.js.map +0 -1
- package/lib/module/Popover.js.map +0 -1
- package/lib/module/Popover.types.js +0 -4
- package/lib/module/Popover.types.js.map +0 -1
- package/lib/module/PopoverPrimitives.js.map +0 -1
- package/lib/module/getNativeTinyui.js.map +0 -1
- package/lib/typescript/src/Menu.d.ts.map +0 -1
- package/lib/typescript/src/Menu.types.d.ts.map +0 -1
- package/lib/typescript/src/MenuNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/MenuOptions.d.ts +0 -7
- package/lib/typescript/src/MenuOptions.d.ts.map +0 -1
- package/lib/typescript/src/Popover.d.ts +0 -7
- package/lib/typescript/src/Popover.d.ts.map +0 -1
- package/lib/typescript/src/Popover.types.d.ts.map +0 -1
- package/lib/typescript/src/PopoverNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/PopoverPrimitives.d.ts.map +0 -1
- package/lib/typescript/src/getNativeTinyui.d.ts.map +0 -1
- /package/lib/module/{PopoverNativeComponent.ts → Popover/PopoverNativeComponent.ts} +0 -0
- /package/lib/typescript/src/{PopoverNativeComponent.d.ts → Popover/PopoverNativeComponent.d.ts} +0 -0
- /package/src/{Menu.types.ts → Menu/types.ts} +0 -0
- /package/src/{PopoverNativeComponent.ts → Popover/PopoverNativeComponent.ts} +0 -0
- /package/src/{Popover.types.ts → Popover/types.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["Popover/types.ts"],"mappings":"","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
export { Menu } from "./Menu.js";
|
|
4
|
-
export { Popover, PopoverClose } from "./Popover.js";
|
|
5
|
-
export { getNativeTinyui, assertComponentEnabled } from "./
|
|
3
|
+
export { Menu } from "./Menu/index.js";
|
|
4
|
+
export { Popover, PopoverClose } from "./Popover/index.js";
|
|
5
|
+
export { getNativeTinyui, assertComponentEnabled } from "./utils/index.js";
|
|
6
|
+
export { LiquidGlassText } from "./LiquidGlassText/index.js";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Menu","Popover","PopoverClose","getNativeTinyui","assertComponentEnabled"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"names":["Menu","Popover","PopoverClose","getNativeTinyui","assertComponentEnabled","LiquidGlassText"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,iBAAQ;AAW7B,SAASC,OAAO,EAAEC,YAAY,QAAQ,oBAAW;AAUjD,SAASC,eAAe,EAAEC,sBAAsB,QAAQ,kBAAS;AAGjE,SAASC,eAAe,QAAQ,4BAAmB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeTinyui","nativeTinyui","enabledComponents","getNativeTinyui","Error","assertComponentEnabled","component","tinyui","Set","getEnabledComponents","has"],"sourceRoot":"../../../src","sources":["utils/getNativeTinyui.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAqB,oBAAiB;AAIzD,IAAIC,YAAqC;AACzC,IAAIC,iBAAkD;;AAEtD;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAA,EAAS;EACtCF,YAAY,KAAKD,YAAY;EAC7B,IAAIC,YAAY,IAAI,IAAI,EAAE;IACxB,MAAM,IAAIG,KAAK,CACb,sDAAsD,GACpD,8DACJ,CAAC;EACH;EACA,OAAOH,YAAY;AACrB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASI,sBAAsBA,CAACC,SAA0B,EAAQ;EACvE,MAAMC,MAAM,GAAGJ,eAAe,CAAC,CAAC;EAChCD,iBAAiB,KAAK,IAAIM,GAAG,CAACD,MAAM,CAACE,oBAAoB,CAAC,CAAC,CAAC;EAE5D,IAAI,CAACP,iBAAiB,CAACQ,GAAG,CAACJ,SAAS,CAAC,EAAE;IACrC,MAAM,IAAIF,KAAK,CACb,gBAAgBE,SAAS,+BAA+B,GACtD,QAAQA,SAAS,kDAAkD,GACnE,sCACJ,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getNativeTinyui","assertComponentEnabled"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;AAAA,SAASA,eAAe,EAAEC,sBAAsB,QAAQ,sBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type CodegenTypes, type ColorValue, type ViewProps } from 'react-native';
|
|
2
|
+
export interface NativeLiquidGlassTextProps extends ViewProps {
|
|
3
|
+
configuration: CodegenTypes.UnsafeMixed;
|
|
4
|
+
tintColor?: ColorValue;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeLiquidGlassTextProps>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=LiquidGlassTextNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiquidGlassTextNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/LiquidGlassText/LiquidGlassTextNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,0BAA2B,SAAQ,SAAS;IAC3D,aAAa,EAAE,YAAY,CAAC,WAAW,CAAC;IACxC,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;;AAED,wBAGE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LiquidGlassTextProps } from './types.js';
|
|
2
|
+
export declare const LiquidGlassText: import("react").ForwardRefExoticComponent<LiquidGlassTextProps & import("react").RefAttributes<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>>;
|
|
3
|
+
export type { LiquidGlassTextFontDesign, LiquidGlassTextEffect, LiquidGlassTextProps, LiquidGlassTextStyle, } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/LiquidGlassText/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAS,CAAC;AA4CpD,eAAO,MAAM,eAAe,kMAyD1B,CAAC;AAEH,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,YAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ColorValue, StyleProp, TextStyle, ViewProps } from 'react-native';
|
|
2
|
+
export type LiquidGlassTextFontDesign = 'default' | 'serif' | 'monospaced' | 'rounded';
|
|
3
|
+
export type LiquidGlassTextEffect = 'clear' | 'regular' | 'identity';
|
|
4
|
+
/** React Native text styles supported by the native glass renderer. */
|
|
5
|
+
export type LiquidGlassTextStyle = Readonly<Pick<TextStyle, 'color' | 'fontFamily' | 'fontSize' | 'fontStyle' | 'fontWeight' | 'letterSpacing' | 'textAlign'>>;
|
|
6
|
+
export interface LiquidGlassTextProps extends Omit<ViewProps, 'children'> {
|
|
7
|
+
/** Text to display. Pass translated strings from JavaScript if needed. */
|
|
8
|
+
text: string;
|
|
9
|
+
/** Glass effect. Defaults to clear. Native glass requires iOS 26+. */
|
|
10
|
+
effect?: LiquidGlassTextEffect;
|
|
11
|
+
/** Glass tint and fallback text color. */
|
|
12
|
+
tint?: ColorValue;
|
|
13
|
+
/** Whether the glass responds to pointer and touch interaction. */
|
|
14
|
+
interactive?: boolean;
|
|
15
|
+
/** Overrides the system font design. */
|
|
16
|
+
fontDesign?: LiquidGlassTextFontDesign;
|
|
17
|
+
/** Familiar React Native text styles. Explicit alignment takes precedence. */
|
|
18
|
+
textStyle?: StyleProp<LiquidGlassTextStyle>;
|
|
19
|
+
/** Aligns explicit newline-separated lines. Defaults to leading. */
|
|
20
|
+
multilineTextAlignment?: 'leading' | 'center' | 'trailing';
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/LiquidGlassText/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,MAAM,MAAM,yBAAyB,GACnC,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;AAEjD,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;AAErE,uEAAuE;AACvE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CACzC,IAAI,CACF,SAAS,EACP,OAAO,GACP,YAAY,GACZ,UAAU,GACV,WAAW,GACX,YAAY,GACZ,eAAe,GACf,WAAW,CACd,CACF,CAAC;AAEF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACvE,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,0CAA0C;IAC1C,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,8EAA8E;IAC9E,SAAS,CAAC,EAAE,SAAS,CAAC,oBAAoB,CAAC,CAAC;IAC5C,oEAAoE;IACpE,sBAAsB,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;CAC5D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ViewProps } from 'react-native';
|
|
1
|
+
import { type CodegenTypes, type ViewProps } from 'react-native';
|
|
2
2
|
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
3
|
export interface NativeMenuProps extends ViewProps {
|
|
4
|
-
menuConfig:
|
|
4
|
+
menuConfig: CodegenTypes.UnsafeMixed;
|
|
5
5
|
title?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
hasPrimaryAction?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/Menu/MenuNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,UAAU,EAAE,YAAY,CAAC,WAAW,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAC3D,eAAe,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;CAC5C;;AAED,wBAEG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MenuComponent } from './
|
|
1
|
+
import type { MenuComponent } from './types.js';
|
|
2
2
|
export declare const Menu: MenuComponent;
|
|
3
|
-
export type { MenuActionOption, MenuDividerOption, MenuItemState, MenuOption, MenuProps, MenuSectionOption, MenuSubmenuOption, } from './
|
|
4
|
-
//# sourceMappingURL=
|
|
3
|
+
export type { MenuActionOption, MenuDividerOption, MenuItemState, MenuOption, MenuProps, MenuSectionOption, MenuSubmenuOption, } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Menu/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,YAAS,CAAC;AAuCxD,eAAO,MAAM,IAAI,EAAe,aAAa,CAAC;AAE9C,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,YAAS,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { processColor } from 'react-native';
|
|
2
|
+
import type { MenuOption } from './types.js';
|
|
3
|
+
type NativeMenuColor = ReturnType<typeof processColor>;
|
|
4
|
+
interface NativeMenuLabel {
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
systemImage?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
iconColor?: NativeMenuColor;
|
|
10
|
+
titleColor?: NativeMenuColor;
|
|
11
|
+
}
|
|
12
|
+
interface NativeMenuAction extends NativeMenuLabel {
|
|
13
|
+
type: 'action';
|
|
14
|
+
id: string;
|
|
15
|
+
state: 'off' | 'on' | 'mixed';
|
|
16
|
+
destructive: boolean;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
hidden: boolean;
|
|
19
|
+
keepOpen: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface NativeMenuSubmenu extends NativeMenuLabel {
|
|
22
|
+
type: 'submenu';
|
|
23
|
+
destructive: boolean;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
hidden: boolean;
|
|
26
|
+
displayInline: boolean;
|
|
27
|
+
children: NativeMenuElement[];
|
|
28
|
+
}
|
|
29
|
+
interface NativeMenuSection {
|
|
30
|
+
type: 'section';
|
|
31
|
+
title?: string;
|
|
32
|
+
children: NativeMenuElement[];
|
|
33
|
+
}
|
|
34
|
+
interface NativeMenuSeparator {
|
|
35
|
+
type: 'separator';
|
|
36
|
+
}
|
|
37
|
+
type NativeMenuElement = NativeMenuAction | NativeMenuSubmenu | NativeMenuSection | NativeMenuSeparator;
|
|
38
|
+
interface NativeMenuConfiguration {
|
|
39
|
+
items: NativeMenuElement[];
|
|
40
|
+
}
|
|
41
|
+
export interface SerializedMenuOptions {
|
|
42
|
+
config: NativeMenuConfiguration;
|
|
43
|
+
callbacks: Map<string, () => void>;
|
|
44
|
+
}
|
|
45
|
+
export declare function serializeMenuOptions(options: readonly MenuOption[]): SerializedMenuOptions;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/Menu/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAE1C,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAEvD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,UAAU,gBAAiB,SAAQ,eAAe;IAChD,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,iBAAkB,SAAQ,eAAe;IACjD,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,UAAU,mBAAmB;IAC3B,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,KAAK,iBAAiB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,CAAC;AAExB,UAAU,uBAAuB;IAC/B,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,uBAAuB,CAAC;IAChC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC;CACpC;AAMD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,UAAU,EAAE,GAC7B,qBAAqB,CAQvB"}
|
|
@@ -62,4 +62,4 @@ export interface MenuProps extends Omit<ViewProps, 'children'> {
|
|
|
62
62
|
export interface MenuComponent extends ForwardRefExoticComponent<MenuProps & RefAttributes<ComponentRef<typeof View>>> {
|
|
63
63
|
}
|
|
64
64
|
export {};
|
|
65
|
-
//# sourceMappingURL=
|
|
65
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/Menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,SAAS,EACT,aAAa,EACd,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC;AAEnD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+FAA+F;IAC/F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,oDAAoD;IACpD,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,mEAAmE;IACnE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,gEAAgE;IAChE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,IAAI,EAAE,SAAS,CAAC;IAChB,yDAAyD;IACzD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,MAAM,UAAU,GACpB,gBAAgB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAE/E,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC5D,2BAA2B;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,aAAc,SAAQ,yBAAyB,CAC9D,SAAS,GAAG,aAAa,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC,CACrD;CAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { PopoverCloseProps } from './
|
|
2
|
+
import type { PopoverCloseProps } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* A button that dismisses the popover. Render it inside the `content` prop
|
|
5
5
|
* and pass the `close` callback from the render-function arguments:
|
|
@@ -18,4 +18,4 @@ export declare function PopoverClose({ close, onPress, ...props }: PopoverCloseP
|
|
|
18
18
|
export declare namespace PopoverClose {
|
|
19
19
|
var displayName: string;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=PopoverClose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverClose.d.ts","sourceRoot":"","sources":["../../../../src/Popover/PopoverClose.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAS,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,OAAO,EACP,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,SAAS,CAU/B;yBAde,YAAY"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/Popover/PopoverNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;QAAE,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;CAC9E;;AAED,wBAEG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PopoverClose } from './PopoverClose.js';
|
|
2
|
+
import type { PopoverComponent } from './types.js';
|
|
3
|
+
export declare const Popover: PopoverComponent & {
|
|
4
|
+
Close: typeof PopoverClose;
|
|
5
|
+
};
|
|
6
|
+
export { PopoverClose };
|
|
7
|
+
export type { PopoverArrowEdge, PopoverAttachmentAnchor, PopoverCloseProps, PopoverContent, PopoverContentRenderArgs, PopoverProps, } from './types.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Popover/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAgB,CAAC;AAC9C,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM,YAAS,CAAC;AA0EjB,eAAO,MAAM,OAAO,EAEd,gBAAgB,GAAG;IACvB,KAAK,EAAE,OAAO,YAAY,CAAC;CAC5B,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,YAAY,GACb,MAAM,YAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/Popover/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACd,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,MAAM,MAAM,uBAAuB,GACjC,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAC1B,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErD,uDAAuD;AACvD,MAAM,WAAW,wBAAwB;IACvC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,MAAM,cAAc,GACxB,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,wBAAwB,KAAK,SAAS,CAAC,CAAC;AAE9D,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/D,yDAAyD;IACzD,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,OAAO,EAAE,cAAc,CAAC;IACxB,qCAAqC;IACrC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mDAAmD;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAiB,SAAQ,yBAAyB,CACjE,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC,CACxD;CAAG;AAEJ,mDAAmD;AACnD,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,qFAAqF;IACrF,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export { Menu } from './Menu.js';
|
|
2
|
-
export type { MenuActionOption, MenuDividerOption, MenuItemState, MenuOption, MenuProps, MenuSectionOption, MenuSubmenuOption, } from './Menu.
|
|
3
|
-
export { Popover, PopoverClose } from './Popover.js';
|
|
4
|
-
export type { PopoverArrowEdge, PopoverAttachmentAnchor, PopoverCloseProps, PopoverContent, PopoverContentRenderArgs, PopoverProps, } from './Popover.
|
|
5
|
-
export { getNativeTinyui, assertComponentEnabled } from './
|
|
6
|
-
export type { TinyuiComponent } from './
|
|
1
|
+
export { Menu } from './Menu/index.js';
|
|
2
|
+
export type { MenuActionOption, MenuDividerOption, MenuItemState, MenuOption, MenuProps, MenuSectionOption, MenuSubmenuOption, } from './Menu/index.js';
|
|
3
|
+
export { Popover, PopoverClose } from './Popover/index.js';
|
|
4
|
+
export type { PopoverArrowEdge, PopoverAttachmentAnchor, PopoverCloseProps, PopoverContent, PopoverContentRenderArgs, PopoverProps, } from './Popover/index.js';
|
|
5
|
+
export { getNativeTinyui, assertComponentEnabled } from './utils/index.js';
|
|
6
|
+
export type { TinyuiComponent } from './utils/index.js';
|
|
7
|
+
export { LiquidGlassText } from './LiquidGlassText/index.js';
|
|
8
|
+
export type { LiquidGlassTextFontDesign, LiquidGlassTextEffect, LiquidGlassTextProps, LiquidGlassTextStyle, } from './LiquidGlassText/index.js';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAQ,CAAC;AAC9B,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAQ,CAAC;AAEhB,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAW,CAAC;AAClD,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,YAAY,GACb,MAAM,oBAAW,CAAC;AAEnB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,kBAAS,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAS,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAAmB,CAAC;AACpD,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,4BAAmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Spec } from '
|
|
2
|
-
export type TinyuiComponent = 'Menu' | 'Popover';
|
|
1
|
+
import { type Spec } from '../NativeTinyui.js';
|
|
2
|
+
export type TinyuiComponent = 'Menu' | 'Popover' | 'LiquidGlassText';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the Tinyui TurboModule instance. The native module is always
|
|
5
5
|
* compiled (Core), so this is safe to call.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNativeTinyui.d.ts","sourceRoot":"","sources":["../../../../src/utils/getNativeTinyui.ts"],"names":[],"mappings":"AAAA,OAAqB,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAiB,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAAC;AAKrE;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAStC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI,CAWvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAmB,CAAC;AAC5E,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tinyui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Dependency-free native iOS Menu and
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Dependency-free native iOS Menu, Popover and LiquidGlassText components for React Native",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -11,16 +11,21 @@
|
|
|
11
11
|
"default": "./lib/module/index.js"
|
|
12
12
|
},
|
|
13
13
|
"./menu": {
|
|
14
|
-
"react-native-tinyui-source": "./src/Menu.tsx",
|
|
15
|
-
"types": "./lib/typescript/src/Menu.d.ts",
|
|
16
|
-
"default": "./lib/module/Menu.js"
|
|
14
|
+
"react-native-tinyui-source": "./src/Menu/index.tsx",
|
|
15
|
+
"types": "./lib/typescript/src/Menu/index.d.ts",
|
|
16
|
+
"default": "./lib/module/Menu/index.js"
|
|
17
17
|
},
|
|
18
18
|
"./popover": {
|
|
19
|
-
"react-native-tinyui-source": "./src/Popover.tsx",
|
|
20
|
-
"types": "./lib/typescript/src/Popover.d.ts",
|
|
21
|
-
"default": "./lib/module/Popover.js"
|
|
19
|
+
"react-native-tinyui-source": "./src/Popover/index.tsx",
|
|
20
|
+
"types": "./lib/typescript/src/Popover/index.d.ts",
|
|
21
|
+
"default": "./lib/module/Popover/index.js"
|
|
22
22
|
},
|
|
23
|
-
"./package.json": "./package.json"
|
|
23
|
+
"./package.json": "./package.json",
|
|
24
|
+
"./liquid-glass-text": {
|
|
25
|
+
"react-native-tinyui-source": "./src/LiquidGlassText/index.tsx",
|
|
26
|
+
"types": "./lib/typescript/src/LiquidGlassText/index.d.ts",
|
|
27
|
+
"default": "./lib/module/LiquidGlassText/index.js"
|
|
28
|
+
}
|
|
24
29
|
},
|
|
25
30
|
"files": [
|
|
26
31
|
"src",
|
|
@@ -47,7 +52,8 @@
|
|
|
47
52
|
"ios",
|
|
48
53
|
"menu",
|
|
49
54
|
"popover",
|
|
50
|
-
"fabric"
|
|
55
|
+
"fabric",
|
|
56
|
+
"liquid-glass"
|
|
51
57
|
],
|
|
52
58
|
"repository": {
|
|
53
59
|
"type": "git",
|
|
@@ -128,6 +134,9 @@
|
|
|
128
134
|
},
|
|
129
135
|
"TinyuiPopoverView": {
|
|
130
136
|
"className": "TinyuiPopoverView"
|
|
137
|
+
},
|
|
138
|
+
"TinyuiLiquidGlassTextView": {
|
|
139
|
+
"className": "TinyuiLiquidGlassTextView"
|
|
131
140
|
}
|
|
132
141
|
}
|
|
133
142
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
codegenNativeComponent,
|
|
3
|
+
type CodegenTypes,
|
|
4
|
+
type ColorValue,
|
|
5
|
+
type ViewProps,
|
|
6
|
+
} from 'react-native';
|
|
7
|
+
|
|
8
|
+
export interface NativeLiquidGlassTextProps extends ViewProps {
|
|
9
|
+
configuration: CodegenTypes.UnsafeMixed;
|
|
10
|
+
tintColor?: ColorValue;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default codegenNativeComponent<NativeLiquidGlassTextProps>(
|
|
14
|
+
'TinyuiLiquidGlassTextView',
|
|
15
|
+
{ excludedPlatforms: ['android'] }
|
|
16
|
+
);
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { forwardRef, type ComponentRef } from 'react';
|
|
2
|
+
import { StyleSheet, type TextStyle, type View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { assertComponentEnabled } from '../utils';
|
|
5
|
+
import type { LiquidGlassTextProps } from './types';
|
|
6
|
+
import NativeLiquidGlassTextView from './LiquidGlassTextNativeComponent';
|
|
7
|
+
|
|
8
|
+
function normalizeFontWeight(
|
|
9
|
+
fontWeight: TextStyle['fontWeight']
|
|
10
|
+
): string | undefined {
|
|
11
|
+
if (fontWeight == null) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const value = String(fontWeight);
|
|
16
|
+
const aliases: Readonly<Record<string, string>> = {
|
|
17
|
+
'normal': 'regular',
|
|
18
|
+
'ultralight': 'ultraLight',
|
|
19
|
+
'condensed': 'regular',
|
|
20
|
+
'condensedBold': 'bold',
|
|
21
|
+
'100': 'ultraLight',
|
|
22
|
+
'200': 'thin',
|
|
23
|
+
'300': 'light',
|
|
24
|
+
'400': 'regular',
|
|
25
|
+
'500': 'medium',
|
|
26
|
+
'600': 'semibold',
|
|
27
|
+
'700': 'bold',
|
|
28
|
+
'800': 'heavy',
|
|
29
|
+
'900': 'black',
|
|
30
|
+
};
|
|
31
|
+
return aliases[value] ?? value;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function resolveAlignment(
|
|
35
|
+
textAlign: TextStyle['textAlign']
|
|
36
|
+
): 'leading' | 'center' | 'trailing' | undefined {
|
|
37
|
+
switch (textAlign) {
|
|
38
|
+
case 'center':
|
|
39
|
+
return 'center';
|
|
40
|
+
case 'right':
|
|
41
|
+
return 'trailing';
|
|
42
|
+
case 'left':
|
|
43
|
+
return 'leading';
|
|
44
|
+
default:
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const LiquidGlassText = forwardRef<
|
|
50
|
+
ComponentRef<typeof View>,
|
|
51
|
+
LiquidGlassTextProps
|
|
52
|
+
>(function LiquidGlassTextRoot(
|
|
53
|
+
{
|
|
54
|
+
text,
|
|
55
|
+
effect = 'clear',
|
|
56
|
+
tint,
|
|
57
|
+
interactive = false,
|
|
58
|
+
fontDesign,
|
|
59
|
+
textStyle,
|
|
60
|
+
multilineTextAlignment,
|
|
61
|
+
style,
|
|
62
|
+
accessibilityLabel,
|
|
63
|
+
accessible = true,
|
|
64
|
+
accessibilityRole = 'text',
|
|
65
|
+
...viewProps
|
|
66
|
+
},
|
|
67
|
+
ref
|
|
68
|
+
) {
|
|
69
|
+
assertComponentEnabled('LiquidGlassText');
|
|
70
|
+
|
|
71
|
+
const flattenedTextStyle = StyleSheet.flatten(textStyle);
|
|
72
|
+
const normalizedTextStyle = flattenedTextStyle
|
|
73
|
+
? {
|
|
74
|
+
fontSize: flattenedTextStyle.fontSize,
|
|
75
|
+
fontFamily: flattenedTextStyle.fontFamily,
|
|
76
|
+
fontWeight: normalizeFontWeight(flattenedTextStyle.fontWeight),
|
|
77
|
+
fontStyle: flattenedTextStyle.fontStyle,
|
|
78
|
+
letterSpacing: flattenedTextStyle.letterSpacing,
|
|
79
|
+
}
|
|
80
|
+
: undefined;
|
|
81
|
+
const resolvedAlignment =
|
|
82
|
+
multilineTextAlignment ??
|
|
83
|
+
resolveAlignment(flattenedTextStyle?.textAlign) ??
|
|
84
|
+
'leading';
|
|
85
|
+
|
|
86
|
+
const configuration = {
|
|
87
|
+
text,
|
|
88
|
+
effect,
|
|
89
|
+
interactive,
|
|
90
|
+
fontDesign,
|
|
91
|
+
...(normalizedTextStyle ? { textStyle: normalizedTextStyle } : {}),
|
|
92
|
+
multilineTextAlignment: resolvedAlignment,
|
|
93
|
+
};
|
|
94
|
+
return (
|
|
95
|
+
<NativeLiquidGlassTextView
|
|
96
|
+
{...viewProps}
|
|
97
|
+
ref={ref}
|
|
98
|
+
accessible={accessible}
|
|
99
|
+
accessibilityRole={accessibilityRole}
|
|
100
|
+
accessibilityLabel={accessibilityLabel ?? text}
|
|
101
|
+
configuration={configuration}
|
|
102
|
+
tintColor={tint ?? flattenedTextStyle?.color}
|
|
103
|
+
style={style}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export type {
|
|
109
|
+
LiquidGlassTextFontDesign,
|
|
110
|
+
LiquidGlassTextEffect,
|
|
111
|
+
LiquidGlassTextProps,
|
|
112
|
+
LiquidGlassTextStyle,
|
|
113
|
+
} from './types';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ColorValue, StyleProp, TextStyle, ViewProps } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export type LiquidGlassTextFontDesign =
|
|
4
|
+
'default' | 'serif' | 'monospaced' | 'rounded';
|
|
5
|
+
|
|
6
|
+
export type LiquidGlassTextEffect = 'clear' | 'regular' | 'identity';
|
|
7
|
+
|
|
8
|
+
/** React Native text styles supported by the native glass renderer. */
|
|
9
|
+
export type LiquidGlassTextStyle = Readonly<
|
|
10
|
+
Pick<
|
|
11
|
+
TextStyle,
|
|
12
|
+
| 'color'
|
|
13
|
+
| 'fontFamily'
|
|
14
|
+
| 'fontSize'
|
|
15
|
+
| 'fontStyle'
|
|
16
|
+
| 'fontWeight'
|
|
17
|
+
| 'letterSpacing'
|
|
18
|
+
| 'textAlign'
|
|
19
|
+
>
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export interface LiquidGlassTextProps extends Omit<ViewProps, 'children'> {
|
|
23
|
+
/** Text to display. Pass translated strings from JavaScript if needed. */
|
|
24
|
+
text: string;
|
|
25
|
+
/** Glass effect. Defaults to clear. Native glass requires iOS 26+. */
|
|
26
|
+
effect?: LiquidGlassTextEffect;
|
|
27
|
+
/** Glass tint and fallback text color. */
|
|
28
|
+
tint?: ColorValue;
|
|
29
|
+
/** Whether the glass responds to pointer and touch interaction. */
|
|
30
|
+
interactive?: boolean;
|
|
31
|
+
/** Overrides the system font design. */
|
|
32
|
+
fontDesign?: LiquidGlassTextFontDesign;
|
|
33
|
+
/** Familiar React Native text styles. Explicit alignment takes precedence. */
|
|
34
|
+
textStyle?: StyleProp<LiquidGlassTextStyle>;
|
|
35
|
+
/** Aligns explicit newline-separated lines. Defaults to leading. */
|
|
36
|
+
multilineTextAlignment?: 'leading' | 'center' | 'trailing';
|
|
37
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
codegenNativeComponent,
|
|
3
|
+
type CodegenTypes,
|
|
4
|
+
type ViewProps,
|
|
5
|
+
} from 'react-native';
|
|
2
6
|
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
7
|
|
|
4
8
|
export interface NativeMenuProps extends ViewProps {
|
|
5
|
-
menuConfig:
|
|
9
|
+
menuConfig: CodegenTypes.UnsafeMixed;
|
|
6
10
|
title?: string;
|
|
7
11
|
disabled?: boolean;
|
|
8
12
|
hasPrimaryAction?: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { forwardRef, type ComponentRef } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { assertComponentEnabled } from '
|
|
5
|
-
import type { MenuComponent, MenuProps } from './
|
|
4
|
+
import { assertComponentEnabled } from '../utils';
|
|
5
|
+
import type { MenuComponent, MenuProps } from './types';
|
|
6
6
|
import NativeMenuView from './MenuNativeComponent';
|
|
7
|
-
import { serializeMenuOptions } from './
|
|
7
|
+
import { serializeMenuOptions } from './options';
|
|
8
8
|
|
|
9
9
|
const MenuRoot = forwardRef<ComponentRef<typeof View>, MenuProps>(function Menu(
|
|
10
10
|
{
|
|
@@ -51,4 +51,4 @@ export type {
|
|
|
51
51
|
MenuProps,
|
|
52
52
|
MenuSectionOption,
|
|
53
53
|
MenuSubmenuOption,
|
|
54
|
-
} from './
|
|
54
|
+
} from './types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { processColor, type ColorValue } from 'react-native';
|
|
2
2
|
|
|
3
|
-
import type { MenuOption } from './
|
|
3
|
+
import type { MenuOption } from './types';
|
|
4
4
|
|
|
5
5
|
type NativeMenuColor = ReturnType<typeof processColor>;
|
|
6
6
|
|
|
@@ -48,8 +48,12 @@ type NativeMenuElement =
|
|
|
48
48
|
| NativeMenuSection
|
|
49
49
|
| NativeMenuSeparator;
|
|
50
50
|
|
|
51
|
+
interface NativeMenuConfiguration {
|
|
52
|
+
items: NativeMenuElement[];
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
export interface SerializedMenuOptions {
|
|
52
|
-
config:
|
|
56
|
+
config: NativeMenuConfiguration;
|
|
53
57
|
callbacks: Map<string, () => void>;
|
|
54
58
|
}
|
|
55
59
|
|
|
@@ -65,7 +69,7 @@ export function serializeMenuOptions(
|
|
|
65
69
|
|
|
66
70
|
return {
|
|
67
71
|
callbacks,
|
|
68
|
-
config:
|
|
72
|
+
config: { items },
|
|
69
73
|
};
|
|
70
74
|
}
|
|
71
75
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { Pressable } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import type { PopoverCloseProps } from './
|
|
4
|
+
import type { PopoverCloseProps } from './types';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A button that dismisses the popover. Render it inside the `content` prop
|
|
@@ -2,14 +2,14 @@ import { forwardRef, useCallback, useState, type ComponentRef } from 'react';
|
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { PlatformColor, Pressable, StyleSheet, View } from 'react-native';
|
|
4
4
|
|
|
5
|
-
import { assertComponentEnabled } from '
|
|
6
|
-
import { PopoverClose } from './
|
|
5
|
+
import { assertComponentEnabled } from '../utils';
|
|
6
|
+
import { PopoverClose } from './PopoverClose';
|
|
7
7
|
import type {
|
|
8
8
|
PopoverComponent,
|
|
9
9
|
PopoverContentRenderArgs,
|
|
10
10
|
PopoverContent as PopoverContentType,
|
|
11
11
|
PopoverProps,
|
|
12
|
-
} from './
|
|
12
|
+
} from './types';
|
|
13
13
|
import NativePopoverView from './PopoverNativeComponent';
|
|
14
14
|
|
|
15
15
|
const PopoverRoot = forwardRef<ComponentRef<typeof View>, PopoverProps>(
|
|
@@ -90,3 +90,12 @@ export const Popover = Object.assign(PopoverRoot, {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
export { PopoverClose };
|
|
93
|
+
|
|
94
|
+
export type {
|
|
95
|
+
PopoverArrowEdge,
|
|
96
|
+
PopoverAttachmentAnchor,
|
|
97
|
+
PopoverCloseProps,
|
|
98
|
+
PopoverContent,
|
|
99
|
+
PopoverContentRenderArgs,
|
|
100
|
+
PopoverProps,
|
|
101
|
+
} from './types';
|