@openproject/primer-view-components 0.82.1 → 0.83.0-rc.0d7454d16

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.
Files changed (35) hide show
  1. package/app/assets/javascripts/primer_view_components.js +1 -1
  2. package/app/assets/javascripts/primer_view_components.js.map +1 -1
  3. package/app/assets/styles/primer_view_components.css +1 -1
  4. package/app/assets/styles/primer_view_components.css.map +1 -1
  5. package/app/components/primer/alpha/action_bar_element.js +68 -77
  6. package/app/components/primer/alpha/action_list.js +1 -1
  7. package/app/components/primer/alpha/action_menu/action_menu_element.js +1 -1
  8. package/app/components/primer/alpha/dialog.css +1 -1
  9. package/app/components/primer/alpha/dialog.css.json +2 -1
  10. package/app/components/primer/alpha/segmented_control.js +1 -1
  11. package/app/components/primer/alpha/select_panel_element.js +3 -1
  12. package/app/components/primer/alpha/toggle_switch.js +1 -1
  13. package/app/components/primer/alpha/tool_tip.js +1 -1
  14. package/app/components/primer/alpha/tree_view/tree_view.js +1 -1
  15. package/app/components/primer/alpha/tree_view/tree_view_icon_pair_element.js +1 -1
  16. package/app/components/primer/alpha/tree_view/tree_view_include_fragment_element.js +1 -1
  17. package/app/components/primer/alpha/tree_view/tree_view_sub_tree_node_element.js +25 -2
  18. package/app/components/primer/alpha/x_banner.js +1 -1
  19. package/app/components/primer/beta/blankslate.css +1 -1
  20. package/app/components/primer/beta/blankslate.css.json +1 -0
  21. package/app/components/primer/beta/details_toggle_element.js +1 -1
  22. package/app/components/primer/beta/nav_list.js +1 -1
  23. package/app/components/primer/beta/nav_list_group_element.js +1 -1
  24. package/app/components/primer/dialog_helper.js +24 -9
  25. package/app/components/primer/scrollable_region.js +1 -1
  26. package/app/lib/primer/forms/primer_multi_input.js +1 -1
  27. package/app/lib/primer/forms/primer_text_area.js +1 -1
  28. package/app/lib/primer/forms/primer_text_field.js +1 -1
  29. package/app/lib/primer/forms/toggle_switch_input.js +1 -1
  30. package/package.json +5 -4
  31. package/static/arguments.json +38 -1
  32. package/static/classes.json +3 -0
  33. package/static/constants.json +17 -0
  34. package/static/info_arch.json +77 -58
  35. package/static/previews.json +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openproject/primer-view-components",
3
- "version": "0.82.1",
3
+ "version": "0.83.0-rc.0d7454d16",
4
4
  "description": "ViewComponents of the Primer Design System for OpenProject",
5
5
  "main": "app/assets/javascripts/primer_view_components.js",
6
6
  "module": "app/components/primer/primer.js",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@github/auto-check-element": "^6.0.0",
47
47
  "@github/auto-complete-element": "^3.8.0",
48
- "@github/catalyst": "^1.6.0",
48
+ "@github/catalyst": "^1.8.0",
49
49
  "@github/clipboard-copy-element": "^1.3.0",
50
50
  "@github/details-menu-element": "^1.0.12",
51
51
  "@github/image-crop-element": "^5.0.0",
@@ -69,6 +69,7 @@
69
69
  "@github/prettier-config": "0.0.6",
70
70
  "@playwright/test": "^1.57.0",
71
71
  "@primer/css": "22.1.0",
72
+ "@primer/primitives": "^11.4.0",
72
73
  "@primer/stylelint-config": "^13.1.1",
73
74
  "@rollup/plugin-node-resolve": "^16.0.1",
74
75
  "@rollup/plugin-typescript": "^8.3.3",
@@ -78,14 +79,14 @@
78
79
  "eslint": "^9.10.0",
79
80
  "eslint-plugin-github": "^6.0.0",
80
81
  "glob": "^11.0.2",
81
- "markdownlint-cli2": "^0.19.1",
82
+ "markdownlint-cli2": "^0.20.0",
82
83
  "mocha": "^11.0.1",
83
84
  "playwright": "^1.57.0",
84
85
  "postcss": "^8.4.16",
85
86
  "postcss-cli": "^11.0.0",
86
87
  "postcss-import": "^16.0.0",
87
88
  "postcss-mixins": "^12.1.2",
88
- "postcss-preset-env": "^10.0.2",
89
+ "postcss-preset-env": "^11.1.2",
89
90
  "prettier": "^3.3.2",
90
91
  "rollup": "^2.79.1",
91
92
  "rollup-plugin-terser": "^7.0.2",
@@ -464,6 +464,12 @@
464
464
  "default": "N/A",
465
465
  "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
466
466
  },
467
+ {
468
+ "name": "anchor_when_narrow",
469
+ "type": "Symbol",
470
+ "default": "N/A",
471
+ "description": "One of `:bottom`, `:fullscreen`, `:inherit`, `:left`, or `:right`."
472
+ },
467
473
  {
468
474
  "name": "menu_id",
469
475
  "type": "String",
@@ -540,6 +546,12 @@
540
546
  "default": "`:outside_bottom`",
541
547
  "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
542
548
  },
549
+ {
550
+ "name": "anchor_when_narrow",
551
+ "type": "Symbol",
552
+ "default": "`:inherit`",
553
+ "description": "One of `:bottom`, `:fullscreen`, `:inherit`, `:left`, or `:right`.."
554
+ },
543
555
  {
544
556
  "name": "dynamic_label",
545
557
  "type": "Boolean",
@@ -586,6 +598,12 @@
586
598
  "default": "`:outside_right`",
587
599
  "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
588
600
  },
601
+ {
602
+ "name": "anchor_when_narrow",
603
+ "type": "Symbol",
604
+ "default": "`:inherit`",
605
+ "description": "One of `:bottom`, `:fullscreen`, `:inherit`, `:left`, or `:right`.."
606
+ },
589
607
  {
590
608
  "name": "overlay_arguments",
591
609
  "type": "Hash",
@@ -2009,6 +2027,12 @@
2009
2027
  "default": "`:normal`",
2010
2028
  "description": "The anchor offset to give the Overlay. One of `:normal` or `:spacious`."
2011
2029
  },
2030
+ {
2031
+ "name": "anchor_when_narrow",
2032
+ "type": "Symbol",
2033
+ "default": "`:inherit`",
2034
+ "description": "The position of the Overlay when in a narrow viewport. One of `:bottom`, `:fullscreen`, `:inherit`, `:left`, or `:right`."
2035
+ },
2012
2036
  {
2013
2037
  "name": "allow_out_of_bounds",
2014
2038
  "type": "Boolean",
@@ -3336,6 +3360,12 @@
3336
3360
  "type": "String",
3337
3361
  "default": "`nil`",
3338
3362
  "description": "Custom label to show when the switch is OFF. Defaults to (\"Off\"). Only customize this label if it makes the toggle’s state more meaningful in its specific context. For example, for a \"Show images\" setting, you might use \"Show\" when the switch is OFF."
3363
+ },
3364
+ {
3365
+ "name": "button_type",
3366
+ "type": "Symbol",
3367
+ "default": "`nil`",
3368
+ "description": "The type attribute for the underlying button element. If `nil`, the button will not have a type attribute, which means it will default to \"submit\" if it's inside a form and \"button\" otherwise."
3339
3369
  }
3340
3370
  ]
3341
3371
  },
@@ -4003,7 +4033,14 @@
4003
4033
  "short_name": "AutoCompleteNoResultItem",
4004
4034
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/auto_complete/no_result_item.rb",
4005
4035
  "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/auto_complete/no_result_item/default/",
4006
- "parameters": []
4036
+ "parameters": [
4037
+ {
4038
+ "name": "system_arguments",
4039
+ "type": "Hash",
4040
+ "default": "N/A",
4041
+ "description": "[System arguments](/system-arguments)"
4042
+ }
4043
+ ]
4007
4044
  },
4008
4045
  {
4009
4046
  "component": "Avatar",
@@ -467,6 +467,9 @@
467
467
  "Overlay--full-whenNarrow": [
468
468
  "Primer::Alpha::Dialog"
469
469
  ],
470
+ "Overlay--fullscreen-whenNarrow": [
471
+ "Primer::Alpha::Dialog"
472
+ ],
470
473
  "Overlay--hidden": [
471
474
  "Primer::Alpha::Dialog"
472
475
  ],
@@ -193,11 +193,13 @@
193
193
  "Primer::Alpha::ActionMenu::PrimaryMenu": {
194
194
  "DEFAULT_ANCHOR_ALIGN": "start",
195
195
  "DEFAULT_ANCHOR_SIDE": "outside_bottom",
196
+ "DEFAULT_ANCHOR_WHEN_NARROW": "inherit",
196
197
  "GeneratedSlotMethods": "Primer::Alpha::ActionMenu::PrimaryMenu::GeneratedSlotMethods"
197
198
  },
198
199
  "Primer::Alpha::ActionMenu::SubMenu": {
199
200
  "DEFAULT_ANCHOR_ALIGN": "start",
200
201
  "DEFAULT_ANCHOR_SIDE": "outside_right",
202
+ "DEFAULT_ANCHOR_WHEN_NARROW": "inherit",
201
203
  "GeneratedSlotMethods": "Primer::Alpha::ActionMenu::SubMenu::GeneratedSlotMethods"
202
204
  },
203
205
  "Primer::Alpha::ActionMenu::SubMenuItem": {
@@ -599,11 +601,26 @@
599
601
  "outside_left",
600
602
  "outside_right"
601
603
  ],
604
+ "ANCHOR_WHEN_NARROW_MAPPINGS": {
605
+ "inherit": "",
606
+ "bottom": "Overlay--placement-bottom-whenNarrow",
607
+ "fullscreen": "Overlay--fullscreen-whenNarrow",
608
+ "left": "Overlay--placement-left-whenNarrow",
609
+ "right": "Overlay--placement-right-whenNarrow"
610
+ },
611
+ "ANCHOR_WHEN_NARROW_OPTIONS": [
612
+ "inherit",
613
+ "bottom",
614
+ "fullscreen",
615
+ "left",
616
+ "right"
617
+ ],
602
618
  "Body": "Primer::Alpha::Overlay::Body",
603
619
  "DEFAULT_ALIGN_CONTENT": "end",
604
620
  "DEFAULT_ANCHOR_ALIGN": "start",
605
621
  "DEFAULT_ANCHOR_OFFSET": "normal",
606
622
  "DEFAULT_ANCHOR_SIDE": "outside_bottom",
623
+ "DEFAULT_ANCHOR_WHEN_NARROW": "inherit",
607
624
  "DEFAULT_PADDING": "normal",
608
625
  "DEFAULT_POPOVER": "auto",
609
626
  "DEFAULT_SIZE": "auto",
@@ -1633,6 +1633,19 @@
1633
1633
  ]
1634
1634
  }
1635
1635
  },
1636
+ {
1637
+ "preview_path": "primer/alpha/action_menu/fullscreen_when_narrow",
1638
+ "name": "fullscreen_when_narrow",
1639
+ "snapshot": "false",
1640
+ "skip_rules": {
1641
+ "wont_fix": [
1642
+ "region"
1643
+ ],
1644
+ "will_fix": [
1645
+ "color-contrast"
1646
+ ]
1647
+ }
1648
+ },
1636
1649
  {
1637
1650
  "preview_path": "primer/alpha/action_menu/sub_menus",
1638
1651
  "name": "sub_menus",
@@ -1674,6 +1687,12 @@
1674
1687
  "default": "N/A",
1675
1688
  "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
1676
1689
  },
1690
+ {
1691
+ "name": "anchor_when_narrow",
1692
+ "type": "Symbol",
1693
+ "default": "N/A",
1694
+ "description": "One of `:bottom`, `:fullscreen`, `:inherit`, `:left`, or `:right`."
1695
+ },
1677
1696
  {
1678
1697
  "name": "menu_id",
1679
1698
  "type": "String",
@@ -1749,6 +1768,12 @@
1749
1768
  "parameters": [],
1750
1769
  "return_types": []
1751
1770
  },
1771
+ {
1772
+ "name": "anchor_when_narrow",
1773
+ "description": "Returns the value of attribute anchor_when_narrow.",
1774
+ "parameters": [],
1775
+ "return_types": []
1776
+ },
1752
1777
  {
1753
1778
  "name": "list",
1754
1779
  "description": "Returns the value of attribute list.",
@@ -1927,6 +1952,12 @@
1927
1952
  "default": "`:outside_right`",
1928
1953
  "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
1929
1954
  },
1955
+ {
1956
+ "name": "anchor_when_narrow",
1957
+ "type": "Symbol",
1958
+ "default": "`:inherit`",
1959
+ "description": "One of `:bottom`, `:fullscreen`, `:inherit`, `:left`, or `:right`.."
1960
+ },
1930
1961
  {
1931
1962
  "name": "overlay_arguments",
1932
1963
  "type": "Hash",
@@ -2045,6 +2076,12 @@
2045
2076
  "default": "`:outside_bottom`",
2046
2077
  "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
2047
2078
  },
2079
+ {
2080
+ "name": "anchor_when_narrow",
2081
+ "type": "Symbol",
2082
+ "default": "`:inherit`",
2083
+ "description": "One of `:bottom`, `:fullscreen`, `:inherit`, `:left`, or `:right`.."
2084
+ },
2048
2085
  {
2049
2086
  "name": "dynamic_label",
2050
2087
  "type": "Boolean",
@@ -5119,7 +5156,7 @@
5119
5156
  {
5120
5157
  "fully_qualified_name": "Primer::Alpha::Layout",
5121
5158
  "description": "`Layout` provides foundational patterns for responsive pages.\n`Layout` can be used for simple two-column pages, or it can be nested to provide flexible 3-column experiences.\n On smaller screens, `Layout` uses vertically stacked rows to display content.\n\n`Layout` flows as both column, when there's enough horizontal space to render both `Main` and `Sidebar`side-by-side (on a desktop of tablet device, per instance);\nor it flows as a row, when `Main` and `Sidebar` are stacked vertically (e.g. on a mobile device).\n`Layout` should always work in any screen size.",
5122
- "accessibility_docs": "Keyboard navigation follows the markup order. Decide carefully how the focus order should be be by deciding whether\n`main` or `sidebar` comes first in code. The code order wont affect the visual position.",
5159
+ "accessibility_docs": "Keyboard navigation follows the markup order. Decide carefully how the focus order should be be by deciding whether\n`main` or `sidebar` comes first in code. The code order won't affect the visual position.\n\nWhen using `row_placement: :none` on the sidebar, the sidebar content will be hidden at narrow viewports.\nThis may cause WCAG 1.4.10 Reflow failures if the sidebar contains essential content. Only use `:none`\nwhen the sidebar content is non-essential or available elsewhere on the page.",
5123
5160
  "is_form_component": false,
5124
5161
  "is_published": true,
5125
5162
  "requires_js": false,
@@ -5194,7 +5231,7 @@
5194
5231
  "name": "row_placement",
5195
5232
  "type": "Symbol",
5196
5233
  "default": "N/A",
5197
- "description": "Sidebar placement when `Layout` is in row mode. One of `:end`, `:none`, or `:start`."
5234
+ "description": "Sidebar placement when `Layout` is in row mode. One of `:end`, `:none`, or `:start`. **Note:** Using `:none` hides the sidebar at narrow viewports, which may cause WCAG 1.4.10 Reflow issues if the sidebar contains essential content."
5198
5235
  },
5199
5236
  {
5200
5237
  "name": "system_arguments",
@@ -6405,6 +6442,12 @@
6405
6442
  "default": "`:normal`",
6406
6443
  "description": "The anchor offset to give the Overlay. One of `:normal` or `:spacious`."
6407
6444
  },
6445
+ {
6446
+ "name": "anchor_when_narrow",
6447
+ "type": "Symbol",
6448
+ "default": "`:inherit`",
6449
+ "description": "The position of the Overlay when in a narrow viewport. One of `:bottom`, `:fullscreen`, `:inherit`, `:left`, or `:right`."
6450
+ },
6408
6451
  {
6409
6452
  "name": "allow_out_of_bounds",
6410
6453
  "type": "Boolean",
@@ -10060,6 +10103,12 @@
10060
10103
  "type": "String",
10061
10104
  "default": "`nil`",
10062
10105
  "description": "Custom label to show when the switch is OFF. Defaults to (\"Off\"). Only customize this label if it makes the toggle’s state more meaningful in its specific context. For example, for a \"Show images\" setting, you might use \"Show\" when the switch is OFF."
10106
+ },
10107
+ {
10108
+ "name": "button_type",
10109
+ "type": "Symbol",
10110
+ "default": "`nil`",
10111
+ "description": "The type attribute for the underlying button element. If `nil`, the button will not have a type attribute, which means it will default to \"submit\" if it's inside a form and \"button\" otherwise."
10063
10112
  }
10064
10113
  ],
10065
10114
  "slots": [],
@@ -12382,6 +12431,32 @@
12382
12431
  }
12383
12432
  ],
12384
12433
  "subcomponents": [
12434
+ {
12435
+ "fully_qualified_name": "Primer::Beta::AutoComplete::NoResultItem",
12436
+ "description": "Use `NoResultItem` to display a message when no autocomplete results are found.\nRenders as a simple div inside the overlay, not as a list item.",
12437
+ "accessibility_docs": null,
12438
+ "is_form_component": false,
12439
+ "is_published": true,
12440
+ "requires_js": false,
12441
+ "component": "AutoComplete::NoResultItem",
12442
+ "status": "beta",
12443
+ "a11y_reviewed": false,
12444
+ "short_name": "AutoCompleteNoResultItem",
12445
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/auto_complete/no_result_item.rb",
12446
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/auto_complete/no_result_item/default/",
12447
+ "parameters": [
12448
+ {
12449
+ "name": "system_arguments",
12450
+ "type": "Hash",
12451
+ "default": "N/A",
12452
+ "description": "{{link_to_system_arguments_docs}}"
12453
+ }
12454
+ ],
12455
+ "slots": [],
12456
+ "methods": [],
12457
+ "previews": [],
12458
+ "subcomponents": []
12459
+ },
12385
12460
  {
12386
12461
  "fully_qualified_name": "Primer::Beta::AutoComplete::Item",
12387
12462
  "description": "Use `AutoCompleteItem` to list results of an auto-completed search.",
@@ -12474,62 +12549,6 @@
12474
12549
  "methods": [],
12475
12550
  "previews": [],
12476
12551
  "subcomponents": []
12477
- },
12478
- {
12479
- "fully_qualified_name": "Primer::Beta::AutoComplete::NoResultItem",
12480
- "description": "",
12481
- "accessibility_docs": null,
12482
- "is_form_component": false,
12483
- "is_published": true,
12484
- "requires_js": false,
12485
- "component": "AutoComplete::NoResultItem",
12486
- "status": "beta",
12487
- "a11y_reviewed": false,
12488
- "short_name": "AutoCompleteNoResultItem",
12489
- "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/auto_complete/no_result_item.rb",
12490
- "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/auto_complete/no_result_item/default/",
12491
- "parameters": [],
12492
- "slots": [
12493
- {
12494
- "name": "leading_visual",
12495
- "description": "The leading visual rendered before the link.",
12496
- "parameters": [
12497
- {
12498
- "name": "kwargs",
12499
- "type": "Hash",
12500
- "default": "N/A",
12501
- "description": "The arguments accepted by {{#link_to_component}}Primer::Beta::Avatar{{/link_to_component}} or {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}"
12502
- }
12503
- ]
12504
- },
12505
- {
12506
- "name": "trailing_visual",
12507
- "description": "The trailing visual rendered after the link.",
12508
- "parameters": [
12509
- {
12510
- "name": "kwargs",
12511
- "type": "Hash",
12512
- "default": "N/A",
12513
- "description": "The arguments accepted by {{#link_to_component}}Primer::Beta::Octicon{{/link_to_component}}, {{#link_to_component}}Primer::Beta::Label{{/link_to_component}}, or {{#link_to_component}}Primer::Beta::Counter{{/link_to_component}}"
12514
- }
12515
- ]
12516
- },
12517
- {
12518
- "name": "description",
12519
- "description": "Optional description",
12520
- "parameters": [
12521
- {
12522
- "name": "system_arguments",
12523
- "type": "Hash",
12524
- "default": "N/A",
12525
- "description": "{{link_to_system_arguments_docs}}"
12526
- }
12527
- ]
12528
- }
12529
- ],
12530
- "methods": [],
12531
- "previews": [],
12532
- "subcomponents": []
12533
12552
  }
12534
12553
  ]
12535
12554
  },
@@ -827,6 +827,19 @@
827
827
  ]
828
828
  }
829
829
  },
830
+ {
831
+ "preview_path": "primer/alpha/action_menu/fullscreen_when_narrow",
832
+ "name": "fullscreen_when_narrow",
833
+ "snapshot": "false",
834
+ "skip_rules": {
835
+ "wont_fix": [
836
+ "region"
837
+ ],
838
+ "will_fix": [
839
+ "color-contrast"
840
+ ]
841
+ }
842
+ },
830
843
  {
831
844
  "preview_path": "primer/alpha/action_menu/sub_menus",
832
845
  "name": "sub_menus",