@bloomreach/react-banana-ui 1.35.1 → 1.36.0

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.
@@ -27,4 +27,6 @@ export declare const WithQuickSelections: Story;
27
27
  export declare const CustomPresets: Story;
28
28
  export declare const QuickSelectionsWithTime: Story;
29
29
  export declare const ComprehensivePresetLibrary: Story;
30
+ export declare const DefaultSelectedPreset: Story;
31
+ export declare const ControlledSelectedPreset: Story;
30
32
  export declare const BuilderFunctionsDemo: Story;
@@ -258,6 +258,36 @@ export interface DateTimeRangePickerProps {
258
258
  * @default false
259
259
  */
260
260
  required?: boolean;
261
+ /**
262
+ * The currently selected preset ID (controlled).
263
+ * When provided (not `undefined`), the component is in controlled mode for preset selection.
264
+ * Use together with `onPresetSelect` to manage preset selection state externally.
265
+ *
266
+ * @example
267
+ * ```tsx
268
+ * const [presetId, setPresetId] = useState<string | undefined>('last-7-days');
269
+ * <DateTimeRangePicker
270
+ * presets={presets}
271
+ * selectedPresetId={presetId}
272
+ * onPresetSelect={(id) => setPresetId(id)}
273
+ * />
274
+ * ```
275
+ */
276
+ selectedPresetId?: string;
277
+ /**
278
+ * The default selected preset ID when the component first mounts (uncontrolled).
279
+ * When provided without `value` or `defaultValue`, the preset's date range will be
280
+ * applied as the initial value.
281
+ *
282
+ * @example
283
+ * ```tsx
284
+ * <DateTimeRangePicker
285
+ * presets={presets}
286
+ * defaultSelectedPresetId="last-7-days"
287
+ * />
288
+ * ```
289
+ */
290
+ defaultSelectedPresetId?: string;
261
291
  /**
262
292
  * Whether to show the timezone in the date and time range picker.
263
293
  * @default false
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bloomreach/react-banana-ui",
3
3
  "type": "module",
4
- "version": "1.35.1",
4
+ "version": "1.36.0",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
@@ -38,7 +38,7 @@
38
38
  "format": "prettier -wu '.'",
39
39
  "format:check": "prettier -c '.'",
40
40
  "generate": "plop",
41
- "generate:icons": "npx ts-node --esm scripts/gen-icons/generate.ts && npm run lint:fix",
41
+ "generate:icons": "tsx scripts/gen-icons/generate.ts && npm run lint:fix",
42
42
  "lint": "eslint src",
43
43
  "lint:fix": "npm run lint -- --fix",
44
44
  "prepare": "husky",
@@ -49,7 +49,8 @@
49
49
  "start": "npm run storybook",
50
50
  "storybook": "storybook dev -p 6006",
51
51
  "storybook:build": "storybook build",
52
- "storybook:upload": "npx ts-node --esm --transpile-only scripts/sb-upload/index.ts",
52
+ "storybook:publish": "tsx scripts/storybook-upload.ts",
53
+ "storybook:upload": "tsx scripts/storybook-upload.ts --skip-build",
53
54
  "test": "vitest run",
54
55
  "test:coverage": "vitest run --coverage",
55
56
  "test:preview": "vite preview --outDir html-report",
@@ -135,6 +136,7 @@
135
136
  "sass": "1.94.2",
136
137
  "semantic-release": "24.2.9",
137
138
  "storybook": "10.0.8",
139
+ "tsx": "4.21.0",
138
140
  "typescript": "5.9.3",
139
141
  "typescript-eslint": "8.47.0",
140
142
  "vite": "7.2.4",