@xaui/native 0.9.1-alpha.33 → 0.9.1-alpha.34
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-DUQUCOUY.cjs +198 -0
- package/dist/chunk-LZK77LFX.js +198 -0
- package/dist/components/badge/index.cjs +16 -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 +16 -0
- package/dist/index.cjs +21 -13
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +26 -18
- package/package.json +11 -1
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk54FJOKANcjs = require('./chunk-54FJOKAN.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkI6ZB3FZIcjs = require('./chunk-I6ZB3FZI.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
15
|
+
|
|
16
|
+
// src/components/badge/badge.tsx
|
|
17
|
+
var _react = require('react');
|
|
18
|
+
var _reactnative = require('react-native');
|
|
19
|
+
|
|
20
|
+
// src/components/badge/badge.recipe.ts
|
|
21
|
+
var SLOTS = ["root", "label"];
|
|
22
|
+
var VARIANT_TOKENS = {
|
|
23
|
+
primary: { bg: "accent", fg: "accentForeground" },
|
|
24
|
+
secondary: { bg: "accentSoft", fg: "accentSoftForeground" },
|
|
25
|
+
default: { bg: "default", fg: "defaultForeground" },
|
|
26
|
+
tertiary: { border: "border", fg: "foreground" },
|
|
27
|
+
ghost: { fg: "foreground" },
|
|
28
|
+
success: { bg: "success", fg: "successForeground" },
|
|
29
|
+
"success-soft": { bg: "successSoft", fg: "successSoftForeground" },
|
|
30
|
+
warning: { bg: "warning", fg: "warningForeground" },
|
|
31
|
+
"warning-soft": { bg: "warningSoft", fg: "warningSoftForeground" },
|
|
32
|
+
danger: { bg: "danger", fg: "dangerForeground" },
|
|
33
|
+
"danger-soft": { bg: "dangerSoft", fg: "dangerSoftForeground" }
|
|
34
|
+
};
|
|
35
|
+
function sizeAxis(step) {
|
|
36
|
+
return (theme) => {
|
|
37
|
+
const height = theme.spacing(step.height);
|
|
38
|
+
return {
|
|
39
|
+
root: {
|
|
40
|
+
height,
|
|
41
|
+
minWidth: height,
|
|
42
|
+
paddingHorizontal: theme.spacing(step.padding)
|
|
43
|
+
},
|
|
44
|
+
label: { fontSize: theme.fontSizes[step.label] }
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function dotAxis(diameter) {
|
|
49
|
+
return (theme) => {
|
|
50
|
+
const size = theme.spacing(diameter);
|
|
51
|
+
return {
|
|
52
|
+
root: { height: size, width: size, minWidth: size, paddingHorizontal: 0 }
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var BADGE_DEFAULT_SIZE = "md";
|
|
57
|
+
var SIZES = {
|
|
58
|
+
xs: { height: 4, padding: 1.25, label: "xs", dot: 1.5 },
|
|
59
|
+
sm: { height: 4.5, padding: 1.5, label: "xs", dot: 2 },
|
|
60
|
+
md: { height: 5, padding: 1.5, label: "xs", dot: 2.5 },
|
|
61
|
+
lg: { height: 6, padding: 2, label: "sm", dot: 3 }
|
|
62
|
+
};
|
|
63
|
+
function badgeOffset(theme, size, isDot) {
|
|
64
|
+
const step = SIZES[size];
|
|
65
|
+
return theme.spacing(isDot ? step.dot : step.height) / 2;
|
|
66
|
+
}
|
|
67
|
+
var badgeRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
|
|
68
|
+
slots: SLOTS,
|
|
69
|
+
base: (theme) => ({
|
|
70
|
+
root: {
|
|
71
|
+
flexDirection: "row",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
justifyContent: "center",
|
|
74
|
+
borderWidth: 0,
|
|
75
|
+
// The capsule at every size, which is what makes a two-digit count read as one
|
|
76
|
+
// object. `radius` is still there for the square marker.
|
|
77
|
+
borderRadius: theme.radius.full,
|
|
78
|
+
// Squircle corners for when `radius` overrides the pill. Free on Android.
|
|
79
|
+
borderCurve: "continuous"
|
|
80
|
+
},
|
|
81
|
+
label: {
|
|
82
|
+
fontFamily: theme.fontFamilies.body,
|
|
83
|
+
fontWeight: theme.fontWeights.semibold,
|
|
84
|
+
// Android reserves leading above and below the glyphs, which in a 16pt box is the
|
|
85
|
+
// difference between a centred digit and one sitting low.
|
|
86
|
+
includeFontPadding: false,
|
|
87
|
+
// No `lineHeight`: the scale's leading is taller than the box at every size here,
|
|
88
|
+
// and the root centres the label anyway.
|
|
89
|
+
textAlign: "center"
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
variantTokens: VARIANT_TOKENS,
|
|
93
|
+
/**
|
|
94
|
+
* Where the variant's colours land, for every variant at once. The border width follows
|
|
95
|
+
* the *presence* of the border role, so `ghost` needs no rule of its own.
|
|
96
|
+
*/
|
|
97
|
+
paint: (theme, colors) => ({
|
|
98
|
+
root: {
|
|
99
|
+
backgroundColor: colors.bg,
|
|
100
|
+
borderColor: colors.border,
|
|
101
|
+
borderWidth: colors.border ? theme.borderWidth.default : 0
|
|
102
|
+
},
|
|
103
|
+
label: { color: colors.fg }
|
|
104
|
+
}),
|
|
105
|
+
/** Declaration order is application order: `dot` overrides the box `size` set, and
|
|
106
|
+
* `radius` overrides the capsule from `base`. */
|
|
107
|
+
variants: {
|
|
108
|
+
size: {
|
|
109
|
+
xs: sizeAxis(SIZES.xs),
|
|
110
|
+
sm: sizeAxis(SIZES.sm),
|
|
111
|
+
md: sizeAxis(SIZES.md),
|
|
112
|
+
lg: sizeAxis(SIZES.lg)
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* The same four keys as `size`, and the root selects it with the resolved size when
|
|
116
|
+
* `isDot` is set and with nothing when it is not — an axis left unselected contributes
|
|
117
|
+
* nothing, which is exactly "this badge has a label". A `{ true, false }` axis would
|
|
118
|
+
* have needed a `false` branch with nothing to say, and a `size × isDot` compound
|
|
119
|
+
* would have been sixteen entries for four measurements.
|
|
120
|
+
*/
|
|
121
|
+
dot: {
|
|
122
|
+
xs: dotAxis(SIZES.xs.dot),
|
|
123
|
+
sm: dotAxis(SIZES.sm.dot),
|
|
124
|
+
md: dotAxis(SIZES.md.dot),
|
|
125
|
+
lg: dotAxis(SIZES.lg.dot)
|
|
126
|
+
},
|
|
127
|
+
radius: _chunkFNEUOBCVcjs.radiusAxis.call(void 0, "root")
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* `danger`, where every other component in the library defaults to the first name in its
|
|
131
|
+
* ladder. A badge is overwhelmingly the count of something that wants attention — unread,
|
|
132
|
+
* failed, overdue — and a red one is what `<Badge>3</Badge>` means. The accent count is a
|
|
133
|
+
* `variant` away.
|
|
134
|
+
*/
|
|
135
|
+
defaultVariants: { variant: "danger", size: BADGE_DEFAULT_SIZE }
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// src/components/badge/badge.utils.ts
|
|
139
|
+
function placementInsets(placement, offset) {
|
|
140
|
+
if (!placement) return void 0;
|
|
141
|
+
const vertical = placement.startsWith("top") ? { top: -offset } : { bottom: -offset };
|
|
142
|
+
const horizontal = placement.endsWith("start") ? { start: -offset } : { end: -offset };
|
|
143
|
+
return { position: "absolute", ...vertical, ...horizontal };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// src/components/badge/badge.tsx
|
|
147
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
148
|
+
var Badge = _react.forwardRef.call(void 0, function Badge2({
|
|
149
|
+
children,
|
|
150
|
+
variant,
|
|
151
|
+
size,
|
|
152
|
+
radius,
|
|
153
|
+
color,
|
|
154
|
+
isDot = false,
|
|
155
|
+
placement,
|
|
156
|
+
asChild = false,
|
|
157
|
+
style,
|
|
158
|
+
...props
|
|
159
|
+
}, ref) {
|
|
160
|
+
const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
|
|
161
|
+
const [styleProps, rest] = _chunkI6ZB3FZIcjs.useStyleProps.call(void 0, props);
|
|
162
|
+
const resolvedSize = _nullishCoalesce(size, () => ( BADGE_DEFAULT_SIZE));
|
|
163
|
+
const selection = {
|
|
164
|
+
variant,
|
|
165
|
+
size,
|
|
166
|
+
radius,
|
|
167
|
+
// An axis left unselected contributes nothing, which is exactly "this badge has a
|
|
168
|
+
// label" — no `false` branch with nothing to say.
|
|
169
|
+
dot: isDot ? resolvedSize : void 0
|
|
170
|
+
};
|
|
171
|
+
const styles = badgeRecipe.resolve({ theme, selection });
|
|
172
|
+
const tint = color ? badgeRecipe.tint({ theme, color, selection }) : void 0;
|
|
173
|
+
const insets = _react.useMemo.call(void 0,
|
|
174
|
+
() => placementInsets(placement, badgeOffset(theme, resolvedSize, isDot)),
|
|
175
|
+
[placement, theme, resolvedSize, isDot]
|
|
176
|
+
);
|
|
177
|
+
const rootStyle = [styles.root, _optionalChain([tint, 'optionalAccess', _ => _.root]), insets, styleProps, style];
|
|
178
|
+
const text = _chunk54FJOKANcjs.childrenToString.call(void 0, children);
|
|
179
|
+
const label = text !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles.label, _optionalChain([tint, 'optionalAccess', _2 => _2.label])], numberOfLines: 1, children: text }) : children;
|
|
180
|
+
const content = isDot ? null : label;
|
|
181
|
+
const Root = asChild ? _chunk54FJOKANcjs.Slot : _reactnative.View;
|
|
182
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
183
|
+
Root,
|
|
184
|
+
{
|
|
185
|
+
ref,
|
|
186
|
+
...rest,
|
|
187
|
+
style: rootStyle,
|
|
188
|
+
children: asChild ? children : content
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
});
|
|
192
|
+
Badge.displayName = "XAUI.Badge";
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
exports.badgeRecipe = badgeRecipe; exports.placementInsets = placementInsets; exports.Badge = Badge;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Slot,
|
|
3
|
+
childrenToString
|
|
4
|
+
} from "./chunk-YXPYOOHU.js";
|
|
5
|
+
import {
|
|
6
|
+
createRecipe,
|
|
7
|
+
radiusAxis
|
|
8
|
+
} from "./chunk-4GTAZM2C.js";
|
|
9
|
+
import {
|
|
10
|
+
useStyleProps
|
|
11
|
+
} from "./chunk-MEYCZS32.js";
|
|
12
|
+
import {
|
|
13
|
+
useXAUITheme
|
|
14
|
+
} from "./chunk-A3EGFI6T.js";
|
|
15
|
+
|
|
16
|
+
// src/components/badge/badge.tsx
|
|
17
|
+
import { forwardRef, useMemo } from "react";
|
|
18
|
+
import { Text, View } from "react-native";
|
|
19
|
+
|
|
20
|
+
// src/components/badge/badge.recipe.ts
|
|
21
|
+
var SLOTS = ["root", "label"];
|
|
22
|
+
var VARIANT_TOKENS = {
|
|
23
|
+
primary: { bg: "accent", fg: "accentForeground" },
|
|
24
|
+
secondary: { bg: "accentSoft", fg: "accentSoftForeground" },
|
|
25
|
+
default: { bg: "default", fg: "defaultForeground" },
|
|
26
|
+
tertiary: { border: "border", fg: "foreground" },
|
|
27
|
+
ghost: { fg: "foreground" },
|
|
28
|
+
success: { bg: "success", fg: "successForeground" },
|
|
29
|
+
"success-soft": { bg: "successSoft", fg: "successSoftForeground" },
|
|
30
|
+
warning: { bg: "warning", fg: "warningForeground" },
|
|
31
|
+
"warning-soft": { bg: "warningSoft", fg: "warningSoftForeground" },
|
|
32
|
+
danger: { bg: "danger", fg: "dangerForeground" },
|
|
33
|
+
"danger-soft": { bg: "dangerSoft", fg: "dangerSoftForeground" }
|
|
34
|
+
};
|
|
35
|
+
function sizeAxis(step) {
|
|
36
|
+
return (theme) => {
|
|
37
|
+
const height = theme.spacing(step.height);
|
|
38
|
+
return {
|
|
39
|
+
root: {
|
|
40
|
+
height,
|
|
41
|
+
minWidth: height,
|
|
42
|
+
paddingHorizontal: theme.spacing(step.padding)
|
|
43
|
+
},
|
|
44
|
+
label: { fontSize: theme.fontSizes[step.label] }
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function dotAxis(diameter) {
|
|
49
|
+
return (theme) => {
|
|
50
|
+
const size = theme.spacing(diameter);
|
|
51
|
+
return {
|
|
52
|
+
root: { height: size, width: size, minWidth: size, paddingHorizontal: 0 }
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var BADGE_DEFAULT_SIZE = "md";
|
|
57
|
+
var SIZES = {
|
|
58
|
+
xs: { height: 4, padding: 1.25, label: "xs", dot: 1.5 },
|
|
59
|
+
sm: { height: 4.5, padding: 1.5, label: "xs", dot: 2 },
|
|
60
|
+
md: { height: 5, padding: 1.5, label: "xs", dot: 2.5 },
|
|
61
|
+
lg: { height: 6, padding: 2, label: "sm", dot: 3 }
|
|
62
|
+
};
|
|
63
|
+
function badgeOffset(theme, size, isDot) {
|
|
64
|
+
const step = SIZES[size];
|
|
65
|
+
return theme.spacing(isDot ? step.dot : step.height) / 2;
|
|
66
|
+
}
|
|
67
|
+
var badgeRecipe = createRecipe({
|
|
68
|
+
slots: SLOTS,
|
|
69
|
+
base: (theme) => ({
|
|
70
|
+
root: {
|
|
71
|
+
flexDirection: "row",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
justifyContent: "center",
|
|
74
|
+
borderWidth: 0,
|
|
75
|
+
// The capsule at every size, which is what makes a two-digit count read as one
|
|
76
|
+
// object. `radius` is still there for the square marker.
|
|
77
|
+
borderRadius: theme.radius.full,
|
|
78
|
+
// Squircle corners for when `radius` overrides the pill. Free on Android.
|
|
79
|
+
borderCurve: "continuous"
|
|
80
|
+
},
|
|
81
|
+
label: {
|
|
82
|
+
fontFamily: theme.fontFamilies.body,
|
|
83
|
+
fontWeight: theme.fontWeights.semibold,
|
|
84
|
+
// Android reserves leading above and below the glyphs, which in a 16pt box is the
|
|
85
|
+
// difference between a centred digit and one sitting low.
|
|
86
|
+
includeFontPadding: false,
|
|
87
|
+
// No `lineHeight`: the scale's leading is taller than the box at every size here,
|
|
88
|
+
// and the root centres the label anyway.
|
|
89
|
+
textAlign: "center"
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
variantTokens: VARIANT_TOKENS,
|
|
93
|
+
/**
|
|
94
|
+
* Where the variant's colours land, for every variant at once. The border width follows
|
|
95
|
+
* the *presence* of the border role, so `ghost` needs no rule of its own.
|
|
96
|
+
*/
|
|
97
|
+
paint: (theme, colors) => ({
|
|
98
|
+
root: {
|
|
99
|
+
backgroundColor: colors.bg,
|
|
100
|
+
borderColor: colors.border,
|
|
101
|
+
borderWidth: colors.border ? theme.borderWidth.default : 0
|
|
102
|
+
},
|
|
103
|
+
label: { color: colors.fg }
|
|
104
|
+
}),
|
|
105
|
+
/** Declaration order is application order: `dot` overrides the box `size` set, and
|
|
106
|
+
* `radius` overrides the capsule from `base`. */
|
|
107
|
+
variants: {
|
|
108
|
+
size: {
|
|
109
|
+
xs: sizeAxis(SIZES.xs),
|
|
110
|
+
sm: sizeAxis(SIZES.sm),
|
|
111
|
+
md: sizeAxis(SIZES.md),
|
|
112
|
+
lg: sizeAxis(SIZES.lg)
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* The same four keys as `size`, and the root selects it with the resolved size when
|
|
116
|
+
* `isDot` is set and with nothing when it is not — an axis left unselected contributes
|
|
117
|
+
* nothing, which is exactly "this badge has a label". A `{ true, false }` axis would
|
|
118
|
+
* have needed a `false` branch with nothing to say, and a `size × isDot` compound
|
|
119
|
+
* would have been sixteen entries for four measurements.
|
|
120
|
+
*/
|
|
121
|
+
dot: {
|
|
122
|
+
xs: dotAxis(SIZES.xs.dot),
|
|
123
|
+
sm: dotAxis(SIZES.sm.dot),
|
|
124
|
+
md: dotAxis(SIZES.md.dot),
|
|
125
|
+
lg: dotAxis(SIZES.lg.dot)
|
|
126
|
+
},
|
|
127
|
+
radius: radiusAxis("root")
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* `danger`, where every other component in the library defaults to the first name in its
|
|
131
|
+
* ladder. A badge is overwhelmingly the count of something that wants attention — unread,
|
|
132
|
+
* failed, overdue — and a red one is what `<Badge>3</Badge>` means. The accent count is a
|
|
133
|
+
* `variant` away.
|
|
134
|
+
*/
|
|
135
|
+
defaultVariants: { variant: "danger", size: BADGE_DEFAULT_SIZE }
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// src/components/badge/badge.utils.ts
|
|
139
|
+
function placementInsets(placement, offset) {
|
|
140
|
+
if (!placement) return void 0;
|
|
141
|
+
const vertical = placement.startsWith("top") ? { top: -offset } : { bottom: -offset };
|
|
142
|
+
const horizontal = placement.endsWith("start") ? { start: -offset } : { end: -offset };
|
|
143
|
+
return { position: "absolute", ...vertical, ...horizontal };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// src/components/badge/badge.tsx
|
|
147
|
+
import { jsx } from "react/jsx-runtime";
|
|
148
|
+
var Badge = forwardRef(function Badge2({
|
|
149
|
+
children,
|
|
150
|
+
variant,
|
|
151
|
+
size,
|
|
152
|
+
radius,
|
|
153
|
+
color,
|
|
154
|
+
isDot = false,
|
|
155
|
+
placement,
|
|
156
|
+
asChild = false,
|
|
157
|
+
style,
|
|
158
|
+
...props
|
|
159
|
+
}, ref) {
|
|
160
|
+
const theme = useXAUITheme();
|
|
161
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
162
|
+
const resolvedSize = size ?? BADGE_DEFAULT_SIZE;
|
|
163
|
+
const selection = {
|
|
164
|
+
variant,
|
|
165
|
+
size,
|
|
166
|
+
radius,
|
|
167
|
+
// An axis left unselected contributes nothing, which is exactly "this badge has a
|
|
168
|
+
// label" — no `false` branch with nothing to say.
|
|
169
|
+
dot: isDot ? resolvedSize : void 0
|
|
170
|
+
};
|
|
171
|
+
const styles = badgeRecipe.resolve({ theme, selection });
|
|
172
|
+
const tint = color ? badgeRecipe.tint({ theme, color, selection }) : void 0;
|
|
173
|
+
const insets = useMemo(
|
|
174
|
+
() => placementInsets(placement, badgeOffset(theme, resolvedSize, isDot)),
|
|
175
|
+
[placement, theme, resolvedSize, isDot]
|
|
176
|
+
);
|
|
177
|
+
const rootStyle = [styles.root, tint?.root, insets, styleProps, style];
|
|
178
|
+
const text = childrenToString(children);
|
|
179
|
+
const label = text !== null ? /* @__PURE__ */ jsx(Text, { style: [styles.label, tint?.label], numberOfLines: 1, children: text }) : children;
|
|
180
|
+
const content = isDot ? null : label;
|
|
181
|
+
const Root = asChild ? Slot : View;
|
|
182
|
+
return /* @__PURE__ */ jsx(
|
|
183
|
+
Root,
|
|
184
|
+
{
|
|
185
|
+
ref,
|
|
186
|
+
...rest,
|
|
187
|
+
style: rootStyle,
|
|
188
|
+
children: asChild ? children : content
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
});
|
|
192
|
+
Badge.displayName = "XAUI.Badge";
|
|
193
|
+
|
|
194
|
+
export {
|
|
195
|
+
badgeRecipe,
|
|
196
|
+
placementInsets,
|
|
197
|
+
Badge
|
|
198
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkDUQUCOUYcjs = require('../../chunk-DUQUCOUY.cjs');
|
|
6
|
+
require('../../chunk-54FJOKAN.cjs');
|
|
7
|
+
require('../../chunk-H4E4HDEP.cjs');
|
|
8
|
+
require('../../chunk-FNEUOBCV.cjs');
|
|
9
|
+
require('../../chunk-I6ZB3FZI.cjs');
|
|
10
|
+
require('../../chunk-57SJ4LJF.cjs');
|
|
11
|
+
require('../../chunk-MC7SY2QH.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.Badge = _chunkDUQUCOUYcjs.Badge; exports.badgeRecipe = _chunkDUQUCOUYcjs.badgeRecipe; exports.placementInsets = _chunkDUQUCOUYcjs.placementInsets;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_native from 'react-native';
|
|
4
|
+
import { ViewProps, StyleProp, ViewStyle, View } from 'react-native';
|
|
5
|
+
import { V as ViewStyleProps } from '../../style-props.type-CfnoGEP7.cjs';
|
|
6
|
+
import { S as Size, R as RadiusKey, X as XAUITheme } from '../../theme.type-C2gNHpEx.cjs';
|
|
7
|
+
import { R as Recipe, S as SlotStyles, a as StyleFn } from '../../create-recipe-dC7wMfnj.cjs';
|
|
8
|
+
|
|
9
|
+
type BadgeSlot = 'root' | 'label';
|
|
10
|
+
/**
|
|
11
|
+
* The full vocabulary (§1 bis), and the `Chip`'s eleven — a badge is what a chip is when
|
|
12
|
+
* it is too small to hold a word: something a component **reports** about itself. So the
|
|
13
|
+
* three status families are here for the same reason they are there, and a name means the
|
|
14
|
+
* same thing in both.
|
|
15
|
+
*
|
|
16
|
+
* `danger` is the default rather than `primary`, and it is the only component in the
|
|
17
|
+
* library whose default is not the first name in the ladder. A badge is overwhelmingly the
|
|
18
|
+
* count of something that wants attention — unread, failed, overdue — and a red one is what
|
|
19
|
+
* a caller writing `<Badge>3</Badge>` means. The accent count is a `variant` away.
|
|
20
|
+
*/
|
|
21
|
+
type BadgeVariant = 'primary' | 'secondary' | 'default' | 'tertiary' | 'ghost' | 'success' | 'success-soft' | 'warning' | 'warning-soft' | 'danger' | 'danger-soft';
|
|
22
|
+
type BadgeSize = Size;
|
|
23
|
+
/**
|
|
24
|
+
* Which corner it hangs off, when it hangs off something.
|
|
25
|
+
*
|
|
26
|
+
* Unset, the badge is in flow and the parent lays it out like any other node — which is the
|
|
27
|
+
* right thing for a badge at the end of a list row. Set, it is absolutely positioned in
|
|
28
|
+
* that corner of the **parent**, so the parent is whatever the badge decorates:
|
|
29
|
+
*
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <View>
|
|
32
|
+
* <Icon as={BellIcon} size={24} />
|
|
33
|
+
* <Badge placement="top-end">3</Badge>
|
|
34
|
+
* </View>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* It is a prop rather than four style keys the caller writes because the offset is derived
|
|
38
|
+
* from the badge's own `size` — it is pulled out by half its height on each axis, so its
|
|
39
|
+
* centre sits on the corner it marks, and that arithmetic belongs with the measurements
|
|
40
|
+
* rather than at every call site. R13 is the other half: the keys are `start` and `end`, so
|
|
41
|
+
* a badge on the trailing corner mirrors in RTL instead of staying put.
|
|
42
|
+
*/
|
|
43
|
+
type BadgePlacement = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start';
|
|
44
|
+
/**
|
|
45
|
+
* What the `Badge` itself understands. R14 — a name in here is the component's, so the
|
|
46
|
+
* style prop that shares it is not exposed: `size` is the badge's scale and never
|
|
47
|
+
* `ViewStyle`'s, and `color` is R7's tint.
|
|
48
|
+
*/
|
|
49
|
+
type BadgeOwnProps = {
|
|
50
|
+
variant?: BadgeVariant;
|
|
51
|
+
/** Height, horizontal padding and type. The width follows the count inside it. */
|
|
52
|
+
size?: BadgeSize;
|
|
53
|
+
/**
|
|
54
|
+
* Overrides the capsule. A badge is a pill at every size — that is what makes a
|
|
55
|
+
* two-digit count read as one object — so this is the prop for the square marker.
|
|
56
|
+
*/
|
|
57
|
+
radius?: RadiusKey;
|
|
58
|
+
/**
|
|
59
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). Where it lands follows the variant: the
|
|
60
|
+
* fill of a `primary`, the border and label of a `tertiary`, the label of a `ghost`.
|
|
61
|
+
*/
|
|
62
|
+
color?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The bare circle — no label, no padding, a fixed diameter. It is what a badge is when
|
|
65
|
+
* the fact that there is *something* is the whole message: a dot on a tab, an unsaved
|
|
66
|
+
* marker on a row.
|
|
67
|
+
*
|
|
68
|
+
* Children are not rendered while it is set: a dot is the absence of a label, so there
|
|
69
|
+
* is nothing for one to sit in.
|
|
70
|
+
*/
|
|
71
|
+
isDot?: boolean;
|
|
72
|
+
placement?: BadgePlacement;
|
|
73
|
+
/** R12 — the child element becomes the badge and keeps this variant's style. */
|
|
74
|
+
asChild?: boolean;
|
|
75
|
+
style?: StyleProp<ViewStyle>;
|
|
76
|
+
children?: ReactNode;
|
|
77
|
+
};
|
|
78
|
+
type BadgeProps = Omit<ViewProps, 'style'> & BadgeOwnProps & Omit<ViewStyleProps, keyof BadgeOwnProps | keyof ViewProps>;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* A count, or the fact that there is one.
|
|
82
|
+
*
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <Badge>3</Badge>
|
|
85
|
+
* <Badge variant="success-soft" size="sm">Payé</Badge>
|
|
86
|
+
* <Badge isDot variant="warning" />
|
|
87
|
+
*
|
|
88
|
+
* <View>
|
|
89
|
+
* <Icon as={BellIcon} size={24} />
|
|
90
|
+
* <Badge placement="top-end">12</Badge>
|
|
91
|
+
* </View>
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* **One node and no slots**, per the plan. A badge is a mark: whatever is inside it is one
|
|
95
|
+
* line of two or three characters, and a slot would be a name for a `Text` this component
|
|
96
|
+
* can just as well insert itself (R3).
|
|
97
|
+
*
|
|
98
|
+
* **It is not a small `Chip`.** A chip holds a word and hugs it; a badge holds a count and
|
|
99
|
+
* is round unless the count is too wide to be. That is the `minWidth` equal to the height —
|
|
100
|
+
* one digit is a circle, two are a capsule — and it is why the label stays at 12pt through
|
|
101
|
+
* three of the four sizes, because a count that grows with its badge stops being a count.
|
|
102
|
+
*
|
|
103
|
+
* **`placement` makes the parent whatever the badge decorates.** Unset, the badge is in
|
|
104
|
+
* flow and laid out like any other node, which is what a badge at the end of a list row
|
|
105
|
+
* wants. Set, it is pulled half its own height out of that corner of the parent, so its
|
|
106
|
+
* centre lands on the corner it marks.
|
|
107
|
+
*/
|
|
108
|
+
declare const Badge: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
109
|
+
variant?: BadgeVariant;
|
|
110
|
+
size?: BadgeSize;
|
|
111
|
+
radius?: RadiusKey;
|
|
112
|
+
color?: string;
|
|
113
|
+
isDot?: boolean;
|
|
114
|
+
placement?: BadgePlacement;
|
|
115
|
+
asChild?: boolean;
|
|
116
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
117
|
+
children?: react.ReactNode;
|
|
118
|
+
} & Omit<ViewStyleProps, "color" | "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" | "asChild" | "radius" | "size" | "variant" | "isDot" | "placement"> & react.RefAttributes<View>>;
|
|
119
|
+
|
|
120
|
+
declare const badgeRecipe: Recipe<"label" | "root", BadgeVariant, {
|
|
121
|
+
readonly size: {
|
|
122
|
+
readonly xs: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
123
|
+
readonly sm: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
124
|
+
readonly md: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
125
|
+
readonly lg: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* The same four keys as `size`, and the root selects it with the resolved size when
|
|
129
|
+
* `isDot` is set and with nothing when it is not — an axis left unselected contributes
|
|
130
|
+
* nothing, which is exactly "this badge has a label". A `{ true, false }` axis would
|
|
131
|
+
* have needed a `false` branch with nothing to say, and a `size × isDot` compound
|
|
132
|
+
* would have been sixteen entries for four measurements.
|
|
133
|
+
*/
|
|
134
|
+
readonly dot: {
|
|
135
|
+
readonly xs: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
136
|
+
readonly sm: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
137
|
+
readonly md: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
138
|
+
readonly lg: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
139
|
+
};
|
|
140
|
+
readonly radius: Record<RadiusKey, StyleFn<BadgeSlot>>;
|
|
141
|
+
}>;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* `placement` turned into the four keys React Native understands, given how far the badge
|
|
145
|
+
* has to be pulled out of the corner it marks.
|
|
146
|
+
*
|
|
147
|
+
* A pure function rather than a lookup in the recipe, because the insets must **not** exist
|
|
148
|
+
* when there is no placement: in flow the node is `position: 'relative'`, where an inset is
|
|
149
|
+
* a nudge rather than a placement, and a cached style carrying `top: -10` would shift every
|
|
150
|
+
* badge that is simply sitting at the end of a row.
|
|
151
|
+
*
|
|
152
|
+
* R13 — `start` and `end`, never `left` and `right`, so a badge on the trailing corner
|
|
153
|
+
* mirrors with the layout instead of staying put.
|
|
154
|
+
*/
|
|
155
|
+
declare function placementInsets(placement: BadgePlacement | undefined, offset: number): ViewStyle | undefined;
|
|
156
|
+
|
|
157
|
+
export { Badge, type BadgePlacement, type BadgeProps, type BadgeSize, type BadgeSlot, type BadgeVariant, badgeRecipe, placementInsets };
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_native from 'react-native';
|
|
4
|
+
import { ViewProps, StyleProp, ViewStyle, View } from 'react-native';
|
|
5
|
+
import { V as ViewStyleProps } from '../../style-props.type-CfnoGEP7.js';
|
|
6
|
+
import { S as Size, R as RadiusKey, X as XAUITheme } from '../../theme.type-C2gNHpEx.js';
|
|
7
|
+
import { R as Recipe, S as SlotStyles, a as StyleFn } from '../../create-recipe-BdVd2ffi.js';
|
|
8
|
+
|
|
9
|
+
type BadgeSlot = 'root' | 'label';
|
|
10
|
+
/**
|
|
11
|
+
* The full vocabulary (§1 bis), and the `Chip`'s eleven — a badge is what a chip is when
|
|
12
|
+
* it is too small to hold a word: something a component **reports** about itself. So the
|
|
13
|
+
* three status families are here for the same reason they are there, and a name means the
|
|
14
|
+
* same thing in both.
|
|
15
|
+
*
|
|
16
|
+
* `danger` is the default rather than `primary`, and it is the only component in the
|
|
17
|
+
* library whose default is not the first name in the ladder. A badge is overwhelmingly the
|
|
18
|
+
* count of something that wants attention — unread, failed, overdue — and a red one is what
|
|
19
|
+
* a caller writing `<Badge>3</Badge>` means. The accent count is a `variant` away.
|
|
20
|
+
*/
|
|
21
|
+
type BadgeVariant = 'primary' | 'secondary' | 'default' | 'tertiary' | 'ghost' | 'success' | 'success-soft' | 'warning' | 'warning-soft' | 'danger' | 'danger-soft';
|
|
22
|
+
type BadgeSize = Size;
|
|
23
|
+
/**
|
|
24
|
+
* Which corner it hangs off, when it hangs off something.
|
|
25
|
+
*
|
|
26
|
+
* Unset, the badge is in flow and the parent lays it out like any other node — which is the
|
|
27
|
+
* right thing for a badge at the end of a list row. Set, it is absolutely positioned in
|
|
28
|
+
* that corner of the **parent**, so the parent is whatever the badge decorates:
|
|
29
|
+
*
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <View>
|
|
32
|
+
* <Icon as={BellIcon} size={24} />
|
|
33
|
+
* <Badge placement="top-end">3</Badge>
|
|
34
|
+
* </View>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* It is a prop rather than four style keys the caller writes because the offset is derived
|
|
38
|
+
* from the badge's own `size` — it is pulled out by half its height on each axis, so its
|
|
39
|
+
* centre sits on the corner it marks, and that arithmetic belongs with the measurements
|
|
40
|
+
* rather than at every call site. R13 is the other half: the keys are `start` and `end`, so
|
|
41
|
+
* a badge on the trailing corner mirrors in RTL instead of staying put.
|
|
42
|
+
*/
|
|
43
|
+
type BadgePlacement = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start';
|
|
44
|
+
/**
|
|
45
|
+
* What the `Badge` itself understands. R14 — a name in here is the component's, so the
|
|
46
|
+
* style prop that shares it is not exposed: `size` is the badge's scale and never
|
|
47
|
+
* `ViewStyle`'s, and `color` is R7's tint.
|
|
48
|
+
*/
|
|
49
|
+
type BadgeOwnProps = {
|
|
50
|
+
variant?: BadgeVariant;
|
|
51
|
+
/** Height, horizontal padding and type. The width follows the count inside it. */
|
|
52
|
+
size?: BadgeSize;
|
|
53
|
+
/**
|
|
54
|
+
* Overrides the capsule. A badge is a pill at every size — that is what makes a
|
|
55
|
+
* two-digit count read as one object — so this is the prop for the square marker.
|
|
56
|
+
*/
|
|
57
|
+
radius?: RadiusKey;
|
|
58
|
+
/**
|
|
59
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). Where it lands follows the variant: the
|
|
60
|
+
* fill of a `primary`, the border and label of a `tertiary`, the label of a `ghost`.
|
|
61
|
+
*/
|
|
62
|
+
color?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The bare circle — no label, no padding, a fixed diameter. It is what a badge is when
|
|
65
|
+
* the fact that there is *something* is the whole message: a dot on a tab, an unsaved
|
|
66
|
+
* marker on a row.
|
|
67
|
+
*
|
|
68
|
+
* Children are not rendered while it is set: a dot is the absence of a label, so there
|
|
69
|
+
* is nothing for one to sit in.
|
|
70
|
+
*/
|
|
71
|
+
isDot?: boolean;
|
|
72
|
+
placement?: BadgePlacement;
|
|
73
|
+
/** R12 — the child element becomes the badge and keeps this variant's style. */
|
|
74
|
+
asChild?: boolean;
|
|
75
|
+
style?: StyleProp<ViewStyle>;
|
|
76
|
+
children?: ReactNode;
|
|
77
|
+
};
|
|
78
|
+
type BadgeProps = Omit<ViewProps, 'style'> & BadgeOwnProps & Omit<ViewStyleProps, keyof BadgeOwnProps | keyof ViewProps>;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* A count, or the fact that there is one.
|
|
82
|
+
*
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <Badge>3</Badge>
|
|
85
|
+
* <Badge variant="success-soft" size="sm">Payé</Badge>
|
|
86
|
+
* <Badge isDot variant="warning" />
|
|
87
|
+
*
|
|
88
|
+
* <View>
|
|
89
|
+
* <Icon as={BellIcon} size={24} />
|
|
90
|
+
* <Badge placement="top-end">12</Badge>
|
|
91
|
+
* </View>
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* **One node and no slots**, per the plan. A badge is a mark: whatever is inside it is one
|
|
95
|
+
* line of two or three characters, and a slot would be a name for a `Text` this component
|
|
96
|
+
* can just as well insert itself (R3).
|
|
97
|
+
*
|
|
98
|
+
* **It is not a small `Chip`.** A chip holds a word and hugs it; a badge holds a count and
|
|
99
|
+
* is round unless the count is too wide to be. That is the `minWidth` equal to the height —
|
|
100
|
+
* one digit is a circle, two are a capsule — and it is why the label stays at 12pt through
|
|
101
|
+
* three of the four sizes, because a count that grows with its badge stops being a count.
|
|
102
|
+
*
|
|
103
|
+
* **`placement` makes the parent whatever the badge decorates.** Unset, the badge is in
|
|
104
|
+
* flow and laid out like any other node, which is what a badge at the end of a list row
|
|
105
|
+
* wants. Set, it is pulled half its own height out of that corner of the parent, so its
|
|
106
|
+
* centre lands on the corner it marks.
|
|
107
|
+
*/
|
|
108
|
+
declare const Badge: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
109
|
+
variant?: BadgeVariant;
|
|
110
|
+
size?: BadgeSize;
|
|
111
|
+
radius?: RadiusKey;
|
|
112
|
+
color?: string;
|
|
113
|
+
isDot?: boolean;
|
|
114
|
+
placement?: BadgePlacement;
|
|
115
|
+
asChild?: boolean;
|
|
116
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
117
|
+
children?: react.ReactNode;
|
|
118
|
+
} & Omit<ViewStyleProps, "color" | "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" | "asChild" | "radius" | "size" | "variant" | "isDot" | "placement"> & react.RefAttributes<View>>;
|
|
119
|
+
|
|
120
|
+
declare const badgeRecipe: Recipe<"label" | "root", BadgeVariant, {
|
|
121
|
+
readonly size: {
|
|
122
|
+
readonly xs: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
123
|
+
readonly sm: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
124
|
+
readonly md: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
125
|
+
readonly lg: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* The same four keys as `size`, and the root selects it with the resolved size when
|
|
129
|
+
* `isDot` is set and with nothing when it is not — an axis left unselected contributes
|
|
130
|
+
* nothing, which is exactly "this badge has a label". A `{ true, false }` axis would
|
|
131
|
+
* have needed a `false` branch with nothing to say, and a `size × isDot` compound
|
|
132
|
+
* would have been sixteen entries for four measurements.
|
|
133
|
+
*/
|
|
134
|
+
readonly dot: {
|
|
135
|
+
readonly xs: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
136
|
+
readonly sm: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
137
|
+
readonly md: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
138
|
+
readonly lg: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
|
|
139
|
+
};
|
|
140
|
+
readonly radius: Record<RadiusKey, StyleFn<BadgeSlot>>;
|
|
141
|
+
}>;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* `placement` turned into the four keys React Native understands, given how far the badge
|
|
145
|
+
* has to be pulled out of the corner it marks.
|
|
146
|
+
*
|
|
147
|
+
* A pure function rather than a lookup in the recipe, because the insets must **not** exist
|
|
148
|
+
* when there is no placement: in flow the node is `position: 'relative'`, where an inset is
|
|
149
|
+
* a nudge rather than a placement, and a cached style carrying `top: -10` would shift every
|
|
150
|
+
* badge that is simply sitting at the end of a row.
|
|
151
|
+
*
|
|
152
|
+
* R13 — `start` and `end`, never `left` and `right`, so a badge on the trailing corner
|
|
153
|
+
* mirrors with the layout instead of staying put.
|
|
154
|
+
*/
|
|
155
|
+
declare function placementInsets(placement: BadgePlacement | undefined, offset: number): ViewStyle | undefined;
|
|
156
|
+
|
|
157
|
+
export { Badge, type BadgePlacement, type BadgeProps, type BadgeSize, type BadgeSlot, type BadgeVariant, badgeRecipe, placementInsets };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Badge,
|
|
3
|
+
badgeRecipe,
|
|
4
|
+
placementInsets
|
|
5
|
+
} from "../../chunk-LZK77LFX.js";
|
|
6
|
+
import "../../chunk-YXPYOOHU.js";
|
|
7
|
+
import "../../chunk-36PRYGAM.js";
|
|
8
|
+
import "../../chunk-4GTAZM2C.js";
|
|
9
|
+
import "../../chunk-MEYCZS32.js";
|
|
10
|
+
import "../../chunk-A3EGFI6T.js";
|
|
11
|
+
import "../../chunk-GGW42MY4.js";
|
|
12
|
+
export {
|
|
13
|
+
Badge,
|
|
14
|
+
badgeRecipe,
|
|
15
|
+
placementInsets
|
|
16
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
var _chunkCM4LI5OHcjs = require('./chunk-CM4LI5OH.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
4
8
|
|
|
5
9
|
var _chunkAOEXU5UVcjs = require('./chunk-AOEXU5UV.cjs');
|
|
6
10
|
|
|
@@ -30,16 +34,17 @@ var _chunkOHEHPQLCcjs = require('./chunk-OHEHPQLC.cjs');
|
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
|
|
37
|
+
var _chunkVSALV7VOcjs = require('./chunk-VSALV7VO.cjs');
|
|
33
38
|
|
|
34
39
|
|
|
35
40
|
|
|
36
41
|
|
|
37
42
|
|
|
38
43
|
|
|
39
|
-
var _chunkTVCS5UOEcjs = require('./chunk-TVCS5UOE.cjs');
|
|
40
44
|
|
|
41
45
|
|
|
42
46
|
|
|
47
|
+
var _chunkTVCS5UOEcjs = require('./chunk-TVCS5UOE.cjs');
|
|
43
48
|
|
|
44
49
|
|
|
45
50
|
|
|
@@ -47,37 +52,36 @@ var _chunkTVCS5UOEcjs = require('./chunk-TVCS5UOE.cjs');
|
|
|
47
52
|
|
|
48
53
|
|
|
49
54
|
|
|
50
|
-
var _chunkPBR44KVVcjs = require('./chunk-PBR44KVV.cjs');
|
|
51
55
|
|
|
52
56
|
|
|
53
57
|
|
|
58
|
+
var _chunkPBR44KVVcjs = require('./chunk-PBR44KVV.cjs');
|
|
54
59
|
|
|
55
60
|
|
|
56
61
|
|
|
57
62
|
|
|
58
|
-
var _chunkMSMZBUZOcjs = require('./chunk-MSMZBUZO.cjs');
|
|
59
63
|
|
|
60
64
|
|
|
61
65
|
|
|
62
|
-
var _chunkLT6XHFXJcjs = require('./chunk-LT6XHFXJ.cjs');
|
|
63
66
|
|
|
64
67
|
|
|
68
|
+
var _chunkQ3D6KIVFcjs = require('./chunk-Q3D6KIVF.cjs');
|
|
65
69
|
|
|
66
|
-
var _chunkXWMB66ZMcjs = require('./chunk-XWMB66ZM.cjs');
|
|
67
70
|
|
|
68
71
|
|
|
69
72
|
|
|
70
73
|
|
|
71
74
|
|
|
72
75
|
|
|
76
|
+
var _chunkMSMZBUZOcjs = require('./chunk-MSMZBUZO.cjs');
|
|
73
77
|
|
|
74
78
|
|
|
75
|
-
var _chunkOX2YNMNScjs = require('./chunk-OX2YNMNS.cjs');
|
|
76
79
|
|
|
80
|
+
var _chunkLT6XHFXJcjs = require('./chunk-LT6XHFXJ.cjs');
|
|
77
81
|
|
|
78
82
|
|
|
79
|
-
var _chunkCM4LI5OHcjs = require('./chunk-CM4LI5OH.cjs');
|
|
80
83
|
|
|
84
|
+
var _chunkXWMB66ZMcjs = require('./chunk-XWMB66ZM.cjs');
|
|
81
85
|
|
|
82
86
|
|
|
83
87
|
|
|
@@ -86,7 +90,7 @@ var _chunkCM4LI5OHcjs = require('./chunk-CM4LI5OH.cjs');
|
|
|
86
90
|
|
|
87
91
|
|
|
88
92
|
|
|
89
|
-
var
|
|
93
|
+
var _chunkOX2YNMNScjs = require('./chunk-OX2YNMNS.cjs');
|
|
90
94
|
|
|
91
95
|
|
|
92
96
|
|
|
@@ -101,6 +105,11 @@ var _chunkI66VMLHEcjs = require('./chunk-I66VMLHE.cjs');
|
|
|
101
105
|
|
|
102
106
|
|
|
103
107
|
|
|
108
|
+
var _chunkDUQUCOUYcjs = require('./chunk-DUQUCOUY.cjs');
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
104
113
|
var _chunkDBXFFJTCcjs = require('./chunk-DBXFFJTC.cjs');
|
|
105
114
|
|
|
106
115
|
|
|
@@ -172,10 +181,6 @@ require('./chunk-EJQCQPET.cjs');
|
|
|
172
181
|
|
|
173
182
|
|
|
174
183
|
|
|
175
|
-
var _chunkVSALV7VOcjs = require('./chunk-VSALV7VO.cjs');
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
184
|
|
|
180
185
|
|
|
181
186
|
var _chunk54FJOKANcjs = require('./chunk-54FJOKAN.cjs');
|
|
@@ -333,4 +338,7 @@ require('./chunk-MC7SY2QH.cjs');
|
|
|
333
338
|
|
|
334
339
|
|
|
335
340
|
|
|
336
|
-
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
exports.Alert = _chunkK7LLERKTcjs.Alert; exports.Avatar = _chunkI66VMLHEcjs.Avatar; exports.Badge = _chunkDUQUCOUYcjs.Badge; exports.Button = _chunkDBXFFJTCcjs.Button; exports.CARD_BACKGROUND = _chunkUORTYL63cjs.CARD_BACKGROUND; exports.Card = _chunkUORTYL63cjs.Card; exports.Checkbox = _chunkCNNLMMFVcjs.Checkbox; exports.CheckboxIndicator = _chunkCNNLMMFVcjs.CheckboxIndicator; exports.CheckboxLabel = _chunkCNNLMMFVcjs.CheckboxLabel; exports.CheckboxRoot = _chunkCNNLMMFVcjs.CheckboxRoot; exports.Chip = _chunkQY4MN7X3cjs.Chip; exports.CloseButton = _chunkCYS6U374cjs.CloseButton; exports.Column = _chunk7CTIE42Jcjs.Column; exports.Divider = _chunkVSALV7VOcjs.Divider; exports.FEEDBACK_OVERLAY = _chunk6M7RUU7Vcjs.FEEDBACK_OVERLAY; exports.Grid = _chunk7CTIE42Jcjs.Grid; exports.HIGHLIGHT_DURATION = _chunk6M7RUU7Vcjs.HIGHLIGHT_DURATION; exports.HIGHLIGHT_OPACITY = _chunk6M7RUU7Vcjs.HIGHLIGHT_OPACITY; exports.Icon = _chunkPCWT2YBEcjs.Icon; exports.IconContext = _chunkPCWT2YBEcjs.IconContext; exports.Input = _chunkQ3D6KIVFcjs.Input; exports.InputDescription = _chunkQ3D6KIVFcjs.InputDescription; exports.InputError = _chunkQ3D6KIVFcjs.InputError; exports.InputField = _chunkQ3D6KIVFcjs.InputField; exports.InputGroup = _chunkTVCS5UOEcjs.InputGroup; exports.InputGroupField = _chunkTVCS5UOEcjs.InputGroupField; exports.InputGroupIcon = _chunkTVCS5UOEcjs.InputGroupIcon; exports.InputGroupPrefix = _chunkTVCS5UOEcjs.InputGroupPrefix; exports.InputGroupRoot = _chunkTVCS5UOEcjs.InputGroupRoot; exports.InputGroupSuffix = _chunkTVCS5UOEcjs.InputGroupSuffix; exports.InputLabel = _chunkQ3D6KIVFcjs.InputLabel; exports.InputOTP = _chunkPBR44KVVcjs.InputOTP; exports.InputRoot = _chunkQ3D6KIVFcjs.InputRoot; exports.OTP_ALPHANUMERIC = _chunkPBR44KVVcjs.OTP_ALPHANUMERIC; exports.OTP_DIGITS = _chunkPBR44KVVcjs.OTP_DIGITS; exports.OTP_LETTERS = _chunkPBR44KVVcjs.OTP_LETTERS; exports.PRESS_DURATION = _chunk6M7RUU7Vcjs.PRESS_DURATION; exports.PRESS_SCALE = _chunk6M7RUU7Vcjs.PRESS_SCALE; exports.Portal = _chunk4SLOOIE5cjs.Portal; exports.PortalContext = _chunk4SLOOIE5cjs.PortalContext; exports.PortalHost = _chunk4SLOOIE5cjs.PortalHost; exports.PressableFeedback = _chunk6M7RUU7Vcjs.PressableFeedback; exports.RIPPLE_CONFIRM_DURATION = _chunk6M7RUU7Vcjs.RIPPLE_CONFIRM_DURATION; exports.RIPPLE_EXPAND_DURATION = _chunk6M7RUU7Vcjs.RIPPLE_EXPAND_DURATION; exports.RIPPLE_FADE_IN = _chunk6M7RUU7Vcjs.RIPPLE_FADE_IN; exports.RIPPLE_FADE_OUT = _chunk6M7RUU7Vcjs.RIPPLE_FADE_OUT; exports.RIPPLE_FADE_OUT_DELAY = _chunk6M7RUU7Vcjs.RIPPLE_FADE_OUT_DELAY; exports.RIPPLE_OPACITY = _chunk6M7RUU7Vcjs.RIPPLE_OPACITY; exports.RIPPLE_START_SCALE = _chunk6M7RUU7Vcjs.RIPPLE_START_SCALE; exports.ROTATION_DURATION = _chunkK4TWKF5Ucjs.ROTATION_DURATION; exports.Radio = _chunkMSMZBUZOcjs.Radio; exports.RadioIndicator = _chunkMSMZBUZOcjs.RadioIndicator; exports.RadioLabel = _chunkMSMZBUZOcjs.RadioLabel; exports.RadioRoot = _chunkMSMZBUZOcjs.RadioRoot; exports.Row = _chunk7CTIE42Jcjs.Row; exports.SCALE_REFERENCE_WIDTH = _chunk6M7RUU7Vcjs.SCALE_REFERENCE_WIDTH; exports.SelectionFill = _chunkF6CQ6CBIcjs.SelectionFill; exports.Skeleton = _chunkLT6XHFXJcjs.Skeleton; exports.Slot = _chunk54FJOKANcjs.Slot; exports.Spinner = _chunkXWMB66ZMcjs.Spinner; exports.Stack = _chunk7CTIE42Jcjs.Stack; exports.Switch = _chunkOX2YNMNScjs.Switch; exports.SwitchLabel = _chunkOX2YNMNScjs.SwitchLabel; exports.SwitchRoot = _chunkOX2YNMNScjs.SwitchRoot; exports.SwitchThumb = _chunkOX2YNMNScjs.SwitchThumb; exports.SwitchTrack = _chunkOX2YNMNScjs.SwitchTrack; exports.TextArea = _chunkCM4LI5OHcjs.TextArea; exports.TextSpan = _chunkAOEXU5UVcjs.TextSpan; exports.ThemeContext = _chunk57SJ4LJFcjs.ThemeContext; exports.Typography = _chunkAOEXU5UVcjs.Typography; exports.XAUIProvider = _chunkOHEHPQLCcjs.XAUIProvider; exports.alertRecipe = _chunkK7LLERKTcjs.alertRecipe; exports.avatarRecipe = _chunkI66VMLHEcjs.avatarRecipe; exports.badgeRecipe = _chunkDUQUCOUYcjs.badgeRecipe; exports.buildRadius = _chunkOHEHPQLCcjs.buildRadius; exports.buildShadows = _chunkOHEHPQLCcjs.buildShadows; exports.buildSlots = _chunkPBR44KVVcjs.buildSlots; exports.buttonRecipe = _chunkDBXFFJTCcjs.buttonRecipe; exports.cardRecipe = _chunkUORTYL63cjs.cardRecipe; exports.checkboxRecipe = _chunkCNNLMMFVcjs.checkboxRecipe; exports.childrenToString = _chunk54FJOKANcjs.childrenToString; exports.chipRecipe = _chunkQY4MN7X3cjs.chipRecipe; exports.closeButtonBase = _chunkCYS6U374cjs.closeButtonBase; exports.createRecipe = _chunkFNEUOBCVcjs.createRecipe; exports.createSlotContext = _chunk54FJOKANcjs.createSlotContext; exports.createTheme = _chunkOHEHPQLCcjs.createTheme; exports.decoratorPadding = _chunkTVCS5UOEcjs.decoratorPadding; exports.defaultTheme = _chunkOHEHPQLCcjs.defaultTheme; exports.deriveColors = _chunkOHEHPQLCcjs.deriveColors; exports.deriveTint = _chunk57SJ4LJFcjs.deriveTint; exports.dividerRecipe = _chunkVSALV7VOcjs.dividerRecipe; exports.extractPastedCode = _chunkPBR44KVVcjs.extractPastedCode; exports.inputOTPRecipe = _chunkPBR44KVVcjs.inputOTPRecipe; exports.inputRecipe = _chunkQ3D6KIVFcjs.inputRecipe; exports.markBackground = _chunkUORTYL63cjs.markBackground; exports.markOverlay = _chunk6M7RUU7Vcjs.markOverlay; exports.mergeProps = _chunk54FJOKANcjs.mergeProps; exports.mergeRefs = _chunkH4E4HDEPcjs.mergeRefs; exports.palette = _chunkOHEHPQLCcjs.palette; exports.placementInsets = _chunkDUQUCOUYcjs.placementInsets; exports.pressScaleFor = _chunk6M7RUU7Vcjs.pressScaleFor; exports.primitives = _chunkOHEHPQLCcjs.primitives; exports.radioRecipe = _chunkMSMZBUZOcjs.radioRecipe; exports.radiusAxis = _chunkFNEUOBCVcjs.radiusAxis; exports.resolveAnimation = _chunk6M7RUU7Vcjs.resolveAnimation; exports.resolveSlotAnimation = _chunk6M7RUU7Vcjs.resolveSlotAnimation; exports.rippleRadiusFor = _chunk6M7RUU7Vcjs.rippleRadiusFor; exports.skeletonRecipe = _chunkLT6XHFXJcjs.skeletonRecipe; exports.sourceKeys = _chunkOHEHPQLCcjs.sourceKeys; exports.spinnerRecipe = _chunkXWMB66ZMcjs.spinnerRecipe; exports.switchRecipe = _chunkOX2YNMNScjs.switchRecipe; exports.tokens = _chunkOHEHPQLCcjs.tokens; exports.typographyRecipe = _chunkAOEXU5UVcjs.typographyRecipe; exports.useAlert = _chunkK7LLERKTcjs.useAlert; exports.useAvatar = _chunkI66VMLHEcjs.useAvatar; exports.useButton = _chunkDBXFFJTCcjs.useButton; exports.useCard = _chunkUORTYL63cjs.useCard; exports.useCheckbox = _chunkCNNLMMFVcjs.useCheckbox; exports.useChip = _chunkQY4MN7X3cjs.useChip; exports.useColorMode = _chunk57SJ4LJFcjs.useColorMode; exports.useControllableState = _chunk7EIHHOHPcjs.useControllableState; exports.useFeedback = _chunk6M7RUU7Vcjs.useFeedback; exports.useGrid = _chunk7CTIE42Jcjs.useGrid; exports.useIconContext = _chunkPCWT2YBEcjs.useIconContext; exports.useInput = _chunkQ3D6KIVFcjs.useInput; exports.useInputGroup = _chunkTVCS5UOEcjs.useInputGroup; exports.useInputOTP = _chunkPBR44KVVcjs.useInputOTP; exports.useInputOTPBox = _chunkPBR44KVVcjs.useInputOTPBox; exports.useMergedRef = _chunkK4TWKF5Ucjs.useMergedRef; exports.usePressState = _chunk7DPL3ZDScjs.usePressState; exports.usePrevious = _chunkK4TWKF5Ucjs.usePrevious; exports.useRadio = _chunkMSMZBUZOcjs.useRadio; exports.useRotation = _chunkK4TWKF5Ucjs.useRotation; exports.useStyleProps = _chunkI6ZB3FZIcjs.useStyleProps; exports.useSwitch = _chunkOX2YNMNScjs.useSwitch; exports.useTextArea = _chunkCM4LI5OHcjs.useTextArea; exports.useThemeColor = _chunk57SJ4LJFcjs.useThemeColor; exports.useXAUITheme = _chunk57SJ4LJFcjs.useXAUITheme;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Alert, AlertCloseProps, AlertContentProps, AlertContextValue, AlertDescriptionProps, AlertIconProps, AlertProps, AlertSize, AlertSlot, AlertTitleProps, AlertVariant, alertRecipe, useAlert } from './components/alert/index.cjs';
|
|
2
2
|
export { Avatar, AvatarContextValue, AvatarFallbackProps, AvatarImageProps, AvatarInitialsProps, AvatarProps, AvatarSize, AvatarSlot, AvatarVariant, avatarRecipe, useAvatar } from './components/avatar/index.cjs';
|
|
3
|
+
export { Badge, BadgePlacement, BadgeProps, BadgeSize, BadgeSlot, BadgeVariant, badgeRecipe, placementInsets } from './components/badge/index.cjs';
|
|
3
4
|
export { Button, ButtonContextValue, ButtonIconProps, ButtonLabelProps, ButtonProps, ButtonSize, ButtonSlot, ButtonSpinnerProps, ButtonVariant, buttonRecipe, useButton } from './components/button/index.cjs';
|
|
4
5
|
export { CARD_BACKGROUND, Card, CardBackgroundProps, CardBodyProps, CardContextValue, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardSize, CardSlot, CardTitleProps, CardVariant, cardRecipe, markBackground, useCard } from './components/card/index.cjs';
|
|
5
6
|
export { Checkbox, CheckboxContextValue, CheckboxIndicator, CheckboxIndicatorProps, CheckboxLabel, CheckboxLabelProps, CheckboxProps, CheckboxRoot, CheckboxSize, CheckboxSlot, CheckboxVariant, checkboxRecipe, useCheckbox } from './components/checkbox/index.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Alert, AlertCloseProps, AlertContentProps, AlertContextValue, AlertDescriptionProps, AlertIconProps, AlertProps, AlertSize, AlertSlot, AlertTitleProps, AlertVariant, alertRecipe, useAlert } from './components/alert/index.js';
|
|
2
2
|
export { Avatar, AvatarContextValue, AvatarFallbackProps, AvatarImageProps, AvatarInitialsProps, AvatarProps, AvatarSize, AvatarSlot, AvatarVariant, avatarRecipe, useAvatar } from './components/avatar/index.js';
|
|
3
|
+
export { Badge, BadgePlacement, BadgeProps, BadgeSize, BadgeSlot, BadgeVariant, badgeRecipe, placementInsets } from './components/badge/index.js';
|
|
3
4
|
export { Button, ButtonContextValue, ButtonIconProps, ButtonLabelProps, ButtonProps, ButtonSize, ButtonSlot, ButtonSpinnerProps, ButtonVariant, buttonRecipe, useButton } from './components/button/index.js';
|
|
4
5
|
export { CARD_BACKGROUND, Card, CardBackgroundProps, CardBodyProps, CardContextValue, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardSize, CardSlot, CardTitleProps, CardVariant, cardRecipe, markBackground, useCard } from './components/card/index.js';
|
|
5
6
|
export { Checkbox, CheckboxContextValue, CheckboxIndicator, CheckboxIndicatorProps, CheckboxLabel, CheckboxLabelProps, CheckboxProps, CheckboxRoot, CheckboxSize, CheckboxSlot, CheckboxVariant, checkboxRecipe, useCheckbox } from './components/checkbox/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TextArea,
|
|
3
|
+
useTextArea
|
|
4
|
+
} from "./chunk-HXL2QCMR.js";
|
|
1
5
|
import {
|
|
2
6
|
TextSpan,
|
|
3
7
|
Typography,
|
|
@@ -27,6 +31,10 @@ import {
|
|
|
27
31
|
sourceKeys,
|
|
28
32
|
tokens
|
|
29
33
|
} from "./chunk-TZG3DERP.js";
|
|
34
|
+
import {
|
|
35
|
+
Divider,
|
|
36
|
+
dividerRecipe
|
|
37
|
+
} from "./chunk-JCYWU5TO.js";
|
|
30
38
|
import {
|
|
31
39
|
InputGroup,
|
|
32
40
|
InputGroupField,
|
|
@@ -48,6 +56,16 @@ import {
|
|
|
48
56
|
useInputOTP,
|
|
49
57
|
useInputOTPBox
|
|
50
58
|
} from "./chunk-SLUJFE6R.js";
|
|
59
|
+
import {
|
|
60
|
+
Input,
|
|
61
|
+
InputDescription,
|
|
62
|
+
InputError,
|
|
63
|
+
InputField,
|
|
64
|
+
InputLabel,
|
|
65
|
+
InputRoot,
|
|
66
|
+
inputRecipe,
|
|
67
|
+
useInput
|
|
68
|
+
} from "./chunk-L55CDXNI.js";
|
|
51
69
|
import {
|
|
52
70
|
Radio,
|
|
53
71
|
RadioIndicator,
|
|
@@ -73,20 +91,6 @@ import {
|
|
|
73
91
|
switchRecipe,
|
|
74
92
|
useSwitch
|
|
75
93
|
} from "./chunk-BA2MPBCO.js";
|
|
76
|
-
import {
|
|
77
|
-
TextArea,
|
|
78
|
-
useTextArea
|
|
79
|
-
} from "./chunk-HXL2QCMR.js";
|
|
80
|
-
import {
|
|
81
|
-
Input,
|
|
82
|
-
InputDescription,
|
|
83
|
-
InputError,
|
|
84
|
-
InputField,
|
|
85
|
-
InputLabel,
|
|
86
|
-
InputRoot,
|
|
87
|
-
inputRecipe,
|
|
88
|
-
useInput
|
|
89
|
-
} from "./chunk-L55CDXNI.js";
|
|
90
94
|
import {
|
|
91
95
|
Alert,
|
|
92
96
|
alertRecipe,
|
|
@@ -97,6 +101,11 @@ import {
|
|
|
97
101
|
avatarRecipe,
|
|
98
102
|
useAvatar
|
|
99
103
|
} from "./chunk-ZA6RT3XQ.js";
|
|
104
|
+
import {
|
|
105
|
+
Badge,
|
|
106
|
+
badgeRecipe,
|
|
107
|
+
placementInsets
|
|
108
|
+
} from "./chunk-LZK77LFX.js";
|
|
100
109
|
import {
|
|
101
110
|
Button,
|
|
102
111
|
buttonRecipe,
|
|
@@ -169,10 +178,6 @@ import {
|
|
|
169
178
|
usePressState
|
|
170
179
|
} from "./chunk-423RQBOX.js";
|
|
171
180
|
import "./chunk-EGLLDKN6.js";
|
|
172
|
-
import {
|
|
173
|
-
Divider,
|
|
174
|
-
dividerRecipe
|
|
175
|
-
} from "./chunk-JCYWU5TO.js";
|
|
176
181
|
import {
|
|
177
182
|
Slot,
|
|
178
183
|
childrenToString,
|
|
@@ -200,6 +205,7 @@ import "./chunk-GGW42MY4.js";
|
|
|
200
205
|
export {
|
|
201
206
|
Alert,
|
|
202
207
|
Avatar,
|
|
208
|
+
Badge,
|
|
203
209
|
Button,
|
|
204
210
|
CARD_BACKGROUND,
|
|
205
211
|
Card,
|
|
@@ -270,6 +276,7 @@ export {
|
|
|
270
276
|
XAUIProvider,
|
|
271
277
|
alertRecipe,
|
|
272
278
|
avatarRecipe,
|
|
279
|
+
badgeRecipe,
|
|
273
280
|
buildRadius,
|
|
274
281
|
buildShadows,
|
|
275
282
|
buildSlots,
|
|
@@ -295,6 +302,7 @@ export {
|
|
|
295
302
|
mergeProps,
|
|
296
303
|
mergeRefs,
|
|
297
304
|
palette,
|
|
305
|
+
placementInsets,
|
|
298
306
|
pressScaleFor,
|
|
299
307
|
primitives,
|
|
300
308
|
radioRecipe,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaui/native",
|
|
3
|
-
"version": "0.9.1-alpha.
|
|
3
|
+
"version": "0.9.1-alpha.34",
|
|
4
4
|
"description": "Composition-first React Native UI components with native animations powered by Reanimated",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -47,6 +47,16 @@
|
|
|
47
47
|
"default": "./dist/components/avatar/index.cjs"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
+
"./badge": {
|
|
51
|
+
"import": {
|
|
52
|
+
"types": "./dist/components/badge/index.d.ts",
|
|
53
|
+
"default": "./dist/components/badge/index.js"
|
|
54
|
+
},
|
|
55
|
+
"require": {
|
|
56
|
+
"types": "./dist/components/badge/index.d.cts",
|
|
57
|
+
"default": "./dist/components/badge/index.cjs"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
50
60
|
"./button": {
|
|
51
61
|
"import": {
|
|
52
62
|
"types": "./dist/components/button/index.d.ts",
|