openproject-primer_view_components 0.53.1 → 0.54.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/app/assets/javascripts/components/primer/open_project/danger_dialog_form_helper.d.ts +1 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/open_project/danger_dialog.rb +4 -0
- data/app/components/primer/open_project/danger_dialog_form_helper.d.ts +1 -0
- data/app/components/primer/open_project/danger_dialog_form_helper.js +8 -3
- data/app/components/primer/open_project/danger_dialog_form_helper.ts +9 -3
- data/app/components/primer/open_project/feedback_dialog.rb +2 -0
- data/app/components/primer/open_project/heading.rb +25 -0
- data/app/components/primer/open_project/page_header.css +1 -1
- data/app/components/primer/open_project/page_header.css.map +1 -1
- data/app/components/primer/open_project/page_header.pcss +0 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/open_project/heading_preview.rb +27 -0
- data/static/arguments.json +16 -0
- data/static/audited_at.json +1 -0
- data/static/constants.json +3 -0
- data/static/info_arch.json +59 -0
- data/static/previews.json +34 -0
- data/static/statuses.json +1 -0
- metadata +4 -2
@@ -20,6 +20,7 @@ module Primer
|
|
20
20
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
21
21
|
renders_one :confirmation_message, lambda { |icon_arguments: {}, **system_arguments|
|
22
22
|
system_arguments[:border] = false
|
23
|
+
system_arguments[:id] = "#{dialog_id}-description"
|
23
24
|
|
24
25
|
icon_arguments[:icon] ||= :"alert"
|
25
26
|
icon_arguments[:color] ||= :danger
|
@@ -82,12 +83,15 @@ module Primer
|
|
82
83
|
@confirm_button_text = confirm_button_text
|
83
84
|
@cancel_button_text = cancel_button_text
|
84
85
|
|
86
|
+
deny_single_argument(:role, "`role` will always be set to `alertdialog`.", **system_arguments)
|
87
|
+
|
85
88
|
@system_arguments = system_arguments
|
86
89
|
@system_arguments[:id] = @dialog_id
|
87
90
|
@system_arguments[:classes] = class_names(
|
88
91
|
system_arguments[:classes],
|
89
92
|
"DangerDialog"
|
90
93
|
)
|
94
|
+
@system_arguments[:role] = "alertdialog"
|
91
95
|
|
92
96
|
@dialog = Primer::Alpha::Dialog.new(title: title, subtitle: nil, visually_hide_title: true, **@system_arguments)
|
93
97
|
end
|
@@ -17,11 +17,19 @@ let DangerDialogFormHelperElement = class DangerDialogFormHelperElement extends
|
|
17
17
|
super(...arguments);
|
18
18
|
_DangerDialogFormHelperElement_instances.add(this);
|
19
19
|
}
|
20
|
+
get form() {
|
21
|
+
return this.querySelector('form');
|
22
|
+
}
|
20
23
|
get submitButton() {
|
21
24
|
return this.querySelector(SUBMIT_BUTTON_SELECTOR);
|
22
25
|
}
|
23
26
|
connectedCallback() {
|
27
|
+
// makes the custom element behave as if it doesn't exist in the DOM structure, passing all
|
28
|
+
// styles directly to its children.
|
24
29
|
this.style.display = 'contents';
|
30
|
+
if (this.form) {
|
31
|
+
this.form.style.display = 'contents';
|
32
|
+
}
|
25
33
|
__classPrivateFieldGet(this, _DangerDialogFormHelperElement_instances, "m", _DangerDialogFormHelperElement_reset).call(this);
|
26
34
|
}
|
27
35
|
toggle() {
|
@@ -32,9 +40,6 @@ let DangerDialogFormHelperElement = class DangerDialogFormHelperElement extends
|
|
32
40
|
};
|
33
41
|
_DangerDialogFormHelperElement_instances = new WeakSet();
|
34
42
|
_DangerDialogFormHelperElement_reset = function _DangerDialogFormHelperElement_reset() {
|
35
|
-
if (this.checkbox) {
|
36
|
-
this.checkbox.disabled = false;
|
37
|
-
}
|
38
43
|
this.toggle();
|
39
44
|
};
|
40
45
|
__decorate([
|
@@ -6,12 +6,21 @@ const SUBMIT_BUTTON_SELECTOR = 'input[type=submit],button[type=submit],button[da
|
|
6
6
|
class DangerDialogFormHelperElement extends HTMLElement {
|
7
7
|
@target checkbox: HTMLInputElement | undefined
|
8
8
|
|
9
|
+
get form() {
|
10
|
+
return this.querySelector('form')
|
11
|
+
}
|
12
|
+
|
9
13
|
get submitButton() {
|
10
14
|
return this.querySelector<HTMLInputElement | HTMLButtonElement>(SUBMIT_BUTTON_SELECTOR)!
|
11
15
|
}
|
12
16
|
|
13
17
|
connectedCallback() {
|
18
|
+
// makes the custom element behave as if it doesn't exist in the DOM structure, passing all
|
19
|
+
// styles directly to its children.
|
14
20
|
this.style.display = 'contents'
|
21
|
+
if (this.form) {
|
22
|
+
this.form.style.display = 'contents'
|
23
|
+
}
|
15
24
|
this.#reset()
|
16
25
|
}
|
17
26
|
|
@@ -22,9 +31,6 @@ class DangerDialogFormHelperElement extends HTMLElement {
|
|
22
31
|
}
|
23
32
|
|
24
33
|
#reset(): void {
|
25
|
-
if (this.checkbox) {
|
26
|
-
this.checkbox.disabled = false
|
27
|
-
}
|
28
34
|
this.toggle()
|
29
35
|
}
|
30
36
|
}
|
@@ -16,6 +16,8 @@ module Primer
|
|
16
16
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
17
17
|
renders_one :feedback_message, lambda { |icon_arguments: {}, **system_arguments|
|
18
18
|
system_arguments[:border] = false
|
19
|
+
system_arguments[:id] = "#{@system_arguments[:id]}-description"
|
20
|
+
|
19
21
|
Primer::OpenProject::FeedbackMessage.new(icon_arguments: icon_arguments, **system_arguments)
|
20
22
|
}
|
21
23
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module OpenProject
|
5
|
+
# This is a generic Heading component specifically for the use in the OpenProject context
|
6
|
+
# Use it for any Heading you need **inside** the page context.
|
7
|
+
# Do not use for a page header, we have Primer::OpenProject::PageHeader for that
|
8
|
+
class Heading < Primer::Component
|
9
|
+
status :open_project
|
10
|
+
|
11
|
+
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
12
|
+
def initialize(**system_arguments)
|
13
|
+
@system_arguments = system_arguments
|
14
|
+
|
15
|
+
# Override because of Primer::OpenProject::PageHeader which should be the
|
16
|
+
# most prominent element in the hierarchical structure
|
17
|
+
@system_arguments[:font_weight] ||= :normal
|
18
|
+
end
|
19
|
+
|
20
|
+
def call
|
21
|
+
render(Primer::Beta::Heading.new(**@system_arguments)) { content }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1 +1 @@
|
|
1
|
-
.PageHeader{border-bottom:var(--borderWidth-thin) solid var(--borderColor-muted);display:flex;flex-flow:column;margin-bottom:var(--stack-gap-normal);padding-bottom:var(--stack-padding-condensed)}.PageHeader--withTabNav{border-bottom:none;margin-bottom:0;padding-bottom:0}.PageHeader-contextBar,.PageHeader-titleBar{align-items:center;display:flex;flex-flow:row;justify-content:flex-end;margin-bottom:var(--base-size-8)}.PageHeader-title{flex:1 1 auto;font-size:var(--text-title-size-medium)
|
1
|
+
.PageHeader{border-bottom:var(--borderWidth-thin) solid var(--borderColor-muted);display:flex;flex-flow:column;margin-bottom:var(--stack-gap-normal);padding-bottom:var(--stack-padding-condensed)}.PageHeader--withTabNav{border-bottom:none;margin-bottom:0;padding-bottom:0}.PageHeader-contextBar,.PageHeader-titleBar{align-items:center;display:flex;flex-flow:row;justify-content:flex-end;margin-bottom:var(--base-size-8)}.PageHeader-title{flex:1 1 auto;font-size:var(--text-title-size-medium)}.PageHeader-title--large{font-size:var(--text-title-size-large)}.PageHeader-description{color:var(--fgColor-muted);flex:1 100%;font-size:var(--text-body-size-medium)}.PageHeader-tabNavBar{overflow:auto}.PageHeader-tabNavBar .PageHeader-tabNav{min-width:max-content}.PageHeader--withTabNav .PageHeader-description{margin-bottom:var(--base-size-16)}.PageHeader-actions{align-items:center;display:flex;justify-content:flex-end}.PageHeader-breadcrumbs{display:block;width:100%}.PageHeader-leadingAction{margin-right:var(--base-size-4);margin-top:2px}.PageHeader-parentLink{flex:1 1 auto}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["page_header.pcss"],"names":[],"mappings":"AAEA,YAIE,oEAAqE,CAHrE,YAAa,CAIb,gBAAiB,CAFjB,qCAAsC,CADtC,6CAIF,CAEA,wBACE,kBAAmB,CAEnB,eAAgB,CADhB,gBAEF,CAUA,4CAIE,kBAAmB,CAHnB,YAAa,CACb,aAAc,CACd,wBAAyB,CAEzB,gCACF,CAEA,
|
1
|
+
{"version":3,"sources":["page_header.pcss"],"names":[],"mappings":"AAEA,YAIE,oEAAqE,CAHrE,YAAa,CAIb,gBAAiB,CAFjB,qCAAsC,CADtC,6CAIF,CAEA,wBACE,kBAAmB,CAEnB,eAAgB,CADhB,gBAEF,CAUA,4CAIE,kBAAmB,CAHnB,YAAa,CACb,aAAc,CACd,wBAAyB,CAEzB,gCACF,CAEA,kBAEE,aAAc,CADd,uCAEF,CAEA,yBACE,sCACF,CAGA,wBAEE,0BAA2B,CAC3B,WAAY,CAFZ,sCAGF,CAEA,sBACE,aACF,CAEA,yCACE,qBACF,CAEA,gDACE,iCACF,CAEA,oBAGE,kBAAmB,CADnB,YAAa,CADb,wBAGF,CAEA,wBACE,aAAc,CACd,UACF,CAEA,0BAEE,+BAAgC,CADhC,cAEF,CAEA,uBACE,aACF","file":"page_header.css","sourcesContent":["/* OP PageHeader */\n\n.PageHeader {\n display: flex;\n padding-bottom: var(--stack-padding-condensed);\n margin-bottom: var(--stack-gap-normal);\n border-bottom: var(--borderWidth-thin) solid var(--borderColor-muted);\n flex-flow: column;\n}\n\n.PageHeader--withTabNav {\n border-bottom: none;\n padding-bottom: 0;\n margin-bottom: 0;\n}\n\n.PageHeader-contextBar {\n display: flex;\n flex-flow: row;\n justify-content: flex-end;\n align-items: center;\n margin-bottom: var(--base-size-8);\n}\n\n.PageHeader-titleBar {\n display: flex;\n flex-flow: row;\n justify-content: flex-end;\n align-items: center; /* Keep back button vertically aligned. */\n margin-bottom: var(--base-size-8);\n}\n\n.PageHeader-title {\n font-size: var(--text-title-size-medium);\n flex: 1 1 auto;\n}\n\n.PageHeader-title--large {\n font-size: var(--text-title-size-large);\n}\n\n/* One-liner of supporting text */\n.PageHeader-description {\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n flex: 1 100%;\n}\n\n.PageHeader-tabNavBar {\n overflow: auto;\n}\n\n.PageHeader-tabNavBar .PageHeader-tabNav {\n min-width: max-content;\n}\n\n.PageHeader--withTabNav .PageHeader-description {\n margin-bottom: var(--base-size-16);\n}\n\n.PageHeader-actions {\n justify-content: flex-end;\n display: flex;\n align-items: center;\n}\n\n.PageHeader-breadcrumbs {\n display: block;\n width: 100%;\n}\n\n.PageHeader-leadingAction {\n margin-top: 2px; /* to center align with label */\n margin-right: var(--base-size-4);\n}\n\n.PageHeader-parentLink {\n flex: 1 1 auto;\n}\n"]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Setup Playground to use all available component props
|
4
|
+
# Setup Features to use individual component props and combinations
|
5
|
+
|
6
|
+
module Primer
|
7
|
+
module OpenProject
|
8
|
+
# @label Heading
|
9
|
+
class HeadingPreview < ViewComponent::Preview
|
10
|
+
# @label Playground
|
11
|
+
# @param tag [Symbol] select [h1, h2, h3, h4, h5, h6]
|
12
|
+
# @param content [String] text
|
13
|
+
def playground(tag: :h2, content: "Heading")
|
14
|
+
render(Primer::OpenProject::Heading.new(tag: tag)) { content }
|
15
|
+
end
|
16
|
+
|
17
|
+
# @label Default options
|
18
|
+
#
|
19
|
+
# @param tag [Symbol] select [h1, h2, h3, h4, h5, h6]
|
20
|
+
# @param content [String] text
|
21
|
+
# @snapshot
|
22
|
+
def default(tag: :h2, content: "Heading")
|
23
|
+
render(Primer::OpenProject::Heading.new(tag: tag)) { content }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/static/arguments.json
CHANGED
@@ -5340,6 +5340,22 @@
|
|
5340
5340
|
}
|
5341
5341
|
]
|
5342
5342
|
},
|
5343
|
+
{
|
5344
|
+
"component": "OpenProject::Heading",
|
5345
|
+
"status": "open_project",
|
5346
|
+
"a11y_reviewed": false,
|
5347
|
+
"short_name": "OpenProjectHeading",
|
5348
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/heading.rb",
|
5349
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/heading/default/",
|
5350
|
+
"parameters": [
|
5351
|
+
{
|
5352
|
+
"name": "system_arguments",
|
5353
|
+
"type": "Hash",
|
5354
|
+
"default": "N/A",
|
5355
|
+
"description": "[System arguments](/system-arguments)"
|
5356
|
+
}
|
5357
|
+
]
|
5358
|
+
},
|
5343
5359
|
{
|
5344
5360
|
"component": "OpenProject::InputGroup",
|
5345
5361
|
"status": "open_project",
|
data/static/audited_at.json
CHANGED
@@ -127,6 +127,7 @@
|
|
127
127
|
"Primer::OpenProject::FlexLayout": "",
|
128
128
|
"Primer::OpenProject::GridLayout": "",
|
129
129
|
"Primer::OpenProject::GridLayout::Area": "",
|
130
|
+
"Primer::OpenProject::Heading": "",
|
130
131
|
"Primer::OpenProject::InputGroup": "",
|
131
132
|
"Primer::OpenProject::PageHeader": "",
|
132
133
|
"Primer::OpenProject::PageHeader::Dialog": "",
|
data/static/constants.json
CHANGED
@@ -1602,6 +1602,9 @@
|
|
1602
1602
|
"span"
|
1603
1603
|
]
|
1604
1604
|
},
|
1605
|
+
"Primer::OpenProject::Heading": {
|
1606
|
+
"GeneratedSlotMethods": "Primer::OpenProject::Heading::GeneratedSlotMethods"
|
1607
|
+
},
|
1605
1608
|
"Primer::OpenProject::InputGroup": {
|
1606
1609
|
"DEFAULT_INPUT_WIDTH": "auto",
|
1607
1610
|
"GeneratedSlotMethods": "Primer::OpenProject::InputGroup::GeneratedSlotMethods",
|
data/static/info_arch.json
CHANGED
@@ -18402,6 +18402,65 @@
|
|
18402
18402
|
|
18403
18403
|
]
|
18404
18404
|
},
|
18405
|
+
{
|
18406
|
+
"fully_qualified_name": "Primer::OpenProject::Heading",
|
18407
|
+
"description": "This is a generic Heading component specifically for the use in the OpenProject context\nUse it for any Heading you need **inside** the page context.\nDo not use for a page header, we have Primer::OpenProject::PageHeader for that",
|
18408
|
+
"accessibility_docs": null,
|
18409
|
+
"is_form_component": false,
|
18410
|
+
"is_published": true,
|
18411
|
+
"requires_js": false,
|
18412
|
+
"component": "OpenProject::Heading",
|
18413
|
+
"status": "open_project",
|
18414
|
+
"a11y_reviewed": false,
|
18415
|
+
"short_name": "OpenProjectHeading",
|
18416
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/heading.rb",
|
18417
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/heading/default/",
|
18418
|
+
"parameters": [
|
18419
|
+
{
|
18420
|
+
"name": "system_arguments",
|
18421
|
+
"type": "Hash",
|
18422
|
+
"default": "N/A",
|
18423
|
+
"description": "{{link_to_system_arguments_docs}}"
|
18424
|
+
}
|
18425
|
+
],
|
18426
|
+
"slots": [
|
18427
|
+
|
18428
|
+
],
|
18429
|
+
"methods": [
|
18430
|
+
|
18431
|
+
],
|
18432
|
+
"previews": [
|
18433
|
+
{
|
18434
|
+
"preview_path": "primer/open_project/heading/playground",
|
18435
|
+
"name": "playground",
|
18436
|
+
"snapshot": "false",
|
18437
|
+
"skip_rules": {
|
18438
|
+
"wont_fix": [
|
18439
|
+
"region"
|
18440
|
+
],
|
18441
|
+
"will_fix": [
|
18442
|
+
"color-contrast"
|
18443
|
+
]
|
18444
|
+
}
|
18445
|
+
},
|
18446
|
+
{
|
18447
|
+
"preview_path": "primer/open_project/heading/default",
|
18448
|
+
"name": "default",
|
18449
|
+
"snapshot": "true",
|
18450
|
+
"skip_rules": {
|
18451
|
+
"wont_fix": [
|
18452
|
+
"region"
|
18453
|
+
],
|
18454
|
+
"will_fix": [
|
18455
|
+
"color-contrast"
|
18456
|
+
]
|
18457
|
+
}
|
18458
|
+
}
|
18459
|
+
],
|
18460
|
+
"subcomponents": [
|
18461
|
+
|
18462
|
+
]
|
18463
|
+
},
|
18405
18464
|
{
|
18406
18465
|
"fully_qualified_name": "Primer::OpenProject::InputGroup",
|
18407
18466
|
"description": "`InputGroup` is composed of a text field input with a trailing action",
|
data/static/previews.json
CHANGED
@@ -4296,6 +4296,40 @@
|
|
4296
4296
|
}
|
4297
4297
|
]
|
4298
4298
|
},
|
4299
|
+
{
|
4300
|
+
"name": "heading",
|
4301
|
+
"component": "OpenProject::Heading",
|
4302
|
+
"status": "open_project",
|
4303
|
+
"lookup_path": "primer/open_project/heading",
|
4304
|
+
"examples": [
|
4305
|
+
{
|
4306
|
+
"preview_path": "primer/open_project/heading/playground",
|
4307
|
+
"name": "playground",
|
4308
|
+
"snapshot": "false",
|
4309
|
+
"skip_rules": {
|
4310
|
+
"wont_fix": [
|
4311
|
+
"region"
|
4312
|
+
],
|
4313
|
+
"will_fix": [
|
4314
|
+
"color-contrast"
|
4315
|
+
]
|
4316
|
+
}
|
4317
|
+
},
|
4318
|
+
{
|
4319
|
+
"preview_path": "primer/open_project/heading/default",
|
4320
|
+
"name": "default",
|
4321
|
+
"snapshot": "true",
|
4322
|
+
"skip_rules": {
|
4323
|
+
"wont_fix": [
|
4324
|
+
"region"
|
4325
|
+
],
|
4326
|
+
"will_fix": [
|
4327
|
+
"color-contrast"
|
4328
|
+
]
|
4329
|
+
}
|
4330
|
+
}
|
4331
|
+
]
|
4332
|
+
},
|
4299
4333
|
{
|
4300
4334
|
"name": "hellip_button",
|
4301
4335
|
"component": "HellipButton",
|
data/static/statuses.json
CHANGED
@@ -127,6 +127,7 @@
|
|
127
127
|
"Primer::OpenProject::FlexLayout": "open_project",
|
128
128
|
"Primer::OpenProject::GridLayout": "open_project",
|
129
129
|
"Primer::OpenProject::GridLayout::Area": "open_project",
|
130
|
+
"Primer::OpenProject::Heading": "open_project",
|
130
131
|
"Primer::OpenProject::InputGroup": "open_project",
|
131
132
|
"Primer::OpenProject::PageHeader": "open_project",
|
132
133
|
"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.
|
4
|
+
version: 0.54.1
|
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: 2025-02-
|
12
|
+
date: 2025-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionview
|
@@ -516,6 +516,7 @@ files:
|
|
516
516
|
- app/components/primer/open_project/grid_layout.html.erb
|
517
517
|
- app/components/primer/open_project/grid_layout.rb
|
518
518
|
- app/components/primer/open_project/grid_layout/area.rb
|
519
|
+
- app/components/primer/open_project/heading.rb
|
519
520
|
- app/components/primer/open_project/input_group.css
|
520
521
|
- app/components/primer/open_project/input_group.css.json
|
521
522
|
- app/components/primer/open_project/input_group.css.map
|
@@ -1043,6 +1044,7 @@ files:
|
|
1043
1044
|
- previews/primer/open_project/feedback_message_preview.rb
|
1044
1045
|
- previews/primer/open_project/flex_layout_preview.rb
|
1045
1046
|
- previews/primer/open_project/grid_layout_preview.rb
|
1047
|
+
- previews/primer/open_project/heading_preview.rb
|
1046
1048
|
- previews/primer/open_project/input_group_preview.rb
|
1047
1049
|
- previews/primer/open_project/page_header_preview.rb
|
1048
1050
|
- previews/primer/open_project/page_header_preview/actions.html.erb
|