@molecule/app-price-range-slider-react 4.0.0 → 4.0.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 +9 -4
- package/dist/PriceRangeSlider.d.ts.map +1 -1
- package/dist/PriceRangeSlider.js +3 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/package.json +5 -5
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-21T12:46:58.191Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-price-range-slider-react
|
|
@@ -123,6 +123,11 @@ Peer dependencies:
|
|
|
123
123
|
- `react`
|
|
124
124
|
|
|
125
125
|
The default `formatValue` renders US-style dollars (`$1,000`) — always pass
|
|
126
|
-
your own formatter for non-USD apps. The two sliders
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
your own formatter for non-USD apps. The two sliders' aria-labels
|
|
127
|
+
("Minimum"/"Maximum") translate through `t()`
|
|
128
|
+
(`priceRangeSlider.aria.minimum`/`priceRangeSlider.aria.maximum`), so they
|
|
129
|
+
follow the active locale. Requires a wired ClassMap bond (`getClassMap()`).
|
|
130
|
+
|
|
131
|
+
## Translations
|
|
132
|
+
|
|
133
|
+
Translation strings are provided by `@molecule/app-locales-price-range-slider`.
|
|
@@ -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;AAK9B,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,EACL,SAAS,GACV,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAoC5C"}
|
package/dist/PriceRangeSlider.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from '@molecule/app-react';
|
|
2
3
|
import { getClassMap } from '@molecule/app-ui';
|
|
3
4
|
/**
|
|
4
5
|
* Dual-handle numeric range slider using two native `<input type="range">`
|
|
@@ -8,7 +9,8 @@ import { getClassMap } from '@molecule/app-ui';
|
|
|
8
9
|
*/
|
|
9
10
|
export function PriceRangeSlider({ min, max, value, onChange, step = 1, formatValue, label, className, }) {
|
|
10
11
|
const cm = getClassMap();
|
|
12
|
+
const { t } = useTranslation();
|
|
11
13
|
const [low, high] = value;
|
|
12
14
|
const fmt = formatValue ?? ((n) => `$${n.toLocaleString()}`);
|
|
13
|
-
return (_jsxs("div", { className: cm.cn(cm.stack(2), className), children: [label && (_jsx("span", { className: cm.cn(cm.textSize('xs'), cm.fontWeight('semibold')), children: label })), _jsxs("div", { className: cm.flex({ align: 'center', gap: 'sm' }), children: [_jsx("span", { className: cm.textSize('sm'), children: fmt(low) }), _jsx("input", { type: "range", min: min, max: max, step: step, value: low, onChange: (e) => onChange([Math.min(Number(e.target.value), high), high]), className: cm.flex1, "aria-label":
|
|
15
|
+
return (_jsxs("div", { className: cm.cn(cm.stack(2), className), children: [label && (_jsx("span", { className: cm.cn(cm.textSize('xs'), cm.fontWeight('semibold')), children: label })), _jsxs("div", { className: cm.flex({ align: 'center', gap: 'sm' }), children: [_jsx("span", { className: cm.textSize('sm'), children: fmt(low) }), _jsx("input", { type: "range", min: min, max: max, step: step, value: low, onChange: (e) => onChange([Math.min(Number(e.target.value), high), high]), className: cm.flex1, "aria-label": t('priceRangeSlider.aria.minimum', undefined, { defaultValue: 'Minimum' }) }), _jsx("input", { type: "range", min: min, max: max, step: step, value: high, onChange: (e) => onChange([low, Math.max(Number(e.target.value), low)]), className: cm.flex1, "aria-label": t('priceRangeSlider.aria.maximum', undefined, { defaultValue: 'Maximum' }) }), _jsx("span", { className: cm.textSize('sm'), children: fmt(high) })] })] }));
|
|
14
16
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -29,9 +29,10 @@
|
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
31
|
* The default `formatValue` renders US-style dollars (`$1,000`) — always pass
|
|
32
|
-
* your own formatter for non-USD apps. The two sliders
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* your own formatter for non-USD apps. The two sliders' aria-labels
|
|
33
|
+
* ("Minimum"/"Maximum") translate through `t()`
|
|
34
|
+
* (`priceRangeSlider.aria.minimum`/`priceRangeSlider.aria.maximum`), so they
|
|
35
|
+
* follow the active locale. Requires a wired ClassMap bond (`getClassMap()`).
|
|
35
36
|
*
|
|
36
37
|
* @module
|
|
37
38
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,cAAc,uBAAuB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -29,9 +29,10 @@
|
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
31
|
* The default `formatValue` renders US-style dollars (`$1,000`) — always pass
|
|
32
|
-
* your own formatter for non-USD apps. The two sliders
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* your own formatter for non-USD apps. The two sliders' aria-labels
|
|
33
|
+
* ("Minimum"/"Maximum") translate through `t()`
|
|
34
|
+
* (`priceRangeSlider.aria.minimum`/`priceRangeSlider.aria.maximum`), so they
|
|
35
|
+
* follow the active locale. Requires a wired ClassMap bond (`getClassMap()`).
|
|
35
36
|
*
|
|
36
37
|
* @module
|
|
37
38
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-price-range-slider-react",
|
|
3
|
-
"version": "4.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.0.1",
|
|
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",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -39,9 +39,9 @@
|
|
|
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.10.1",
|
|
43
|
+
"@molecule/app-ui": "1.5.0",
|
|
44
|
+
"@molecule/app-ui-react": "4.2.0",
|
|
45
45
|
"@types/node": "26.6.5",
|
|
46
46
|
"@types/react": "19.3.0",
|
|
47
47
|
"@types/react-dom": "19.3.0",
|