@satinhq/kit 0.1.0-beta.2 → 0.1.0-beta.4
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/NOTICE +2 -2
- package/README.md +2 -3
- package/dist/acknowledgements/inventory.json +5 -5
- package/dist/actions/RowActions.d.ts +4 -4
- package/dist/actions/RowActions.js +93 -27
- package/dist/actions/fullSwipeContact.d.ts +73 -0
- package/dist/actions/fullSwipeContact.js +186 -0
- package/dist/actions/rowScrub.d.ts +7 -4
- package/dist/actions/rowScrub.js +39 -37
- package/dist/actions/types.d.ts +13 -7
- package/dist/app/InstallComponents.d.ts +4 -7
- package/dist/app/InstallComponents.js +7 -7
- package/dist/app/InstallationDiagnostics.d.ts +2 -1
- package/dist/app/InstallationDiagnostics.js +2 -1
- package/dist/app/appearance.d.ts +5 -3
- package/dist/app/appearance.js +5 -3
- package/dist/app/appearanceStore.d.ts +3 -2
- package/dist/app/buildInfo.d.ts +4 -4
- package/dist/app/buildInfo.js +2 -2
- package/dist/app/definition.d.ts +11 -3
- package/dist/app/definition.js +2 -0
- package/dist/app/head.d.ts +2 -1
- package/dist/app/head.js +13 -16
- package/dist/app/inlineCSP.d.ts +6 -0
- package/dist/app/inlineCSP.js +25 -0
- package/dist/app/install.d.ts +1 -0
- package/dist/app/install.js +5 -2
- package/dist/app/installCheck.js +32 -86
- package/dist/app/installContext.d.ts +10 -5
- package/dist/app/installContext.js +2 -0
- package/dist/app/installCustom.js +1 -0
- package/dist/app/installExperience.js +0 -60
- package/dist/app/installationFailure.d.ts +3 -2
- package/dist/app/installationFailure.js +1 -1
- package/dist/app/launchScreen.d.ts +6 -2
- package/dist/app/launchScreen.js +104 -1
- package/dist/app/launchScreenRuntime.d.ts +31 -4
- package/dist/app/launchScreenRuntime.js +150 -22
- package/dist/app/launchWatchdog.js +25 -65
- package/dist/app/platformScripts.js +11 -0
- package/dist/app/styles.d.ts +3 -0
- package/dist/app/styles.js +42 -0
- package/dist/app/viewportValue.d.ts +2 -1
- package/dist/app/vite.d.ts +4 -0
- package/dist/app/vite.js +22 -24
- package/dist/content/content.d.ts +35 -30
- package/dist/content/content.js +19 -16
- package/dist/content/layout.d.ts +10 -2
- package/dist/content/layout.js +4 -2
- package/dist/content/scaledMetric.d.ts +2 -1
- package/dist/content/scaledMetric.js +2 -1
- package/dist/controls/ColorPicker.d.ts +2 -4
- package/dist/controls/ColorPicker.js +2 -4
- package/dist/controls/DatePicker.d.ts +4 -4
- package/dist/controls/DatePicker.js +2 -2
- package/dist/controls/ProgressView.d.ts +4 -4
- package/dist/controls/ProgressView.js +1 -2
- package/dist/controls/civilDate.d.ts +1 -1
- package/dist/controls/civilDate.js +1 -1
- package/dist/data/database.d.ts +9 -8
- package/dist/data/database.js +4 -4
- package/dist/docs/components/file-importer.md +1 -1
- package/dist/docs/components/paste-button.md +1 -1
- package/dist/docs/components/photos-picker.md +1 -1
- package/dist/docs/components/share-link.md +1 -1
- package/dist/docs/limitations.md +1 -1
- package/dist/docs/push.md +3 -3
- package/dist/docs/reference.md +1888 -0
- package/dist/docs/tailwind.md +76 -0
- package/dist/docs/tokens.md +1 -1
- package/dist/gestures/GestureView.d.ts +3 -1
- package/dist/gestures/GestureView.js +2 -1
- package/dist/gestures/gesture.d.ts +22 -2
- package/dist/gestures/gesture.js +7 -2
- package/dist/glass/GlassEffect.d.ts +2 -1
- package/dist/glass/GlassEffect.js +2 -1
- package/dist/glass/GlassPresentation.d.ts +1 -0
- package/dist/glass/GlassPresentation.js +21 -4
- package/dist/glass/TabBar.js +23 -1
- package/dist/glass/errorAlert.js +2 -1
- package/dist/glass/errors.d.ts +3 -1
- package/dist/glass/fallback/runtime.d.ts +1 -0
- package/dist/glass/fallback/runtime.js +8 -1
- package/dist/glass/lens/controlLift.d.ts +1 -1
- package/dist/glass/lens/controlLift.js +1 -1
- package/dist/glass/lens/interactivePress.d.ts +2 -2
- package/dist/glass/lens/interactivePress.js +2 -2
- package/dist/glass/lens/menu-opening-native-fits.json +1 -1
- package/dist/glass/lens/menuContextFit.json +1 -1
- package/dist/glass/lens/menuDropFit.json +1 -1
- package/dist/glass/lens/menuField.d.ts +2 -2
- package/dist/glass/lens/menuField.js +3 -3
- package/dist/glass/lens/menuGlyphDropFit.json +1 -1
- package/dist/glass/lens/menuMorphFit.json +1 -1
- package/dist/glass/lens/menuMorphPhoneFit.json +1 -1
- package/dist/glass/lens/tabAccessoryMotion.d.ts +1 -1
- package/dist/glass/lens/tabSearchMember.d.ts +1 -1
- package/dist/glass/lens/tabSearchMember.js +1 -1
- package/dist/glass/liquidContext.d.ts +2 -0
- package/dist/glass/menuPresenter.d.ts +2 -0
- package/dist/glass/menuPresenter.js +1 -1
- package/dist/glass/regions.d.ts +3 -2
- package/dist/glass/regions.js +1 -1
- package/dist/glass/renderSpecs.d.ts +1 -0
- package/dist/glass/renderSpecs.js +1 -0
- package/dist/glass/shapeTrack.d.ts +1 -1
- package/dist/glass/submenuMotion.d.ts +1 -1
- package/dist/glass/submenuMotion.js +1 -1
- package/dist/glass/webgpu/controlRim.d.ts +29 -0
- package/dist/glass/webgpu/controlRim.js +68 -0
- package/dist/glass/webgpu/entry.worker.js +3 -6
- package/dist/glass/webgpu/frameClock.d.ts +6 -2
- package/dist/glass/webgpu/frameClock.js +9 -2
- package/dist/glass/webgpu/frameProbe.d.ts +1 -1
- package/dist/glass/webgpu/frameProbe.js +3 -3
- package/dist/glass/webgpu/passes.d.ts +2 -2
- package/dist/glass/webgpu/production.d.ts +1 -0
- package/dist/glass/webgpu/production.js +31 -1
- package/dist/glass/webgpu/raster.d.ts +18 -0
- package/dist/glass/webgpu/raster.js +105 -15
- package/dist/glass/webgpu/rasterMaterial.d.ts +4 -0
- package/dist/glass/webgpu/rasterMaterial.js +17 -1
- package/dist/glass/webgpu/rasterUniforms.js +9 -0
- package/dist/glass/webgpu/regionScene.d.ts +4 -1
- package/dist/glass/webgpu/regionScene.js +30 -1
- package/dist/glass/webgpu/renderer.js +23 -7
- package/dist/glass/webgpu/shaders.d.ts +2 -2
- package/dist/glass/webgpu/shaders.js +5 -1
- package/dist/haptics/SensoryButton.d.ts +4 -4
- package/dist/haptics/SensoryButton.js +3 -3
- package/dist/image/Image.d.ts +6 -3
- package/dist/image/Image.js +4 -3
- package/dist/image/asset.d.ts +2 -1
- package/dist/keyboard/adapter.d.ts +3 -4
- package/dist/keyboard/adapter.js +2 -2
- package/dist/keyboard/avoidance.d.ts +1 -1
- package/dist/keyboard/avoidance.js +1 -1
- package/dist/keyboard/geometry.d.ts +1 -1
- package/dist/keyboard/motion.d.ts +1 -1
- package/dist/keyboard/motion.js +1 -1
- package/dist/list-form/ListForm.d.ts +10 -9
- package/dist/list-form/ListForm.js +3 -3
- package/dist/list-form/ListItem.js +1 -1
- package/dist/list-form/RowLabel.d.ts +1 -1
- package/dist/list-form/RowLabel.js +1 -1
- package/dist/list-form/Slider.js +1 -1
- package/dist/list-form/editMotion.js +1 -1
- package/dist/list-form/editing.d.ts +10 -11
- package/dist/list-form/editing.js +5 -6
- package/dist/list-form/offsets.d.ts +2 -2
- package/dist/list-form/offsets.js +2 -2
- package/dist/media/react.d.ts +2 -1
- package/dist/media/react.js +2 -1
- package/dist/media/types.d.ts +6 -3
- package/dist/motion/TransitionView.d.ts +4 -2
- package/dist/motion/TransitionView.js +3 -2
- package/dist/motion/animationValue.d.ts +2 -2
- package/dist/motion/animationValue.js +9 -10
- package/dist/motion/matchedGeometry.d.ts +10 -9
- package/dist/motion/matchedGeometry.js +9 -9
- package/dist/motion/springTrack.d.ts +1 -2
- package/dist/motion/springTrack.js +10 -5
- package/dist/motion/transition.d.ts +4 -1
- package/dist/motion/transition.js +2 -0
- package/dist/navigation/DetailList.d.ts +1 -1
- package/dist/navigation/DetailList.js +1 -1
- package/dist/navigation/ScreenContainer.js +1 -1
- package/dist/navigation/Sidebar.d.ts +3 -1
- package/dist/navigation/Sidebar.js +1 -1
- package/dist/navigation/SidebarSymbol.d.ts +2 -1
- package/dist/navigation/SidebarSymbol.js +2 -1
- package/dist/navigation/chromeCurves.js +1 -1
- package/dist/navigation/navigationContext.d.ts +2 -1
- package/dist/navigation/navigationContext.js +2 -1
- package/dist/navigation/splitContext.d.ts +2 -1
- package/dist/navigation/splitContext.js +2 -1
- package/dist/navigation/toolbarMinimization.d.ts +4 -3
- package/dist/navigation/types.d.ts +8 -6
- package/dist/navigation/zoomGeometry.js +1 -1
- package/dist/navigation/zoomMotion.d.ts +1 -1
- package/dist/navigation/zoomMotion.js +2 -2
- package/dist/navigation/zoomTransition.js +3 -4
- package/dist/presentation/Presentation.d.ts +10 -9
- package/dist/presentation/Presentation.js +4 -3
- package/dist/presentation/model.d.ts +2 -1
- package/dist/presentation/presentationSource.js +1 -1
- package/dist/press/Pressable.d.ts +5 -1
- package/dist/press/Pressable.js +2 -0
- package/dist/press/stateMachine.d.ts +1 -1
- package/dist/public/Label.d.ts +2 -1
- package/dist/public/Label.js +2 -1
- package/dist/public/Screen.d.ts +4 -6
- package/dist/public/actions.d.ts +2 -1
- package/dist/public/actions.js +2 -1
- package/dist/public/buttonBorderShape.d.ts +2 -1
- package/dist/public/colors.d.ts +7 -4
- package/dist/public/colors.js +3 -2
- package/dist/public/controlStyle.d.ts +17 -14
- package/dist/public/controls.d.ts +29 -28
- package/dist/public/controls.js +25 -24
- package/dist/public/deviceActions.d.ts +6 -4
- package/dist/public/deviceActions.js +4 -2
- package/dist/public/environment.d.ts +16 -13
- package/dist/public/environment.js +11 -9
- package/dist/public/filePickers.d.ts +6 -4
- package/dist/public/filePickers.js +3 -2
- package/dist/public/glass.d.ts +8 -6
- package/dist/public/glass.js +2 -2
- package/dist/public/glassValue.d.ts +3 -4
- package/dist/public/glassValue.js +3 -4
- package/dist/public/keyboard.d.ts +4 -1
- package/dist/public/keyboard.js +2 -1
- package/dist/public/navigationTransition.d.ts +6 -6
- package/dist/public/navigationTransition.js +3 -3
- package/dist/public/presentation.d.ts +8 -7
- package/dist/public/presentation.js +5 -5
- package/dist/public/runtime.d.ts +9 -8
- package/dist/public/runtime.js +7 -7
- package/dist/public/scroll.d.ts +6 -3
- package/dist/public/scroll.js +3 -1
- package/dist/public/structure.d.ts +2 -2
- package/dist/public/toolbar.d.ts +15 -11
- package/dist/public/toolbar.js +13 -8
- package/dist/reachability/model.d.ts +4 -3
- package/dist/reachability/react.d.ts +4 -1
- package/dist/reachability/react.js +2 -1
- package/dist/root/SatinRoot.d.ts +3 -3
- package/dist/root/SatinRoot.js +12 -36
- package/dist/root/mountSatin.d.ts +1 -1
- package/dist/root/mountSatin.js +26 -35
- package/dist/root/runtimeContext.d.ts +2 -1
- package/dist/root/runtimeContext.js +2 -1
- package/dist/safe-area/Overlay.d.ts +3 -2
- package/dist/safe-area/Overlay.js +2 -1
- package/dist/safe-area/SafeAreaInset.d.ts +11 -7
- package/dist/safe-area/SafeAreaInset.js +10 -9
- package/dist/safe-area/context.d.ts +3 -3
- package/dist/safe-area/context.js +1 -1
- package/dist/safe-area/displayCorners.d.ts +4 -2
- package/dist/safe-area/displayCorners.js +4 -2
- package/dist/safe-area/modifiers.d.ts +14 -10
- package/dist/safe-area/modifiers.js +10 -6
- package/dist/safe-area/useSafeAreaMetrics.js +2 -2
- package/dist/scroll/ScrollSurface.d.ts +5 -5
- package/dist/scroll/ScrollSurface.js +6 -2
- package/dist/scroll/ScrollTarget.d.ts +1 -1
- package/dist/scroll/ScrollTarget.js +1 -1
- package/dist/scroll/edgePolicy.d.ts +2 -2
- package/dist/scroll/position.d.ts +5 -3
- package/dist/scroll/position.js +1 -1
- package/dist/scroll/screenGeometry.d.ts +1 -1
- package/dist/scroll/screenGeometry.js +1 -1
- package/dist/scroll/types.d.ts +1 -1
- package/dist/search/PadSearchDrawer.d.ts +7 -0
- package/dist/search/PadSearchDrawer.js +8 -0
- package/dist/search/PadSearchPresentationContext.d.ts +6 -0
- package/dist/search/PadSearchPresentationContext.js +4 -0
- package/dist/search/SearchDrawer.d.ts +1 -1
- package/dist/search/SearchDrawer.js +7 -2
- package/dist/search/SearchSuggestionsPopover.d.ts +6 -0
- package/dist/search/SearchSuggestionsPopover.js +42 -0
- package/dist/search/SearchToolbarField.d.ts +2 -1
- package/dist/search/SearchToolbarField.js +28 -7
- package/dist/search/padSearchBarMotion.d.ts +69 -0
- package/dist/search/padSearchBarMotion.js +73 -0
- package/dist/search/padSearchFieldSamples.json +491 -0
- package/dist/search/searchMotion.d.ts +1 -1
- package/dist/search/searchMotion.js +1 -1
- package/dist/search/searchPlacement.d.ts +3 -0
- package/dist/search/searchPlacement.js +7 -0
- package/dist/search/searchable.d.ts +14 -12
- package/dist/search/usePadSearchFieldMotion.d.ts +4 -0
- package/dist/search/usePadSearchFieldMotion.js +100 -0
- package/dist/search/useSearchPresentation.d.ts +2 -1
- package/dist/search/useSearchPresentation.js +24 -6
- package/dist/server.d.ts +4 -4
- package/dist/server.js +4 -4
- package/dist/shapes/corners.d.ts +3 -3
- package/dist/shapes/corners.js +2 -3
- package/dist/styles.css +8302 -8236
- package/dist/sw/vite.d.ts +4 -0
- package/dist/sw/vite.js +2 -0
- package/dist/symbols/Symbol.d.ts +7 -5
- package/dist/symbols/Symbol.js +5 -3
- package/dist/symbols/catalogue.d.ts +1 -1
- package/dist/symbols/types.d.ts +6 -4
- package/dist/tabs/TabSection.d.ts +3 -2
- package/dist/tabs/TabSection.js +2 -1
- package/dist/tabs/TabView.js +54 -51
- package/dist/tasks/useTask.d.ts +5 -4
- package/dist/tasks/useTask.js +4 -3
- package/dist/testing.d.ts +3 -2
- package/dist/testing.js +3 -2
- package/dist/text-input/TextEditor.js +7 -3
- package/dist/text-input/focusChain.d.ts +4 -3
- package/dist/text-input/focusChain.js +3 -2
- package/dist/text-input/kinds.d.ts +1 -1
- package/dist/web/WebView.d.ts +10 -3
- package/dist/web/WebView.js +3 -2
- package/dist/web/authentication.d.ts +12 -1
- package/dist/web/authentication.js +2 -1
- package/dist/web/openURL.d.ts +10 -4
- package/dist/web/openURL.js +4 -2
- package/dist/web/useWebAuthentication.d.ts +2 -1
- package/dist/web/useWebAuthentication.js +2 -1
- package/dist/zoom/Zoomable.d.ts +3 -3
- package/dist/zoom/Zoomable.js +2 -2
- package/package.json +4 -4
- package/dist/docs/swiftui-reference.md +0 -1895
|
@@ -3,20 +3,22 @@ import type { ComponentType } from 'react';
|
|
|
3
3
|
import type { ScrollSnapshot } from '../scroll/types.js';
|
|
4
4
|
declare const screenParamsType: unique symbol;
|
|
5
5
|
export type PresentationKind = 'push';
|
|
6
|
-
/**
|
|
6
|
+
/** Where a screen is in a navigation transition: `entering`, `exiting` or `settled`. */
|
|
7
7
|
export type TransitionPhase = 'settled' | 'entering' | 'exiting';
|
|
8
8
|
export type TransitionOperation = 'pop' | 'popToRoot' | 'push' | 'replace';
|
|
9
|
+
/** Whether a pushed screen shows its back button. `automatic` shows it; `hidden` removes it. */
|
|
9
10
|
export type NavigationBackButtonBehavior = 'automatic' | 'hidden';
|
|
10
|
-
/**
|
|
11
|
+
/** How a screen title is drawn: `inline` in the bar, `large` below it, `inlineLarge` large inside
|
|
12
|
+
* the bar row, or `none`. */
|
|
11
13
|
export type TitleDisplayMode = 'inline' | 'large' | 'inlineLarge' | 'none';
|
|
12
|
-
/**
|
|
14
|
+
/** Whether the navigation bar shows. A hidden bar reserves no row. */
|
|
13
15
|
export type Visibility = 'automatic' | 'visible' | 'hidden';
|
|
14
16
|
export type NavigationBarDefinition<Params = unknown> = Readonly<{
|
|
15
17
|
backButton?: NavigationBackButtonBehavior;
|
|
16
18
|
display?: TitleDisplayMode;
|
|
17
19
|
visibility?: Visibility;
|
|
18
20
|
title: string | ((params: Params) => string);
|
|
19
|
-
/**
|
|
21
|
+
/** A line under the title, inline or large. */
|
|
20
22
|
subtitle?: string;
|
|
21
23
|
}>;
|
|
22
24
|
export type TransitionControllerContext = Readonly<{
|
|
@@ -120,12 +122,12 @@ export type ScreenEntry<Id extends string = string, Params = unknown> = Readonly
|
|
|
120
122
|
export type NavigatorState<Entry extends ScreenEntry = ScreenEntry> = Readonly<{
|
|
121
123
|
entries: readonly Entry[];
|
|
122
124
|
}>;
|
|
123
|
-
/**
|
|
125
|
+
/** Whether a screen is covered by another, and the phase of its current transition. */
|
|
124
126
|
export type ScreenLifecycle = Readonly<{
|
|
125
127
|
isCovered: boolean;
|
|
126
128
|
phase: TransitionPhase;
|
|
127
129
|
}>;
|
|
128
|
-
/**
|
|
130
|
+
/** The `appear` and `disappear` callbacks for `useScreenLifecycle`. */
|
|
129
131
|
export type ScreenLifecycleCallbacks = Readonly<{
|
|
130
132
|
appear?: () => void;
|
|
131
133
|
disappear?: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Zoom navigation geometry, as pure functions of a rectangle.
|
|
3
3
|
*
|
|
4
4
|
* At every moment the pushed screen is shown inside a rounded "window" rectangle that moves between
|
|
5
5
|
* the source view's frame and the full screen. As natively, the screen's content is scaled so its
|
|
@@ -9,7 +9,7 @@ export type ZoomSprings = Readonly<{
|
|
|
9
9
|
size: ZoomSpring;
|
|
10
10
|
}>;
|
|
11
11
|
/**
|
|
12
|
-
* Push: the centre and the width move together, critically damped (half way at 88 ms;
|
|
12
|
+
* Push: the centre and the width move together, critically damped (half way at 88 ms; the measured
|
|
13
13
|
* duration 0.33 s); the height lags slightly. Native moves the width with the centre, so the
|
|
14
14
|
* width shares the centre's spring here and the height takes the size spring (rms 0.002, 51 ticks).
|
|
15
15
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Measured values
|
|
2
|
+
* Measured spring values for the zoom navigation transition on iOS 27.
|
|
3
3
|
*
|
|
4
4
|
* native reference: a stock native fixture (a 180 pt tile with a 10 pt corner in a
|
|
5
5
|
* NavigationStack grid, pushed to a full-screen page), iPhone 17 Pro Max Simulator, iOS 27.0.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* (the measured reference, October 11).
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
* Push: the centre and the width move together, critically damped (half way at 88 ms;
|
|
13
|
+
* Push: the centre and the width move together, critically damped (half way at 88 ms; the measured
|
|
14
14
|
* duration 0.33 s); the height lags slightly. Native moves the width with the centre, so the
|
|
15
15
|
* width shares the centre's spring here and the height takes the size spring (rms 0.002, 51 ticks).
|
|
16
16
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
3
|
-
* from, and `.navigationTransition(.zoom(sourceID:in:))` on the pushed screen.
|
|
2
|
+
* Zoom navigation connects a MatchedTransitionSource to a screen configured with a zoom transition.
|
|
4
3
|
*
|
|
5
4
|
* A push whose screen asks for a zoom, and whose source is on screen in the screen it covers, grows
|
|
6
5
|
* out of the source instead of sliding in. Its pop (the back button) and a downward drag on the
|
|
@@ -116,7 +115,7 @@ export function visibleZoomSource(entryKey, rear, excluded) {
|
|
|
116
115
|
}
|
|
117
116
|
return chosen?.view;
|
|
118
117
|
}
|
|
119
|
-
/**
|
|
118
|
+
/** Zoom transitions require a visible source: at least part of it in the viewport. */
|
|
120
119
|
function isOnScreen(view) {
|
|
121
120
|
const bounds = view.getBoundingClientRect();
|
|
122
121
|
if (!(bounds.width > 0 && bounds.height > 0))
|
|
@@ -950,7 +949,7 @@ export function windowKeyframes(from, to, springs, velocity) {
|
|
|
950
949
|
frames.push({ ms: frames.at(-1).ms + FRAME_MS, rect: to });
|
|
951
950
|
return frames;
|
|
952
951
|
}
|
|
953
|
-
/** A measured Core Animation spring as Satin's `Animation` (
|
|
952
|
+
/** A measured Core Animation spring as Satin's `Animation` (the duration/bounce representation is
|
|
954
953
|
* exact: omega = 2π / duration, damping ratio = 1 − bounce). */
|
|
955
954
|
function animationOf(spring) {
|
|
956
955
|
return SpringAnimation.spring({
|
|
@@ -19,7 +19,7 @@ export type SheetProps = PresentationProps & {
|
|
|
19
19
|
* content that fills the card (Now Playing). A modal NavigationStack root's title is drawn by
|
|
20
20
|
* its navigation bar either way. */
|
|
21
21
|
titleVisibility?: 'visible' | 'hidden';
|
|
22
|
-
/**
|
|
22
|
+
/** Control the sheet drag indicator. `automatic` shows it only when there is more than one
|
|
23
23
|
* detent to drag between, as native does. */
|
|
24
24
|
dragIndicator?: 'automatic' | 'visible' | 'hidden';
|
|
25
25
|
};
|
|
@@ -27,11 +27,11 @@ export declare function Sheet(props: SheetProps): import("react").JSX.Element |
|
|
|
27
27
|
export type FullScreenCoverProps = PresentationProps & {
|
|
28
28
|
children: ReactNode;
|
|
29
29
|
};
|
|
30
|
-
/**
|
|
30
|
+
/** An opaque presentation over the whole screen that slides up from
|
|
31
31
|
* the bottom edge. It has no grabber and no interactive dismissal; close it with its binding or
|
|
32
32
|
* `useDismiss()`. Its title labels the dialog for assistive technology and is not drawn. */
|
|
33
33
|
export declare function FullScreenCover({ children, ...props }: FullScreenCoverProps): import("react").JSX.Element | null;
|
|
34
|
-
/** The controlled text and keyboard intent
|
|
34
|
+
/** The text field inside an alert: its label, controlled text, prompt and keyboard intent. */
|
|
35
35
|
export type AlertTextFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'onSubmit' | 'size' | 'placeholder'> & {
|
|
36
36
|
label: string;
|
|
37
37
|
value: string;
|
|
@@ -42,20 +42,21 @@ export type AlertTextFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'v
|
|
|
42
42
|
labelPlacement?: 'leading' | 'above';
|
|
43
43
|
prompt?: string;
|
|
44
44
|
};
|
|
45
|
-
/** An alert's presentation binding, message and
|
|
45
|
+
/** An alert's presentation binding, title, message, actions and optional text field. */
|
|
46
46
|
export type AlertProps = PresentationProps & {
|
|
47
47
|
message?: string;
|
|
48
48
|
actions: readonly ActionItem[];
|
|
49
49
|
textField?: AlertTextFieldProps;
|
|
50
50
|
};
|
|
51
|
-
/** A confirmation dialog's presentation binding,
|
|
51
|
+
/** A confirmation dialog's presentation binding, title, message, actions and optional anchor. */
|
|
52
52
|
export type ConfirmationDialogProps = Omit<AlertProps, 'textField'> & {
|
|
53
53
|
/** The view the popover points at. Defaults to the control that was pressed to open it (a swipe
|
|
54
|
-
* action's row).
|
|
55
|
-
*
|
|
54
|
+
* action's row). The popover draws no Cancel button: a tap outside cancels, and the Cancel
|
|
55
|
+
* action stays for assistive technology. */
|
|
56
56
|
anchor?: RefObject<HTMLElement | null>;
|
|
57
57
|
};
|
|
58
|
-
/**
|
|
58
|
+
/** A centred alert with a title, an optional message, up to three actions and an optional text
|
|
59
|
+
* field. */
|
|
59
60
|
export declare function Alert({ message, actions, textField, ...props }: AlertProps): import("react").JSX.Element;
|
|
60
|
-
/**
|
|
61
|
+
/** A titled set of actions, such as Delete and Cancel, shown next to the control that opened it. */
|
|
61
62
|
export declare function ConfirmationDialog({ message, actions, anchor, ...props }: ConfirmationDialogProps): import("react").JSX.Element;
|
|
@@ -23,7 +23,7 @@ export function Sheet(props) {
|
|
|
23
23
|
props.onDismiss?.();
|
|
24
24
|
} })) : null;
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
26
|
+
/** An opaque presentation over the whole screen that slides up from
|
|
27
27
|
* the bottom edge. It has no grabber and no interactive dismissal; close it with its binding or
|
|
28
28
|
* `useDismiss()`. Its title labels the dialog for assistive technology and is not drawn. */
|
|
29
29
|
export function FullScreenCover({ children, ...props }) {
|
|
@@ -70,7 +70,8 @@ function validateActions(actions, alert) {
|
|
|
70
70
|
if (actions.filter(action => action.role === 'cancel').length > 1)
|
|
71
71
|
throw new Error('Presentation accepts at most one Cancel action.');
|
|
72
72
|
}
|
|
73
|
-
/**
|
|
73
|
+
/** A centred alert with a title, an optional message, up to three actions and an optional text
|
|
74
|
+
* field. */
|
|
74
75
|
export function Alert({ message, actions, textField, ...props }) {
|
|
75
76
|
const isPresented = useColdLaunchPresentation(props.isPresented, props.onPresentedChange);
|
|
76
77
|
props = { ...props, isPresented };
|
|
@@ -80,7 +81,7 @@ export function Alert({ message, actions, textField, ...props }) {
|
|
|
80
81
|
// Input alerts retain the description while their editing target owns focus.
|
|
81
82
|
return (_jsxs(Surface, { ...props, kind: "alert", describedBy: textField && message ? messageId : undefined, children: [message && (_jsx("p", { id: messageId, className: "satin-presentation-message", children: message })), textField && _jsx(AlertTextField, { ...textField }), _jsx(Actions, { actions: actions, active: props.isPresented, dismiss: () => props.onPresentedChange(false) })] }));
|
|
82
83
|
}
|
|
83
|
-
/**
|
|
84
|
+
/** A titled set of actions, such as Delete and Cancel, shown next to the control that opened it. */
|
|
84
85
|
export function ConfirmationDialog({ message, actions, anchor, ...props }) {
|
|
85
86
|
const isPresented = useColdLaunchPresentation(props.isPresented, props.onPresentedChange);
|
|
86
87
|
props = { ...props, isPresented };
|
|
@@ -41,7 +41,8 @@ export declare function sheetCornerShape(frame: ReturnType<typeof sheetFrame>, p
|
|
|
41
41
|
bottomCornerRadius?: number | undefined;
|
|
42
42
|
cornerStyle: 'continuous';
|
|
43
43
|
};
|
|
44
|
-
/**
|
|
44
|
+
/** A height a sheet can rest at: `medium`, `large`, a fixed `height` in points or a `fraction` of
|
|
45
|
+
* the available height. */
|
|
45
46
|
export type PresentationDetent = 'medium' | 'large' | Readonly<{
|
|
46
47
|
height: number;
|
|
47
48
|
}> | Readonly<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** The control a presentation grows from when the app names no anchor. Native iOS 27 presents
|
|
2
2
|
* `confirmationDialog` as a popover from the view that asked for it: a swipe action's dialog points
|
|
3
3
|
* at its row, a toolbar button's dialog grows out of the button. Satin's natural structure attaches
|
|
4
|
-
* the dialog at screen level, so the pressed control
|
|
4
|
+
* the dialog at screen level, so the pressed control supplies the attachment point. */
|
|
5
5
|
const lastPress = new WeakMap();
|
|
6
6
|
const tracked = new WeakSet();
|
|
7
7
|
// A press older than this did not open the dialog (a timer or a data change did).
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type ButtonHTMLAttributes, type CSSProperties, type ReactNode } from 'react';
|
|
2
2
|
import type { PressState } from './stateMachine.js';
|
|
3
|
-
/** DOM
|
|
3
|
+
/** The DOM event handlers `Pressable` owns. Use `onPress` and `onPressStateChange` instead. */
|
|
4
4
|
export type PressableOwnedHandlers = 'children' | 'disabled' | 'onBlur' | 'onClick' | 'onKeyDown' | 'onKeyUp' | 'onLostPointerCapture' | 'onPointerCancel' | 'onPointerDown' | 'onPointerMove' | 'onPointerUp';
|
|
5
|
+
/** A pressable's `onPress` action, content and press feedback. An `iconOnly` pressable needs an
|
|
6
|
+
* `aria-label`. */
|
|
5
7
|
export type PressableProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, PressableOwnedHandlers> & Readonly<{
|
|
6
8
|
children?: ReactNode;
|
|
7
9
|
disabled?: boolean;
|
|
@@ -16,4 +18,6 @@ export type PressableProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, Press
|
|
|
16
18
|
}> | Readonly<{
|
|
17
19
|
iconOnly?: false;
|
|
18
20
|
}>);
|
|
21
|
+
/** A plain tap target with no button chrome. It dims while pressed, and a touch that turns into a
|
|
22
|
+
* scroll does not fire `onPress`. Use it for custom tappable content. */
|
|
19
23
|
export declare const Pressable: import("react").ForwardRefExoticComponent<PressableProps & import("react").RefAttributes<HTMLButtonElement>>;
|
package/dist/press/Pressable.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { usePressInteraction } from './usePressInteraction.js';
|
|
4
|
+
/** A plain tap target with no button chrome. It dims while pressed, and a touch that turns into a
|
|
5
|
+
* scroll does not fire `onPress`. Use it for custom tappable content. */
|
|
4
6
|
export const Pressable = forwardRef(function Pressable({ children, disabled = false, onPress, onPressStateChange, pressedStyle, feedback = 'opacity', iconOnly = false, style, type = 'button', ...props }, forwardedRef) {
|
|
5
7
|
if (iconOnly && !props['aria-label']?.trim())
|
|
6
8
|
throw new Error('An icon-only Pressable requires a meaningful aria-label.');
|
package/dist/public/Label.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ export type LabelProps = {
|
|
|
9
9
|
labelStyle?: BuiltInLabelStyle | LabelStyle;
|
|
10
10
|
style?: CSSProperties;
|
|
11
11
|
};
|
|
12
|
-
/**
|
|
12
|
+
/** A title with an icon. In a toolbar a label with an icon shows the icon alone; a hidden title
|
|
13
|
+
* stays available to assistive technology. */
|
|
13
14
|
export declare function Label({ children, icon, symbol, labelStyle: requestedStyle, style: cssStyle, }: LabelProps): import("react").JSX.Element;
|
|
14
15
|
/** The accessible name of a toolbar label that draws only an icon: a `Label` with an icon, or a
|
|
15
16
|
* `SymbolImage`. A toolbar button or menu with such a label is a glass circle. */
|
package/dist/public/Label.js
CHANGED
|
@@ -3,7 +3,8 @@ import { isValidElement, useContext } from 'react';
|
|
|
3
3
|
import { SymbolImage } from '../symbols/Symbol.js';
|
|
4
4
|
import { ToolbarContext } from './toolbar.js';
|
|
5
5
|
import { useControlStyle } from './controlStyle.js';
|
|
6
|
-
/**
|
|
6
|
+
/** A title with an icon. In a toolbar a label with an icon shows the icon alone; a hidden title
|
|
7
|
+
* stays available to assistive technology. */
|
|
7
8
|
export function Label({ children, icon, symbol, labelStyle: requestedStyle, style: cssStyle, }) {
|
|
8
9
|
const environment = useControlStyle({ labelStyle: requestedStyle });
|
|
9
10
|
const toolbar = useContext(ToolbarContext) !== false;
|
package/dist/public/Screen.d.ts
CHANGED
|
@@ -7,8 +7,7 @@ import { type NavigationTransition } from './navigationTransition.js';
|
|
|
7
7
|
export type ScreenProps = {
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
title?: string;
|
|
10
|
-
/**
|
|
11
|
-
* under the large title. */
|
|
10
|
+
/** A line under the title: 12 pt under an inline 15 pt title, 11 pt under a large title. */
|
|
12
11
|
subtitle?: string;
|
|
13
12
|
titleDisplay?: 'large' | 'inline' | 'inlineLarge' | 'none';
|
|
14
13
|
backButton?: 'automatic' | 'hidden';
|
|
@@ -18,12 +17,11 @@ export type ScreenProps = {
|
|
|
18
17
|
toolbarMinimizationBehavior?: ToolbarMinimizationBehavior;
|
|
19
18
|
toolbarMinimizationRestoration?: ToolbarMinimizationRestoration;
|
|
20
19
|
toolbarMinimizationSafeAreaAdjustment?: ToolbarMinimizationSafeAreaAdjustment;
|
|
21
|
-
/**
|
|
20
|
+
/** The screen's `ToolbarItem`, `ToolbarItemGroup` and `ToolbarSpacer` elements. */
|
|
22
21
|
toolbar?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* scroll view. */
|
|
22
|
+
/** A search field for this screen, placed in the navigation bar drawer or the bottom toolbar. */
|
|
25
23
|
searchable?: Searchable;
|
|
26
|
-
/**
|
|
24
|
+
/** How this screen arrives when pushed and leaves when popped.
|
|
27
25
|
* `NavigationTransition.zoom(...)` grows it out of a `MatchedTransitionSource`. */
|
|
28
26
|
navigationTransition?: NavigationTransition;
|
|
29
27
|
};
|
package/dist/public/actions.d.ts
CHANGED
|
@@ -12,5 +12,6 @@ export type MenuProps = Readonly<{
|
|
|
12
12
|
* @experimental Custom menu triggers may change. */
|
|
13
13
|
trigger?: (props: MenuTriggerProps) => ReactNode;
|
|
14
14
|
}>;
|
|
15
|
-
/**
|
|
15
|
+
/** A button that opens a menu of actions. In a toolbar a symbol label draws an icon button and a
|
|
16
|
+
* text label draws a capsule. */
|
|
16
17
|
export declare function Menu(props: MenuProps): import("react").JSX.Element;
|
package/dist/public/actions.js
CHANGED
|
@@ -4,7 +4,8 @@ import { Menu as EngineMenu } from '../glass/Menu.js';
|
|
|
4
4
|
import { ToolbarContext } from './toolbar.js';
|
|
5
5
|
import { Button } from './controls.js';
|
|
6
6
|
export { ContextMenu } from '../actions/RowActions.js';
|
|
7
|
-
/**
|
|
7
|
+
/** A button that opens a menu of actions. In a toolbar a symbol label draws an icon button and a
|
|
8
|
+
* text label draws a capsule. */
|
|
8
9
|
export function Menu(props) {
|
|
9
10
|
const toolbar = useContext(ToolbarContext);
|
|
10
11
|
const trigger = props.trigger ??
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type GlassShape } from '../glass/regions.js';
|
|
2
|
-
/** `
|
|
2
|
+
/** The outline of a bordered button: `automatic`, `capsule`, or a rounded rectangle with a fixed
|
|
3
|
+
* corner radius in points. */
|
|
3
4
|
export type ButtonBorderShape = 'automatic' | 'capsule' | Readonly<{
|
|
4
5
|
kind: 'roundedRectangle';
|
|
5
6
|
cornerRadius: number;
|
package/dist/public/colors.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** The names of the iOS system colours. Each has a light and a dark value. Plain CSS colours work
|
|
2
|
+
* too. */
|
|
2
3
|
export type SystemColorName = 'blue' | 'brown' | 'cyan' | 'gray' | 'gray2' | 'gray3' | 'gray4' | 'gray5' | 'gray6' | 'green' | 'indigo' | 'mint' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'yellow';
|
|
3
|
-
/**
|
|
4
|
+
/** Returns a system colour as a CSS colour that follows light and dark appearance.
|
|
4
5
|
* @example <Button tint={systemColor('orange')} onPress={start}>Start</Button> */
|
|
5
6
|
export declare function systemColor(name: SystemColorName): string;
|
|
6
7
|
declare const semanticColors: {
|
|
@@ -22,8 +23,10 @@ declare const semanticColors: {
|
|
|
22
23
|
readonly tertiarySystemGroupedBackground: '--satin-tertiary-system-grouped-background';
|
|
23
24
|
readonly tint: '--satin-tint';
|
|
24
25
|
};
|
|
25
|
-
/**
|
|
26
|
+
/** The names of the iOS semantic colours for text, fills, backgrounds, separators and tint
|
|
27
|
+
* (`label`, `secondarySystemBackground`, …). */
|
|
26
28
|
export type SemanticColorName = keyof typeof semanticColors;
|
|
27
|
-
/**
|
|
29
|
+
/** Returns a semantic colour, such as `label` or `systemGroupedBackground`, as a CSS colour that
|
|
30
|
+
* follows light and dark appearance. It also resolves inside portals. */
|
|
28
31
|
export declare function semanticColor(name: SemanticColorName): string;
|
|
29
32
|
export {};
|
package/dist/public/colors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Returns a system colour as a CSS colour that follows light and dark appearance.
|
|
2
2
|
* @example <Button tint={systemColor('orange')} onPress={start}>Start</Button> */
|
|
3
3
|
export function systemColor(name) {
|
|
4
4
|
return `var(--satin-system-${name})`;
|
|
@@ -22,7 +22,8 @@ const semanticColors = {
|
|
|
22
22
|
tertiarySystemGroupedBackground: '--satin-tertiary-system-grouped-background',
|
|
23
23
|
tint: '--satin-tint',
|
|
24
24
|
};
|
|
25
|
-
/**
|
|
25
|
+
/** Returns a semantic colour, such as `label` or `systemGroupedBackground`, as a CSS colour that
|
|
26
|
+
* follows light and dark appearance. It also resolves inside portals. */
|
|
26
27
|
export function semanticColor(name) {
|
|
27
28
|
return `var(${semanticColors[name]})`;
|
|
28
29
|
}
|
|
@@ -1,51 +1,54 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
-
/** `
|
|
2
|
+
/** A control's size, from `mini` to `extraLarge`. `regular` is the default. */
|
|
3
3
|
export type ControlSize = 'mini' | 'small' | 'regular' | 'large' | 'extraLarge';
|
|
4
|
-
/** `
|
|
4
|
+
/** A button's role. `destructive` draws it in red; `cancel` marks the action that backs out. */
|
|
5
5
|
export type ButtonRole = 'destructive' | 'cancel';
|
|
6
|
-
/**
|
|
6
|
+
/** The built-in button styles, by their `buttonStyle` names. `automatic` picks one for the
|
|
7
|
+
* context. */
|
|
7
8
|
export type BuiltInButtonStyle = 'automatic' | 'bordered' | 'borderedProminent' | 'borderless' | 'plain' | 'glass' | 'glassProminent';
|
|
8
|
-
/**
|
|
9
|
+
/** What every custom control style receives: enabled state, control size and tint. */
|
|
9
10
|
export type ControlConfiguration = Readonly<{
|
|
10
11
|
isEnabled: boolean;
|
|
11
12
|
controlSize: ControlSize;
|
|
12
13
|
tint: string | undefined;
|
|
13
14
|
}>;
|
|
14
|
-
/**
|
|
15
|
+
/** What a custom `ButtonStyle` draws from: the label, the pressed state and the role, plus the
|
|
16
|
+
* shared control values. */
|
|
15
17
|
export type ButtonStyleConfiguration = ControlConfiguration & Readonly<{
|
|
16
18
|
label: ReactNode;
|
|
17
19
|
isPressed: boolean;
|
|
18
20
|
role: ButtonRole | undefined;
|
|
19
21
|
}>;
|
|
20
|
-
/** A custom
|
|
21
|
-
*
|
|
22
|
+
/** A custom look for `Button`. `makeBody` returns noninteractive content; Satin still owns the
|
|
23
|
+
* button's press handling and accessibility. */
|
|
22
24
|
export type ButtonStyle = Readonly<{
|
|
23
25
|
makeBody(configuration: ButtonStyleConfiguration): ReactNode;
|
|
24
26
|
}>;
|
|
25
|
-
/** `
|
|
27
|
+
/** What a custom `LabelStyle` draws from: the label's title and icon. */
|
|
26
28
|
export type LabelStyleConfiguration = Readonly<{
|
|
27
29
|
title: ReactNode;
|
|
28
30
|
icon: ReactNode;
|
|
29
31
|
}>;
|
|
30
|
-
/** A custom
|
|
32
|
+
/** A custom arrangement of a label's title and icon. */
|
|
31
33
|
export type LabelStyle = Readonly<{
|
|
32
34
|
makeBody(configuration: LabelStyleConfiguration): ReactNode;
|
|
33
35
|
}>;
|
|
34
|
-
/**
|
|
36
|
+
/** The built-in label styles: the title, the icon or both. `automatic` picks for the context. */
|
|
35
37
|
export type BuiltInLabelStyle = 'automatic' | 'titleAndIcon' | 'titleOnly' | 'iconOnly';
|
|
36
|
-
/**
|
|
38
|
+
/** What a custom `ToggleStyle` draws from: the label, the on state and the pressed state, plus
|
|
39
|
+
* the shared control values. */
|
|
37
40
|
export type ToggleStyleConfiguration = ControlConfiguration & Readonly<{
|
|
38
41
|
label: ReactNode;
|
|
39
42
|
isOn: boolean;
|
|
40
43
|
isPressed: boolean;
|
|
41
44
|
}>;
|
|
42
|
-
/** A custom
|
|
43
|
-
*
|
|
45
|
+
/** A custom look for `Toggle`. Satin applies the declared `semantics` (switch, checkbox or button)
|
|
46
|
+
* to the element it owns; `makeBody` draws the appearance. */
|
|
44
47
|
export type ToggleStyle = Readonly<{
|
|
45
48
|
semantics: 'switch' | 'checkbox' | 'button';
|
|
46
49
|
makeBody(configuration: ToggleStyleConfiguration): ReactNode;
|
|
47
50
|
}>;
|
|
48
|
-
/**
|
|
51
|
+
/** The built-in toggle styles: `switch` or `button`. `automatic` picks for the context. */
|
|
49
52
|
export type BuiltInToggleStyle = 'automatic' | 'switch' | 'button';
|
|
50
53
|
/** The control environment a `ControlStyleProvider` sets for its subtree. */
|
|
51
54
|
export type ControlStyleValues = Readonly<{
|