@studio-piot/native-ui 0.2.0 → 0.2.3
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/components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +181 -0
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -0
- package/dist/components/SegmentedControl/index.d.ts +4 -0
- package/dist/components/SegmentedControl/index.d.ts.map +1 -0
- package/dist/components/SegmentedControl/index.js +8 -0
- package/dist/components/SegmentedControl/index.js.map +1 -0
- package/dist/components/SegmentedControl/segmentIndicatorFrame.d.ts +16 -0
- package/dist/components/SegmentedControl/segmentIndicatorFrame.d.ts.map +1 -0
- package/dist/components/SegmentedControl/segmentIndicatorFrame.js +27 -0
- package/dist/components/SegmentedControl/segmentIndicatorFrame.js.map +1 -0
- package/dist/components/SegmentedControl/segmentThemeRoles.d.ts +10 -0
- package/dist/components/SegmentedControl/segmentThemeRoles.d.ts.map +1 -0
- package/dist/components/SegmentedControl/segmentThemeRoles.js +12 -0
- package/dist/components/SegmentedControl/segmentThemeRoles.js.map +1 -0
- package/dist/components/SegmentedControl/types.d.ts +23 -0
- package/dist/components/SegmentedControl/types.d.ts.map +1 -0
- package/dist/components/SegmentedControl/types.js +3 -0
- package/dist/components/SegmentedControl/types.js.map +1 -0
- package/dist/components/Select/Select.d.ts +3 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +72 -28
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectCloseButton.d.ts +9 -3
- package/dist/components/Select/SelectCloseButton.d.ts.map +1 -1
- package/dist/components/Select/SelectCloseButton.js +2 -5
- package/dist/components/Select/SelectCloseButton.js.map +1 -1
- package/dist/components/Select/presentSelectSheet.d.ts +7 -0
- package/dist/components/Select/presentSelectSheet.d.ts.map +1 -0
- package/dist/components/Select/presentSelectSheet.js +14 -0
- package/dist/components/Select/presentSelectSheet.js.map +1 -0
- package/dist/components/Select/selectThemeRoles.d.ts +1 -1
- package/dist/components/Select/selectThemeRoles.js +1 -1
- package/dist/components/Select/selectThemeRoles.js.map +1 -1
- package/dist/components/Select/types.d.ts +2 -2
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Slider/Slider.d.ts +3 -0
- package/dist/components/Slider/Slider.d.ts.map +1 -0
- package/dist/components/Slider/Slider.js +46 -0
- package/dist/components/Slider/Slider.js.map +1 -0
- package/dist/components/Slider/index.d.ts +4 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/Slider/index.js +8 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/Slider/sliderThemeRoles.d.ts +8 -0
- package/dist/components/Slider/sliderThemeRoles.d.ts.map +1 -0
- package/dist/components/Slider/sliderThemeRoles.js +10 -0
- package/dist/components/Slider/sliderThemeRoles.js.map +1 -0
- package/dist/components/Slider/types.d.ts +18 -0
- package/dist/components/Slider/types.d.ts.map +1 -0
- package/dist/components/Slider/types.js +3 -0
- package/dist/components/Slider/types.js.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +7 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/docs/components/segmented-control.md +95 -0
- package/docs/components/select.md +11 -6
- package/docs/components/slider.md +65 -0
- package/docs/superpowers/plans/2026-09-25-slider.md +35 -0
- package/docs/superpowers/specs/2026-09-25-select-design.md +3 -3
- package/docs/superpowers/specs/2026-09-25-slider-design.md +117 -0
- package/package.json +6 -2
- package/src/components/SegmentedControl/SegmentedControl.tsx +234 -0
- package/src/components/SegmentedControl/index.ts +6 -0
- package/src/components/SegmentedControl/segmentIndicatorFrame.test.ts +39 -0
- package/src/components/SegmentedControl/segmentIndicatorFrame.ts +31 -0
- package/src/components/SegmentedControl/segmentThemeRoles.test.ts +17 -0
- package/src/components/SegmentedControl/segmentThemeRoles.ts +10 -0
- package/src/components/SegmentedControl/types.ts +24 -0
- package/src/components/Select/Select.tsx +133 -64
- package/src/components/Select/SelectCloseButton.tsx +15 -7
- package/src/components/Select/selectThemeRoles.test.ts +2 -2
- package/src/components/Select/selectThemeRoles.ts +1 -1
- package/src/components/Select/types.ts +2 -2
- package/src/components/Slider/Slider.tsx +95 -0
- package/src/components/Slider/index.ts +6 -0
- package/src/components/Slider/sliderThemeRoles.test.ts +12 -0
- package/src/components/Slider/sliderThemeRoles.ts +8 -0
- package/src/components/Slider/types.ts +18 -0
- package/src/components/index.ts +13 -0
- package/src/index.ts +14 -1
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
|
-
`
|
|
13
|
+
`Select` peers `@gorhom/bottom-sheet`, `react-native-reanimated`, `react-native-gesture-handler`, and `react-native-screens` (iOS `FullWindowOverlay` so the sheet appears above React Navigation modals). `SegmentedControl` uses that same `react-native-reanimated` peer to slide the selection fill. `Slider` peers `@react-native-community/slider`.
|
|
14
14
|
|
|
15
15
|
## Docs
|
|
16
16
|
|
|
@@ -20,11 +20,14 @@ npm install @studio-piot/native-ui
|
|
|
20
20
|
- [Form usage](./docs/components/form.md)
|
|
21
21
|
- [RadioField usage](./docs/components/radio-field.md)
|
|
22
22
|
- [Select usage](./docs/components/select.md)
|
|
23
|
+
- [SegmentedControl usage](./docs/components/segmented-control.md)
|
|
24
|
+
- [Slider usage](./docs/components/slider.md)
|
|
23
25
|
- [Design: theme provider and Button](./docs/superpowers/specs/2026-09-24-theme-provider-button-design.md)
|
|
24
26
|
- [Design: LinkBlocks](./docs/superpowers/specs/2026-09-24-link-blocks-design.md)
|
|
25
27
|
- [Design: Field](./docs/superpowers/specs/2026-09-24-field-design.md)
|
|
26
28
|
- [Design: RadioField](./docs/superpowers/specs/2026-09-25-radio-field-design.md)
|
|
27
29
|
- [Design: Select](./docs/superpowers/specs/2026-09-25-select-design.md)
|
|
30
|
+
- [Design: Slider](./docs/superpowers/specs/2026-09-25-slider-design.md)
|
|
28
31
|
|
|
29
32
|
## Quick start
|
|
30
33
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SegmentedControlProps } from "./types";
|
|
2
|
+
export declare function SegmentedControl<T extends string = string>({ value, onChange, options, label, radius, disabled, backgroundColor: backgroundColorProp, borderColor: borderColorProp, selectedBackgroundColor: selectedBackgroundColorProp, labelColor: labelColorProp, selectedLabelColor: selectedLabelColorProp, titleColor: titleColorProp, style, }: SegmentedControlProps<T>): import("react").JSX.Element | null;
|
|
3
|
+
//# sourceMappingURL=SegmentedControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIrD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1D,KAAK,EACL,QAAQ,EACR,OAAO,EACP,KAAK,EACL,MAAa,EACb,QAAgB,EAChB,eAAe,EAAE,mBAAmB,EACpC,WAAW,EAAE,eAAe,EAC5B,uBAAuB,EAAE,2BAA2B,EACpD,UAAU,EAAE,cAAc,EAC1B,kBAAkB,EAAE,sBAAsB,EAC1C,UAAU,EAAE,cAAc,EAC1B,KAAK,GACN,EAAE,qBAAqB,CAAC,CAAC,CAAC,sCAuJ1B"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SegmentedControl = SegmentedControl;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = require("react");
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
41
|
+
const buttonRadius_1 = require("../Button/buttonRadius");
|
|
42
|
+
const useResolvedFieldColor_1 = require("../Field/useResolvedFieldColor");
|
|
43
|
+
const segmentIndicatorFrame_1 = require("./segmentIndicatorFrame");
|
|
44
|
+
const segmentThemeRoles_1 = require("./segmentThemeRoles");
|
|
45
|
+
const SLIDE_MS = 220;
|
|
46
|
+
function SegmentedControl({ value, onChange, options, label, radius = "lg", disabled = false, backgroundColor: backgroundColorProp, borderColor: borderColorProp, selectedBackgroundColor: selectedBackgroundColorProp, labelColor: labelColorProp, selectedLabelColor: selectedLabelColorProp, titleColor: titleColorProp, style, }) {
|
|
47
|
+
const backgroundColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(backgroundColorProp, segmentThemeRoles_1.SEGMENTED_THEME_ROLES.backgroundColor);
|
|
48
|
+
const borderColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(borderColorProp, segmentThemeRoles_1.SEGMENTED_THEME_ROLES.borderColor);
|
|
49
|
+
const selectedBackgroundColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(selectedBackgroundColorProp, segmentThemeRoles_1.SEGMENTED_THEME_ROLES.selectedBackgroundColor);
|
|
50
|
+
const labelColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(labelColorProp, segmentThemeRoles_1.SEGMENTED_THEME_ROLES.labelColor);
|
|
51
|
+
const selectedLabelColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(selectedLabelColorProp, segmentThemeRoles_1.SEGMENTED_THEME_ROLES.selectedLabelColor);
|
|
52
|
+
const titleColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(titleColorProp, segmentThemeRoles_1.SEGMENTED_THEME_ROLES.titleColor);
|
|
53
|
+
const index = (0, segmentIndicatorFrame_1.resolveSegmentIndex)(value, options);
|
|
54
|
+
const trackWidth = (0, react_1.useRef)(0);
|
|
55
|
+
const laidOut = (0, react_1.useRef)(false);
|
|
56
|
+
const indexSV = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
57
|
+
const widthSV = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
58
|
+
const opacitySV = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
59
|
+
const borderRadius = (0, buttonRadius_1.buttonRadiusValue)(radius);
|
|
60
|
+
const pillRadius = Math.max(0, borderRadius - segmentIndicatorFrame_1.SEGMENT_INSET);
|
|
61
|
+
const applyTrackWidth = (nextWidth, count) => {
|
|
62
|
+
trackWidth.current = nextWidth;
|
|
63
|
+
const frame = (0, segmentIndicatorFrame_1.segmentIndicatorFrame)(0, count, nextWidth, segmentIndicatorFrame_1.SEGMENT_INSET);
|
|
64
|
+
widthSV.value = frame?.width ?? 0;
|
|
65
|
+
};
|
|
66
|
+
(0, react_1.useEffect)(() => {
|
|
67
|
+
if (trackWidth.current > 0) {
|
|
68
|
+
applyTrackWidth(trackWidth.current, options.length);
|
|
69
|
+
}
|
|
70
|
+
}, [options.length, widthSV]);
|
|
71
|
+
(0, react_1.useEffect)(() => {
|
|
72
|
+
if (!laidOut.current) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (index < 0) {
|
|
76
|
+
opacitySV.value = (0, react_native_reanimated_1.withTiming)(0, { duration: 160 });
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
opacitySV.value = (0, react_native_reanimated_1.withTiming)(1, { duration: 160 });
|
|
80
|
+
indexSV.value = (0, react_native_reanimated_1.withTiming)(index, {
|
|
81
|
+
duration: SLIDE_MS,
|
|
82
|
+
easing: react_native_reanimated_1.Easing.out(react_native_reanimated_1.Easing.cubic),
|
|
83
|
+
});
|
|
84
|
+
}, [index, indexSV, opacitySV]);
|
|
85
|
+
const indicatorStyle = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({
|
|
86
|
+
width: widthSV.value,
|
|
87
|
+
opacity: opacitySV.value,
|
|
88
|
+
transform: [{ translateX: segmentIndicatorFrame_1.SEGMENT_INSET + indexSV.value * widthSV.value }],
|
|
89
|
+
}));
|
|
90
|
+
if (options.length === 0) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles.group, disabled && styles.blocked, style], children: [label ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.title, { color: titleColor }], children: label })) : null, (0, jsx_runtime_1.jsxs)(react_native_1.View, { accessibilityLabel: label, accessibilityRole: "radiogroup", style: [
|
|
94
|
+
styles.track,
|
|
95
|
+
{ backgroundColor, borderColor, borderRadius },
|
|
96
|
+
], children: [(0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { pointerEvents: "none", style: [
|
|
97
|
+
styles.indicator,
|
|
98
|
+
indicatorStyle,
|
|
99
|
+
{
|
|
100
|
+
backgroundColor: selectedBackgroundColor,
|
|
101
|
+
borderRadius: pillRadius,
|
|
102
|
+
},
|
|
103
|
+
] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { onLayout: (event) => {
|
|
104
|
+
const nextWidth = event.nativeEvent.layout.width;
|
|
105
|
+
if (nextWidth <= 0) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
applyTrackWidth(nextWidth, options.length);
|
|
109
|
+
if (!laidOut.current) {
|
|
110
|
+
indexSV.value = index < 0 ? 0 : index;
|
|
111
|
+
opacitySV.value = index < 0 ? 0 : 1;
|
|
112
|
+
laidOut.current = true;
|
|
113
|
+
}
|
|
114
|
+
}, style: styles.row, children: options.map((option) => {
|
|
115
|
+
const selected = value === option.value;
|
|
116
|
+
const blocked = disabled || !!option.disabled;
|
|
117
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { accessibilityLabel: option.label, accessibilityRole: "radio", accessibilityState: {
|
|
118
|
+
selected,
|
|
119
|
+
checked: selected,
|
|
120
|
+
disabled: blocked,
|
|
121
|
+
}, disabled: blocked, onPress: () => onChange(option.value), style: ({ pressed }) => [
|
|
122
|
+
styles.segment,
|
|
123
|
+
pressed && !blocked && styles.pressed,
|
|
124
|
+
option.disabled && styles.segmentBlocked,
|
|
125
|
+
], children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [
|
|
126
|
+
styles.label,
|
|
127
|
+
{
|
|
128
|
+
color: selected ? selectedLabelColor : labelColor,
|
|
129
|
+
fontWeight: selected ? "600" : "500",
|
|
130
|
+
},
|
|
131
|
+
], children: option.label }) }, option.value));
|
|
132
|
+
}) })] })] }));
|
|
133
|
+
}
|
|
134
|
+
const styles = react_native_1.StyleSheet.create({
|
|
135
|
+
group: {
|
|
136
|
+
width: "100%",
|
|
137
|
+
gap: 8,
|
|
138
|
+
},
|
|
139
|
+
blocked: {
|
|
140
|
+
opacity: 0.4,
|
|
141
|
+
},
|
|
142
|
+
title: {
|
|
143
|
+
fontSize: 13,
|
|
144
|
+
fontWeight: "600",
|
|
145
|
+
paddingHorizontal: 4,
|
|
146
|
+
},
|
|
147
|
+
track: {
|
|
148
|
+
width: "100%",
|
|
149
|
+
borderWidth: 1,
|
|
150
|
+
padding: segmentIndicatorFrame_1.SEGMENT_INSET,
|
|
151
|
+
overflow: "hidden",
|
|
152
|
+
},
|
|
153
|
+
indicator: {
|
|
154
|
+
position: "absolute",
|
|
155
|
+
top: segmentIndicatorFrame_1.SEGMENT_INSET,
|
|
156
|
+
bottom: segmentIndicatorFrame_1.SEGMENT_INSET,
|
|
157
|
+
left: 0,
|
|
158
|
+
},
|
|
159
|
+
row: {
|
|
160
|
+
flexDirection: "row",
|
|
161
|
+
},
|
|
162
|
+
segment: {
|
|
163
|
+
flex: 1,
|
|
164
|
+
minHeight: 36,
|
|
165
|
+
paddingVertical: 8,
|
|
166
|
+
paddingHorizontal: 8,
|
|
167
|
+
alignItems: "center",
|
|
168
|
+
justifyContent: "center",
|
|
169
|
+
},
|
|
170
|
+
pressed: {
|
|
171
|
+
opacity: 0.65,
|
|
172
|
+
},
|
|
173
|
+
segmentBlocked: {
|
|
174
|
+
opacity: 0.4,
|
|
175
|
+
},
|
|
176
|
+
label: {
|
|
177
|
+
fontSize: 15,
|
|
178
|
+
textAlign: "center",
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
//# sourceMappingURL=SegmentedControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,4CAqKC;;AAzLD,iCAA0C;AAC1C,+CAAiE;AACjE,mFAKiC;AACjC,yDAA2D;AAC3D,0EAAuE;AACvE,mEAIiC;AACjC,2DAA4D;AAG5D,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,SAAgB,gBAAgB,CAA4B,EAC1D,KAAK,EACL,QAAQ,EACR,OAAO,EACP,KAAK,EACL,MAAM,GAAG,IAAI,EACb,QAAQ,GAAG,KAAK,EAChB,eAAe,EAAE,mBAAmB,EACpC,WAAW,EAAE,eAAe,EAC5B,uBAAuB,EAAE,2BAA2B,EACpD,UAAU,EAAE,cAAc,EAC1B,kBAAkB,EAAE,sBAAsB,EAC1C,UAAU,EAAE,cAAc,EAC1B,KAAK,GACoB;IACzB,MAAM,eAAe,GAAG,IAAA,6CAAqB,EAC3C,mBAAmB,EACnB,yCAAqB,CAAC,eAAe,CACtC,CAAC;IACF,MAAM,WAAW,GAAG,IAAA,6CAAqB,EACvC,eAAe,EACf,yCAAqB,CAAC,WAAW,CAClC,CAAC;IACF,MAAM,uBAAuB,GAAG,IAAA,6CAAqB,EACnD,2BAA2B,EAC3B,yCAAqB,CAAC,uBAAuB,CAC9C,CAAC;IACF,MAAM,UAAU,GAAG,IAAA,6CAAqB,EACtC,cAAc,EACd,yCAAqB,CAAC,UAAU,CACjC,CAAC;IACF,MAAM,kBAAkB,GAAG,IAAA,6CAAqB,EAC9C,sBAAsB,EACtB,yCAAqB,CAAC,kBAAkB,CACzC,CAAC;IACF,MAAM,UAAU,GAAG,IAAA,6CAAqB,EACtC,cAAc,EACd,yCAAq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;IACD,GAAG,EAAE;QACH,aAAa,EAAE,KAAK;KACrB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,CAAC;QACP,SAAS,EAAE,EAAE;QACb,eAAe,EAAE,CAAC;QAClB,iBAAiB,EAAE,CAAC;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,OAAO,EAAE;QACP,OAAO,EAAE,IAAI;KACd;IACD,cAAc,EAAE;QACd,OAAO,EAAE,GAAG;KACb;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SEGMENTED_THEME_ROLES = exports.SegmentedControl = void 0;
|
|
4
|
+
var SegmentedControl_1 = require("./SegmentedControl");
|
|
5
|
+
Object.defineProperty(exports, "SegmentedControl", { enumerable: true, get: function () { return SegmentedControl_1.SegmentedControl; } });
|
|
6
|
+
var segmentThemeRoles_1 = require("./segmentThemeRoles");
|
|
7
|
+
Object.defineProperty(exports, "SEGMENTED_THEME_ROLES", { enumerable: true, get: function () { return segmentThemeRoles_1.SEGMENTED_THEME_ROLES; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SegmentedControl/index.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,yDAG6B;AAF3B,0HAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Gap between the track edge and the sliding selection fill. */
|
|
2
|
+
export declare const SEGMENT_INSET = 3;
|
|
3
|
+
export declare function resolveSegmentIndex<T extends string>(value: T | null, options: readonly {
|
|
4
|
+
value: T;
|
|
5
|
+
}[]): number;
|
|
6
|
+
/**
|
|
7
|
+
* Equal-width selection fill for a segment row.
|
|
8
|
+
* `segmentRowWidth` is the row already inset from the track edge.
|
|
9
|
+
* `inset` is that same gap, applied on the leading side (and, by symmetry, the trailing side).
|
|
10
|
+
* `index` 0 is the leading segment. Returns null when there is nothing to draw.
|
|
11
|
+
*/
|
|
12
|
+
export declare function segmentIndicatorFrame(index: number, count: number, segmentRowWidth: number, inset?: number): {
|
|
13
|
+
x: number;
|
|
14
|
+
width: number;
|
|
15
|
+
} | null;
|
|
16
|
+
//# sourceMappingURL=segmentIndicatorFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmentIndicatorFrame.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/segmentIndicatorFrame.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAClD,KAAK,EAAE,CAAC,GAAG,IAAI,EACf,OAAO,EAAE,SAAS;IAAE,KAAK,EAAE,CAAC,CAAA;CAAE,EAAE,GAC/B,MAAM,CAKR;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,EACvB,KAAK,GAAE,MAAsB,GAC5B;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAMrC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SEGMENT_INSET = void 0;
|
|
4
|
+
exports.resolveSegmentIndex = resolveSegmentIndex;
|
|
5
|
+
exports.segmentIndicatorFrame = segmentIndicatorFrame;
|
|
6
|
+
/** Gap between the track edge and the sliding selection fill. */
|
|
7
|
+
exports.SEGMENT_INSET = 3;
|
|
8
|
+
function resolveSegmentIndex(value, options) {
|
|
9
|
+
if (value == null) {
|
|
10
|
+
return -1;
|
|
11
|
+
}
|
|
12
|
+
return options.findIndex((option) => option.value === value);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Equal-width selection fill for a segment row.
|
|
16
|
+
* `segmentRowWidth` is the row already inset from the track edge.
|
|
17
|
+
* `inset` is that same gap, applied on the leading side (and, by symmetry, the trailing side).
|
|
18
|
+
* `index` 0 is the leading segment. Returns null when there is nothing to draw.
|
|
19
|
+
*/
|
|
20
|
+
function segmentIndicatorFrame(index, count, segmentRowWidth, inset = exports.SEGMENT_INSET) {
|
|
21
|
+
if (index < 0 || count < 1 || segmentRowWidth <= 0) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const width = segmentRowWidth / count;
|
|
25
|
+
return { x: inset + index * width, width };
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=segmentIndicatorFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmentIndicatorFrame.js","sourceRoot":"","sources":["../../../src/components/SegmentedControl/segmentIndicatorFrame.ts"],"names":[],"mappings":";;;AAGA,kDAQC;AAQD,sDAWC;AA9BD,iEAAiE;AACpD,QAAA,aAAa,GAAG,CAAC,CAAC;AAE/B,SAAgB,mBAAmB,CACjC,KAAe,EACf,OAAgC;IAEhC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;IACD,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CACnC,KAAa,EACb,KAAa,EACb,eAAuB,EACvB,QAAgB,qBAAa;IAE7B,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,eAAe,IAAI,CAAC,EAAE,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,eAAe,GAAG,KAAK,CAAC;IACtC,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const SEGMENTED_THEME_ROLES: {
|
|
2
|
+
readonly backgroundColor: "fieldBackground";
|
|
3
|
+
readonly borderColor: "fieldBorder";
|
|
4
|
+
readonly selectedBackgroundColor: "fieldRadioSelected";
|
|
5
|
+
readonly labelColor: "fieldText";
|
|
6
|
+
readonly selectedLabelColor: "fieldBackground";
|
|
7
|
+
readonly titleColor: "fieldLabel";
|
|
8
|
+
};
|
|
9
|
+
export type SegmentedThemeColorProp = keyof typeof SEGMENTED_THEME_ROLES;
|
|
10
|
+
//# sourceMappingURL=segmentThemeRoles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmentThemeRoles.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/segmentThemeRoles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB;;;;;;;CAOxB,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,MAAM,OAAO,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SEGMENTED_THEME_ROLES = void 0;
|
|
4
|
+
exports.SEGMENTED_THEME_ROLES = {
|
|
5
|
+
backgroundColor: "fieldBackground",
|
|
6
|
+
borderColor: "fieldBorder",
|
|
7
|
+
selectedBackgroundColor: "fieldRadioSelected",
|
|
8
|
+
labelColor: "fieldText",
|
|
9
|
+
selectedLabelColor: "fieldBackground",
|
|
10
|
+
titleColor: "fieldLabel",
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=segmentThemeRoles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmentThemeRoles.js","sourceRoot":"","sources":["../../../src/components/SegmentedControl/segmentThemeRoles.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG;IACnC,eAAe,EAAE,iBAAiB;IAClC,WAAW,EAAE,aAAa;IAC1B,uBAAuB,EAAE,oBAAoB;IAC7C,UAAU,EAAE,WAAW;IACvB,kBAAkB,EAAE,iBAAiB;IACrC,UAAU,EAAE,YAAY;CAChB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import type { ButtonRadius } from "../Button/buttonRadius";
|
|
3
|
+
export type SegmentedOption<T extends string = string> = {
|
|
4
|
+
value: T;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type SegmentedControlProps<T extends string = string> = {
|
|
9
|
+
value: T | null;
|
|
10
|
+
onChange: (value: T) => void;
|
|
11
|
+
options: SegmentedOption<T>[];
|
|
12
|
+
label?: string;
|
|
13
|
+
radius?: ButtonRadius;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
backgroundColor?: string;
|
|
16
|
+
borderColor?: string;
|
|
17
|
+
selectedBackgroundColor?: string;
|
|
18
|
+
labelColor?: string;
|
|
19
|
+
selectedLabelColor?: string;
|
|
20
|
+
titleColor?: string;
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IACvD,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IAC7D,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/SegmentedControl/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { SelectProps } from "./types";
|
|
2
|
-
export declare function Select({ value, onChange, options, placeholder, label, description, error, sheetTitle, closeButton,
|
|
2
|
+
export declare function Select({ value, onChange, options, placeholder, label, description, error, sheetTitle, closeButton,
|
|
3
|
+
/** Max sheet height as a fraction of the window (largest value wins). Default `[0.25, 0.5, 0.75]` → 75%. */
|
|
4
|
+
detents, initialDetent: _initialDetent, radius, editable, backgroundColor: backgroundColorProp, textColor: textColorProp, placeholderColor: placeholderColorProp, labelColor: labelColorProp, descriptionColor: descriptionColorProp, borderColor: borderColorProp, errorColor: errorColorProp, selectedColor: selectedColorProp, style, }: SelectProps): import("react").JSX.Element;
|
|
3
5
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -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":"AA8BA,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,SAAS,CAAC;AAazD,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAgC,EAChC,KAAK,EACL,WAAW,EACX,KAAK,EACL,UAAU,EACV,WAAW;AACX,4GAA4G;AAC5G,OAAqC,EACrC,aAAa,EAAE,cAAc,EAC7B,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,+BAkPb"}
|
|
@@ -5,14 +5,27 @@ 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
7
|
const bottom_sheet_1 = require("@gorhom/bottom-sheet");
|
|
8
|
+
const react_native_screens_1 = require("react-native-screens");
|
|
8
9
|
const buttonRadius_1 = require("../Button/buttonRadius");
|
|
9
10
|
const useResolvedFieldColor_1 = require("../Field/useResolvedFieldColor");
|
|
11
|
+
const useThemeColor_1 = require("../../theme/useThemeColor");
|
|
10
12
|
const resolveSelectDetentIndex_1 = require("./resolveSelectDetentIndex");
|
|
11
13
|
const SelectCloseButton_1 = require("./SelectCloseButton");
|
|
12
14
|
const selectThemeRoles_1 = require("./selectThemeRoles");
|
|
13
15
|
const BACKDROP_OPACITY = 0.72;
|
|
14
|
-
|
|
16
|
+
const SHEET_TOP_RADIUS = 20;
|
|
17
|
+
/** Renders the sheet above React Navigation native modals (iOS). */
|
|
18
|
+
function SheetContainer({ children }) {
|
|
19
|
+
if (react_native_1.Platform.OS === "ios") {
|
|
20
|
+
return (0, jsx_runtime_1.jsx)(react_native_screens_1.FullWindowOverlay, { children: children });
|
|
21
|
+
}
|
|
22
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
23
|
+
}
|
|
24
|
+
function Select({ value, onChange, options, placeholder = "Select an option", label, description, error, sheetTitle, closeButton,
|
|
25
|
+
/** Max sheet height as a fraction of the window (largest value wins). Default `[0.25, 0.5, 0.75]` → 75%. */
|
|
26
|
+
detents = [...resolveSelectDetentIndex_1.DEFAULT_SELECT_DETENTS], initialDetent: _initialDetent, radius = "xl", editable = true, backgroundColor: backgroundColorProp, textColor: textColorProp, placeholderColor: placeholderColorProp, labelColor: labelColorProp, descriptionColor: descriptionColorProp, borderColor: borderColorProp, errorColor: errorColorProp, selectedColor: selectedColorProp, style, }) {
|
|
15
27
|
const modalRef = (0, react_1.useRef)(null);
|
|
28
|
+
const { height: windowHeight } = (0, react_native_1.useWindowDimensions)();
|
|
16
29
|
const backgroundColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(backgroundColorProp, selectThemeRoles_1.SELECT_THEME_ROLES.backgroundColor);
|
|
17
30
|
const textColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(textColorProp, selectThemeRoles_1.SELECT_THEME_ROLES.textColor);
|
|
18
31
|
const placeholderColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(placeholderColorProp, selectThemeRoles_1.SELECT_THEME_ROLES.placeholderColor);
|
|
@@ -21,14 +34,19 @@ function Select({ value, onChange, options, placeholder = "Select an option", la
|
|
|
21
34
|
const borderColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(borderColorProp, selectThemeRoles_1.SELECT_THEME_ROLES.borderColor);
|
|
22
35
|
const errorColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(errorColorProp, selectThemeRoles_1.SELECT_THEME_ROLES.errorColor);
|
|
23
36
|
const selectedColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(selectedColorProp, selectThemeRoles_1.SELECT_THEME_ROLES.selectedColor);
|
|
37
|
+
// Resolved on the trigger tree (has ThemeProvider), then passed into the portal.
|
|
38
|
+
const closeDiscColor = (0, useThemeColor_1.useThemeColor)("text");
|
|
39
|
+
const closeIconColor = (0, useThemeColor_1.useThemeColor)("background");
|
|
24
40
|
const hasError = Boolean(error);
|
|
25
41
|
const selected = options.find((option) => option.value === value);
|
|
26
42
|
const display = selected?.label ?? placeholder;
|
|
27
43
|
const isPlaceholder = selected == null;
|
|
28
44
|
const borderRadius = (0, buttonRadius_1.buttonRadiusValue)(radius);
|
|
29
45
|
const title = sheetTitle ?? label ?? "Select";
|
|
30
|
-
const
|
|
31
|
-
|
|
46
|
+
const maxDynamicContentSize = (0, react_1.useMemo)(() => {
|
|
47
|
+
const maxDetent = Math.max(...detents, 0.75);
|
|
48
|
+
return Math.round(windowHeight * maxDetent);
|
|
49
|
+
}, [detents, windowHeight]);
|
|
32
50
|
const dismiss = (0, react_1.useCallback)(() => {
|
|
33
51
|
modalRef.current?.dismiss();
|
|
34
52
|
}, []);
|
|
@@ -40,7 +58,26 @@ function Select({ value, onChange, options, placeholder = "Select an option", la
|
|
|
40
58
|
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" })), []);
|
|
41
59
|
const resolvedClose = typeof closeButton === "function"
|
|
42
60
|
? closeButton(dismiss)
|
|
43
|
-
: (closeButton ?? (0, jsx_runtime_1.jsx)(SelectCloseButton_1.SelectCloseButton, { onPress: dismiss }));
|
|
61
|
+
: (closeButton ?? ((0, jsx_runtime_1.jsx)(SelectCloseButton_1.SelectCloseButton, { backgroundColor: closeDiscColor, iconColor: closeIconColor, onPress: dismiss })));
|
|
62
|
+
// Header lives in the handle so it stays fixed; only options scroll.
|
|
63
|
+
const renderHandle = (0, react_1.useCallback)((props) => ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
64
|
+
styles.handleRoot,
|
|
65
|
+
{
|
|
66
|
+
backgroundColor,
|
|
67
|
+
borderTopLeftRadius: SHEET_TOP_RADIUS,
|
|
68
|
+
borderTopRightRadius: SHEET_TOP_RADIUS,
|
|
69
|
+
},
|
|
70
|
+
], children: [(0, jsx_runtime_1.jsx)(bottom_sheet_1.BottomSheetHandle, { ...props, indicatorStyle: {
|
|
71
|
+
backgroundColor: placeholderColor,
|
|
72
|
+
opacity: 0.9,
|
|
73
|
+
} }), (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] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles.headerDivider, { backgroundColor: borderColor }] })] })), [
|
|
74
|
+
backgroundColor,
|
|
75
|
+
borderColor,
|
|
76
|
+
placeholderColor,
|
|
77
|
+
resolvedClose,
|
|
78
|
+
textColor,
|
|
79
|
+
title,
|
|
80
|
+
]);
|
|
44
81
|
const onSelect = (option) => {
|
|
45
82
|
if (option.disabled)
|
|
46
83
|
return;
|
|
@@ -57,25 +94,26 @@ function Select({ value, onChange, options, placeholder = "Select an option", la
|
|
|
57
94
|
], children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { numberOfLines: 1, style: [
|
|
58
95
|
styles.triggerText,
|
|
59
96
|
{ color: isPlaceholder ? placeholderColor : textColor, flex: 1 },
|
|
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: {
|
|
61
|
-
backgroundColor
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
97
|
+
], 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: {
|
|
98
|
+
backgroundColor,
|
|
99
|
+
borderTopLeftRadius: SHEET_TOP_RADIUS,
|
|
100
|
+
borderTopRightRadius: SHEET_TOP_RADIUS,
|
|
101
|
+
}, containerComponent: SheetContainer, enableDynamicSizing: true, enablePanDownToClose: true, handleComponent: renderHandle, handleStyle: styles.handleShell, maxDynamicContentSize: maxDynamicContentSize, stackBehavior: "push", children: (0, jsx_runtime_1.jsx)(bottom_sheet_1.BottomSheetScrollView, { contentContainerStyle: styles.sheetContent, enableFooterMarginAdjustment: false, children: options.length === 0 ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.empty, { color: placeholderColor }], children: "No options" })) : (options.map((option) => {
|
|
102
|
+
const isSelected = option.value === value;
|
|
103
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.Pressable, { accessibilityRole: "button", accessibilityState: {
|
|
104
|
+
selected: isSelected,
|
|
105
|
+
disabled: !!option.disabled,
|
|
106
|
+
}, disabled: option.disabled, onPress: () => onSelect(option), style: [
|
|
107
|
+
styles.option,
|
|
108
|
+
option.disabled && styles.optionBlocked,
|
|
109
|
+
], children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [
|
|
110
|
+
styles.optionLabel,
|
|
111
|
+
{
|
|
112
|
+
color: isSelected ? selectedColor : textColor,
|
|
113
|
+
flex: 1,
|
|
114
|
+
},
|
|
115
|
+
], children: option.label }), isSelected ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.check, { color: selectedColor }], children: "\u2713" })) : null] }, option.value));
|
|
116
|
+
})) }) })] }));
|
|
79
117
|
}
|
|
80
118
|
const styles = react_native_1.StyleSheet.create({
|
|
81
119
|
column: {
|
|
@@ -106,10 +144,17 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
106
144
|
fontSize: 22,
|
|
107
145
|
fontWeight: "300",
|
|
108
146
|
lineHeight: 24,
|
|
147
|
+
transform: [{ rotate: "90deg" }],
|
|
109
148
|
},
|
|
110
149
|
helper: {
|
|
111
150
|
fontSize: 13,
|
|
112
151
|
},
|
|
152
|
+
handleShell: {
|
|
153
|
+
paddingBottom: 0,
|
|
154
|
+
},
|
|
155
|
+
handleRoot: {
|
|
156
|
+
overflow: "hidden",
|
|
157
|
+
},
|
|
113
158
|
sheetContent: {
|
|
114
159
|
paddingBottom: 24,
|
|
115
160
|
},
|
|
@@ -118,9 +163,12 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
118
163
|
alignItems: "center",
|
|
119
164
|
gap: 12,
|
|
120
165
|
paddingHorizontal: 16,
|
|
121
|
-
paddingTop:
|
|
166
|
+
paddingTop: 4,
|
|
122
167
|
paddingBottom: 12,
|
|
123
168
|
},
|
|
169
|
+
headerDivider: {
|
|
170
|
+
height: react_native_1.StyleSheet.hairlineWidth,
|
|
171
|
+
},
|
|
124
172
|
sheetTitle: {
|
|
125
173
|
fontSize: 17,
|
|
126
174
|
fontWeight: "600",
|
|
@@ -147,9 +195,5 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
147
195
|
fontSize: 17,
|
|
148
196
|
fontWeight: "600",
|
|
149
197
|
},
|
|
150
|
-
divider: {
|
|
151
|
-
height: react_native_1.StyleSheet.hairlineWidth,
|
|
152
|
-
marginHorizontal: 16,
|
|
153
|
-
},
|
|
154
198
|
});
|
|
155
199
|
//# 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":";;AA2CA,wBA0QC;;AArTD,iCAMe;AACf,+CAOsB;AACtB,uDAO8B;AAC9B,+DAAyD;AACzD,yDAA2D;AAC3D,0EAAuE;AACvE,6DAA0D;AAC1D,yEAAoE;AACpE,2DAAwD;AACxD,yDAAwD;AAGxD,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,gBAAgB,GAAG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KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,GAAG,EAAE,EAAE;KACR;IACD,aAAa,EAAE;QACb,OAAO,EAAE,GAAG;KACb;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function SelectCloseButton({ onPress }: {
|
|
1
|
+
type SelectCloseButtonProps = {
|
|
3
2
|
onPress: () => void;
|
|
4
|
-
|
|
3
|
+
/** Disc fill. Select passes theme colours so this stays portal-safe. */
|
|
4
|
+
backgroundColor?: string;
|
|
5
|
+
/** Cross colour. */
|
|
6
|
+
iconColor?: string;
|
|
7
|
+
};
|
|
8
|
+
/** Default Select sheet close: filled disc + contrasting cross. */
|
|
9
|
+
export declare function SelectCloseButton({ onPress, backgroundColor, iconColor, }: SelectCloseButtonProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
5
11
|
//# sourceMappingURL=SelectCloseButton.d.ts.map
|