achery-ui 0.17.0 → 0.18.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/dist/native/index.cjs +124 -2
- package/dist/native/index.cjs.map +1 -1
- package/dist/native/index.d.cts +66 -1
- package/dist/native/index.d.ts +66 -1
- package/dist/native/index.js +122 -3
- package/dist/native/index.js.map +1 -1
- package/package.json +1 -1
- package/src/native/components/AdaptivePanel.tsx +190 -0
- package/src/native/components/BottomSheet.tsx +10 -4
- package/src/native/components/index.ts +3 -0
- package/src/native/index.ts +2 -0
package/dist/native/index.cjs
CHANGED
|
@@ -5805,7 +5805,7 @@ var BottomSheet = ({
|
|
|
5805
5805
|
(() => {
|
|
5806
5806
|
const keyboardCap = keyboardOffset > 0 ? Math.max(160, windowHeight - keyboardOffset - insets.bottom - 140) : void 0;
|
|
5807
5807
|
const effectiveMax = maxContentHeight != null && keyboardCap != null ? Math.min(maxContentHeight, keyboardCap) : maxContentHeight ?? keyboardCap;
|
|
5808
|
-
return
|
|
5808
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5809
5809
|
reactNative.ScrollView,
|
|
5810
5810
|
{
|
|
5811
5811
|
style: { maxHeight: effectiveMax },
|
|
@@ -5814,7 +5814,7 @@ var BottomSheet = ({
|
|
|
5814
5814
|
keyboardShouldPersistTaps: "handled",
|
|
5815
5815
|
children
|
|
5816
5816
|
}
|
|
5817
|
-
)
|
|
5817
|
+
);
|
|
5818
5818
|
})()
|
|
5819
5819
|
]
|
|
5820
5820
|
}
|
|
@@ -5868,6 +5868,125 @@ var StyleSheet3 = {
|
|
|
5868
5868
|
bottom: 0
|
|
5869
5869
|
}
|
|
5870
5870
|
};
|
|
5871
|
+
var ADAPTIVE_PANEL_BREAKPOINT = 900;
|
|
5872
|
+
var AdaptivePanel = ({
|
|
5873
|
+
open,
|
|
5874
|
+
onClose,
|
|
5875
|
+
title,
|
|
5876
|
+
showClose = false,
|
|
5877
|
+
children,
|
|
5878
|
+
width = 340,
|
|
5879
|
+
side = "right",
|
|
5880
|
+
breakpoint = ADAPTIVE_PANEL_BREAKPOINT,
|
|
5881
|
+
maxContentHeight,
|
|
5882
|
+
avoidKeyboard = true,
|
|
5883
|
+
style
|
|
5884
|
+
}) => {
|
|
5885
|
+
const { tokens: tokens$1 } = useTheme();
|
|
5886
|
+
const { width: windowWidth } = reactNative.useWindowDimensions();
|
|
5887
|
+
const docked = windowWidth >= breakpoint;
|
|
5888
|
+
if (!docked) {
|
|
5889
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5890
|
+
BottomSheet,
|
|
5891
|
+
{
|
|
5892
|
+
open,
|
|
5893
|
+
onClose,
|
|
5894
|
+
showClose,
|
|
5895
|
+
avoidKeyboard,
|
|
5896
|
+
...title !== void 0 && { title },
|
|
5897
|
+
...maxContentHeight !== void 0 && { maxContentHeight },
|
|
5898
|
+
...style !== void 0 && { style },
|
|
5899
|
+
children
|
|
5900
|
+
}
|
|
5901
|
+
);
|
|
5902
|
+
}
|
|
5903
|
+
if (!open) return null;
|
|
5904
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5905
|
+
reactNative.View,
|
|
5906
|
+
{
|
|
5907
|
+
style: [
|
|
5908
|
+
{
|
|
5909
|
+
width,
|
|
5910
|
+
flexShrink: 0,
|
|
5911
|
+
backgroundColor: tokens$1.surface,
|
|
5912
|
+
// The rule sits on the edge facing the content it displaces.
|
|
5913
|
+
borderLeftWidth: side === "right" ? 2 : 0,
|
|
5914
|
+
borderRightWidth: side === "left" ? 2 : 0,
|
|
5915
|
+
borderLeftColor: tokens$1.border,
|
|
5916
|
+
borderRightColor: tokens$1.border
|
|
5917
|
+
},
|
|
5918
|
+
style
|
|
5919
|
+
],
|
|
5920
|
+
children: [
|
|
5921
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5922
|
+
reactNative.View,
|
|
5923
|
+
{
|
|
5924
|
+
style: {
|
|
5925
|
+
flexDirection: "row",
|
|
5926
|
+
alignItems: "center",
|
|
5927
|
+
justifyContent: "space-between",
|
|
5928
|
+
paddingHorizontal: tokens.spacing.sp6,
|
|
5929
|
+
paddingVertical: tokens.spacing.sp4,
|
|
5930
|
+
borderBottomWidth: 1,
|
|
5931
|
+
borderBottomColor: tokens$1.borderMute,
|
|
5932
|
+
minHeight: 44
|
|
5933
|
+
},
|
|
5934
|
+
children: [
|
|
5935
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5936
|
+
reactNative.Text,
|
|
5937
|
+
{
|
|
5938
|
+
style: {
|
|
5939
|
+
fontSize: 10,
|
|
5940
|
+
fontWeight: tokens.fontWeights.semibold.toString(),
|
|
5941
|
+
letterSpacing: 1.6,
|
|
5942
|
+
textTransform: "uppercase",
|
|
5943
|
+
color: tokens$1.fg3
|
|
5944
|
+
},
|
|
5945
|
+
children: title
|
|
5946
|
+
}
|
|
5947
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, {}),
|
|
5948
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5949
|
+
reactNative.TouchableOpacity,
|
|
5950
|
+
{
|
|
5951
|
+
onPress: onClose,
|
|
5952
|
+
hitSlop: { top: 12, bottom: 12, left: 12, right: 12 },
|
|
5953
|
+
accessibilityRole: "button",
|
|
5954
|
+
accessibilityLabel: "Close",
|
|
5955
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5956
|
+
reactNative.Text,
|
|
5957
|
+
{
|
|
5958
|
+
style: {
|
|
5959
|
+
fontSize: 11,
|
|
5960
|
+
fontWeight: tokens.fontWeights.semibold.toString(),
|
|
5961
|
+
letterSpacing: 0.5,
|
|
5962
|
+
color: tokens$1.fg3,
|
|
5963
|
+
textTransform: "uppercase"
|
|
5964
|
+
},
|
|
5965
|
+
children: "\u2715"
|
|
5966
|
+
}
|
|
5967
|
+
)
|
|
5968
|
+
}
|
|
5969
|
+
)
|
|
5970
|
+
]
|
|
5971
|
+
}
|
|
5972
|
+
),
|
|
5973
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5974
|
+
reactNative.ScrollView,
|
|
5975
|
+
{
|
|
5976
|
+
style: { flex: 1 },
|
|
5977
|
+
showsVerticalScrollIndicator: false,
|
|
5978
|
+
keyboardShouldPersistTaps: "handled",
|
|
5979
|
+
children
|
|
5980
|
+
}
|
|
5981
|
+
)
|
|
5982
|
+
]
|
|
5983
|
+
}
|
|
5984
|
+
);
|
|
5985
|
+
};
|
|
5986
|
+
var useIsPanelDocked = (breakpoint = ADAPTIVE_PANEL_BREAKPOINT) => {
|
|
5987
|
+
const { width } = reactNative.useWindowDimensions();
|
|
5988
|
+
return width >= breakpoint;
|
|
5989
|
+
};
|
|
5871
5990
|
var BAR_HEIGHT = 56;
|
|
5872
5991
|
var MAX_VISIBLE = 4;
|
|
5873
5992
|
var BottomTabBar = ({
|
|
@@ -6156,6 +6275,8 @@ var styles = reactNative.StyleSheet.create({
|
|
|
6156
6275
|
suggestion: { borderWidth: 1, paddingHorizontal: 8, paddingVertical: 4 }
|
|
6157
6276
|
});
|
|
6158
6277
|
|
|
6278
|
+
exports.ADAPTIVE_PANEL_BREAKPOINT = ADAPTIVE_PANEL_BREAKPOINT;
|
|
6279
|
+
exports.AdaptivePanel = AdaptivePanel;
|
|
6159
6280
|
exports.Badge = Badge;
|
|
6160
6281
|
exports.BottomSheet = BottomSheet;
|
|
6161
6282
|
exports.BottomTabBar = BottomTabBar;
|
|
@@ -6188,6 +6309,7 @@ exports.Toggle = Toggle;
|
|
|
6188
6309
|
exports.glyphCategory = glyphCategory;
|
|
6189
6310
|
exports.glyphLabel = glyphLabel;
|
|
6190
6311
|
exports.searchGlyphs = searchGlyphs;
|
|
6312
|
+
exports.useIsPanelDocked = useIsPanelDocked;
|
|
6191
6313
|
exports.useTheme = useTheme;
|
|
6192
6314
|
exports.useToast = useToast;
|
|
6193
6315
|
//# sourceMappingURL=index.cjs.map
|