laif-ds 0.2.79 → 0.2.80

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/dist/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable technical changes to the laif-ds core will be documented in this fil
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [laif-ds@0.2.80]
9
+
10
+ ### 🚀 Added
11
+
12
+ - **AppSelect**: Added `selectableAll` prop (multi-select only, default `true`) — renders a tri-state checkbox toggle to the left of the search bar with four icon states (`Square` / `SquareMinus` / `SquareCheck` / `SquareDot`). Both select-all and deselect-all are scoped to the current search filter, preserving out-of-view selections and `fixed: true` items
13
+ - **DatePicker**: Added range dragging — in range mode, click and drag the `from` or `to` handle to extend or shrink the selected interval; the range automatically inverts when handles cross over
14
+
15
+ ### 🔧 Changed
16
+
17
+ - **AppSelect**: Prevented automatic focus of the search input on popover open via `onOpenAutoFocus` — fixes the mobile soft-keyboard collapsing the visual viewport and pushing the dropdown off-screen
18
+ - **DatePicker**: Reworked range click behavior — a third click on a completed range now starts a new range from that day instead of resetting to empty; clicking an end-date earlier than the current `from` resets the start anchor to that day
19
+
8
20
  ## [laif-ds@0.2.79]
9
21
 
10
22
  ### 🚀 Added
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
- import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
4
- var t = e();
5
- const a = /* @__PURE__ */ r(t);
2
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
+ import { __require as t } from "../node_modules/eventemitter3/index2.js";
4
+ var r = t();
5
+ const m = /* @__PURE__ */ e(r);
6
6
  export {
7
- a as default
7
+ m as default
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
- import { __require as r } from "../node_modules/extend/index.js";
4
- var t = r();
5
- const x = /* @__PURE__ */ e(t);
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
4
+ var t = e();
5
+ const a = /* @__PURE__ */ r(t);
6
6
  export {
7
- x as default
7
+ a as default
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
- import { __require as t } from "../node_modules/eventemitter3/index2.js";
4
- var r = t();
5
- const m = /* @__PURE__ */ e(r);
3
+ import { __require as r } from "../node_modules/extend/index.js";
4
+ var t = r();
5
+ const x = /* @__PURE__ */ e(t);
6
6
  export {
7
- m as default
7
+ x as default
8
8
  };
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-04-01T11:02:03.946Z",
3
+ "generatedAt": "2026-05-05T15:26:14.216Z",
4
4
  "package": {
5
5
  "name": "laif-ds",
6
- "version": "0.2.79"
6
+ "version": "0.2.80"
7
7
  },
8
8
  "summary": {
9
9
  "scannedFiles": 394,
@@ -528,6 +528,13 @@
528
528
  "src/components/ui/multiple-selector.tsx"
529
529
  ]
530
530
  },
531
+ {
532
+ "className": "bg-muted/50 rounded p-4 text-sm",
533
+ "occurrences": 7,
534
+ "files": [
535
+ "src/components/stories/app-select.stories.tsx"
536
+ ]
537
+ },
531
538
  {
532
539
  "className": "border-d-border border px-3 py-1 text-center text-sm font-light",
533
540
  "occurrences": 7,
@@ -565,13 +572,6 @@
565
572
  "src/components/stories/playground.stories.tsx"
566
573
  ]
567
574
  },
568
- {
569
- "className": "bg-muted/50 rounded p-4 text-sm",
570
- "occurrences": 6,
571
- "files": [
572
- "src/components/stories/app-select.stories.tsx"
573
- ]
574
- },
575
575
  {
576
576
  "className": "mb-2 text-sm font-medium",
577
577
  "occurrences": 6,
@@ -74,6 +74,7 @@ export type MultiSelectProps = BaseProps & {
74
74
  renderValue?: (option: AppSelectOption) => React.ReactNode; // Custom render for selected values
75
75
  maxSelected?: number; // Maximum number of selectable items
76
76
  showChipsInsteadOfCount?: boolean; // Display chips instead of count (default: false)
77
+ selectableAll?: boolean; // Shows tri-state select-all toggle next to the search bar (default: true)
77
78
  };
78
79
  ```
79
80
 
@@ -154,6 +155,19 @@ When options have a `group` property:
154
155
  - Options without a group value (empty string, undefined, or missing) appear under the `noGroupLabel` heading
155
156
  - Grouping is based on the `group` property of `AppSelectOption`
156
157
 
158
+ ### Select All / Deselect All
159
+
160
+ In multiple mode with `selectableAll={true}` (default):
161
+
162
+ - A single tri-state checkbox-style toggle appears at the left of the search bar — replacing the search icon (or in a slim header bar when `searchable` is off)
163
+ - **`Square`** icon → no filtered options selected; click selects all matching the current filter (respects `maxSelected` cap)
164
+ - **`SquareMinus`** icon → some filtered options selected; click completes the selection (within the cap)
165
+ - **`SquareCheck`** icon → all filtered options selected (or `maxSelected` cap reached); click deselects only the currently-filtered items — **out-of-view selections and `fixed: true` items are preserved**
166
+ - **`SquareDot`** icon (disabled) → search yields no matches; the button stays visible but inactive so the layout doesn't collapse
167
+ - Both actions are scoped to the current search filter — symmetric, predictable, and prevents accidental data loss
168
+ - Uses `role="checkbox"` with dynamic `aria-checked` (`true` / `false` / `"mixed"`) and a hardcoded English `aria-label` (no per-project i18n required)
169
+ - Available only on multi-select; type-rejected on single-select. Opt out with `selectableAll={false}`
170
+
157
171
  ### Max Selection Limit
158
172
 
159
173
  In multiple mode with `maxSelected` set:
@@ -420,6 +434,37 @@ export function SelectWithDisabled() {
420
434
  }
421
435
  ```
422
436
 
437
+ ### Multiple with Select All / Deselect All
438
+
439
+ ```tsx
440
+ import { AppSelect } from "laif-ds";
441
+ import { useState } from "react";
442
+
443
+ const options = [
444
+ { value: "react", label: "React" },
445
+ { value: "vue", label: "Vue" },
446
+ { value: "angular", label: "Angular" },
447
+ { value: "svelte", label: "Svelte" },
448
+ ];
449
+
450
+ export function SelectAllExample() {
451
+ const [values, setValues] = useState<(string | number)[]>([]);
452
+
453
+ return (
454
+ <AppSelect
455
+ multiple
456
+ selectableAll
457
+ searchable
458
+ options={options}
459
+ value={values}
460
+ onValueChange={setValues}
461
+ placeholder="Select frameworks"
462
+ label="Frameworks"
463
+ />
464
+ );
465
+ }
466
+ ```
467
+
423
468
  ### Custom Render Value
424
469
 
425
470
  ```tsx
@@ -462,3 +507,4 @@ export function CustomRenderSelect() {
462
507
  - **Performance**: Efficient rendering with useMemo for computed values
463
508
  - **Custom Rendering**: Use `renderValue` prop to customize how selected options appear in the trigger
464
509
  - **Controlled Component Detection**: Uses `props.hasOwnProperty('value')` to determine if component is controlled, ensuring stable behavior even when value is `undefined`
510
+ - **Mobile Keyboard**: Popover prevents default auto-focus on open via `onOpenAutoFocus`, so the soft keyboard does not pop up automatically when `searchable` is enabled. This avoids the visual-viewport collapse that previously caused the dropdown to flip off-screen on mobile. Tap the search input to focus it explicitly when needed.
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "schemaVersion": "1.1.0",
3
- "generatedAt": "2026-04-01T11:02:03.665Z",
3
+ "generatedAt": "2026-05-05T15:26:13.593Z",
4
4
  "package": {
5
5
  "name": "laif-ds",
6
- "version": "0.2.79"
6
+ "version": "0.2.80"
7
7
  },
8
8
  "stats": {
9
9
  "documentedComponentCount": 92,
@@ -847,6 +847,7 @@
847
847
  "Search Functionality",
848
848
  "Creatable Options",
849
849
  "Grouping",
850
+ "Select All / Deselect All",
850
851
  "Max Selection Limit",
851
852
  "Chips Display",
852
853
  "Disabled Options",
@@ -858,6 +859,7 @@
858
859
  "Custom JSX Labels",
859
860
  "Clearable Single Select",
860
861
  "With Disabled Options",
862
+ "Multiple with Select All / Deselect All",
861
863
  "Custom Render Value"
862
864
  ],
863
865
  "controlledPattern": "controlled-uncontrolled-documented",
@@ -6059,5 +6061,5 @@
6059
6061
  ]
6060
6062
  }
6061
6063
  ],
6062
- "checksum": "405eb253ef5b553303bd5f6005a1395f86f08f55c627c8c96046719fcf78a9ad"
6064
+ "checksum": "5365e3750a199ac2ef62a230e7ec5a26fa46e3494a332e48d9f832d003ac6a1b"
6063
6065
  }