@kanso-labs/react-native-kanso-ui 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/badge/index.js +74 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/badge/styles.js +51 -0
- package/dist/badge/styles.js.map +1 -0
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/pending.js +1 -1
- package/dist/button/slots.d.ts +2 -2
- package/dist/calendar/index.js +1182 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/calendar/styles.js +120 -0
- package/dist/calendar/styles.js.map +1 -0
- package/dist/chip/index.js +2 -2
- package/dist/components/app-bar/index.d.ts +111 -0
- package/dist/components/app-bar/index.js +341 -0
- package/dist/components/app-bar/index.js.map +1 -0
- package/dist/components/avatar/index.d.ts +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/calendar/index.d.ts +51 -0
- package/dist/components/calendar/index.js +82 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +3 -3
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chip-group/index.d.ts +1 -1
- package/dist/components/chip-group/index.js +4 -4
- package/dist/components/copy-field/index.d.ts +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/currency/index.d.ts +1 -1
- package/dist/components/currency/index.js +1 -1
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/dialog/index.js +2 -2
- package/dist/components/icon-button/index.d.ts +1 -1
- package/dist/components/icon-button/index.js +2 -2
- package/dist/components/link/index.d.ts +1 -1
- package/dist/components/link/index.js +3 -3
- package/dist/components/list/index.d.ts +1 -1
- package/dist/components/list/index.js +5 -5
- package/dist/components/list-detail/index.d.ts +56 -0
- package/dist/components/list-detail/index.js +169 -0
- package/dist/components/list-detail/index.js.map +1 -0
- package/dist/components/list-item/index.d.ts +1 -1
- package/dist/components/list-item/index.js +1 -1
- package/dist/components/menu/index.d.ts +1 -1
- package/dist/components/menu/index.js +7 -7
- package/dist/components/meter/index.d.ts +1 -1
- package/dist/components/meter/index.js +1 -1
- package/dist/components/navigation-bar/index.d.ts +164 -0
- package/dist/components/navigation-bar/index.js +470 -0
- package/dist/components/navigation-bar/index.js.map +1 -0
- package/dist/components/navigation-rail/index.d.ts +68 -0
- package/dist/components/navigation-rail/index.js +294 -0
- package/dist/components/navigation-rail/index.js.map +1 -0
- package/dist/components/number-field/index.d.ts +1 -1
- package/dist/components/number-field/index.js +5 -5
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/popover/index.js +3 -3
- package/dist/components/product-icon/index.d.ts +1 -1
- package/dist/components/progress-indicator/index.d.ts +1 -1
- package/dist/components/progress-indicator/index.js +3 -3
- package/dist/components/radio-group/index.d.ts +1 -1
- package/dist/components/radio-group/index.js +3 -3
- package/dist/components/search-field/index.d.ts +1 -1
- package/dist/components/search-field/index.js +5 -5
- package/dist/components/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js +5 -5
- package/dist/components/separator/index.d.ts +1 -1
- package/dist/components/separator/index.js +1 -1
- package/dist/components/sheet/index.d.ts +1 -1
- package/dist/components/sheet/index.js +3 -3
- package/dist/components/snackbar/index.d.ts +1 -1
- package/dist/components/snackbar/index.js +4 -4
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/stack/index.js +1 -1
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/index.js +4 -4
- package/dist/components/text/index.d.ts +1 -1
- package/dist/components/text/index.js +1 -1
- package/dist/components/text-field/index.d.ts +1 -1
- package/dist/components/text-field/index.js +1 -1
- package/dist/control/checkbox-box.js +2 -2
- package/dist/control/index.js +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js +4 -4
- package/dist/form/index.d.ts +1 -1
- package/dist/glyphs/index.js +21 -3
- package/dist/glyphs/index.js.map +1 -1
- package/dist/hooks/useAppBarScroll.d.ts +56 -0
- package/dist/hooks/useAppBarScroll.js +87 -0
- package/dist/hooks/useAppBarScroll.js.map +1 -0
- package/dist/i18n/messages.js +374 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.js +10 -4
- package/dist/indicator/index.d.ts +2 -2
- package/dist/indicator/index.js +3 -3
- package/dist/indicator/motion.js +1 -1
- package/dist/mark/index.d.ts +1 -1
- package/dist/mark/index.js +2 -2
- package/dist/modal/index.d.ts +1 -1
- package/dist/modal/index.js +2 -2
- package/dist/navigation/index.d.ts +36 -0
- package/dist/navigation/index.js +454 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/styles.js +83 -0
- package/dist/navigation/styles.js.map +1 -0
- package/dist/overlay/anchored.d.ts +2 -2
- package/dist/overlay/anchored.js +1 -1
- package/dist/overlay/host.d.ts +2 -2
- package/dist/overlay/host.js +1 -1
- package/dist/overlay/panel.js +2 -2
- package/dist/press/index.js +75 -69
- package/dist/press/index.js.map +1 -1
- package/dist/router/index.js +1 -1
- package/dist/row/index.js +1 -1
- package/dist/theme/scope.js +1 -1
- package/dist/theme-scope.d.ts +1 -1
- package/dist/theme-scope.js +1 -1
- package/dist/typography/fonts.js +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { IconStyleContext } from "../../glyphs/icon-style.js";
|
|
2
|
+
import { useTheme } from "../../theme/scope.js";
|
|
3
|
+
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
4
|
+
import { hasContent } from "../../row/index.js";
|
|
5
|
+
import { Text as Text$1 } from "../text/index.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { StyleSheet, View } from "react-native";
|
|
8
|
+
import Animated, { Easing, useAnimatedStyle, useReducedMotion, withTiming } from "react-native-reanimated";
|
|
9
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/app-bar/index.tsx
|
|
12
|
+
const ICON_SIZE = 24;
|
|
13
|
+
const GLYPH_INSET = 12;
|
|
14
|
+
const HEIGHTS = {
|
|
15
|
+
lg: {
|
|
16
|
+
plain: 120,
|
|
17
|
+
withSubtitle: 152
|
|
18
|
+
},
|
|
19
|
+
md: {
|
|
20
|
+
plain: 112,
|
|
21
|
+
withSubtitle: 136
|
|
22
|
+
},
|
|
23
|
+
sm: {
|
|
24
|
+
plain: 64,
|
|
25
|
+
withSubtitle: 64
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const HEADLINE_ROLES = {
|
|
29
|
+
lg: "headlineMedium",
|
|
30
|
+
md: "headlineSmall",
|
|
31
|
+
sm: "titleLarge"
|
|
32
|
+
};
|
|
33
|
+
const EDGES = [
|
|
34
|
+
"left",
|
|
35
|
+
"right",
|
|
36
|
+
"top"
|
|
37
|
+
];
|
|
38
|
+
const styles = StyleSheet.create({
|
|
39
|
+
center: { textAlign: "center" },
|
|
40
|
+
pinned: { zIndex: 1 },
|
|
41
|
+
row: {
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
flexDirection: "row",
|
|
44
|
+
width: "100%"
|
|
45
|
+
},
|
|
46
|
+
safeArea: { alignItems: "center" }
|
|
47
|
+
});
|
|
48
|
+
const stylesOf = themedStyles(({ sizing, spacing }) => StyleSheet.create({
|
|
49
|
+
row: { gap: spacing.xs },
|
|
50
|
+
slot: {
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
flexDirection: "row",
|
|
53
|
+
flexShrink: 0,
|
|
54
|
+
gap: 48 - sizing.controlSm,
|
|
55
|
+
paddingHorizontal: (48 - sizing.controlSm) / 2
|
|
56
|
+
},
|
|
57
|
+
text: {
|
|
58
|
+
flexGrow: 1,
|
|
59
|
+
flexShrink: 1,
|
|
60
|
+
justifyContent: "center",
|
|
61
|
+
minWidth: 0,
|
|
62
|
+
paddingVertical: spacing.sm
|
|
63
|
+
}
|
|
64
|
+
}));
|
|
65
|
+
/**
|
|
66
|
+
* Material Design's top app bar: the bar at the top of a screen carrying its
|
|
67
|
+
* title, one or two actions, and the way back out.
|
|
68
|
+
*
|
|
69
|
+
* ```tsx
|
|
70
|
+
* <AppBar
|
|
71
|
+
* headline="Headline"
|
|
72
|
+
* leading={<IconButton aria-label="Back"><ArrowBackGlyph /></IconButton>}
|
|
73
|
+
* />
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* Three sizes. `sm` is a 64dp bar for a screen whose title is a label; `md`
|
|
77
|
+
* and `lg` are the flexible bars, which give the headline a larger type role
|
|
78
|
+
* and grow to fit a subtitle or a headline that wraps.
|
|
79
|
+
*
|
|
80
|
+
* It paints its own surface, from the screen's top edge, and keeps its
|
|
81
|
+
* contents clear of the status bar and the notch. Separating itself from the
|
|
82
|
+
* content beneath is its job, which is why `scrolled` and `collapsed` exist;
|
|
83
|
+
* `useAppBarScroll` sets both from the screen's scroll view.
|
|
84
|
+
*/
|
|
85
|
+
function AppBar(t0) {
|
|
86
|
+
const $ = c(58);
|
|
87
|
+
let contentInset;
|
|
88
|
+
let contentMaxInlineSize;
|
|
89
|
+
let headline;
|
|
90
|
+
let leading;
|
|
91
|
+
let props;
|
|
92
|
+
let style;
|
|
93
|
+
let subtitle;
|
|
94
|
+
let t1;
|
|
95
|
+
let t2;
|
|
96
|
+
let t3;
|
|
97
|
+
let t4;
|
|
98
|
+
let t5;
|
|
99
|
+
let trailing;
|
|
100
|
+
if ($[0] !== t0) {
|
|
101
|
+
({align: t1, collapsed: t2, contentInset, contentMaxInlineSize, headline, leading, pinned: t3, scrolled: t4, size: t5, style, subtitle, trailing, ...props} = t0);
|
|
102
|
+
$[0] = t0;
|
|
103
|
+
$[1] = contentInset;
|
|
104
|
+
$[2] = contentMaxInlineSize;
|
|
105
|
+
$[3] = headline;
|
|
106
|
+
$[4] = leading;
|
|
107
|
+
$[5] = props;
|
|
108
|
+
$[6] = style;
|
|
109
|
+
$[7] = subtitle;
|
|
110
|
+
$[8] = t1;
|
|
111
|
+
$[9] = t2;
|
|
112
|
+
$[10] = t3;
|
|
113
|
+
$[11] = t4;
|
|
114
|
+
$[12] = t5;
|
|
115
|
+
$[13] = trailing;
|
|
116
|
+
} else {
|
|
117
|
+
contentInset = $[1];
|
|
118
|
+
contentMaxInlineSize = $[2];
|
|
119
|
+
headline = $[3];
|
|
120
|
+
leading = $[4];
|
|
121
|
+
props = $[5];
|
|
122
|
+
style = $[6];
|
|
123
|
+
subtitle = $[7];
|
|
124
|
+
t1 = $[8];
|
|
125
|
+
t2 = $[9];
|
|
126
|
+
t3 = $[10];
|
|
127
|
+
t4 = $[11];
|
|
128
|
+
t5 = $[12];
|
|
129
|
+
trailing = $[13];
|
|
130
|
+
}
|
|
131
|
+
const align = t1 === void 0 ? "start" : t1;
|
|
132
|
+
const collapsed = t2 === void 0 ? false : t2;
|
|
133
|
+
const pinned = t3 === void 0 ? false : t3;
|
|
134
|
+
const scrolled = t4 === void 0 ? false : t4;
|
|
135
|
+
const size = t5 === void 0 ? "sm" : t5;
|
|
136
|
+
const theme = useTheme();
|
|
137
|
+
const own = stylesOf(theme);
|
|
138
|
+
const inset = contentInset ?? theme.spacing.lg;
|
|
139
|
+
const collapse = collapsed && size !== "sm";
|
|
140
|
+
const hasLeading = hasContent(leading);
|
|
141
|
+
const hasTrailing = hasContent(trailing);
|
|
142
|
+
let t6;
|
|
143
|
+
if ($[14] !== collapse || $[15] !== subtitle) {
|
|
144
|
+
t6 = hasContent(subtitle) && !collapse;
|
|
145
|
+
$[14] = collapse;
|
|
146
|
+
$[15] = subtitle;
|
|
147
|
+
$[16] = t6;
|
|
148
|
+
} else t6 = $[16];
|
|
149
|
+
const showsSubtitle = t6;
|
|
150
|
+
const heights = HEIGHTS[collapse ? "sm" : size];
|
|
151
|
+
const fill = useFill(scrolled);
|
|
152
|
+
const t7 = Animated;
|
|
153
|
+
const t8 = pinned ? styles.pinned : null;
|
|
154
|
+
let t9;
|
|
155
|
+
if ($[17] !== fill || $[18] !== style || $[19] !== t8) {
|
|
156
|
+
t9 = composeStyles(fill, t8, style);
|
|
157
|
+
$[17] = fill;
|
|
158
|
+
$[18] = style;
|
|
159
|
+
$[19] = t8;
|
|
160
|
+
$[20] = t9;
|
|
161
|
+
} else t9 = $[20];
|
|
162
|
+
const T0 = SafeAreaView;
|
|
163
|
+
const t10 = EDGES;
|
|
164
|
+
const t11 = styles;
|
|
165
|
+
const T1 = View;
|
|
166
|
+
const t12 = composeStyles(styles.row, own.row, {
|
|
167
|
+
maxWidth: contentMaxInlineSize,
|
|
168
|
+
minHeight: showsSubtitle ? heights.withSubtitle : heights.plain,
|
|
169
|
+
paddingEnd: edgePadding(inset, hasTrailing),
|
|
170
|
+
paddingStart: edgePadding(inset, hasLeading)
|
|
171
|
+
});
|
|
172
|
+
let t13;
|
|
173
|
+
if ($[21] !== hasLeading || $[22] !== leading || $[23] !== theme) {
|
|
174
|
+
t13 = hasLeading ? /* @__PURE__ */ jsx(Slot, {
|
|
175
|
+
color: theme.colors.onSurface,
|
|
176
|
+
children: leading
|
|
177
|
+
}) : null;
|
|
178
|
+
$[21] = hasLeading;
|
|
179
|
+
$[22] = leading;
|
|
180
|
+
$[23] = theme;
|
|
181
|
+
$[24] = t13;
|
|
182
|
+
} else t13 = $[24];
|
|
183
|
+
let t14;
|
|
184
|
+
if ($[25] !== align || $[26] !== collapse || $[27] !== headline || $[28] !== size) {
|
|
185
|
+
t14 = hasContent(headline) ? /* @__PURE__ */ jsx(Text$1, {
|
|
186
|
+
role: "heading",
|
|
187
|
+
style: align === "center" ? styles.center : void 0,
|
|
188
|
+
variant: HEADLINE_ROLES[collapse ? "sm" : size],
|
|
189
|
+
children: headline
|
|
190
|
+
}) : null;
|
|
191
|
+
$[25] = align;
|
|
192
|
+
$[26] = collapse;
|
|
193
|
+
$[27] = headline;
|
|
194
|
+
$[28] = size;
|
|
195
|
+
$[29] = t14;
|
|
196
|
+
} else t14 = $[29];
|
|
197
|
+
let t15;
|
|
198
|
+
if ($[30] !== align || $[31] !== showsSubtitle || $[32] !== subtitle) {
|
|
199
|
+
t15 = showsSubtitle ? /* @__PURE__ */ jsx(Text$1, {
|
|
200
|
+
style: align === "center" ? styles.center : void 0,
|
|
201
|
+
tone: "muted",
|
|
202
|
+
variant: "bodyMedium",
|
|
203
|
+
children: subtitle
|
|
204
|
+
}) : null;
|
|
205
|
+
$[30] = align;
|
|
206
|
+
$[31] = showsSubtitle;
|
|
207
|
+
$[32] = subtitle;
|
|
208
|
+
$[33] = t15;
|
|
209
|
+
} else t15 = $[33];
|
|
210
|
+
let t16;
|
|
211
|
+
if ($[34] !== own.text || $[35] !== t14 || $[36] !== t15) {
|
|
212
|
+
t16 = /* @__PURE__ */ jsxs(View, {
|
|
213
|
+
style: own.text,
|
|
214
|
+
children: [t14, t15]
|
|
215
|
+
});
|
|
216
|
+
$[34] = own.text;
|
|
217
|
+
$[35] = t14;
|
|
218
|
+
$[36] = t15;
|
|
219
|
+
$[37] = t16;
|
|
220
|
+
} else t16 = $[37];
|
|
221
|
+
let t17;
|
|
222
|
+
if ($[38] !== hasTrailing || $[39] !== theme || $[40] !== trailing) {
|
|
223
|
+
t17 = hasTrailing ? /* @__PURE__ */ jsx(Slot, {
|
|
224
|
+
color: theme.colors.onSurfaceVariant,
|
|
225
|
+
children: trailing
|
|
226
|
+
}) : null;
|
|
227
|
+
$[38] = hasTrailing;
|
|
228
|
+
$[39] = theme;
|
|
229
|
+
$[40] = trailing;
|
|
230
|
+
$[41] = t17;
|
|
231
|
+
} else t17 = $[41];
|
|
232
|
+
let t18;
|
|
233
|
+
if ($[42] !== T1 || $[43] !== t12 || $[44] !== t13 || $[45] !== t16 || $[46] !== t17) {
|
|
234
|
+
t18 = /* @__PURE__ */ jsxs(T1, {
|
|
235
|
+
style: t12,
|
|
236
|
+
children: [
|
|
237
|
+
t13,
|
|
238
|
+
t16,
|
|
239
|
+
t17
|
|
240
|
+
]
|
|
241
|
+
});
|
|
242
|
+
$[42] = T1;
|
|
243
|
+
$[43] = t12;
|
|
244
|
+
$[44] = t13;
|
|
245
|
+
$[45] = t16;
|
|
246
|
+
$[46] = t17;
|
|
247
|
+
$[47] = t18;
|
|
248
|
+
} else t18 = $[47];
|
|
249
|
+
let t19;
|
|
250
|
+
if ($[48] !== T0 || $[49] !== t10 || $[50] !== t11.safeArea || $[51] !== t18) {
|
|
251
|
+
t19 = /* @__PURE__ */ jsx(T0, {
|
|
252
|
+
edges: t10,
|
|
253
|
+
style: t11.safeArea,
|
|
254
|
+
children: t18
|
|
255
|
+
});
|
|
256
|
+
$[48] = T0;
|
|
257
|
+
$[49] = t10;
|
|
258
|
+
$[50] = t11.safeArea;
|
|
259
|
+
$[51] = t18;
|
|
260
|
+
$[52] = t19;
|
|
261
|
+
} else t19 = $[52];
|
|
262
|
+
let t20;
|
|
263
|
+
if ($[53] !== props || $[54] !== t19 || $[55] !== t7.View || $[56] !== t9) {
|
|
264
|
+
t20 = /* @__PURE__ */ jsx(t7.View, {
|
|
265
|
+
...props,
|
|
266
|
+
style: t9,
|
|
267
|
+
children: t19
|
|
268
|
+
});
|
|
269
|
+
$[53] = props;
|
|
270
|
+
$[54] = t19;
|
|
271
|
+
$[55] = t7.View;
|
|
272
|
+
$[56] = t9;
|
|
273
|
+
$[57] = t20;
|
|
274
|
+
} else t20 = $[57];
|
|
275
|
+
return t20;
|
|
276
|
+
}
|
|
277
|
+
function edgePadding(inset, hasSlot) {
|
|
278
|
+
return hasSlot ? Math.max(0, inset - GLYPH_INSET) : inset;
|
|
279
|
+
}
|
|
280
|
+
function iconStyleOf(color) {
|
|
281
|
+
return {
|
|
282
|
+
color,
|
|
283
|
+
size: ICON_SIZE
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function Slot(t0) {
|
|
287
|
+
const $ = c(10);
|
|
288
|
+
const { children, color } = t0;
|
|
289
|
+
const t1 = useTheme();
|
|
290
|
+
let t2;
|
|
291
|
+
if ($[0] !== t1) {
|
|
292
|
+
t2 = stylesOf(t1);
|
|
293
|
+
$[0] = t1;
|
|
294
|
+
$[1] = t2;
|
|
295
|
+
} else t2 = $[1];
|
|
296
|
+
const own = t2;
|
|
297
|
+
let t3;
|
|
298
|
+
if ($[2] !== color) {
|
|
299
|
+
t3 = iconStyleOf(color);
|
|
300
|
+
$[2] = color;
|
|
301
|
+
$[3] = t3;
|
|
302
|
+
} else t3 = $[3];
|
|
303
|
+
let t4;
|
|
304
|
+
if ($[4] !== children || $[5] !== own.slot) {
|
|
305
|
+
t4 = /* @__PURE__ */ jsx(View, {
|
|
306
|
+
style: own.slot,
|
|
307
|
+
children
|
|
308
|
+
});
|
|
309
|
+
$[4] = children;
|
|
310
|
+
$[5] = own.slot;
|
|
311
|
+
$[6] = t4;
|
|
312
|
+
} else t4 = $[6];
|
|
313
|
+
let t5;
|
|
314
|
+
if ($[7] !== t3 || $[8] !== t4) {
|
|
315
|
+
t5 = /* @__PURE__ */ jsx(IconStyleContext, {
|
|
316
|
+
value: t3,
|
|
317
|
+
children: t4
|
|
318
|
+
});
|
|
319
|
+
$[7] = t3;
|
|
320
|
+
$[8] = t4;
|
|
321
|
+
$[9] = t5;
|
|
322
|
+
} else t5 = $[9];
|
|
323
|
+
return t5;
|
|
324
|
+
}
|
|
325
|
+
function useFill(scrolled) {
|
|
326
|
+
const { colors, motion } = useTheme();
|
|
327
|
+
const reduceMotion = useReducedMotion();
|
|
328
|
+
const fill = scrolled ? colors.surfaceContainer : colors.surface;
|
|
329
|
+
const timing = {
|
|
330
|
+
duration: motion.durationMedium1,
|
|
331
|
+
easing: Easing.bezier(...motion.easingEmphasized)
|
|
332
|
+
};
|
|
333
|
+
return useAnimatedStyle(() => {
|
|
334
|
+
"worklet";
|
|
335
|
+
return { backgroundColor: reduceMotion ? fill : withTiming(fill, timing) };
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
339
|
+
export { AppBar };
|
|
340
|
+
|
|
341
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","ColorValue","ViewProps","ViewStyle","AnimatedStyle","Edge","StyleSheet","View","Animated","Easing","useAnimatedStyle","useReducedMotion","withTiming","SafeAreaView","IconStyle","TypeRole","IconStyleContext","COLLAPSED_BLOCK_SIZE","TARGET_SIZE","hasContent","useTheme","composeStyles","themedStyles","Text","ICON_SIZE","GLYPH_INSET","HEIGHTS","lg","plain","withSubtitle","md","sm","const","HEADLINE_ROLES","Readonly","Record","AppBarSize","EDGES","styles","create","center","textAlign","pinned","zIndex","row","alignItems","flexDirection","width","safeArea","stylesOf","sizing","spacing","gap","xs","slot","flexShrink","controlSm","paddingHorizontal","text","flexGrow","justifyContent","minWidth","paddingVertical","AppBarProps","Omit","align","collapsed","contentInset","contentMaxInlineSize","headline","leading","ref","scrolled","size","subtitle","trailing","SlotProps","children","color","AppBar","t0","$","_c","props","style","t1","t2","t3","t4","t5","undefined","theme","own","inset","collapse","hasLeading","hasTrailing","t6","showsSubtitle","heights","fill","useFill","t7","t8","t9","T0","T1","t12","maxWidth","minHeight","paddingEnd","edgePadding","paddingStart","t13","colors","onSurface","t14","t15","t16","t17","onSurfaceVariant","t18","t19","t10","t11","t20","hasSlot","Math","max","iconStyleOf","Slot","motion","reduceMotion","surfaceContainer","surface","timing","duration","durationMedium1","easing","bezier","easingEmphasized","backgroundColor","_c","Text"],"sources":["../../../src/components/app-bar/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type { ColorValue, ViewProps, ViewStyle } from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { Edge } from 'react-native-safe-area-context'\n\nimport { StyleSheet, View } from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n withTiming,\n} from 'react-native-reanimated'\nimport { SafeAreaView } from 'react-native-safe-area-context'\n\nimport type { IconStyle } from '../../glyphs/icon-style'\nimport type { TypeRole } from '../../typography/roles'\n\nimport { IconStyleContext } from '../../glyphs/icon-style'\nimport { COLLAPSED_BLOCK_SIZE } from '../../hooks/useAppBarScroll'\nimport { TARGET_SIZE } from '../../press'\nimport { hasContent } from '../../row'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { Text } from '../text'\n\n// kanso-ui's AppBar, Material Design's top app bar in the three sizes the spec\n// recommends. `md` and `lg` are its medium and large *flexible* bars, the\n// newer of the two sets the spec gives and the one it recommends. The old\n// center-aligned variant is a configuration of every size, which is why\n// alignment is a prop.\n//\n// Heights are minimums rather than fixed. The flexible bars hug their text,\n// so a headline that wraps, or a larger text size the device asks for, makes\n// the bar taller rather than being cut off.\n//\n// The bar paints its surface from the screen's top edge, under the status\n// bar, and keeps its contents inside the safe area: a `SafeAreaView` pads it\n// by the status bar, the notch and a rounded corner wherever the bar meets\n// them, and by nothing where it does not, so a bar drawn below another view\n// takes no inset of its own.\n//\n// Three things differ from web's, each because of the platform.\n//\n// - **No heading level.** Native screen readers have no levels to move\n// between, so the headline is a header and `headingLevel` is gone.\n// - **`pinned` means outside the scroll view.** Native has no sticky\n// position, so a pinned bar is one the screen draws above its scroll view\n// rather than inside it, and the content scrolls beneath its lower edge.\n// - **The fill eases and the height does not.** Collapsing moves the height\n// and the headline's type role at once. React Native has no transition for\n// a type role, and easing the height alone would leave the text jumping\n// inside a moving bar. The fill a scrolled bar takes eases over medium 1\n// on the emphasized curve, as web's does, and arrives at once under\n// reduced motion.\n\n// The geometry Material Design lays a bar's icon buttons out on: a 48dp\n// target per button, edge to edge, with a 24dp icon centred in each, and the\n// outermost target 4dp in from the bar's edge, so a glyph lands at the\n// page's margin. IconButton draws a 40dp box with its 48dp target spilling\n// out through `hitSlop`, so a slot pads half the difference either side and\n// puts the whole of it between two buttons, which lays the targets edge to\n// edge as the spec does.\nconst ICON_SIZE = 24\n\n// How far an icon sits inside its target, which is how much less than the\n// content inset the row is padded on an edge that holds a slot. That puts a\n// leading glyph, rather than the edge of its target, at the inset.\nconst GLYPH_INSET = (TARGET_SIZE - ICON_SIZE) / 2\n\nconst HEIGHTS = {\n lg: { plain: 120, withSubtitle: 152 },\n md: { plain: 112, withSubtitle: 136 },\n sm: { plain: COLLAPSED_BLOCK_SIZE, withSubtitle: COLLAPSED_BLOCK_SIZE },\n} as const\n\n// One type role per size, as Material Design's own title tokens alias the\n// type scale rather than giving sizes of their own. A collapsed bar takes the\n// small one's.\nconst HEADLINE_ROLES: Readonly<Record<AppBarSize, TypeRole>> = {\n lg: 'headlineMedium',\n md: 'headlineSmall',\n sm: 'titleLarge',\n}\n\n// The bar's sides as well as its top, so a landscape notch is cleared too.\n// The bottom is the content's.\nconst EDGES: readonly Edge[] = ['left', 'right', 'top']\n\nconst styles = StyleSheet.create({\n center: {\n textAlign: 'center',\n },\n // Drawn over what follows it, so whatever strays past the scroll view's\n // top edge, an overscroll or a shadow, passes beneath the bar.\n pinned: {\n zIndex: 1,\n },\n row: {\n alignItems: 'center',\n flexDirection: 'row',\n width: '100%',\n },\n // The row, centred once it reaches `contentMaxInlineSize`.\n safeArea: {\n alignItems: 'center',\n },\n})\n\nconst stylesOf = themedStyles(({ sizing, spacing }) =>\n StyleSheet.create({\n row: {\n gap: spacing.xs,\n },\n // Slots hold their own size rather than being squeezed by a long\n // headline, and space their icon buttons by the spec's targets.\n slot: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n gap: TARGET_SIZE - sizing.controlSm,\n paddingHorizontal: (TARGET_SIZE - sizing.controlSm) / 2,\n },\n // The text takes the room the slots leave, and wraps inside it.\n text: {\n flexGrow: 1,\n flexShrink: 1,\n justifyContent: 'center',\n minWidth: 0,\n paddingVertical: spacing.sm,\n },\n }),\n)\n\ntype AppBarProps = Omit<ViewProps, 'children'> & {\n /**\n * Which of Material Design's alignments the text takes. `center` is the\n * configuration that replaced the old center-aligned variant.\n * @default 'start'\n */\n readonly align?: 'center' | 'start'\n /**\n * Collapses a flexible bar to the height and headline of the small one,\n * for a `pinned` bar over content that has been scrolled. Without it a\n * pinned `lg` keeps 152dp of the screen for as long as the screen is open.\n *\n * Controlled, as `scrolled` is: only the app knows which view scrolls and\n * how far into it the bar should have collapsed. `useAppBarScroll` derives\n * both from that view's scroll, and is the way to set them unless the app\n * needs a rule of its own. Ignored on `sm`, which is already the height\n * this collapses to, and the subtitle goes with the height.\n * @default false\n */\n readonly collapsed?: boolean\n /**\n * Where the bar's content starts on each edge, in dp: the headline where\n * nothing comes before it, and the leading icon's glyph where something\n * does. The trailing edge is the same mirrored. `0` draws a bar flush.\n *\n * The default is Material Design's margin for a top app bar, the spacing\n * scale's `lg` step, which is also the margin it gives body content, so a\n * bar and the screen beneath line up without either being told about the\n * other.\n * @default spacing.lg\n */\n readonly contentInset?: number\n /**\n * How wide the bar's contents may run, in dp, before they stop growing,\n * with the row centred in what is left. The bar's surface still paints\n * edge to edge. Unset, the row is as wide as the bar.\n */\n readonly contentMaxInlineSize?: number\n /**\n * The screen's title, a header for a screen reader. Wraps rather than\n * truncating, and grows the bar with it.\n */\n readonly headline?: ReactNode\n /**\n * Usually a back or menu icon button. Sits before the text, and hands an\n * icon the on-surface colour and a 24dp size through `useIconStyle()`.\n */\n readonly leading?: ReactNode\n /**\n * Marks a bar drawn above the screen's scroll view rather than inside it,\n * so it stays put while the content scrolls beneath its lower edge, and is\n * drawn over that content. A pinned bar is the one `collapsed` and\n * `scrolled` are for.\n * @default false\n */\n readonly pinned?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * Whether the content beneath has been scrolled. Material Design separates\n * a bar from scrolled content with a fill colour rather than a shadow, the\n * surface container role, and this is what applies it.\n *\n * Controlled, with no listener of its own: only the app knows which view\n * scrolls. `useAppBarScroll` derives it.\n * @default false\n */\n readonly scrolled?: boolean\n /**\n * `sm` is Material Design's small bar, 64dp; `md` and `lg` are its medium\n * and large flexible bars, 112dp and 120dp, or 136dp and 152dp with a\n * subtitle, which hug their text. The headline is title large, headline\n * small and headline medium in turn.\n * @default 'sm'\n */\n readonly size?: AppBarSize\n /** A second line under the headline. Makes `md` and `lg` taller. */\n readonly subtitle?: ReactNode\n /**\n * Actions, at the far end, usually icon buttons. An icon here takes the\n * on-surface-variant colour and a 24dp size through `useIconStyle()`.\n */\n readonly trailing?: ReactNode\n}\n\ntype AppBarSize = 'lg' | 'md' | 'sm'\n\ntype SlotProps = {\n readonly children: ReactNode\n readonly color: ColorValue\n}\n\n/**\n * Material Design's top app bar: the bar at the top of a screen carrying its\n * title, one or two actions, and the way back out.\n *\n * ```tsx\n * <AppBar\n * headline=\"Headline\"\n * leading={<IconButton aria-label=\"Back\"><ArrowBackGlyph /></IconButton>}\n * />\n * ```\n *\n * Three sizes. `sm` is a 64dp bar for a screen whose title is a label; `md`\n * and `lg` are the flexible bars, which give the headline a larger type role\n * and grow to fit a subtitle or a headline that wraps.\n *\n * It paints its own surface, from the screen's top edge, and keeps its\n * contents clear of the status bar and the notch. Separating itself from the\n * content beneath is its job, which is why `scrolled` and `collapsed` exist;\n * `useAppBarScroll` sets both from the screen's scroll view.\n */\nfunction AppBar({\n align = 'start',\n collapsed = false,\n contentInset,\n contentMaxInlineSize,\n headline,\n leading,\n pinned = false,\n scrolled = false,\n size = 'sm',\n style,\n subtitle,\n trailing,\n ...props\n}: AppBarProps) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const inset = contentInset ?? theme.spacing.lg\n // `sm` is already what the flexible bars collapse to, so collapsing it is\n // a no-op rather than an error, for a size chosen by the window.\n const collapse = collapsed && size !== 'sm'\n const hasLeading = hasContent(leading)\n const hasTrailing = hasContent(trailing)\n const showsSubtitle = hasContent(subtitle) && !collapse\n const heights = HEIGHTS[collapse ? 'sm' : size]\n const fill = useFill(scrolled)\n\n return (\n <Animated.View\n {...props}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n fill,\n pinned ? styles.pinned : null,\n style,\n )}\n >\n <SafeAreaView edges={EDGES} style={styles.safeArea}>\n <View\n style={composeStyles<ViewStyle>(styles.row, own.row, {\n maxWidth: contentMaxInlineSize,\n minHeight: showsSubtitle ? heights.withSubtitle : heights.plain,\n paddingEnd: edgePadding(inset, hasTrailing),\n paddingStart: edgePadding(inset, hasLeading),\n })}\n >\n {hasLeading ? (\n <Slot color={theme.colors.onSurface}>{leading}</Slot>\n ) : null}\n <View style={own.text}>\n {hasContent(headline) ? (\n <Text\n role=\"heading\"\n style={align === 'center' ? styles.center : undefined}\n variant={HEADLINE_ROLES[collapse ? 'sm' : size]}\n >\n {headline}\n </Text>\n ) : null}\n {showsSubtitle ? (\n <Text\n style={align === 'center' ? styles.center : undefined}\n tone=\"muted\"\n variant=\"bodyMedium\"\n >\n {subtitle}\n </Text>\n ) : null}\n </View>\n {hasTrailing ? (\n <Slot color={theme.colors.onSurfaceVariant}>{trailing}</Slot>\n ) : null}\n </View>\n </SafeAreaView>\n </Animated.View>\n )\n}\n\n// The row's padding on one edge, for the inset the call site gave. Where the\n// edge holds a slot the row stops short of the inset by GLYPH_INSET, clamped\n// at zero for an inset smaller than a glyph's own room.\nfunction edgePadding(inset: number, hasSlot: boolean): number {\n return hasSlot ? Math.max(0, inset - GLYPH_INSET) : inset\n}\n\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's jsx-no-new-object-as-prop is after; the React Compiler\n// memoises the result on its inputs.\nfunction iconStyleOf(color: ColorValue): IconStyle {\n return { color, size: ICON_SIZE }\n}\n\n// A slot's icons draw at 24dp in the slot's colour. An icon button inside it\n// hands its own icon the button's colour instead.\nfunction Slot({ children, color }: SlotProps) {\n const own = stylesOf(useTheme())\n\n return (\n <IconStyleContext value={iconStyleOf(color)}>\n <View style={own.slot}>{children}</View>\n </IconStyleContext>\n )\n}\n\n// The bar's surface, which takes the surface container role once the\n// content beneath has scrolled. It eases over medium 1 on the emphasized\n// curve, and arrives at once under reduced motion.\nfunction useFill(scrolled: boolean) {\n const { colors, motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const fill = scrolled ? colors.surfaceContainer : colors.surface\n const timing = {\n duration: motion.durationMedium1,\n easing: Easing.bezier(...motion.easingEmphasized),\n }\n\n return useAnimatedStyle(() => {\n 'worklet'\n return {\n backgroundColor: reduceMotion ? fill : withTiming(fill, timing),\n }\n })\n}\n\nexport { AppBar }\nexport type { AppBarProps }\n"],"mappings":";;;;;;;;;;;AA8DA,MAAM0B,YAAY;AAKlB,MAAMC,cAAAA;AAEN,MAAMC,UAAU;CACdC,IAAI;EAAEC,OAAO;EAAKC,cAAc;CAAI;CACpCC,IAAI;EAAEF,OAAO;EAAKC,cAAc;CAAI;CACpCE,IAAI;EAAEH,OAAAA;EAA6BC,cAAAA;CAAmC;AACxE;AAKA,MAAMI,iBAAyD;CAC7DN,IAAI;CACJG,IAAI;CACJC,IAAI;AACN;AAIA,MAAMM,QAAyB;CAAC;CAAQ;CAAS;AAAK;AAEtD,MAAMC,SAAShC,WAAWiC,OAAO;CAC/BC,QAAQ,EACNC,WAAW,SACb;CAGAC,QAAQ,EACNC,QAAQ,EACV;CACAC,KAAK;EACHC,YAAY;EACZC,eAAe;EACfC,OAAO;CACT;CAEAC,UAAU,EACRH,YAAY,SACd;AACF,CAAC;AAED,MAAMI,WAAW3B,cAAc,EAAE4B,QAAQC,cACvC7C,WAAWiC,OAAO;CAChBK,KAAK,EACHQ,KAAKD,QAAQE,GACf;CAGAC,MAAM;EACJT,YAAY;EACZC,eAAe;EACfS,YAAY;EACZH,KAAAA,KAAmBF,OAAOM;EAC1BC,oBAAAA,KAAkCP,OAAOM,aAAa;CACxD;CAEAE,MAAM;EACJC,UAAU;EACVJ,YAAY;EACZK,gBAAgB;EAChBC,UAAU;EACVC,iBAAiBX,QAAQpB;CAC3B;AACF,CAAC,CACH;;;;;;;;;;;;;;;;;;;;;AAiHA,SAAAgD,OAAAC,IAAA;CAAA,MA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;EAD1CC,KAAA,oBAAC,kBAAD;GAAyB,OAAAF;GACvBC,UAAAA;EADe,CAAA;EAEEP,EAAA,KAAAM;EAAAN,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAFnBQ;AAEmB;AAOvB,SAAAY,QAAA7B,UAAA;CACE,MAAA,EAAA0C,QAAAiB,WAA2B/G,SAAS;CACpC,MAAAgH,eAAqBzH,iBAAiB;CACtC,MAAAyF,OAAa5B,WAAW0C,OAAMmB,mBAAoBnB,OAAMoB;CACxD,MAAAC,SAAe;EAAAC,UACHL,OAAMM;EAAgBC,QACxBjI,OAAMkI,OAAO,GAAIR,OAAMS,gBAAiB;CAClD;CAAC,OAEMlI,uBAAiB;EAAA;EAAA,OAEf,EAAAmI,iBACYT,eAAAhC,OAAsBxF,WAAWwF,MAAMmC,MAAM,EAChE;CAAC,CACF;AAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MarkImageProps } from "../../mark/index.js";
|
|
2
|
-
import { ComponentRef, Ref } from "react";
|
|
3
2
|
import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
3
|
+
import { ComponentRef, Ref } from "react";
|
|
4
4
|
//#region src/components/avatar/index.d.ts
|
|
5
5
|
type AvatarProps = Omit<ViewProps, 'children' | 'style'> & {
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonLinkForm, ButtonPressForm, ButtonToggleForm } from "../../button/index.js";
|
|
2
|
-
import { ComponentRef, ReactNode, Ref } from "react";
|
|
3
2
|
import { PressableProps, StyleProp, View, ViewStyle } from "react-native";
|
|
3
|
+
import { ComponentRef, ReactNode, Ref } from "react";
|
|
4
4
|
//#region src/components/button/index.d.ts
|
|
5
5
|
type ButtonForm = ButtonLinkForm | ButtonPressForm | (ButtonToggleForm & {
|
|
6
6
|
/**
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { IconStyleContext } from "../../glyphs/icon-style.js";
|
|
2
2
|
import { useTheme } from "../../theme/scope.js";
|
|
3
3
|
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
4
|
+
import { hitSlop, usePressFeedback } from "../../press/index.js";
|
|
4
5
|
import { useTypeRole } from "../../typography/roles.js";
|
|
5
6
|
import { AnimatedPressable, HEIGHTS, OUTLINE_WIDTHS, PRESSED_CORNERS, buttonStyles, toggleState, useButtonAction, useCorner, useSlotTrigger } from "../../button/index.js";
|
|
6
7
|
import { palettesOf } from "../../button/palettes.js";
|
|
7
8
|
import { BUSY, CONCEALED, PendingContent, PendingRing, pendingStyles, usePending } from "../../button/pending.js";
|
|
8
|
-
import { hitSlop, usePressFeedback } from "../../press/index.js";
|
|
9
9
|
import { c } from "react/compiler-runtime";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { StyleSheet, Text, useWindowDimensions } from "react-native";
|
|
12
11
|
import Animated from "react-native-reanimated";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/button/index.tsx
|
|
14
14
|
const DISABLED = {
|
|
15
15
|
elevated: "filledDisabled",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { StyleProp, View, ViewStyle } from "react-native";
|
|
2
|
+
import { ComponentRef, Ref } from "react";
|
|
3
|
+
import { CalendarProps, DateValue } from "react-stately/useCalendarState";
|
|
4
|
+
//#region src/components/calendar/index.d.ts
|
|
5
|
+
type CalendarProps$1<T extends DateValue = DateValue> = Pick<CalendarProps<T>, 'defaultFocusedValue' | 'defaultValue' | 'firstDayOfWeek' | 'focusedValue' | 'isDateUnavailable' | 'isDisabled' | 'isReadOnly' | 'maxValue' | 'minValue' | 'onChange' | 'onFocusChange' | 'value'> & {
|
|
6
|
+
/**
|
|
7
|
+
* The calendar's name. The month shown is added to it, as React Aria adds
|
|
8
|
+
* it on web.
|
|
9
|
+
*/
|
|
10
|
+
readonly 'aria-label'?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The BCP 47 locale the calendar is written in: its month and weekday
|
|
13
|
+
* names, its digits, its first day of the week and its calendar system.
|
|
14
|
+
* Defaults to the device's.
|
|
15
|
+
*/
|
|
16
|
+
readonly locale?: string;
|
|
17
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the header draws the month and the year as menu buttons, each
|
|
20
|
+
* opening a list of them in the grid's place, as the docked date picker's
|
|
21
|
+
* header does, rather than one heading between the chevrons. For a date
|
|
22
|
+
* far from the one shown, such as a date of birth: the year list runs a
|
|
23
|
+
* century either side of the year shown, or to `minValue` and `maxValue`
|
|
24
|
+
* where they are closer.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
readonly showMonthYearMenus?: boolean;
|
|
28
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
29
|
+
readonly testID?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A month calendar for picking a date. The value is an
|
|
33
|
+
* `@internationalized/date` value, as on web: pass `value` with `onChange` to
|
|
34
|
+
* control it, or `defaultValue` to let it keep its own.
|
|
35
|
+
*
|
|
36
|
+
* ```tsx
|
|
37
|
+
* import { getLocalTimeZone, today } from '@internationalized/date'
|
|
38
|
+
*
|
|
39
|
+
* <Calendar aria-label="Label" defaultValue={today(getLocalTimeZone())} />
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* `minValue` and `maxValue` bound it, and `isDateUnavailable` rules
|
|
43
|
+
* individual dates out. Name it with `aria-label`; the month shown is added
|
|
44
|
+
* to the name.
|
|
45
|
+
*
|
|
46
|
+
* `style`, `ref` and `testID` land on the container.
|
|
47
|
+
*/
|
|
48
|
+
declare function Calendar<T extends DateValue = DateValue>({ 'aria-label': ariaLabel, locale, ref, showMonthYearMenus, style, testID, ...props }: CalendarProps$1<T>): import("react").JSX.Element;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { Calendar, type CalendarProps$1 as CalendarProps };
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useTheme } from "../../theme/scope.js";
|
|
2
|
+
import { composeStyles } from "../../theme/styles.js";
|
|
3
|
+
import { localeOf } from "../../number/locale.js";
|
|
4
|
+
import { stylesOf } from "../../calendar/styles.js";
|
|
5
|
+
import { CalendarFrame, visibleMonthOf } from "../../calendar/index.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { View } from "react-native";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { createCalendar } from "@internationalized/date";
|
|
10
|
+
import { useCalendarState } from "react-stately/useCalendarState";
|
|
11
|
+
//#region src/components/calendar/index.tsx
|
|
12
|
+
/**
|
|
13
|
+
* A month calendar for picking a date. The value is an
|
|
14
|
+
* `@internationalized/date` value, as on web: pass `value` with `onChange` to
|
|
15
|
+
* control it, or `defaultValue` to let it keep its own.
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { getLocalTimeZone, today } from '@internationalized/date'
|
|
19
|
+
*
|
|
20
|
+
* <Calendar aria-label="Label" defaultValue={today(getLocalTimeZone())} />
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* `minValue` and `maxValue` bound it, and `isDateUnavailable` rules
|
|
24
|
+
* individual dates out. Name it with `aria-label`; the month shown is added
|
|
25
|
+
* to the name.
|
|
26
|
+
*
|
|
27
|
+
* `style`, `ref` and `testID` land on the container.
|
|
28
|
+
*/
|
|
29
|
+
function Calendar(t0) {
|
|
30
|
+
const $ = c(12);
|
|
31
|
+
const { "aria-label": ariaLabel, locale, ref, showMonthYearMenus: t1, style, testID, ...props } = t0;
|
|
32
|
+
const showMonthYearMenus = t1 === void 0 ? false : t1;
|
|
33
|
+
const writtenIn = localeOf(locale);
|
|
34
|
+
const own = stylesOf(useTheme());
|
|
35
|
+
const state = useCalendarState({
|
|
36
|
+
...props,
|
|
37
|
+
createCalendar,
|
|
38
|
+
locale: writtenIn
|
|
39
|
+
});
|
|
40
|
+
const month = visibleMonthOf(state, writtenIn);
|
|
41
|
+
const T0 = View;
|
|
42
|
+
const t2 = ariaLabel === void 0 ? month : `${ariaLabel}, ${month}`;
|
|
43
|
+
const t3 = "group";
|
|
44
|
+
const t4 = composeStyles(own.root, style);
|
|
45
|
+
let t5;
|
|
46
|
+
if ($[0] !== props.firstDayOfWeek || $[1] !== showMonthYearMenus || $[2] !== state || $[3] !== writtenIn) {
|
|
47
|
+
t5 = /* @__PURE__ */ jsx(CalendarFrame, {
|
|
48
|
+
firstDayOfWeek: props.firstDayOfWeek,
|
|
49
|
+
locale: writtenIn,
|
|
50
|
+
showMonthYearMenus,
|
|
51
|
+
state
|
|
52
|
+
});
|
|
53
|
+
$[0] = props.firstDayOfWeek;
|
|
54
|
+
$[1] = showMonthYearMenus;
|
|
55
|
+
$[2] = state;
|
|
56
|
+
$[3] = writtenIn;
|
|
57
|
+
$[4] = t5;
|
|
58
|
+
} else t5 = $[4];
|
|
59
|
+
let t6;
|
|
60
|
+
if ($[5] !== T0 || $[6] !== ref || $[7] !== t2 || $[8] !== t4 || $[9] !== t5 || $[10] !== testID) {
|
|
61
|
+
t6 = /* @__PURE__ */ jsx(T0, {
|
|
62
|
+
"aria-label": t2,
|
|
63
|
+
ref,
|
|
64
|
+
role: t3,
|
|
65
|
+
style: t4,
|
|
66
|
+
testID,
|
|
67
|
+
children: t5
|
|
68
|
+
});
|
|
69
|
+
$[5] = T0;
|
|
70
|
+
$[6] = ref;
|
|
71
|
+
$[7] = t2;
|
|
72
|
+
$[8] = t4;
|
|
73
|
+
$[9] = t5;
|
|
74
|
+
$[10] = testID;
|
|
75
|
+
$[11] = t6;
|
|
76
|
+
} else t6 = $[11];
|
|
77
|
+
return t6;
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { Calendar };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","Ref","StyleProp","ViewStyle","DateValue","CalendarProps","StatelyCalendarProps","createCalendar","View","useCalendarState","CalendarFrame","visibleMonthOf","stylesOf","localeOf","useTheme","composeStyles","Pick","T","locale","ref","showMonthYearMenus","style","testID","Calendar","t0","$","_c","ariaLabel","t1","props","undefined","writtenIn","own","state","month","T0","t2","t3","t4","root","t5","firstDayOfWeek","t6","_c"],"sources":["../../../src/components/calendar/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { StyleProp, ViewStyle } from 'react-native'\nimport type {\n DateValue,\n CalendarProps as StatelyCalendarProps,\n} from 'react-stately/useCalendarState'\n\nimport { createCalendar } from '@internationalized/date'\nimport { View } from 'react-native'\nimport { useCalendarState } from 'react-stately/useCalendarState'\n\nimport { CalendarFrame, visibleMonthOf } from '../../calendar'\nimport { stylesOf } from '../../calendar/styles'\nimport { localeOf } from '../../number/locale'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles } from '../../theme/styles'\n\n// kanso-ui's Calendar, the date pickers page's docked calendar: a month grid\n// with a circle on the selected date and an outline on today. Its values are\n// that page's: a 360dp container on the high surface container, 48dp date\n// cells with a 40dp state layer inside them, body large for both the weekday\n// row and the dates, and primary for the selected circle and for today's\n// outline. The parts are in src/calendar.\n//\n// The state is React Stately's `useCalendarState`, which web's React Aria\n// calendar is built on, over `@internationalized/date`, so the selection,\n// the bounds and the locale's calendar, first day of the week and digits\n// behave as they do on web.\n//\n// The page's container is 456dp tall, which this does not take: that height\n// is a picker's, counting a headline and an action row the calendar itself\n// does not draw. What is held instead is the grid, at six weeks, the most any\n// month occupies, so the calendar keeps its height as the month moves and a\n// shorter month leaves its last rows empty.\n//\n// `showMonthYearMenus` draws the page's docked header instead of one heading:\n// the month's menu button between the chevrons that step it and the year's\n// after them, each opening its list where the grid was, as web's does. The\n// page draws the lists there, and a calendar inside a picker is already in\n// a panel, so a menu over it would be a panel over a panel.\n//\n// Five things are this component's own, as on web.\n//\n// **The year menu has no chevrons of its own.** The page draws a pair either\n// side of it that step a year; the year list reaches any year within a\n// century of the one shown in one press, or any the bounds allow where they\n// are closer.\n//\n// **The cell is a circle in a square.** The page gives the date a 48dp\n// container and a 40dp state layer, which is a 40dp circle with 4dp of room\n// around it. The circle is the pressable, centred in a 48dp column and a 48dp\n// row, and its `hitSlop` reaches the 4dp past it on every side, so the whole\n// square takes the press. The chevrons and the menu buttons reach a 48dp\n// target the same way.\n//\n// **It narrows to its container.** The page's docked calendar is 360dp, and\n// a compact window leaves 328dp between its margins, so the calendar is 360\n// at most and the columns share whatever is left below that.\n//\n// **A date from the month either side is faded because it is disabled**, as\n// React Aria disables those dates: the page's 38% either way. A date\n// `isDateUnavailable` rules out is struck through at full contrast instead,\n// since a reader can still land on it and has to read it.\n//\n// **Today reads as today whether or not it is selected.** The page gives it\n// an outline and the primary label; selected gives it a filled circle and\n// the on-primary label. A selected today takes the fill.\n//\n// Web's month changes at once. Here **the weeks slide in** from the side the\n// new month comes from, Material Design's shared axis transition, and change\n// at once under reduced motion.\n//\n// **The locale is a prop**, defaulting to the device's, where web reads it\n// from React Aria's `I18nProvider`. The words the calendar writes, its\n// chevrons' names and its dates', are React Aria's in that locale.\n\ntype CalendarProps<T extends DateValue = DateValue> = Pick<\n StatelyCalendarProps<T>,\n | 'defaultFocusedValue'\n | 'defaultValue'\n | 'firstDayOfWeek'\n | 'focusedValue'\n | 'isDateUnavailable'\n | 'isDisabled'\n | 'isReadOnly'\n | 'maxValue'\n | 'minValue'\n | 'onChange'\n | 'onFocusChange'\n | 'value'\n> & {\n /**\n * The calendar's name. The month shown is added to it, as React Aria adds\n * it on web.\n */\n readonly 'aria-label'?: string\n /**\n * The BCP 47 locale the calendar is written in: its month and weekday\n * names, its digits, its first day of the week and its calendar system.\n * Defaults to the device's.\n */\n readonly locale?: string\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * Whether the header draws the month and the year as menu buttons, each\n * opening a list of them in the grid's place, as the docked date picker's\n * header does, rather than one heading between the chevrons. For a date\n * far from the one shown, such as a date of birth: the year list runs a\n * century either side of the year shown, or to `minValue` and `maxValue`\n * where they are closer.\n * @default false\n */\n readonly showMonthYearMenus?: boolean\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\n/**\n * A month calendar for picking a date. The value is an\n * `@internationalized/date` value, as on web: pass `value` with `onChange` to\n * control it, or `defaultValue` to let it keep its own.\n *\n * ```tsx\n * import { getLocalTimeZone, today } from '@internationalized/date'\n *\n * <Calendar aria-label=\"Label\" defaultValue={today(getLocalTimeZone())} />\n * ```\n *\n * `minValue` and `maxValue` bound it, and `isDateUnavailable` rules\n * individual dates out. Name it with `aria-label`; the month shown is added\n * to the name.\n *\n * `style`, `ref` and `testID` land on the container.\n */\nfunction Calendar<T extends DateValue = DateValue>({\n 'aria-label': ariaLabel,\n locale,\n ref,\n showMonthYearMenus = false,\n style,\n testID,\n ...props\n}: CalendarProps<T>) {\n const writtenIn = localeOf(locale)\n const own = stylesOf(useTheme())\n const state = useCalendarState<T>({\n ...props,\n createCalendar,\n locale: writtenIn,\n })\n const month = visibleMonthOf(state, writtenIn)\n\n return (\n <View\n aria-label={ariaLabel === undefined ? month : `${ariaLabel}, ${month}`}\n ref={ref}\n role=\"group\"\n style={composeStyles<ViewStyle>(own.root, style)}\n testID={testID}\n >\n <CalendarFrame\n firstDayOfWeek={props.firstDayOfWeek}\n locale={writtenIn}\n showMonthYearMenus={showMonthYearMenus}\n state={state}\n />\n </View>\n )\n}\n\nexport type { CalendarProps }\n\nexport { Calendar }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsIA,SAAAuB,SAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAmD,MAAA,EAAA,cAAAC,WAAAT,QAAAC,KAAAC,oBAAAQ,IAAAP,OAAAC,QAAA,GAAAO,UAAAL;CAIjD,MAAAJ,qBAAAQ,OAAAE,KAA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} from "react";
|
|
2
1
|
import { PressableProps, StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
2
|
+
import { ComponentRef, ReactNode, Ref } from "react";
|
|
3
3
|
//#region src/components/card/index.d.ts
|
|
4
4
|
type CardBaseProps = {
|
|
5
5
|
readonly children?: ReactNode;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useTheme } from "../../theme/scope.js";
|
|
2
2
|
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
3
|
-
import { useLinkPress } from "../../router/index.js";
|
|
4
|
-
import { withOpacity } from "../../theme/color.js";
|
|
5
3
|
import { usePressFeedback } from "../../press/index.js";
|
|
4
|
+
import { withOpacity } from "../../theme/color.js";
|
|
5
|
+
import { useLinkPress } from "../../router/index.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/card/index.tsx
|
|
10
10
|
const paddings = themedStyles(({ spacing }) => StyleSheet.create({
|
|
11
11
|
default: { padding: spacing.lg },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentRef, ReactNode, Ref } from "react";
|
|
2
1
|
import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
2
|
+
import { ComponentRef, ReactNode, Ref } from "react";
|
|
3
3
|
//#region src/components/checkbox/index.d.ts
|
|
4
4
|
type CheckboxProps = Omit<ViewProps, 'children' | 'style'> & {
|
|
5
5
|
/**
|
|
@@ -5,9 +5,9 @@ import { controlStylesOf } from "../../control/styles.js";
|
|
|
5
5
|
import { ControlLabel, ControlMessage, describedBy, messageOf } from "../../control/index.js";
|
|
6
6
|
import { CheckboxBox } from "../../control/checkbox-box.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
|
+
import { Pressable, View } from "react-native";
|
|
8
9
|
import { useId } from "react";
|
|
9
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { Pressable, View } from "react-native";
|
|
11
11
|
import { useToggleState } from "react-stately/useToggleState";
|
|
12
12
|
//#region src/components/checkbox/index.tsx
|
|
13
13
|
const LAYERS = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentRef, ReactNode, Ref } from "react";
|
|
2
1
|
import { PressableProps, StyleProp, View, ViewStyle } from "react-native";
|
|
2
|
+
import { ComponentRef, ReactNode, Ref } from "react";
|
|
3
3
|
//#region src/components/chip/index.d.ts
|
|
4
4
|
/** An assist or suggestion chip: an action, drawn as a plain button. */
|
|
5
5
|
type ChipActionProps = ChipBaseProps & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTheme } from "../../theme/scope.js";
|
|
2
2
|
import { composeStyles } from "../../theme/styles.js";
|
|
3
|
-
import { AnimatedPressable, toggleState, useButtonAction } from "../../button/index.js";
|
|
4
3
|
import { usePressFeedback } from "../../press/index.js";
|
|
4
|
+
import { AnimatedPressable, toggleState, useButtonAction } from "../../button/index.js";
|
|
5
5
|
import { shadowsOf, stylesOf } from "../../chip/styles.js";
|
|
6
6
|
import { ChipGlyph, ChipLabel, measureThen, paintOf, targetOf, useEasedColors } from "../../chip/index.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentRef, ReactElement, ReactNode, Ref } from "react";
|
|
2
1
|
import { PressableProps, StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
2
|
+
import { ComponentRef, ReactElement, ReactNode, Ref } from "react";
|
|
3
3
|
import { Key, Selection, SelectionMode } from "react-stately";
|
|
4
4
|
//#region src/components/chip-group/index.d.ts
|
|
5
5
|
type ChipGroupChipProps = Omit<PressableProps, 'children' | 'disabled' | 'id' | 'style'> & {
|