openproject-primer_view_components 0.79.1 → 0.80.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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/app/assets/styles/primer_view_components.css +1 -1
  4. data/app/assets/styles/primer_view_components.css.map +1 -1
  5. data/app/components/primer/open_project/fieldset.html.erb +8 -0
  6. data/app/components/primer/open_project/fieldset.rb +66 -0
  7. data/app/components/primer/open_project/inline_message.css +1 -0
  8. data/app/components/primer/open_project/inline_message.css.json +13 -0
  9. data/app/components/primer/open_project/inline_message.css.map +1 -0
  10. data/app/components/primer/open_project/inline_message.html.erb +4 -0
  11. data/app/components/primer/open_project/inline_message.pcss +42 -0
  12. data/app/components/primer/open_project/inline_message.rb +65 -0
  13. data/app/components/primer/open_project/page_header.rb +18 -1
  14. data/app/components/primer/primer.pcss +1 -0
  15. data/app/lib/primer/forms/dsl/fieldset_group_input.rb +35 -0
  16. data/app/lib/primer/forms/dsl/form_object.rb +4 -0
  17. data/app/lib/primer/forms/fieldset_group.html.erb +10 -0
  18. data/app/lib/primer/forms/fieldset_group.rb +54 -0
  19. data/lib/primer/view_components/version.rb +2 -2
  20. data/previews/primer/forms_preview/fieldset_group_form.html.erb +40 -0
  21. data/previews/primer/forms_preview.rb +3 -0
  22. data/previews/primer/open_project/inline_message_preview/default.html.erb +5 -0
  23. data/previews/primer/open_project/inline_message_preview/playground.html.erb +5 -0
  24. data/previews/primer/open_project/inline_message_preview.rb +22 -0
  25. data/static/arguments.json +65 -0
  26. data/static/audited_at.json +3 -0
  27. data/static/classes.json +6 -0
  28. data/static/constants.json +22 -0
  29. data/static/form_previews.json +5 -0
  30. data/static/info_arch.json +142 -0
  31. data/static/previews.json +34 -0
  32. data/static/statuses.json +3 -0
  33. metadata +17 -2
@@ -18,6 +18,11 @@
18
18
  "name": "custom_width_fields_form",
19
19
  "snapshot": "false"
20
20
  },
21
+ {
22
+ "preview_path": "primer/forms/fieldset_group_form",
23
+ "name": "fieldset_group_form",
24
+ "snapshot": "true"
25
+ },
21
26
  {
22
27
  "preview_path": "primer/forms/text_field_and_checkbox_form",
23
28
  "name": "text_field_and_checkbox_form",
@@ -20079,6 +20079,83 @@
20079
20079
  ],
20080
20080
  "subcomponents": []
20081
20081
  },
20082
+ {
20083
+ "fully_qualified_name": "Primer::OpenProject::Fieldset",
20084
+ "description": "A low-level component for building fieldsets with unopinionated styling.\n\nThis component is not designed to be used directly, but rather a primitive for\nauthors of other components and form controls.",
20085
+ "accessibility_docs": null,
20086
+ "is_form_component": false,
20087
+ "is_published": true,
20088
+ "requires_js": false,
20089
+ "component": "OpenProject::Fieldset",
20090
+ "status": "open_project",
20091
+ "a11y_reviewed": false,
20092
+ "short_name": "OpenProjectFieldset",
20093
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/fieldset.rb",
20094
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/fieldset/default/",
20095
+ "parameters": [
20096
+ {
20097
+ "name": "legend_text",
20098
+ "type": "String",
20099
+ "default": "`nil`",
20100
+ "description": "A legend should be short and concise. The String will also be read by assistive technology."
20101
+ },
20102
+ {
20103
+ "name": "visually_hide_legend",
20104
+ "type": "Boolean",
20105
+ "default": "`false`",
20106
+ "description": "Controls if the legend is visible. If `true`, screen reader only text will be added."
20107
+ },
20108
+ {
20109
+ "name": "system_arguments",
20110
+ "type": "Hash",
20111
+ "default": "N/A",
20112
+ "description": "{{link_to_system_arguments_docs}}"
20113
+ }
20114
+ ],
20115
+ "slots": [
20116
+ {
20117
+ "name": "legend",
20118
+ "description": null,
20119
+ "parameters": []
20120
+ }
20121
+ ],
20122
+ "methods": [
20123
+ {
20124
+ "name": "legend_text",
20125
+ "description": "Returns the value of attribute legend_text.",
20126
+ "parameters": [],
20127
+ "return_types": []
20128
+ }
20129
+ ],
20130
+ "previews": [],
20131
+ "subcomponents": []
20132
+ },
20133
+ {
20134
+ "fully_qualified_name": "Primer::OpenProject::Fieldset::LegendComponent",
20135
+ "description": "",
20136
+ "accessibility_docs": null,
20137
+ "is_form_component": false,
20138
+ "is_published": true,
20139
+ "requires_js": false,
20140
+ "component": "OpenProject::Fieldset::Legend",
20141
+ "status": "open_project",
20142
+ "a11y_reviewed": false,
20143
+ "short_name": "OpenProjectFieldsetLegend",
20144
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/fieldset/legend_component.rb",
20145
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/fieldset/legend/default/",
20146
+ "parameters": [],
20147
+ "slots": [],
20148
+ "methods": [
20149
+ {
20150
+ "name": "text",
20151
+ "description": "Returns the value of attribute text.",
20152
+ "parameters": [],
20153
+ "return_types": []
20154
+ }
20155
+ ],
20156
+ "previews": [],
20157
+ "subcomponents": []
20158
+ },
20082
20159
  {
20083
20160
  "fully_qualified_name": "Primer::OpenProject::FilterableTreeView",
20084
20161
  "description": "A TreeView and associated filter controls for searching nested hierarchies.\n\n## Filter controls\n\n`FilterableTreeView`s can be filtered using two controls, both present in the toolbar above the tree:\n\n1. A free-form query string from a text input field.\n2. A `SegmentedControl` with two options (by default):\n 1. The \"Selected\" option causes the component to only show checked nodes, provided they also satisfy the other\n filter criteria described here.\n 2. The \"All\" option causes the component to show all nodes, provided they also satisfy the other filter\n criteria described here.\n\n## Custom filter modes\n\nIn addition to the default filter modes of `'all'` and `'selected'` described above, `FilterableTreeView` supports\nadding custom filter modes. Adding a filter mode will cause its label to appear in the `SegmentedControl` in the\ntoolbar, and will be passed as the third argument to the filter function (see below).\n\nHere's how to add a custom filter mode in addition to the default ones:\n\n```erb\n<%= render(Primer::OpenProject::FilterableTreeView.new) do |tree_view| %>\n <%# remove this line to prevent adding the default modes %>\n <% tree_view.with_default_filter_modes %>\n <% tree_view.with_filter_mode(name: \"Custom\", system_arguments)\n<% end %>\n```\n\n## Filter behavior\n\nBy default, matching node text is identified by looking for an exact substring match, operating on a lowercased\nversion of both the query string and the node text. For more information, and to provide a customized filter\nfunction, please see the section titled \"Customizing the filter function\" below.\n\nNodes that match the filter appear as normal; nodes that do not match are presented as follows:\n\n1. Leaf nodes are hidden.\n2. Sub-tree nodes with no matching children are hidden.\n3. Sub-tree nodes with at least one matching child are disabled but still visible.\n\n## Checking behavior\n\nBy default, checking a node in a `FilterableTreeView` checks only that node (i.e. no child nodes are checked).\nTo aide in checking children in deeply nested or highly populated hierarchies, a third control exists in the\ntoolbar: the \"Include sub-items\" check box. If this feature is turned on, checking sub-tree nodes causes all\nchildren, both leaf and sub-tree nodes, to also be checked recursively. Moreover, turning this feature on will\ncause the children of any previously checked nodes to be checked recursively. Unchecking a node while in\n\"Include sub-items\" mode will restore that sub-tree and all its children to their previously checked state, so as\nnot to permanently override a user's selections. Unchecking the \"Include sub-items\" check box has a similar effect,\ni.e. restores all previous user selections under currently checked sub-trees.\n\n## JavaScript API\n\n`FilterableTreeView` does not yet have an extensive JavaScript API, but this may change in the future as the\ncomponent is further developed to fit additional use-cases.\n\n### Customizing the filter function\n\nThe filter function can be customized by setting the value of the `filterFn` property to a function with the\nfollowing signature:\n\n```typescript\nexport type FilterFn = (node: HTMLElement, query: string, filterMode?: string) => Range[] | null\n```\n\nThis function will be called once for each node in the tree every time filter controls change (i.e. when the\nfilter mode or query string are altered). The function is called with the following arguments:\n\n|Argument |Description |\n|:-----------|:----------------------------------------------------------------|\n|`node` |The HTML node element, i.e. the element with `role=treeitem` set.|\n|`query` |The query string. |\n|`filterMode`|The filter mode, either `'all'` or `'selected'`. |\n\nThe component expects the filter function to return specific values depending on the type of match:\n\n1. No match - return `null`\n2. Match but no highlights (eg. when the query string is empty) - return an empty array\n3. Match with highlights - return a non-empty array of `Range` objects\n\nExample:\n\n```javascript\nconst filterableTreeView = document.querySelector('filterable-tree-view')\nfilterableTreeView.filterFn = (node, query, filterMode) => {\n // custom filter implementation here\n}\n```\n\nYou can read about `Range` objects here: https://developer.mozilla.org/en-US/docs/Web/API/Range.\n\nFor a complete example demonstrating how to implement a working filter function complete with range highlighting,\nsee the default filter function available in the `FilterableTreeViewElement` JavaScript class, which is part of\nthe Primer source code.\n\n### Events\n\nCurrently `FilterableTreeView` does not emit any events aside from the events already emitted by the `TreeView`\ncomponent.",
@@ -20571,6 +20648,71 @@
20571
20648
  ],
20572
20649
  "subcomponents": []
20573
20650
  },
20651
+ {
20652
+ "fully_qualified_name": "Primer::OpenProject::InlineMessage",
20653
+ "description": "A simple component to render warning text.\n\nThe warning text is rendered in the \"attention\" Primer color and\nuses a leading alert Octicon for additional emphasis. This component\nis designed to be used \"inline\", e.g. table cells, and in places\nwhere a Banner component might be overkill.",
20654
+ "accessibility_docs": null,
20655
+ "is_form_component": false,
20656
+ "is_published": true,
20657
+ "requires_js": false,
20658
+ "component": "OpenProject::InlineMessage",
20659
+ "status": "open_project",
20660
+ "a11y_reviewed": false,
20661
+ "short_name": "OpenProjectInlineMessage",
20662
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/inline_message.rb",
20663
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/inline_message/default/",
20664
+ "parameters": [
20665
+ {
20666
+ "name": "scheme",
20667
+ "type": "Symbol",
20668
+ "default": "N/A",
20669
+ "description": "One of `:critical`, `:success`, `:unavailable`, or `:warning`."
20670
+ },
20671
+ {
20672
+ "name": "size",
20673
+ "type": "Symbol",
20674
+ "default": "`:medium`",
20675
+ "description": "One of `:medium` or `:small`."
20676
+ },
20677
+ {
20678
+ "name": "system_arguments",
20679
+ "type": "Hash",
20680
+ "default": "N/A",
20681
+ "description": "{{link_to_system_arguments_docs}}"
20682
+ }
20683
+ ],
20684
+ "slots": [],
20685
+ "methods": [],
20686
+ "previews": [
20687
+ {
20688
+ "preview_path": "primer/open_project/inline_message/default",
20689
+ "name": "default",
20690
+ "snapshot": "true",
20691
+ "skip_rules": {
20692
+ "wont_fix": [
20693
+ "region"
20694
+ ],
20695
+ "will_fix": [
20696
+ "color-contrast"
20697
+ ]
20698
+ }
20699
+ },
20700
+ {
20701
+ "preview_path": "primer/open_project/inline_message/playground",
20702
+ "name": "playground",
20703
+ "snapshot": "false",
20704
+ "skip_rules": {
20705
+ "wont_fix": [
20706
+ "region"
20707
+ ],
20708
+ "will_fix": [
20709
+ "color-contrast"
20710
+ ]
20711
+ }
20712
+ }
20713
+ ],
20714
+ "subcomponents": []
20715
+ },
20574
20716
  {
20575
20717
  "fully_qualified_name": "Primer::OpenProject::InputGroup",
20576
20718
  "description": "`InputGroup` is composed of a text field input with a trailing action",
data/static/previews.json CHANGED
@@ -5104,6 +5104,40 @@
5104
5104
  }
5105
5105
  ]
5106
5106
  },
5107
+ {
5108
+ "name": "inline_message",
5109
+ "component": "OpenProject::InlineMessage",
5110
+ "status": "open_project",
5111
+ "lookup_path": "primer/open_project/inline_message",
5112
+ "examples": [
5113
+ {
5114
+ "preview_path": "primer/open_project/inline_message/default",
5115
+ "name": "default",
5116
+ "snapshot": "true",
5117
+ "skip_rules": {
5118
+ "wont_fix": [
5119
+ "region"
5120
+ ],
5121
+ "will_fix": [
5122
+ "color-contrast"
5123
+ ]
5124
+ }
5125
+ },
5126
+ {
5127
+ "preview_path": "primer/open_project/inline_message/playground",
5128
+ "name": "playground",
5129
+ "snapshot": "false",
5130
+ "skip_rules": {
5131
+ "wont_fix": [
5132
+ "region"
5133
+ ],
5134
+ "will_fix": [
5135
+ "color-contrast"
5136
+ ]
5137
+ }
5138
+ }
5139
+ ]
5140
+ },
5107
5141
  {
5108
5142
  "name": "input_group",
5109
5143
  "component": "OpenProject::InputGroup",
data/static/statuses.json CHANGED
@@ -151,12 +151,15 @@
151
151
  "Primer::OpenProject::DragHandle": "open_project",
152
152
  "Primer::OpenProject::FeedbackDialog": "open_project",
153
153
  "Primer::OpenProject::FeedbackMessage": "open_project",
154
+ "Primer::OpenProject::Fieldset": "open_project",
155
+ "Primer::OpenProject::Fieldset::LegendComponent": "open_project",
154
156
  "Primer::OpenProject::FilterableTreeView": "alpha",
155
157
  "Primer::OpenProject::FilterableTreeView::SubTree": "alpha",
156
158
  "Primer::OpenProject::FlexLayout": "open_project",
157
159
  "Primer::OpenProject::GridLayout": "open_project",
158
160
  "Primer::OpenProject::GridLayout::Area": "open_project",
159
161
  "Primer::OpenProject::Heading": "open_project",
162
+ "Primer::OpenProject::InlineMessage": "open_project",
160
163
  "Primer::OpenProject::InputGroup": "open_project",
161
164
  "Primer::OpenProject::PageHeader": "open_project",
162
165
  "Primer::OpenProject::PageHeader::Dialog": "open_project",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openproject-primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.79.1
4
+ version: 0.80.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-01-12 00:00:00.000000000 Z
12
+ date: 2026-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionview
@@ -622,6 +622,8 @@ files:
622
622
  - app/components/primer/open_project/feedback_dialog.rb
623
623
  - app/components/primer/open_project/feedback_message.html.erb
624
624
  - app/components/primer/open_project/feedback_message.rb
625
+ - app/components/primer/open_project/fieldset.html.erb
626
+ - app/components/primer/open_project/fieldset.rb
625
627
  - app/components/primer/open_project/filterable_tree_view.d.ts
626
628
  - app/components/primer/open_project/filterable_tree_view.html.erb
627
629
  - app/components/primer/open_project/filterable_tree_view.js
@@ -634,6 +636,12 @@ files:
634
636
  - app/components/primer/open_project/grid_layout.rb
635
637
  - app/components/primer/open_project/grid_layout/area.rb
636
638
  - app/components/primer/open_project/heading.rb
639
+ - app/components/primer/open_project/inline_message.css
640
+ - app/components/primer/open_project/inline_message.css.json
641
+ - app/components/primer/open_project/inline_message.css.map
642
+ - app/components/primer/open_project/inline_message.html.erb
643
+ - app/components/primer/open_project/inline_message.pcss
644
+ - app/components/primer/open_project/inline_message.rb
637
645
  - app/components/primer/open_project/input_group.css
638
646
  - app/components/primer/open_project/input_group.css.json
639
647
  - app/components/primer/open_project/input_group.css.map
@@ -784,6 +792,7 @@ files:
784
792
  - app/lib/primer/forms/dsl/button_input.rb
785
793
  - app/lib/primer/forms/dsl/check_box_group_input.rb
786
794
  - app/lib/primer/forms/dsl/check_box_input.rb
795
+ - app/lib/primer/forms/dsl/fieldset_group_input.rb
787
796
  - app/lib/primer/forms/dsl/form_object.rb
788
797
  - app/lib/primer/forms/dsl/form_reference_input.rb
789
798
  - app/lib/primer/forms/dsl/hidden_input.rb
@@ -798,6 +807,8 @@ files:
798
807
  - app/lib/primer/forms/dsl/text_area_input.rb
799
808
  - app/lib/primer/forms/dsl/text_field_input.rb
800
809
  - app/lib/primer/forms/dsl/toggle_switch_input.rb
810
+ - app/lib/primer/forms/fieldset_group.html.erb
811
+ - app/lib/primer/forms/fieldset_group.rb
801
812
  - app/lib/primer/forms/form_control.html.erb
802
813
  - app/lib/primer/forms/form_control.rb
803
814
  - app/lib/primer/forms/form_list.html.erb
@@ -1193,6 +1204,7 @@ files:
1193
1204
  - previews/primer/forms_preview/composed_form.html.erb
1194
1205
  - previews/primer/forms_preview/custom_width_fields_form.html.erb
1195
1206
  - previews/primer/forms_preview/example_toggle_switch_form.html.erb
1207
+ - previews/primer/forms_preview/fieldset_group_form.html.erb
1196
1208
  - previews/primer/forms_preview/horizontal_form.html.erb
1197
1209
  - previews/primer/forms_preview/immediate_validation_form.html.erb
1198
1210
  - previews/primer/forms_preview/invalid_form.html.erb
@@ -1247,6 +1259,9 @@ files:
1247
1259
  - previews/primer/open_project/flex_layout_preview.rb
1248
1260
  - previews/primer/open_project/grid_layout_preview.rb
1249
1261
  - previews/primer/open_project/heading_preview.rb
1262
+ - previews/primer/open_project/inline_message_preview.rb
1263
+ - previews/primer/open_project/inline_message_preview/default.html.erb
1264
+ - previews/primer/open_project/inline_message_preview/playground.html.erb
1250
1265
  - previews/primer/open_project/input_group_preview.rb
1251
1266
  - previews/primer/open_project/page_header_preview.rb
1252
1267
  - previews/primer/open_project/page_header_preview/actions.html.erb