@ankhorage/zora 1.4.12 → 1.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 +14 -0
- package/README.md +7 -8
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/layout/auth-layout/meta.js +2 -2
- package/dist/layout/auth-layout/meta.js.map +1 -1
- package/dist/layout/screen/Screen.d.ts +4 -0
- package/dist/layout/screen/Screen.d.ts.map +1 -0
- package/dist/layout/screen/Screen.js +23 -0
- package/dist/layout/screen/Screen.js.map +1 -0
- package/dist/layout/screen/index.d.ts +3 -0
- package/dist/layout/screen/index.d.ts.map +1 -0
- package/dist/layout/screen/index.js +2 -0
- package/dist/layout/screen/index.js.map +1 -0
- package/dist/layout/screen/meta.d.ts +25 -0
- package/dist/layout/screen/meta.d.ts.map +1 -0
- package/dist/layout/screen/meta.js +26 -0
- package/dist/layout/screen/meta.js.map +1 -0
- package/dist/layout/{page → screen}/types.d.ts +2 -2
- package/dist/layout/screen/types.d.ts.map +1 -0
- package/dist/layout/screen/types.js.map +1 -0
- package/dist/layout/screen-section/ScreenSection.d.ts +4 -0
- package/dist/layout/screen-section/ScreenSection.d.ts.map +1 -0
- package/dist/layout/{page-section/PageSection.js → screen-section/ScreenSection.js} +3 -3
- package/dist/layout/screen-section/ScreenSection.js.map +1 -0
- package/dist/layout/screen-section/index.d.ts +3 -0
- package/dist/layout/screen-section/index.d.ts.map +1 -0
- package/dist/layout/screen-section/index.js +2 -0
- package/dist/layout/screen-section/index.js.map +1 -0
- package/dist/layout/{page-section → screen-section}/meta.d.ts +3 -3
- package/dist/layout/screen-section/meta.d.ts.map +1 -0
- package/dist/layout/{page-section → screen-section}/meta.js +5 -5
- package/dist/layout/screen-section/meta.js.map +1 -0
- package/dist/layout/{page-section → screen-section}/types.d.ts +1 -1
- package/dist/layout/screen-section/types.d.ts.map +1 -0
- package/dist/layout/screen-section/types.js.map +1 -0
- package/dist/layout/settings-layout/SettingsLayout.d.ts.map +1 -1
- package/dist/layout/settings-layout/SettingsLayout.js +8 -5
- package/dist/layout/settings-layout/SettingsLayout.js.map +1 -1
- package/dist/metadata/allowedChildren.d.ts +2 -2
- package/dist/metadata/allowedChildren.d.ts.map +1 -1
- package/dist/metadata/allowedChildren.js +2 -6
- package/dist/metadata/allowedChildren.js.map +1 -1
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +4 -6
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/patterns/zora-tab-bar/ZoraTabBar.d.ts.map +1 -1
- package/dist/patterns/zora-tab-bar/ZoraTabBar.js +64 -15
- package/dist/patterns/zora-tab-bar/ZoraTabBar.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +4 -6
- package/src/layout/auth-layout/meta.ts +2 -2
- package/src/layout/screen/Screen.tsx +42 -0
- package/src/layout/screen/index.ts +2 -0
- package/src/layout/{page → screen}/meta.ts +11 -5
- package/src/layout/{page → screen}/types.ts +2 -2
- package/src/layout/{page-section/PageSection.tsx → screen-section/ScreenSection.tsx} +4 -4
- package/src/layout/screen-section/index.ts +2 -0
- package/src/layout/{page-section → screen-section}/meta.ts +5 -5
- package/src/layout/{page-section → screen-section}/types.ts +1 -1
- package/src/layout/settings-layout/SettingsLayout.tsx +8 -10
- package/src/metadata/allowedChildren.ts +2 -6
- package/src/metadata/componentMeta.test.ts +2 -3
- package/src/metadata/componentMeta.ts +4 -6
- package/src/patterns/zora-tab-bar/ZoraTabBar.tsx +104 -15
- package/src/showcaseCoverage.test.ts +2 -3
- package/src/theme/themeScopeStructure.test.ts +4 -6
- package/dist/layout/page/Page.d.ts +0 -4
- package/dist/layout/page/Page.d.ts.map +0 -1
- package/dist/layout/page/Page.js +0 -15
- package/dist/layout/page/Page.js.map +0 -1
- package/dist/layout/page/index.d.ts +0 -3
- package/dist/layout/page/index.d.ts.map +0 -1
- package/dist/layout/page/index.js +0 -2
- package/dist/layout/page/index.js.map +0 -1
- package/dist/layout/page/meta.d.ts +0 -19
- package/dist/layout/page/meta.d.ts.map +0 -1
- package/dist/layout/page/meta.js +0 -20
- package/dist/layout/page/meta.js.map +0 -1
- package/dist/layout/page/types.d.ts.map +0 -1
- package/dist/layout/page/types.js +0 -2
- package/dist/layout/page/types.js.map +0 -1
- package/dist/layout/page-header/PageHeader.d.ts +0 -4
- package/dist/layout/page-header/PageHeader.d.ts.map +0 -1
- package/dist/layout/page-header/PageHeader.js +0 -24
- package/dist/layout/page-header/PageHeader.js.map +0 -1
- package/dist/layout/page-header/index.d.ts +0 -3
- package/dist/layout/page-header/index.d.ts.map +0 -1
- package/dist/layout/page-header/index.js +0 -2
- package/dist/layout/page-header/index.js.map +0 -1
- package/dist/layout/page-header/meta.d.ts +0 -38
- package/dist/layout/page-header/meta.d.ts.map +0 -1
- package/dist/layout/page-header/meta.js +0 -38
- package/dist/layout/page-header/meta.js.map +0 -1
- package/dist/layout/page-header/types.d.ts +0 -10
- package/dist/layout/page-header/types.d.ts.map +0 -1
- package/dist/layout/page-header/types.js.map +0 -1
- package/dist/layout/page-section/PageSection.d.ts +0 -4
- package/dist/layout/page-section/PageSection.d.ts.map +0 -1
- package/dist/layout/page-section/PageSection.js.map +0 -1
- package/dist/layout/page-section/index.d.ts +0 -3
- package/dist/layout/page-section/index.d.ts.map +0 -1
- package/dist/layout/page-section/index.js +0 -2
- package/dist/layout/page-section/index.js.map +0 -1
- package/dist/layout/page-section/meta.d.ts.map +0 -1
- package/dist/layout/page-section/meta.js.map +0 -1
- package/dist/layout/page-section/types.d.ts.map +0 -1
- package/dist/layout/page-section/types.js.map +0 -1
- package/src/layout/page/Page.tsx +0 -28
- package/src/layout/page/index.ts +0 -2
- package/src/layout/page-header/PageHeader.tsx +0 -48
- package/src/layout/page-header/index.ts +0 -2
- package/src/layout/page-header/meta.ts +0 -39
- package/src/layout/page-header/types.ts +0 -11
- package/src/layout/page-section/index.ts +0 -2
- /package/dist/layout/{page-section → screen}/types.js +0 -0
- /package/dist/layout/{page-header → screen-section}/types.js +0 -0
|
@@ -1,25 +1,48 @@
|
|
|
1
|
-
import { TabBar as SurfaceTabBar } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { Pressable, Text as ReactNativeText } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { Icon } from '../../components/icon';
|
|
5
|
+
import { Box, Surface } from '../../foundation';
|
|
5
6
|
import {
|
|
6
7
|
createTabBarItemPressHandler,
|
|
7
8
|
resolveNavigationItems,
|
|
8
9
|
} from '../../internal/resolveZoraNavigationItems';
|
|
10
|
+
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
9
11
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
10
12
|
import type { ZoraTabBarProps } from './types';
|
|
11
13
|
|
|
14
|
+
function resolveAccessibilityLabel(
|
|
15
|
+
label: React.ReactNode,
|
|
16
|
+
explicitLabel?: string,
|
|
17
|
+
): string | undefined {
|
|
18
|
+
if (explicitLabel !== undefined) {
|
|
19
|
+
return explicitLabel;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (typeof label === 'string') {
|
|
23
|
+
return label;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (typeof label === 'number') {
|
|
27
|
+
return String(label);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
12
33
|
function ZoraTabBarInner({
|
|
13
34
|
themeId: _themeId,
|
|
14
35
|
mode: _mode,
|
|
15
36
|
state,
|
|
16
37
|
navigation,
|
|
17
38
|
descriptors,
|
|
39
|
+
insets,
|
|
18
40
|
routeMap,
|
|
19
41
|
compact = false,
|
|
20
42
|
chrome = 'raised',
|
|
21
43
|
testID,
|
|
22
44
|
}: ZoraTabBarProps) {
|
|
45
|
+
const { theme } = useZoraTheme();
|
|
23
46
|
const resolved = resolveNavigationItems({
|
|
24
47
|
state,
|
|
25
48
|
descriptors,
|
|
@@ -27,19 +50,85 @@ function ZoraTabBarInner({
|
|
|
27
50
|
kind: 'tab',
|
|
28
51
|
});
|
|
29
52
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
const bottomInset = insets?.bottom ?? 0;
|
|
54
|
+
const minHeight = compact ? 56 : 64;
|
|
55
|
+
const labelSize = compact ? theme.typography.sizes.xs : theme.typography.sizes.s;
|
|
56
|
+
const labelWeight = theme.typography.weights.medium;
|
|
57
|
+
const content = (
|
|
58
|
+
<Box
|
|
59
|
+
bg="surface"
|
|
60
|
+
style={{
|
|
61
|
+
borderTopColor: theme.semantics.border.default,
|
|
62
|
+
borderTopWidth: 1,
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
minHeight: minHeight + bottomInset,
|
|
65
|
+
paddingBottom: bottomInset,
|
|
66
|
+
}}
|
|
67
|
+
testID={testID}
|
|
68
|
+
>
|
|
69
|
+
{resolved.map((item) => {
|
|
70
|
+
const { active } = item;
|
|
71
|
+
const { disabled } = item;
|
|
72
|
+
const contentColor = disabled
|
|
73
|
+
? theme.semantics.content.subtle
|
|
74
|
+
: active
|
|
75
|
+
? theme.semantics.action.primary.base
|
|
76
|
+
: theme.semantics.content.muted;
|
|
77
|
+
const backgroundColor = active
|
|
78
|
+
? theme.semantics.action.primary.softBg
|
|
79
|
+
: theme.semantics.surface.default;
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<Pressable
|
|
83
|
+
accessibilityLabel={resolveAccessibilityLabel(
|
|
84
|
+
item.label,
|
|
85
|
+
item.metadata?.accessibilityLabel,
|
|
86
|
+
)}
|
|
87
|
+
accessibilityRole="tab"
|
|
88
|
+
accessibilityState={{ selected: active, disabled }}
|
|
89
|
+
disabled={disabled}
|
|
90
|
+
key={item.route.key}
|
|
91
|
+
onPress={createTabBarItemPressHandler({ item, navigation })}
|
|
92
|
+
style={{
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
backgroundColor,
|
|
95
|
+
flex: 1,
|
|
96
|
+
justifyContent: 'center',
|
|
97
|
+
minHeight,
|
|
98
|
+
opacity: disabled ? 0.48 : 1,
|
|
99
|
+
paddingHorizontal: theme.spacing.s,
|
|
100
|
+
paddingVertical: compact ? theme.spacing.xs : theme.spacing.s,
|
|
101
|
+
}}
|
|
102
|
+
testID={
|
|
103
|
+
item.metadata?.testID ?? (testID ? `${testID}-item-${item.route.key}` : undefined)
|
|
104
|
+
}
|
|
105
|
+
>
|
|
106
|
+
{item.metadata?.icon ? (
|
|
107
|
+
<Icon
|
|
108
|
+
color={contentColor}
|
|
109
|
+
name={item.metadata.icon.name}
|
|
110
|
+
provider={item.metadata.icon.provider}
|
|
111
|
+
size={compact ? theme.spacing.m : theme.spacing.l}
|
|
112
|
+
/>
|
|
113
|
+
) : null}
|
|
114
|
+
<ReactNativeText
|
|
115
|
+
numberOfLines={1}
|
|
116
|
+
style={{
|
|
117
|
+
color: contentColor,
|
|
118
|
+
fontSize: labelSize,
|
|
119
|
+
fontWeight: labelWeight,
|
|
120
|
+
lineHeight: compact ? 16 : 20,
|
|
121
|
+
marginTop: item.metadata?.icon ? theme.spacing.xs : 0,
|
|
122
|
+
textAlign: 'center',
|
|
123
|
+
}}
|
|
124
|
+
>
|
|
125
|
+
{item.label}
|
|
126
|
+
</ReactNativeText>
|
|
127
|
+
</Pressable>
|
|
128
|
+
);
|
|
129
|
+
})}
|
|
130
|
+
</Box>
|
|
131
|
+
);
|
|
43
132
|
|
|
44
133
|
if (chrome === 'none') {
|
|
45
134
|
return content;
|
|
@@ -84,9 +84,8 @@ const scopedComponentFiles = [
|
|
|
84
84
|
|
|
85
85
|
join(srcDir, 'layout', 'app-shell', 'AppShell.tsx'),
|
|
86
86
|
join(srcDir, 'layout', 'auth-layout', 'AuthLayout.tsx'),
|
|
87
|
-
join(srcDir, 'layout', '
|
|
88
|
-
join(srcDir, 'layout', '
|
|
89
|
-
join(srcDir, 'layout', 'page-section', 'PageSection.tsx'),
|
|
87
|
+
join(srcDir, 'layout', 'screen', 'Screen.tsx'),
|
|
88
|
+
join(srcDir, 'layout', 'screen-section', 'ScreenSection.tsx'),
|
|
90
89
|
join(srcDir, 'layout', 'settings-layout', 'SettingsLayout.tsx'),
|
|
91
90
|
join(srcDir, 'layout', 'sidebar-layout', 'SidebarLayout.tsx'),
|
|
92
91
|
join(srcDir, 'layout', 'topbar-layout', 'TopbarLayout.tsx'),
|
|
@@ -154,9 +153,8 @@ const scopedPropTypeFiles = [
|
|
|
154
153
|
|
|
155
154
|
join(srcDir, 'layout', 'app-shell', 'types.ts'),
|
|
156
155
|
join(srcDir, 'layout', 'auth-layout', 'types.ts'),
|
|
157
|
-
join(srcDir, 'layout', '
|
|
158
|
-
join(srcDir, 'layout', '
|
|
159
|
-
join(srcDir, 'layout', 'page-section', 'types.ts'),
|
|
156
|
+
join(srcDir, 'layout', 'screen', 'types.ts'),
|
|
157
|
+
join(srcDir, 'layout', 'screen-section', 'types.ts'),
|
|
160
158
|
join(srcDir, 'layout', 'settings-layout', 'types.ts'),
|
|
161
159
|
join(srcDir, 'layout', 'sidebar-layout', 'types.ts'),
|
|
162
160
|
join(srcDir, 'layout', 'topbar-layout', 'types.ts'),
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/layout/page/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAsBzC,eAAO,MAAM,IAAI,iDAAgC,CAAC"}
|
package/dist/layout/page/Page.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Container, Stack } from '../../foundation';
|
|
3
|
-
import { resolvePageMaxWidth } from '../../internal/recipes';
|
|
4
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
|
-
function PageInner({ themeId: _themeId, mode: _mode, children, header, footer, width = 'default', testID, }) {
|
|
6
|
-
return (<Container maxWidth={resolvePageMaxWidth(width)} py="xl" testID={testID}>
|
|
7
|
-
<Stack gap="l">
|
|
8
|
-
{header}
|
|
9
|
-
{children}
|
|
10
|
-
{footer}
|
|
11
|
-
</Stack>
|
|
12
|
-
</Container>);
|
|
13
|
-
}
|
|
14
|
-
export const Page = withZoraThemeScope(PageInner);
|
|
15
|
-
//# sourceMappingURL=Page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/layout/page/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,SAAS,CAAC,EACjB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,GAAG,SAAS,EACjB,MAAM,GACI;IACV,OAAO,CACL,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CACtE;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CACZ;QAAA,CAAC,MAAM,CACP;QAAA,CAAC,QAAQ,CACT;QAAA,CAAC,MAAM,CACT;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Container, Stack } from '../../foundation';\nimport { resolvePageMaxWidth } from '../../internal/recipes';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { PageProps } from './types';\n\nfunction PageInner({\n themeId: _themeId,\n mode: _mode,\n children,\n header,\n footer,\n width = 'default',\n testID,\n}: PageProps) {\n return (\n <Container maxWidth={resolvePageMaxWidth(width)} py=\"xl\" testID={testID}>\n <Stack gap=\"l\">\n {header}\n {children}\n {footer}\n </Stack>\n </Container>\n );\n}\n\nexport const Page = withZoraThemeScope(PageInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layout/page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/layout/page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export { Page } from './Page';\nexport type { PageProps } from './types';\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare const pageMeta: {
|
|
2
|
-
readonly name: "Page";
|
|
3
|
-
readonly category: "layout";
|
|
4
|
-
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["PageHeader", "PageSection", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble"];
|
|
6
|
-
readonly blueprint: {
|
|
7
|
-
readonly label: "Page";
|
|
8
|
-
};
|
|
9
|
-
readonly props: {
|
|
10
|
-
readonly width: {
|
|
11
|
-
readonly type: "enum";
|
|
12
|
-
readonly category: "Layout";
|
|
13
|
-
readonly label: "Width";
|
|
14
|
-
readonly enum: readonly ["narrow", "default", "wide"];
|
|
15
|
-
readonly default: "default";
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/layout/page/meta.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;CAiBiB,CAAC"}
|
package/dist/layout/page/meta.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PAGE_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';
|
|
2
|
-
export const pageMeta = {
|
|
3
|
-
name: 'Page',
|
|
4
|
-
category: 'layout',
|
|
5
|
-
directManifestNode: true,
|
|
6
|
-
allowedChildren: [...PAGE_ALLOWED_CHILDREN],
|
|
7
|
-
blueprint: {
|
|
8
|
-
label: 'Page',
|
|
9
|
-
},
|
|
10
|
-
props: {
|
|
11
|
-
width: {
|
|
12
|
-
type: 'enum',
|
|
13
|
-
category: 'Layout',
|
|
14
|
-
label: 'Width',
|
|
15
|
-
enum: ['narrow', 'default', 'wide'],
|
|
16
|
-
default: 'default',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/layout/page/meta.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,QAAQ;IAClB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,GAAG,qBAAqB,CAAC;IAC3C,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;KACd;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;YACnC,OAAO,EAAE,SAAS;SACnB;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\nimport { PAGE_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';\n\nexport const pageMeta = {\n name: 'Page',\n category: 'layout',\n directManifestNode: true,\n allowedChildren: [...PAGE_ALLOWED_CHILDREN],\n blueprint: {\n label: 'Page',\n },\n props: {\n width: {\n type: 'enum',\n category: 'Layout',\n label: 'Width',\n enum: ['narrow', 'default', 'wide'],\n default: 'default',\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/layout/page/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/layout/page/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraContentWidth } from '../../internal/recipes';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface PageProps extends ZoraBaseProps {\n children?: React.ReactNode;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n width?: ZoraContentWidth;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../src/layout/page-header/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAyC/C,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Heading } from '../../components/heading';
|
|
3
|
-
import { Text } from '../../components/text';
|
|
4
|
-
import { Box, Stack } from '../../foundation';
|
|
5
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
|
-
function PageHeaderInner({ themeId: _themeId, mode: _mode, title, description, eyebrow, actions, meta, testID, }) {
|
|
7
|
-
return (<Stack align={{ base: 'flex-start', md: 'center' }} direction={{ base: 'column', md: 'row' }} gap="l" justify="space-between" testID={testID}>
|
|
8
|
-
<Box flex={{ md: 1 }} width={{ base: '100%', md: 'auto' }}>
|
|
9
|
-
<Stack gap="s">
|
|
10
|
-
{eyebrow ? (<Text tone="muted" variant="caption" weight="semiBold">
|
|
11
|
-
{eyebrow}
|
|
12
|
-
</Text>) : null}
|
|
13
|
-
<Heading level={1}>{title}</Heading>
|
|
14
|
-
{description ? (<Text tone="muted" variant="body">
|
|
15
|
-
{description}
|
|
16
|
-
</Text>) : null}
|
|
17
|
-
{meta ? <Box pt="xs">{meta}</Box> : null}
|
|
18
|
-
</Stack>
|
|
19
|
-
</Box>
|
|
20
|
-
{actions ? <Box>{actions}</Box> : null}
|
|
21
|
-
</Stack>);
|
|
22
|
-
}
|
|
23
|
-
export const PageHeader = withZoraThemeScope(PageHeaderInner);
|
|
24
|
-
//# sourceMappingURL=PageHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../../src/layout/page-header/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,eAAe,CAAC,EACvB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,OAAO,EACP,OAAO,EACP,IAAI,EACJ,MAAM,GACU;IAChB,OAAO,CACL,CAAC,KAAK,CACJ,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAC5C,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CACzC,GAAG,CAAC,GAAG,CACP,OAAO,CAAC,eAAe,CACvB,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CACxD;QAAA,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CACZ;UAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CACT,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CACpD;cAAA,CAAC,OAAO,CACV;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;UAAA,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,CACnC;UAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAC/B;cAAA,CAAC,WAAW,CACd;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;UAAA,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAC1C;QAAA,EAAE,KAAK,CACT;MAAA,EAAE,GAAG,CACL;MAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CACxC;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Heading } from '../../components/heading';\nimport { Text } from '../../components/text';\nimport { Box, Stack } from '../../foundation';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { PageHeaderProps } from './types';\n\nfunction PageHeaderInner({\n themeId: _themeId,\n mode: _mode,\n title,\n description,\n eyebrow,\n actions,\n meta,\n testID,\n}: PageHeaderProps) {\n return (\n <Stack\n align={{ base: 'flex-start', md: 'center' }}\n direction={{ base: 'column', md: 'row' }}\n gap=\"l\"\n justify=\"space-between\"\n testID={testID}\n >\n <Box flex={{ md: 1 }} width={{ base: '100%', md: 'auto' }}>\n <Stack gap=\"s\">\n {eyebrow ? (\n <Text tone=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {eyebrow}\n </Text>\n ) : null}\n <Heading level={1}>{title}</Heading>\n {description ? (\n <Text tone=\"muted\" variant=\"body\">\n {description}\n </Text>\n ) : null}\n {meta ? <Box pt=\"xs\">{meta}</Box> : null}\n </Stack>\n </Box>\n {actions ? <Box>{actions}</Box> : null}\n </Stack>\n );\n}\n\nexport const PageHeader = withZoraThemeScope(PageHeaderInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layout/page-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/layout/page-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { PageHeader } from './PageHeader';\nexport type { PageHeaderProps } from './types';\n"]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export declare const pageHeaderMeta: {
|
|
2
|
-
readonly name: "PageHeader";
|
|
3
|
-
readonly category: "layout";
|
|
4
|
-
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly blueprint: {
|
|
7
|
-
readonly label: "Page header";
|
|
8
|
-
readonly defaultProps: {
|
|
9
|
-
readonly title: "Page title";
|
|
10
|
-
readonly description: "Short description.";
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
readonly props: {
|
|
14
|
-
readonly title: {
|
|
15
|
-
readonly type: "string";
|
|
16
|
-
readonly category: "Content";
|
|
17
|
-
readonly label: "Title";
|
|
18
|
-
readonly default: "Page title";
|
|
19
|
-
};
|
|
20
|
-
readonly description: {
|
|
21
|
-
readonly type: "string";
|
|
22
|
-
readonly category: "Content";
|
|
23
|
-
readonly label: "Description";
|
|
24
|
-
readonly default: "Short description.";
|
|
25
|
-
};
|
|
26
|
-
readonly eyebrow: {
|
|
27
|
-
readonly type: "string";
|
|
28
|
-
readonly category: "Content";
|
|
29
|
-
readonly label: "Eyebrow";
|
|
30
|
-
};
|
|
31
|
-
readonly meta: {
|
|
32
|
-
readonly type: "string";
|
|
33
|
-
readonly category: "Content";
|
|
34
|
-
readonly label: "Meta";
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/layout/page-header/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCW,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export const pageHeaderMeta = {
|
|
2
|
-
name: 'PageHeader',
|
|
3
|
-
category: 'layout',
|
|
4
|
-
directManifestNode: true,
|
|
5
|
-
allowedChildren: [],
|
|
6
|
-
blueprint: {
|
|
7
|
-
label: 'Page header',
|
|
8
|
-
defaultProps: {
|
|
9
|
-
title: 'Page title',
|
|
10
|
-
description: 'Short description.',
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
props: {
|
|
14
|
-
title: {
|
|
15
|
-
type: 'string',
|
|
16
|
-
category: 'Content',
|
|
17
|
-
label: 'Title',
|
|
18
|
-
default: 'Page title',
|
|
19
|
-
},
|
|
20
|
-
description: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
category: 'Content',
|
|
23
|
-
label: 'Description',
|
|
24
|
-
default: 'Short description.',
|
|
25
|
-
},
|
|
26
|
-
eyebrow: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
category: 'Content',
|
|
29
|
-
label: 'Eyebrow',
|
|
30
|
-
},
|
|
31
|
-
meta: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
category: 'Content',
|
|
34
|
-
label: 'Meta',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/layout/page-header/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,QAAQ;IAClB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,aAAa;QACpB,YAAY,EAAE;YACZ,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,oBAAoB;SAClC;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,YAAY;SACtB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,oBAAoB;SAC9B;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,SAAS;SACjB;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,MAAM;SACd;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const pageHeaderMeta = {\n name: 'PageHeader',\n category: 'layout',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Page header',\n defaultProps: {\n title: 'Page title',\n description: 'Short description.',\n },\n },\n props: {\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n default: 'Page title',\n },\n description: {\n type: 'string',\n category: 'Content',\n label: 'Description',\n default: 'Short description.',\n },\n eyebrow: {\n type: 'string',\n category: 'Content',\n label: 'Eyebrow',\n },\n meta: {\n type: 'string',\n category: 'Content',\n label: 'Meta',\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
3
|
-
export interface PageHeaderProps extends ZoraBaseProps {
|
|
4
|
-
title: React.ReactNode;
|
|
5
|
-
description?: React.ReactNode;
|
|
6
|
-
eyebrow?: React.ReactNode;
|
|
7
|
-
actions?: React.ReactNode;
|
|
8
|
-
meta?: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/layout/page-header/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/layout/page-header/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface PageHeaderProps extends ZoraBaseProps {\n title: React.ReactNode;\n description?: React.ReactNode;\n eyebrow?: React.ReactNode;\n actions?: React.ReactNode;\n meta?: React.ReactNode;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageSection.d.ts","sourceRoot":"","sources":["../../../src/layout/page-section/PageSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAmBhD,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageSection.js","sourceRoot":"","sources":["../../../src/layout/page-section/PageSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,gBAAgB,CAAC,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,OAAO,EACP,QAAQ,EACR,MAAM,GACW;IACjB,OAAO,CACL,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC5B;MAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAG,CAAC,CAAC,CAAC,IAAI,CAC3F;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Stack } from '../../foundation';\nimport { SectionHeader } from '../../patterns/section-header';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { PageSectionProps } from './types';\n\nfunction PageSectionInner({\n themeId: _themeId,\n mode: _mode,\n title,\n description,\n actions,\n children,\n testID,\n}: PageSectionProps) {\n return (\n <Stack gap=\"m\" testID={testID}>\n {title ? <SectionHeader actions={actions} description={description} title={title} /> : null}\n {children}\n </Stack>\n );\n}\n\nexport const PageSection = withZoraThemeScope(PageSectionInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layout/page-section/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/layout/page-section/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { PageSection } from './PageSection';\nexport type { PageSectionProps } from './types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/layout/page-section/meta.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/layout/page-section/meta.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,QAAQ;IAClB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,GAAG,6BAA6B,CAAC;IACnD,SAAS,EAAE;QACT,KAAK,EAAE,cAAc;QACrB,YAAY,EAAE;YACZ,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,sBAAsB;SACpC;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,SAAS;SACnB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,sBAAsB;SAChC;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\nimport { PAGE_SECTION_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';\n\nexport const pageSectionMeta = {\n name: 'PageSection',\n category: 'layout',\n directManifestNode: true,\n allowedChildren: [...PAGE_SECTION_ALLOWED_CHILDREN],\n blueprint: {\n label: 'Page section',\n defaultProps: {\n title: 'Section',\n description: 'Section description.',\n },\n },\n props: {\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n default: 'Section',\n },\n description: {\n type: 'string',\n category: 'Content',\n label: 'Description',\n default: 'Section description.',\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/layout/page-section/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/layout/page-section/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface PageSectionProps extends ZoraBaseProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n actions?: React.ReactNode;\n children?: React.ReactNode;\n}\n"]}
|
package/src/layout/page/Page.tsx
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Container, Stack } from '../../foundation';
|
|
4
|
-
import { resolvePageMaxWidth } from '../../internal/recipes';
|
|
5
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
|
-
import type { PageProps } from './types';
|
|
7
|
-
|
|
8
|
-
function PageInner({
|
|
9
|
-
themeId: _themeId,
|
|
10
|
-
mode: _mode,
|
|
11
|
-
children,
|
|
12
|
-
header,
|
|
13
|
-
footer,
|
|
14
|
-
width = 'default',
|
|
15
|
-
testID,
|
|
16
|
-
}: PageProps) {
|
|
17
|
-
return (
|
|
18
|
-
<Container maxWidth={resolvePageMaxWidth(width)} py="xl" testID={testID}>
|
|
19
|
-
<Stack gap="l">
|
|
20
|
-
{header}
|
|
21
|
-
{children}
|
|
22
|
-
{footer}
|
|
23
|
-
</Stack>
|
|
24
|
-
</Container>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const Page = withZoraThemeScope(PageInner);
|
package/src/layout/page/index.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Heading } from '../../components/heading';
|
|
4
|
-
import { Text } from '../../components/text';
|
|
5
|
-
import { Box, Stack } from '../../foundation';
|
|
6
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
|
-
import type { PageHeaderProps } from './types';
|
|
8
|
-
|
|
9
|
-
function PageHeaderInner({
|
|
10
|
-
themeId: _themeId,
|
|
11
|
-
mode: _mode,
|
|
12
|
-
title,
|
|
13
|
-
description,
|
|
14
|
-
eyebrow,
|
|
15
|
-
actions,
|
|
16
|
-
meta,
|
|
17
|
-
testID,
|
|
18
|
-
}: PageHeaderProps) {
|
|
19
|
-
return (
|
|
20
|
-
<Stack
|
|
21
|
-
align={{ base: 'flex-start', md: 'center' }}
|
|
22
|
-
direction={{ base: 'column', md: 'row' }}
|
|
23
|
-
gap="l"
|
|
24
|
-
justify="space-between"
|
|
25
|
-
testID={testID}
|
|
26
|
-
>
|
|
27
|
-
<Box flex={{ md: 1 }} width={{ base: '100%', md: 'auto' }}>
|
|
28
|
-
<Stack gap="s">
|
|
29
|
-
{eyebrow ? (
|
|
30
|
-
<Text tone="muted" variant="caption" weight="semiBold">
|
|
31
|
-
{eyebrow}
|
|
32
|
-
</Text>
|
|
33
|
-
) : null}
|
|
34
|
-
<Heading level={1}>{title}</Heading>
|
|
35
|
-
{description ? (
|
|
36
|
-
<Text tone="muted" variant="body">
|
|
37
|
-
{description}
|
|
38
|
-
</Text>
|
|
39
|
-
) : null}
|
|
40
|
-
{meta ? <Box pt="xs">{meta}</Box> : null}
|
|
41
|
-
</Stack>
|
|
42
|
-
</Box>
|
|
43
|
-
{actions ? <Box>{actions}</Box> : null}
|
|
44
|
-
</Stack>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const PageHeader = withZoraThemeScope(PageHeaderInner);
|