openproject-primer_view_components 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- .PageHeader{border-bottom:var(--borderWidth-thin,max(1px,.0625rem)) solid var(--borderColor-muted,var(--color-border-muted));display:flex;flex-flow:row wrap;justify-content:flex-end;margin-bottom:var(--stack-gap-normal,1rem);padding-bottom:var(--stack-padding-condensed,.5rem)}.PageHeader-title{flex:1 1 auto;order:0}.PageHeader-description{color:var(--fgColor-muted,var(--color-fg-muted));flex:1 100%;font-size:var(--text-body-size-medium,.875rem);order:2}.PageHeader-actions{align-self:center;justify-content:flex-end;margin:var(--base-size-4,.25rem) 0 var(--base-size-4,.25rem) var(--base-size-4,.25rem);order:1}.PageHeader-actions+.PageHeader-description{margin-top:var(--base-size-4,.25rem)}
1
+ .PageHeader{border-bottom:var(--borderWidth-thin,max(1px,.0625rem)) solid var(--borderColor-muted,var(--color-border-muted));display:flex;flex-flow:row wrap;justify-content:flex-end;margin-bottom:var(--stack-gap-normal,1rem);padding-bottom:var(--stack-padding-condensed,.5rem)}.PageHeader-title{flex:1 1 auto;font-size:24px;font-weight:var(--base-text-weight-normal,400);order:0}.PageHeader-title--large{font-size:var(--text-title-size-large,2rem)}.PageHeader-description{color:var(--fgColor-muted,var(--color-fg-muted));flex:1 100%;font-size:var(--text-body-size-medium,.875rem);order:2}.PageHeader-actions{align-self:center;justify-content:flex-end;margin:var(--base-size-4,.25rem) 0 var(--base-size-4,.25rem) var(--base-size-4,.25rem);order:1}.PageHeader-actions+.PageHeader-description{margin-top:var(--base-size-4,.25rem)}
@@ -3,6 +3,7 @@
3
3
  "selectors": [
4
4
  ".PageHeader",
5
5
  ".PageHeader-title",
6
+ ".PageHeader-title--large",
6
7
  ".PageHeader-description",
7
8
  ".PageHeader-actions",
8
9
  ".PageHeader-actions+.PageHeader-description"
@@ -1 +1 @@
1
- {"version":3,"sources":["page_header.pcss"],"names":[],"mappings":"AAEA,YAIE,gHAAqE,CAHrE,YAAa,CAIb,kBAAmB,CACnB,wBAAyB,CAHzB,0CAAsC,CADtC,mDAKF,CAGA,kBACE,aAAc,CACd,OACF,CAGA,wBAEE,gDAA2B,CAC3B,WAAY,CAFZ,8CAAuC,CAGvC,OACF,CAGA,oBAEE,iBAAkB,CAClB,wBAAyB,CAFzB,sFAAkE,CAGlE,OAKF,CAHE,4CACE,oCACF","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: row wrap;\n justify-content: flex-end; /* Keep actions right aligned. */\n}\n\n/* <h2> sized heading with normal font weight */\n.PageHeader-title {\n flex: 1 1 auto;\n order: 0;\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 order: 2;\n}\n\n/* Add 1 or 2 buttons to the right of the heading */\n.PageHeader-actions {\n margin: var(--base-size-4) 0 var(--base-size-4) var(--base-size-4);\n align-self: center;\n justify-content: flex-end;\n order: 1;\n\n & + .PageHeader-description {\n margin-top: var(--base-size-4);\n }\n}\n"]}
1
+ {"version":3,"sources":["page_header.pcss"],"names":[],"mappings":"AAEA,YAIE,gHAAqE,CAHrE,YAAa,CAIb,kBAAmB,CACnB,wBAAyB,CAHzB,0CAAsC,CADtC,mDAKF,CAEA,kBAGE,aAAc,CAFd,cAAe,CACf,8CAA2C,CAE3C,OACF,CAEA,yBACE,2CACF,CAGA,wBAEE,gDAA2B,CAC3B,WAAY,CAFZ,8CAAuC,CAGvC,OACF,CAGA,oBAEE,iBAAkB,CAClB,wBAAyB,CAFzB,sFAAkE,CAGlE,OAKF,CAHE,4CACE,oCACF","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: row wrap;\n justify-content: flex-end; /* Keep actions right aligned. */\n}\n\n.PageHeader-title {\n font-size: 24px;\n font-weight: var(--base-text-weight-normal);\n flex: 1 1 auto;\n order: 0;\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 order: 2;\n}\n\n/* Add 1 or 2 buttons to the right of the heading */\n.PageHeader-actions {\n margin: var(--base-size-4) 0 var(--base-size-4) var(--base-size-4);\n align-self: center;\n justify-content: flex-end;\n order: 1;\n\n & + .PageHeader-description {\n margin-top: var(--base-size-4);\n }\n}\n"]}
@@ -9,12 +9,17 @@
9
9
  justify-content: flex-end; /* Keep actions right aligned. */
10
10
  }
11
11
 
12
- /* <h2> sized heading with normal font weight */
13
12
  .PageHeader-title {
13
+ font-size: 24px;
14
+ font-weight: var(--base-text-weight-normal);
14
15
  flex: 1 1 auto;
15
16
  order: 0;
16
17
  }
17
18
 
19
+ .PageHeader-title--large {
20
+ font-size: var(--text-title-size-large);
21
+ }
22
+
18
23
  /* One-liner of supporting text */
19
24
  .PageHeader-description {
20
25
  font-size: var(--text-body-size-medium);
@@ -5,7 +5,13 @@ module Primer
5
5
  # A ViewComponent PageHeader inspired by the primer react variant
6
6
  class PageHeader < Primer::Component
7
7
  HEADING_TAG_OPTIONS = [:h1, :h2, :h3, :h4, :h5, :h6].freeze
8
- HEADING_TAG_FALLBACK = :h1
8
+ HEADING_TAG_FALLBACK = :h2
9
+
10
+ DEFAULT_HEADER_VARIANT = :medium
11
+ HEADER_VARIANT_OPTIONS = [
12
+ :large,
13
+ DEFAULT_HEADER_VARIANT
14
+ ].freeze
9
15
 
10
16
  status :open_project
11
17
 
@@ -13,9 +19,13 @@ module Primer
13
19
  #
14
20
  # @param tag [Symbol] <%= one_of(Primer::Beta::Heading::TAG_OPTIONS) %>
15
21
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
16
- renders_one :title, lambda { |tag: :h1, **system_arguments|
22
+ renders_one :title, lambda { |tag: HEADING_TAG_FALLBACK, variant: DEFAULT_HEADER_VARIANT, **system_arguments|
17
23
  system_arguments[:tag] = fetch_or_fallback(HEADING_TAG_OPTIONS, tag, HEADING_TAG_FALLBACK)
18
- system_arguments[:classes] = class_names(system_arguments[:classes], "PageHeader-title")
24
+ system_arguments[:classes] = class_names(
25
+ system_arguments[:classes],
26
+ "PageHeader-title",
27
+ "PageHeader-title--#{variant}"
28
+ )
19
29
 
20
30
  Primer::BaseComponent.new(**system_arguments)
21
31
  }
@@ -6,7 +6,7 @@ module Primer
6
6
  module VERSION
7
7
  MAJOR = 0
8
8
  MINOR = 9
9
- PATCH = 0
9
+ PATCH = 1
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
12
12
  end
@@ -14,12 +14,21 @@ module Primer
14
14
  end
15
15
  end
16
16
 
17
-
18
17
  # @label Playground
19
- #
20
- def playground
18
+ # @param variant [Symbol] select [medium, large]
19
+ # @param title [String] text
20
+ # @param description [String] text
21
+ def playground(variant: :medium, title: "Hello", description: "Last updated 5 minutes ago by XYZ.")
21
22
  render(Primer::OpenProject::PageHeader.new) do |header|
22
- header.with_title { "Hello" }
23
+ header.with_title(variant: variant) { title }
24
+ header.with_description { description }
25
+ end
26
+ end
27
+
28
+ # @label Large
29
+ def large_title
30
+ render(Primer::OpenProject::PageHeader.new) do |header|
31
+ header.with_title(variant: :large) { "Hello" }
23
32
  header.with_description { "Last updated 5 minutes ago by XYZ." }
24
33
  end
25
34
  end
@@ -4423,6 +4423,17 @@
4423
4423
  }
4424
4424
  ]
4425
4425
  },
4426
+ {
4427
+ "component": "OpenProject::PageHeader",
4428
+ "status": "open_project",
4429
+ "a11y_reviewed": false,
4430
+ "short_name": "OpenProjectPageHeader",
4431
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/page_header.rb",
4432
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/page_header/default/",
4433
+ "parameters": [
4434
+
4435
+ ]
4436
+ },
4426
4437
  {
4427
4438
  "component": "Tooltip",
4428
4439
  "status": "deprecated",
@@ -102,6 +102,7 @@
102
102
  "Primer::IconButton": "",
103
103
  "Primer::LayoutComponent": "",
104
104
  "Primer::Navigation::TabComponent": "",
105
+ "Primer::OpenProject::PageHeader": "",
105
106
  "Primer::Tooltip": "",
106
107
  "Primer::Truncate": ""
107
108
  }
data/static/classes.json CHANGED
@@ -423,6 +423,9 @@
423
423
  "PageHeader-title": [
424
424
  "Primer::OpenProject::PageHeader"
425
425
  ],
426
+ "PageHeader-title--large": [
427
+ "Primer::OpenProject::PageHeader"
428
+ ],
426
429
  "Popover": [
427
430
  "Primer::Beta::Popover"
428
431
  ],
@@ -1300,6 +1300,22 @@
1300
1300
  },
1301
1301
  "Primer::Navigation::TabComponent": {
1302
1302
  },
1303
+ "Primer::OpenProject::PageHeader": {
1304
+ "DEFAULT_HEADER_VARIANT": "medium",
1305
+ "HEADER_VARIANT_OPTIONS": [
1306
+ "large",
1307
+ "medium"
1308
+ ],
1309
+ "HEADING_TAG_FALLBACK": "h2",
1310
+ "HEADING_TAG_OPTIONS": [
1311
+ "h1",
1312
+ "h2",
1313
+ "h3",
1314
+ "h4",
1315
+ "h5",
1316
+ "h6"
1317
+ ]
1318
+ },
1303
1319
  "Primer::Tooltip": {
1304
1320
  "ALIGN_DEFAULT": "default",
1305
1321
  "ALIGN_MAPPING": {
@@ -14364,6 +14364,122 @@
14364
14364
 
14365
14365
  ]
14366
14366
  },
14367
+ {
14368
+ "fully_qualified_name": "Primer::OpenProject::PageHeader",
14369
+ "description": "A ViewComponent PageHeader inspired by the primer react variant",
14370
+ "accessibility_docs": null,
14371
+ "is_form_component": false,
14372
+ "is_published": true,
14373
+ "requires_js": false,
14374
+ "component": "OpenProject::PageHeader",
14375
+ "status": "open_project",
14376
+ "a11y_reviewed": false,
14377
+ "short_name": "OpenProjectPageHeader",
14378
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/open_project/page_header.rb",
14379
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/open_project/page_header/default/",
14380
+ "parameters": [
14381
+
14382
+ ],
14383
+ "slots": [
14384
+ {
14385
+ "name": "title",
14386
+ "description": "The title of the page header",
14387
+ "parameters": [
14388
+ {
14389
+ "name": "tag",
14390
+ "type": "Symbol",
14391
+ "default": "N/A",
14392
+ "description": "One of `:h1`, `:h2`, `:h3`, `:h4`, `:h5`, or `:h6`."
14393
+ },
14394
+ {
14395
+ "name": "system_arguments",
14396
+ "type": "Hash",
14397
+ "default": "N/A",
14398
+ "description": "{{link_to_system_arguments_docs}}"
14399
+ }
14400
+ ]
14401
+ },
14402
+ {
14403
+ "name": "description",
14404
+ "description": "Optional description below the title row",
14405
+ "parameters": [
14406
+
14407
+ ]
14408
+ },
14409
+ {
14410
+ "name": "actions",
14411
+ "description": "Actions",
14412
+ "parameters": [
14413
+ {
14414
+ "name": "system_arguments",
14415
+ "type": "Hash",
14416
+ "default": "N/A",
14417
+ "description": "{{link_to_system_arguments_docs}}"
14418
+ }
14419
+ ]
14420
+ }
14421
+ ],
14422
+ "methods": [
14423
+
14424
+ ],
14425
+ "previews": [
14426
+ {
14427
+ "preview_path": "primer/open_project/page_header/default",
14428
+ "name": "default",
14429
+ "snapshot": "true",
14430
+ "skip_rules": {
14431
+ "wont_fix": [
14432
+ "region"
14433
+ ],
14434
+ "will_fix": [
14435
+ "color-contrast"
14436
+ ]
14437
+ }
14438
+ },
14439
+ {
14440
+ "preview_path": "primer/open_project/page_header/playground",
14441
+ "name": "playground",
14442
+ "snapshot": "false",
14443
+ "skip_rules": {
14444
+ "wont_fix": [
14445
+ "region"
14446
+ ],
14447
+ "will_fix": [
14448
+ "color-contrast"
14449
+ ]
14450
+ }
14451
+ },
14452
+ {
14453
+ "preview_path": "primer/open_project/page_header/large_title",
14454
+ "name": "large_title",
14455
+ "snapshot": "false",
14456
+ "skip_rules": {
14457
+ "wont_fix": [
14458
+ "region"
14459
+ ],
14460
+ "will_fix": [
14461
+ "color-contrast"
14462
+ ]
14463
+ }
14464
+ },
14465
+ {
14466
+ "preview_path": "primer/open_project/page_header/actions",
14467
+ "name": "actions",
14468
+ "snapshot": "false",
14469
+ "skip_rules": {
14470
+ "wont_fix": [
14471
+ "region"
14472
+ ],
14473
+ "will_fix": [
14474
+ "color-contrast"
14475
+ ]
14476
+ }
14477
+ }
14478
+ ],
14479
+ "subcomponents": [
14480
+
14481
+ ]
14482
+ },
14367
14483
  {
14368
14484
  "fully_qualified_name": "Primer::Tooltip",
14369
14485
  "description": "`Tooltip` is a wrapper component that will apply a tooltip to the provided content.",
data/static/previews.json CHANGED
@@ -4434,14 +4434,27 @@
4434
4434
  },
4435
4435
  {
4436
4436
  "name": "page_header",
4437
- "component": "PageHeader",
4438
- "status": "openproject",
4437
+ "component": "OpenProject::PageHeader",
4438
+ "status": "open_project",
4439
4439
  "lookup_path": "primer/open_project/page_header",
4440
4440
  "examples": [
4441
+ {
4442
+ "preview_path": "primer/open_project/page_header/default",
4443
+ "name": "default",
4444
+ "snapshot": "true",
4445
+ "skip_rules": {
4446
+ "wont_fix": [
4447
+ "region"
4448
+ ],
4449
+ "will_fix": [
4450
+ "color-contrast"
4451
+ ]
4452
+ }
4453
+ },
4441
4454
  {
4442
4455
  "preview_path": "primer/open_project/page_header/playground",
4443
4456
  "name": "playground",
4444
- "snapshot": "true",
4457
+ "snapshot": "false",
4445
4458
  "skip_rules": {
4446
4459
  "wont_fix": [
4447
4460
  "region"
@@ -4452,9 +4465,9 @@
4452
4465
  }
4453
4466
  },
4454
4467
  {
4455
- "preview_path": "primer/open_project/page_header/default",
4456
- "name": "default",
4457
- "snapshot": "true",
4468
+ "preview_path": "primer/open_project/page_header/large_title",
4469
+ "name": "large_title",
4470
+ "snapshot": "false",
4458
4471
  "skip_rules": {
4459
4472
  "wont_fix": [
4460
4473
  "region"
@@ -4467,7 +4480,7 @@
4467
4480
  {
4468
4481
  "preview_path": "primer/open_project/page_header/actions",
4469
4482
  "name": "actions",
4470
- "snapshot": "true",
4483
+ "snapshot": "false",
4471
4484
  "skip_rules": {
4472
4485
  "wont_fix": [
4473
4486
  "region"
data/static/statuses.json CHANGED
@@ -102,6 +102,7 @@
102
102
  "Primer::IconButton": "deprecated",
103
103
  "Primer::LayoutComponent": "deprecated",
104
104
  "Primer::Navigation::TabComponent": "deprecated",
105
+ "Primer::OpenProject::PageHeader": "open_project",
105
106
  "Primer::Tooltip": "deprecated",
106
107
  "Primer::Truncate": "deprecated"
107
108
  }
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.9.0
4
+ version: 0.9.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: 2023-09-07 00:00:00.000000000 Z
12
+ date: 2023-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionview