@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.40
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/dist/chunk-2EGR4LWD.js +145 -0
- package/dist/chunk-2NRZKJG7.js +531 -0
- package/dist/chunk-2PMXMKS5.js +67 -0
- package/dist/chunk-2XPG2243.js +586 -0
- package/dist/chunk-36PRYGAM.js +13 -0
- package/dist/chunk-3E7CDKFO.cjs +696 -0
- package/dist/chunk-3GFRSZYR.js +54 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-4CUZZWFW.js +92 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4KFKWBN5.cjs +89 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5R26NM4M.cjs +402 -0
- package/dist/chunk-5VKYNBNA.js +607 -0
- package/dist/chunk-64MXEVT3.js +66 -0
- package/dist/chunk-6DOLGZVV.cjs +147 -0
- package/dist/chunk-6L2TS2R3.cjs +92 -0
- package/dist/chunk-6UEZJRVI.js +669 -0
- package/dist/chunk-734MFAX4.js +27 -0
- package/dist/chunk-73RKQC5X.js +104 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7GHM4GKL.cjs +119 -0
- package/dist/chunk-7YF5NAHQ.cjs +74 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-ABAGZTXZ.cjs +736 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-ACAPTWE3.cjs} +85 -81
- package/dist/chunk-AMCSSOJT.cjs +104 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BRRXFOBY.js +431 -0
- package/dist/chunk-C5YLPCFC.cjs +293 -0
- package/dist/chunk-DA3OKXHV.cjs +700 -0
- package/dist/chunk-DD4276RF.js +366 -0
- package/dist/chunk-DG2I4PJG.js +701 -0
- package/dist/chunk-DHGLGSH6.js +661 -0
- package/dist/chunk-DIBUQ46Y.js +346 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-EKS3W46M.cjs +66 -0
- package/dist/chunk-EZEYMLO3.js +402 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FHUYHV6J.js +89 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G7P3ERYF.cjs +478 -0
- package/dist/chunk-GA6PBWNT.js +147 -0
- package/dist/chunk-GFUZ3MUT.cjs +455 -0
- package/dist/chunk-GGW43Q37.cjs +1 -0
- package/dist/chunk-GTR5X65M.cjs +27 -0
- package/dist/chunk-H4E4HDEP.cjs +13 -0
- package/dist/chunk-H7DS4IO7.js +198 -0
- package/dist/chunk-HDVVZG4S.cjs +198 -0
- package/dist/chunk-IKJVLJKT.js +151 -0
- package/dist/chunk-J3MB4PI5.cjs +531 -0
- package/dist/chunk-K72UDPVN.js +119 -0
- package/dist/chunk-KCMYU7WF.js +86 -0
- package/dist/chunk-LRN3RNDO.js +940 -0
- package/dist/chunk-LTX6TB5I.js +124 -0
- package/dist/chunk-LUPCPLND.cjs +145 -0
- package/dist/chunk-M63GFNKV.js +194 -0
- package/dist/chunk-N3KTZMPG.js +293 -0
- package/dist/chunk-NCTOTTVW.js +13 -0
- package/dist/chunk-NWGLP6JX.cjs +410 -0
- package/dist/chunk-R73XQK7X.cjs +314 -0
- package/dist/chunk-RU7JCMWC.cjs +881 -0
- package/dist/chunk-SNIHUKDA.cjs +184 -0
- package/dist/chunk-T5FV5F7A.cjs +607 -0
- package/dist/chunk-TDTUAIFF.cjs +153 -0
- package/dist/chunk-TJ74XVZN.cjs +431 -0
- package/dist/chunk-TK44VBIE.cjs +194 -0
- package/dist/chunk-UAWBAD4E.cjs +346 -0
- package/dist/chunk-UFTCTTKK.js +381 -0
- package/dist/chunk-WDDXU3OH.cjs +67 -0
- package/dist/chunk-WFEMJCXO.cjs +13 -0
- package/dist/chunk-WHJTBTYM.js +0 -0
- package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
- package/dist/chunk-XFPQFCEK.js +455 -0
- package/dist/chunk-XSQPVDFH.cjs +60 -0
- package/dist/chunk-XTC2SLFT.js +153 -0
- package/dist/chunk-XV735BSA.cjs +366 -0
- package/dist/chunk-XWNG2U4K.cjs +124 -0
- package/dist/chunk-YGYYJ3LQ.js +314 -0
- package/dist/chunk-YVHT2UVW.js +74 -0
- package/dist/chunk-ZFOOJK37.cjs +86 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
- package/dist/components/accordion/index.cjs +35 -0
- package/dist/components/accordion/index.d.cts +299 -0
- package/dist/components/accordion/index.d.ts +299 -0
- package/dist/components/accordion/index.js +35 -0
- package/dist/components/alert/index.cjs +20 -0
- package/dist/components/alert/index.d.cts +169 -0
- package/dist/components/alert/index.d.ts +169 -0
- package/dist/components/alert/index.js +20 -0
- package/dist/components/avatar/index.cjs +16 -0
- package/dist/components/avatar/index.d.cts +131 -0
- package/dist/components/avatar/index.d.ts +131 -0
- package/dist/components/avatar/index.js +16 -0
- package/dist/components/badge/index.cjs +15 -0
- package/dist/components/badge/index.d.cts +157 -0
- package/dist/components/badge/index.d.ts +157 -0
- package/dist/components/badge/index.js +15 -0
- package/dist/components/button/index.cjs +22 -0
- package/dist/components/button/index.d.cts +613 -0
- package/dist/components/button/index.d.ts +613 -0
- package/dist/components/button/index.js +22 -0
- package/dist/components/card/index.cjs +22 -0
- package/dist/components/card/index.d.cts +620 -0
- package/dist/components/card/index.d.ts +620 -0
- package/dist/components/card/index.js +22 -0
- package/dist/components/checkbox/index.cjs +26 -0
- package/dist/components/checkbox/index.d.cts +1136 -0
- package/dist/components/checkbox/index.d.ts +1136 -0
- package/dist/components/checkbox/index.js +26 -0
- package/dist/components/chip/index.cjs +20 -0
- package/dist/components/chip/index.d.cts +608 -0
- package/dist/components/chip/index.d.ts +608 -0
- package/dist/components/chip/index.js +20 -0
- package/dist/components/divider/index.cjs +13 -0
- package/dist/components/divider/index.d.cts +117 -0
- package/dist/components/divider/index.d.ts +117 -0
- package/dist/components/divider/index.js +13 -0
- package/dist/components/field-group/index.cjs +27 -0
- package/dist/components/field-group/index.d.cts +270 -0
- package/dist/components/field-group/index.d.ts +270 -0
- package/dist/components/field-group/index.js +27 -0
- package/dist/components/input-otp/index.cjs +29 -0
- package/dist/components/input-otp/index.d.cts +325 -0
- package/dist/components/input-otp/index.d.ts +325 -0
- package/dist/components/input-otp/index.js +29 -0
- package/dist/components/menu/index.cjs +49 -0
- package/dist/components/menu/index.d.cts +351 -0
- package/dist/components/menu/index.d.ts +351 -0
- package/dist/components/menu/index.js +49 -0
- package/dist/components/popover/index.cjs +38 -0
- package/dist/components/popover/index.d.cts +254 -0
- package/dist/components/popover/index.d.ts +254 -0
- package/dist/components/popover/index.js +38 -0
- package/dist/components/radio/index.cjs +26 -0
- package/dist/components/radio/index.d.cts +1102 -0
- package/dist/components/radio/index.d.ts +1102 -0
- package/dist/components/radio/index.js +26 -0
- package/dist/components/select/index.cjs +50 -0
- package/dist/components/select/index.d.cts +498 -0
- package/dist/components/select/index.d.ts +498 -0
- package/dist/components/select/index.js +50 -0
- package/dist/components/skeleton/index.cjs +11 -0
- package/dist/components/skeleton/index.d.cts +111 -0
- package/dist/components/skeleton/index.d.ts +111 -0
- package/dist/components/skeleton/index.js +11 -0
- package/dist/components/spinner/index.cjs +17 -0
- package/dist/components/spinner/index.d.cts +104 -0
- package/dist/components/spinner/index.d.ts +104 -0
- package/dist/components/spinner/index.js +17 -0
- package/dist/components/switch/index.cjs +27 -0
- package/dist/components/switch/index.d.cts +1154 -0
- package/dist/components/switch/index.d.ts +1154 -0
- package/dist/components/switch/index.js +27 -0
- package/dist/components/text-area/index.cjs +14 -0
- package/dist/components/text-area/index.d.cts +73 -0
- package/dist/components/text-area/index.d.ts +73 -0
- package/dist/components/text-area/index.js +14 -0
- package/dist/components/text-field/index.cjs +25 -0
- package/dist/components/text-field/index.d.cts +205 -0
- package/dist/components/text-field/index.d.ts +205 -0
- package/dist/components/text-field/index.js +25 -0
- package/dist/components/typography/index.cjs +15 -0
- package/dist/components/typography/index.d.cts +116 -0
- package/dist/components/typography/index.d.ts +116 -0
- package/dist/components/typography/index.js +15 -0
- package/dist/components/view/index.cjs +17 -0
- package/dist/components/view/index.d.cts +152 -0
- package/dist/components/view/index.d.ts +152 -0
- package/dist/components/view/index.js +17 -0
- package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
- package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
- package/dist/icon.type-Kml72iSz.d.ts +73 -0
- package/dist/icon.type-d_i9ma-i.d.cts +73 -0
- package/dist/index.cjs +400 -4
- package/dist/index.d.cts +118 -4
- package/dist/index.d.ts +118 -4
- package/dist/index.js +423 -27
- package/dist/placement-DHa0Rrh1.d.cts +38 -0
- package/dist/placement-DHa0Rrh1.d.ts +38 -0
- package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
- package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
- package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
- package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
- package/dist/system/index.cjs +73 -4
- package/dist/system/index.d.cts +379 -193
- package/dist/system/index.d.ts +379 -193
- package/dist/system/index.js +87 -18
- package/dist/text-field.type-0l73acce.d.ts +167 -0
- package/dist/text-field.type-DBh06DU5.d.cts +167 -0
- package/dist/theme/index.cjs +5 -3
- package/dist/theme/index.d.cts +55 -24
- package/dist/theme/index.d.ts +55 -24
- package/dist/theme/index.js +4 -2
- package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
- package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
- package/package.json +254 -18
- package/dist/chunk-ECDWSSHJ.js +0 -688
- package/dist/chunk-IYFGO523.cjs +0 -688
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_native from 'react-native';
|
|
4
|
+
import { StyleProp, ViewStyle, TextStyle, ViewProps, TextProps } from 'react-native';
|
|
5
|
+
import { V as ViewStyleProps, T as TextStyleProps } from '../../style-props.type-CfnoGEP7.js';
|
|
6
|
+
import { S as Size, R as RadiusKey, X as XAUITheme } from '../../theme.type-C2gNHpEx.js';
|
|
7
|
+
import { I as IconContextValue, a as IconProps } from '../../icon.type-Kml72iSz.js';
|
|
8
|
+
import { C as CloseButtonProps } from '../../close-button.type-BUYuoSt2.js';
|
|
9
|
+
import { R as Recipe, S as SlotStyles, a as StyleFn } from '../../create-recipe-BdVd2ffi.js';
|
|
10
|
+
import '../../pressable-feedback.type-Bs4dQlGj.js';
|
|
11
|
+
import 'react-native-reanimated';
|
|
12
|
+
|
|
13
|
+
type AlertSlot = 'root' | 'icon' | 'iconGlyph' | 'content' | 'title' | 'description' | 'close' | 'closeGlyph';
|
|
14
|
+
/**
|
|
15
|
+
* Nine names: the surface, the accent in two weights, and the three status families in
|
|
16
|
+
* theirs. An alert is the one component in the library that is **both** a surface and a
|
|
17
|
+
* report, so it takes the emphasis vocabulary of the `Card` for its neutral level and the
|
|
18
|
+
* status vocabulary of the `Chip` for the rest.
|
|
19
|
+
*
|
|
20
|
+
* - **`default`** — the `surface` fill and the surface shadow, exactly the `Card`'s
|
|
21
|
+
* `default`. This is HeroUI's alert: a neutral card, with the status carried by the icon
|
|
22
|
+
* rather than by the background.
|
|
23
|
+
* - **`primary` / `secondary`** — the full accent and its soft slice, for the
|
|
24
|
+
* informational alert that is not an outcome.
|
|
25
|
+
* - **`success` / `warning` / `danger`**, each with a `-soft` slice — the tinted surface
|
|
26
|
+
* most alerts want, and the solid fill for the banner that has to stop the reader.
|
|
27
|
+
*
|
|
28
|
+
* `tertiary` and `ghost` are absent: an alert without a surface is a paragraph, and the
|
|
29
|
+
* outline case is `default` with `borderWidth` and `borderColor` as style props (R14).
|
|
30
|
+
*/
|
|
31
|
+
type AlertVariant = 'default' | 'primary' | 'secondary' | 'success' | 'success-soft' | 'warning' | 'warning-soft' | 'danger' | 'danger-soft';
|
|
32
|
+
type AlertSize = Size;
|
|
33
|
+
/**
|
|
34
|
+
* What the `Alert` itself understands. R14 — a name in here is the component's, so the
|
|
35
|
+
* style prop that shares it is not exposed: `size` is the alert's scale and never
|
|
36
|
+
* `ViewStyle`'s, and `color` is R7's tint.
|
|
37
|
+
*/
|
|
38
|
+
type AlertOwnProps = {
|
|
39
|
+
variant?: AlertVariant;
|
|
40
|
+
/**
|
|
41
|
+
* Padding, gaps, radius and the type of `Title` and `Description`. **Never a height**:
|
|
42
|
+
* an alert is a surface, and it is as tall as the message it carries.
|
|
43
|
+
*/
|
|
44
|
+
size?: AlertSize;
|
|
45
|
+
/** Overrides the radius `size` chose. */
|
|
46
|
+
radius?: RadiusKey;
|
|
47
|
+
/**
|
|
48
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). It paints the fill and, through its
|
|
49
|
+
* OKLab-contrasted slice, the title and the icon — so a brand-coloured alert stays
|
|
50
|
+
* readable without being told a second colour.
|
|
51
|
+
*/
|
|
52
|
+
color?: string;
|
|
53
|
+
/** Dims the alert, and reaches the close inside it. */
|
|
54
|
+
isDisabled?: boolean;
|
|
55
|
+
style?: StyleProp<ViewStyle>;
|
|
56
|
+
children?: ReactNode;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* R14 — the alert's own props, `View`'s, and every `ViewStyle` key neither already
|
|
60
|
+
* claims. There is no press behaviour here, deliberately: an alert reports, it is not a
|
|
61
|
+
* control. A dismissible one carries an `Alert.Close`, which is the control.
|
|
62
|
+
*/
|
|
63
|
+
type AlertProps = AlertOwnProps & Omit<ViewProps, keyof AlertOwnProps> & Omit<ViewStyleProps, keyof AlertOwnProps | keyof ViewProps> & {
|
|
64
|
+
/** R12 — merge into the single child instead of rendering a `View`. */
|
|
65
|
+
asChild?: boolean;
|
|
66
|
+
};
|
|
67
|
+
/** `View`'s own props win over the `ViewStyle` keys of the same name (R14). */
|
|
68
|
+
type AlertContentProps = ViewProps & Omit<ViewStyleProps, keyof ViewProps> & {
|
|
69
|
+
children?: ReactNode;
|
|
70
|
+
};
|
|
71
|
+
/** `Text`'s own props win over the `TextStyle` keys of the same name (R14). */
|
|
72
|
+
type AlertTextProps = TextProps & Omit<TextStyleProps, keyof TextProps> & {
|
|
73
|
+
children?: ReactNode;
|
|
74
|
+
};
|
|
75
|
+
type AlertTitleProps = AlertTextProps;
|
|
76
|
+
type AlertDescriptionProps = AlertTextProps;
|
|
77
|
+
/**
|
|
78
|
+
* `Icon`'s three forms, plus the `ViewStyle` keys of the box around them (R14).
|
|
79
|
+
*
|
|
80
|
+
* Unlike `Button.Icon` and `Chip.Icon`, this slot **renders a view of its own**. It has
|
|
81
|
+
* to: an alert's icon sits beside a block of text rather than on one line with it, and
|
|
82
|
+
* lining the glyph up with the first line's cap-height means offsetting it by half the
|
|
83
|
+
* leading — which needs a node. That node is also what lets the slot carry style props at
|
|
84
|
+
* all, which the other two cannot.
|
|
85
|
+
*/
|
|
86
|
+
type AlertIconGlyphKey = 'as' | 'children' | 'source' | 'size' | 'color';
|
|
87
|
+
/**
|
|
88
|
+
* `Pick`, distributed over `Icon`'s three forms rather than applied to the union as a
|
|
89
|
+
* whole. Applied as a whole it merges them into one shape where `as` and `source` are both
|
|
90
|
+
* optional — which is the boundary `IconProps` was turned into a union to keep, so
|
|
91
|
+
* `<Alert.Icon as={Check} source={png} />` would compile again and one of the two would be
|
|
92
|
+
* silently dropped.
|
|
93
|
+
*/
|
|
94
|
+
type AlertIconGlyphProps<T = IconProps> = T extends IconProps ? Pick<T, AlertIconGlyphKey> : never;
|
|
95
|
+
type AlertIconBoxProps = {
|
|
96
|
+
/** The box, not the glyph — `size` and `color` are what shape the icon itself. */
|
|
97
|
+
style?: StyleProp<ViewStyle>;
|
|
98
|
+
} & Omit<ViewStyleProps, AlertIconGlyphKey | 'style'>;
|
|
99
|
+
type AlertIconProps = AlertIconGlyphProps & AlertIconBoxProps;
|
|
100
|
+
/**
|
|
101
|
+
* Everything the shared `CloseButton` accepts, minus the three the alert supplies itself:
|
|
102
|
+
* the warning's name and the two resolved styles its recipe already decided (R5).
|
|
103
|
+
*/
|
|
104
|
+
type AlertCloseProps = Omit<CloseButtonProps, 'name' | 'baseStyle' | 'glyphStyle'>;
|
|
105
|
+
/**
|
|
106
|
+
* R5 — resolved styles, not props for a slot to resolve a second time. Each entry is the
|
|
107
|
+
* cached `StyleSheet` reference with the uncached tint pass layered over it, so a slot
|
|
108
|
+
* merges its own `style` on top and does no work of its own.
|
|
109
|
+
*/
|
|
110
|
+
type AlertContextValue = {
|
|
111
|
+
iconStyle: StyleProp<ViewStyle>;
|
|
112
|
+
contentStyle: StyleProp<ViewStyle>;
|
|
113
|
+
titleStyle: StyleProp<TextStyle>;
|
|
114
|
+
descriptionStyle: StyleProp<TextStyle>;
|
|
115
|
+
closeStyle: StyleProp<ViewStyle>;
|
|
116
|
+
closeGlyphStyle: StyleProp<ViewStyle>;
|
|
117
|
+
/**
|
|
118
|
+
* Values, not a style: `Icon` hands `size` and `color` to a third-party component, so
|
|
119
|
+
* the root flattens its icon slot once here rather than in every icon it contains.
|
|
120
|
+
*/
|
|
121
|
+
icon: IconContextValue;
|
|
122
|
+
isDisabled: boolean;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
declare const useAlert: () => AlertContextValue;
|
|
126
|
+
|
|
127
|
+
declare const alertRecipe: Recipe<"title" | "root" | "content" | "description" | "icon" | "iconGlyph" | "close" | "closeGlyph", AlertVariant, {
|
|
128
|
+
readonly size: {
|
|
129
|
+
readonly xs: (theme: XAUITheme) => SlotStyles<AlertSlot>;
|
|
130
|
+
readonly sm: (theme: XAUITheme) => SlotStyles<AlertSlot>;
|
|
131
|
+
readonly md: (theme: XAUITheme) => SlotStyles<AlertSlot>;
|
|
132
|
+
readonly lg: (theme: XAUITheme) => SlotStyles<AlertSlot>;
|
|
133
|
+
};
|
|
134
|
+
readonly radius: Record<RadiusKey, StyleFn<"root">>;
|
|
135
|
+
}>;
|
|
136
|
+
|
|
137
|
+
declare const Alert: react.ForwardRefExoticComponent<{
|
|
138
|
+
variant?: AlertVariant;
|
|
139
|
+
size?: AlertSize;
|
|
140
|
+
radius?: RadiusKey;
|
|
141
|
+
color?: string;
|
|
142
|
+
isDisabled?: boolean;
|
|
143
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
144
|
+
children?: react.ReactNode;
|
|
145
|
+
} & Omit<react_native.ViewProps, keyof {
|
|
146
|
+
variant?: AlertVariant;
|
|
147
|
+
size?: AlertSize;
|
|
148
|
+
radius?: RadiusKey;
|
|
149
|
+
color?: string;
|
|
150
|
+
isDisabled?: boolean;
|
|
151
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
152
|
+
children?: react.ReactNode;
|
|
153
|
+
}> & Omit<ViewStyleProps, "color" | "pointerEvents" | "style" | "children" | "size" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "variant" | "radius" | "isDisabled"> & {
|
|
154
|
+
asChild?: boolean;
|
|
155
|
+
} & react.RefAttributes<react_native.View>> & {
|
|
156
|
+
Icon: react.ForwardRefExoticComponent<AlertIconProps & react.RefAttributes<react_native.View>>;
|
|
157
|
+
Content: react.ForwardRefExoticComponent<react_native.ViewProps & Omit<ViewStyleProps, keyof react_native.ViewProps> & {
|
|
158
|
+
children?: react.ReactNode;
|
|
159
|
+
} & react.RefAttributes<react_native.View>>;
|
|
160
|
+
Title: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
161
|
+
children?: react.ReactNode;
|
|
162
|
+
} & react.RefAttributes<react_native.Text>>;
|
|
163
|
+
Description: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
164
|
+
children?: react.ReactNode;
|
|
165
|
+
} & react.RefAttributes<react_native.Text>>;
|
|
166
|
+
Close: react.ForwardRefExoticComponent<AlertCloseProps & react.RefAttributes<react_native.View>>;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export { Alert, type AlertCloseProps, type AlertContentProps, type AlertContextValue, type AlertDescriptionProps, type AlertIconProps, type AlertProps, type AlertSize, type AlertSlot, type AlertTitleProps, type AlertVariant, alertRecipe, useAlert };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Alert,
|
|
3
|
+
alertRecipe,
|
|
4
|
+
useAlert
|
|
5
|
+
} from "../../chunk-DD4276RF.js";
|
|
6
|
+
import "../../chunk-KCMYU7WF.js";
|
|
7
|
+
import "../../chunk-FHUYHV6J.js";
|
|
8
|
+
import "../../chunk-6UEZJRVI.js";
|
|
9
|
+
import "../../chunk-423RQBOX.js";
|
|
10
|
+
import "../../chunk-EGLLDKN6.js";
|
|
11
|
+
import "../../chunk-4GTAZM2C.js";
|
|
12
|
+
import "../../chunk-A3EGFI6T.js";
|
|
13
|
+
import "../../chunk-K72UDPVN.js";
|
|
14
|
+
import "../../chunk-36PRYGAM.js";
|
|
15
|
+
import "../../chunk-M63GFNKV.js";
|
|
16
|
+
export {
|
|
17
|
+
Alert,
|
|
18
|
+
alertRecipe,
|
|
19
|
+
useAlert
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkNWGLP6JXcjs = require('../../chunk-NWGLP6JX.cjs');
|
|
6
|
+
require('../../chunk-4KFKWBN5.cjs');
|
|
7
|
+
require('../../chunk-FNEUOBCV.cjs');
|
|
8
|
+
require('../../chunk-57SJ4LJF.cjs');
|
|
9
|
+
require('../../chunk-7GHM4GKL.cjs');
|
|
10
|
+
require('../../chunk-H4E4HDEP.cjs');
|
|
11
|
+
require('../../chunk-TK44VBIE.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.Avatar = _chunkNWGLP6JXcjs.Avatar; exports.avatarRecipe = _chunkNWGLP6JXcjs.avatarRecipe; exports.useAvatar = _chunkNWGLP6JXcjs.useAvatar;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_native from 'react-native';
|
|
4
|
+
import { StyleProp, ViewStyle, TextStyle, ViewProps, ImageProps, ImageStyle, TextProps } from 'react-native';
|
|
5
|
+
import { V as ViewStyleProps, I as ImageStyleProps, T as TextStyleProps } from '../../style-props.type-CfnoGEP7.cjs';
|
|
6
|
+
import { S as Size, R as RadiusKey, X as XAUITheme } from '../../theme.type-C2gNHpEx.cjs';
|
|
7
|
+
import { I as IconContextValue } from '../../icon.type-d_i9ma-i.cjs';
|
|
8
|
+
import { R as Recipe, S as SlotStyles, a as StyleFn } from '../../create-recipe-dC7wMfnj.cjs';
|
|
9
|
+
|
|
10
|
+
type AvatarSlot = 'root' | 'fallback' | 'initials' | 'icon';
|
|
11
|
+
/**
|
|
12
|
+
* The full vocabulary (§1 bis), and the `Chip`'s eleven names exactly — an avatar is a
|
|
13
|
+
* token *about* a person or a thing, which is the category the `Chip` established, so a
|
|
14
|
+
* name means here what it means there.
|
|
15
|
+
*
|
|
16
|
+
* They colour the **frame**, which is all that shows when there is no image: `primary` is
|
|
17
|
+
* the accent fill with its contrasted initials, `secondary` the soft slice, `tertiary` a
|
|
18
|
+
* border and nothing else. The three status families are here because an avatar reports as
|
|
19
|
+
* often as it identifies — a red frame for the account that failed to sync, a green one for
|
|
20
|
+
* the person who is online.
|
|
21
|
+
*
|
|
22
|
+
* It is HeroUI's `variant × color` matrix said once: their `default` is this `default`, and
|
|
23
|
+
* their `soft` crossed with five colours is `secondary` plus the five `-soft` names.
|
|
24
|
+
*/
|
|
25
|
+
type AvatarVariant = 'primary' | 'secondary' | 'default' | 'tertiary' | 'ghost' | 'success' | 'success-soft' | 'warning' | 'warning-soft' | 'danger' | 'danger-soft';
|
|
26
|
+
type AvatarSize = Size;
|
|
27
|
+
/**
|
|
28
|
+
* What the `Avatar` itself understands. R14 — a name in here is the component's, so the
|
|
29
|
+
* style prop that shares it is not exposed: `size` is the avatar's diameter and never
|
|
30
|
+
* `ViewStyle`'s, and `color` is R7's tint.
|
|
31
|
+
*/
|
|
32
|
+
type AvatarOwnProps = {
|
|
33
|
+
variant?: AvatarVariant;
|
|
34
|
+
/** The diameter, and the type inside it. It sets both sides, never a width alone. */
|
|
35
|
+
size?: AvatarSize;
|
|
36
|
+
/**
|
|
37
|
+
* Overrides the circle. An avatar is round at every size — that is the shape the name
|
|
38
|
+
* means — so this is the prop for the logo or the cover that wants a square.
|
|
39
|
+
*/
|
|
40
|
+
radius?: RadiusKey;
|
|
41
|
+
/**
|
|
42
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). Where it lands follows the variant: the
|
|
43
|
+
* fill of a `primary`, the border of a `tertiary`, the initials of a `ghost`. Its
|
|
44
|
+
* contrasted and soft slices are derived in OKLab, so it behaves exactly like `accent` —
|
|
45
|
+
* which is also why it must be a hex value.
|
|
46
|
+
*/
|
|
47
|
+
color?: string;
|
|
48
|
+
/** R12 — the child element becomes the frame and keeps this variant's style. */
|
|
49
|
+
asChild?: boolean;
|
|
50
|
+
style?: StyleProp<ViewStyle>;
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
};
|
|
53
|
+
type AvatarProps = Omit<ViewProps, 'style'> & AvatarOwnProps & Omit<ViewStyleProps, keyof AvatarOwnProps | keyof ViewProps>;
|
|
54
|
+
type AvatarImageOwnProps = {
|
|
55
|
+
/**
|
|
56
|
+
* `false` shows the image the moment it decodes, with no fade. The frame does not change
|
|
57
|
+
* either way, so a list switched off with this does not reflow.
|
|
58
|
+
*/
|
|
59
|
+
animation?: boolean;
|
|
60
|
+
style?: StyleProp<ImageStyle>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* `Image`'s own props win over the `ImageStyle` keys of the same name (R14). `source`
|
|
64
|
+
* stays required, as `Image` declares it: an `Avatar.Image` with nothing to show is an
|
|
65
|
+
* `Avatar.Fallback`.
|
|
66
|
+
*/
|
|
67
|
+
type AvatarImageProps = Omit<ImageProps, 'style'> & AvatarImageOwnProps & Omit<ImageStyleProps, keyof AvatarImageOwnProps | keyof ImageProps>;
|
|
68
|
+
type AvatarFallbackOwnProps = {
|
|
69
|
+
/**
|
|
70
|
+
* Initials, an `Icon`, anything. A stringifiable tree becomes `Avatar.Initials` (R3); an
|
|
71
|
+
* element is centred and left alone — and an `Icon` among them needs no props, because
|
|
72
|
+
* the fallback publishes the frame's size and colour to it.
|
|
73
|
+
*/
|
|
74
|
+
children?: ReactNode;
|
|
75
|
+
style?: StyleProp<ViewStyle>;
|
|
76
|
+
};
|
|
77
|
+
type AvatarFallbackProps = Omit<ViewProps, 'style'> & AvatarFallbackOwnProps & Omit<ViewStyleProps, keyof AvatarFallbackOwnProps | keyof ViewProps>;
|
|
78
|
+
/** `Text`'s own props win over the `TextStyle` keys of the same name (R14). */
|
|
79
|
+
type AvatarInitialsProps = TextProps & Omit<TextStyleProps, keyof TextProps> & {
|
|
80
|
+
children?: ReactNode;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* R5 — resolved styles, not props for a slot to resolve a second time. Each entry is the
|
|
84
|
+
* cached `StyleSheet` reference with the uncached tint pass layered over it, so a slot
|
|
85
|
+
* merges its own `style` on top and does no work of its own.
|
|
86
|
+
*/
|
|
87
|
+
type AvatarContextValue = {
|
|
88
|
+
fallbackStyle: StyleProp<ViewStyle>;
|
|
89
|
+
initialsStyle: StyleProp<TextStyle>;
|
|
90
|
+
/**
|
|
91
|
+
* Values, not a style: `Icon` hands `size` and `color` to a third-party component, so
|
|
92
|
+
* the root flattens its icon slot once here rather than in every icon it contains.
|
|
93
|
+
*/
|
|
94
|
+
icon: IconContextValue;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
declare const useAvatar: () => AvatarContextValue;
|
|
98
|
+
|
|
99
|
+
declare const avatarRecipe: Recipe<"root" | "icon" | "fallback" | "initials", AvatarVariant, {
|
|
100
|
+
readonly size: {
|
|
101
|
+
readonly xs: (theme: XAUITheme) => SlotStyles<AvatarSlot>;
|
|
102
|
+
readonly sm: (theme: XAUITheme) => SlotStyles<AvatarSlot>;
|
|
103
|
+
readonly md: (theme: XAUITheme) => SlotStyles<AvatarSlot>;
|
|
104
|
+
readonly lg: (theme: XAUITheme) => SlotStyles<AvatarSlot>;
|
|
105
|
+
};
|
|
106
|
+
readonly radius: Record<RadiusKey, StyleFn<AvatarSlot>>;
|
|
107
|
+
}>;
|
|
108
|
+
|
|
109
|
+
declare const Avatar: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
110
|
+
variant?: AvatarVariant;
|
|
111
|
+
size?: AvatarSize;
|
|
112
|
+
radius?: RadiusKey;
|
|
113
|
+
color?: string;
|
|
114
|
+
asChild?: boolean;
|
|
115
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
116
|
+
children?: react.ReactNode;
|
|
117
|
+
} & Omit<ViewStyleProps, "color" | "pointerEvents" | "style" | "children" | "size" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "variant" | "radius" | "asChild"> & react.RefAttributes<react_native.View>> & {
|
|
118
|
+
Image: react.ForwardRefExoticComponent<Omit<react_native.ImageProps, "style"> & {
|
|
119
|
+
animation?: boolean;
|
|
120
|
+
style?: react_native.StyleProp<react_native.ImageStyle>;
|
|
121
|
+
} & Omit<ImageStyleProps, "height" | "width" | "borderRadius" | "resizeMode" | "tintColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "style" | "source" | "id" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "onError" | "onLoad" | "onLoadEnd" | "onLoadStart" | "progressiveRenderingEnabled" | "src" | "srcSet" | "loadingIndicatorSource" | "defaultSource" | "alt" | "crossOrigin" | "referrerPolicy" | "blurRadius" | "capInsets" | "onProgress" | "onPartialLoad" | "resizeMethod" | "fadeDuration" | "animation"> & react.RefAttributes<react_native.Image>>;
|
|
122
|
+
Fallback: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
123
|
+
children?: react.ReactNode;
|
|
124
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
125
|
+
} & Omit<ViewStyleProps, "pointerEvents" | "style" | "children" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction"> & react.RefAttributes<react_native.View>>;
|
|
126
|
+
Initials: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
127
|
+
children?: react.ReactNode;
|
|
128
|
+
} & react.RefAttributes<react_native.Text>>;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export { Avatar, type AvatarContextValue, type AvatarFallbackProps, type AvatarImageProps, type AvatarInitialsProps, type AvatarProps, type AvatarSize, type AvatarSlot, type AvatarVariant, avatarRecipe, useAvatar };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_native from 'react-native';
|
|
4
|
+
import { StyleProp, ViewStyle, TextStyle, ViewProps, ImageProps, ImageStyle, TextProps } from 'react-native';
|
|
5
|
+
import { V as ViewStyleProps, I as ImageStyleProps, T as TextStyleProps } from '../../style-props.type-CfnoGEP7.js';
|
|
6
|
+
import { S as Size, R as RadiusKey, X as XAUITheme } from '../../theme.type-C2gNHpEx.js';
|
|
7
|
+
import { I as IconContextValue } from '../../icon.type-Kml72iSz.js';
|
|
8
|
+
import { R as Recipe, S as SlotStyles, a as StyleFn } from '../../create-recipe-BdVd2ffi.js';
|
|
9
|
+
|
|
10
|
+
type AvatarSlot = 'root' | 'fallback' | 'initials' | 'icon';
|
|
11
|
+
/**
|
|
12
|
+
* The full vocabulary (§1 bis), and the `Chip`'s eleven names exactly — an avatar is a
|
|
13
|
+
* token *about* a person or a thing, which is the category the `Chip` established, so a
|
|
14
|
+
* name means here what it means there.
|
|
15
|
+
*
|
|
16
|
+
* They colour the **frame**, which is all that shows when there is no image: `primary` is
|
|
17
|
+
* the accent fill with its contrasted initials, `secondary` the soft slice, `tertiary` a
|
|
18
|
+
* border and nothing else. The three status families are here because an avatar reports as
|
|
19
|
+
* often as it identifies — a red frame for the account that failed to sync, a green one for
|
|
20
|
+
* the person who is online.
|
|
21
|
+
*
|
|
22
|
+
* It is HeroUI's `variant × color` matrix said once: their `default` is this `default`, and
|
|
23
|
+
* their `soft` crossed with five colours is `secondary` plus the five `-soft` names.
|
|
24
|
+
*/
|
|
25
|
+
type AvatarVariant = 'primary' | 'secondary' | 'default' | 'tertiary' | 'ghost' | 'success' | 'success-soft' | 'warning' | 'warning-soft' | 'danger' | 'danger-soft';
|
|
26
|
+
type AvatarSize = Size;
|
|
27
|
+
/**
|
|
28
|
+
* What the `Avatar` itself understands. R14 — a name in here is the component's, so the
|
|
29
|
+
* style prop that shares it is not exposed: `size` is the avatar's diameter and never
|
|
30
|
+
* `ViewStyle`'s, and `color` is R7's tint.
|
|
31
|
+
*/
|
|
32
|
+
type AvatarOwnProps = {
|
|
33
|
+
variant?: AvatarVariant;
|
|
34
|
+
/** The diameter, and the type inside it. It sets both sides, never a width alone. */
|
|
35
|
+
size?: AvatarSize;
|
|
36
|
+
/**
|
|
37
|
+
* Overrides the circle. An avatar is round at every size — that is the shape the name
|
|
38
|
+
* means — so this is the prop for the logo or the cover that wants a square.
|
|
39
|
+
*/
|
|
40
|
+
radius?: RadiusKey;
|
|
41
|
+
/**
|
|
42
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). Where it lands follows the variant: the
|
|
43
|
+
* fill of a `primary`, the border of a `tertiary`, the initials of a `ghost`. Its
|
|
44
|
+
* contrasted and soft slices are derived in OKLab, so it behaves exactly like `accent` —
|
|
45
|
+
* which is also why it must be a hex value.
|
|
46
|
+
*/
|
|
47
|
+
color?: string;
|
|
48
|
+
/** R12 — the child element becomes the frame and keeps this variant's style. */
|
|
49
|
+
asChild?: boolean;
|
|
50
|
+
style?: StyleProp<ViewStyle>;
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
};
|
|
53
|
+
type AvatarProps = Omit<ViewProps, 'style'> & AvatarOwnProps & Omit<ViewStyleProps, keyof AvatarOwnProps | keyof ViewProps>;
|
|
54
|
+
type AvatarImageOwnProps = {
|
|
55
|
+
/**
|
|
56
|
+
* `false` shows the image the moment it decodes, with no fade. The frame does not change
|
|
57
|
+
* either way, so a list switched off with this does not reflow.
|
|
58
|
+
*/
|
|
59
|
+
animation?: boolean;
|
|
60
|
+
style?: StyleProp<ImageStyle>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* `Image`'s own props win over the `ImageStyle` keys of the same name (R14). `source`
|
|
64
|
+
* stays required, as `Image` declares it: an `Avatar.Image` with nothing to show is an
|
|
65
|
+
* `Avatar.Fallback`.
|
|
66
|
+
*/
|
|
67
|
+
type AvatarImageProps = Omit<ImageProps, 'style'> & AvatarImageOwnProps & Omit<ImageStyleProps, keyof AvatarImageOwnProps | keyof ImageProps>;
|
|
68
|
+
type AvatarFallbackOwnProps = {
|
|
69
|
+
/**
|
|
70
|
+
* Initials, an `Icon`, anything. A stringifiable tree becomes `Avatar.Initials` (R3); an
|
|
71
|
+
* element is centred and left alone — and an `Icon` among them needs no props, because
|
|
72
|
+
* the fallback publishes the frame's size and colour to it.
|
|
73
|
+
*/
|
|
74
|
+
children?: ReactNode;
|
|
75
|
+
style?: StyleProp<ViewStyle>;
|
|
76
|
+
};
|
|
77
|
+
type AvatarFallbackProps = Omit<ViewProps, 'style'> & AvatarFallbackOwnProps & Omit<ViewStyleProps, keyof AvatarFallbackOwnProps | keyof ViewProps>;
|
|
78
|
+
/** `Text`'s own props win over the `TextStyle` keys of the same name (R14). */
|
|
79
|
+
type AvatarInitialsProps = TextProps & Omit<TextStyleProps, keyof TextProps> & {
|
|
80
|
+
children?: ReactNode;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* R5 — resolved styles, not props for a slot to resolve a second time. Each entry is the
|
|
84
|
+
* cached `StyleSheet` reference with the uncached tint pass layered over it, so a slot
|
|
85
|
+
* merges its own `style` on top and does no work of its own.
|
|
86
|
+
*/
|
|
87
|
+
type AvatarContextValue = {
|
|
88
|
+
fallbackStyle: StyleProp<ViewStyle>;
|
|
89
|
+
initialsStyle: StyleProp<TextStyle>;
|
|
90
|
+
/**
|
|
91
|
+
* Values, not a style: `Icon` hands `size` and `color` to a third-party component, so
|
|
92
|
+
* the root flattens its icon slot once here rather than in every icon it contains.
|
|
93
|
+
*/
|
|
94
|
+
icon: IconContextValue;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
declare const useAvatar: () => AvatarContextValue;
|
|
98
|
+
|
|
99
|
+
declare const avatarRecipe: Recipe<"root" | "icon" | "fallback" | "initials", AvatarVariant, {
|
|
100
|
+
readonly size: {
|
|
101
|
+
readonly xs: (theme: XAUITheme) => SlotStyles<AvatarSlot>;
|
|
102
|
+
readonly sm: (theme: XAUITheme) => SlotStyles<AvatarSlot>;
|
|
103
|
+
readonly md: (theme: XAUITheme) => SlotStyles<AvatarSlot>;
|
|
104
|
+
readonly lg: (theme: XAUITheme) => SlotStyles<AvatarSlot>;
|
|
105
|
+
};
|
|
106
|
+
readonly radius: Record<RadiusKey, StyleFn<AvatarSlot>>;
|
|
107
|
+
}>;
|
|
108
|
+
|
|
109
|
+
declare const Avatar: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
110
|
+
variant?: AvatarVariant;
|
|
111
|
+
size?: AvatarSize;
|
|
112
|
+
radius?: RadiusKey;
|
|
113
|
+
color?: string;
|
|
114
|
+
asChild?: boolean;
|
|
115
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
116
|
+
children?: react.ReactNode;
|
|
117
|
+
} & Omit<ViewStyleProps, "color" | "pointerEvents" | "style" | "children" | "size" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "variant" | "radius" | "asChild"> & react.RefAttributes<react_native.View>> & {
|
|
118
|
+
Image: react.ForwardRefExoticComponent<Omit<react_native.ImageProps, "style"> & {
|
|
119
|
+
animation?: boolean;
|
|
120
|
+
style?: react_native.StyleProp<react_native.ImageStyle>;
|
|
121
|
+
} & Omit<ImageStyleProps, "height" | "width" | "borderRadius" | "resizeMode" | "tintColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "style" | "source" | "id" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "onError" | "onLoad" | "onLoadEnd" | "onLoadStart" | "progressiveRenderingEnabled" | "src" | "srcSet" | "loadingIndicatorSource" | "defaultSource" | "alt" | "crossOrigin" | "referrerPolicy" | "blurRadius" | "capInsets" | "onProgress" | "onPartialLoad" | "resizeMethod" | "fadeDuration" | "animation"> & react.RefAttributes<react_native.Image>>;
|
|
122
|
+
Fallback: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
123
|
+
children?: react.ReactNode;
|
|
124
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
125
|
+
} & Omit<ViewStyleProps, "pointerEvents" | "style" | "children" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction"> & react.RefAttributes<react_native.View>>;
|
|
126
|
+
Initials: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
127
|
+
children?: react.ReactNode;
|
|
128
|
+
} & react.RefAttributes<react_native.Text>>;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export { Avatar, type AvatarContextValue, type AvatarFallbackProps, type AvatarImageProps, type AvatarInitialsProps, type AvatarProps, type AvatarSize, type AvatarSlot, type AvatarVariant, avatarRecipe, useAvatar };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Avatar,
|
|
3
|
+
avatarRecipe,
|
|
4
|
+
useAvatar
|
|
5
|
+
} from "../../chunk-UFTCTTKK.js";
|
|
6
|
+
import "../../chunk-FHUYHV6J.js";
|
|
7
|
+
import "../../chunk-4GTAZM2C.js";
|
|
8
|
+
import "../../chunk-A3EGFI6T.js";
|
|
9
|
+
import "../../chunk-K72UDPVN.js";
|
|
10
|
+
import "../../chunk-36PRYGAM.js";
|
|
11
|
+
import "../../chunk-M63GFNKV.js";
|
|
12
|
+
export {
|
|
13
|
+
Avatar,
|
|
14
|
+
avatarRecipe,
|
|
15
|
+
useAvatar
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkHDVVZG4Scjs = require('../../chunk-HDVVZG4S.cjs');
|
|
6
|
+
require('../../chunk-FNEUOBCV.cjs');
|
|
7
|
+
require('../../chunk-57SJ4LJF.cjs');
|
|
8
|
+
require('../../chunk-7GHM4GKL.cjs');
|
|
9
|
+
require('../../chunk-H4E4HDEP.cjs');
|
|
10
|
+
require('../../chunk-TK44VBIE.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.Badge = _chunkHDVVZG4Scjs.Badge; exports.badgeRecipe = _chunkHDVVZG4Scjs.badgeRecipe; exports.placementInsets = _chunkHDVVZG4Scjs.placementInsets;
|