@molecule/app-price-range-slider-react 4.0.1 → 4.1.1
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
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-25T03:49:05.073Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-price-range-slider-react
|
|
@@ -97,7 +97,7 @@ function PriceRangeSlider({
|
|
|
97
97
|
onChange,
|
|
98
98
|
step = 1,
|
|
99
99
|
formatValue,
|
|
100
|
-
label,
|
|
100
|
+
label: labelProp,
|
|
101
101
|
className,
|
|
102
102
|
}: PriceRangeSliderProps): React.ReactElement
|
|
103
103
|
```
|
|
@@ -110,9 +110,9 @@ function PriceRangeSlider({
|
|
|
110
110
|
|
|
111
111
|
Peer dependencies:
|
|
112
112
|
|
|
113
|
-
- `@molecule/app-react` ^4.
|
|
114
|
-
- `@molecule/app-ui` ^1.0
|
|
115
|
-
- `@molecule/app-ui-react` ^4.
|
|
113
|
+
- `@molecule/app-react` ^4.13.0
|
|
114
|
+
- `@molecule/app-ui` ^1.8.0
|
|
115
|
+
- `@molecule/app-ui-react` ^4.6.0
|
|
116
116
|
- `react` ^18.0.0 || ^19.0.0
|
|
117
117
|
|
|
118
118
|
### Runtime Dependencies
|
|
@@ -24,5 +24,5 @@ export interface PriceRangeSliderProps {
|
|
|
24
24
|
* endpoint labels (typical use: currency-formatted prices).
|
|
25
25
|
* @param props - Component props (see {@link PriceRangeSliderProps}).
|
|
26
26
|
*/
|
|
27
|
-
export declare function PriceRangeSlider({ min, max, value, onChange, step, formatValue, label, className, }: PriceRangeSliderProps): React.ReactElement;
|
|
27
|
+
export declare function PriceRangeSlider({ min, max, value, onChange, step, formatValue, label: labelProp, className, }: PriceRangeSliderProps): React.ReactElement;
|
|
28
28
|
//# sourceMappingURL=PriceRangeSlider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PriceRangeSlider.d.ts","sourceRoot":"","sources":["../src/PriceRangeSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"PriceRangeSlider.d.ts","sourceRoot":"","sources":["../src/PriceRangeSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,iFAAiF;IACjF,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvB,2CAA2C;IAC3C,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAA;IAC3C,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kFAAkF;IAClF,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,4BAA4B;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,GAAG,EACH,KAAK,EACL,QAAQ,EACR,IAAQ,EACR,WAAW,EACX,KAAK,EAAE,SAAS,EAChB,SAAS,GACV,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CA2C5C"}
|
package/dist/PriceRangeSlider.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from '@molecule/app-react';
|
|
3
|
+
import { slot } from '@molecule/app-react/render';
|
|
3
4
|
import { getClassMap } from '@molecule/app-ui';
|
|
5
|
+
import { Box, RangeField, Text } from '@molecule/app-ui-react/elements';
|
|
4
6
|
/**
|
|
5
7
|
* Dual-handle numeric range slider using two native `<input type="range">`
|
|
6
8
|
* controls. Apps supply min/max/step and a `formatValue` to render the
|
|
7
9
|
* endpoint labels (typical use: currency-formatted prices).
|
|
8
10
|
* @param props - Component props (see {@link PriceRangeSliderProps}).
|
|
9
11
|
*/
|
|
10
|
-
export function PriceRangeSlider({ min, max, value, onChange, step = 1, formatValue, label, className, }) {
|
|
12
|
+
export function PriceRangeSlider({ min, max, value, onChange, step = 1, formatValue, label: labelProp, className, }) {
|
|
13
|
+
const label = slot(labelProp);
|
|
11
14
|
const cm = getClassMap();
|
|
12
15
|
const { t } = useTranslation();
|
|
13
16
|
const [low, high] = value;
|
|
14
17
|
const fmt = formatValue ?? ((n) => `$${n.toLocaleString()}`);
|
|
15
|
-
return (_jsxs("div",
|
|
18
|
+
return (_jsxs(Box, { as: "div", className: cm.cn(cm.stack(2), className), children: [label && (_jsx(Text, { as: "span", className: cm.cn(cm.textSize('xs'), cm.fontWeight('semibold')), children: label })), _jsxs(Box, { as: "div", className: cm.flex({ align: 'center', gap: 'sm' }), children: [_jsx(Text, { as: "span", className: cm.textSize('sm'), children: fmt(low) }), _jsx(RangeField, { type: "range", min: min, max: max, step: step, value: low, onValueChange: (next) => onChange([Math.min(next, high), high]), className: cm.flex1, "aria-label": t('priceRangeSlider.aria.minimum', undefined, { defaultValue: 'Minimum' }) }), _jsx(RangeField, { type: "range", min: min, max: max, step: step, value: high, onValueChange: (next) => onChange([low, Math.max(next, low)]), className: cm.flex1, "aria-label": t('priceRangeSlider.aria.maximum', undefined, { defaultValue: 'Maximum' }) }), _jsx(Text, { as: "span", className: cm.textSize('sm'), children: fmt(high) })] })] }));
|
|
16
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-price-range-slider-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Price range slider — two clamped min/max range inputs with formatted labels (low always ≤ high)",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-price-range-slider-react",
|
|
6
6
|
"type": "module",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"directory": "packages/app/features/price-range-slider-react"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@molecule/app-react": "^4.
|
|
37
|
-
"@molecule/app-ui": "^1.0
|
|
38
|
-
"@molecule/app-ui-react": "^4.
|
|
36
|
+
"@molecule/app-react": "^4.13.0",
|
|
37
|
+
"@molecule/app-ui": "^1.8.0",
|
|
38
|
+
"@molecule/app-ui-react": "^4.6.0",
|
|
39
39
|
"react": "^18.0.0 || ^19.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@molecule/app-react": "4.
|
|
43
|
-
"@molecule/app-ui": "1.
|
|
44
|
-
"@molecule/app-ui-react": "4.
|
|
42
|
+
"@molecule/app-react": "4.17.0",
|
|
43
|
+
"@molecule/app-ui": "1.13.0",
|
|
44
|
+
"@molecule/app-ui-react": "4.11.0",
|
|
45
45
|
"@types/node": "26.6.5",
|
|
46
46
|
"@types/react": "19.3.0",
|
|
47
47
|
"@types/react-dom": "19.3.0",
|