@studio-piot/native-ui 0.1.0 → 0.2.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 +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +41 -23
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectCloseButton.d.ts +1 -0
- package/dist/components/Select/SelectCloseButton.d.ts.map +1 -1
- package/dist/components/Select/SelectCloseButton.js +15 -4
- package/dist/components/Select/SelectCloseButton.js.map +1 -1
- package/dist/components/Select/index.d.ts +3 -3
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +2 -1
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/resolveSelectDetentIndex.d.ts +2 -0
- package/dist/components/Select/resolveSelectDetentIndex.d.ts.map +1 -1
- package/dist/components/Select/resolveSelectDetentIndex.js +5 -0
- package/dist/components/Select/resolveSelectDetentIndex.js.map +1 -1
- package/dist/components/Select/trueSheetReanimated.d.ts +13 -0
- package/dist/components/Select/trueSheetReanimated.d.ts.map +1 -0
- package/dist/components/Select/trueSheetReanimated.js +14 -0
- package/dist/components/Select/trueSheetReanimated.js.map +1 -0
- package/dist/components/Select/types.d.ts +3 -1
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/docs/components/select.md +26 -9
- package/docs/superpowers/plans/2026-09-25-select.md +26 -8
- package/docs/superpowers/specs/2026-09-25-select-design.md +37 -65
- package/package.json +7 -3
- package/src/components/Select/Select.tsx +115 -71
- package/src/components/Select/SelectCloseButton.tsx +22 -5
- package/src/components/Select/index.ts +6 -2
- package/src/components/Select/resolveSelectDetentIndex.test.ts +15 -1
- package/src/components/Select/resolveSelectDetentIndex.ts +5 -0
- package/src/components/Select/selectThemeRoles.test.ts +16 -0
- package/src/components/Select/types.ts +3 -1
- package/src/components/index.ts +2 -1
- package/src/index.ts +3 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ The package is the native counterpart of `@studio-piot/ui`. Apps own their palet
|
|
|
10
10
|
npm install @studio-piot/native-ui
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
`react` and `react-native` are peer dependencies. `Form` also peers `react-native-keyboard-controller` and `react-native-safe-area-context`. `Select` peers `@
|
|
13
|
+
`react` and `react-native` are peer dependencies. `Form` also peers `react-native-keyboard-controller` and `react-native-safe-area-context`. `Select` peers `@gorhom/bottom-sheet`, `react-native-reanimated`, and `react-native-gesture-handler`.
|
|
14
14
|
|
|
15
15
|
## Docs
|
|
16
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,SAAS,CAAC;AAIzD,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAgC,EAChC,KAAK,EACL,WAAW,EACX,KAAK,EACL,UAAU,EACV,WAAW,EACX,OAAqC,EACrC,aAA6C,EAC7C,MAAa,EACb,QAAe,EACf,eAAe,EAAE,mBAAmB,EACpC,SAAS,EAAE,aAAa,EACxB,gBAAgB,EAAE,oBAAoB,EACtC,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,oBAAoB,EACtC,WAAW,EAAE,eAAe,EAC5B,UAAU,EAAE,cAAc,EAC1B,aAAa,EAAE,iBAAiB,EAChC,KAAK,GACN,EAAE,WAAW,+BAmMb"}
|
|
@@ -4,14 +4,15 @@ exports.Select = Select;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
|
-
const
|
|
7
|
+
const bottom_sheet_1 = require("@gorhom/bottom-sheet");
|
|
8
8
|
const buttonRadius_1 = require("../Button/buttonRadius");
|
|
9
9
|
const useResolvedFieldColor_1 = require("../Field/useResolvedFieldColor");
|
|
10
10
|
const resolveSelectDetentIndex_1 = require("./resolveSelectDetentIndex");
|
|
11
11
|
const SelectCloseButton_1 = require("./SelectCloseButton");
|
|
12
12
|
const selectThemeRoles_1 = require("./selectThemeRoles");
|
|
13
|
+
const BACKDROP_OPACITY = 0.72;
|
|
13
14
|
function Select({ value, onChange, options, placeholder = "Select an option", label, description, error, sheetTitle, closeButton, detents = [...resolveSelectDetentIndex_1.DEFAULT_SELECT_DETENTS], initialDetent = resolveSelectDetentIndex_1.DEFAULT_SELECT_INITIAL_DETENT, radius = "xl", editable = true, backgroundColor: backgroundColorProp, textColor: textColorProp, placeholderColor: placeholderColorProp, labelColor: labelColorProp, descriptionColor: descriptionColorProp, borderColor: borderColorProp, errorColor: errorColorProp, selectedColor: selectedColorProp, style, }) {
|
|
14
|
-
const
|
|
15
|
+
const modalRef = (0, react_1.useRef)(null);
|
|
15
16
|
const backgroundColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(backgroundColorProp, selectThemeRoles_1.SELECT_THEME_ROLES.backgroundColor);
|
|
16
17
|
const textColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(textColorProp, selectThemeRoles_1.SELECT_THEME_ROLES.textColor);
|
|
17
18
|
const placeholderColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(placeholderColorProp, selectThemeRoles_1.SELECT_THEME_ROLES.placeholderColor);
|
|
@@ -27,14 +28,16 @@ function Select({ value, onChange, options, placeholder = "Select an option", la
|
|
|
27
28
|
const borderRadius = (0, buttonRadius_1.buttonRadiusValue)(radius);
|
|
28
29
|
const title = sheetTitle ?? label ?? "Select";
|
|
29
30
|
const presentIndex = (0, resolveSelectDetentIndex_1.resolveSelectDetentIndex)(detents, initialDetent);
|
|
31
|
+
const snapPoints = (0, react_1.useMemo)(() => (0, resolveSelectDetentIndex_1.detentsToSnapPoints)(detents), [detents]);
|
|
30
32
|
const dismiss = (0, react_1.useCallback)(() => {
|
|
31
|
-
|
|
33
|
+
modalRef.current?.dismiss();
|
|
32
34
|
}, []);
|
|
33
35
|
const present = (0, react_1.useCallback)(() => {
|
|
34
36
|
if (!editable)
|
|
35
37
|
return;
|
|
36
|
-
|
|
37
|
-
}, [editable
|
|
38
|
+
modalRef.current?.present();
|
|
39
|
+
}, [editable]);
|
|
40
|
+
const renderBackdrop = (0, react_1.useCallback)((props) => ((0, jsx_runtime_1.jsx)(bottom_sheet_1.BottomSheetBackdrop, { ...props, appearsOnIndex: 0, disappearsOnIndex: -1, opacity: BACKDROP_OPACITY, pressBehavior: "close" })), []);
|
|
38
41
|
const resolvedClose = typeof closeButton === "function"
|
|
39
42
|
? closeButton(dismiss)
|
|
40
43
|
: (closeButton ?? (0, jsx_runtime_1.jsx)(SelectCloseButton_1.SelectCloseButton, { onPress: dismiss }));
|
|
@@ -54,19 +57,25 @@ function Select({ value, onChange, options, placeholder = "Select an option", la
|
|
|
54
57
|
], children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { numberOfLines: 1, style: [
|
|
55
58
|
styles.triggerText,
|
|
56
59
|
{ color: isPlaceholder ? placeholderColor : textColor, flex: 1 },
|
|
57
|
-
], children: display }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: [styles.chevron, { color: placeholderColor }], children: "\u203A" })] }), error ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.helper, { color: errorColor }], children: error })) : description ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.helper, { color: descriptionColor }], children: description })) : null, (0, jsx_runtime_1.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
], children: display }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: [styles.chevron, { color: placeholderColor }], children: "\u203A" })] }), error ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.helper, { color: errorColor }], children: error })) : description ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.helper, { color: descriptionColor }], children: description })) : null, (0, jsx_runtime_1.jsx)(bottom_sheet_1.BottomSheetModal, { ref: modalRef, backdropComponent: renderBackdrop, backgroundStyle: { backgroundColor }, enablePanDownToClose: true, handleIndicatorStyle: {
|
|
61
|
+
backgroundColor: placeholderColor,
|
|
62
|
+
opacity: 0.9,
|
|
63
|
+
}, index: presentIndex, snapPoints: snapPoints, children: (0, jsx_runtime_1.jsxs)(bottom_sheet_1.BottomSheetScrollView, { contentContainerStyle: styles.sheetContent, children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.header, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.sheetTitle, { color: textColor, flex: 1 }], children: title }), resolvedClose] }), options.length === 0 ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.empty, { color: placeholderColor }], children: "No options" })) : (options.map((option, index) => {
|
|
64
|
+
const isSelected = option.value === value;
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [index > 0 ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles.divider, { backgroundColor: borderColor }] })) : null, (0, jsx_runtime_1.jsxs)(react_native_1.Pressable, { accessibilityRole: "button", accessibilityState: {
|
|
66
|
+
selected: isSelected,
|
|
67
|
+
disabled: !!option.disabled,
|
|
68
|
+
}, disabled: option.disabled, onPress: () => onSelect(option), style: [
|
|
69
|
+
styles.option,
|
|
70
|
+
option.disabled && styles.optionBlocked,
|
|
71
|
+
], children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [
|
|
72
|
+
styles.optionLabel,
|
|
73
|
+
{
|
|
74
|
+
color: isSelected ? selectedColor : textColor,
|
|
75
|
+
flex: 1,
|
|
76
|
+
},
|
|
77
|
+
], children: option.label }), isSelected ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.check, { color: selectedColor }], children: "\u2713" })) : null] })] }, option.value));
|
|
78
|
+
}))] }) })] }));
|
|
70
79
|
}
|
|
71
80
|
const styles = react_native_1.StyleSheet.create({
|
|
72
81
|
column: {
|
|
@@ -82,6 +91,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
82
91
|
},
|
|
83
92
|
trigger: {
|
|
84
93
|
minHeight: 48,
|
|
94
|
+
width: "100%",
|
|
85
95
|
borderWidth: 1,
|
|
86
96
|
paddingHorizontal: 14,
|
|
87
97
|
paddingVertical: 12,
|
|
@@ -96,12 +106,14 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
96
106
|
fontSize: 22,
|
|
97
107
|
fontWeight: "300",
|
|
98
108
|
lineHeight: 24,
|
|
99
|
-
transform: [{ rotate: "90deg" }],
|
|
100
109
|
},
|
|
101
110
|
helper: {
|
|
102
111
|
fontSize: 13,
|
|
103
112
|
},
|
|
104
|
-
|
|
113
|
+
sheetContent: {
|
|
114
|
+
paddingBottom: 24,
|
|
115
|
+
},
|
|
116
|
+
header: {
|
|
105
117
|
flexDirection: "row",
|
|
106
118
|
alignItems: "center",
|
|
107
119
|
gap: 12,
|
|
@@ -114,10 +126,9 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
114
126
|
fontWeight: "600",
|
|
115
127
|
},
|
|
116
128
|
empty: {
|
|
117
|
-
fontSize:
|
|
129
|
+
fontSize: 15,
|
|
118
130
|
paddingHorizontal: 16,
|
|
119
|
-
paddingVertical:
|
|
120
|
-
textAlign: "center",
|
|
131
|
+
paddingVertical: 20,
|
|
121
132
|
},
|
|
122
133
|
option: {
|
|
123
134
|
minHeight: 52,
|
|
@@ -126,6 +137,9 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
126
137
|
alignItems: "center",
|
|
127
138
|
gap: 12,
|
|
128
139
|
},
|
|
140
|
+
optionBlocked: {
|
|
141
|
+
opacity: 0.4,
|
|
142
|
+
},
|
|
129
143
|
optionLabel: {
|
|
130
144
|
fontSize: 17,
|
|
131
145
|
},
|
|
@@ -133,5 +147,9 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
133
147
|
fontSize: 17,
|
|
134
148
|
fontWeight: "600",
|
|
135
149
|
},
|
|
150
|
+
divider: {
|
|
151
|
+
height: react_native_1.StyleSheet.hairlineWidth,
|
|
152
|
+
marginHorizontal: 16,
|
|
153
|
+
},
|
|
136
154
|
});
|
|
137
155
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":";;AA4BA,wBA0NC;;AAtPD,iCAMe;AACf,+CAAiE;AACjE,uDAK8B;AAC9B,yDAA2D;AAC3D,0EAAuE;AACvE,yEAKoC;AACpC,2DAAwD;AACxD,yDAAwD;AAGxD,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B,SAAgB,MAAM,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,GAAG,kBAAkB,EAChC,KAAK,EACL,WAAW,EACX,KAAK,EACL,UAAU,EACV,WAAW,EACX,OAAO,GAAG,CAAC,GAAG,iDAAsB,CAAC,EACrC,aAAa,GAAG,wDAA6B,EAC7C,MAAM,GAAG,IAAI,EACb,QAAQ,GAAG,IAAI,EACf,eAAe,EAAE,mBAAmB,EACpC,SAAS,EAAE,aA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
|
|
|
1
|
-
{"version":3,"file":"SelectCloseButton.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectCloseButton.tsx"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,+
|
|
1
|
+
{"version":3,"file":"SelectCloseButton.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectCloseButton.tsx"],"names":[],"mappings":"AAGA,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,+BAerE"}
|
|
@@ -4,14 +4,25 @@ exports.SelectCloseButton = SelectCloseButton;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_native_1 = require("react-native");
|
|
6
6
|
const useThemeColor_1 = require("../../theme/useThemeColor");
|
|
7
|
+
/** Default Select sheet close: filled disc + contrasting cross. */
|
|
7
8
|
function SelectCloseButton({ onPress }) {
|
|
8
|
-
const
|
|
9
|
-
|
|
9
|
+
const disc = (0, useThemeColor_1.useThemeColor)("text");
|
|
10
|
+
const cross = (0, useThemeColor_1.useThemeColor)("background");
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { accessibilityLabel: "Close", accessibilityRole: "button", hitSlop: 8, onPress: onPress, style: [styles.disc, { backgroundColor: disc }], children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.discX, { color: cross }], children: "\u00D7" }) }));
|
|
10
12
|
}
|
|
11
13
|
const styles = react_native_1.StyleSheet.create({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
disc: {
|
|
15
|
+
width: 28,
|
|
16
|
+
height: 28,
|
|
17
|
+
borderRadius: 14,
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
},
|
|
21
|
+
discX: {
|
|
22
|
+
fontSize: 20,
|
|
14
23
|
fontWeight: "600",
|
|
24
|
+
lineHeight: 22,
|
|
25
|
+
marginTop: -1,
|
|
15
26
|
},
|
|
16
27
|
});
|
|
17
28
|
//# sourceMappingURL=SelectCloseButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectCloseButton.js","sourceRoot":"","sources":["../../../src/components/Select/SelectCloseButton.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"SelectCloseButton.js","sourceRoot":"","sources":["../../../src/components/Select/SelectCloseButton.tsx"],"names":[],"mappings":";;AAIA,8CAeC;;AAnBD,+CAA2D;AAC3D,6DAA0D;AAE1D,mEAAmE;AACnE,SAAgB,iBAAiB,CAAC,EAAE,OAAO,EAA2B;IACpE,MAAM,IAAI,GAAG,IAAA,6BAAa,EAAC,MAAM,CAAC,CAAC;IACnC,MAAM,KAAK,GAAG,IAAA,6BAAa,EAAC,YAAY,CAAC,CAAC;IAE1C,OAAO,CACL,uBAAC,wBAAS,IACR,kBAAkB,EAAC,OAAO,EAC1B,iBAAiB,EAAC,QAAQ,EAC1B,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,YAE/C,uBAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,uBAAU,GAC7C,CACb,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,CAAC,CAAC;KACd;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Select } from "./Select";
|
|
2
2
|
export { SelectCloseButton } from "./SelectCloseButton";
|
|
3
|
-
export { DEFAULT_SELECT_DETENTS, DEFAULT_SELECT_INITIAL_DETENT, resolveSelectDetentIndex, } from "./resolveSelectDetentIndex";
|
|
4
|
-
export { SELECT_THEME_ROLES, type SelectThemeColorProp } from "./selectThemeRoles";
|
|
5
|
-
export type { SelectCloseButton as
|
|
3
|
+
export { DEFAULT_SELECT_DETENTS, DEFAULT_SELECT_INITIAL_DETENT, detentsToSnapPoints, resolveSelectDetentIndex, } from "./resolveSelectDetentIndex";
|
|
4
|
+
export { SELECT_THEME_ROLES, type SelectThemeColorProp, } from "./selectThemeRoles";
|
|
5
|
+
export type { SelectCloseButton as SelectCloseButtonSlot, SelectOption, SelectProps, } from "./types";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,iBAAiB,IAAI,qBAAqB,EAC1C,YAAY,EACZ,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SELECT_THEME_ROLES = exports.resolveSelectDetentIndex = exports.DEFAULT_SELECT_INITIAL_DETENT = exports.DEFAULT_SELECT_DETENTS = exports.SelectCloseButton = exports.Select = void 0;
|
|
3
|
+
exports.SELECT_THEME_ROLES = exports.resolveSelectDetentIndex = exports.detentsToSnapPoints = exports.DEFAULT_SELECT_INITIAL_DETENT = exports.DEFAULT_SELECT_DETENTS = exports.SelectCloseButton = exports.Select = void 0;
|
|
4
4
|
var Select_1 = require("./Select");
|
|
5
5
|
Object.defineProperty(exports, "Select", { enumerable: true, get: function () { return Select_1.Select; } });
|
|
6
6
|
var SelectCloseButton_1 = require("./SelectCloseButton");
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "SelectCloseButton", { enumerable: true, get: fun
|
|
|
8
8
|
var resolveSelectDetentIndex_1 = require("./resolveSelectDetentIndex");
|
|
9
9
|
Object.defineProperty(exports, "DEFAULT_SELECT_DETENTS", { enumerable: true, get: function () { return resolveSelectDetentIndex_1.DEFAULT_SELECT_DETENTS; } });
|
|
10
10
|
Object.defineProperty(exports, "DEFAULT_SELECT_INITIAL_DETENT", { enumerable: true, get: function () { return resolveSelectDetentIndex_1.DEFAULT_SELECT_INITIAL_DETENT; } });
|
|
11
|
+
Object.defineProperty(exports, "detentsToSnapPoints", { enumerable: true, get: function () { return resolveSelectDetentIndex_1.detentsToSnapPoints; } });
|
|
11
12
|
Object.defineProperty(exports, "resolveSelectDetentIndex", { enumerable: true, get: function () { return resolveSelectDetentIndex_1.resolveSelectDetentIndex; } });
|
|
12
13
|
var selectThemeRoles_1 = require("./selectThemeRoles");
|
|
13
14
|
Object.defineProperty(exports, "SELECT_THEME_ROLES", { enumerable: true, get: function () { return selectThemeRoles_1.SELECT_THEME_ROLES; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Select/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Select/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,uEAKoC;AAJlC,kIAAA,sBAAsB,OAAA;AACtB,yIAAA,6BAA6B,OAAA;AAC7B,+HAAA,mBAAmB,OAAA;AACnB,oIAAA,wBAAwB,OAAA;AAE1B,uDAG4B;AAF1B,sHAAA,kBAAkB,OAAA"}
|
|
@@ -6,4 +6,6 @@ export declare const DEFAULT_SELECT_INITIAL_DETENT = 0.5;
|
|
|
6
6
|
* Falls back to 0 when `initial` is missing from `detents`.
|
|
7
7
|
*/
|
|
8
8
|
export declare function resolveSelectDetentIndex(detents: readonly number[], initial: number): number;
|
|
9
|
+
/** Convert detent fractions (0–1) to Gorhom snap-point percentage strings. */
|
|
10
|
+
export declare function detentsToSnapPoints(detents: readonly number[]): string[];
|
|
9
11
|
//# sourceMappingURL=resolveSelectDetentIndex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSelectDetentIndex.d.ts","sourceRoot":"","sources":["../../../src/components/Select/resolveSelectDetentIndex.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,4BAA6B,CAAC;AAEjE,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,EAAE,MAAM,GACd,MAAM,CAGR"}
|
|
1
|
+
{"version":3,"file":"resolveSelectDetentIndex.d.ts","sourceRoot":"","sources":["../../../src/components/Select/resolveSelectDetentIndex.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,4BAA6B,CAAC;AAEjE,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,EAAE,MAAM,GACd,MAAM,CAGR;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAExE"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_SELECT_INITIAL_DETENT = exports.DEFAULT_SELECT_DETENTS = void 0;
|
|
4
4
|
exports.resolveSelectDetentIndex = resolveSelectDetentIndex;
|
|
5
|
+
exports.detentsToSnapPoints = detentsToSnapPoints;
|
|
5
6
|
/** Default sheet heights: quarter, half, three-quarter. */
|
|
6
7
|
exports.DEFAULT_SELECT_DETENTS = [0.25, 0.5, 0.75];
|
|
7
8
|
exports.DEFAULT_SELECT_INITIAL_DETENT = 0.5;
|
|
@@ -13,4 +14,8 @@ function resolveSelectDetentIndex(detents, initial) {
|
|
|
13
14
|
const index = detents.indexOf(initial);
|
|
14
15
|
return index >= 0 ? index : 0;
|
|
15
16
|
}
|
|
17
|
+
/** Convert detent fractions (0–1) to Gorhom snap-point percentage strings. */
|
|
18
|
+
function detentsToSnapPoints(detents) {
|
|
19
|
+
return detents.map((detent) => `${Math.round(detent * 100)}%`);
|
|
20
|
+
}
|
|
16
21
|
//# sourceMappingURL=resolveSelectDetentIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSelectDetentIndex.js","sourceRoot":"","sources":["../../../src/components/Select/resolveSelectDetentIndex.ts"],"names":[],"mappings":";;;AASA,4DAMC;
|
|
1
|
+
{"version":3,"file":"resolveSelectDetentIndex.js","sourceRoot":"","sources":["../../../src/components/Select/resolveSelectDetentIndex.ts"],"names":[],"mappings":";;;AASA,4DAMC;AAGD,kDAEC;AApBD,2DAA2D;AAC9C,QAAA,sBAAsB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AAEpD,QAAA,6BAA6B,GAAG,GAAG,CAAC;AAEjD;;;GAGG;AACH,SAAgB,wBAAwB,CACtC,OAA0B,EAC1B,OAAe;IAEf,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,8EAA8E;AAC9E,SAAgB,mBAAmB,CAAC,OAA0B;IAC5D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, ReactNode, RefAttributes } from "react";
|
|
2
|
+
import type { TrueSheet, TrueSheetProps } from "@lodev09/react-native-true-sheet";
|
|
3
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
4
|
+
export declare const ReanimatedTrueSheet: ForwardRefExoticComponent<TrueSheetProps & RefAttributes<TrueSheet>>;
|
|
5
|
+
export declare const ReanimatedTrueSheetProvider: (props: {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
export declare const useReanimatedTrueSheet: () => {
|
|
9
|
+
animatedPosition: SharedValue<number>;
|
|
10
|
+
animatedIndex: SharedValue<number>;
|
|
11
|
+
animatedDetent: SharedValue<number>;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=trueSheetReanimated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trueSheetReanimated.d.ts","sourceRoot":"","sources":["../../../src/components/Select/trueSheetReanimated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAuB3D,eAAO,MAAM,mBAAmB,sEAA0B,CAAC;AAC3D,eAAO,MAAM,2BAA2B,UAlBD;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,KAAK,SAkBM,CAAC;AAC3E,eAAO,MAAM,sBAAsB,QAlBH;IAC5B,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAewB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useReanimatedTrueSheet = exports.ReanimatedTrueSheetProvider = exports.ReanimatedTrueSheet = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Subpath `@lodev09/react-native-true-sheet/reanimated` is resolved by Metro
|
|
6
|
+
* via package exports; TypeScript `moduleResolution: "node"` cannot see it.
|
|
7
|
+
* Runtime require matches the truesheet-usage Reanimated guide.
|
|
8
|
+
*/
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
10
|
+
const mod = require("@lodev09/react-native-true-sheet/reanimated");
|
|
11
|
+
exports.ReanimatedTrueSheet = mod.ReanimatedTrueSheet;
|
|
12
|
+
exports.ReanimatedTrueSheetProvider = mod.ReanimatedTrueSheetProvider;
|
|
13
|
+
exports.useReanimatedTrueSheet = mod.useReanimatedTrueSheet;
|
|
14
|
+
//# sourceMappingURL=trueSheetReanimated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trueSheetReanimated.js","sourceRoot":"","sources":["../../../src/components/Select/trueSheetReanimated.ts"],"names":[],"mappings":";;;AAgBA;;;;GAIG;AACH,iEAAiE;AACjE,MAAM,GAAG,GACP,OAAO,CAAC,6CAA6C,CAA8B,CAAC;AAEzE,QAAA,mBAAmB,GAAG,GAAG,CAAC,mBAAmB,CAAC;AAC9C,QAAA,2BAA2B,GAAG,GAAG,CAAC,2BAA2B,CAAC;AAC9D,QAAA,sBAAsB,GAAG,GAAG,CAAC,sBAAsB,CAAC"}
|
|
@@ -16,9 +16,11 @@ export type SelectProps = {
|
|
|
16
16
|
description?: string;
|
|
17
17
|
error?: string;
|
|
18
18
|
sheetTitle?: string;
|
|
19
|
-
/**
|
|
19
|
+
/** DiscClose by default. Pass `(dismiss) => <YourClose onPress={dismiss} />` to override. */
|
|
20
20
|
closeButton?: SelectCloseButton;
|
|
21
|
+
/** Detent fractions 0–1; mapped to Gorhom snap `%`. Default `[0.25, 0.5, 0.75]`. */
|
|
21
22
|
detents?: number[];
|
|
23
|
+
/** Which detent to open at. Default `0.5`. */
|
|
22
24
|
initialDetent?: number;
|
|
23
25
|
radius?: ButtonRadius;
|
|
24
26
|
editable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,MAAM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AAY,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6FAA6F;IAC7F,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -3,5 +3,5 @@ export { LinkBlocks, filterLinkBlockGroups, type LinkBlockGroup, type LinkBlockI
|
|
|
3
3
|
export { FieldText, FieldTextarea, FIELD_THEME_ROLES, type FieldThemeColorProp, type FieldSharedProps, type FieldTextProps, type FieldTextareaProps, } from "./Field";
|
|
4
4
|
export { Form, FormCloseButton, type FormProps } from "./Form";
|
|
5
5
|
export { RadioField, RADIO_THEME_ROLES, type RadioThemeColorProp, type RadioOption, type RadioFieldProps, } from "./RadioField";
|
|
6
|
-
export { Select, SelectCloseButton, SELECT_THEME_ROLES, DEFAULT_SELECT_DETENTS, DEFAULT_SELECT_INITIAL_DETENT, resolveSelectDetentIndex, type SelectThemeColorProp, type
|
|
6
|
+
export { Select, SelectCloseButton, SELECT_THEME_ROLES, DEFAULT_SELECT_DETENTS, DEFAULT_SELECT_INITIAL_DETENT, detentsToSnapPoints, resolveSelectDetentIndex, type SelectThemeColorProp, type SelectCloseButtonSlot, type SelectOption, type SelectProps, } from "./Select";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,YAAY,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,6BAA6B,EAC7B,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,YAAY,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveSelectDetentIndex = exports.DEFAULT_SELECT_INITIAL_DETENT = exports.DEFAULT_SELECT_DETENTS = exports.SELECT_THEME_ROLES = exports.SelectCloseButton = exports.Select = exports.RADIO_THEME_ROLES = exports.RadioField = exports.FormCloseButton = exports.Form = exports.FIELD_THEME_ROLES = exports.FieldTextarea = exports.FieldText = exports.filterLinkBlockGroups = exports.LinkBlocks = exports.buttonRadiusValue = exports.Button = void 0;
|
|
3
|
+
exports.resolveSelectDetentIndex = exports.detentsToSnapPoints = exports.DEFAULT_SELECT_INITIAL_DETENT = exports.DEFAULT_SELECT_DETENTS = exports.SELECT_THEME_ROLES = exports.SelectCloseButton = exports.Select = exports.RADIO_THEME_ROLES = exports.RadioField = exports.FormCloseButton = exports.Form = exports.FIELD_THEME_ROLES = exports.FieldTextarea = exports.FieldText = exports.filterLinkBlockGroups = exports.LinkBlocks = exports.buttonRadiusValue = exports.Button = void 0;
|
|
4
4
|
var Button_1 = require("./Button");
|
|
5
5
|
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
|
|
6
6
|
Object.defineProperty(exports, "buttonRadiusValue", { enumerable: true, get: function () { return Button_1.buttonRadiusValue; } });
|
|
@@ -23,5 +23,6 @@ Object.defineProperty(exports, "SelectCloseButton", { enumerable: true, get: fun
|
|
|
23
23
|
Object.defineProperty(exports, "SELECT_THEME_ROLES", { enumerable: true, get: function () { return Select_1.SELECT_THEME_ROLES; } });
|
|
24
24
|
Object.defineProperty(exports, "DEFAULT_SELECT_DETENTS", { enumerable: true, get: function () { return Select_1.DEFAULT_SELECT_DETENTS; } });
|
|
25
25
|
Object.defineProperty(exports, "DEFAULT_SELECT_INITIAL_DETENT", { enumerable: true, get: function () { return Select_1.DEFAULT_SELECT_INITIAL_DETENT; } });
|
|
26
|
+
Object.defineProperty(exports, "detentsToSnapPoints", { enumerable: true, get: function () { return Select_1.detentsToSnapPoints; } });
|
|
26
27
|
Object.defineProperty(exports, "resolveSelectDetentIndex", { enumerable: true, get: function () { return Select_1.resolveSelectDetentIndex; } });
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,mCAKkB;AAJhB,gGAAA,MAAM,OAAA;AAEN,2GAAA,iBAAiB,OAAA;AAGnB,2CAMsB;AALpB,wGAAA,UAAU,OAAA;AACV,mHAAA,qBAAqB,OAAA;AAKvB,iCAQiB;AAPf,kGAAA,SAAS,OAAA;AACT,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AAMnB,+BAA+D;AAAtD,4FAAA,IAAI,OAAA;AAAE,uGAAA,eAAe,OAAA;AAC9B,2CAMsB;AALpB,wGAAA,UAAU,OAAA;AACV,+GAAA,iBAAiB,OAAA;AAKnB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,mCAKkB;AAJhB,gGAAA,MAAM,OAAA;AAEN,2GAAA,iBAAiB,OAAA;AAGnB,2CAMsB;AALpB,wGAAA,UAAU,OAAA;AACV,mHAAA,qBAAqB,OAAA;AAKvB,iCAQiB;AAPf,kGAAA,SAAS,OAAA;AACT,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AAMnB,+BAA+D;AAAtD,4FAAA,IAAI,OAAA;AAAE,uGAAA,eAAe,OAAA;AAC9B,2CAMsB;AALpB,wGAAA,UAAU,OAAA;AACV,+GAAA,iBAAiB,OAAA;AAKnB,mCAYkB;AAXhB,gGAAA,MAAM,OAAA;AACN,2GAAA,iBAAiB,OAAA;AACjB,4GAAA,kBAAkB,OAAA;AAClB,gHAAA,sBAAsB,OAAA;AACtB,uHAAA,6BAA6B,OAAA;AAC7B,6GAAA,mBAAmB,OAAA;AACnB,kHAAA,wBAAwB,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare const version = "0.
|
|
1
|
+
export declare const version = "0.2.0";
|
|
2
2
|
export * from "./theme";
|
|
3
3
|
export { Button, type ButtonProps, buttonRadiusValue, type ButtonRadius, } from "./components/Button";
|
|
4
4
|
export { LinkBlocks, filterLinkBlockGroups, type LinkBlockGroup, type LinkBlockItem, type LinkBlocksProps, } from "./components/LinkBlocks";
|
|
5
5
|
export { FieldText, FieldTextarea, FIELD_THEME_ROLES, type FieldThemeColorProp, type FieldSharedProps, type FieldTextProps, type FieldTextareaProps, } from "./components/Field";
|
|
6
6
|
export { Form, FormCloseButton, type FormProps, } from "./components/Form";
|
|
7
7
|
export { RadioField, RADIO_THEME_ROLES, type RadioThemeColorProp, type RadioOption, type RadioFieldProps, } from "./components/RadioField";
|
|
8
|
-
export { Select, SelectCloseButton, SELECT_THEME_ROLES, DEFAULT_SELECT_DETENTS, DEFAULT_SELECT_INITIAL_DETENT, resolveSelectDetentIndex, type SelectThemeColorProp, type
|
|
8
|
+
export { Select, SelectCloseButton, SELECT_THEME_ROLES, DEFAULT_SELECT_DETENTS, DEFAULT_SELECT_INITIAL_DETENT, detentsToSnapPoints, resolveSelectDetentIndex, type SelectThemeColorProp, type SelectCloseButtonSlot, type SelectOption, type SelectProps, } from "./components/Select";
|
|
9
9
|
export * as components from "./components";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,IAAI,EACJ,eAAe,EACf,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,6BAA6B,EAC7B,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,IAAI,EACJ,eAAe,EACf,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -36,8 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.components = exports.resolveSelectDetentIndex = exports.DEFAULT_SELECT_INITIAL_DETENT = exports.DEFAULT_SELECT_DETENTS = exports.SELECT_THEME_ROLES = exports.SelectCloseButton = exports.Select = exports.RADIO_THEME_ROLES = exports.RadioField = exports.FormCloseButton = exports.Form = exports.FIELD_THEME_ROLES = exports.FieldTextarea = exports.FieldText = exports.filterLinkBlockGroups = exports.LinkBlocks = exports.buttonRadiusValue = exports.Button = exports.version = void 0;
|
|
40
|
-
exports.version = "0.
|
|
39
|
+
exports.components = exports.resolveSelectDetentIndex = exports.detentsToSnapPoints = exports.DEFAULT_SELECT_INITIAL_DETENT = exports.DEFAULT_SELECT_DETENTS = exports.SELECT_THEME_ROLES = exports.SelectCloseButton = exports.Select = exports.RADIO_THEME_ROLES = exports.RadioField = exports.FormCloseButton = exports.Form = exports.FIELD_THEME_ROLES = exports.FieldTextarea = exports.FieldText = exports.filterLinkBlockGroups = exports.LinkBlocks = exports.buttonRadiusValue = exports.Button = exports.version = void 0;
|
|
40
|
+
exports.version = "0.2.0";
|
|
41
41
|
__exportStar(require("./theme"), exports);
|
|
42
42
|
var Button_1 = require("./components/Button");
|
|
43
43
|
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
|
|
@@ -61,6 +61,7 @@ Object.defineProperty(exports, "SelectCloseButton", { enumerable: true, get: fun
|
|
|
61
61
|
Object.defineProperty(exports, "SELECT_THEME_ROLES", { enumerable: true, get: function () { return Select_1.SELECT_THEME_ROLES; } });
|
|
62
62
|
Object.defineProperty(exports, "DEFAULT_SELECT_DETENTS", { enumerable: true, get: function () { return Select_1.DEFAULT_SELECT_DETENTS; } });
|
|
63
63
|
Object.defineProperty(exports, "DEFAULT_SELECT_INITIAL_DETENT", { enumerable: true, get: function () { return Select_1.DEFAULT_SELECT_INITIAL_DETENT; } });
|
|
64
|
+
Object.defineProperty(exports, "detentsToSnapPoints", { enumerable: true, get: function () { return Select_1.detentsToSnapPoints; } });
|
|
64
65
|
Object.defineProperty(exports, "resolveSelectDetentIndex", { enumerable: true, get: function () { return Select_1.resolveSelectDetentIndex; } });
|
|
65
66
|
exports.components = __importStar(require("./components"));
|
|
66
67
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B,0CAAwB;AACxB,8CAK6B;AAJ3B,gGAAA,MAAM,OAAA;AAEN,2GAAA,iBAAiB,OAAA;AAGnB,sDAMiC;AAL/B,wGAAA,UAAU,OAAA;AACV,mHAAA,qBAAqB,OAAA;AAKvB,4CAQ4B;AAP1B,kGAAA,SAAS,OAAA;AACT,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AAMnB,0CAI2B;AAHzB,4FAAA,IAAI,OAAA;AACJ,uGAAA,eAAe,OAAA;AAGjB,sDAMiC;AAL/B,wGAAA,UAAU,OAAA;AACV,+GAAA,iBAAiB,OAAA;AAKnB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B,0CAAwB;AACxB,8CAK6B;AAJ3B,gGAAA,MAAM,OAAA;AAEN,2GAAA,iBAAiB,OAAA;AAGnB,sDAMiC;AAL/B,wGAAA,UAAU,OAAA;AACV,mHAAA,qBAAqB,OAAA;AAKvB,4CAQ4B;AAP1B,kGAAA,SAAS,OAAA;AACT,sGAAA,aAAa,OAAA;AACb,0GAAA,iBAAiB,OAAA;AAMnB,0CAI2B;AAHzB,4FAAA,IAAI,OAAA;AACJ,uGAAA,eAAe,OAAA;AAGjB,sDAMiC;AAL/B,wGAAA,UAAU,OAAA;AACV,+GAAA,iBAAiB,OAAA;AAKnB,8CAY6B;AAX3B,gGAAA,MAAM,OAAA;AACN,2GAAA,iBAAiB,OAAA;AACjB,4GAAA,kBAAkB,OAAA;AAClB,gHAAA,sBAAsB,OAAA;AACtB,uHAAA,6BAA6B,OAAA;AAC7B,6GAAA,mBAAmB,OAAA;AACnB,kHAAA,wBAAwB,OAAA;AAM1B,2DAA2C"}
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
# Select — usage
|
|
2
2
|
|
|
3
|
-
Field-like select trigger that opens a
|
|
3
|
+
Field-like select trigger that opens a Gorhom bottom sheet (`@gorhom/bottom-sheet`) of options. Selecting an option updates the value and dismisses the sheet.
|
|
4
4
|
|
|
5
5
|
For `ThemeProvider`, see [theme provider and Button usage](./button.md). Design: [Select design](../superpowers/specs/2026-09-25-select-design.md).
|
|
6
6
|
|
|
7
|
-
## Peer
|
|
7
|
+
## Peer dependencies
|
|
8
8
|
|
|
9
|
-
Install in the app:
|
|
9
|
+
Install in the app (Expo example):
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx expo install @
|
|
12
|
+
npx expo install @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Wrap the app root with `GestureHandlerRootView` and `BottomSheetModalProvider`:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
|
|
19
|
+
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
20
|
+
|
|
21
|
+
export default function RootLayout() {
|
|
22
|
+
return (
|
|
23
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
24
|
+
<BottomSheetModalProvider>{/* … */}</BottomSheetModalProvider>
|
|
25
|
+
</GestureHandlerRootView>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Import `react-native-gesture-handler` at the top of the entry layout (before other imports) if your template requires it.
|
|
16
31
|
|
|
17
32
|
## Theme roles
|
|
18
33
|
|
|
@@ -36,15 +51,17 @@ import { Select } from "@studio-piot/native-ui";
|
|
|
36
51
|
/>
|
|
37
52
|
```
|
|
38
53
|
|
|
39
|
-
##
|
|
54
|
+
## Close control
|
|
55
|
+
|
|
56
|
+
Default is a dark disc with a white × (`SelectCloseButton`). Override:
|
|
40
57
|
|
|
41
58
|
```tsx
|
|
42
|
-
closeButton={(dismiss) => <
|
|
59
|
+
closeButton={(dismiss) => <YourClose onPress={dismiss} />}
|
|
43
60
|
```
|
|
44
61
|
|
|
45
|
-
## Detents
|
|
62
|
+
## Detents / snap points
|
|
46
63
|
|
|
47
|
-
Default `detents={[0.25, 0.5, 0.75]}
|
|
64
|
+
Default `detents={[0.25, 0.5, 0.75]}` (Gorhom snap `25%` / `50%` / `75%`), opens at `initialDetent={0.5}`.
|
|
48
65
|
|
|
49
66
|
## Imports
|
|
50
67
|
|
|
@@ -2,21 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
> **For agentic workers:** Inline execution in session; checkboxes track progress.
|
|
4
4
|
|
|
5
|
-
**Goal:** Ship `Select` (Field-like trigger +
|
|
5
|
+
**Goal:** Ship `Select` (Field-like trigger + Gorhom `BottomSheetModal`) and wire Ribe create-activity Type; remove TrueSheet from Ribe.
|
|
6
6
|
|
|
7
|
-
**Architecture:** Controlled `Select` presents `@
|
|
7
|
+
**Architecture:** Controlled `Select` presents `@gorhom/bottom-sheet` at snap points from detents `[0.25, 0.5, 0.75]` (open index for `0.5`). Default close is DiscClose. Field theme roles + `fieldRadioSelected` for selected check. App provides `BottomSheetModalProvider` (+ existing `GestureHandlerRootView`).
|
|
8
8
|
|
|
9
|
-
**Tech Stack:** TypeScript, RN,
|
|
9
|
+
**Tech Stack:** TypeScript, RN, Gorhom peer (+ reanimated, gesture-handler), Expo Ribe.
|
|
10
10
|
|
|
11
11
|
## Global Constraints
|
|
12
12
|
|
|
13
13
|
- Spec: `docs/superpowers/specs/2026-09-25-select-design.md`
|
|
14
|
-
-
|
|
14
|
+
- Peers: `@gorhom/bottom-sheet`, `react-native-reanimated`, `react-native-gesture-handler`
|
|
15
|
+
- No TrueSheet in package or Ribe
|
|
15
16
|
- No brand in package; no search/icons/grids
|
|
17
|
+
- Commit only when the user asks
|
|
18
|
+
|
|
19
|
+
## File map
|
|
20
|
+
|
|
21
|
+
| File | Responsibility |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `src/components/Select/resolveSelectDetentIndex.ts` | Detent → snap index + % snap points |
|
|
24
|
+
| `src/components/Select/resolveSelectDetentIndex.test.ts` | Unit tests |
|
|
25
|
+
| `src/components/Select/selectThemeRoles.ts` | Role map |
|
|
26
|
+
| `src/components/Select/selectThemeRoles.test.ts` | Role map assertions |
|
|
27
|
+
| `src/components/Select/types.ts` | Props |
|
|
28
|
+
| `src/components/Select/SelectCloseButton.tsx` | DiscClose default |
|
|
29
|
+
| `src/components/Select/Select.tsx` | Trigger + BottomSheetModal |
|
|
30
|
+
| `src/components/Select/index.ts` | Barrel |
|
|
31
|
+
| `docs/components/select.md` | Usage |
|
|
32
|
+
| Exports / README | Public surface |
|
|
33
|
+
| Ribe create-activity, root layout | Wire Select + BottomSheetModalProvider |
|
|
34
|
+
| Ribe package / sheet-lab / activities | Remove TrueSheet + lab |
|
|
16
35
|
|
|
17
36
|
## Tasks
|
|
18
37
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
---
|
|
38
|
+
- [x] Spec (Gorhom)
|
|
39
|
+
- [x] Package Select + peers + docs + exports + unit tests
|
|
40
|
+
- [x] Ribe: BottomSheetModalProvider, create-activity Select, remove TrueSheet + sheet-lab
|