@ankhorage/zora 1.5.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +125 -123
- package/dist/components/app-bar/AppBar.js +4 -4
- package/dist/components/app-bar/AppBar.js.map +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.js +19 -9
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/avatar/types.d.ts +2 -2
- package/dist/components/avatar/types.d.ts.map +1 -1
- package/dist/components/avatar/types.js.map +1 -1
- package/dist/components/avatar-group/AvatarGroup.js +2 -2
- package/dist/components/avatar-group/AvatarGroup.js.map +1 -1
- package/dist/components/avatar-group/types.d.ts +2 -2
- package/dist/components/avatar-group/types.d.ts.map +1 -1
- package/dist/components/avatar-group/types.js.map +1 -1
- package/dist/components/badge/Badge.js +3 -3
- package/dist/components/badge/Badge.js.map +1 -1
- package/dist/components/badge/types.d.ts +4 -4
- package/dist/components/badge/types.d.ts.map +1 -1
- package/dist/components/badge/types.js.map +1 -1
- package/dist/components/button/Button.js +3 -3
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/meta.d.ts +7 -7
- package/dist/components/button/meta.d.ts.map +1 -1
- package/dist/components/button/meta.js +8 -7
- package/dist/components/button/meta.js.map +1 -1
- package/dist/components/button/types.d.ts +4 -4
- package/dist/components/button/types.d.ts.map +1 -1
- package/dist/components/button/types.js.map +1 -1
- package/dist/components/card/Card.js +2 -2
- package/dist/components/card/Card.js.map +1 -1
- package/dist/components/checkbox/CheckboxGroup.js +5 -5
- package/dist/components/checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/checkbox/types.d.ts +1 -1
- package/dist/components/checkbox/types.d.ts.map +1 -1
- package/dist/components/checkbox/types.js.map +1 -1
- package/dist/components/chip/Chip.d.ts.map +1 -1
- package/dist/components/chip/Chip.js +9 -10
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/chip/resolveChipColors.d.ts +3 -3
- package/dist/components/chip/resolveChipColors.d.ts.map +1 -1
- package/dist/components/chip/resolveChipColors.js +14 -4
- package/dist/components/chip/resolveChipColors.js.map +1 -1
- package/dist/components/chip/types.d.ts +2 -2
- package/dist/components/chip/types.d.ts.map +1 -1
- package/dist/components/chip/types.js.map +1 -1
- package/dist/components/chip-group/ChipGroup.js +2 -2
- package/dist/components/chip-group/ChipGroup.js.map +1 -1
- package/dist/components/chip-group/types.d.ts +2 -2
- package/dist/components/chip-group/types.d.ts.map +1 -1
- package/dist/components/chip-group/types.js.map +1 -1
- package/dist/components/drawer/Drawer.js +1 -1
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/form/FormError.js +1 -1
- package/dist/components/form/FormError.js.map +1 -1
- package/dist/components/form/FormField.js +1 -1
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/heading/Heading.d.ts.map +1 -1
- package/dist/components/heading/Heading.js +5 -3
- package/dist/components/heading/Heading.js.map +1 -1
- package/dist/components/heading/index.d.ts +1 -1
- package/dist/components/heading/index.d.ts.map +1 -1
- package/dist/components/heading/index.js.map +1 -1
- package/dist/components/heading/meta.d.ts +9 -3
- package/dist/components/heading/meta.d.ts.map +1 -1
- package/dist/components/heading/meta.js +10 -3
- package/dist/components/heading/meta.js.map +1 -1
- package/dist/components/heading/resolveHeadingRecipe.d.ts +4 -3
- package/dist/components/heading/resolveHeadingRecipe.d.ts.map +1 -1
- package/dist/components/heading/resolveHeadingRecipe.js +33 -12
- package/dist/components/heading/resolveHeadingRecipe.js.map +1 -1
- package/dist/components/heading/types.d.ts +5 -2
- package/dist/components/heading/types.d.ts.map +1 -1
- package/dist/components/heading/types.js.map +1 -1
- package/dist/components/icon-button/IconButton.js +3 -3
- package/dist/components/icon-button/IconButton.js.map +1 -1
- package/dist/components/icon-button/types.d.ts +3 -3
- package/dist/components/icon-button/types.d.ts.map +1 -1
- package/dist/components/icon-button/types.js.map +1 -1
- package/dist/components/input/Input.js +1 -1
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/media-card/MediaCard.js +2 -2
- package/dist/components/media-card/MediaCard.js.map +1 -1
- package/dist/components/metric-card/MetricCard.js +5 -5
- package/dist/components/metric-card/MetricCard.js.map +1 -1
- package/dist/components/metric-card/types.d.ts +2 -2
- package/dist/components/metric-card/types.d.ts.map +1 -1
- package/dist/components/metric-card/types.js.map +1 -1
- package/dist/components/modal/Modal.js +1 -1
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/progress/Progress.js +2 -2
- package/dist/components/progress/Progress.js.map +1 -1
- package/dist/components/progress/types.d.ts +3 -3
- package/dist/components/progress/types.d.ts.map +1 -1
- package/dist/components/progress/types.js +12 -2
- package/dist/components/progress/types.js.map +1 -1
- package/dist/components/radio/RadioGroup.js +5 -5
- package/dist/components/radio/RadioGroup.js.map +1 -1
- package/dist/components/radio/types.d.ts +1 -1
- package/dist/components/radio/types.d.ts.map +1 -1
- package/dist/components/radio/types.js.map +1 -1
- package/dist/components/rating/Rating.js +2 -2
- package/dist/components/rating/Rating.js.map +1 -1
- package/dist/components/rating/types.d.ts +3 -3
- package/dist/components/rating/types.d.ts.map +1 -1
- package/dist/components/rating/types.js +12 -2
- package/dist/components/rating/types.js.map +1 -1
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +4 -4
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/text/Text.d.ts.map +1 -1
- package/dist/components/text/Text.js +3 -2
- package/dist/components/text/Text.js.map +1 -1
- package/dist/components/text/index.d.ts +1 -1
- package/dist/components/text/index.d.ts.map +1 -1
- package/dist/components/text/index.js.map +1 -1
- package/dist/components/text/meta.d.ts +10 -4
- package/dist/components/text/meta.d.ts.map +1 -1
- package/dist/components/text/meta.js +11 -4
- package/dist/components/text/meta.js.map +1 -1
- package/dist/components/text/resolveTextRecipe.d.ts +4 -3
- package/dist/components/text/resolveTextRecipe.d.ts.map +1 -1
- package/dist/components/text/resolveTextRecipe.js +35 -13
- package/dist/components/text/resolveTextRecipe.js.map +1 -1
- package/dist/components/text/types.d.ts +5 -2
- package/dist/components/text/types.d.ts.map +1 -1
- package/dist/components/text/types.js.map +1 -1
- package/dist/components/toolbar/ToolbarAction.js +1 -1
- package/dist/components/toolbar/ToolbarAction.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/colorModel.d.ts +10 -0
- package/dist/internal/colorModel.d.ts.map +1 -0
- package/dist/internal/colorModel.js +25 -0
- package/dist/internal/colorModel.js.map +1 -0
- package/dist/internal/recipes.d.ts +12 -11
- package/dist/internal/recipes.d.ts.map +1 -1
- package/dist/internal/recipes.js +6 -6
- package/dist/internal/recipes.js.map +1 -1
- package/dist/layout/screen/Screen.d.ts.map +1 -1
- package/dist/layout/screen/Screen.js +7 -3
- package/dist/layout/screen/Screen.js.map +1 -1
- package/dist/patterns/auth/ForgotPasswordForm.js +2 -2
- package/dist/patterns/auth/ForgotPasswordForm.js.map +1 -1
- package/dist/patterns/auth/OtpForm.js +2 -2
- package/dist/patterns/auth/OtpForm.js.map +1 -1
- package/dist/patterns/auth/SignInForm.js +4 -4
- package/dist/patterns/auth/SignInForm.js.map +1 -1
- package/dist/patterns/auth/SignUpForm.js +2 -2
- package/dist/patterns/auth/SignUpForm.js.map +1 -1
- package/dist/patterns/chat-list-item/ChatListItem.d.ts.map +1 -1
- package/dist/patterns/chat-list-item/ChatListItem.js +6 -6
- package/dist/patterns/chat-list-item/ChatListItem.js.map +1 -1
- package/dist/patterns/chat-list-item/types.d.ts +2 -2
- package/dist/patterns/chat-list-item/types.d.ts.map +1 -1
- package/dist/patterns/chat-list-item/types.js.map +1 -1
- package/dist/patterns/collection-editor/CollectionEditor.js +5 -5
- package/dist/patterns/collection-editor/CollectionEditor.js.map +1 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.js +3 -3
- package/dist/patterns/confirm-dialog/ConfirmDialog.js.map +1 -1
- package/dist/patterns/confirm-dialog/types.d.ts +3 -3
- package/dist/patterns/confirm-dialog/types.d.ts.map +1 -1
- package/dist/patterns/confirm-dialog/types.js.map +1 -1
- package/dist/patterns/disclosure-section/DisclosureSection.js +1 -1
- package/dist/patterns/disclosure-section/DisclosureSection.js.map +1 -1
- package/dist/patterns/empty-state/EmptyState.js +2 -2
- package/dist/patterns/empty-state/EmptyState.js.map +1 -1
- package/dist/patterns/empty-state/types.d.ts +3 -3
- package/dist/patterns/empty-state/types.d.ts.map +1 -1
- package/dist/patterns/empty-state/types.js.map +1 -1
- package/dist/patterns/form-field/FormField.js +1 -1
- package/dist/patterns/form-field/FormField.js.map +1 -1
- package/dist/patterns/hero/Hero.js +3 -3
- package/dist/patterns/hero/Hero.js.map +1 -1
- package/dist/patterns/hero/types.d.ts +3 -3
- package/dist/patterns/hero/types.d.ts.map +1 -1
- package/dist/patterns/hero/types.js.map +1 -1
- package/dist/patterns/image-preview/ImagePreview.js +1 -1
- package/dist/patterns/image-preview/ImagePreview.js.map +1 -1
- package/dist/patterns/image-upload-field/ImageUploadField.js +7 -7
- package/dist/patterns/image-upload-field/ImageUploadField.js.map +1 -1
- package/dist/patterns/list/ListRow.js +2 -2
- package/dist/patterns/list/ListRow.js.map +1 -1
- package/dist/patterns/message-bubble/MessageBubble.d.ts.map +1 -1
- package/dist/patterns/message-bubble/MessageBubble.js +6 -6
- package/dist/patterns/message-bubble/MessageBubble.js.map +1 -1
- package/dist/patterns/message-bubble/types.d.ts +2 -2
- package/dist/patterns/message-bubble/types.d.ts.map +1 -1
- package/dist/patterns/message-bubble/types.js.map +1 -1
- package/dist/patterns/notice/Notice.js +2 -2
- package/dist/patterns/notice/Notice.js.map +1 -1
- package/dist/patterns/notice/types.d.ts +2 -2
- package/dist/patterns/notice/types.d.ts.map +1 -1
- package/dist/patterns/notice/types.js.map +1 -1
- package/dist/patterns/post-card/PostCard.js +4 -4
- package/dist/patterns/post-card/PostCard.js.map +1 -1
- package/dist/patterns/post-card/types.d.ts +2 -2
- package/dist/patterns/post-card/types.d.ts.map +1 -1
- package/dist/patterns/post-card/types.js.map +1 -1
- package/dist/patterns/section-header/SectionHeader.js +2 -2
- package/dist/patterns/section-header/SectionHeader.js.map +1 -1
- package/dist/patterns/settings-row/SettingsRow.js +1 -1
- package/dist/patterns/settings-row/SettingsRow.js.map +1 -1
- package/dist/patterns/theme-composer/ThemeComposer.js +14 -14
- package/dist/patterns/theme-composer/ThemeComposer.js.map +1 -1
- package/dist/patterns/tile-grid/PaletteItem.js +1 -1
- package/dist/patterns/tile-grid/PaletteItem.js.map +1 -1
- package/dist/patterns/timeline/Timeline.d.ts.map +1 -1
- package/dist/patterns/timeline/Timeline.js +14 -4
- package/dist/patterns/timeline/Timeline.js.map +1 -1
- package/dist/patterns/timeline/types.d.ts +2 -2
- package/dist/patterns/timeline/types.d.ts.map +1 -1
- package/dist/patterns/timeline/types.js.map +1 -1
- package/dist/patterns/tree-view/TreeItem.js +1 -1
- package/dist/patterns/tree-view/TreeItem.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/components/app-bar/AppBar.tsx +6 -6
- package/src/components/avatar/Avatar.tsx +21 -11
- package/src/components/avatar/types.ts +2 -2
- package/src/components/avatar-group/AvatarGroup.tsx +2 -2
- package/src/components/avatar-group/types.ts +2 -2
- package/src/components/badge/Badge.tsx +4 -4
- package/src/components/badge/types.ts +4 -4
- package/src/components/button/Button.tsx +4 -4
- package/src/components/button/meta.ts +8 -7
- package/src/components/button/types.ts +4 -4
- package/src/components/card/Card.tsx +2 -2
- package/src/components/checkbox/CheckboxGroup.tsx +6 -6
- package/src/components/checkbox/types.ts +1 -1
- package/src/components/chip/Chip.tsx +9 -10
- package/src/components/chip/resolveChipColors.ts +16 -6
- package/src/components/chip/types.ts +2 -2
- package/src/components/chip-group/ChipGroup.tsx +2 -2
- package/src/components/chip-group/types.ts +2 -2
- package/src/components/drawer/Drawer.tsx +1 -1
- package/src/components/form/FormError.tsx +1 -1
- package/src/components/form/FormField.tsx +1 -1
- package/src/components/heading/Heading.tsx +6 -3
- package/src/components/heading/index.ts +2 -1
- package/src/components/heading/meta.ts +10 -3
- package/src/components/heading/resolveHeadingRecipe.test.ts +13 -10
- package/src/components/heading/resolveHeadingRecipe.ts +58 -15
- package/src/components/heading/types.ts +5 -10
- package/src/components/icon-button/IconButton.tsx +4 -4
- package/src/components/icon-button/types.ts +3 -3
- package/src/components/input/Input.tsx +2 -2
- package/src/components/media-card/MediaCard.tsx +2 -2
- package/src/components/metric-card/MetricCard.tsx +6 -6
- package/src/components/metric-card/types.ts +2 -2
- package/src/components/modal/Modal.tsx +1 -1
- package/src/components/progress/Progress.tsx +2 -2
- package/src/components/progress/types.ts +14 -4
- package/src/components/radio/RadioGroup.tsx +6 -6
- package/src/components/radio/types.ts +1 -1
- package/src/components/rating/Rating.tsx +2 -2
- package/src/components/rating/types.ts +14 -4
- package/src/components/tabs/Tabs.tsx +11 -7
- package/src/components/text/Text.tsx +4 -2
- package/src/components/text/index.ts +8 -1
- package/src/components/text/meta.ts +11 -4
- package/src/components/text/resolveTextRecipe.test.ts +18 -14
- package/src/components/text/resolveTextRecipe.ts +42 -15
- package/src/components/text/types.ts +5 -10
- package/src/components/toolbar/ToolbarAction.tsx +2 -2
- package/src/index.ts +22 -2
- package/src/internal/colorModel.ts +39 -0
- package/src/internal/recipes.test.ts +2 -2
- package/src/internal/recipes.ts +18 -18
- package/src/layout/screen/Screen.tsx +11 -3
- package/src/patterns/auth/ForgotPasswordForm.tsx +2 -2
- package/src/patterns/auth/OtpForm.tsx +2 -2
- package/src/patterns/auth/SignInForm.tsx +4 -4
- package/src/patterns/auth/SignUpForm.tsx +2 -2
- package/src/patterns/chat-list-item/ChatListItem.tsx +7 -6
- package/src/patterns/chat-list-item/types.ts +2 -2
- package/src/patterns/collection-editor/CollectionEditor.tsx +6 -6
- package/src/patterns/confirm-dialog/ConfirmDialog.tsx +4 -4
- package/src/patterns/confirm-dialog/types.ts +3 -3
- package/src/patterns/disclosure-section/DisclosureSection.tsx +2 -2
- package/src/patterns/empty-state/EmptyState.tsx +4 -4
- package/src/patterns/empty-state/types.ts +3 -3
- package/src/patterns/form-field/FormField.tsx +1 -1
- package/src/patterns/hero/Hero.tsx +4 -4
- package/src/patterns/hero/types.ts +3 -3
- package/src/patterns/image-preview/ImagePreview.tsx +1 -1
- package/src/patterns/image-upload-field/ImageUploadField.tsx +8 -8
- package/src/patterns/list/ListRow.tsx +2 -2
- package/src/patterns/message-bubble/MessageBubble.tsx +10 -6
- package/src/patterns/message-bubble/types.ts +2 -2
- package/src/patterns/notice/Notice.tsx +2 -2
- package/src/patterns/notice/types.ts +2 -2
- package/src/patterns/post-card/PostCard.tsx +5 -5
- package/src/patterns/post-card/types.ts +2 -2
- package/src/patterns/section-header/SectionHeader.tsx +2 -2
- package/src/patterns/settings-row/SettingsRow.tsx +1 -1
- package/src/patterns/theme-composer/ThemeComposer.tsx +15 -15
- package/src/patterns/tile-grid/PaletteItem.tsx +1 -1
- package/src/patterns/timeline/Timeline.tsx +15 -5
- package/src/patterns/timeline/types.ts +2 -2
- package/src/patterns/tree-view/TreeItem.tsx +1 -1
- package/src/patterns/zora-tab-bar/ZoraTabBar.tsx +104 -15
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
type FontWeight,
|
|
4
4
|
resolveResponsive,
|
|
5
5
|
type Responsive,
|
|
6
|
+
type RoleSemantics,
|
|
6
7
|
type SurfaceTheme,
|
|
7
8
|
} from '@ankhorage/surface';
|
|
8
9
|
import type { TextStyle } from 'react-native';
|
|
9
10
|
|
|
10
|
-
import type { TextAlign,
|
|
11
|
+
import type { TextAlign, TextColor, TextEmphasis, TextVariant, TextWeight } from './types';
|
|
11
12
|
|
|
12
13
|
interface VariantRecipe {
|
|
13
14
|
fontSize: number;
|
|
@@ -21,7 +22,8 @@ interface ResolveTextStyleOptions {
|
|
|
21
22
|
theme: SurfaceTheme;
|
|
22
23
|
breakpoint: Breakpoint;
|
|
23
24
|
variant?: Responsive<TextVariant>;
|
|
24
|
-
|
|
25
|
+
color?: Responsive<TextColor>;
|
|
26
|
+
emphasis?: Responsive<TextEmphasis>;
|
|
25
27
|
weight?: Responsive<TextWeight>;
|
|
26
28
|
align?: Responsive<TextAlign>;
|
|
27
29
|
italic?: boolean;
|
|
@@ -109,22 +111,45 @@ function resolveVariantRecipe(
|
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
|
|
112
|
-
function
|
|
113
|
-
switch (
|
|
114
|
+
function resolveRoleSemantics(theme: SurfaceTheme, color: TextColor): RoleSemantics {
|
|
115
|
+
switch (color) {
|
|
116
|
+
case 'secondary':
|
|
117
|
+
return theme.semantics.secondary;
|
|
118
|
+
case 'tertiary':
|
|
119
|
+
return theme.semantics.accent;
|
|
120
|
+
case 'quaternary':
|
|
121
|
+
return theme.semantics.highlight;
|
|
122
|
+
case 'neutral':
|
|
123
|
+
return theme.semantics.action.neutral;
|
|
124
|
+
case 'error':
|
|
125
|
+
return theme.semantics.error;
|
|
126
|
+
case 'info':
|
|
127
|
+
return theme.semantics.info;
|
|
128
|
+
case 'danger':
|
|
129
|
+
return theme.semantics.action.danger;
|
|
130
|
+
case 'success':
|
|
131
|
+
return theme.semantics.success;
|
|
132
|
+
case 'warning':
|
|
133
|
+
return theme.semantics.warning;
|
|
134
|
+
case 'primary':
|
|
135
|
+
default:
|
|
136
|
+
return theme.semantics.action.primary;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function resolveTextColor(theme: SurfaceTheme, emphasis: TextEmphasis, color?: TextColor): string {
|
|
141
|
+
if (color) {
|
|
142
|
+
const role = resolveRoleSemantics(theme, color);
|
|
143
|
+
return emphasis === 'inverse' ? role.onSolidText : role.base;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
switch (emphasis) {
|
|
114
147
|
case 'muted':
|
|
115
148
|
return theme.semantics.content.muted;
|
|
116
149
|
case 'subtle':
|
|
117
150
|
return theme.semantics.content.subtle;
|
|
118
151
|
case 'inverse':
|
|
119
152
|
return theme.semantics.content.inverse;
|
|
120
|
-
case 'primary':
|
|
121
|
-
return theme.semantics.brand.base;
|
|
122
|
-
case 'danger':
|
|
123
|
-
return theme.semantics.danger.base;
|
|
124
|
-
case 'success':
|
|
125
|
-
return theme.semantics.success.base;
|
|
126
|
-
case 'warning':
|
|
127
|
-
return theme.semantics.warning.base;
|
|
128
153
|
case 'default':
|
|
129
154
|
default:
|
|
130
155
|
return theme.semantics.content.default;
|
|
@@ -135,13 +160,15 @@ export function resolveTextStyle({
|
|
|
135
160
|
theme,
|
|
136
161
|
breakpoint,
|
|
137
162
|
variant,
|
|
138
|
-
|
|
163
|
+
color,
|
|
164
|
+
emphasis,
|
|
139
165
|
weight,
|
|
140
166
|
align,
|
|
141
167
|
italic = false,
|
|
142
168
|
}: ResolveTextStyleOptions): TextStyle {
|
|
143
169
|
const resolvedVariant = resolveResponsive(variant, breakpoint) ?? 'body';
|
|
144
|
-
const
|
|
170
|
+
const resolvedEmphasis = resolveResponsive(emphasis, breakpoint) ?? 'default';
|
|
171
|
+
const resolvedColor = resolveResponsive(color, breakpoint);
|
|
145
172
|
const resolvedAlign = resolveResponsive(align, breakpoint);
|
|
146
173
|
const recipe = resolveVariantRecipe(theme, resolvedVariant, breakpoint);
|
|
147
174
|
const resolvedWeight = resolveWeight(
|
|
@@ -150,7 +177,7 @@ export function resolveTextStyle({
|
|
|
150
177
|
);
|
|
151
178
|
|
|
152
179
|
return {
|
|
153
|
-
color:
|
|
180
|
+
color: resolveTextColor(theme, resolvedEmphasis, resolvedColor),
|
|
154
181
|
elevation: 0,
|
|
155
182
|
fontFamily: resolveFontFamily({
|
|
156
183
|
theme,
|
|
@@ -2,19 +2,13 @@ import type { Responsive } from '@ankhorage/surface';
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { AccessibilityRole, TextStyle } from 'react-native';
|
|
4
4
|
|
|
5
|
+
import type { ZoraColor, ZoraEmphasis } from '../../internal/recipes';
|
|
5
6
|
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
6
7
|
|
|
7
8
|
export type TextVariant = 'body' | 'lead' | 'bodySmall' | 'caption' | 'label' | 'eyebrow' | 'code';
|
|
8
9
|
|
|
9
|
-
export type
|
|
10
|
-
|
|
11
|
-
| 'muted'
|
|
12
|
-
| 'subtle'
|
|
13
|
-
| 'inverse'
|
|
14
|
-
| 'primary'
|
|
15
|
-
| 'danger'
|
|
16
|
-
| 'success'
|
|
17
|
-
| 'warning';
|
|
10
|
+
export type TextColor = ZoraColor;
|
|
11
|
+
export type TextEmphasis = ZoraEmphasis;
|
|
18
12
|
|
|
19
13
|
export type TextWeight = 'regular' | 'medium' | 'semiBold' | 'bold';
|
|
20
14
|
|
|
@@ -25,7 +19,8 @@ export interface TextProps extends ZoraBaseProps {
|
|
|
25
19
|
text?: string;
|
|
26
20
|
i18nKey?: string;
|
|
27
21
|
variant?: Responsive<TextVariant>;
|
|
28
|
-
|
|
22
|
+
color?: Responsive<TextColor>;
|
|
23
|
+
emphasis?: Responsive<TextEmphasis>;
|
|
29
24
|
align?: Responsive<TextAlign>;
|
|
30
25
|
weight?: Responsive<TextWeight>;
|
|
31
26
|
italic?: boolean;
|
|
@@ -13,8 +13,8 @@ function ToolbarActionInner({
|
|
|
13
13
|
return (
|
|
14
14
|
<IconButton
|
|
15
15
|
{...props}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
variant={active ? 'soft' : 'ghost'}
|
|
17
|
+
color={active ? 'primary' : 'neutral'}
|
|
18
18
|
size="m"
|
|
19
19
|
/>
|
|
20
20
|
);
|
package/src/index.ts
CHANGED
|
@@ -48,10 +48,11 @@ export {
|
|
|
48
48
|
} from './components/form';
|
|
49
49
|
export type {
|
|
50
50
|
HeadingAlign,
|
|
51
|
+
HeadingColor,
|
|
52
|
+
HeadingEmphasis,
|
|
51
53
|
HeadingLevel,
|
|
52
54
|
HeadingProps,
|
|
53
55
|
HeadingSize,
|
|
54
|
-
HeadingTone,
|
|
55
56
|
HeadingWeight,
|
|
56
57
|
} from './components/heading';
|
|
57
58
|
export { Heading } from './components/heading';
|
|
@@ -89,7 +90,14 @@ export type { SelectOption, SelectProps } from './components/select';
|
|
|
89
90
|
export { Select } from './components/select';
|
|
90
91
|
export type { TabItem, TabsProps, TabsVariant } from './components/tabs';
|
|
91
92
|
export { Tabs } from './components/tabs';
|
|
92
|
-
export type {
|
|
93
|
+
export type {
|
|
94
|
+
TextAlign,
|
|
95
|
+
TextColor,
|
|
96
|
+
TextEmphasis,
|
|
97
|
+
TextProps,
|
|
98
|
+
TextVariant,
|
|
99
|
+
TextWeight,
|
|
100
|
+
} from './components/text';
|
|
93
101
|
export { Text } from './components/text';
|
|
94
102
|
export type { TextareaProps } from './components/textarea';
|
|
95
103
|
export { Textarea } from './components/textarea';
|
|
@@ -120,6 +128,18 @@ export {
|
|
|
120
128
|
Stack,
|
|
121
129
|
Surface,
|
|
122
130
|
} from './foundation';
|
|
131
|
+
export type {
|
|
132
|
+
ZoraColor,
|
|
133
|
+
ZoraEmphasis,
|
|
134
|
+
ZoraPaletteColor,
|
|
135
|
+
ZoraStatusColor,
|
|
136
|
+
} from './internal/colorModel';
|
|
137
|
+
export {
|
|
138
|
+
ZORA_COLORS,
|
|
139
|
+
ZORA_EMPHASES,
|
|
140
|
+
ZORA_PALETTE_COLORS,
|
|
141
|
+
ZORA_STATUS_COLORS,
|
|
142
|
+
} from './internal/colorModel';
|
|
123
143
|
export type { AppShellProps } from './layout/app-shell';
|
|
124
144
|
export { AppShell } from './layout/app-shell';
|
|
125
145
|
export type { AuthLayoutProps } from './layout/auth-layout';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SurfaceColor,
|
|
3
|
+
SurfaceEmphasis,
|
|
4
|
+
SurfacePaletteColor,
|
|
5
|
+
SurfaceStatusColor,
|
|
6
|
+
} from '@ankhorage/surface';
|
|
7
|
+
|
|
8
|
+
export type ZoraPaletteColor = SurfacePaletteColor;
|
|
9
|
+
export type ZoraStatusColor = SurfaceStatusColor;
|
|
10
|
+
export type ZoraColor = SurfaceColor;
|
|
11
|
+
export type ZoraEmphasis = SurfaceEmphasis;
|
|
12
|
+
|
|
13
|
+
export const ZORA_PALETTE_COLORS = [
|
|
14
|
+
'primary',
|
|
15
|
+
'secondary',
|
|
16
|
+
'tertiary',
|
|
17
|
+
'quaternary',
|
|
18
|
+
'neutral',
|
|
19
|
+
] as const satisfies readonly SurfacePaletteColor[];
|
|
20
|
+
|
|
21
|
+
export const ZORA_STATUS_COLORS = [
|
|
22
|
+
'success',
|
|
23
|
+
'warning',
|
|
24
|
+
'error',
|
|
25
|
+
'info',
|
|
26
|
+
] as const satisfies readonly SurfaceStatusColor[];
|
|
27
|
+
|
|
28
|
+
export const ZORA_COLORS = [
|
|
29
|
+
...ZORA_PALETTE_COLORS,
|
|
30
|
+
...ZORA_STATUS_COLORS,
|
|
31
|
+
'danger',
|
|
32
|
+
] as const satisfies readonly SurfaceColor[];
|
|
33
|
+
|
|
34
|
+
export const ZORA_EMPHASES = [
|
|
35
|
+
'default',
|
|
36
|
+
'muted',
|
|
37
|
+
'subtle',
|
|
38
|
+
'inverse',
|
|
39
|
+
] as const satisfies readonly SurfaceEmphasis[];
|
|
@@ -13,7 +13,7 @@ describe('recipes', () => {
|
|
|
13
13
|
test('maps button defaults to a more opinionated large solid primary button', () => {
|
|
14
14
|
expect(resolveButtonRecipe({})).toEqual({
|
|
15
15
|
size: 'l',
|
|
16
|
-
|
|
16
|
+
color: 'primary',
|
|
17
17
|
variant: 'solid',
|
|
18
18
|
});
|
|
19
19
|
});
|
|
@@ -21,7 +21,7 @@ describe('recipes', () => {
|
|
|
21
21
|
test('maps badge defaults to a soft medium primary badge', () => {
|
|
22
22
|
expect(resolveBadgeRecipe({})).toEqual({
|
|
23
23
|
size: 'm',
|
|
24
|
-
|
|
24
|
+
color: 'primary',
|
|
25
25
|
variant: 'soft',
|
|
26
26
|
});
|
|
27
27
|
});
|
package/src/internal/recipes.ts
CHANGED
|
@@ -3,43 +3,43 @@ import type {
|
|
|
3
3
|
ButtonProps as SurfaceButtonProps,
|
|
4
4
|
CardProps as SurfaceCardProps,
|
|
5
5
|
} from '@ankhorage/surface';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export type
|
|
6
|
+
export type { ZoraColor, ZoraEmphasis } from './colorModel';
|
|
7
|
+
import type { ZoraColor } from './colorModel';
|
|
8
|
+
export type ZoraButtonVariant = NonNullable<SurfaceButtonProps['variant']>;
|
|
9
9
|
export type ZoraControlSize = NonNullable<SurfaceButtonProps['size']>;
|
|
10
|
-
export type
|
|
10
|
+
export type ZoraBadgeVariant = NonNullable<SurfaceBadgeProps['variant']>;
|
|
11
11
|
export type ZoraCardTone = 'default' | 'subtle' | 'outline';
|
|
12
12
|
export type ZoraContentWidth = 'narrow' | 'default' | 'wide';
|
|
13
13
|
|
|
14
14
|
export function resolveButtonRecipe({
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
color = 'primary',
|
|
16
|
+
variant = 'solid',
|
|
17
17
|
size = 'l',
|
|
18
18
|
}: {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
color?: ZoraColor;
|
|
20
|
+
variant?: ZoraButtonVariant;
|
|
21
21
|
size?: ZoraControlSize;
|
|
22
|
-
}): Pick<SurfaceButtonProps, 'size' | '
|
|
22
|
+
}): Pick<SurfaceButtonProps, 'size' | 'color' | 'variant'> {
|
|
23
23
|
return {
|
|
24
24
|
size,
|
|
25
|
-
|
|
26
|
-
variant
|
|
25
|
+
color,
|
|
26
|
+
variant,
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export function resolveBadgeRecipe({
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
color = 'primary',
|
|
32
|
+
variant = 'soft',
|
|
33
33
|
size = 'm',
|
|
34
34
|
}: {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
color?: ZoraColor;
|
|
36
|
+
variant?: ZoraBadgeVariant;
|
|
37
37
|
size?: ZoraControlSize;
|
|
38
|
-
}): Pick<SurfaceBadgeProps, 'size' | '
|
|
38
|
+
}): Pick<SurfaceBadgeProps, 'size' | 'color' | 'variant'> {
|
|
39
39
|
return {
|
|
40
40
|
size,
|
|
41
|
-
|
|
42
|
-
variant
|
|
41
|
+
color,
|
|
42
|
+
variant,
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ScrollArea } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { Container, Stack } from '../../foundation';
|
|
4
|
+
import { Box, Container, Stack } from '../../foundation';
|
|
5
5
|
import { resolvePageMaxWidth } from '../../internal/recipes';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { ScreenProps } from './types';
|
|
@@ -25,10 +25,18 @@ function ScreenInner({
|
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
if (!scroll) {
|
|
28
|
-
return
|
|
28
|
+
return (
|
|
29
|
+
<Box bg="background" flex={1}>
|
|
30
|
+
{content}
|
|
31
|
+
</Box>
|
|
32
|
+
);
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
return
|
|
35
|
+
return (
|
|
36
|
+
<ScrollArea bg="background" style={{ flex: 1 }}>
|
|
37
|
+
{content}
|
|
38
|
+
</ScrollArea>
|
|
39
|
+
);
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
export const Screen = withZoraThemeScope(ScreenInner);
|
|
@@ -61,12 +61,12 @@ function ForgotPasswordFormInner({
|
|
|
61
61
|
<Stack direction="row" gap="s" wrap="wrap">
|
|
62
62
|
<Button
|
|
63
63
|
disabled={disabled || loading}
|
|
64
|
-
|
|
64
|
+
variant="ghost"
|
|
65
65
|
onPress={() => {
|
|
66
66
|
void onSignIn();
|
|
67
67
|
}}
|
|
68
68
|
size="s"
|
|
69
|
-
|
|
69
|
+
color="neutral"
|
|
70
70
|
>
|
|
71
71
|
{signInLabel}
|
|
72
72
|
</Button>
|
|
@@ -56,13 +56,13 @@ function OtpFormInner({
|
|
|
56
56
|
<Stack direction="row" gap="s" wrap="wrap">
|
|
57
57
|
<Button
|
|
58
58
|
disabled={disabled || loading || resendDisabled}
|
|
59
|
-
|
|
59
|
+
variant="ghost"
|
|
60
60
|
loading={resendLoading}
|
|
61
61
|
onPress={() => {
|
|
62
62
|
void onResend();
|
|
63
63
|
}}
|
|
64
64
|
size="s"
|
|
65
|
-
|
|
65
|
+
color="neutral"
|
|
66
66
|
>
|
|
67
67
|
{resendLabel}
|
|
68
68
|
</Button>
|
|
@@ -74,12 +74,12 @@ function SignInFormInner({
|
|
|
74
74
|
{onForgotPassword ? (
|
|
75
75
|
<Button
|
|
76
76
|
disabled={disabled || loading}
|
|
77
|
-
|
|
77
|
+
variant="ghost"
|
|
78
78
|
onPress={() => {
|
|
79
79
|
void onForgotPassword();
|
|
80
80
|
}}
|
|
81
81
|
size="s"
|
|
82
|
-
|
|
82
|
+
color="neutral"
|
|
83
83
|
>
|
|
84
84
|
{forgotPasswordLabel}
|
|
85
85
|
</Button>
|
|
@@ -87,12 +87,12 @@ function SignInFormInner({
|
|
|
87
87
|
{onSignUp ? (
|
|
88
88
|
<Button
|
|
89
89
|
disabled={disabled || loading}
|
|
90
|
-
|
|
90
|
+
variant="ghost"
|
|
91
91
|
onPress={() => {
|
|
92
92
|
void onSignUp();
|
|
93
93
|
}}
|
|
94
94
|
size="s"
|
|
95
|
-
|
|
95
|
+
color="neutral"
|
|
96
96
|
>
|
|
97
97
|
{signUpLabel}
|
|
98
98
|
</Button>
|
|
@@ -53,12 +53,12 @@ function SignUpFormInner({
|
|
|
53
53
|
<Stack direction="row" gap="s" wrap="wrap">
|
|
54
54
|
<Button
|
|
55
55
|
disabled={disabled || loading}
|
|
56
|
-
|
|
56
|
+
variant="ghost"
|
|
57
57
|
onPress={() => {
|
|
58
58
|
void onSignIn();
|
|
59
59
|
}}
|
|
60
60
|
size="s"
|
|
61
|
-
|
|
61
|
+
color="neutral"
|
|
62
62
|
>
|
|
63
63
|
{signInLabel}
|
|
64
64
|
</Button>
|
|
@@ -62,7 +62,7 @@ function renderUnreadCount(unreadCount: React.ReactNode) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
return (
|
|
65
|
-
<Badge size="s"
|
|
65
|
+
<Badge size="s" color="primary">
|
|
66
66
|
{unreadCount}
|
|
67
67
|
</Badge>
|
|
68
68
|
);
|
|
@@ -126,7 +126,7 @@ function ChatListItemInner({
|
|
|
126
126
|
shape={avatar?.shape}
|
|
127
127
|
size={avatar?.size ?? (compact ? 's' : 'm')}
|
|
128
128
|
source={avatar?.source}
|
|
129
|
-
|
|
129
|
+
color={avatar?.color}
|
|
130
130
|
/>
|
|
131
131
|
)}
|
|
132
132
|
|
|
@@ -136,7 +136,7 @@ function ChatListItemInner({
|
|
|
136
136
|
<Box flex={1}>
|
|
137
137
|
<Text
|
|
138
138
|
numberOfLines={1}
|
|
139
|
-
|
|
139
|
+
emphasis={disabled ? 'muted' : 'default'}
|
|
140
140
|
variant="bodySmall"
|
|
141
141
|
weight={unread || selected ? 'semiBold' : 'medium'}
|
|
142
142
|
>
|
|
@@ -146,7 +146,8 @@ function ChatListItemInner({
|
|
|
146
146
|
{hasTimestamp ? (
|
|
147
147
|
<Text
|
|
148
148
|
numberOfLines={1}
|
|
149
|
-
|
|
149
|
+
color={unread ? 'primary' : undefined}
|
|
150
|
+
emphasis={unread ? 'default' : 'subtle'}
|
|
150
151
|
variant="caption"
|
|
151
152
|
weight={unread ? 'semiBold' : 'regular'}
|
|
152
153
|
>
|
|
@@ -162,7 +163,7 @@ function ChatListItemInner({
|
|
|
162
163
|
{hasPreview ? (
|
|
163
164
|
<Text
|
|
164
165
|
numberOfLines={1}
|
|
165
|
-
|
|
166
|
+
emphasis={unread ? 'default' : 'muted'}
|
|
166
167
|
variant="bodySmall"
|
|
167
168
|
weight={unread ? 'medium' : 'regular'}
|
|
168
169
|
>
|
|
@@ -170,7 +171,7 @@ function ChatListItemInner({
|
|
|
170
171
|
</Text>
|
|
171
172
|
) : null}
|
|
172
173
|
{hasMeta ? (
|
|
173
|
-
<Text numberOfLines={1}
|
|
174
|
+
<Text numberOfLines={1} emphasis="subtle" variant="caption">
|
|
174
175
|
{meta}
|
|
175
176
|
</Text>
|
|
176
177
|
) : null}
|
|
@@ -2,7 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
import type { ImageSourcePropType } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import type { AvatarShape, AvatarSize } from '../../components/avatar';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ZoraColor } from '../../internal/recipes';
|
|
6
6
|
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
7
7
|
|
|
8
8
|
export interface ChatListAvatar {
|
|
@@ -12,7 +12,7 @@ export interface ChatListAvatar {
|
|
|
12
12
|
label?: string;
|
|
13
13
|
size?: AvatarSize;
|
|
14
14
|
shape?: AvatarShape;
|
|
15
|
-
|
|
15
|
+
color?: ZoraColor;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface ChatListItemProps extends ZoraBaseProps {
|
|
@@ -33,7 +33,7 @@ function CollectionEditorInner<TItem>({
|
|
|
33
33
|
title={title}
|
|
34
34
|
actions={
|
|
35
35
|
onAdd ? (
|
|
36
|
-
<Button
|
|
36
|
+
<Button variant="soft" size="s" disabled={disabled} onPress={onAdd}>
|
|
37
37
|
{addLabel}
|
|
38
38
|
</Button>
|
|
39
39
|
) : null
|
|
@@ -42,7 +42,7 @@ function CollectionEditorInner<TItem>({
|
|
|
42
42
|
<Stack gap="s">
|
|
43
43
|
{isEmpty ? (
|
|
44
44
|
<Box py="m">
|
|
45
|
-
<Text align="center"
|
|
45
|
+
<Text align="center" emphasis="muted">
|
|
46
46
|
{emptyLabel}
|
|
47
47
|
</Text>
|
|
48
48
|
</Box>
|
|
@@ -70,7 +70,7 @@ function CollectionEditorInner<TItem>({
|
|
|
70
70
|
disabled={disabled ?? index === 0}
|
|
71
71
|
onPress={() => onMove(index, index - 1)}
|
|
72
72
|
size="s"
|
|
73
|
-
|
|
73
|
+
variant="ghost"
|
|
74
74
|
/>
|
|
75
75
|
<IconButton
|
|
76
76
|
icon={{ name: 'arrow-down-outline' }}
|
|
@@ -78,7 +78,7 @@ function CollectionEditorInner<TItem>({
|
|
|
78
78
|
disabled={disabled ?? index === items.length - 1}
|
|
79
79
|
onPress={() => onMove(index, index + 1)}
|
|
80
80
|
size="s"
|
|
81
|
-
|
|
81
|
+
variant="ghost"
|
|
82
82
|
/>
|
|
83
83
|
</>
|
|
84
84
|
) : null}
|
|
@@ -86,11 +86,11 @@ function CollectionEditorInner<TItem>({
|
|
|
86
86
|
<IconButton
|
|
87
87
|
icon={{ name: 'trash-outline' }}
|
|
88
88
|
label="Remove"
|
|
89
|
-
|
|
89
|
+
color="danger"
|
|
90
90
|
disabled={disabled}
|
|
91
91
|
onPress={() => onRemove(index)}
|
|
92
92
|
size="s"
|
|
93
|
-
|
|
93
|
+
variant="ghost"
|
|
94
94
|
/>
|
|
95
95
|
) : null}
|
|
96
96
|
</Stack>
|
|
@@ -15,8 +15,8 @@ function ConfirmDialogInner({
|
|
|
15
15
|
children,
|
|
16
16
|
confirmLabel = 'Confirm',
|
|
17
17
|
cancelLabel = 'Cancel',
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
confirmColor = 'danger',
|
|
19
|
+
confirmVariant = 'solid',
|
|
20
20
|
busy = false,
|
|
21
21
|
closeOnBackdrop = true,
|
|
22
22
|
onConfirm,
|
|
@@ -29,10 +29,10 @@ function ConfirmDialogInner({
|
|
|
29
29
|
description={description}
|
|
30
30
|
footer={
|
|
31
31
|
<Stack direction={{ base: 'column', md: 'row' }} gap="s" justify="flex-end">
|
|
32
|
-
<Button
|
|
32
|
+
<Button variant="soft" onPress={onCancel} color="neutral">
|
|
33
33
|
{cancelLabel}
|
|
34
34
|
</Button>
|
|
35
|
-
<Button
|
|
35
|
+
<Button variant={confirmVariant} loading={busy} onPress={onConfirm} color={confirmColor}>
|
|
36
36
|
{confirmLabel}
|
|
37
37
|
</Button>
|
|
38
38
|
</Stack>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { ZoraButtonVariant, ZoraColor } from '../../internal/recipes';
|
|
4
4
|
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
5
|
|
|
6
6
|
export interface ConfirmDialogProps extends ZoraBaseProps {
|
|
@@ -10,8 +10,8 @@ export interface ConfirmDialogProps extends ZoraBaseProps {
|
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
confirmLabel?: React.ReactNode;
|
|
12
12
|
cancelLabel?: React.ReactNode;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
confirmColor?: ZoraColor;
|
|
14
|
+
confirmVariant?: ZoraButtonVariant;
|
|
15
15
|
busy?: boolean;
|
|
16
16
|
closeOnBackdrop?: boolean;
|
|
17
17
|
onConfirm?: () => void;
|
|
@@ -49,8 +49,8 @@ function DisclosureSectionInner({
|
|
|
49
49
|
<IconButton
|
|
50
50
|
icon={{ name: isOpen ? 'chevron-up-outline' : 'chevron-down-outline' }}
|
|
51
51
|
label={isOpen ? 'Collapse' : 'Expand'}
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
variant="ghost"
|
|
53
|
+
color="neutral"
|
|
54
54
|
size="s"
|
|
55
55
|
disabled={disabled}
|
|
56
56
|
onPress={toggleOpen}
|
|
@@ -31,18 +31,18 @@ function EmptyStateInner({
|
|
|
31
31
|
<Stack direction={{ base: 'column', md: 'row' }} gap="s">
|
|
32
32
|
{primaryAction ? (
|
|
33
33
|
<Button
|
|
34
|
-
|
|
34
|
+
variant={primaryAction.variant}
|
|
35
35
|
onPress={primaryAction.onPress}
|
|
36
|
-
|
|
36
|
+
color={primaryAction.color}
|
|
37
37
|
>
|
|
38
38
|
{primaryAction.label}
|
|
39
39
|
</Button>
|
|
40
40
|
) : null}
|
|
41
41
|
{secondaryAction ? (
|
|
42
42
|
<Button
|
|
43
|
-
|
|
43
|
+
variant={secondaryAction.variant ?? 'soft'}
|
|
44
44
|
onPress={secondaryAction.onPress}
|
|
45
|
-
|
|
45
|
+
color={secondaryAction.color ?? 'neutral'}
|
|
46
46
|
>
|
|
47
47
|
{secondaryAction.label}
|
|
48
48
|
</Button>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { ZoraButtonVariant, ZoraColor } from '../../internal/recipes';
|
|
4
4
|
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
5
|
|
|
6
6
|
export interface EmptyStateAction {
|
|
7
7
|
label: React.ReactNode;
|
|
8
8
|
onPress: () => void;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
color?: ZoraColor;
|
|
10
|
+
variant?: ZoraButtonVariant;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export interface EmptyStateProps extends ZoraBaseProps {
|