@ankhorage/zora 27.2.4 → 27.2.5
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 +6 -0
- package/README.md +1 -1
- package/package.json +3 -2
- package/web-dist/authoring/index.js +1 -1
- package/web-dist/chunks/{Accordion-2ga81fwp.js → Accordion-0c585c6b.js} +2 -2
- package/web-dist/chunks/{Accordion-ecknv9v4.js → Accordion-276zkmsp.js} +6 -6
- package/web-dist/chunks/{Accordion-yq16wwh5.js → Accordion-2bwvswbf.js} +100 -2
- package/web-dist/chunks/{Accordion-pwpjet1r.js → Accordion-3c33rhns.js} +2 -2
- package/web-dist/chunks/{Accordion-6wrr910w.js → Accordion-4d4xahgg.js} +1 -1
- package/web-dist/chunks/{Accordion-fvv1jb72.js → Accordion-58rjgzd8.js} +4 -4
- package/web-dist/chunks/{Accordion-awarqvqt.js → Accordion-5xjm3haw.js} +3 -3
- package/web-dist/chunks/{Accordion-r2g18vxa.js → Accordion-67hswqw7.js} +1 -1
- package/web-dist/chunks/{Accordion-bfszt9f0.js → Accordion-6fe2cg8x.js} +3 -2
- package/web-dist/chunks/{Accordion-xstk85jq.js → Accordion-6pyhxpvj.js} +53 -18
- package/web-dist/chunks/{Accordion-ng4f4k3b.js → Accordion-7hcnqvw9.js} +3 -3
- package/web-dist/chunks/{Accordion-vg337250.js → Accordion-7j1ams3h.js} +2 -2
- package/web-dist/chunks/{Accordion-rkg1y7x3.js → Accordion-a0rf46ya.js} +9 -9
- package/web-dist/chunks/{Accordion-vmbaw3e9.js → Accordion-av34pgmt.js} +6 -6
- package/web-dist/chunks/{Accordion-srjya6dz.js → Accordion-b36h9a7g.js} +1 -1
- package/web-dist/chunks/{Accordion-37fyjrmm.js → Accordion-bjagk749.js} +3 -3
- package/web-dist/chunks/{Accordion-apchszqk.js → Accordion-c1hhwvme.js} +2 -2
- package/web-dist/chunks/{Accordion-vyr0pdcg.js → Accordion-cqw8wx8b.js} +4 -4
- package/web-dist/chunks/{Accordion-hywab9gp.js → Accordion-czjn2qsj.js} +12 -12
- package/web-dist/chunks/{Accordion-yen1cn5b.js → Accordion-dvydrq9k.js} +2 -2
- package/web-dist/chunks/{Accordion-k3mcnzzz.js → Accordion-e027hq2m.js} +9 -9
- package/web-dist/chunks/{Accordion-109vh7aq.js → Accordion-e5cv8nsg.js} +8 -8
- package/web-dist/chunks/{Accordion-xwg44t8y.js → Accordion-ekynbcva.js} +5 -5
- package/web-dist/chunks/{Accordion-9j3x1ccv.js → Accordion-fz2eb6nq.js} +7 -7
- package/web-dist/chunks/{Accordion-z11jhrng.js → Accordion-gs2sm01j.js} +8 -8
- package/web-dist/chunks/{Accordion-mfyhqbk5.js → Accordion-h0g07rpv.js} +6 -6
- package/web-dist/chunks/{Accordion-rwk4marz.js → Accordion-hcybq8sv.js} +5 -5
- package/web-dist/chunks/{Accordion-8pwsx854.js → Accordion-hh7rrtvm.js} +7 -7
- package/web-dist/chunks/{Accordion-55axaf49.js → Accordion-hvxmng6p.js} +4 -4
- package/web-dist/chunks/{Accordion-972z2w82.js → Accordion-k90e8xbz.js} +4 -4
- package/web-dist/chunks/{Accordion-dska91jj.js → Accordion-kgsyp87f.js} +13 -13
- package/web-dist/chunks/{Accordion-jz4j00nh.js → Accordion-kw82sjaq.js} +4 -4
- package/web-dist/chunks/{Accordion-f2ce5m3x.js → Accordion-m0h44b2f.js} +4 -4
- package/web-dist/chunks/{Accordion-j1chy29e.js → Accordion-m9ph4kvs.js} +3 -3
- package/web-dist/chunks/{Accordion-2d49mqp7.js → Accordion-mqb226ws.js} +2 -2
- package/web-dist/chunks/Accordion-n6r6pees.js +9568 -0
- package/web-dist/chunks/Accordion-n8272tj8.js +1296 -0
- package/web-dist/chunks/{Accordion-dev40gg3.js → Accordion-n893wynv.js} +2 -2
- package/web-dist/chunks/{Accordion-aqqx878d.js → Accordion-p10zbjj2.js} +7 -7
- package/web-dist/chunks/{Accordion-2gx0rh1s.js → Accordion-pc1amd3f.js} +9 -9
- package/web-dist/chunks/{Accordion-qr5qn652.js → Accordion-pc21382h.js} +1 -1
- package/web-dist/chunks/{Accordion-bn0e6xt0.js → Accordion-pjp156pj.js} +7 -7
- package/web-dist/chunks/{Accordion-3p43xhk7.js → Accordion-qdpdvt4d.js} +29 -17
- package/web-dist/chunks/{Accordion-vj2yj9fa.js → Accordion-qe96qhwd.js} +2 -2
- package/web-dist/chunks/{Accordion-y0kg8p9s.js → Accordion-qntvm6fr.js} +5 -5
- package/web-dist/chunks/{Accordion-bff0p3x4.js → Accordion-qqv9mak2.js} +17 -5
- package/web-dist/chunks/{Accordion-0x8jncra.js → Accordion-tz5kyeym.js} +5 -7
- package/web-dist/chunks/{Accordion-vj1m2wck.js → Accordion-w42y21pt.js} +1 -1
- package/web-dist/chunks/{Accordion-xyx98xnk.js → Accordion-yttxjn1e.js} +5 -5
- package/web-dist/chunks/{Accordion-rmnw8z4x.js → Accordion-zvd2t0ey.js} +4 -4
- package/web-dist/components/accordion/Accordion.js +10 -12
- package/web-dist/components/accordion-item/AccordionItem.js +10 -12
- package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -3
- package/web-dist/components/app-bar/AppBar.js +15 -17
- package/web-dist/components/app-header/AppHeader.js +15 -17
- package/web-dist/components/app-shell/AppShell.js +4 -5
- package/web-dist/components/auth-screen/AuthScreen.js +19 -21
- package/web-dist/components/avatar/Avatar.js +10 -12
- package/web-dist/components/avatar-group/AvatarGroup.js +10 -12
- package/web-dist/components/badge/Badge.js +5 -6
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +18 -20
- package/web-dist/components/bottom-sheet/BottomSheet.js +6 -7
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +6 -7
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +6 -7
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +6 -7
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +6 -7
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +6 -7
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +12 -14
- package/web-dist/components/button/Button.js +10 -12
- package/web-dist/components/button-group/ButtonGroup.js +10 -12
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +18 -20
- package/web-dist/components/card/Card.js +17 -19
- package/web-dist/components/card-back/CardBack.js +4 -4
- package/web-dist/components/card-hand/CardHand.js +4 -4
- package/web-dist/components/chat-list-item/ChatListItem.js +14 -16
- package/web-dist/components/checkbox/Checkbox.js +10 -12
- package/web-dist/components/checkbox-group/CheckboxGroup.js +10 -12
- package/web-dist/components/chess-board/ChessBoard.js +4 -4
- package/web-dist/components/chip/Chip.js +11 -13
- package/web-dist/components/chip-group/ChipGroup.js +11 -13
- package/web-dist/components/collection-editor/CollectionEditor.js +17 -19
- package/web-dist/components/content-rail/ContentRail.js +11 -13
- package/web-dist/components/data-table/DataTable.js +22 -24
- package/web-dist/components/date-picker/DatePicker.js +15 -17
- package/web-dist/components/dialog/Dialog.js +9 -11
- package/web-dist/components/divider/Divider.js +4 -5
- package/web-dist/components/empty-state/EmptyState.js +18 -20
- package/web-dist/components/explorer/Explorer.js +11 -13
- package/web-dist/components/field/Field.js +10 -12
- package/web-dist/components/file-explorer/FileExplorer.js +11 -13
- package/web-dist/components/flat-list/FlatList.js +11 -13
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +19 -21
- package/web-dist/components/form/Form.js +14 -16
- package/web-dist/components/form-actions/FormActions.js +14 -16
- package/web-dist/components/form-error/FormError.js +14 -16
- package/web-dist/components/game/Game.js +5 -6
- package/web-dist/components/game-entity/GameEntity.js +5 -6
- package/web-dist/components/game-field/GameField.js +5 -6
- package/web-dist/components/game-input-zone/GameInputZone.js +5 -6
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +5 -6
- package/web-dist/components/game-overlay/GameOverlay.js +5 -6
- package/web-dist/components/gradient/Gradient.js +5 -6
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +5 -6
- package/web-dist/components/grid/Grid.js +4 -5
- package/web-dist/components/grid-line-overlay/GridLineOverlay.js +4 -4
- package/web-dist/components/grid-ruler/GridRuler.js +4 -4
- package/web-dist/components/heading/Heading.js +5 -6
- package/web-dist/components/hero/Hero.js +17 -19
- package/web-dist/components/icon/Icon.js +4 -5
- package/web-dist/components/icon-button/IconButton.js +10 -12
- package/web-dist/components/image/Image.js +8 -10
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -3
- package/web-dist/components/list/List.js +11 -13
- package/web-dist/components/list-item/ListItem.js +11 -13
- package/web-dist/components/list-section/ListSection.js +11 -13
- package/web-dist/components/matrix-grid/MatrixGrid.js +4 -9
- package/web-dist/components/media-card/MediaCard.js +17 -19
- package/web-dist/components/media-explorer/MediaExplorer.js +11 -13
- package/web-dist/components/message-bubble/MessageBubble.js +14 -16
- package/web-dist/components/metric-card/MetricCard.js +17 -19
- package/web-dist/components/missing-element/MissingElement.js +9 -11
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +19 -21
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +19 -21
- package/web-dist/components/opening-book/OpeningBook.js +4 -4
- package/web-dist/components/otp-form/OtpForm.js +19 -21
- package/web-dist/components/pagination/Pagination.js +11 -13
- package/web-dist/components/palette-item/PaletteItem.js +17 -19
- package/web-dist/components/playing-card/PlayingCard.js +4 -4
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +4 -4
- package/web-dist/components/popover-menu/PopoverMenu.js +10 -12
- package/web-dist/components/post-card/PostCard.js +17 -19
- package/web-dist/components/product-card/ProductCard.js +17 -19
- package/web-dist/components/progress/Progress.js +8 -10
- package/web-dist/components/progress-ring/ProgressRing.js +8 -10
- package/web-dist/components/radio/Radio.js +12 -14
- package/web-dist/components/radio-group/RadioGroup.js +12 -14
- package/web-dist/components/rating/Rating.js +7 -9
- package/web-dist/components/reader/Reader.js +18 -20
- package/web-dist/components/scan-overlay/ScanOverlay.js +18 -20
- package/web-dist/components/screen/Screen.js +4 -5
- package/web-dist/components/screen-section/ScreenSection.js +8 -10
- package/web-dist/components/scroll-view/ScrollView.js +4 -5
- package/web-dist/components/search-input/SearchInput.js +11 -13
- package/web-dist/components/section-header/SectionHeader.js +8 -10
- package/web-dist/components/section-list/SectionList.js +11 -13
- package/web-dist/components/select/Select.js +13 -15
- package/web-dist/components/selectable-item/SelectableItem.js +3 -8
- package/web-dist/components/selection-provider/SelectionProvider.js +3 -8
- package/web-dist/components/sign-in-form/SignInForm.js +19 -21
- package/web-dist/components/sign-up-form/SignUpForm.js +19 -21
- package/web-dist/components/skeleton/Skeleton.js +20 -22
- package/web-dist/components/skeleton-card/SkeletonCard.js +20 -22
- package/web-dist/components/skeleton-list/SkeletonList.js +20 -22
- package/web-dist/components/skeleton-text/SkeletonText.js +20 -22
- package/web-dist/components/surface/Surface.js +5 -6
- package/web-dist/components/switch/Switch.js +5 -6
- package/web-dist/components/tab/Tab.js +5 -6
- package/web-dist/components/tab-list/TabList.js +5 -6
- package/web-dist/components/tab-panel/TabPanel.js +5 -6
- package/web-dist/components/tabletop-table/TabletopTable.js +4 -4
- package/web-dist/components/tabs/Tabs.js +5 -6
- package/web-dist/components/text/Text.js +5 -6
- package/web-dist/components/text-input/TextInput.js +11 -13
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +10 -12
- package/web-dist/components/time-picker/TimePicker.js +15 -17
- package/web-dist/components/timeline/Timeline.js +9 -11
- package/web-dist/components/toast/Toast.js +7 -8
- package/web-dist/components/toast-provider/ToastProvider.js +7 -8
- package/web-dist/components/toolbar/Toolbar.js +17 -19
- package/web-dist/components/tree-item/TreeItem.js +15 -17
- package/web-dist/components/uploader/Uploader.js +20 -22
- package/web-dist/components/view/View.js +4 -5
- package/web-dist/manifest.json +1271 -1477
- package/web-dist/runtime/ZoraProvider.js +6 -7
- package/web-dist/chunks/Accordion-58yzdsab.js +0 -106
- package/web-dist/chunks/Accordion-bfzeab9x.js +0 -18
- package/web-dist/chunks/Accordion-ebcg2kyw.js +0 -218
- package/web-dist/chunks/Accordion-pv1432kr.js +0 -413
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import {
|
|
3
|
-
useTheme
|
|
4
|
-
} from "./Accordion-6wrr910w.js";
|
|
5
|
-
import {
|
|
6
|
-
Icon3
|
|
7
|
-
} from "./Accordion-3p43xhk7.js";
|
|
8
|
-
import {
|
|
9
|
-
View3
|
|
10
|
-
} from "./Accordion-58yzdsab.js";
|
|
11
|
-
import {
|
|
12
|
-
Pressable
|
|
13
|
-
} from "./Accordion-xstk85jq.js";
|
|
14
|
-
import {
|
|
15
|
-
Text2
|
|
16
|
-
} from "./Accordion-qr5qn652.js";
|
|
17
|
-
import {
|
|
18
|
-
withZoraThemeScope
|
|
19
|
-
} from "./Accordion-vj1m2wck.js";
|
|
20
|
-
import {
|
|
21
|
-
View2
|
|
22
|
-
} from "./Accordion-0x8jncra.js";
|
|
23
|
-
import {
|
|
24
|
-
resolveControlSize,
|
|
25
|
-
resolveIconSize2,
|
|
26
|
-
resolveButtonColors
|
|
27
|
-
} from "./Accordion-6ec4gxv2.js";
|
|
28
|
-
import {
|
|
29
|
-
useZoraThemeRecipe,
|
|
30
|
-
ZORA_COLORS
|
|
31
|
-
} from "./Accordion-bff0p3x4.js";
|
|
32
|
-
import {
|
|
33
|
-
require_cjs
|
|
34
|
-
} from "./Accordion-xgpzh4wq.js";
|
|
35
|
-
import {
|
|
36
|
-
__toESM
|
|
37
|
-
} from "./Accordion-nh0cs9hq.js";
|
|
38
|
-
|
|
39
|
-
// node_modules/@ankhorage/surface/src/features/button/adapters/inbound/ButtonPresentation.tsx
|
|
40
|
-
var import_react_native = __toESM(require_cjs(), 1);
|
|
41
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
42
|
-
function ButtonPresentation({ Icon, ...props }) {
|
|
43
|
-
const {
|
|
44
|
-
children,
|
|
45
|
-
variant = "solid",
|
|
46
|
-
color = "primary",
|
|
47
|
-
size = "m",
|
|
48
|
-
disabled = false,
|
|
49
|
-
loading = false,
|
|
50
|
-
leadingIcon,
|
|
51
|
-
trailingIcon,
|
|
52
|
-
fullWidth = false,
|
|
53
|
-
onPress,
|
|
54
|
-
testID,
|
|
55
|
-
...pressableProps
|
|
56
|
-
} = props;
|
|
57
|
-
const { theme } = useTheme();
|
|
58
|
-
const controlSize = resolveControlSize(theme, size);
|
|
59
|
-
return /* @__PURE__ */ jsx(Pressable, {
|
|
60
|
-
...pressableProps,
|
|
61
|
-
disabled: disabled || loading,
|
|
62
|
-
onPress,
|
|
63
|
-
style: resolvePressableStyle(fullWidth),
|
|
64
|
-
testID,
|
|
65
|
-
children: (state) => /* @__PURE__ */ jsx(ButtonContent, {
|
|
66
|
-
Icon,
|
|
67
|
-
color,
|
|
68
|
-
controlSize,
|
|
69
|
-
fullWidth,
|
|
70
|
-
leadingIcon,
|
|
71
|
-
loading,
|
|
72
|
-
size,
|
|
73
|
-
state,
|
|
74
|
-
theme,
|
|
75
|
-
trailingIcon,
|
|
76
|
-
variant,
|
|
77
|
-
children
|
|
78
|
-
})
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
function ButtonContent({
|
|
82
|
-
Icon,
|
|
83
|
-
children,
|
|
84
|
-
color,
|
|
85
|
-
controlSize,
|
|
86
|
-
fullWidth,
|
|
87
|
-
leadingIcon,
|
|
88
|
-
loading,
|
|
89
|
-
size,
|
|
90
|
-
state,
|
|
91
|
-
theme,
|
|
92
|
-
trailingIcon,
|
|
93
|
-
variant
|
|
94
|
-
}) {
|
|
95
|
-
const colors = resolveButtonColors(theme, { variant, color, state });
|
|
96
|
-
const iconSize = resolveIconSize2(theme, size);
|
|
97
|
-
return /* @__PURE__ */ jsx(View3, {
|
|
98
|
-
px: controlSize.paddingHorizontal,
|
|
99
|
-
py: controlSize.paddingVertical,
|
|
100
|
-
radius: controlSize.borderRadius,
|
|
101
|
-
style: resolveButtonContentStyle(controlSize, colors, fullWidth, variant),
|
|
102
|
-
children: loading ? /* @__PURE__ */ jsx(import_react_native.ActivityIndicator, {
|
|
103
|
-
color: colors.contentColor,
|
|
104
|
-
size: "small"
|
|
105
|
-
}) : /* @__PURE__ */ jsxs(Fragment, {
|
|
106
|
-
children: [
|
|
107
|
-
leadingIcon ? /* @__PURE__ */ jsx(import_react_native.View, {
|
|
108
|
-
style: resolveAccessoryStyle(theme.spacing.s, "leading"),
|
|
109
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
110
|
-
...leadingIcon,
|
|
111
|
-
color: colors.contentColor,
|
|
112
|
-
size: iconSize
|
|
113
|
-
})
|
|
114
|
-
}) : null,
|
|
115
|
-
/* @__PURE__ */ jsx(Text2, {
|
|
116
|
-
style: { color: colors.contentColor },
|
|
117
|
-
variant: controlSize.textVariant,
|
|
118
|
-
weight: "semiBold",
|
|
119
|
-
children
|
|
120
|
-
}),
|
|
121
|
-
trailingIcon ? /* @__PURE__ */ jsx(import_react_native.View, {
|
|
122
|
-
style: resolveAccessoryStyle(theme.spacing.s, "trailing"),
|
|
123
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
124
|
-
...trailingIcon,
|
|
125
|
-
color: colors.contentColor,
|
|
126
|
-
size: iconSize
|
|
127
|
-
})
|
|
128
|
-
}) : null
|
|
129
|
-
]
|
|
130
|
-
})
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
function resolvePressableStyle(fullWidth) {
|
|
134
|
-
return { alignSelf: fullWidth ? "stretch" : "flex-start" };
|
|
135
|
-
}
|
|
136
|
-
function resolveButtonContentStyle(controlSize, colors, fullWidth, variant) {
|
|
137
|
-
return {
|
|
138
|
-
alignItems: "center",
|
|
139
|
-
backgroundColor: colors.backgroundColor,
|
|
140
|
-
borderColor: colors.borderColor,
|
|
141
|
-
borderWidth: variant === "solid" ? 0 : 1,
|
|
142
|
-
flexDirection: "row",
|
|
143
|
-
justifyContent: "center",
|
|
144
|
-
minHeight: controlSize.minHeight,
|
|
145
|
-
opacity: colors.opacity,
|
|
146
|
-
width: fullWidth ? "100%" : undefined
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
function resolveAccessoryStyle(spacing, position) {
|
|
150
|
-
return position === "leading" ? { marginRight: spacing } : { marginLeft: spacing };
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// node_modules/@ankhorage/surface/src/features/button/adapters/inbound/Button.web.tsx
|
|
154
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
155
|
-
function Button(props) {
|
|
156
|
-
return /* @__PURE__ */ jsx2(ButtonPresentation, {
|
|
157
|
-
...props,
|
|
158
|
-
Icon: Icon3
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// src/features/button/utils/resolveButtonRecipe.ts
|
|
163
|
-
function resolveButtonRecipe({
|
|
164
|
-
color = "primary",
|
|
165
|
-
variant = "solid",
|
|
166
|
-
size = "l"
|
|
167
|
-
}) {
|
|
168
|
-
return { size, color, variant };
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// src/features/button/utils/resolveButtonThemeRecipe.ts
|
|
172
|
-
function resolveButtonThemeRecipe(input) {
|
|
173
|
-
return resolveButtonRecipe({
|
|
174
|
-
color: input.color ?? readColor(input.themeFields.color),
|
|
175
|
-
variant: input.variant ?? readVariant(input.themeFields.variant),
|
|
176
|
-
size: input.size ?? readSize(input.themeFields.size)
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
function readColor(value) {
|
|
180
|
-
if (typeof value !== "string")
|
|
181
|
-
return;
|
|
182
|
-
if (value === "primary" || value === "secondary" || value === "tertiary")
|
|
183
|
-
return value;
|
|
184
|
-
if (value === "quaternary" || value === "neutral" || value === "danger")
|
|
185
|
-
return value;
|
|
186
|
-
if (value === "success" || value === "warning" || value === "error" || value === "info")
|
|
187
|
-
return value;
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
function readVariant(value) {
|
|
191
|
-
if (value === "solid" || value === "outline" || value === "ghost" || value === "soft")
|
|
192
|
-
return value;
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
function readSize(value) {
|
|
196
|
-
if (value === "s" || value === "m" || value === "l")
|
|
197
|
-
return value;
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// src/features/button/utils/themeRecipeMeta.ts
|
|
202
|
-
var buttonThemeRecipeMeta = {
|
|
203
|
-
name: "Button",
|
|
204
|
-
kind: "component",
|
|
205
|
-
description: "Maps shared semantic choices into Button presentation defaults.",
|
|
206
|
-
fields: {
|
|
207
|
-
color: {
|
|
208
|
-
type: "choice",
|
|
209
|
-
label: "Color",
|
|
210
|
-
options: ZORA_COLORS,
|
|
211
|
-
default: "primary"
|
|
212
|
-
},
|
|
213
|
-
variant: {
|
|
214
|
-
type: "choice",
|
|
215
|
-
label: "Variant",
|
|
216
|
-
options: ["solid", "outline", "ghost", "soft"],
|
|
217
|
-
default: "solid"
|
|
218
|
-
},
|
|
219
|
-
size: {
|
|
220
|
-
type: "choice",
|
|
221
|
-
label: "Size",
|
|
222
|
-
description: "A Button-specific semantic scale, not a universal pixel size.",
|
|
223
|
-
options: ["s", "m", "l"],
|
|
224
|
-
default: "l"
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
// src/features/button/adapters/inbound/Button.tsx
|
|
230
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
231
|
-
var Button2 = withZoraThemeScope(ButtonInner);
|
|
232
|
-
function ButtonInner({
|
|
233
|
-
themeId: _themeId,
|
|
234
|
-
mode: _mode,
|
|
235
|
-
color,
|
|
236
|
-
variant,
|
|
237
|
-
size,
|
|
238
|
-
interactionPolicy,
|
|
239
|
-
...props
|
|
240
|
-
}) {
|
|
241
|
-
const themeFields = useZoraThemeRecipe(buttonThemeRecipeMeta);
|
|
242
|
-
const recipe = resolveButtonThemeRecipe({ color, variant, size, themeFields });
|
|
243
|
-
return /* @__PURE__ */ jsx3(Button, {
|
|
244
|
-
...props,
|
|
245
|
-
color: recipe.color,
|
|
246
|
-
size: recipe.size,
|
|
247
|
-
variant: recipe.variant,
|
|
248
|
-
interactionPolicy
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// src/features/button/adapters/inbound/ButtonGroup.tsx
|
|
253
|
-
import React from "react";
|
|
254
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
255
|
-
var ButtonGroup2 = withZoraThemeScope(ButtonGroupInner);
|
|
256
|
-
function resolveDirection(orientation) {
|
|
257
|
-
if (orientation === "vertical") {
|
|
258
|
-
return "column";
|
|
259
|
-
}
|
|
260
|
-
if (orientation === "responsive") {
|
|
261
|
-
return { base: "column", md: "row" };
|
|
262
|
-
}
|
|
263
|
-
return "row";
|
|
264
|
-
}
|
|
265
|
-
function resolveHorizontalJustify(align) {
|
|
266
|
-
switch (align) {
|
|
267
|
-
case "start":
|
|
268
|
-
return "flex-start";
|
|
269
|
-
case "center":
|
|
270
|
-
return "center";
|
|
271
|
-
case "between":
|
|
272
|
-
return "space-between";
|
|
273
|
-
case "stretch":
|
|
274
|
-
case "end":
|
|
275
|
-
default:
|
|
276
|
-
return "flex-end";
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
function resolveVerticalAlign(align) {
|
|
280
|
-
switch (align) {
|
|
281
|
-
case "start":
|
|
282
|
-
return "flex-start";
|
|
283
|
-
case "center":
|
|
284
|
-
case "between":
|
|
285
|
-
return "center";
|
|
286
|
-
case "stretch":
|
|
287
|
-
return "stretch";
|
|
288
|
-
case "end":
|
|
289
|
-
default:
|
|
290
|
-
return "flex-end";
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
function resolveStackAlign(align, orientation) {
|
|
294
|
-
if (orientation === "horizontal") {
|
|
295
|
-
return align === "stretch" ? "stretch" : "center";
|
|
296
|
-
}
|
|
297
|
-
if (orientation === "responsive") {
|
|
298
|
-
return {
|
|
299
|
-
base: resolveVerticalAlign(align),
|
|
300
|
-
md: align === "stretch" ? "stretch" : "center"
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
return resolveVerticalAlign(align);
|
|
304
|
-
}
|
|
305
|
-
function resolveStackJustify(align, orientation) {
|
|
306
|
-
if (orientation === "horizontal") {
|
|
307
|
-
return resolveHorizontalJustify(align);
|
|
308
|
-
}
|
|
309
|
-
if (orientation === "responsive") {
|
|
310
|
-
return {
|
|
311
|
-
base: align === "between" ? "space-between" : "flex-start",
|
|
312
|
-
md: resolveHorizontalJustify(align)
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
return align === "between" ? "space-between" : "flex-start";
|
|
316
|
-
}
|
|
317
|
-
function ButtonGroupInner({
|
|
318
|
-
themeId: _themeId,
|
|
319
|
-
mode: _mode,
|
|
320
|
-
children,
|
|
321
|
-
align = "end",
|
|
322
|
-
orientation = "horizontal",
|
|
323
|
-
gap = "s",
|
|
324
|
-
reverse = false,
|
|
325
|
-
testID,
|
|
326
|
-
interactionPolicy: _interactionPolicy
|
|
327
|
-
}) {
|
|
328
|
-
const items = React.Children.toArray(children);
|
|
329
|
-
const orderedItems = reverse ? items.reverse() : items;
|
|
330
|
-
return /* @__PURE__ */ jsx4(View2, {
|
|
331
|
-
align: resolveStackAlign(align, orientation),
|
|
332
|
-
direction: resolveDirection(orientation),
|
|
333
|
-
gap,
|
|
334
|
-
justify: resolveStackJustify(align, orientation),
|
|
335
|
-
testID,
|
|
336
|
-
children: orderedItems
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
// node_modules/@ankhorage/surface/src/features/button/adapters/inbound/IconButton.tsx
|
|
340
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
341
|
-
function IconButton({
|
|
342
|
-
icon,
|
|
343
|
-
accessibilityLabel,
|
|
344
|
-
variant = "ghost",
|
|
345
|
-
color = "primary",
|
|
346
|
-
size = "m",
|
|
347
|
-
disabled = false,
|
|
348
|
-
onPress,
|
|
349
|
-
testID,
|
|
350
|
-
...props
|
|
351
|
-
}) {
|
|
352
|
-
const { theme } = useTheme();
|
|
353
|
-
const controlSize = resolveControlSize(theme, size);
|
|
354
|
-
return /* @__PURE__ */ jsx5(Pressable, {
|
|
355
|
-
...props,
|
|
356
|
-
accessibilityLabel,
|
|
357
|
-
disabled,
|
|
358
|
-
onPress,
|
|
359
|
-
testID,
|
|
360
|
-
children: (state) => {
|
|
361
|
-
const colors = resolveButtonColors(theme, { color, state, variant });
|
|
362
|
-
return /* @__PURE__ */ jsx5(View3, {
|
|
363
|
-
radius: controlSize.borderRadius,
|
|
364
|
-
style: resolveIconButtonStyle(controlSize, colors, variant),
|
|
365
|
-
children: /* @__PURE__ */ jsx5(Icon3, {
|
|
366
|
-
...icon,
|
|
367
|
-
color: colors.contentColor,
|
|
368
|
-
size: resolveIconSize2(theme, size)
|
|
369
|
-
})
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
function resolveIconButtonStyle(controlSize, colors, variant) {
|
|
375
|
-
return {
|
|
376
|
-
alignItems: "center",
|
|
377
|
-
backgroundColor: colors.backgroundColor,
|
|
378
|
-
borderColor: colors.borderColor,
|
|
379
|
-
borderWidth: variant === "solid" ? 0 : 1,
|
|
380
|
-
justifyContent: "center",
|
|
381
|
-
minHeight: controlSize.minHeight,
|
|
382
|
-
minWidth: controlSize.minHeight,
|
|
383
|
-
opacity: colors.opacity
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// src/features/button/adapters/inbound/IconButton.tsx
|
|
388
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
389
|
-
var IconButton2 = withZoraThemeScope(IconButtonInner);
|
|
390
|
-
function IconButtonInner({
|
|
391
|
-
themeId: _themeId,
|
|
392
|
-
mode: _mode,
|
|
393
|
-
icon,
|
|
394
|
-
iconName,
|
|
395
|
-
label,
|
|
396
|
-
variant = "ghost",
|
|
397
|
-
color = "neutral",
|
|
398
|
-
size = "m",
|
|
399
|
-
interactionPolicy,
|
|
400
|
-
...props
|
|
401
|
-
}) {
|
|
402
|
-
const recipe = resolveButtonRecipe({ color, variant, size });
|
|
403
|
-
return /* @__PURE__ */ jsx6(IconButton, {
|
|
404
|
-
...props,
|
|
405
|
-
icon: icon ?? { name: iconName ?? "add" },
|
|
406
|
-
accessibilityLabel: label,
|
|
407
|
-
color: recipe.color,
|
|
408
|
-
size: recipe.size,
|
|
409
|
-
variant: recipe.variant,
|
|
410
|
-
interactionPolicy
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
export { Button2, ButtonGroup2, IconButton2 };
|