react-native-tinyui 0.5.0 → 1.0.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 +351 -22
- package/ios/ConcentricView/TinyuiConcentricView.h +12 -0
- package/ios/ConcentricView/TinyuiConcentricView.mm +60 -0
- package/ios/Core/Tinyui.mm +54 -0
- package/ios/Core/TinyuiComponentClasses.mm +44 -0
- package/ios/Menu/TinyuiMenuBuilder.swift +238 -0
- package/ios/Menu/TinyuiMenuProvider.swift +51 -85
- package/ios/Menu/TinyuiMenuView.mm +12 -35
- package/ios/Popover/TinyuiPopoverProvider.swift +198 -44
- package/ios/Popover/TinyuiPopoverView.mm +26 -1
- package/ios/SFSymbol/TinyuiSFSymbolEffects.h +9 -0
- package/ios/SFSymbol/TinyuiSFSymbolEffects.mm +180 -0
- package/ios/SFSymbol/TinyuiSFSymbolImage.h +8 -0
- package/ios/SFSymbol/TinyuiSFSymbolImage.mm +141 -0
- package/ios/SFSymbol/TinyuiSFSymbolShadowNode.h +31 -0
- package/ios/SFSymbol/TinyuiSFSymbolShadowNode.mm +30 -0
- package/ios/SFSymbol/TinyuiSFSymbolView.h +4 -0
- package/ios/SFSymbol/TinyuiSFSymbolView.mm +173 -0
- package/ios/Stepper/TinyuiStepperShadowNode.h +32 -0
- package/ios/Stepper/TinyuiStepperShadowNode.mm +28 -0
- package/ios/Stepper/TinyuiStepperView.h +12 -0
- package/ios/Stepper/TinyuiStepperView.mm +128 -0
- package/ios/TipKit/TinyuiTip.swift +31 -0
- package/ios/TipKit/TinyuiTipPopoverProvider.swift +276 -0
- package/ios/TipKit/TinyuiTipPopoverView.h +8 -0
- package/ios/TipKit/TinyuiTipPopoverView.mm +114 -0
- package/ios/TipKit/TinyuiTipsRuntime.swift +148 -0
- package/lib/module/ConcentricView/ConcentricViewNativeComponent.ts +14 -0
- package/lib/module/ConcentricView/index.js +29 -0
- package/lib/module/ConcentricView/index.js.map +1 -0
- package/lib/module/ConcentricView/types.js +4 -0
- package/lib/module/ConcentricView/types.js.map +1 -0
- package/lib/module/Menu/MenuNativeComponent.ts +1 -3
- package/lib/module/Menu/index.js +4 -9
- package/lib/module/Menu/index.js.map +1 -1
- package/lib/module/Menu/options.js +4 -12
- package/lib/module/Menu/options.js.map +1 -1
- package/lib/module/NativeTinyui.js.map +1 -1
- package/lib/module/Popover/index.js +4 -2
- package/lib/module/Popover/index.js.map +1 -1
- package/lib/module/SFSymbol/SFSymbolNativeComponent.ts +20 -0
- package/lib/module/SFSymbol/index.js +73 -0
- package/lib/module/SFSymbol/index.js.map +1 -0
- package/lib/module/SFSymbol/options.js +79 -0
- package/lib/module/SFSymbol/options.js.map +1 -0
- package/lib/module/SFSymbol/types.js +4 -0
- package/lib/module/SFSymbol/types.js.map +1 -0
- package/lib/module/Stepper/StepperNativeComponent.ts +29 -0
- package/lib/module/Stepper/index.js +75 -0
- package/lib/module/Stepper/index.js.map +1 -0
- package/lib/module/Stepper/types.js +4 -0
- package/lib/module/Stepper/types.js.map +1 -0
- package/lib/module/TipKit/Popover.js +89 -0
- package/lib/module/TipKit/Popover.js.map +1 -0
- package/lib/module/TipKit/TipPopoverNativeComponent.ts +37 -0
- package/lib/module/TipKit/index.js +28 -0
- package/lib/module/TipKit/index.js.map +1 -0
- package/lib/module/TipKit/types.js +4 -0
- package/lib/module/TipKit/types.js.map +1 -0
- package/lib/module/TipKit/validation.js +24 -0
- package/lib/module/TipKit/validation.js.map +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/getNativeTinyui.js.map +1 -1
- package/lib/typescript/src/ConcentricView/ConcentricViewNativeComponent.d.ts +7 -0
- package/lib/typescript/src/ConcentricView/ConcentricViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/ConcentricView/index.d.ts +4 -0
- package/lib/typescript/src/ConcentricView/index.d.ts.map +1 -0
- package/lib/typescript/src/ConcentricView/types.d.ts +6 -0
- package/lib/typescript/src/ConcentricView/types.d.ts.map +1 -0
- package/lib/typescript/src/Menu/MenuNativeComponent.d.ts +2 -3
- package/lib/typescript/src/Menu/MenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/Menu/index.d.ts +1 -1
- package/lib/typescript/src/Menu/index.d.ts.map +1 -1
- package/lib/typescript/src/Menu/options.d.ts +1 -5
- package/lib/typescript/src/Menu/options.d.ts.map +1 -1
- package/lib/typescript/src/Menu/types.d.ts +16 -4
- package/lib/typescript/src/Menu/types.d.ts.map +1 -1
- package/lib/typescript/src/NativeTinyui.d.ts +2 -0
- package/lib/typescript/src/NativeTinyui.d.ts.map +1 -1
- package/lib/typescript/src/Popover/index.d.ts.map +1 -1
- package/lib/typescript/src/Popover/types.d.ts +2 -0
- package/lib/typescript/src/Popover/types.d.ts.map +1 -1
- package/lib/typescript/src/SFSymbol/SFSymbolNativeComponent.d.ts +11 -0
- package/lib/typescript/src/SFSymbol/SFSymbolNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/SFSymbol/index.d.ts +4 -0
- package/lib/typescript/src/SFSymbol/index.d.ts.map +1 -0
- package/lib/typescript/src/SFSymbol/options.d.ts +86 -0
- package/lib/typescript/src/SFSymbol/options.d.ts.map +1 -0
- package/lib/typescript/src/SFSymbol/types.d.ts +113 -0
- package/lib/typescript/src/SFSymbol/types.d.ts.map +1 -0
- package/lib/typescript/src/Stepper/StepperNativeComponent.d.ts +21 -0
- package/lib/typescript/src/Stepper/StepperNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/Stepper/index.d.ts +4 -0
- package/lib/typescript/src/Stepper/index.d.ts.map +1 -0
- package/lib/typescript/src/Stepper/types.d.ts +24 -0
- package/lib/typescript/src/Stepper/types.d.ts.map +1 -0
- package/lib/typescript/src/TipKit/Popover.d.ts +3 -0
- package/lib/typescript/src/TipKit/Popover.d.ts.map +1 -0
- package/lib/typescript/src/TipKit/TipPopoverNativeComponent.d.ts +38 -0
- package/lib/typescript/src/TipKit/TipPopoverNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/TipKit/index.d.ts +10 -0
- package/lib/typescript/src/TipKit/index.d.ts.map +1 -0
- package/lib/typescript/src/TipKit/types.d.ts +46 -0
- package/lib/typescript/src/TipKit/types.d.ts.map +1 -0
- package/lib/typescript/src/TipKit/validation.d.ts +4 -0
- package/lib/typescript/src/TipKit/validation.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +9 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/getNativeTinyui.d.ts +1 -1
- package/lib/typescript/src/utils/getNativeTinyui.d.ts.map +1 -1
- package/package.json +37 -2
- package/{Tinyui.podspec → react-native-tinyui.podspec} +23 -2
- package/src/ConcentricView/ConcentricViewNativeComponent.ts +14 -0
- package/src/ConcentricView/index.tsx +34 -0
- package/src/ConcentricView/types.ts +6 -0
- package/src/Menu/MenuNativeComponent.ts +1 -3
- package/src/Menu/index.tsx +6 -6
- package/src/Menu/options.ts +2 -20
- package/src/Menu/types.ts +18 -4
- package/src/NativeTinyui.ts +2 -0
- package/src/Popover/index.tsx +8 -3
- package/src/Popover/types.ts +2 -0
- package/src/SFSymbol/SFSymbolNativeComponent.ts +20 -0
- package/src/SFSymbol/index.tsx +89 -0
- package/src/SFSymbol/options.ts +116 -0
- package/src/SFSymbol/types.ts +158 -0
- package/src/Stepper/StepperNativeComponent.ts +29 -0
- package/src/Stepper/index.tsx +91 -0
- package/src/Stepper/types.ts +24 -0
- package/src/TipKit/Popover.tsx +87 -0
- package/src/TipKit/TipPopoverNativeComponent.ts +37 -0
- package/src/TipKit/index.ts +47 -0
- package/src/TipKit/types.ts +57 -0
- package/src/TipKit/validation.ts +39 -0
- package/src/index.tsx +30 -0
- package/src/utils/getNativeTinyui.ts +8 -1
- package/ios/Core/TinyuiHostingHelpers.swift +0 -74
- package/ios/Menu/TinyuiMenuViewSwift.swift +0 -326
- package/ios/Popover/TinyuiPopoverViewSwift.swift +0 -88
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
export type TipDisplayFrequency = 'immediate' | 'hourly' | 'daily' | 'weekly' | 'monthly';
|
|
4
|
+
export interface TipKitConfiguration {
|
|
5
|
+
/** App-wide interval between new tips. Defaults to `daily`. */
|
|
6
|
+
displayFrequency?: TipDisplayFrequency;
|
|
7
|
+
}
|
|
8
|
+
export type TipInvalidationReason = 'actionPerformed' | 'tipClosed';
|
|
9
|
+
export type TipStatus = {
|
|
10
|
+
status: 'pending' | 'available';
|
|
11
|
+
} | {
|
|
12
|
+
status: 'invalidated';
|
|
13
|
+
reason: TipInvalidationReason | 'displayCountExceeded' | 'displayDurationExceeded' | 'unknown';
|
|
14
|
+
};
|
|
15
|
+
export interface TipAction {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TipError {
|
|
20
|
+
code: string;
|
|
21
|
+
message: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TipPopoverProps extends Omit<ViewProps, 'children'> {
|
|
24
|
+
/** Anchor content. Its existing touch handlers are preserved. */
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
/** Stable identity used by TipKit to persist this tip's history. */
|
|
27
|
+
tipId: string;
|
|
28
|
+
title: string;
|
|
29
|
+
message?: string;
|
|
30
|
+
systemImage?: string;
|
|
31
|
+
actions?: readonly TipAction[];
|
|
32
|
+
/** Allows presentation when TipKit is also eligible. Defaults to true. */
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
/** Omit to leave the number of presentations unlimited. */
|
|
35
|
+
maxDisplayCount?: number;
|
|
36
|
+
ignoresDisplayFrequency?: boolean;
|
|
37
|
+
/** Preferred arrow edge on the bubble; UIKit may adapt to available space. */
|
|
38
|
+
arrowEdge?: 'top' | 'bottom' | 'leading' | 'trailing' | 'auto';
|
|
39
|
+
/** TipKit eligibility, independent of whether the bubble is on screen. */
|
|
40
|
+
onStatusChange?: (status: TipStatus) => void;
|
|
41
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
42
|
+
/** Actions do not automatically invalidate the tip. */
|
|
43
|
+
onActionPress?: (action: TipAction) => void;
|
|
44
|
+
onError?: (error: TipError) => void;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/TipKit/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,mBAAmB,GAC7B,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE1D,MAAM,WAAW,mBAAmB;IAClC,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;CACxC;AAED,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG,WAAW,CAAC;AAEpE,MAAM,MAAM,SAAS,GACjB;IAAE,MAAM,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,GACnC;IACE,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EACF,qBAAqB,GACrB,sBAAsB,GACtB,yBAAyB,GACzB,SAAS,CAAC;CACf,CAAC;AAEN,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAClE,iEAAiE;IACjE,QAAQ,EAAE,SAAS,CAAC;IACpB,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAC/B,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2DAA2D;IAC3D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,8EAA8E;IAC9E,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IAC/D,0EAA0E;IAC1E,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IAC7C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,uDAAuD;IACvD,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/TipKit/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAS,CAAC;AAE/C,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAIjD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CA8BxD"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export { Menu } from './Menu/index.js';
|
|
2
|
-
export
|
|
2
|
+
export { TipKit } from './TipKit/index.js';
|
|
3
|
+
export type { TipAction, TipDisplayFrequency, TipError, TipInvalidationReason, TipPopoverProps, TipKitConfiguration, TipStatus, } from './TipKit/index.js';
|
|
4
|
+
export type { MenuActionOption, MenuActionPressEvent, MenuActionPressEventData, MenuDividerOption, MenuItemState, MenuOption, MenuProps, MenuSectionOption, MenuSubmenuOption, } from './Menu/index.js';
|
|
5
|
+
export { Stepper } from './Stepper/index.js';
|
|
6
|
+
export type { StepperProps } from './Stepper/index.js';
|
|
7
|
+
export { ConcentricView } from './ConcentricView/index.js';
|
|
8
|
+
export type { ConcentricViewProps } from './ConcentricView/index.js';
|
|
9
|
+
export { SFSymbol } from './SFSymbol/index.js';
|
|
10
|
+
export type { SFSymbolContentTransition, SFSymbolEffect, SFSymbolEffectOptions, SFSymbolProps, SFSymbolRenderingMode, SFSymbolScale, SFSymbolTextStyle, SFSymbolWeight, } from './SFSymbol/index.js';
|
|
3
11
|
export { Popover, PopoverClose } from './Popover/index.js';
|
|
4
12
|
export type { PopoverArrowEdge, PopoverAttachmentAnchor, PopoverCloseProps, PopoverContent, PopoverContentRenderArgs, PopoverProps, } from './Popover/index.js';
|
|
5
13
|
export { getNativeTinyui, assertComponentEnabled } from './utils/index.js';
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAU,CAAC;AAClC,YAAY,EACV,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,SAAS,GACV,MAAM,mBAAU,CAAC;AAClB,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAQ,CAAC;AAEhB,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAW,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,2BAAkB,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAY,CAAC;AACtC,YAAY,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,cAAc,GACf,MAAM,qBAAY,CAAC;AAEpB,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
1
|
import { type Spec } from '../NativeTinyui.js';
|
|
2
|
-
export type TinyuiComponent = 'Menu' | 'Popover' | 'LiquidGlassText';
|
|
2
|
+
export type TinyuiComponent = 'Menu' | 'Popover' | 'LiquidGlassText' | 'Stepper' | 'ConcentricView' | 'SFSymbol' | 'TipKit';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the Tinyui TurboModule instance. The native module is always
|
|
5
5
|
* compiled (Core), so this is safe to call.
|
|
@@ -1 +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,
|
|
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,GACvB,MAAM,GACN,SAAS,GACT,iBAAiB,GACjB,SAAS,GACT,gBAAgB,GAChB,UAAU,GACV,QAAQ,CAAC;AAKb;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAStC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI,CAWvE"}
|
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, Popover and LiquidGlassText components for React Native",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Dependency-free native iOS Menu, Popover, TipKit, Stepper, ConcentricView, SFSymbol 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": {
|
|
@@ -20,6 +20,26 @@
|
|
|
20
20
|
"types": "./lib/typescript/src/Popover/index.d.ts",
|
|
21
21
|
"default": "./lib/module/Popover/index.js"
|
|
22
22
|
},
|
|
23
|
+
"./stepper": {
|
|
24
|
+
"react-native-tinyui-source": "./src/Stepper/index.tsx",
|
|
25
|
+
"types": "./lib/typescript/src/Stepper/index.d.ts",
|
|
26
|
+
"default": "./lib/module/Stepper/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./concentric-view": {
|
|
29
|
+
"react-native-tinyui-source": "./src/ConcentricView/index.tsx",
|
|
30
|
+
"types": "./lib/typescript/src/ConcentricView/index.d.ts",
|
|
31
|
+
"default": "./lib/module/ConcentricView/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./sf-symbol": {
|
|
34
|
+
"react-native-tinyui-source": "./src/SFSymbol/index.tsx",
|
|
35
|
+
"types": "./lib/typescript/src/SFSymbol/index.d.ts",
|
|
36
|
+
"default": "./lib/module/SFSymbol/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./tip-kit": {
|
|
39
|
+
"react-native-tinyui-source": "./src/TipKit/index.ts",
|
|
40
|
+
"types": "./lib/typescript/src/TipKit/index.d.ts",
|
|
41
|
+
"default": "./lib/module/TipKit/index.js"
|
|
42
|
+
},
|
|
23
43
|
"./package.json": "./package.json",
|
|
24
44
|
"./liquid-glass-text": {
|
|
25
45
|
"react-native-tinyui-source": "./src/LiquidGlassText/index.tsx",
|
|
@@ -52,6 +72,7 @@
|
|
|
52
72
|
"ios",
|
|
53
73
|
"menu",
|
|
54
74
|
"popover",
|
|
75
|
+
"stepper",
|
|
55
76
|
"fabric",
|
|
56
77
|
"liquid-glass"
|
|
57
78
|
],
|
|
@@ -78,6 +99,7 @@
|
|
|
78
99
|
"@react-native/jest-preset": "0.85.0",
|
|
79
100
|
"@release-it/conventional-changelog": "^11.0.1",
|
|
80
101
|
"@types/react": "^19.2.0",
|
|
102
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
81
103
|
"del-cli": "^7.0.0",
|
|
82
104
|
"eslint": "^9.39.4",
|
|
83
105
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -88,6 +110,7 @@
|
|
|
88
110
|
"react": "19.2.3",
|
|
89
111
|
"react-native": "0.85.0",
|
|
90
112
|
"react-native-builder-bob": "^0.43.0",
|
|
113
|
+
"react-test-renderer": "19.2.3",
|
|
91
114
|
"release-it": "^20.2.0",
|
|
92
115
|
"turbo": "^2.9.16",
|
|
93
116
|
"typescript": "^6.0.3"
|
|
@@ -137,6 +160,18 @@
|
|
|
137
160
|
},
|
|
138
161
|
"TinyuiLiquidGlassTextView": {
|
|
139
162
|
"className": "TinyuiLiquidGlassTextView"
|
|
163
|
+
},
|
|
164
|
+
"TinyuiStepperView": {
|
|
165
|
+
"className": "TinyuiStepperView"
|
|
166
|
+
},
|
|
167
|
+
"TinyuiConcentricView": {
|
|
168
|
+
"className": "TinyuiConcentricView"
|
|
169
|
+
},
|
|
170
|
+
"TinyuiSFSymbolView": {
|
|
171
|
+
"className": "TinyuiSFSymbolView"
|
|
172
|
+
},
|
|
173
|
+
"TinyuiTipPopoverView": {
|
|
174
|
+
"className": "TinyuiTipPopoverView"
|
|
140
175
|
}
|
|
141
176
|
}
|
|
142
177
|
}
|
|
@@ -19,6 +19,26 @@ components = {
|
|
|
19
19
|
:definition => "TINYUI_FEATURE_LIQUID_GLASS_TEXT=1",
|
|
20
20
|
:frameworks => ["UIKit", "SwiftUI", "CoreText"],
|
|
21
21
|
},
|
|
22
|
+
"Stepper" => {
|
|
23
|
+
:source_files => "ios/Stepper/**/*.{h,m,mm,swift,cpp}",
|
|
24
|
+
:definition => "TINYUI_FEATURE_STEPPER=1",
|
|
25
|
+
:frameworks => ["UIKit"],
|
|
26
|
+
},
|
|
27
|
+
"ConcentricView" => {
|
|
28
|
+
:source_files => "ios/ConcentricView/**/*.{h,m,mm,swift,cpp}",
|
|
29
|
+
:definition => "TINYUI_FEATURE_CONCENTRIC_VIEW=1",
|
|
30
|
+
:frameworks => ["UIKit"],
|
|
31
|
+
},
|
|
32
|
+
"SFSymbol" => {
|
|
33
|
+
:source_files => "ios/SFSymbol/**/*.{h,m,mm,swift,cpp}",
|
|
34
|
+
:definition => "TINYUI_FEATURE_SF_SYMBOL=1",
|
|
35
|
+
:frameworks => ["UIKit", "Symbols"],
|
|
36
|
+
},
|
|
37
|
+
"TipKit" => {
|
|
38
|
+
:source_files => "ios/TipKit/**/*.{h,m,mm,swift,cpp}",
|
|
39
|
+
:definition => "TINYUI_FEATURE_TIP_KIT=1",
|
|
40
|
+
:frameworks => ["UIKit", "SwiftUI", "TipKit"],
|
|
41
|
+
},
|
|
22
42
|
}
|
|
23
43
|
|
|
24
44
|
configured_components = nil
|
|
@@ -68,7 +88,8 @@ definitions = selected_components.map { |component| component[:definition] }
|
|
|
68
88
|
frameworks = selected_components.flat_map { |component| component.fetch(:frameworks, []) }.uniq
|
|
69
89
|
|
|
70
90
|
Pod::Spec.new do |s|
|
|
71
|
-
s.name = "
|
|
91
|
+
s.name = "react-native-tinyui"
|
|
92
|
+
s.module_name = "Tinyui"
|
|
72
93
|
s.version = package["version"]
|
|
73
94
|
s.summary = package["description"]
|
|
74
95
|
s.homepage = package["homepage"]
|
|
@@ -79,7 +100,7 @@ Pod::Spec.new do |s|
|
|
|
79
100
|
s.source = { :git => "https://github.com/luoxuhai/react-native-tinyui.git", :tag => "#{s.version}" }
|
|
80
101
|
|
|
81
102
|
s.source_files = source_files
|
|
82
|
-
s.private_header_files = ["ios/Core/**/*.h", "ios/Menu/**/*.h", "ios/Popover/**/*.h", "ios/LiquidGlassText/**/*.h"]
|
|
103
|
+
s.private_header_files = ["ios/Core/**/*.h", "ios/Menu/**/*.h", "ios/Popover/**/*.h", "ios/LiquidGlassText/**/*.h", "ios/Stepper/**/*.h", "ios/ConcentricView/**/*.h", "ios/SFSymbol/**/*.h", "ios/TipKit/**/*.h"]
|
|
83
104
|
s.preserve_paths = "ios/LiquidGlassText/GlassText-LICENSE"
|
|
84
105
|
s.swift_version = "5.0"
|
|
85
106
|
s.frameworks = frameworks unless frameworks.empty?
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
codegenNativeComponent,
|
|
3
|
+
type CodegenTypes,
|
|
4
|
+
type ViewProps,
|
|
5
|
+
} from 'react-native';
|
|
6
|
+
|
|
7
|
+
export interface NativeConcentricViewProps extends ViewProps {
|
|
8
|
+
minimumRadius?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default codegenNativeComponent<NativeConcentricViewProps>(
|
|
12
|
+
'TinyuiConcentricView',
|
|
13
|
+
{ excludedPlatforms: ['android'] }
|
|
14
|
+
);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { forwardRef, type ComponentRef } from 'react';
|
|
2
|
+
import { StyleSheet, type View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { assertComponentEnabled } from '../utils';
|
|
5
|
+
import NativeConcentricView from './ConcentricViewNativeComponent';
|
|
6
|
+
import type { ConcentricViewProps } from './types';
|
|
7
|
+
|
|
8
|
+
export const ConcentricView = forwardRef<
|
|
9
|
+
ComponentRef<typeof View>,
|
|
10
|
+
ConcentricViewProps
|
|
11
|
+
>(function ConcentricViewRoot({ minimumRadius = 0, style, ...viewProps }, ref) {
|
|
12
|
+
assertComponentEnabled('ConcentricView');
|
|
13
|
+
|
|
14
|
+
if (!Number.isFinite(minimumRadius) || minimumRadius < 0) {
|
|
15
|
+
throw new RangeError(
|
|
16
|
+
'[TinyUI] ConcentricView minimumRadius must be a finite, nonnegative number.'
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<NativeConcentricView
|
|
22
|
+
{...viewProps}
|
|
23
|
+
ref={ref}
|
|
24
|
+
minimumRadius={minimumRadius}
|
|
25
|
+
style={[styles.container, style]}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
container: { overflow: 'hidden' },
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export type { ConcentricViewProps } from './types';
|
|
@@ -9,9 +9,7 @@ export interface NativeMenuProps extends ViewProps {
|
|
|
9
9
|
menuConfig: CodegenTypes.UnsafeMixed;
|
|
10
10
|
title?: string;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
-
|
|
13
|
-
onItemPress?: DirectEventHandler<Readonly<{ id: string }>>;
|
|
14
|
-
onPrimaryAction?: DirectEventHandler<null>;
|
|
12
|
+
onActionPress?: DirectEventHandler<Readonly<{ id: string; title: string }>>;
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
export default codegenNativeComponent<NativeMenuProps>('TinyuiMenuView', {
|
package/src/Menu/index.tsx
CHANGED
|
@@ -11,7 +11,7 @@ const MenuRoot = forwardRef<ComponentRef<typeof View>, MenuProps>(function Menu(
|
|
|
11
11
|
accessibilityLabel,
|
|
12
12
|
children,
|
|
13
13
|
disabled,
|
|
14
|
-
|
|
14
|
+
onActionPress,
|
|
15
15
|
options,
|
|
16
16
|
title,
|
|
17
17
|
testID,
|
|
@@ -21,17 +21,15 @@ const MenuRoot = forwardRef<ComponentRef<typeof View>, MenuProps>(function Menu(
|
|
|
21
21
|
) {
|
|
22
22
|
assertComponentEnabled('Menu');
|
|
23
23
|
|
|
24
|
-
const
|
|
24
|
+
const menuConfig = serializeMenuOptions(options);
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
27
|
<View {...viewProps} ref={ref} collapsable={false}>
|
|
28
28
|
<NativeMenuView
|
|
29
29
|
accessibilityLabel={accessibilityLabel}
|
|
30
30
|
disabled={disabled}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
onItemPress={(event) => callbacks.get(event.nativeEvent.id)?.()}
|
|
34
|
-
onPrimaryAction={onPrimaryAction}
|
|
31
|
+
menuConfig={menuConfig}
|
|
32
|
+
onActionPress={onActionPress}
|
|
35
33
|
testID={testID}
|
|
36
34
|
title={title}
|
|
37
35
|
>
|
|
@@ -45,6 +43,8 @@ export const Menu = MenuRoot as MenuComponent;
|
|
|
45
43
|
|
|
46
44
|
export type {
|
|
47
45
|
MenuActionOption,
|
|
46
|
+
MenuActionPressEvent,
|
|
47
|
+
MenuActionPressEventData,
|
|
48
48
|
MenuDividerOption,
|
|
49
49
|
MenuItemState,
|
|
50
50
|
MenuOption,
|
package/src/Menu/options.ts
CHANGED
|
@@ -52,30 +52,18 @@ interface NativeMenuConfiguration {
|
|
|
52
52
|
items: NativeMenuElement[];
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export interface SerializedMenuOptions {
|
|
56
|
-
config: NativeMenuConfiguration;
|
|
57
|
-
callbacks: Map<string, () => void>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
55
|
function serializeColor(color: ColorValue | undefined): NativeMenuColor {
|
|
61
56
|
return color === undefined ? undefined : processColor(color);
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
export function serializeMenuOptions(
|
|
65
60
|
options: readonly MenuOption[]
|
|
66
|
-
):
|
|
67
|
-
|
|
68
|
-
const items = serializeOptions(options, callbacks, new Set(), 'root');
|
|
69
|
-
|
|
70
|
-
return {
|
|
71
|
-
callbacks,
|
|
72
|
-
config: { items },
|
|
73
|
-
};
|
|
61
|
+
): NativeMenuConfiguration {
|
|
62
|
+
return { items: serializeOptions(options, new Set(), 'root') };
|
|
74
63
|
}
|
|
75
64
|
|
|
76
65
|
function serializeOptions(
|
|
77
66
|
options: readonly MenuOption[],
|
|
78
|
-
callbacks: Map<string, () => void>,
|
|
79
67
|
usedIds: Set<string>,
|
|
80
68
|
path: string
|
|
81
69
|
): NativeMenuElement[] {
|
|
@@ -101,7 +89,6 @@ function serializeOptions(
|
|
|
101
89
|
displayInline: option.displayInline ?? false,
|
|
102
90
|
children: serializeOptions(
|
|
103
91
|
option.options,
|
|
104
|
-
callbacks,
|
|
105
92
|
usedIds,
|
|
106
93
|
`${optionPath}.submenu`
|
|
107
94
|
),
|
|
@@ -114,7 +101,6 @@ function serializeOptions(
|
|
|
114
101
|
title: option.title,
|
|
115
102
|
children: serializeOptions(
|
|
116
103
|
option.options,
|
|
117
|
-
callbacks,
|
|
118
104
|
usedIds,
|
|
119
105
|
`${optionPath}.section`
|
|
120
106
|
),
|
|
@@ -127,10 +113,6 @@ function serializeOptions(
|
|
|
127
113
|
}
|
|
128
114
|
usedIds.add(id);
|
|
129
115
|
|
|
130
|
-
if (option.onSelect) {
|
|
131
|
-
callbacks.set(id, option.onSelect);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
116
|
return {
|
|
135
117
|
type: 'action',
|
|
136
118
|
id,
|
package/src/Menu/types.ts
CHANGED
|
@@ -17,7 +17,11 @@ interface MenuOptionLabel {
|
|
|
17
17
|
icon?: string;
|
|
18
18
|
/** Tint applied to `icon` or `systemImage`. */
|
|
19
19
|
iconColor?: ColorValue;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Retained for source compatibility. UIKit menu elements don't expose a
|
|
22
|
+
* public custom title-color API; use `destructive` for system red styling.
|
|
23
|
+
* @deprecated UIKit ignores custom menu title colors.
|
|
24
|
+
*/
|
|
21
25
|
titleColor?: ColorValue;
|
|
22
26
|
}
|
|
23
27
|
|
|
@@ -32,7 +36,6 @@ export interface MenuActionOption extends MenuOptionLabel {
|
|
|
32
36
|
hidden?: boolean;
|
|
33
37
|
/** Keep the menu visible after selection on iOS 16 and newer. */
|
|
34
38
|
keepOpen?: boolean;
|
|
35
|
-
onSelect?: () => void;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
export interface MenuSubmenuOption extends MenuOptionLabel {
|
|
@@ -61,6 +64,17 @@ export interface MenuDividerOption {
|
|
|
61
64
|
export type MenuOption =
|
|
62
65
|
MenuActionOption | MenuSubmenuOption | MenuSectionOption | MenuDividerOption;
|
|
63
66
|
|
|
67
|
+
export interface MenuActionPressEventData {
|
|
68
|
+
/** The selected action's explicit id, or its generated menu-path id. */
|
|
69
|
+
id: string;
|
|
70
|
+
/** The selected action's displayed title. */
|
|
71
|
+
title: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type MenuActionPressEvent = Readonly<{
|
|
75
|
+
nativeEvent: Readonly<MenuActionPressEventData>;
|
|
76
|
+
}>;
|
|
77
|
+
|
|
64
78
|
export interface MenuProps extends Omit<ViewProps, 'children'> {
|
|
65
79
|
/** The trigger element. */
|
|
66
80
|
children: ReactNode;
|
|
@@ -70,8 +84,8 @@ export interface MenuProps extends Omit<ViewProps, 'children'> {
|
|
|
70
84
|
options: readonly MenuOption[];
|
|
71
85
|
/** Prevents the trigger from opening the menu. */
|
|
72
86
|
disabled?: boolean;
|
|
73
|
-
/** Called
|
|
74
|
-
|
|
87
|
+
/** Called whenever an enabled action is selected. */
|
|
88
|
+
onActionPress?: (event: MenuActionPressEvent) => void;
|
|
75
89
|
}
|
|
76
90
|
|
|
77
91
|
export interface MenuComponent extends ForwardRefExoticComponent<
|
package/src/NativeTinyui.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface Spec extends TurboModule {
|
|
|
7
7
|
* based on the `react-native-tinyui.components` array in package.json.
|
|
8
8
|
*/
|
|
9
9
|
getEnabledComponents(): ReadonlyArray<string>;
|
|
10
|
+
configureTips(displayFrequency: string): Promise<void>;
|
|
11
|
+
invalidateTip(tipId: string, reason: string): Promise<void>;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export default TurboModuleRegistry.get<Spec>('Tinyui');
|
package/src/Popover/index.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef, useCallback, useState, type ComponentRef } from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { assertComponentEnabled } from '../utils';
|
|
6
6
|
import { PopoverClose } from './PopoverClose';
|
|
@@ -59,7 +59,11 @@ const PopoverRoot = forwardRef<ComponentRef<typeof View>, PopoverProps>(
|
|
|
59
59
|
}}
|
|
60
60
|
>
|
|
61
61
|
<Pressable onPress={() => setOpen(true)}>{children}</Pressable>
|
|
62
|
-
<View
|
|
62
|
+
<View
|
|
63
|
+
collapsable={false}
|
|
64
|
+
style={styles.content}
|
|
65
|
+
pointerEvents="box-none"
|
|
66
|
+
>
|
|
63
67
|
{renderedContent}
|
|
64
68
|
</View>
|
|
65
69
|
</NativePopoverView>
|
|
@@ -78,7 +82,8 @@ function renderContent(
|
|
|
78
82
|
const styles = StyleSheet.create({
|
|
79
83
|
content: {
|
|
80
84
|
position: 'absolute',
|
|
81
|
-
|
|
85
|
+
top: 0,
|
|
86
|
+
left: 0,
|
|
82
87
|
overflow: 'hidden',
|
|
83
88
|
},
|
|
84
89
|
});
|
package/src/Popover/types.ts
CHANGED
|
@@ -27,6 +27,8 @@ export interface PopoverProps extends Omit<ViewProps, 'children'> {
|
|
|
27
27
|
/**
|
|
28
28
|
* Content shown inside the popover. Pass a node, or a render function that
|
|
29
29
|
* receives `{ close }` to dismiss the popover from within the content.
|
|
30
|
+
* The content's layout determines the popover size, including live updates.
|
|
31
|
+
* Leave its background transparent to reveal the system popover material.
|
|
30
32
|
*/
|
|
31
33
|
content: PopoverContent;
|
|
32
34
|
/** Controlled presentation state. */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
codegenNativeComponent,
|
|
3
|
+
type CodegenTypes,
|
|
4
|
+
type ViewProps,
|
|
5
|
+
} from 'react-native';
|
|
6
|
+
|
|
7
|
+
export interface NativeSFSymbolProps extends ViewProps {
|
|
8
|
+
configuration: CodegenTypes.UnsafeMixed;
|
|
9
|
+
effects: CodegenTypes.UnsafeMixed;
|
|
10
|
+
contentTransition: CodegenTypes.UnsafeMixed;
|
|
11
|
+
resizeMode?: CodegenTypes.WithDefault<string, 'center'>;
|
|
12
|
+
respectReduceMotion?: CodegenTypes.WithDefault<boolean, true>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default codegenNativeComponent<NativeSFSymbolProps>(
|
|
16
|
+
'TinyuiSFSymbolView',
|
|
17
|
+
{
|
|
18
|
+
excludedPlatforms: ['android'],
|
|
19
|
+
}
|
|
20
|
+
);
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { forwardRef, type ComponentRef } from 'react';
|
|
2
|
+
import { StyleSheet, useWindowDimensions, type View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { assertComponentEnabled } from '../utils';
|
|
5
|
+
import NativeSFSymbolView from './SFSymbolNativeComponent';
|
|
6
|
+
import { serializeSFSymbol } from './options';
|
|
7
|
+
import type { SFSymbolProps } from './types';
|
|
8
|
+
|
|
9
|
+
export const SFSymbol = forwardRef<ComponentRef<typeof View>, SFSymbolProps>(
|
|
10
|
+
function SFSymbolRoot(
|
|
11
|
+
{
|
|
12
|
+
name,
|
|
13
|
+
source,
|
|
14
|
+
size,
|
|
15
|
+
weight,
|
|
16
|
+
scale,
|
|
17
|
+
textStyle,
|
|
18
|
+
fontFamily,
|
|
19
|
+
allowFontScaling,
|
|
20
|
+
maxFontSizeMultiplier,
|
|
21
|
+
renderingMode,
|
|
22
|
+
color,
|
|
23
|
+
paletteColors,
|
|
24
|
+
variableValue,
|
|
25
|
+
variableValueMode,
|
|
26
|
+
colorRenderingMode,
|
|
27
|
+
effect,
|
|
28
|
+
contentTransition,
|
|
29
|
+
respectReduceMotion = true,
|
|
30
|
+
resizeMode = 'center',
|
|
31
|
+
style,
|
|
32
|
+
accessible = false,
|
|
33
|
+
accessibilityRole = 'image',
|
|
34
|
+
...viewProps
|
|
35
|
+
},
|
|
36
|
+
ref
|
|
37
|
+
) {
|
|
38
|
+
assertComponentEnabled('SFSymbol');
|
|
39
|
+
const { fontScale } = useWindowDimensions();
|
|
40
|
+
const serialized = serializeSFSymbol(
|
|
41
|
+
{
|
|
42
|
+
name,
|
|
43
|
+
source,
|
|
44
|
+
size,
|
|
45
|
+
weight,
|
|
46
|
+
scale,
|
|
47
|
+
textStyle,
|
|
48
|
+
fontFamily,
|
|
49
|
+
allowFontScaling,
|
|
50
|
+
maxFontSizeMultiplier,
|
|
51
|
+
renderingMode,
|
|
52
|
+
color,
|
|
53
|
+
paletteColors,
|
|
54
|
+
variableValue,
|
|
55
|
+
variableValueMode,
|
|
56
|
+
colorRenderingMode,
|
|
57
|
+
effect,
|
|
58
|
+
contentTransition,
|
|
59
|
+
},
|
|
60
|
+
fontScale
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<NativeSFSymbolView
|
|
65
|
+
{...viewProps}
|
|
66
|
+
{...serialized}
|
|
67
|
+
ref={ref}
|
|
68
|
+
accessible={accessible}
|
|
69
|
+
accessibilityRole={accessibilityRole}
|
|
70
|
+
respectReduceMotion={respectReduceMotion}
|
|
71
|
+
resizeMode={resizeMode}
|
|
72
|
+
style={[styles.symbol, style]}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const styles = StyleSheet.create({ symbol: { alignSelf: 'flex-start' } });
|
|
79
|
+
|
|
80
|
+
export type {
|
|
81
|
+
SFSymbolContentTransition,
|
|
82
|
+
SFSymbolEffect,
|
|
83
|
+
SFSymbolEffectOptions,
|
|
84
|
+
SFSymbolProps,
|
|
85
|
+
SFSymbolRenderingMode,
|
|
86
|
+
SFSymbolScale,
|
|
87
|
+
SFSymbolTextStyle,
|
|
88
|
+
SFSymbolWeight,
|
|
89
|
+
} from './types';
|