@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
|
@@ -13,9 +13,9 @@ export type { ButtonBorderShape } from './buttonBorderShape.js';
|
|
|
13
13
|
import type { RowActionsProps } from '../actions/types.js';
|
|
14
14
|
import { type ListItemID } from '../list-form/editing.js';
|
|
15
15
|
import type { Routes, RouteProps, RegisteredRoutes } from './routes.js';
|
|
16
|
-
/** `swipeActions` and `contextMenu`
|
|
16
|
+
/** The `swipeActions` and `contextMenu` props of a row in a `List`. */
|
|
17
17
|
export type RowInteractionProps = RowActionsProps;
|
|
18
|
-
/**
|
|
18
|
+
/** How a text field draws. `automatic` adapts to its container; `plain` draws no field chrome. */
|
|
19
19
|
export type TextFieldStyle = 'automatic' | 'plain';
|
|
20
20
|
/** A number caps growth; a range also reserves its minimum number of lines. */
|
|
21
21
|
export type LineLimit = number | {
|
|
@@ -37,14 +37,14 @@ export type FormProps = Omit<HTMLAttributes<HTMLDivElement>, 'id'> & {
|
|
|
37
37
|
listSectionSpacing?: 'default' | 'compact' | number;
|
|
38
38
|
scrollContentBackground?: 'hidden' | 'visible';
|
|
39
39
|
};
|
|
40
|
-
/** `
|
|
40
|
+
/** How a `List` draws its rows and sections. `insetGrouped` is the default. */
|
|
41
41
|
export type ListStyle = 'insetGrouped' | 'plain' | 'grouped' | 'sidebar';
|
|
42
42
|
/** A `List` takes a `Form`'s options, its `listStyle` and an optional `selection`. */
|
|
43
43
|
export type ListProps<ID extends ListItemID = ListItemID> = FormProps & {
|
|
44
44
|
listStyle?: ListStyle;
|
|
45
45
|
} & ListSelectionProps<ID>;
|
|
46
46
|
/**
|
|
47
|
-
* `List
|
|
47
|
+
* Row selection for a `List`. An optional id selects one row: tapping a row selects it. A `Set`
|
|
48
48
|
* selects many: while editing, rows show selection circles and taps toggle them. Rows are
|
|
49
49
|
* identified by their `ForEach` ids.
|
|
50
50
|
*/
|
|
@@ -59,8 +59,8 @@ export type ListSelectionProps<ID extends ListItemID = ListItemID> = {
|
|
|
59
59
|
onSelectionChange: (next: Set<ID>) => void;
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
62
|
+
* A scrolling column of rows, inset grouped by default. Controls inside it render as rows.
|
|
63
|
+
* Its `id` keys scroll restoration, so keep it stable.
|
|
64
64
|
*
|
|
65
65
|
* With `selection`, rows from a `ForEach` become selectable; with an `EditButton` in the screen's
|
|
66
66
|
* toolbar, `ForEach`'s `onDelete` and `onMove` add the editing controls.
|
|
@@ -87,8 +87,8 @@ export declare function List<ID extends ListItemID>(props: FormProps & {
|
|
|
87
87
|
export declare function List(props: FormProps & {
|
|
88
88
|
listStyle?: ListStyle;
|
|
89
89
|
}): ReactElement;
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
90
|
+
/** An inset grouped `List` for settings and data entry. Scrolling it dismisses the keyboard
|
|
91
|
+
* at once. */
|
|
92
92
|
export declare function Form(props: FormProps): import("react").JSX.Element;
|
|
93
93
|
/** Button's action, label and control properties. An `iconOnly` button needs an `aria-label`. */
|
|
94
94
|
export type ButtonProps = AriaAttributes & RowInteractionProps & {
|
|
@@ -112,7 +112,7 @@ export type ButtonProps = AriaAttributes & RowInteractionProps & {
|
|
|
112
112
|
iconOnly?: false;
|
|
113
113
|
});
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
115
|
+
* A pressable control that adapts to where it is: a tinted row in a `List`, a glass button in a
|
|
116
116
|
* toolbar, otherwise the `buttonStyle` you choose. `role="destructive"` carries into every context.
|
|
117
117
|
*
|
|
118
118
|
* @example
|
|
@@ -120,8 +120,8 @@ export type ButtonProps = AriaAttributes & RowInteractionProps & {
|
|
|
120
120
|
*/
|
|
121
121
|
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
123
|
+
* Toggles the screen's edit mode. In a toolbar it reads Edit, then becomes a prominent
|
|
124
|
+
* checkmark (Done) while editing.
|
|
125
125
|
*
|
|
126
126
|
* @example
|
|
127
127
|
* <Screen toolbar={<ToolbarItem placement="topBarTrailing"><EditButton /></ToolbarItem>}>
|
|
@@ -154,8 +154,8 @@ export type NavigationLinkProps<R extends Routes = RegisteredRoutes> = [
|
|
|
154
154
|
};
|
|
155
155
|
}[keyof R['definitions'] & string];
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
157
|
+
* Pushes a declared route. In a `List` it draws a disclosure row; elsewhere it is a plain
|
|
158
|
+
* pressable.
|
|
159
159
|
*
|
|
160
160
|
* @example
|
|
161
161
|
* <NavigationLink to="note" params={{ id: note.id }}>{note.title}</NavigationLink>
|
|
@@ -166,7 +166,7 @@ export type RowLabelProps = {
|
|
|
166
166
|
children: ReactNode;
|
|
167
167
|
detail: ReactNode;
|
|
168
168
|
};
|
|
169
|
-
/** A row
|
|
169
|
+
/** A row title with a secondary `detail` line under it. The framework owns its layout. */
|
|
170
170
|
export declare function RowLabel({ children, detail }: RowLabelProps): import("react").JSX.Element;
|
|
171
171
|
/** The row's label and the trailing value it shows. */
|
|
172
172
|
export type LabeledContentProps = RowInteractionProps & {
|
|
@@ -178,7 +178,7 @@ export type LabeledContentProps = RowInteractionProps & {
|
|
|
178
178
|
className?: string;
|
|
179
179
|
'aria-label'?: string;
|
|
180
180
|
};
|
|
181
|
-
/**
|
|
181
|
+
/** A row with a label and a trailing value in secondary text. */
|
|
182
182
|
export declare function LabeledContent({ 'aria-label': accessibilityLabel, ...props }: LabeledContentProps): import("react").JSX.Element;
|
|
183
183
|
/** Toggle's controlled value, label and control properties. */
|
|
184
184
|
export type ToggleProps = {
|
|
@@ -196,8 +196,8 @@ export type ToggleProps = {
|
|
|
196
196
|
tint?: string;
|
|
197
197
|
};
|
|
198
198
|
/**
|
|
199
|
-
*
|
|
200
|
-
* elsewhere
|
|
199
|
+
* A controlled on/off value. It draws a switch row in a `List` or `Form` and a bare switch
|
|
200
|
+
* elsewhere. `toggleStyle` can make it a button or a custom `ToggleStyle`.
|
|
201
201
|
*
|
|
202
202
|
* @example
|
|
203
203
|
* <Toggle label="Show Completed" isOn={showCompleted} onChange={setShowCompleted} />
|
|
@@ -216,9 +216,8 @@ export type PickerProps = {
|
|
|
216
216
|
onSelectionChange(id: string): void;
|
|
217
217
|
};
|
|
218
218
|
/**
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* segmented control.
|
|
219
|
+
* Chooses one option. `menu` (the default) opens a menu from the row, `navigationLink` pushes a
|
|
220
|
+
* list of options, `inline` lists them in place and `segmented` draws a segmented control.
|
|
222
221
|
*
|
|
223
222
|
* An option can carry a `symbol` (or `icon`) and a `color`. Icons draw in colour in an inline or
|
|
224
223
|
* navigationLink list, in the label colour inside the open menu, and not at all when segmented.
|
|
@@ -241,14 +240,14 @@ export type StepperProps = {
|
|
|
241
240
|
label: string;
|
|
242
241
|
onEditingChange?: (editing: boolean) => void;
|
|
243
242
|
};
|
|
244
|
-
/**
|
|
245
|
-
*
|
|
243
|
+
/** Increments or decrements a controlled number within its bounds. It draws a row in a `List`
|
|
244
|
+
* and the bare control elsewhere. */
|
|
246
245
|
export declare function Stepper({ disabled, ...rest }: StepperProps): import("react").JSX.Element;
|
|
247
246
|
/** Slider's controlled value, range, step and accessibility label. */
|
|
248
247
|
export type SliderProps = {
|
|
249
248
|
value: number;
|
|
250
249
|
onChange: (value: number) => void;
|
|
251
|
-
/** `
|
|
250
|
+
/** The lower bound. `min` and `max` default to 0 and 1. */
|
|
252
251
|
min?: number;
|
|
253
252
|
max?: number;
|
|
254
253
|
/** Snap to multiples of `step` from `min`; omit for a continuous Slider. */
|
|
@@ -261,7 +260,8 @@ export type SliderProps = {
|
|
|
261
260
|
tint?: string;
|
|
262
261
|
onEditingChange?: (editing: boolean) => void;
|
|
263
262
|
};
|
|
264
|
-
/**
|
|
263
|
+
/** Drags a controlled number between `min` and `max`, continuously or in steps. In a `List` or
|
|
264
|
+
* `Form` it fills its own 60 pt row. */
|
|
265
265
|
export declare function Slider({ disabled, tint, ...rest }: SliderProps): import("react").JSX.Element;
|
|
266
266
|
/** Horizontal TextField's controlled text and keyboard intent. */
|
|
267
267
|
export type HorizontalTextFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'onSubmit' | 'size' | 'placeholder'> & {
|
|
@@ -291,7 +291,7 @@ export type VerticalTextFieldProps = Omit<TextareaHTMLAttributes<HTMLTextAreaEle
|
|
|
291
291
|
/** A single-line field, or with `axis="vertical"` a field that grows to its `lineLimit`. */
|
|
292
292
|
export type TextFieldProps = HorizontalTextFieldProps | VerticalTextFieldProps;
|
|
293
293
|
/**
|
|
294
|
-
*
|
|
294
|
+
* Single-line controlled text with a label, an optional `prompt` and keyboard intent from
|
|
295
295
|
* `kind`. In a `List` or `Form` it becomes the row; elsewhere it draws a standalone field.
|
|
296
296
|
* `axis="vertical"` grows with its content.
|
|
297
297
|
*
|
|
@@ -314,7 +314,7 @@ export type SecureFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type
|
|
|
314
314
|
prompt?: string;
|
|
315
315
|
textFieldStyle?: TextFieldStyle;
|
|
316
316
|
};
|
|
317
|
-
/**
|
|
317
|
+
/** Password entry through secure system input. In a `List` or `Form` it becomes the row. */
|
|
318
318
|
export declare const SecureField: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "onSubmit" | "placeholder" | "size" | "type" | "value"> & {
|
|
319
319
|
label: string;
|
|
320
320
|
value: string;
|
|
@@ -336,7 +336,8 @@ export type TextEditorProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>,
|
|
|
336
336
|
prompt?: string;
|
|
337
337
|
textFieldStyle?: TextFieldStyle;
|
|
338
338
|
};
|
|
339
|
-
/**
|
|
339
|
+
/** Multiline text entry. In a `List` or `Form` it becomes the row; elsewhere it shows three
|
|
340
|
+
* lines by default. */
|
|
340
341
|
export declare const TextEditor: import("react").ForwardRefExoticComponent<Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "defaultValue" | "onChange" | "placeholder" | "rows" | "value"> & {
|
|
341
342
|
value: string;
|
|
342
343
|
onChange(value: string): void;
|
|
@@ -356,5 +357,5 @@ export type ContentUnavailableViewProps = {
|
|
|
356
357
|
className?: string;
|
|
357
358
|
children?: ReactNode;
|
|
358
359
|
};
|
|
359
|
-
/**
|
|
360
|
+
/** An empty state: an icon, a title, an optional description and optional action children. */
|
|
360
361
|
export declare function ContentUnavailableView({ symbol, title, description, icon, className, children, }: ContentUnavailableViewProps): import("react").JSX.Element;
|
package/dist/public/controls.js
CHANGED
|
@@ -46,13 +46,13 @@ function selectionBinding(selection, onSelectionChange) {
|
|
|
46
46
|
onChange: onSelectionChange,
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
49
|
+
/** An inset grouped `List` for settings and data entry. Scrolling it dismisses the keyboard
|
|
50
|
+
* at once. */
|
|
51
51
|
export function Form(props) {
|
|
52
52
|
return (_jsx(List, { ...props, listStyle: "insetGrouped", scrollDismissesKeyboard: props.scrollDismissesKeyboard ?? 'immediately' }));
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* A pressable control that adapts to where it is: a tinted row in a `List`, a glass button in a
|
|
56
56
|
* toolbar, otherwise the `buttonStyle` you choose. `role="destructive"` carries into every context.
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
@@ -72,9 +72,9 @@ export const Button = forwardRef(function Button({ children, symbol, role, butto
|
|
|
72
72
|
const resolvedBorderShape = resolveButtonBorderShape(buttonBorderShape);
|
|
73
73
|
const [isPressed, setPressed] = useState(false);
|
|
74
74
|
// A toolbar button labelled with an icon-only Label or a SymbolImage is a glass circle, and so is a
|
|
75
|
-
// titled button with a symbol
|
|
75
|
+
// A titled toolbar button with a symbol uses a circular control.
|
|
76
76
|
// draws only its symbol (iOS 27.0 native reference), the title becoming its accessible name. A bare symbol
|
|
77
|
-
//
|
|
77
|
+
// An icon-only toolbar button uses the same circle.
|
|
78
78
|
const symbolTitle = toolbar && symbol && typeof children === 'string' && !rest.iconOnly ? children : undefined;
|
|
79
79
|
const bareSymbolName = toolbar && symbol && (children == null || typeof children === 'boolean') && !rest.iconOnly
|
|
80
80
|
? rest['aria-label']?.trim() || symbol
|
|
@@ -131,8 +131,8 @@ export const Button = forwardRef(function Button({ children, symbol, role, butto
|
|
|
131
131
|
: props.style, "data-satin-row-intrinsic": "true", "data-satin-button-style": style, "data-satin-button-role": role, children: _jsx("span", { "data-satin-button-content": true, children: content }) }));
|
|
132
132
|
});
|
|
133
133
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
134
|
+
* Toggles the screen's edit mode. In a toolbar it reads Edit, then becomes a prominent
|
|
135
|
+
* checkmark (Done) while editing.
|
|
136
136
|
*
|
|
137
137
|
* @example
|
|
138
138
|
* <Screen toolbar={<ToolbarItem placement="topBarTrailing"><EditButton /></ToolbarItem>}>
|
|
@@ -147,8 +147,8 @@ export function EditButton() {
|
|
|
147
147
|
return _jsx(Button, { onPress: toggle, children: editing ? 'Done' : 'Edit' });
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
150
|
+
* Pushes a declared route. In a `List` it draws a disclosure row; elsewhere it is a plain
|
|
151
|
+
* pressable.
|
|
152
152
|
*
|
|
153
153
|
* @example
|
|
154
154
|
* <NavigationLink to="note" params={{ id: note.id }}>{note.title}</NavigationLink>
|
|
@@ -165,17 +165,17 @@ export function NavigationLink({ to, params, children, swipeActions, contextMenu
|
|
|
165
165
|
};
|
|
166
166
|
return list ? (_jsx(Rows.NavigationRow, { ...props, swipeActions, contextMenu, label: children, leading: symbol ? (_jsx(SymbolImage, { name: symbol, style: { fontSize: 21.7, color: configuration.tint ?? 'var(--satin-tint)' } })) : (props.leading), onPress: onPress })) : (_jsxs(Pressable, { ...props, disabled: configuration.disabled, style: controlTintStyle(configuration.tint), "data-satin-navigation-link": "true", onPress: onPress, children: [symbol && _jsx(SymbolImage, { name: symbol }), children] }));
|
|
167
167
|
}
|
|
168
|
-
/** A row
|
|
168
|
+
/** A row title with a secondary `detail` line under it. The framework owns its layout. */
|
|
169
169
|
export function RowLabel({ children, detail }) {
|
|
170
170
|
return _jsx(RowLabelBody, { detail: detail, children: children });
|
|
171
171
|
}
|
|
172
|
-
/**
|
|
172
|
+
/** A row with a label and a trailing value in secondary text. */
|
|
173
173
|
export function LabeledContent({ 'aria-label': accessibilityLabel, ...props }) {
|
|
174
174
|
return _jsx(Rows.ValueRow, { ...props, accessibilityLabel: accessibilityLabel });
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
|
-
*
|
|
178
|
-
* elsewhere
|
|
177
|
+
* A controlled on/off value. It draws a switch row in a `List` or `Form` and a bare switch
|
|
178
|
+
* elsewhere. `toggleStyle` can make it a button or a custom `ToggleStyle`.
|
|
179
179
|
*
|
|
180
180
|
* @example
|
|
181
181
|
* <Toggle label="Show Completed" isOn={showCompleted} onChange={setShowCompleted} />
|
|
@@ -222,9 +222,8 @@ function toggleLabel(props, descriptionId) {
|
|
|
222
222
|
return (_jsx(RowLabelBody, { detail: props.subtitle, detailId: descriptionId, children: props.label }));
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* segmented control.
|
|
225
|
+
* Chooses one option. `menu` (the default) opens a menu from the row, `navigationLink` pushes a
|
|
226
|
+
* list of options, `inline` lists them in place and `segmented` draws a segmented control.
|
|
228
227
|
*
|
|
229
228
|
* An option can carry a `symbol` (or `icon`) and a `color`. Icons draw in colour in an inline or
|
|
230
229
|
* navigationLink list, in the label colour inside the open menu, and not at all when segmented.
|
|
@@ -236,7 +235,7 @@ function toggleLabel(props, descriptionId) {
|
|
|
236
235
|
* options={[{ id: 'home', label: 'Home', symbol: 'house', color: systemColor('red') }]} />
|
|
237
236
|
*/
|
|
238
237
|
export function Picker({ pickerStyle = 'menu', selection, onSelectionChange, disabled, ...rest }) {
|
|
239
|
-
// `ControlStyleProvider disabled` disables a Picker
|
|
238
|
+
// `ControlStyleProvider disabled` disables a Picker throughout its subtree.
|
|
240
239
|
const configuration = useControlStyle({ disabled });
|
|
241
240
|
const props = {
|
|
242
241
|
...rest,
|
|
@@ -251,14 +250,15 @@ export function Picker({ pickerStyle = 'menu', selection, onSelectionChange, dis
|
|
|
251
250
|
return _jsx(Rows.PickerOptions, { ...props });
|
|
252
251
|
return (_jsx(Rows.PickerRow, { ...props, onNavigate: navigate, presentation: pickerStyle === 'navigationLink' ? 'navigation' : 'menu' }));
|
|
253
252
|
}
|
|
254
|
-
/**
|
|
255
|
-
*
|
|
253
|
+
/** Increments or decrements a controlled number within its bounds. It draws a row in a `List`
|
|
254
|
+
* and the bare control elsewhere. */
|
|
256
255
|
export function Stepper({ disabled, ...rest }) {
|
|
257
256
|
const configuration = useControlStyle({ disabled });
|
|
258
257
|
const props = { ...rest, disabled: configuration.disabled };
|
|
259
258
|
return useContext(ListContext) ? (_jsx(Rows.StepperRow, { ...props })) : (_jsx(Rows.StepperControl, { ...props }));
|
|
260
259
|
}
|
|
261
|
-
/**
|
|
260
|
+
/** Drags a controlled number between `min` and `max`, continuously or in steps. In a `List` or
|
|
261
|
+
* `Form` it fills its own 60 pt row. */
|
|
262
262
|
export function Slider({ disabled, tint, ...rest }) {
|
|
263
263
|
const configuration = useControlStyle({ disabled, tint });
|
|
264
264
|
const props = { ...rest, disabled: configuration.disabled, tint: configuration.tint };
|
|
@@ -276,7 +276,7 @@ const Field = forwardRef(function TextField({ prompt, textFieldStyle, style, ...
|
|
|
276
276
|
return (_jsx(Fields.TextField, { ...fieldProps, style: style, ref: ref, placeholder: prompt ?? (hidden ? props.label : undefined), variant: variant, labelVisibility: hidden ? 'hidden' : 'visible' }));
|
|
277
277
|
});
|
|
278
278
|
/**
|
|
279
|
-
*
|
|
279
|
+
* Single-line controlled text with a label, an optional `prompt` and keyboard intent from
|
|
280
280
|
* `kind`. In a `List` or `Form` it becomes the row; elsewhere it draws a standalone field.
|
|
281
281
|
* `axis="vertical"` grows with its content.
|
|
282
282
|
*
|
|
@@ -285,17 +285,18 @@ const Field = forwardRef(function TextField({ prompt, textFieldStyle, style, ...
|
|
|
285
285
|
*/
|
|
286
286
|
// The cast keeps single-line refs and events precisely typed when axis is omitted.
|
|
287
287
|
export const TextField = Field;
|
|
288
|
-
/**
|
|
288
|
+
/** Password entry through secure system input. In a `List` or `Form` it becomes the row. */
|
|
289
289
|
export const SecureField = forwardRef(function SecureField({ prompt, textFieldStyle, style, ...props }, ref) {
|
|
290
290
|
const variant = useFieldVariant(textFieldStyle);
|
|
291
291
|
return (_jsx(Fields.SecureField, { ...props, style: style, ref: ref, placeholder: prompt ?? (variant !== 'standalone' ? props.label : undefined), variant: variant, labelVisibility: prompt !== undefined || variant !== 'standalone' ? 'hidden' : 'visible' }));
|
|
292
292
|
});
|
|
293
|
-
/**
|
|
293
|
+
/** Multiline text entry. In a `List` or `Form` it becomes the row; elsewhere it shows three
|
|
294
|
+
* lines by default. */
|
|
294
295
|
export const TextEditor = forwardRef(function TextEditor({ prompt, textFieldStyle, style, ...props }, ref) {
|
|
295
296
|
const variant = useFieldVariant(textFieldStyle);
|
|
296
297
|
return (_jsx(Editor, { ...props, minLines: props.minLines ?? (variant === 'row' ? 1 : 3), style: style, ref: ref, placeholder: prompt ?? (variant === 'plain' ? props.label : undefined), variant: variant, labelVisibility: prompt !== undefined || variant !== 'standalone' ? 'hidden' : 'visible' }));
|
|
297
298
|
});
|
|
298
|
-
/**
|
|
299
|
+
/** An empty state: an icon, a title, an optional description and optional action children. */
|
|
299
300
|
export function ContentUnavailableView({ symbol = 'tray', title, description, icon, className, children, }) {
|
|
300
301
|
return (_jsxs("div", { "data-satin-empty-state": "true", className: className, children: [_jsx("div", { "data-satin-empty-state-icon": "true", "aria-hidden": "true", children: icon ?? _jsx(SymbolImage, { name: symbol }) }), _jsx("strong", { "data-satin-empty-state-title": "true", children: title }), description && _jsx("div", { "data-satin-empty-state-description": "true", children: description }), children && _jsx("div", { "data-satin-unavailable-actions": "true", children: children })] }));
|
|
301
302
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
/**
|
|
2
|
+
/** The text, URL or files to share, the button content and the completion and error callbacks. */
|
|
3
3
|
export type ShareLinkProps = {
|
|
4
4
|
item: ShareData;
|
|
5
5
|
children?: ReactNode;
|
|
@@ -9,9 +9,10 @@ export type ShareLinkProps = {
|
|
|
9
9
|
/** Includes AbortError for dismissal or absence of a suitable share target. */
|
|
10
10
|
onError(error: Error): void;
|
|
11
11
|
};
|
|
12
|
-
/**
|
|
12
|
+
/** A button that opens the system share sheet. Prepare file bytes before rendering, because the
|
|
13
|
+
* sheet must open during the press. */
|
|
13
14
|
export declare function ShareLink({ item, children, disabled, onCompletion, onError, }: ShareLinkProps): import("react").JSX.Element;
|
|
14
|
-
/**
|
|
15
|
+
/** The button content and the callbacks that receive the pasted text or the error. */
|
|
15
16
|
export type PasteButtonProps = {
|
|
16
17
|
children?: ReactNode;
|
|
17
18
|
disabled?: boolean;
|
|
@@ -19,5 +20,6 @@ export type PasteButtonProps = {
|
|
|
19
20
|
/** Permission denial and dismissal are reported as browser errors. */
|
|
20
21
|
onError(error: Error): void;
|
|
21
22
|
};
|
|
22
|
-
/**
|
|
23
|
+
/** A button that pastes plain text from the clipboard when pressed. It never reads the clipboard
|
|
24
|
+
* before the press. The browser may ask the user to confirm. */
|
|
23
25
|
export declare function PasteButton({ children, disabled, onPaste, onError }: PasteButtonProps): import("react").JSX.Element;
|
|
@@ -63,7 +63,8 @@ function DeviceAction({ children, disabled, identity, start, onResult, onError,
|
|
|
63
63
|
};
|
|
64
64
|
return (_jsx(Button, { ref: button, disabled: unavailable || busy, onPress: activate, children: children }));
|
|
65
65
|
}
|
|
66
|
-
/**
|
|
66
|
+
/** A button that opens the system share sheet. Prepare file bytes before rendering, because the
|
|
67
|
+
* sheet must open during the press. */
|
|
67
68
|
export function ShareLink({ item, children = 'Share', disabled, onCompletion, onError, }) {
|
|
68
69
|
return (_jsx(DeviceAction, { disabled: disabled, identity: item, onResult: onCompletion, onError: onError, start: () => {
|
|
69
70
|
if (typeof navigator.share !== 'function') {
|
|
@@ -76,7 +77,8 @@ export function ShareLink({ item, children = 'Share', disabled, onCompletion, on
|
|
|
76
77
|
return navigator.share(item);
|
|
77
78
|
}, children: children }));
|
|
78
79
|
}
|
|
79
|
-
/**
|
|
80
|
+
/** A button that pastes plain text from the clipboard when pressed. It never reads the clipboard
|
|
81
|
+
* before the press. The browser may ask the user to confirm. */
|
|
80
82
|
export function PasteButton({ children = 'Paste', disabled, onPaste, onError }) {
|
|
81
83
|
return (_jsx(DeviceAction, { disabled: disabled, onResult: onPaste, onError: onError, start: () => {
|
|
82
84
|
if (typeof navigator.clipboard?.readText !== 'function') {
|
|
@@ -10,32 +10,34 @@ import { setAppBadge } from '../push/notifications.js';
|
|
|
10
10
|
export declare function useAppUpdate(): Readonly<{
|
|
11
11
|
justUpdated: JustUpdated | null;
|
|
12
12
|
}>;
|
|
13
|
-
/** `
|
|
13
|
+
/** The horizontal size class: `compact` or `regular`. Inside a presentation it is the
|
|
14
|
+
* presentation's own class; elsewhere, the window's. */
|
|
14
15
|
export declare function useHorizontalSizeClass(): UserInterfaceSizeClass;
|
|
15
|
-
/** `
|
|
16
|
+
/** The vertical size class: `compact` or `regular`. Inside a presentation it is the
|
|
17
|
+
* presentation's own class; elsewhere, the window's. */
|
|
16
18
|
export declare function useVerticalSizeClass(): UserInterfaceSizeClass;
|
|
17
19
|
/** The live safe-area insets in CSS pixels. Use them instead of `env(safe-area-inset-*)`. */
|
|
18
20
|
export declare function useSafeAreaInsets(): EdgeInsets;
|
|
19
|
-
/**
|
|
21
|
+
/** Whether the app is in use: `active` in the foreground with focus, `inactive` without focus,
|
|
20
22
|
* `background` when hidden. */
|
|
21
23
|
export declare function useScenePhase(): ScenePhase;
|
|
22
|
-
/**
|
|
24
|
+
/** The appearance Satin is drawing right now, `light` or `dark`. */
|
|
23
25
|
export declare function useColorScheme(): ColorScheme;
|
|
24
26
|
/** Every glass renderer error so far, re-rendering when one is added. For diagnostics screens;
|
|
25
27
|
* `runApp`'s `onGlassError` is the way to report them. */
|
|
26
28
|
export declare function useGlassErrors(): readonly GlassError[];
|
|
27
29
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
30
|
+
* State kept with the current navigation entry, so a draft survives a relaunch. Each pushed
|
|
31
|
+
* entry owns its own value. Values must be JSON-serializable. Keep saved records in a
|
|
32
|
+
* collection, not here.
|
|
31
33
|
*
|
|
32
34
|
* @example
|
|
33
35
|
* const [draft, setDraft] = useSceneStorage('draft', '')
|
|
34
36
|
*/
|
|
35
37
|
export declare function useSceneStorage<T>(key: string, initial: T): readonly [T, (next: SetStateAction<T>) => void];
|
|
36
38
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
+
* A small preference kept in local storage across launches. Every component that reads the same
|
|
40
|
+
* key sees the same value. Values must be JSON-serializable.
|
|
39
41
|
*
|
|
40
42
|
* @example
|
|
41
43
|
* const [units, setUnits] = useAppStorage('units', 'kg')
|
|
@@ -62,16 +64,17 @@ export type NotificationPermissionExplainerProps = {
|
|
|
62
64
|
/** Explains what notifications are for before the user asks for them; its button requests
|
|
63
65
|
* authorization from that gesture. */
|
|
64
66
|
export declare function NotificationPermissionExplainer({ title, children, }: NotificationPermissionExplainerProps): import("react").JSX.Element;
|
|
65
|
-
/**
|
|
67
|
+
/** Insets on each edge in points. `leading` and `trailing` follow the layout direction. */
|
|
66
68
|
export type EdgeInsets = Readonly<{
|
|
67
69
|
top: number;
|
|
68
70
|
leading: number;
|
|
69
71
|
bottom: number;
|
|
70
72
|
trailing: number;
|
|
71
73
|
}>;
|
|
72
|
-
/**
|
|
74
|
+
/** How much room there is along one axis: `compact` or `regular`. */
|
|
73
75
|
export type UserInterfaceSizeClass = 'compact' | 'regular';
|
|
74
|
-
/**
|
|
76
|
+
/** Whether the app is in the foreground with focus (`active`), without focus (`inactive`) or
|
|
77
|
+
* hidden (`background`). */
|
|
75
78
|
export type ScenePhase = 'active' | 'inactive' | 'background';
|
|
76
|
-
/**
|
|
79
|
+
/** A light or dark appearance. */
|
|
77
80
|
export type ColorScheme = 'light' | 'dark';
|
|
@@ -18,13 +18,15 @@ export function useAppUpdate() {
|
|
|
18
18
|
const { justUpdated, launchReady } = useSatinLayoutRuntime();
|
|
19
19
|
return { justUpdated: launchReady ? justUpdated : null };
|
|
20
20
|
}
|
|
21
|
-
/** `
|
|
21
|
+
/** The horizontal size class: `compact` or `regular`. Inside a presentation it is the
|
|
22
|
+
* presentation's own class; elsewhere, the window's. */
|
|
22
23
|
export function useHorizontalSizeClass() {
|
|
23
24
|
const presentation = useContext(PresentationLayoutClassContext);
|
|
24
25
|
const runtime = useSatinLayoutRuntime().layoutClass;
|
|
25
26
|
return (presentation ?? runtime).horizontal;
|
|
26
27
|
}
|
|
27
|
-
/** `
|
|
28
|
+
/** The vertical size class: `compact` or `regular`. Inside a presentation it is the
|
|
29
|
+
* presentation's own class; elsewhere, the window's. */
|
|
28
30
|
export function useVerticalSizeClass() {
|
|
29
31
|
const presentation = useContext(PresentationLayoutClassContext);
|
|
30
32
|
const runtime = useSatinLayoutRuntime().layoutClass;
|
|
@@ -48,12 +50,12 @@ function subscribeScene(listener) {
|
|
|
48
50
|
window.removeEventListener('blur', listener);
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
|
-
/**
|
|
53
|
+
/** Whether the app is in use: `active` in the foreground with focus, `inactive` without focus,
|
|
52
54
|
* `background` when hidden. */
|
|
53
55
|
export function useScenePhase() {
|
|
54
56
|
return useSyncExternalStore(subscribeScene, sceneSnapshot, () => 'inactive');
|
|
55
57
|
}
|
|
56
|
-
/**
|
|
58
|
+
/** The appearance Satin is drawing right now, `light` or `dark`. */
|
|
57
59
|
export function useColorScheme() {
|
|
58
60
|
const store = window.__SATIN_APPEARANCE__;
|
|
59
61
|
if (!store)
|
|
@@ -77,9 +79,9 @@ function schema(initial) {
|
|
|
77
79
|
};
|
|
78
80
|
}
|
|
79
81
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
82
|
+
* State kept with the current navigation entry, so a draft survives a relaunch. Each pushed
|
|
83
|
+
* entry owns its own value. Values must be JSON-serializable. Keep saved records in a
|
|
84
|
+
* collection, not here.
|
|
83
85
|
*
|
|
84
86
|
* @example
|
|
85
87
|
* const [draft, setDraft] = useSceneStorage('draft', '')
|
|
@@ -90,8 +92,8 @@ export function useSceneStorage(key, initial) {
|
|
|
90
92
|
}
|
|
91
93
|
const preferenceListeners = new Set();
|
|
92
94
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
+
* A small preference kept in local storage across launches. Every component that reads the same
|
|
96
|
+
* key sees the same value. Values must be JSON-serializable.
|
|
95
97
|
*
|
|
96
98
|
* @example
|
|
97
99
|
* const [units, setUnits] = useAppStorage('units', 'kg')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** The picker's label, the selected file and the kind of media it accepts. */
|
|
2
2
|
export type PhotosPickerProps = {
|
|
3
3
|
label?: string;
|
|
4
4
|
selection: File | null;
|
|
@@ -9,9 +9,10 @@ export type PhotosPickerProps = {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
onError?(error: Error): void;
|
|
11
11
|
};
|
|
12
|
-
/**
|
|
12
|
+
/** A button that opens the system photo chooser and returns one photo or video as a `File`. */
|
|
13
13
|
export declare function PhotosPicker({ label, selection, onSelectionChange, matching, ...props }: PhotosPickerProps): import("react").JSX.Element;
|
|
14
|
-
/**
|
|
14
|
+
/** The importer's label, the selected files and the content types it accepts, as MIME types or
|
|
15
|
+
* extensions. */
|
|
15
16
|
export type FileImporterProps = {
|
|
16
17
|
label?: string;
|
|
17
18
|
selection: readonly File[];
|
|
@@ -21,5 +22,6 @@ export type FileImporterProps = {
|
|
|
21
22
|
disabled?: boolean;
|
|
22
23
|
onError?(error: Error): void;
|
|
23
24
|
};
|
|
24
|
-
/**
|
|
25
|
+
/** A button that opens the system file chooser and returns the chosen files. Cancelling keeps the
|
|
26
|
+
* current selection. */
|
|
25
27
|
export declare function FileImporter({ label, selection, onSelectionChange, allowedContentTypes, allowsMultipleSelection, ...props }: FileImporterProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { NativeFilePicker } from './NativeFilePicker.js';
|
|
3
|
-
/**
|
|
3
|
+
/** A button that opens the system photo chooser and returns one photo or video as a `File`. */
|
|
4
4
|
export function PhotosPicker({ label = 'Choose Photo', selection, onSelectionChange, matching = 'images', ...props }) {
|
|
5
5
|
const accept = matching === 'images' ? 'image/*' : matching === 'videos' ? 'video/*' : 'image/*,video/*';
|
|
6
6
|
return (_jsx(NativeFilePicker, { ...props, label: label, value: selection, accept: accept, onChange: files => onSelectionChange(files[0]) }));
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
8
|
+
/** A button that opens the system file chooser and returns the chosen files. Cancelling keeps the
|
|
9
|
+
* current selection. */
|
|
9
10
|
export function FileImporter({ label = 'Import File', selection, onSelectionChange, allowedContentTypes, allowsMultipleSelection = false, ...props }) {
|
|
10
11
|
return (_jsx(NativeFilePicker, { ...props, label: label, value: selection, onChange: onSelectionChange, accept: allowedContentTypes?.join(','), multiple: allowsMultipleSelection }));
|
|
11
12
|
}
|
package/dist/public/glass.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
2
|
import type { NamespaceID } from '../motion/matchedGeometry.js';
|
|
3
3
|
import { Glass } from './glassValue.js';
|
|
4
|
-
/**
|
|
4
|
+
/** The outline of a glass effect: `capsule`, `circle` or a rounded rectangle with a corner radius
|
|
5
|
+
* in points. */
|
|
5
6
|
export type GlassShape = 'capsule' | 'circle' | Readonly<{
|
|
6
7
|
kind: 'roundedRectangle';
|
|
7
8
|
cornerRadius: number;
|
|
8
9
|
}>;
|
|
9
|
-
/** The glass material
|
|
10
|
+
/** The glass material and shape, plus the namespace and id that let effects morph into each
|
|
11
|
+
* other. Plain div attributes also apply. */
|
|
10
12
|
export type GlassEffectProps = HTMLAttributes<HTMLDivElement> & {
|
|
11
13
|
glass?: Glass;
|
|
12
14
|
shape?: GlassShape;
|
|
@@ -14,14 +16,14 @@ export type GlassEffectProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
14
16
|
in?: NamespaceID;
|
|
15
17
|
/** Morph identity within namespace; independent of the DOM id. */
|
|
16
18
|
glassEffectID?: string;
|
|
17
|
-
/**
|
|
19
|
+
/** Effects with one union id draw as one shape. */
|
|
18
20
|
glassEffectUnion?: string;
|
|
19
|
-
/**
|
|
21
|
+
/** Controls how an identified effect enters or leaves its container. */
|
|
20
22
|
glassEffectTransition?: 'matchedGeometry' | 'materialize' | 'identity';
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
+
* Draws glass behind its content in the given shape, a capsule by default. Inside a
|
|
26
|
+
* `GlassEffectContainer`, effects with ids morph into one another.
|
|
25
27
|
*
|
|
26
28
|
* @example
|
|
27
29
|
* <GlassEffect glass={Glass.regular.interactive()} shape="circle">
|
package/dist/public/glass.js
CHANGED
|
@@ -3,8 +3,8 @@ import { Glass, resolveGlass } from './glassValue.js';
|
|
|
3
3
|
import { GlassFieldContext } from './fieldContext.js';
|
|
4
4
|
import { GlassEffect as Effect } from '../glass/GlassEffect.js';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Draws glass behind its content in the given shape, a capsule by default. Inside a
|
|
7
|
+
* `GlassEffectContainer`, effects with ids morph into one another.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* <GlassEffect glass={Glass.regular.interactive()} shape="circle">
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Glass as Material, type GlassTint } from '../glass/regions.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* internal.
|
|
3
|
+
* The glass material for a `GlassEffect`. Start from `Glass.regular` or `Glass.clear` and refine
|
|
4
|
+
* it with a tint or `interactive()`; each call returns a new value.
|
|
6
5
|
*
|
|
7
6
|
* @example
|
|
8
7
|
* Glass.regular.tintRGBA([0, 0.48, 1, 0.2]).interactive()
|
|
@@ -13,7 +12,7 @@ export declare class Glass {
|
|
|
13
12
|
private constructor();
|
|
14
13
|
/** Tints the glass with `[red, green, blue, alpha]`, each 0...1; no argument removes the tint. */
|
|
15
14
|
tintRGBA(color?: GlassTint): Glass;
|
|
16
|
-
/**
|
|
15
|
+
/** Makes the glass respond to touch. */
|
|
17
16
|
interactive(enabled?: boolean): Glass;
|
|
18
17
|
}
|
|
19
18
|
export declare function resolveGlass(glass: Glass): Material;
|