@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectCloseButton.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectCloseButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectCloseButton.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectCloseButton.tsx"],"names":[],"mappings":"AAEA,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,eAA2B,EAC3B,SAAqB,GACtB,EAAE,sBAAsB,+BAYxB"}
|
|
@@ -3,12 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SelectCloseButton = SelectCloseButton;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_native_1 = require("react-native");
|
|
6
|
-
const useThemeColor_1 = require("../../theme/useThemeColor");
|
|
7
6
|
/** Default Select sheet close: filled disc + contrasting cross. */
|
|
8
|
-
function SelectCloseButton({ onPress }) {
|
|
9
|
-
|
|
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" }) }));
|
|
7
|
+
function SelectCloseButton({ onPress, backgroundColor = "#111111", iconColor = "#FFFFFF", }) {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { accessibilityLabel: "Close", accessibilityRole: "button", hitSlop: 8, onPress: onPress, style: [styles.disc, { backgroundColor }], children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.discX, { color: iconColor }], children: "\u00D7" }) }));
|
|
12
9
|
}
|
|
13
10
|
const styles = react_native_1.StyleSheet.create({
|
|
14
11
|
disc: {
|
|
@@ -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":";;AAWA,8CAgBC;;AA3BD,+CAA2D;AAU3D,mEAAmE;AACnE,SAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,eAAe,GAAG,SAAS,EAC3B,SAAS,GAAG,SAAS,GACE;IACvB,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,CAAC,YAEzC,uBAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,uBAAU,GACjD,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form scroll views use `keyboardShouldPersistTaps="handled"`, so tapping
|
|
3
|
+
* Select does not dismiss the keyboard. The sheet is portaled under the
|
|
4
|
+
* keyboard window, so it must open only after the keyboard has fully hidden.
|
|
5
|
+
*/
|
|
6
|
+
export declare function presentSelectSheet(dismissKeyboard: () => Promise<void>, present: () => void): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=presentSelectSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentSelectSheet.d.ts","sourceRoot":"","sources":["../../../src/components/Select/presentSelectSheet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACpC,OAAO,EAAE,MAAM,IAAI,GAClB,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.presentSelectSheet = presentSelectSheet;
|
|
4
|
+
/**
|
|
5
|
+
* Form scroll views use `keyboardShouldPersistTaps="handled"`, so tapping
|
|
6
|
+
* Select does not dismiss the keyboard. The sheet is portaled under the
|
|
7
|
+
* keyboard window, so it must open only after the keyboard has fully hidden.
|
|
8
|
+
*/
|
|
9
|
+
function presentSelectSheet(dismissKeyboard, present) {
|
|
10
|
+
return dismissKeyboard().then(() => {
|
|
11
|
+
present();
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=presentSelectSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentSelectSheet.js","sourceRoot":"","sources":["../../../src/components/Select/presentSelectSheet.ts"],"names":[],"mappings":";;AAKA,gDAOC;AAZD;;;;GAIG;AACH,SAAgB,kBAAkB,CAChC,eAAoC,EACpC,OAAmB;IAEnB,OAAO,eAAe,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;QACjC,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -6,7 +6,7 @@ export declare const SELECT_THEME_ROLES: {
|
|
|
6
6
|
readonly descriptionColor: "fieldDescription";
|
|
7
7
|
readonly borderColor: "fieldBorder";
|
|
8
8
|
readonly errorColor: "fieldError";
|
|
9
|
-
readonly selectedColor: "
|
|
9
|
+
readonly selectedColor: "fieldSelectSelected";
|
|
10
10
|
};
|
|
11
11
|
export type SelectThemeColorProp = keyof typeof SELECT_THEME_ROLES;
|
|
12
12
|
//# sourceMappingURL=selectThemeRoles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectThemeRoles.js","sourceRoot":"","sources":["../../../src/components/Select/selectThemeRoles.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,eAAe,EAAE,iBAAiB;IAClC,SAAS,EAAE,WAAW;IACtB,gBAAgB,EAAE,kBAAkB;IACpC,UAAU,EAAE,YAAY;IACxB,gBAAgB,EAAE,kBAAkB;IACpC,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"selectThemeRoles.js","sourceRoot":"","sources":["../../../src/components/Select/selectThemeRoles.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,eAAe,EAAE,iBAAiB;IAClC,SAAS,EAAE,WAAW;IACtB,gBAAgB,EAAE,kBAAkB;IACpC,UAAU,EAAE,YAAY;IACxB,gBAAgB,EAAE,kBAAkB;IACpC,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,qBAAqB;CAC5B,CAAC"}
|
|
@@ -18,9 +18,9 @@ export type SelectProps = {
|
|
|
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
|
|
21
|
+
/** Detent fractions 0–1. Largest value caps sheet height (content-sized up to that max). Default `[0.25, 0.5, 0.75]`. */
|
|
22
22
|
detents?: number[];
|
|
23
|
-
/**
|
|
23
|
+
/** @deprecated Ignored — sheet opens at content height (capped by `detents`). */
|
|
24
24
|
initialDetent?: number;
|
|
25
25
|
radius?: ButtonRadius;
|
|
26
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,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC,CAAC;AAEzC,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,YAAY,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,
|
|
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,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC,CAAC;AAEzC,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,YAAY,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,yHAAyH;IACzH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,iFAAiF;IACjF,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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SliderProps } from "./types";
|
|
2
|
+
export declare function Slider({ value, onChange, minimumValue, maximumValue, step, label, formatValue, disabled, labelColor: labelColorProp, valueColor: valueColorProp, highlightColor: highlightColorProp, trackColor: trackColorProp, style, }: SliderProps): import("react").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=Slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,IAAI,EACJ,KAAK,EACL,WAAoB,EACpB,QAAgB,EAChB,UAAU,EAAE,cAAc,EAC1B,UAAU,EAAE,cAAc,EAC1B,cAAc,EAAE,kBAAkB,EAClC,UAAU,EAAE,cAAc,EAC1B,KAAK,GACN,EAAE,WAAW,+BAgDb"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Slider = Slider;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const slider_1 = __importDefault(require("@react-native-community/slider"));
|
|
10
|
+
const useResolvedFieldColor_1 = require("../Field/useResolvedFieldColor");
|
|
11
|
+
const sliderThemeRoles_1 = require("./sliderThemeRoles");
|
|
12
|
+
function Slider({ value, onChange, minimumValue, maximumValue, step, label, formatValue = String, disabled = false, labelColor: labelColorProp, valueColor: valueColorProp, highlightColor: highlightColorProp, trackColor: trackColorProp, style, }) {
|
|
13
|
+
const labelColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(labelColorProp, sliderThemeRoles_1.SLIDER_THEME_ROLES.labelColor);
|
|
14
|
+
const valueColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(valueColorProp, sliderThemeRoles_1.SLIDER_THEME_ROLES.valueColor);
|
|
15
|
+
const highlightColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(highlightColorProp, sliderThemeRoles_1.SLIDER_THEME_ROLES.highlightColor);
|
|
16
|
+
const trackColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(trackColorProp, sliderThemeRoles_1.SLIDER_THEME_ROLES.trackColor);
|
|
17
|
+
const display = formatValue(value);
|
|
18
|
+
const accessibilityLabel = label ? `${label}. ${display}` : display;
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles.column, disabled && styles.blocked, style], children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.header, children: [label ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.label, { color: labelColor, flex: 1 }], children: label })) : ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 } })), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.value, { color: valueColor }], children: display })] }), (0, jsx_runtime_1.jsx)(slider_1.default, { accessibilityLabel: accessibilityLabel, disabled: disabled, maximumTrackTintColor: trackColor, maximumValue: maximumValue, minimumTrackTintColor: highlightColor, minimumValue: minimumValue, onValueChange: onChange, step: step, style: styles.track, thumbTintColor: highlightColor, value: value })] }));
|
|
20
|
+
}
|
|
21
|
+
const styles = react_native_1.StyleSheet.create({
|
|
22
|
+
column: {
|
|
23
|
+
width: "100%",
|
|
24
|
+
gap: 6,
|
|
25
|
+
},
|
|
26
|
+
blocked: {
|
|
27
|
+
opacity: 0.4,
|
|
28
|
+
},
|
|
29
|
+
header: {
|
|
30
|
+
flexDirection: "row",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
gap: 12,
|
|
33
|
+
},
|
|
34
|
+
label: {
|
|
35
|
+
fontSize: 13,
|
|
36
|
+
fontWeight: "600",
|
|
37
|
+
},
|
|
38
|
+
value: {
|
|
39
|
+
fontSize: 17,
|
|
40
|
+
},
|
|
41
|
+
track: {
|
|
42
|
+
width: "100%",
|
|
43
|
+
height: 40,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=Slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":";;;;;AAMA,wBA8DC;;AApED,+CAAsD;AACtD,4EAA6D;AAC7D,0EAAuE;AACvE,yDAAwD;AAGxD,SAAgB,MAAM,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,IAAI,EACJ,KAAK,EACL,WAAW,GAAG,MAAM,EACpB,QAAQ,GAAG,KAAK,EAChB,UAAU,EAAE,cAAc,EAC1B,UAAU,EAAE,cAAc,EAC1B,cAAc,EAAE,kBAAkB,EAClC,UAAU,EAAE,cAAc,EAC1B,KAAK,GACO;IACZ,MAAM,UAAU,GAAG,IAAA,6CAAqB,EACtC,cAAc,EACd,qCAAkB,CAAC,UAAU,CAC9B,CAAC;IACF,MAAM,UAAU,GAAG,IAAA,6CAAqB,EACtC,cAAc,EACd,qCAAkB,CAAC,UAAU,CAC9B,CAAC;IACF,MAAM,cAAc,GAAG,IAAA,6CAAqB,EAC1C,kBAAkB,EAClB,qCAAkB,CAAC,cAAc,CAClC,CAAC;IACF,MAAM,UAAU,GAAG,IAAA,6CAAqB,EACtC,cAAc,EACd,qCAAkB,CAAC,UAAU,CAC9B,CAAC;IAEF,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,kBAAkB,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAEpE,OAAO,CACL,wBAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,aAC7D,wBAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,aACvB,KAAK,CAAC,CAAC,CAAC,CACP,uBAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,YACxD,KAAK,GACD,CACR,CAAC,CAAC,CAAC,CACF,uBAAC,mBAAI,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAI,CAC7B,EACD,uBAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,YAAG,OAAO,GAAQ,IAC/D,EACP,uBAAC,gBAAe,IACd,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,UAAU,EACjC,YAAY,EAAE,YAAY,EAC1B,qBAAqB,EAAE,cAAc,EACrC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,QAAQ,EACvB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,GACZ,IACG,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,CAAC;KACP;IACD,OAAO,EAAE;QACP,OAAO,EAAE,GAAG;KACb;IACD,MAAM,EAAE;QACN,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,GAAG,EAAE,EAAE;KACR;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,EAAE;KACX;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SLIDER_THEME_ROLES = exports.Slider = void 0;
|
|
4
|
+
var Slider_1 = require("./Slider");
|
|
5
|
+
Object.defineProperty(exports, "Slider", { enumerable: true, get: function () { return Slider_1.Slider; } });
|
|
6
|
+
var sliderThemeRoles_1 = require("./sliderThemeRoles");
|
|
7
|
+
Object.defineProperty(exports, "SLIDER_THEME_ROLES", { enumerable: true, get: function () { return sliderThemeRoles_1.SLIDER_THEME_ROLES; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Slider/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,uDAG4B;AAF1B,sHAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SLIDER_THEME_ROLES: {
|
|
2
|
+
readonly labelColor: "fieldLabel";
|
|
3
|
+
readonly valueColor: "fieldText";
|
|
4
|
+
readonly highlightColor: "fieldSliderHighlight";
|
|
5
|
+
readonly trackColor: "fieldBorder";
|
|
6
|
+
};
|
|
7
|
+
export type SliderThemeColorProp = keyof typeof SLIDER_THEME_ROLES;
|
|
8
|
+
//# sourceMappingURL=sliderThemeRoles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliderThemeRoles.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/sliderThemeRoles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;CAKrB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SLIDER_THEME_ROLES = void 0;
|
|
4
|
+
exports.SLIDER_THEME_ROLES = {
|
|
5
|
+
labelColor: "fieldLabel",
|
|
6
|
+
valueColor: "fieldText",
|
|
7
|
+
highlightColor: "fieldSliderHighlight",
|
|
8
|
+
trackColor: "fieldBorder",
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=sliderThemeRoles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliderThemeRoles.js","sourceRoot":"","sources":["../../../src/components/Slider/sliderThemeRoles.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,WAAW;IACvB,cAAc,EAAE,sBAAsB;IACtC,UAAU,EAAE,aAAa;CACjB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
export type SliderProps = {
|
|
3
|
+
value: number;
|
|
4
|
+
onChange: (value: number) => void;
|
|
5
|
+
minimumValue: number;
|
|
6
|
+
maximumValue: number;
|
|
7
|
+
step?: number;
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Defaults to `String(value)`. */
|
|
10
|
+
formatValue?: (value: number) => string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
labelColor?: string;
|
|
13
|
+
valueColor?: string;
|
|
14
|
+
highlightColor?: string;
|
|
15
|
+
trackColor?: string;
|
|
16
|
+
style?: StyleProp<ViewStyle>;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,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/Slider/types.ts"],"names":[],"mappings":""}
|
|
@@ -4,4 +4,6 @@ export { FieldText, FieldTextarea, FIELD_THEME_ROLES, type FieldThemeColorProp,
|
|
|
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
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
|
+
export { SegmentedControl, SEGMENTED_THEME_ROLES, type SegmentedThemeColorProp, type SegmentedOption, type SegmentedControlProps, } from "./SegmentedControl";
|
|
8
|
+
export { Slider, SLIDER_THEME_ROLES, type SliderThemeColorProp, type SliderProps, } from "./Slider";
|
|
7
9
|
//# 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,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC"}
|
|
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;AAClB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,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.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;
|
|
3
|
+
exports.SLIDER_THEME_ROLES = exports.Slider = exports.SEGMENTED_THEME_ROLES = exports.SegmentedControl = 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; } });
|
|
@@ -25,4 +25,10 @@ Object.defineProperty(exports, "DEFAULT_SELECT_DETENTS", { enumerable: true, get
|
|
|
25
25
|
Object.defineProperty(exports, "DEFAULT_SELECT_INITIAL_DETENT", { enumerable: true, get: function () { return Select_1.DEFAULT_SELECT_INITIAL_DETENT; } });
|
|
26
26
|
Object.defineProperty(exports, "detentsToSnapPoints", { enumerable: true, get: function () { return Select_1.detentsToSnapPoints; } });
|
|
27
27
|
Object.defineProperty(exports, "resolveSelectDetentIndex", { enumerable: true, get: function () { return Select_1.resolveSelectDetentIndex; } });
|
|
28
|
+
var SegmentedControl_1 = require("./SegmentedControl");
|
|
29
|
+
Object.defineProperty(exports, "SegmentedControl", { enumerable: true, get: function () { return SegmentedControl_1.SegmentedControl; } });
|
|
30
|
+
Object.defineProperty(exports, "SEGMENTED_THEME_ROLES", { enumerable: true, get: function () { return SegmentedControl_1.SEGMENTED_THEME_ROLES; } });
|
|
31
|
+
var Slider_1 = require("./Slider");
|
|
32
|
+
Object.defineProperty(exports, "Slider", { enumerable: true, get: function () { return Slider_1.Slider; } });
|
|
33
|
+
Object.defineProperty(exports, "SLIDER_THEME_ROLES", { enumerable: true, get: function () { return Slider_1.SLIDER_THEME_ROLES; } });
|
|
28
34
|
//# 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,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"}
|
|
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;AAM1B,uDAM4B;AAL1B,oHAAA,gBAAgB,OAAA;AAChB,yHAAA,qBAAqB,OAAA;AAKvB,mCAKkB;AAJhB,gGAAA,MAAM,OAAA;AACN,4GAAA,kBAAkB,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const version = "0.2.
|
|
1
|
+
export declare const version = "0.2.3";
|
|
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";
|
|
@@ -6,5 +6,7 @@ export { FieldText, FieldTextarea, FIELD_THEME_ROLES, type FieldThemeColorProp,
|
|
|
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
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
|
+
export { SegmentedControl, SEGMENTED_THEME_ROLES, type SegmentedThemeColorProp, type SegmentedOption, type SegmentedControlProps, } from "./components/SegmentedControl";
|
|
10
|
+
export { Slider, SLIDER_THEME_ROLES, type SliderThemeColorProp, type SliderProps, } from "./components/Slider";
|
|
9
11
|
export * as components from "./components";
|
|
10
12
|
//# 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,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"}
|
|
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,EACL,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,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.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.
|
|
39
|
+
exports.components = exports.SLIDER_THEME_ROLES = exports.Slider = exports.SEGMENTED_THEME_ROLES = exports.SegmentedControl = 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.3";
|
|
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; } });
|
|
@@ -63,5 +63,11 @@ Object.defineProperty(exports, "DEFAULT_SELECT_DETENTS", { enumerable: true, get
|
|
|
63
63
|
Object.defineProperty(exports, "DEFAULT_SELECT_INITIAL_DETENT", { enumerable: true, get: function () { return Select_1.DEFAULT_SELECT_INITIAL_DETENT; } });
|
|
64
64
|
Object.defineProperty(exports, "detentsToSnapPoints", { enumerable: true, get: function () { return Select_1.detentsToSnapPoints; } });
|
|
65
65
|
Object.defineProperty(exports, "resolveSelectDetentIndex", { enumerable: true, get: function () { return Select_1.resolveSelectDetentIndex; } });
|
|
66
|
+
var SegmentedControl_1 = require("./components/SegmentedControl");
|
|
67
|
+
Object.defineProperty(exports, "SegmentedControl", { enumerable: true, get: function () { return SegmentedControl_1.SegmentedControl; } });
|
|
68
|
+
Object.defineProperty(exports, "SEGMENTED_THEME_ROLES", { enumerable: true, get: function () { return SegmentedControl_1.SEGMENTED_THEME_ROLES; } });
|
|
69
|
+
var Slider_1 = require("./components/Slider");
|
|
70
|
+
Object.defineProperty(exports, "Slider", { enumerable: true, get: function () { return Slider_1.Slider; } });
|
|
71
|
+
Object.defineProperty(exports, "SLIDER_THEME_ROLES", { enumerable: true, get: function () { return Slider_1.SLIDER_THEME_ROLES; } });
|
|
66
72
|
exports.components = __importStar(require("./components"));
|
|
67
73
|
//# 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,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
|
+
{"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,kEAMuC;AALrC,oHAAA,gBAAgB,OAAA;AAChB,yHAAA,qBAAqB,OAAA;AAKvB,8CAK6B;AAJ3B,gGAAA,MAAM,OAAA;AACN,4GAAA,kBAAkB,OAAA;AAIpB,2DAA2C"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# SegmentedControl — usage
|
|
2
|
+
|
|
3
|
+
Presentational controlled choice shown as a row of pressable segments. One selection fill sits behind the selected segment and slides to the next choice. It is a radio group: one value, `onChange` with the next value. Colours default from `ThemeProvider`; pass props only to override. Your app owns form state.
|
|
4
|
+
|
|
5
|
+
React Native has no segmented control. iOS `UISegmentedControl` and Android Material segmented buttons are separate platform widgets, and they do not use this package’s theme roles. This control draws the row itself and moves the selection fill with `react-native-reanimated`, which is already a peer (used by `Select`).
|
|
6
|
+
|
|
7
|
+
## SegmentedControl
|
|
8
|
+
|
|
9
|
+
`SegmentedControl` is controlled only (`value` + `onChange`). When colour props are omitted, colours resolve from fixed theme roles (see below). Explicit colour props always win. `ThemeProvider` is required when at least one colour prop is omitted. Full width of the parent is fixed. An empty `options` array renders nothing. `value={null}` shows the track with no selection fill.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { SegmentedControl } from "@studio-piot/native-ui";
|
|
13
|
+
import { useState } from "react";
|
|
14
|
+
|
|
15
|
+
type DipslideStatus = "ON" | "OFF";
|
|
16
|
+
|
|
17
|
+
const statusOptions = [
|
|
18
|
+
{ value: "ON" as const, label: "On" },
|
|
19
|
+
{ value: "OFF" as const, label: "Off" },
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export function DipslideStatusField() {
|
|
23
|
+
const [status, setStatus] = useState<DipslideStatus>("ON");
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<SegmentedControl
|
|
27
|
+
label="Dipslide status"
|
|
28
|
+
value={status}
|
|
29
|
+
onChange={setStatus}
|
|
30
|
+
options={statusOptions}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
No new theme keys. The selection fill reuses `fieldRadioSelected`. Selected label text reuses `fieldBackground`, which contrasts with that fill in the same light and dark maps.
|
|
37
|
+
|
|
38
|
+
### Colour props (optional overrides)
|
|
39
|
+
|
|
40
|
+
| Prop | Default theme role | Role |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| `backgroundColor` | `fieldBackground` | Track fill |
|
|
43
|
+
| `borderColor` | `fieldBorder` | Track border |
|
|
44
|
+
| `selectedBackgroundColor` | `fieldRadioSelected` | Sliding selection fill |
|
|
45
|
+
| `labelColor` | `fieldText` | Unselected label |
|
|
46
|
+
| `selectedLabelColor` | `fieldBackground` | Label on the selection fill |
|
|
47
|
+
| `titleColor` | `fieldLabel` | Group label above the track |
|
|
48
|
+
|
|
49
|
+
### Props
|
|
50
|
+
|
|
51
|
+
| Prop | Type | Default | Notes |
|
|
52
|
+
|---|---|---|---|
|
|
53
|
+
| `value` | `T \| null` | — | Required. Controlled selection; `null` = none selected |
|
|
54
|
+
| `onChange` | `(value: T) => void` | — | Required |
|
|
55
|
+
| `options` | `SegmentedOption<T>[]` | — | Required. Empty list → renders nothing |
|
|
56
|
+
| `label` | `string` | — | Optional caption above the track |
|
|
57
|
+
| `radius` | `ButtonRadius` | `"lg"` | Same steps as `Button` (8px) |
|
|
58
|
+
| `disabled` | `boolean` | `false` | Whole control at 40% opacity; not selectable |
|
|
59
|
+
| `backgroundColor` | `string` | theme `fieldBackground` | Optional override |
|
|
60
|
+
| `borderColor` | `string` | theme `fieldBorder` | Optional override |
|
|
61
|
+
| `selectedBackgroundColor` | `string` | theme `fieldRadioSelected` | Optional override |
|
|
62
|
+
| `labelColor` | `string` | theme `fieldText` | Optional override |
|
|
63
|
+
| `selectedLabelColor` | `string` | theme `fieldBackground` | Optional override |
|
|
64
|
+
| `titleColor` | `string` | theme `fieldLabel` | Optional override |
|
|
65
|
+
| `style` | view style | — | Outer column |
|
|
66
|
+
|
|
67
|
+
### SegmentedOption
|
|
68
|
+
|
|
69
|
+
| Prop | Type | Notes |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| `value` | `T` | Stable string id |
|
|
72
|
+
| `label` | `string` | Segment title |
|
|
73
|
+
| `disabled` | `boolean` | Segment at 40% opacity; not selectable |
|
|
74
|
+
|
|
75
|
+
### Layout
|
|
76
|
+
|
|
77
|
+
Segments share the track width equally. The selection fill is inset by 3px on every side: the same gap above and below it, before the first segment, and after the last. It translates to the selected index over 220ms. Track radius defaults to `"lg"` (8). See the [Button radius table](./button.md#radius).
|
|
78
|
+
|
|
79
|
+
### Accessibility
|
|
80
|
+
|
|
81
|
+
The track uses `accessibilityRole="radiogroup"`. Each segment is `accessibilityRole="radio"` with `accessibilityState` including `selected`, `checked` (same as selected; required for Android TalkBack radio semantics), and `disabled`. The sliding fill is decorative.
|
|
82
|
+
|
|
83
|
+
## Imports
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import {
|
|
87
|
+
SegmentedControl,
|
|
88
|
+
SEGMENTED_THEME_ROLES,
|
|
89
|
+
type SegmentedOption,
|
|
90
|
+
type SegmentedControlProps,
|
|
91
|
+
} from "@studio-piot/native-ui";
|
|
92
|
+
|
|
93
|
+
// Or components only:
|
|
94
|
+
import { SegmentedControl } from "@studio-piot/native-ui/components";
|
|
95
|
+
```
|
|
@@ -9,19 +9,24 @@ For `ThemeProvider`, see [theme provider and Button usage](./button.md). Design:
|
|
|
9
9
|
Install in the app (Expo example):
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx expo install @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler
|
|
12
|
+
npx expo install @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-screens
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
On iOS, Select uses `FullWindowOverlay` so the sheet appears above React Navigation `fullScreenModal` screens.
|
|
16
|
+
|
|
17
|
+
Wrap the app root with `GestureHandlerRootView` and `BottomSheetModalProvider`. Put **`BottomSheetModalProvider` inside `ThemeProvider`** so sheet content (portaled) still resolves theme colours:
|
|
16
18
|
|
|
17
19
|
```tsx
|
|
18
20
|
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
|
|
21
|
+
import { ThemeProvider } from "@studio-piot/native-ui";
|
|
19
22
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
20
23
|
|
|
21
24
|
export default function RootLayout() {
|
|
22
25
|
return (
|
|
23
26
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
24
|
-
<
|
|
27
|
+
<ThemeProvider colors={Colors}>
|
|
28
|
+
<BottomSheetModalProvider>{/* … */}</BottomSheetModalProvider>
|
|
29
|
+
</ThemeProvider>
|
|
25
30
|
</GestureHandlerRootView>
|
|
26
31
|
);
|
|
27
32
|
}
|
|
@@ -31,7 +36,7 @@ Import `react-native-gesture-handler` at the top of the entry layout (before oth
|
|
|
31
36
|
|
|
32
37
|
## Theme roles
|
|
33
38
|
|
|
34
|
-
Uses Field roles: `fieldBackground`, `fieldText`, `fieldPlaceholder`, `fieldLabel`, `fieldDescription`, `fieldBorder`, `fieldError`, plus
|
|
39
|
+
Uses Field roles: `fieldBackground`, `fieldText`, `fieldPlaceholder`, `fieldLabel`, `fieldDescription`, `fieldBorder`, `fieldError`, plus **`fieldSelectSelected`** for the selected option check / label tint.
|
|
35
40
|
|
|
36
41
|
## Basic usage
|
|
37
42
|
|
|
@@ -59,9 +64,9 @@ Default is a dark disc with a white × (`SelectCloseButton`). Override:
|
|
|
59
64
|
closeButton={(dismiss) => <YourClose onPress={dismiss} />}
|
|
60
65
|
```
|
|
61
66
|
|
|
62
|
-
## Detents /
|
|
67
|
+
## Detents / height
|
|
63
68
|
|
|
64
|
-
|
|
69
|
+
Sheet height follows content (`enableDynamicSizing`), capped by the largest `detents` fraction (default `0.75` of the window). Dragging cannot expand past content (or that cap when the list is long).
|
|
65
70
|
|
|
66
71
|
## Imports
|
|
67
72
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Slider — usage
|
|
2
|
+
|
|
3
|
+
Controlled slider with label on the left and a live formatted value on the top right. Track uses `@react-native-community/slider`. Your app owns form state.
|
|
4
|
+
|
|
5
|
+
Design: [Slider design](../superpowers/specs/2026-09-25-slider-design.md).
|
|
6
|
+
|
|
7
|
+
## Peer dependency
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx expo install @react-native-community/slider
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Theme roles
|
|
14
|
+
|
|
15
|
+
| Usage | Role |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Label | `fieldLabel` |
|
|
18
|
+
| Value | `fieldText` |
|
|
19
|
+
| Filled track + thumb | **`fieldSliderHighlight`** (apps must add) |
|
|
20
|
+
| Unfilled track | `fieldBorder` |
|
|
21
|
+
|
|
22
|
+
## Basic usage
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { Slider } from "@studio-piot/native-ui";
|
|
26
|
+
import { useState } from "react";
|
|
27
|
+
|
|
28
|
+
export function EffortSlider() {
|
|
29
|
+
const [effort, setEffort] = useState(5);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Slider
|
|
33
|
+
label="Effort"
|
|
34
|
+
value={effort}
|
|
35
|
+
onChange={setEffort}
|
|
36
|
+
minimumValue={1}
|
|
37
|
+
maximumValue={10}
|
|
38
|
+
step={1}
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Optional colour overrides
|
|
45
|
+
|
|
46
|
+
| Prop | Default theme role |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `labelColor` | `fieldLabel` |
|
|
49
|
+
| `valueColor` | `fieldText` |
|
|
50
|
+
| `highlightColor` | `fieldSliderHighlight` |
|
|
51
|
+
| `trackColor` | `fieldBorder` |
|
|
52
|
+
|
|
53
|
+
### Props
|
|
54
|
+
|
|
55
|
+
| Prop | Type | Default | Notes |
|
|
56
|
+
|---|---|---|---|
|
|
57
|
+
| `value` | `number` | — | Required |
|
|
58
|
+
| `onChange` | `(value: number) => void` | — | Required |
|
|
59
|
+
| `minimumValue` | `number` | — | Required |
|
|
60
|
+
| `maximumValue` | `number` | — | Required |
|
|
61
|
+
| `step` | `number` | — | Optional; omit for continuous |
|
|
62
|
+
| `label` | `string` | — | Optional |
|
|
63
|
+
| `formatValue` | `(value: number) => string` | `String` | Value display |
|
|
64
|
+
| `disabled` | `boolean` | `false` | |
|
|
65
|
+
| `style` | view style | — | Outer column |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Slider Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For agentic workers:** Inline execution in session; checkboxes track progress.
|
|
4
|
+
|
|
5
|
+
**Goal:** Ship controlled `Slider` (label left, formatted value top-right, community track) with `fieldSliderHighlight`, and wire Ribe create-activity Effort (1–10).
|
|
6
|
+
|
|
7
|
+
**Architecture:** Presentational wrapper around `@react-native-community/slider`. Theme colours resolve like Field via `useResolvedFieldColor`. New role `fieldSliderHighlight` for filled track + thumb; unfilled track uses `fieldBorder`.
|
|
8
|
+
|
|
9
|
+
**Tech Stack:** TypeScript, RN, `@react-native-community/slider` peer, Expo Ribe.
|
|
10
|
+
|
|
11
|
+
## Global Constraints
|
|
12
|
+
|
|
13
|
+
- Spec: `docs/superpowers/specs/2026-09-25-slider-design.md`
|
|
14
|
+
- Peer `@react-native-community/slider`
|
|
15
|
+
- No brand in package; no custom-drawn track; no Optimum migration
|
|
16
|
+
- Commit only when the user asks
|
|
17
|
+
|
|
18
|
+
## File map
|
|
19
|
+
|
|
20
|
+
| File | Responsibility |
|
|
21
|
+
|---|---|
|
|
22
|
+
| `src/components/Slider/sliderThemeRoles.ts` | Role map |
|
|
23
|
+
| `src/components/Slider/sliderThemeRoles.test.ts` | Role assertions |
|
|
24
|
+
| `src/components/Slider/types.ts` | `SliderProps` |
|
|
25
|
+
| `src/components/Slider/Slider.tsx` | Header + community Slider |
|
|
26
|
+
| `src/components/Slider/index.ts` | Barrel |
|
|
27
|
+
| Exports / README / `docs/components/slider.md` | Public surface |
|
|
28
|
+
| Ribe `colors.ts` (+ test) | `fieldSliderHighlight` |
|
|
29
|
+
| Ribe create-activity | Effort Slider |
|
|
30
|
+
| Ribe `package.json` | Install community slider |
|
|
31
|
+
|
|
32
|
+
## Tasks
|
|
33
|
+
|
|
34
|
+
- [x] Package Slider + peer + docs + exports + unit test
|
|
35
|
+
- [x] Ribe: theme role + Effort on create-activity + install peer
|