@getflip/swirl-ai 0.519.0 → 0.520.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.
@@ -14,6 +14,7 @@ The SwirlResourceListItem component can be used to represent an object, like med
14
14
  - `alignItems` (string | undefined) –
15
15
  - `allowDrag` (boolean | undefined) –
16
16
  - `allowHtml` (boolean | undefined) –
17
+ - `checkboxLabel` (string | undefined) –
17
18
  - `checked` (boolean | undefined) –
18
19
  - `compact` (boolean | undefined) –
19
20
  - `description` (string | undefined) –
@@ -36,6 +37,7 @@ The SwirlResourceListItem component can be used to represent an object, like med
36
37
  - `meta` (string | undefined) –
37
38
  - `rel` ("external" | "nofollow" | "noindex" | "noopener noreferrer" | "noopener" | "noreferrer" | undefined) –
38
39
  - `selectable` (boolean | undefined) –
40
+ - `selectionMode` ("checkbox" | "row" | undefined) –
39
41
  - `swirlAriaCurrent` ("date" | "location" | "page" | "step" | "time" | "true" | undefined) –
40
42
  - `swirlAriaLabel` (string | undefined) –
41
43
  - `target` ("_blank" | "_parent" | "_self" | "_top" | undefined) –
@@ -49,6 +51,7 @@ The SwirlResourceListItem component can be used to represent an object, like med
49
51
 
50
52
  ## Events
51
53
 
54
+ - `activate` – CustomEvent<HTMLSwirlResourceListItemElement>
52
55
  - `toggleDrag` – CustomEvent<HTMLSwirlResourceListItemElement>
53
56
  - `valueChange` – CustomEvent<boolean>
54
57
 
@@ -75,7 +78,7 @@ control.
75
78
  | `role="gridcell"` | Set on the inner container element; for usage inside the SwirlResourceList component. |
76
79
  | `role="button"` | Implicit when used as a button. |
77
80
  | `role="link"` | Implicit when used as a link. |
78
- | `role="checkbox"` | Set on the interactive part if used as a checkbox. |
81
+ | `role="checkbox"` | Set on the interactive part if used as a checkbox, or on the checkbox itself with `selection-mode="checkbox"`. |
79
82
  | `aria-disabled` | If not used as a link, the `aria-disabled` attribute is set to `true` for the disabled element. |
80
83
 
81
84
  ### Keyboard
@@ -85,6 +88,11 @@ control.
85
88
  | <kbd>ENTER</kbd> | Activates the item if used as a button or link. |
86
89
  | <kbd>SPACE</kbd> | Activates the item if used as a button or link. Toggles the item if used as a checkbox. |
87
90
 
91
+ With `selection-mode="checkbox"`, <kbd>ENTER</kbd> on the row activates it, and
92
+ <kbd>SPACE</kbd> or <kbd>ENTER</kbd> on the checkbox toggles it. Inside a
93
+ `swirl-resource-list` with grid semantics the checkbox is reached with
94
+ <kbd>TAB</kbd> from the row, while the arrow keys keep moving between rows.
95
+
88
96
  ## Minimal example
89
97
 
90
98
  ```html
@@ -49301,6 +49301,14 @@
49301
49301
  },
49302
49302
  "fieldName": "allowHtml"
49303
49303
  },
49304
+ {
49305
+ "name": "checkbox-label",
49306
+ "type": {
49307
+ "text": "string | undefined"
49308
+ },
49309
+ "default": "\"Select\"",
49310
+ "fieldName": "checkboxLabel"
49311
+ },
49304
49312
  {
49305
49313
  "name": "checked",
49306
49314
  "type": {
@@ -49487,6 +49495,20 @@
49487
49495
  },
49488
49496
  "fieldName": "selectable"
49489
49497
  },
49498
+ {
49499
+ "name": "selection-mode",
49500
+ "type": {
49501
+ "text": "\"checkbox\" | \"row\" | undefined",
49502
+ "references": [
49503
+ {
49504
+ "name": "SwirlResourceListItemSelectionMode",
49505
+ "module": "./swirl-resource-list-item.types"
49506
+ }
49507
+ ]
49508
+ },
49509
+ "default": "\"row\"",
49510
+ "fieldName": "selectionMode"
49511
+ },
49490
49512
  {
49491
49513
  "name": "swirl-aria-current",
49492
49514
  "type": {
@@ -49565,6 +49587,16 @@
49565
49587
  "readonly": true,
49566
49588
  "attribute": "allow-html"
49567
49589
  },
49590
+ {
49591
+ "kind": "field",
49592
+ "name": "checkboxLabel",
49593
+ "type": {
49594
+ "text": "string | undefined"
49595
+ },
49596
+ "default": "\"Select\"",
49597
+ "readonly": true,
49598
+ "attribute": "checkbox-label"
49599
+ },
49568
49600
  {
49569
49601
  "kind": "field",
49570
49602
  "name": "checked",
@@ -49796,6 +49828,22 @@
49796
49828
  "readonly": true,
49797
49829
  "attribute": "selectable"
49798
49830
  },
49831
+ {
49832
+ "kind": "field",
49833
+ "name": "selectionMode",
49834
+ "type": {
49835
+ "text": "\"checkbox\" | \"row\" | undefined",
49836
+ "references": [
49837
+ {
49838
+ "name": "SwirlResourceListItemSelectionMode",
49839
+ "module": "./swirl-resource-list-item.types"
49840
+ }
49841
+ ]
49842
+ },
49843
+ "default": "\"row\"",
49844
+ "readonly": true,
49845
+ "attribute": "selection-mode"
49846
+ },
49799
49847
  {
49800
49848
  "kind": "field",
49801
49849
  "name": "swirlAriaCurrent",
@@ -49846,6 +49894,18 @@
49846
49894
  }
49847
49895
  ],
49848
49896
  "events": [
49897
+ {
49898
+ "name": "activate",
49899
+ "type": {
49900
+ "text": "CustomEvent<HTMLSwirlResourceListItemElement>",
49901
+ "references": [
49902
+ {
49903
+ "name": "HTMLSwirlResourceListItemElement",
49904
+ "package": "global:"
49905
+ }
49906
+ ]
49907
+ }
49908
+ },
49849
49909
  {
49850
49910
  "name": "toggleDrag",
49851
49911
  "type": {
@@ -49884,7 +49944,7 @@
49884
49944
  "name": "resource-list-item__content"
49885
49945
  }
49886
49946
  ],
49887
- "description": "The SwirlResourceListItem component can be used to represent an object, like media, a group or a chat within a collection. It should only be used inside the [SwirlResourceList component](?path=/docs/components-swirlresourcelist--docs).\n\nAccessibility\n\n### ARIA\n\nDepending on the purpose, the item can be used as a button, link or checkbox\ncontrol.\n\n| ARIA | Usage |\n| ----------------- | ----------------------------------------------------------------------------------------------- |\n| `role=\"row\"` | Set on the element; for usage inside the SwirlResourceList component. |\n| `role=\"gridcell\"` | Set on the inner container element; for usage inside the SwirlResourceList component. |\n| `role=\"button\"` | Implicit when used as a button. |\n| `role=\"link\"` | Implicit when used as a link. |\n| `role=\"checkbox\"` | Set on the interactive part if used as a checkbox. |\n| `aria-disabled` | If not used as a link, the `aria-disabled` attribute is set to `true` for the disabled element. |\n\n### Keyboard\n\n| Key | Action |\n| ---------------- | --------------------------------------------------------------------------------------- |\n| <kbd>ENTER</kbd> | Activates the item if used as a button or link. |\n| <kbd>SPACE</kbd> | Activates the item if used as a button or link. Toggles the item if used as a checkbox. |"
49947
+ "description": "The SwirlResourceListItem component can be used to represent an object, like media, a group or a chat within a collection. It should only be used inside the [SwirlResourceList component](?path=/docs/components-swirlresourcelist--docs).\n\nAccessibility\n\n### ARIA\n\nDepending on the purpose, the item can be used as a button, link or checkbox\ncontrol.\n\n| ARIA | Usage |\n| ----------------- | ----------------------------------------------------------------------------------------------- |\n| `role=\"row\"` | Set on the element; for usage inside the SwirlResourceList component. |\n| `role=\"gridcell\"` | Set on the inner container element; for usage inside the SwirlResourceList component. |\n| `role=\"button\"` | Implicit when used as a button. |\n| `role=\"link\"` | Implicit when used as a link. |\n| `role=\"checkbox\"` | Set on the interactive part if used as a checkbox, or on the checkbox itself with `selection-mode=\"checkbox\"`. |\n| `aria-disabled` | If not used as a link, the `aria-disabled` attribute is set to `true` for the disabled element. |\n\n### Keyboard\n\n| Key | Action |\n| ---------------- | --------------------------------------------------------------------------------------- |\n| <kbd>ENTER</kbd> | Activates the item if used as a button or link. |\n| <kbd>SPACE</kbd> | Activates the item if used as a button or link. Toggles the item if used as a checkbox. |\n\nWith `selection-mode=\"checkbox\"`, <kbd>ENTER</kbd> on the row activates it, and\n<kbd>SPACE</kbd> or <kbd>ENTER</kbd> on the checkbox toggles it. Inside a\n`swirl-resource-list` with grid semantics the checkbox is reached with\n<kbd>TAB</kbd> from the row, while the arrow keys keep moving between rows."
49888
49948
  }
49889
49949
  ],
49890
49950
  "exports": [
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from "../../stencil-public-runtime";
2
2
  import { SwirlTooltipPosition } from "../swirl-tooltip/swirl-tooltip";
3
- import { SwirlResourceListItemAriaCurrent, SwirlResourceListItemLabelWeight, SwirlResourceListItemRel, SwirlResourceListItemTarget } from "./swirl-resource-list-item.types";
3
+ import { SwirlResourceListItemAriaCurrent, SwirlResourceListItemLabelWeight, SwirlResourceListItemRel, SwirlResourceListItemSelectionMode, SwirlResourceListItemTarget } from "./swirl-resource-list-item.types";
4
4
  /**
5
5
  * @slot control - Used to add a menu button to the item
6
6
  * @slot badges - Badges displayed inside the item
@@ -11,6 +11,7 @@ export declare class SwirlResourceListItem {
11
11
  active?: boolean;
12
12
  allowDrag?: boolean;
13
13
  allowHtml?: boolean;
14
+ checkboxLabel?: string;
14
15
  checked?: boolean;
15
16
  compact?: boolean;
16
17
  description?: string;
@@ -34,6 +35,7 @@ export declare class SwirlResourceListItem {
34
35
  meta?: string;
35
36
  rel?: SwirlResourceListItemRel;
36
37
  selectable?: boolean;
38
+ selectionMode?: SwirlResourceListItemSelectionMode;
37
39
  swirlAriaCurrent?: SwirlResourceListItemAriaCurrent;
38
40
  swirlAriaLabel?: string;
39
41
  target?: SwirlResourceListItemTarget;
@@ -41,28 +43,34 @@ export declare class SwirlResourceListItem {
41
43
  alignItems?: string;
42
44
  hasMedia: boolean;
43
45
  iconSize: 20 | 24;
46
+ activate: EventEmitter<HTMLSwirlResourceListItemElement>;
44
47
  toggleDrag: EventEmitter<HTMLSwirlResourceListItemElement>;
45
48
  valueChange: EventEmitter<boolean>;
49
+ private checkboxEl;
46
50
  private elementId;
47
51
  private iconEl;
48
52
  private mediaQueryUnsubscribe;
49
53
  private parentSemantics;
54
+ private rowHasFocus;
50
55
  componentWillLoad(): void;
51
56
  componentDidLoad(): void;
57
+ componentDidRender(): void;
52
58
  disconnectedCallback(): void;
59
+ onFocusIn(): void;
60
+ onFocusOut(event: FocusEvent): void;
61
+ private get hasInteractiveCheckbox();
53
62
  private get hasBadges();
54
63
  private get showMeta();
55
64
  private forceIconProps;
56
65
  private updateIconSize;
57
66
  private updateMediaState;
58
67
  private getControl;
59
- private makeControlFocusable;
60
- private makeControlUnfocusable;
68
+ private syncTabIndex;
61
69
  private onClick;
62
- private onBlur;
63
- private onFocus;
64
70
  private onMenuTriggerClick;
65
71
  private onDragHandleKeyDown;
66
72
  private onControlClick;
73
+ private onCheckboxClick;
74
+ private toggle;
67
75
  render(): any;
68
76
  }
@@ -9,4 +9,5 @@ export declare const swirlResourceListItemRel: {
9
9
  readonly noreferrer: "noreferrer";
10
10
  };
11
11
  export type SwirlResourceListItemRel = (typeof swirlResourceListItemRel)[keyof typeof swirlResourceListItemRel];
12
+ export type SwirlResourceListItemSelectionMode = "row" | "checkbox";
12
13
  export type SwirlResourceListItemTarget = "_self" | "_blank" | "_parent" | "_top";
@@ -58,7 +58,7 @@ import { SwirlPopover } from "./components/swirl-popover/swirl-popover";
58
58
  import { SwirlProgressIndicatorSize, SwirlProgressIndicatorVariant } from "./components/swirl-progress-indicator/swirl-progress-indicator";
59
59
  import { SwirlRadioState, SwirlRadioVariant } from "./components/swirl-radio/swirl-radio";
60
60
  import { SwirlBoxPadding as SwirlBoxPadding1, SwirlResourceListSemantics } from "./components/swirl-resource-list/swirl-resource-list";
61
- import { SwirlResourceListItemAriaCurrent, SwirlResourceListItemLabelWeight, SwirlResourceListItemRel, SwirlResourceListItemTarget } from "./components/swirl-resource-list-item/swirl-resource-list-item.types";
61
+ import { SwirlResourceListItemAriaCurrent, SwirlResourceListItemLabelWeight, SwirlResourceListItemRel, SwirlResourceListItemSelectionMode, SwirlResourceListItemTarget } from "./components/swirl-resource-list-item/swirl-resource-list-item.types";
62
62
  import { SwirlTooltipPosition } from "./components/swirl-tooltip/swirl-tooltip";
63
63
  import { SwirlSearchVariant } from "./components/swirl-search/swirl-search";
64
64
  import { SwirlSeparatorColor, SwirlSeparatorOrientation, SwirlSeparatorSemantics, SwirlSeparatorSpacing as SwirlSeparatorSpacing1 } from "./components/swirl-separator/swirl-separator";
@@ -142,7 +142,7 @@ export { SwirlPopover } from "./components/swirl-popover/swirl-popover";
142
142
  export { SwirlProgressIndicatorSize, SwirlProgressIndicatorVariant } from "./components/swirl-progress-indicator/swirl-progress-indicator";
143
143
  export { SwirlRadioState, SwirlRadioVariant } from "./components/swirl-radio/swirl-radio";
144
144
  export { SwirlBoxPadding as SwirlBoxPadding1, SwirlResourceListSemantics } from "./components/swirl-resource-list/swirl-resource-list";
145
- export { SwirlResourceListItemAriaCurrent, SwirlResourceListItemLabelWeight, SwirlResourceListItemRel, SwirlResourceListItemTarget } from "./components/swirl-resource-list-item/swirl-resource-list-item.types";
145
+ export { SwirlResourceListItemAriaCurrent, SwirlResourceListItemLabelWeight, SwirlResourceListItemRel, SwirlResourceListItemSelectionMode, SwirlResourceListItemTarget } from "./components/swirl-resource-list-item/swirl-resource-list-item.types";
146
146
  export { SwirlTooltipPosition } from "./components/swirl-tooltip/swirl-tooltip";
147
147
  export { SwirlSearchVariant } from "./components/swirl-search/swirl-search";
148
148
  export { SwirlSeparatorColor, SwirlSeparatorOrientation, SwirlSeparatorSemantics, SwirlSeparatorSpacing as SwirlSeparatorSpacing1 } from "./components/swirl-separator/swirl-separator";
@@ -4285,6 +4285,10 @@ export namespace Components {
4285
4285
  "alignItems"?: string;
4286
4286
  "allowDrag"?: boolean;
4287
4287
  "allowHtml"?: boolean;
4288
+ /**
4289
+ * @default "Select"
4290
+ */
4291
+ "checkboxLabel"?: string;
4288
4292
  /**
4289
4293
  * @default false
4290
4294
  */
@@ -4329,6 +4333,10 @@ export namespace Components {
4329
4333
  "meta"?: string;
4330
4334
  "rel"?: SwirlResourceListItemRel;
4331
4335
  "selectable"?: boolean;
4336
+ /**
4337
+ * @default "row"
4338
+ */
4339
+ "selectionMode"?: SwirlResourceListItemSelectionMode;
4332
4340
  "swirlAriaCurrent"?: SwirlResourceListItemAriaCurrent;
4333
4341
  "swirlAriaLabel"?: string;
4334
4342
  "target"?: SwirlResourceListItemTarget;
@@ -8943,6 +8951,7 @@ declare global {
8943
8951
  new (): HTMLSwirlResourceListFileItemElement;
8944
8952
  };
8945
8953
  interface HTMLSwirlResourceListItemElementEventMap {
8954
+ "activate": HTMLSwirlResourceListItemElement;
8946
8955
  "toggleDrag": HTMLSwirlResourceListItemElement;
8947
8956
  "valueChange": boolean;
8948
8957
  }
@@ -14654,6 +14663,10 @@ declare namespace LocalJSX {
14654
14663
  "alignItems"?: string;
14655
14664
  "allowDrag"?: boolean;
14656
14665
  "allowHtml"?: boolean;
14666
+ /**
14667
+ * @default "Select"
14668
+ */
14669
+ "checkboxLabel"?: string;
14657
14670
  /**
14658
14671
  * @default false
14659
14672
  */
@@ -14696,10 +14709,15 @@ declare namespace LocalJSX {
14696
14709
  */
14697
14710
  "menuTriggerLabel"?: string;
14698
14711
  "meta"?: string;
14712
+ "onActivate"?: (event: SwirlResourceListItemCustomEvent<HTMLSwirlResourceListItemElement>) => void;
14699
14713
  "onToggleDrag"?: (event: SwirlResourceListItemCustomEvent<HTMLSwirlResourceListItemElement>) => void;
14700
14714
  "onValueChange"?: (event: SwirlResourceListItemCustomEvent<boolean>) => void;
14701
14715
  "rel"?: SwirlResourceListItemRel;
14702
14716
  "selectable"?: boolean;
14717
+ /**
14718
+ * @default "row"
14719
+ */
14720
+ "selectionMode"?: SwirlResourceListItemSelectionMode;
14703
14721
  "swirlAriaCurrent"?: SwirlResourceListItemAriaCurrent;
14704
14722
  "swirlAriaLabel"?: string;
14705
14723
  "target"?: SwirlResourceListItemTarget;
@@ -18369,6 +18387,7 @@ declare namespace LocalJSX {
18369
18387
  "active": boolean;
18370
18388
  "allowDrag": boolean;
18371
18389
  "allowHtml": boolean;
18390
+ "checkboxLabel": string;
18372
18391
  "checked": boolean;
18373
18392
  "compact": boolean;
18374
18393
  "description": string;
@@ -18392,6 +18411,7 @@ declare namespace LocalJSX {
18392
18411
  "meta": string;
18393
18412
  "rel": SwirlResourceListItemRel;
18394
18413
  "selectable": boolean;
18414
+ "selectionMode": SwirlResourceListItemSelectionMode;
18395
18415
  "swirlAriaCurrent": SwirlResourceListItemAriaCurrent;
18396
18416
  "swirlAriaLabel": string;
18397
18417
  "target": SwirlResourceListItemTarget;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getflip/swirl-ai",
3
- "version": "0.519.0",
3
+ "version": "0.520.0",
4
4
  "description": "Swirl Design System AI package with artifacts for AI agents",
5
5
  "author": "Flip GmbH",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "lint": "tsc --noEmit"
27
27
  },
28
28
  "devDependencies": {
29
- "@getflip/swirl-components": "0.519.0",
29
+ "@getflip/swirl-components": "0.520.0",
30
30
  "@getflip/swirl-tokens": "2.14.3",
31
31
  "@types/node": "25.3.0",
32
32
  "tsx": "^4.7.0",