@ankhorage/zora 28.4.0 → 28.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/features/color/ColorPicker.js +27 -1
- package/dist/features/color/ColorPicker.js.map +1 -1
- package/dist/features/layout/adapters/inbound/ZoraWebStyleSheet.d.ts +4 -0
- package/dist/features/layout/adapters/inbound/ZoraWebStyleSheet.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/ZoraWebStyleSheet.js +18 -0
- package/dist/features/layout/adapters/inbound/ZoraWebStyleSheet.js.map +1 -0
- package/dist/features/layout/public.d.ts +1 -0
- package/dist/features/layout/public.d.ts.map +1 -1
- package/dist/features/layout/public.js +1 -0
- package/dist/features/layout/public.js.map +1 -1
- package/dist/features/popover/adapters/inbound/Popover.d.ts +4 -0
- package/dist/features/popover/adapters/inbound/Popover.d.ts.map +1 -0
- package/dist/features/popover/adapters/inbound/Popover.js +9 -0
- package/dist/features/popover/adapters/inbound/Popover.js.map +1 -0
- package/dist/features/popover/public.d.ts +3 -0
- package/dist/features/popover/public.d.ts.map +1 -0
- package/dist/features/popover/public.js +2 -0
- package/dist/features/popover/public.js.map +1 -0
- package/dist/features/theme/adapters/inbound/ZoraProvider.d.ts.map +1 -1
- package/dist/features/theme/adapters/inbound/ZoraProvider.js +10 -8
- package/dist/features/theme/adapters/inbound/ZoraProvider.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/types/popover.d.ts +7 -0
- package/dist/types/popover.d.ts.map +1 -0
- package/dist/types/popover.js +2 -0
- package/dist/types/popover.js.map +1 -0
- package/package.json +1 -1
- package/src/features/color/ColorPicker.layout.test.tsx +60 -0
- package/src/features/color/ColorPicker.tsx +31 -1
- package/src/features/layout/adapters/inbound/ZoraWebStyleSheet.tsx +26 -0
- package/src/features/layout/public.test.ts +9 -1
- package/src/features/layout/public.ts +1 -0
- package/src/features/master-detail/adapters/inbound/MasterDetail.runtime.test.tsx +1 -0
- package/src/features/popover/adapters/inbound/Popover.tsx +17 -0
- package/src/features/popover/public.test.ts +9 -0
- package/src/features/popover/public.ts +2 -0
- package/src/features/theme/adapters/inbound/ZoraProvider.tsx +10 -8
- package/src/features/theme/themeScopeStructure.test.ts +3 -2
- package/src/index.ts +7 -0
- package/src/types/popover.ts +12 -0
- package/web-dist/chunks/{Accordion-nmpzv3b0.js → Accordion-0egwarcs.js} +3 -3
- package/web-dist/chunks/{Accordion-htm3j8r8.js → Accordion-0spfxhpg.js} +4 -4
- package/web-dist/chunks/{Accordion-r75ep5pg.js → Accordion-19aegsx2.js} +4 -4
- package/web-dist/chunks/{Accordion-gnbt6w4q.js → Accordion-1g91we37.js} +4 -4
- package/web-dist/chunks/{Accordion-sh79sr5g.js → Accordion-224snqz3.js} +2 -2
- package/web-dist/chunks/{Accordion-f8zpd80k.js → Accordion-23k6n6zk.js} +3 -3
- package/web-dist/chunks/{Accordion-za0jcjgn.js → Accordion-2ad57stc.js} +2 -2
- package/web-dist/chunks/{Accordion-d405whfb.js → Accordion-2bygfpwg.js} +1 -1
- package/web-dist/chunks/{Accordion-fdzyyqe9.js → Accordion-2yat0x6x.js} +4 -3
- package/web-dist/chunks/{Accordion-v86n9tvj.js → Accordion-3cpkxpdg.js} +2 -2
- package/web-dist/chunks/{Accordion-5rwztz14.js → Accordion-49d0frg7.js} +2 -2
- package/web-dist/chunks/{Accordion-f8a49gy8.js → Accordion-4mg3epm9.js} +19 -1
- package/web-dist/chunks/Accordion-4qrva6ye.js +15 -0
- package/web-dist/chunks/{Accordion-01bsg7zt.js → Accordion-4yrszsvs.js} +1 -1
- package/web-dist/chunks/{Accordion-38xvj0cq.js → Accordion-516n2cx4.js} +4 -4
- package/web-dist/chunks/{Accordion-bp9y7738.js → Accordion-554f42yj.js} +27 -8
- package/web-dist/chunks/{Accordion-be2yhfqz.js → Accordion-5z75befg.js} +12 -4
- package/web-dist/chunks/{Accordion-tqagt6cz.js → Accordion-77514sk9.js} +1 -1
- package/web-dist/chunks/{Accordion-2xkxthf1.js → Accordion-78astqx3.js} +6 -6
- package/web-dist/chunks/{Accordion-h63c9k9k.js → Accordion-7nn4r909.js} +16 -9
- package/web-dist/chunks/{Accordion-2xb252py.js → Accordion-7v6mrp8n.js} +6 -6
- package/web-dist/chunks/{Accordion-kcm6jcpp.js → Accordion-9b4bsxwe.js} +1 -1
- package/web-dist/chunks/{Accordion-a1mgdfg7.js → Accordion-9m5asd8r.js} +1 -1
- package/web-dist/chunks/{Accordion-f1vargnk.js → Accordion-9tgvr155.js} +4 -4
- package/web-dist/chunks/{Accordion-vb52sts9.js → Accordion-a5fsrv3x.js} +7 -6
- package/web-dist/chunks/{Accordion-bzgy9sg3.js → Accordion-agt9vt85.js} +2 -2
- package/web-dist/chunks/{Accordion-xzaa9s7f.js → Accordion-akwd4brm.js} +1 -13
- package/web-dist/chunks/{Accordion-379mgrse.js → Accordion-arr9ayv0.js} +1 -1
- package/web-dist/chunks/{Accordion-axe7nsht.js → Accordion-d5sz8vaq.js} +1 -1
- package/web-dist/chunks/{Accordion-5qz4j8tt.js → Accordion-ge7cjtwy.js} +5 -5
- package/web-dist/chunks/{Accordion-e0vm82xr.js → Accordion-gs838h0n.js} +2 -2
- package/web-dist/chunks/{Accordion-4zb6dcys.js → Accordion-j1zerr6z.js} +1 -1
- package/web-dist/chunks/{Accordion-2ys50fc8.js → Accordion-jtgh2tep.js} +1 -1
- package/web-dist/chunks/{Accordion-9qg7cjt8.js → Accordion-kcspvk6q.js} +2 -2
- package/web-dist/chunks/{Accordion-vkqqktc5.js → Accordion-khfjh10v.js} +2 -2
- package/web-dist/chunks/{Accordion-q683s6kd.js → Accordion-ktscjwa2.js} +3 -3
- package/web-dist/chunks/{Accordion-hdyzyw8q.js → Accordion-mnxf855g.js} +1 -1
- package/web-dist/chunks/{Accordion-17s33h1a.js → Accordion-q8a423pk.js} +1 -1
- package/web-dist/chunks/{Accordion-rtamzg9j.js → Accordion-qjxbf8nt.js} +1 -1
- package/web-dist/chunks/{Accordion-v6vhyv31.js → Accordion-qjxx43r1.js} +1 -1
- package/web-dist/chunks/{Accordion-bd9vzpbz.js → Accordion-sj1n06dw.js} +8 -8
- package/web-dist/chunks/{Accordion-rq311z1k.js → Accordion-tdrk9cyn.js} +4 -4
- package/web-dist/chunks/{Accordion-kdb9g5b1.js → Accordion-vx8bjm5k.js} +4 -4
- package/web-dist/chunks/{Accordion-2wggrer7.js → Accordion-ytf9ba8v.js} +2 -2
- package/web-dist/chunks/{Accordion-t9n4ey2r.js → Accordion-zd15byha.js} +1 -1
- package/web-dist/chunks/{RichTextClient-8x3t7bwd.js → RichTextClient-70qt7037.js} +11 -11
- package/web-dist/chunks/{Video.native-97x0098j.js → Video.native-6142s9f7.js} +5 -5
- package/web-dist/chunks/{index-cnnsfz6n.js → index-n6p0wdvg.js} +1 -1
- package/web-dist/components/accordion/Accordion.js +2 -2
- package/web-dist/components/accordion-item/AccordionItem.js +2 -2
- package/web-dist/components/app-bar/AppBar.js +9 -9
- package/web-dist/components/app-header/AppHeader.js +9 -9
- package/web-dist/components/app-shell/AppShell.js +1 -1
- package/web-dist/components/audio/Audio.js +6 -6
- package/web-dist/components/auth-screen/AuthScreen.js +10 -10
- package/web-dist/components/avatar/Avatar.js +2 -2
- package/web-dist/components/avatar-group/AvatarGroup.js +2 -2
- package/web-dist/components/badge/Badge.js +2 -2
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +9 -9
- package/web-dist/components/bottom-sheet/BottomSheet.js +2 -2
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +2 -2
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +2 -2
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +2 -2
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +2 -2
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +2 -2
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +4 -4
- package/web-dist/components/button/Button.js +4 -4
- package/web-dist/components/button-group/ButtonGroup.js +4 -4
- package/web-dist/components/calendar/Calendar.js +5 -5
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +9 -9
- package/web-dist/components/card/Card.js +8 -8
- package/web-dist/components/chat-list-item/ChatListItem.js +6 -6
- package/web-dist/components/checkbox/Checkbox.js +4 -4
- package/web-dist/components/checkbox-group/CheckboxGroup.js +4 -4
- package/web-dist/components/chip/Chip.js +3 -3
- package/web-dist/components/chip-group/ChipGroup.js +3 -3
- package/web-dist/components/collection-editor/CollectionEditor.js +8 -8
- package/web-dist/components/color-hue-scale/ColorHueScale.js +15 -15
- package/web-dist/components/color-picker/ColorPicker.js +15 -15
- package/web-dist/components/color-tone/ColorTone.js +15 -15
- package/web-dist/components/color-wheel/ColorWheel.js +15 -15
- package/web-dist/components/content-rail/ContentRail.js +4 -4
- package/web-dist/components/data-table/DataTable.js +17 -17
- package/web-dist/components/date-picker/DatePicker.js +11 -11
- package/web-dist/components/dialog/Dialog.js +4 -4
- package/web-dist/components/divider/Divider.js +1 -1
- package/web-dist/components/empty-state/EmptyState.js +9 -9
- package/web-dist/components/explorer/Explorer.js +3 -3
- package/web-dist/components/field/Field.js +4 -4
- package/web-dist/components/file-explorer/FileExplorer.js +3 -3
- package/web-dist/components/flat-list/FlatList.js +5 -5
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +10 -10
- package/web-dist/components/form/Form.js +7 -7
- package/web-dist/components/form-actions/FormActions.js +7 -7
- package/web-dist/components/form-error/FormError.js +7 -7
- package/web-dist/components/game/Game.js +2 -2
- package/web-dist/components/game-entity/GameEntity.js +2 -2
- package/web-dist/components/game-field/GameField.js +2 -2
- package/web-dist/components/game-input-zone/GameInputZone.js +2 -2
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +2 -2
- package/web-dist/components/game-overlay/GameOverlay.js +2 -2
- package/web-dist/components/gradient/Gradient.js +2 -2
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +2 -2
- package/web-dist/components/grid/Grid.js +1 -1
- package/web-dist/components/hero/Hero.js +8 -8
- package/web-dist/components/icon-button/IconButton.js +4 -4
- package/web-dist/components/image/Image.js +2 -2
- package/web-dist/components/list/List.js +5 -5
- package/web-dist/components/list-item/ListItem.js +5 -5
- package/web-dist/components/list-section/ListSection.js +5 -5
- package/web-dist/components/master-detail/MasterDetail.js +1 -1
- package/web-dist/components/media-card/MediaCard.js +8 -8
- package/web-dist/components/media-explorer/MediaExplorer.js +3 -3
- package/web-dist/components/message-bubble/MessageBubble.js +6 -6
- package/web-dist/components/metric-card/MetricCard.js +8 -8
- package/web-dist/components/missing-element/MissingElement.js +3 -3
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +10 -10
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +10 -10
- package/web-dist/components/otp-form/OtpForm.js +10 -10
- package/web-dist/components/pagination/Pagination.js +4 -4
- package/web-dist/components/palette-item/PaletteItem.js +8 -8
- package/web-dist/components/popover/Popover.d.ts +5 -0
- package/web-dist/components/popover/Popover.dependency-0.d.ts +27 -0
- package/web-dist/components/popover/Popover.dependency-1.d.ts +3 -0
- package/web-dist/components/popover/Popover.js +29 -0
- package/web-dist/components/popover/Popover.types-0.d.ts +10 -0
- package/web-dist/components/popover/index.d.ts +2 -0
- package/web-dist/components/popover/index.js +2 -0
- package/web-dist/components/popover-menu/PopoverMenu.js +6 -6
- package/web-dist/components/post-card/PostCard.js +8 -8
- package/web-dist/components/product-card/ProductCard.js +8 -8
- package/web-dist/components/progress/Progress.js +2 -2
- package/web-dist/components/progress-ring/ProgressRing.js +2 -2
- package/web-dist/components/radio/Radio.js +4 -4
- package/web-dist/components/radio-group/RadioGroup.js +4 -4
- package/web-dist/components/rating/Rating.js +1 -1
- package/web-dist/components/reader/Reader.js +11 -11
- package/web-dist/components/rich-text/RichText.js +2 -2
- package/web-dist/components/scan-overlay/ScanOverlay.js +9 -9
- package/web-dist/components/screen/Screen.js +1 -1
- package/web-dist/components/screen-section/ScreenSection.js +2 -2
- package/web-dist/components/scroll-view/ScrollView.js +1 -1
- package/web-dist/components/search-input/SearchInput.js +6 -6
- package/web-dist/components/section-header/SectionHeader.js +2 -2
- package/web-dist/components/section-list/SectionList.js +5 -5
- package/web-dist/components/select/Select.js +9 -9
- package/web-dist/components/sign-in-form/SignInForm.js +10 -10
- package/web-dist/components/sign-up-form/SignUpForm.js +10 -10
- package/web-dist/components/skeleton/Skeleton.js +11 -11
- package/web-dist/components/skeleton-card/SkeletonCard.js +11 -11
- package/web-dist/components/skeleton-list/SkeletonList.js +11 -11
- package/web-dist/components/skeleton-text/SkeletonText.js +11 -11
- package/web-dist/components/switch/Switch.js +3 -3
- package/web-dist/components/tab/Tab.js +2 -2
- package/web-dist/components/tab-list/TabList.js +2 -2
- package/web-dist/components/tab-panel/TabPanel.js +2 -2
- package/web-dist/components/tabs/Tabs.js +2 -2
- package/web-dist/components/text-input/TextInput.js +6 -6
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +4 -4
- package/web-dist/components/time-picker/TimePicker.js +10 -10
- package/web-dist/components/timeline/Timeline.js +2 -2
- package/web-dist/components/toast/Toast.js +4 -4
- package/web-dist/components/toast-provider/ToastProvider.js +4 -4
- package/web-dist/components/toolbar/Toolbar.js +9 -9
- package/web-dist/components/tree-item/TreeItem.js +6 -6
- package/web-dist/components/uploader/Uploader.js +13 -13
- package/web-dist/components/video/Video.js +4 -4
- package/web-dist/components/view/View.js +1 -1
- package/web-dist/components/zora-web-style-sheet/ZoraWebStyleSheet.d.ts +5 -0
- package/web-dist/components/zora-web-style-sheet/ZoraWebStyleSheet.js +14 -0
- package/web-dist/components/zora-web-style-sheet/index.d.ts +1 -0
- package/web-dist/components/zora-web-style-sheet/index.js +2 -0
- package/web-dist/manifest.json +798 -734
- package/web-dist/runtime/ZoraProvider.js +89 -58
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
type ReactNativeWebStyleSheet = Readonly<{
|
|
5
|
+
id: string;
|
|
6
|
+
textContent: string;
|
|
7
|
+
}>;
|
|
8
|
+
|
|
9
|
+
/*** Hoists the React Native Web styles required by a server-rendered ZORA application. */
|
|
10
|
+
export function ZoraWebStyleSheet() {
|
|
11
|
+
const sheet = getReactNativeWebStyleSheet();
|
|
12
|
+
if (sheet === null) return null;
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<style id={sheet.id} precedence="react-native-web">
|
|
16
|
+
{sheet.textContent}
|
|
17
|
+
</style>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/*** Reads React Native Web's public stylesheet without changing native rendering. */
|
|
22
|
+
function getReactNativeWebStyleSheet(): ReactNativeWebStyleSheet | null {
|
|
23
|
+
if (Platform.OS !== 'web' || !('getSheet' in StyleSheet)) return null;
|
|
24
|
+
|
|
25
|
+
return (StyleSheet.getSheet as () => ReactNativeWebStyleSheet)();
|
|
26
|
+
}
|
|
@@ -23,7 +23,15 @@ const removedPublicNames = [
|
|
|
23
23
|
|
|
24
24
|
describe('canonical layout boundary', () => {
|
|
25
25
|
test('exports only the current layout primitives and semantic screen composition', () => {
|
|
26
|
-
for (const name of [
|
|
26
|
+
for (const name of [
|
|
27
|
+
'AppShell',
|
|
28
|
+
'Divider',
|
|
29
|
+
'Grid',
|
|
30
|
+
'Screen',
|
|
31
|
+
'ScrollView',
|
|
32
|
+
'View',
|
|
33
|
+
'ZoraWebStyleSheet',
|
|
34
|
+
]) {
|
|
27
35
|
expect(publicSource).toMatch(new RegExp(`\\b${name}\\b`, 'u'));
|
|
28
36
|
}
|
|
29
37
|
|
|
@@ -14,3 +14,4 @@ export { Screen } from './adapters/inbound/Screen';
|
|
|
14
14
|
export { ScrollView } from './adapters/inbound/ScrollView';
|
|
15
15
|
export { useScrollGestureLock } from './adapters/inbound/useScrollGestureLock';
|
|
16
16
|
export { View } from './adapters/inbound/View';
|
|
17
|
+
export { ZoraWebStyleSheet } from './adapters/inbound/ZoraWebStyleSheet';
|
|
@@ -43,6 +43,7 @@ await mock.module('@ankhorage/surface', () => ({
|
|
|
43
43
|
}));
|
|
44
44
|
|
|
45
45
|
await mock.module('react-native', () => ({
|
|
46
|
+
Platform: { OS: 'web' },
|
|
46
47
|
StyleSheet: { create: <T,>(styles: T) => styles },
|
|
47
48
|
Text: ({ children }: React.PropsWithChildren) => <span>{children}</span>,
|
|
48
49
|
View: ({ children }: React.PropsWithChildren) => <div>{children}</div>,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Popover as SurfacePopover } from '@ankhorage/surface';
|
|
2
|
+
|
|
3
|
+
import type { PopoverProps } from '../../../../types/popover';
|
|
4
|
+
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
5
|
+
|
|
6
|
+
/*** Presents arbitrary anchored content through the ZORA-owned popover boundary. */
|
|
7
|
+
export const Popover = withZoraThemeScope(PopoverInner);
|
|
8
|
+
|
|
9
|
+
/*** Delegates overlay placement and controllable state to the Surface foundation. */
|
|
10
|
+
function PopoverInner({
|
|
11
|
+
inverted: _inverted,
|
|
12
|
+
mode: _mode,
|
|
13
|
+
themeId: _themeId,
|
|
14
|
+
...props
|
|
15
|
+
}: PopoverProps) {
|
|
16
|
+
return <SurfacePopover {...props} />;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
test('Popover exposes the narrow ZORA-owned Surface overlay boundary', async () => {
|
|
4
|
+
const source = await Bun.file('src/features/popover/adapters/inbound/Popover.tsx').text();
|
|
5
|
+
|
|
6
|
+
expect(source).toContain('Popover as SurfacePopover');
|
|
7
|
+
expect(source).toContain('<SurfacePopover');
|
|
8
|
+
expect(source).toContain('withZoraThemeScope');
|
|
9
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemeProvider, useTheme as useSurfaceTheme } from '@ankhorage/surface';
|
|
1
|
+
import { ResponsiveProvider, ThemeProvider, useTheme as useSurfaceTheme } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import type { ZoraProviderProps } from '../../../../types/provider';
|
|
@@ -27,13 +27,15 @@ export function ZoraProvider({
|
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
29
|
<ZoraThemeRuntimeContext value={runtimeValue}>
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
<ResponsiveProvider>
|
|
31
|
+
<ThemeProvider initialConfig={resolvedConfig} initialMode={mode ?? initialMode}>
|
|
32
|
+
<ZoraProviderMode mode={mode}>
|
|
33
|
+
<ZoraRuntimeCapabilities bottomSheet={bottomSheet} toast={toast}>
|
|
34
|
+
{children}
|
|
35
|
+
</ZoraRuntimeCapabilities>
|
|
36
|
+
</ZoraProviderMode>
|
|
37
|
+
</ThemeProvider>
|
|
38
|
+
</ResponsiveProvider>
|
|
37
39
|
</ZoraThemeRuntimeContext>
|
|
38
40
|
);
|
|
39
41
|
}
|
|
@@ -169,10 +169,11 @@ const scopedPropTypeFiles = [
|
|
|
169
169
|
] as const;
|
|
170
170
|
|
|
171
171
|
describe('theme scope structure', () => {
|
|
172
|
-
it('
|
|
172
|
+
it('owns the ResponsiveProvider composition required by every ZORA application context', () => {
|
|
173
173
|
expect(zoraProviderSource).toMatch(/ThemeProvider/);
|
|
174
174
|
expect(zoraProviderSource).toMatch(/<ZoraThemeRuntimeContext\s+value=/u);
|
|
175
|
-
expect(zoraProviderSource).
|
|
175
|
+
expect(zoraProviderSource).toMatch(/ResponsiveProvider/);
|
|
176
|
+
expect(zoraProviderSource).toMatch(/<ResponsiveProvider>[\s\S]*?<ThemeProvider/u);
|
|
176
177
|
});
|
|
177
178
|
|
|
178
179
|
it('delegates nested Surface runtime ownership to the public ThemeScope boundary', () => {
|
package/src/index.ts
CHANGED
|
@@ -36,6 +36,7 @@ export type {
|
|
|
36
36
|
GradientRendererProviderProps,
|
|
37
37
|
} from './features/gradient/public';
|
|
38
38
|
export { GradientRendererProvider } from './features/gradient/public';
|
|
39
|
+
export { ZoraWebStyleSheet } from './features/layout/public';
|
|
39
40
|
export type {
|
|
40
41
|
MasterDetailActivePane,
|
|
41
42
|
MasterDetailDesktopMode,
|
|
@@ -43,6 +44,12 @@ export type {
|
|
|
43
44
|
MasterDetailProps,
|
|
44
45
|
} from './features/master-detail/public';
|
|
45
46
|
export { MasterDetail } from './features/master-detail/public';
|
|
47
|
+
export type {
|
|
48
|
+
PopoverAnchorRenderProps,
|
|
49
|
+
PopoverPlacement,
|
|
50
|
+
PopoverProps,
|
|
51
|
+
} from './features/popover/public';
|
|
52
|
+
export { Popover } from './features/popover/public';
|
|
46
53
|
export type {
|
|
47
54
|
ReaderColorScheme,
|
|
48
55
|
ReaderDocumentFormat,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PopoverAnchorRenderProps as SurfacePopoverAnchorRenderProps,
|
|
3
|
+
PopoverPlacement as SurfacePopoverPlacement,
|
|
4
|
+
PopoverProps as SurfacePopoverProps,
|
|
5
|
+
} from '@ankhorage/surface';
|
|
6
|
+
|
|
7
|
+
import type { ZoraBaseProps } from './base';
|
|
8
|
+
|
|
9
|
+
export type PopoverAnchorRenderProps = SurfacePopoverAnchorRenderProps;
|
|
10
|
+
export type PopoverPlacement = SurfacePopoverPlacement;
|
|
11
|
+
|
|
12
|
+
export interface PopoverProps extends SurfacePopoverProps, ZoraBaseProps {}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
Button3
|
|
4
|
-
} from "./Accordion-
|
|
4
|
+
} from "./Accordion-9tgvr155.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
7
|
} from "./Accordion-tk8zf9ff.js";
|
|
8
8
|
import {
|
|
9
9
|
View2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-4mg3epm9.js";
|
|
11
11
|
import {
|
|
12
12
|
Card2
|
|
13
|
-
} from "./Accordion-
|
|
13
|
+
} from "./Accordion-78astqx3.js";
|
|
14
14
|
|
|
15
15
|
// src/features/empty-state/adapters/inbound/EmptyState.tsx
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
Card2
|
|
4
|
-
} from "./Accordion-
|
|
4
|
+
} from "./Accordion-78astqx3.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
7
|
} from "./Accordion-tk8zf9ff.js";
|
|
8
8
|
import {
|
|
9
9
|
View2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-4mg3epm9.js";
|
|
11
11
|
import {
|
|
12
12
|
Text3
|
|
13
13
|
} from "./Accordion-8skz71ct.js";
|
|
14
14
|
import {
|
|
15
15
|
Badge2
|
|
16
|
-
} from "./Accordion-
|
|
16
|
+
} from "./Accordion-224snqz3.js";
|
|
17
17
|
import {
|
|
18
18
|
Button3
|
|
19
|
-
} from "./Accordion-
|
|
19
|
+
} from "./Accordion-9tgvr155.js";
|
|
20
20
|
import {
|
|
21
21
|
useZoraTheme2
|
|
22
22
|
} from "./Accordion-b1y5mjac.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
Pressable
|
|
4
|
-
} from "./Accordion-
|
|
4
|
+
} from "./Accordion-mnxf855g.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
7
|
} from "./Accordion-tk8zf9ff.js";
|
|
8
8
|
import {
|
|
9
9
|
View2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-4mg3epm9.js";
|
|
11
11
|
import {
|
|
12
12
|
Text3
|
|
13
13
|
} from "./Accordion-8skz71ct.js";
|
|
14
14
|
import {
|
|
15
15
|
Avatar2
|
|
16
|
-
} from "./Accordion-
|
|
16
|
+
} from "./Accordion-9m5asd8r.js";
|
|
17
17
|
import {
|
|
18
18
|
Badge2
|
|
19
|
-
} from "./Accordion-
|
|
19
|
+
} from "./Accordion-224snqz3.js";
|
|
20
20
|
import {
|
|
21
21
|
useZoraTheme2
|
|
22
22
|
} from "./Accordion-b1y5mjac.js";
|
|
@@ -10,16 +10,16 @@ import {
|
|
|
10
10
|
} from "./Accordion-9d38cgqj.js";
|
|
11
11
|
import {
|
|
12
12
|
Pressable
|
|
13
|
-
} from "./Accordion-
|
|
13
|
+
} from "./Accordion-mnxf855g.js";
|
|
14
14
|
import {
|
|
15
15
|
Text2
|
|
16
|
-
} from "./Accordion-
|
|
16
|
+
} from "./Accordion-9b4bsxwe.js";
|
|
17
17
|
import {
|
|
18
18
|
withZoraThemeScope
|
|
19
19
|
} from "./Accordion-tk8zf9ff.js";
|
|
20
20
|
import {
|
|
21
21
|
View2
|
|
22
|
-
} from "./Accordion-
|
|
22
|
+
} from "./Accordion-4mg3epm9.js";
|
|
23
23
|
import {
|
|
24
24
|
Text3
|
|
25
25
|
} from "./Accordion-8skz71ct.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
resolveSelectionControlNextChecked,
|
|
31
31
|
resolveSelectionControlInteractionState
|
|
32
|
-
} from "./Accordion-
|
|
32
|
+
} from "./Accordion-akwd4brm.js";
|
|
33
33
|
import {
|
|
34
34
|
useZoraThemeRecipe,
|
|
35
35
|
ZORA_COLORS
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
} from "./Accordion-9d38cgqj.js";
|
|
8
8
|
import {
|
|
9
9
|
Text2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-9b4bsxwe.js";
|
|
11
11
|
import {
|
|
12
12
|
withZoraThemeScope
|
|
13
13
|
} from "./Accordion-tk8zf9ff.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveControlSize,
|
|
16
16
|
resolveButtonColors
|
|
17
|
-
} from "./Accordion-
|
|
17
|
+
} from "./Accordion-akwd4brm.js";
|
|
18
18
|
|
|
19
19
|
// node_modules/@ankhorage/surface/src/features/badge/adapters/inbound/Badge.tsx
|
|
20
20
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
} from "./Accordion-9d38cgqj.js";
|
|
9
9
|
import {
|
|
10
10
|
IconButton2
|
|
11
|
-
} from "./Accordion-
|
|
11
|
+
} from "./Accordion-9tgvr155.js";
|
|
12
12
|
import {
|
|
13
13
|
withZoraThemeScope
|
|
14
14
|
} from "./Accordion-tk8zf9ff.js";
|
|
15
15
|
import {
|
|
16
16
|
View2
|
|
17
|
-
} from "./Accordion-
|
|
17
|
+
} from "./Accordion-4mg3epm9.js";
|
|
18
18
|
import {
|
|
19
19
|
PopoverMenu2
|
|
20
|
-
} from "./Accordion-
|
|
20
|
+
} from "./Accordion-7v6mrp8n.js";
|
|
21
21
|
import {
|
|
22
22
|
Heading2,
|
|
23
23
|
Text3
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
Pressable
|
|
4
|
-
} from "./Accordion-
|
|
4
|
+
} from "./Accordion-mnxf855g.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
7
|
} from "./Accordion-tk8zf9ff.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./Accordion-3zzzw7a8.js";
|
|
11
11
|
import {
|
|
12
12
|
View2
|
|
13
|
-
} from "./Accordion-
|
|
13
|
+
} from "./Accordion-4mg3epm9.js";
|
|
14
14
|
import {
|
|
15
15
|
Text3
|
|
16
16
|
} from "./Accordion-8skz71ct.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./Accordion-mnac2z83.js";
|
|
5
5
|
import {
|
|
6
6
|
Portal
|
|
7
|
-
} from "./Accordion-
|
|
7
|
+
} from "./Accordion-7nn4r909.js";
|
|
8
8
|
import {
|
|
9
9
|
require_cjs
|
|
10
10
|
} from "./Accordion-xgpzh4wq.js";
|
|
@@ -110,6 +110,7 @@ function PopoverOverlay({
|
|
|
110
110
|
});
|
|
111
111
|
return /* @__PURE__ */ jsx(Portal, {
|
|
112
112
|
layer: "popover",
|
|
113
|
+
onDismiss: passive ? undefined : onClose,
|
|
113
114
|
visible: ready,
|
|
114
115
|
children: /* @__PURE__ */ jsxs(import_react_native2.View, {
|
|
115
116
|
pointerEvents: "box-none",
|
|
@@ -146,7 +147,7 @@ var styles = import_react_native2.StyleSheet.create({
|
|
|
146
147
|
|
|
147
148
|
// node_modules/@ankhorage/surface/src/features/popover/adapters/inbound/Popover.tsx
|
|
148
149
|
import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
|
|
149
|
-
function
|
|
150
|
+
function Popover2(props) {
|
|
150
151
|
const anchorRef = React2.useRef(null);
|
|
151
152
|
const [resolvedOpen, setResolvedOpen] = useControllableState({
|
|
152
153
|
defaultValue: props.defaultOpen ?? false,
|
|
@@ -184,4 +185,4 @@ function Popover(props) {
|
|
|
184
185
|
});
|
|
185
186
|
}
|
|
186
187
|
|
|
187
|
-
export {
|
|
188
|
+
export { Popover2 };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
Card2
|
|
4
|
-
} from "./Accordion-
|
|
4
|
+
} from "./Accordion-78astqx3.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
7
|
} from "./Accordion-tk8zf9ff.js";
|
|
8
8
|
import {
|
|
9
9
|
View2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-4mg3epm9.js";
|
|
11
11
|
|
|
12
12
|
// src/features/toolbar/adapters/inbound/Toolbar.tsx
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./Accordion-0dj1r7w3.js";
|
|
5
5
|
import {
|
|
6
6
|
TextInput3
|
|
7
|
-
} from "./Accordion-
|
|
7
|
+
} from "./Accordion-2bygfpwg.js";
|
|
8
8
|
import {
|
|
9
9
|
IconButton2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-9tgvr155.js";
|
|
11
11
|
import {
|
|
12
12
|
withZoraThemeScope
|
|
13
13
|
} from "./Accordion-tk8zf9ff.js";
|
|
@@ -384,4 +384,22 @@ function ScreenInner({
|
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
386
|
var Screen2 = withZoraThemeScope(ScreenInner);
|
|
387
|
-
|
|
387
|
+
// src/features/layout/adapters/inbound/ZoraWebStyleSheet.tsx
|
|
388
|
+
var import_react_native3 = __toESM(require_cjs(), 1);
|
|
389
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
390
|
+
function ZoraWebStyleSheet2() {
|
|
391
|
+
const sheet = getReactNativeWebStyleSheet();
|
|
392
|
+
if (sheet === null)
|
|
393
|
+
return null;
|
|
394
|
+
return /* @__PURE__ */ jsx9("style", {
|
|
395
|
+
id: sheet.id,
|
|
396
|
+
precedence: "react-native-web",
|
|
397
|
+
children: sheet.textContent
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
function getReactNativeWebStyleSheet() {
|
|
401
|
+
if (import_react_native3.Platform.OS !== "web" || !("getSheet" in import_react_native3.StyleSheet))
|
|
402
|
+
return null;
|
|
403
|
+
return import_react_native3.StyleSheet.getSheet();
|
|
404
|
+
}
|
|
405
|
+
export { View2, AppShell2, Divider2, Grid2, ScrollView2, Screen2, ZoraWebStyleSheet2 };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
// node_modules/@ankhorage/surface/src/internal/resolvers/resolveOverlayZIndex.ts
|
|
3
|
+
var BASE_Z_INDEX = {
|
|
4
|
+
modal: 1000,
|
|
5
|
+
drawer: 1100,
|
|
6
|
+
menu: 1200,
|
|
7
|
+
popover: 1250,
|
|
8
|
+
tooltip: 1300,
|
|
9
|
+
toast: 1400
|
|
10
|
+
};
|
|
11
|
+
function resolveOverlayZIndex(layer, stackIndex = 0) {
|
|
12
|
+
return BASE_Z_INDEX[layer] + stackIndex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { resolveOverlayZIndex };
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
View2,
|
|
16
16
|
Divider2
|
|
17
|
-
} from "./Accordion-
|
|
17
|
+
} from "./Accordion-4mg3epm9.js";
|
|
18
18
|
import {
|
|
19
19
|
Pressable
|
|
20
|
-
} from "./Accordion-
|
|
20
|
+
} from "./Accordion-mnxf855g.js";
|
|
21
21
|
import {
|
|
22
22
|
Text2
|
|
23
|
-
} from "./Accordion-
|
|
23
|
+
} from "./Accordion-9b4bsxwe.js";
|
|
24
24
|
import {
|
|
25
25
|
SectionHeader2
|
|
26
|
-
} from "./Accordion-
|
|
26
|
+
} from "./Accordion-77514sk9.js";
|
|
27
27
|
import {
|
|
28
28
|
useZoraTheme2
|
|
29
29
|
} from "./Accordion-b1y5mjac.js";
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
} from "./Accordion-9d38cgqj.js";
|
|
11
11
|
import {
|
|
12
12
|
Pressable
|
|
13
|
-
} from "./Accordion-
|
|
13
|
+
} from "./Accordion-mnxf855g.js";
|
|
14
14
|
import {
|
|
15
15
|
withZoraThemeScope
|
|
16
16
|
} from "./Accordion-tk8zf9ff.js";
|
|
17
17
|
import {
|
|
18
18
|
View2,
|
|
19
19
|
Divider2
|
|
20
|
-
} from "./Accordion-
|
|
20
|
+
} from "./Accordion-4mg3epm9.js";
|
|
21
21
|
import {
|
|
22
22
|
Heading2,
|
|
23
23
|
Text3
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from "./Accordion-chdbfcm6.js";
|
|
29
29
|
import {
|
|
30
30
|
TextInput3
|
|
31
|
-
} from "./Accordion-
|
|
31
|
+
} from "./Accordion-2bygfpwg.js";
|
|
32
32
|
import {
|
|
33
33
|
Button2,
|
|
34
34
|
Circle,
|
|
@@ -42,19 +42,19 @@ import {
|
|
|
42
42
|
Stop,
|
|
43
43
|
Svg,
|
|
44
44
|
IconButton2
|
|
45
|
-
} from "./Accordion-
|
|
45
|
+
} from "./Accordion-9tgvr155.js";
|
|
46
46
|
import {
|
|
47
47
|
Card2
|
|
48
|
-
} from "./Accordion-
|
|
48
|
+
} from "./Accordion-78astqx3.js";
|
|
49
49
|
import {
|
|
50
50
|
Icon2
|
|
51
51
|
} from "./Accordion-3zzzw7a8.js";
|
|
52
52
|
import {
|
|
53
53
|
Select2
|
|
54
|
-
} from "./Accordion-
|
|
54
|
+
} from "./Accordion-sj1n06dw.js";
|
|
55
55
|
import {
|
|
56
56
|
Gradient2
|
|
57
|
-
} from "./Accordion-
|
|
57
|
+
} from "./Accordion-zd15byha.js";
|
|
58
58
|
import {
|
|
59
59
|
useZoraTheme2
|
|
60
60
|
} from "./Accordion-b1y5mjac.js";
|
|
@@ -959,7 +959,7 @@ function PickerRow({
|
|
|
959
959
|
compact: true,
|
|
960
960
|
interactionPolicy,
|
|
961
961
|
onValueChange: onToneChange,
|
|
962
|
-
options: tones
|
|
962
|
+
options: resolveToneOptions(tones),
|
|
963
963
|
placeholder: "Any tone",
|
|
964
964
|
value: tone
|
|
965
965
|
})
|
|
@@ -1080,6 +1080,25 @@ function resolvePalette(tone, primaryColor, harmony) {
|
|
|
1080
1080
|
const roleColors = harmony ? generateHarmonyRoleColors(primaryColor, harmony).colors.map((role) => role.hex) : [];
|
|
1081
1081
|
return Array.from(new Set([primaryColor, ...roleColors, ...candidates])).slice(0, 64);
|
|
1082
1082
|
}
|
|
1083
|
+
function resolveToneOptions(tones) {
|
|
1084
|
+
const accentCounts = new Map;
|
|
1085
|
+
for (const tone of tones) {
|
|
1086
|
+
const accent = tone.accent.trim().toLocaleLowerCase();
|
|
1087
|
+
accentCounts.set(accent, (accentCounts.get(accent) ?? 0) + 1);
|
|
1088
|
+
}
|
|
1089
|
+
return tones.map((tone) => ({
|
|
1090
|
+
label: (accentCounts.get(tone.accent.trim().toLocaleLowerCase()) ?? 0) > 1 ? `${tone.accent} · ${resolveToneQualifier(tone)}` : tone.accent,
|
|
1091
|
+
value: tone.id
|
|
1092
|
+
}));
|
|
1093
|
+
}
|
|
1094
|
+
function resolveToneQualifier(tone) {
|
|
1095
|
+
const normalizedAccent = tone.accent.trim().toLocaleLowerCase().replaceAll(" ", "-");
|
|
1096
|
+
const qualifier = tone.id.replace(new RegExp(`^${escapeRegExp(normalizedAccent)}-on-`, "i"), "").replaceAll("-", " ");
|
|
1097
|
+
return qualifier.replace(/\b\w/g, (character) => character.toLocaleUpperCase());
|
|
1098
|
+
}
|
|
1099
|
+
function escapeRegExp(value) {
|
|
1100
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1101
|
+
}
|
|
1083
1102
|
function resolveEnabledTabs(tabs) {
|
|
1084
1103
|
if (tabs.length === 0)
|
|
1085
1104
|
throw new Error("ColorPicker requires at least one tab.");
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
useOverlayStackActions,
|
|
4
|
+
useOverlayEntry
|
|
5
|
+
} from "./Accordion-7nn4r909.js";
|
|
2
6
|
import {
|
|
3
7
|
useFocusManager
|
|
4
8
|
} from "./Accordion-6zb9d92y.js";
|
|
@@ -15,6 +19,8 @@ import React from "react";
|
|
|
15
19
|
import { jsx } from "react/jsx-runtime";
|
|
16
20
|
function FocusScope({ active, children, onEscape, testID }) {
|
|
17
21
|
const containerRef = React.useRef(null);
|
|
22
|
+
const overlay = useOverlayEntry();
|
|
23
|
+
const overlayActions = useOverlayStackActions();
|
|
18
24
|
const { bindKeydown, capturePreviousFocus, cycleFocus, focusFirst, restorePreviousFocus } = useFocusManager();
|
|
19
25
|
React.useEffect(() => {
|
|
20
26
|
if (!active) {
|
|
@@ -30,7 +36,8 @@ function FocusScope({ active, children, onEscape, testID }) {
|
|
|
30
36
|
cycleFocus(containerRef.current, Boolean(event.shiftKey));
|
|
31
37
|
}
|
|
32
38
|
if (event.key === "Escape") {
|
|
33
|
-
|
|
39
|
+
if (overlay === null || overlayActions === null || overlayActions.isTopmost(overlay.id))
|
|
40
|
+
onEscape?.();
|
|
34
41
|
}
|
|
35
42
|
});
|
|
36
43
|
return () => {
|
|
@@ -45,17 +52,18 @@ function FocusScope({ active, children, onEscape, testID }) {
|
|
|
45
52
|
cycleFocus,
|
|
46
53
|
focusFirst,
|
|
47
54
|
onEscape,
|
|
55
|
+
overlay,
|
|
56
|
+
overlayActions,
|
|
48
57
|
restorePreviousFocus
|
|
49
58
|
]);
|
|
50
59
|
return /* @__PURE__ */ jsx(import_react_native.View, {
|
|
51
60
|
collapsable: false,
|
|
52
61
|
ref: containerRef,
|
|
53
62
|
testID,
|
|
54
|
-
style:
|
|
55
|
-
flex: 1
|
|
56
|
-
},
|
|
63
|
+
style: styles.fill,
|
|
57
64
|
children
|
|
58
65
|
});
|
|
59
66
|
}
|
|
67
|
+
var styles = { fill: { flex: 1 } };
|
|
60
68
|
|
|
61
69
|
export { FocusScope };
|