@molecule/app-price-range-slider-react 4.0.0 → 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-12T04:41:16.172Z
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.0.0
114
- - `@molecule/app-ui` ^1.0.1
115
- - `@molecule/app-ui-react` ^4.0.0
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
@@ -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 carry fixed English
127
- aria-labels ("Minimum"/"Maximum"); there is no locale bond. Requires a
128
- wired ClassMap bond (`getClassMap()`).
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`.
@@ -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;AAI9B,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,CAmC5C"}
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"}
@@ -1,14 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTranslation } from '@molecule/app-react';
3
+ import { slot } from '@molecule/app-react/render';
2
4
  import { getClassMap } from '@molecule/app-ui';
5
+ import { Box, RangeField, Text } from '@molecule/app-ui-react/elements';
3
6
  /**
4
7
  * Dual-handle numeric range slider using two native `<input type="range">`
5
8
  * controls. Apps supply min/max/step and a `formatValue` to render the
6
9
  * endpoint labels (typical use: currency-formatted prices).
7
10
  * @param props - Component props (see {@link PriceRangeSliderProps}).
8
11
  */
9
- 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);
10
14
  const cm = getClassMap();
15
+ const { t } = useTranslation();
11
16
  const [low, high] = value;
12
17
  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": "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": "Maximum" }), _jsx("span", { className: cm.textSize('sm'), children: fmt(high) })] })] }));
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) })] })] }));
14
19
  }
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 carry fixed English
33
- * aria-labels ("Minimum"/"Maximum"); there is no locale bond. Requires a
34
- * wired ClassMap bond (`getClassMap()`).
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
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,cAAc,uBAAuB,CAAA"}
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 carry fixed English
33
- * aria-labels ("Minimum"/"Maximum"); there is no locale bond. Requires a
34
- * wired ClassMap bond (`getClassMap()`).
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.0",
4
- "description": "Single- or dual-handle range slider with formatted labels",
3
+ "version": "4.1.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",
@@ -33,15 +33,15 @@
33
33
  "directory": "packages/app/features/price-range-slider-react"
34
34
  },
35
35
  "peerDependencies": {
36
- "@molecule/app-react": "^4.0.0",
37
- "@molecule/app-ui": "^1.0.1",
38
- "@molecule/app-ui-react": "^4.0.0",
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.0.0",
43
- "@molecule/app-ui": "1.3.9",
44
- "@molecule/app-ui-react": "4.0.0",
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",