primer_view_components 0.0.92 → 0.0.93
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 +12 -0
- data/README.md +2 -2
- 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 -0
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/dialog/body.rb +25 -0
- data/app/components/primer/alpha/dialog/footer.rb +31 -0
- data/app/components/primer/alpha/dialog/header.html.erb +15 -0
- data/app/components/primer/alpha/dialog/header.rb +37 -0
- data/app/components/primer/alpha/dialog.html.erb +12 -0
- data/app/components/primer/alpha/dialog.rb +160 -0
- data/app/components/primer/alpha/modal-dialog-element.d.ts +1 -1
- data/app/components/primer/alpha/modal-dialog-element.js +2 -3
- data/app/components/primer/alpha/modal-dialog-element.ts +148 -0
- data/app/components/primer/alpha/toggle-switch-element.js +2 -0
- data/app/components/primer/alpha/toggle-switch-element.ts +2 -1
- data/app/components/primer/alpha/tool-tip-element.ts +0 -1
- data/app/components/primer/beta/button.html.erb +23 -0
- data/app/components/primer/beta/button.pcss +332 -0
- data/app/components/primer/beta/button.rb +189 -0
- data/app/components/primer/beta/icon_button.html.erb +6 -0
- data/app/components/primer/beta/icon_button.rb +104 -0
- data/app/components/primer/clipboard_copy_component.ts +1 -1
- data/app/components/primer/experimental/action-bar-element.d.ts +14 -0
- data/app/components/primer/experimental/action-bar-element.js +139 -0
- data/app/components/primer/experimental/action-menu-element.d.ts +31 -0
- data/app/components/primer/experimental/action-menu-element.js +334 -0
- data/app/components/primer/experimental/overflow-menu-element.d.ts +13 -0
- data/app/components/primer/experimental/overflow-menu-element.js +113 -0
- data/app/components/primer/primer.d.ts +1 -0
- data/app/components/primer/primer.js +1 -0
- data/app/components/primer/primer.pcss +1 -0
- data/app/components/primer/primer.ts +1 -0
- data/lib/postcss_mixins/focusBoxShadowInset.pcss +6 -0
- data/lib/postcss_mixins/focusOutline.pcss +5 -0
- data/lib/postcss_mixins/focusOutlineOnEmphasis.pcss +6 -0
- data/lib/postcss_mixins/minTouchTarget.js +20 -0
- data/lib/postcss_mixins/targetBoxShadow.pcss +6 -0
- data/lib/primer/view_components/linters/argument_mappers/base.rb +1 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/tasks/docs.rake +3 -8
- data/static/arguments.yml +113 -0
- data/static/audited_at.json +6 -0
- data/static/constants.json +107 -0
- data/static/statuses.json +6 -0
- metadata +25 -5
- data/app/components/primer/alpha/segmented-control-element.d.ts +0 -8
- data/app/components/primer/alpha/segmented-control-element.js +0 -28
- data/static/classes.yml +0 -230
@@ -0,0 +1,6 @@
|
|
1
|
+
/* outline with fg box-shadow for buttons */
|
2
|
+
@define-mixin focusOutlineOnEmphasis $outlineOffset: -2px, $outlineColor: var(--color-accent-fg) {
|
3
|
+
outline: 2px solid $outlineColor;
|
4
|
+
outline-offset: $outlineOffset;
|
5
|
+
box-shadow: inset 0 0 0 3px var(--color-fg-on-emphasis);
|
6
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module.exports = function (mixin, minHeight = '32px', minWidth = null) {
|
2
|
+
let declarations = {
|
3
|
+
position: 'absolute',
|
4
|
+
top: '50%',
|
5
|
+
left: '50%',
|
6
|
+
width: '100%',
|
7
|
+
height: '100%',
|
8
|
+
'min-height': minHeight,
|
9
|
+
content: '""',
|
10
|
+
transform: 'translateX(-50%) translateY(-50%)'
|
11
|
+
}
|
12
|
+
|
13
|
+
if (minWidth) {
|
14
|
+
declarations['min-width'] = minWidth
|
15
|
+
}
|
16
|
+
|
17
|
+
return {
|
18
|
+
'&': declarations
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/* box-shadow for :target styles (no inset) */
|
2
|
+
/* !important to override PCSS utilities */
|
3
|
+
@define-mixin targetBoxShadow $outlineWidth: 2px, $outlineColor: var(--color-accent-fg) {
|
4
|
+
outline: none !important;
|
5
|
+
box-shadow: 0 0 0 $outlineWidth $outlineColor !important;
|
6
|
+
}
|
@@ -75,7 +75,7 @@ module ERBLint
|
|
75
75
|
|
76
76
|
# Override this with your component's mappings, it should return a hash with the component's arguments,
|
77
77
|
# including a `classes` key that will contain all classes that the mapper couldn't handle.
|
78
|
-
# @
|
78
|
+
# @return { classes: Array, ... }
|
79
79
|
def classes_to_args(classes)
|
80
80
|
{ classes: classes }
|
81
81
|
end
|
data/lib/tasks/docs.rake
CHANGED
@@ -29,6 +29,8 @@ namespace :docs do
|
|
29
29
|
# Rails controller for rendering arbitrary ERB
|
30
30
|
view_context = ApplicationController.new.tap { |c| c.request = ActionDispatch::TestRequest.create }.view_context
|
31
31
|
components = [
|
32
|
+
Primer::Beta::IconButton,
|
33
|
+
Primer::Beta::Button,
|
32
34
|
Primer::Alpha::Layout,
|
33
35
|
Primer::HellipButton,
|
34
36
|
Primer::Image,
|
@@ -53,6 +55,7 @@ namespace :docs do
|
|
53
55
|
Primer::Beta::CloseButton,
|
54
56
|
Primer::Beta::Counter,
|
55
57
|
Primer::Beta::Details,
|
58
|
+
Primer::Alpha::Dialog,
|
56
59
|
Primer::Dropdown,
|
57
60
|
Primer::DropdownMenuComponent,
|
58
61
|
Primer::Beta::Flash,
|
@@ -107,7 +110,6 @@ namespace :docs do
|
|
107
110
|
components_needing_docs = all_components - components
|
108
111
|
|
109
112
|
args_for_components = []
|
110
|
-
classes_found_in_examples = []
|
111
113
|
|
112
114
|
errors = []
|
113
115
|
|
@@ -252,9 +254,6 @@ namespace :docs do
|
|
252
254
|
end
|
253
255
|
f.puts
|
254
256
|
html = view_context.render(inline: code)
|
255
|
-
html.scan(/class="([^"]*)"/) do |classnames|
|
256
|
-
classes_found_in_examples.concat(classnames[0].split.reject { |c| c.starts_with?("octicon", "js", "my-") }.map { ".#{_1}" })
|
257
|
-
end
|
258
257
|
f.puts("<Example src=\"#{html.tr('"', "\'").delete("\n")}\" />")
|
259
258
|
f.puts
|
260
259
|
f.puts("```erb")
|
@@ -276,10 +275,6 @@ namespace :docs do
|
|
276
275
|
raise
|
277
276
|
end
|
278
277
|
|
279
|
-
File.open("static/classes.yml", "w") do |f|
|
280
|
-
f.puts YAML.dump(classes_found_in_examples.sort.uniq)
|
281
|
-
end
|
282
|
-
|
283
278
|
File.open("static/arguments.yml", "w") do |f|
|
284
279
|
f.puts YAML.dump(args_for_components)
|
285
280
|
end
|
data/static/arguments.yml
CHANGED
@@ -22,6 +22,45 @@
|
|
22
22
|
type: Hash
|
23
23
|
default: N/A
|
24
24
|
description: "[System arguments](/system-arguments)"
|
25
|
+
- component: Dialog
|
26
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/dialog.rb
|
27
|
+
parameters:
|
28
|
+
- name: id
|
29
|
+
type: String
|
30
|
+
default: '`"dialog-#{(36**3 + rand(36**4)).to_s(36)}"`'
|
31
|
+
description: The id of the dialog.
|
32
|
+
- name: title
|
33
|
+
type: String
|
34
|
+
default: N/A
|
35
|
+
description: Describes the content of the dialog.
|
36
|
+
- name: subtitle
|
37
|
+
type: String
|
38
|
+
default: "`nil`"
|
39
|
+
description: Provides dditional context for the dialog, also setting the `aria-describedby`
|
40
|
+
attribute.
|
41
|
+
- name: size
|
42
|
+
type: Symbol
|
43
|
+
default: "`:medium`"
|
44
|
+
description: The size of the dialog. One of `:large`, `:medium`, `:medium_portrait`,
|
45
|
+
`:small`, or `:xlarge`.
|
46
|
+
- name: position
|
47
|
+
type: Symbol
|
48
|
+
default: "`:center`"
|
49
|
+
description: The size of the dialog. One of `:center`, `:left`, or `:right`.
|
50
|
+
- name: position_narrow
|
51
|
+
type: Symbol
|
52
|
+
default: "`:inherit`"
|
53
|
+
description: The size of the dialog. One of `:bottom`, `:fullscreen`, `:inherit`,
|
54
|
+
`:left`, or `:right`.
|
55
|
+
- name: visually_hide_title
|
56
|
+
type: Boolean
|
57
|
+
default: "`false`"
|
58
|
+
description: If true will hide the heading title, while still making it available
|
59
|
+
to Screen Readers.
|
60
|
+
- name: system_arguments
|
61
|
+
type: Hash
|
62
|
+
default: N/A
|
63
|
+
description: "[System arguments](/system-arguments)"
|
25
64
|
- component: HiddenTextExpander
|
26
65
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/hidden_text_expander.rb
|
27
66
|
parameters:
|
@@ -477,6 +516,38 @@
|
|
477
516
|
type: Hash
|
478
517
|
default: N/A
|
479
518
|
description: "[System arguments](/system-arguments)"
|
519
|
+
- component: Button
|
520
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/button.rb
|
521
|
+
parameters:
|
522
|
+
- name: scheme
|
523
|
+
type: Symbol
|
524
|
+
default: "`:default`"
|
525
|
+
description: One of `:danger`, `:default`, `:invisible`, `:link`, `:outline`,
|
526
|
+
`:primary`, or `:secondary`.
|
527
|
+
- name: size
|
528
|
+
type: Symbol
|
529
|
+
default: "`:medium`"
|
530
|
+
description: One of `:large`, `:medium`, or `:small`.
|
531
|
+
- name: full_width
|
532
|
+
type: Boolean
|
533
|
+
default: "`false`"
|
534
|
+
description: 'Whether button is full-width with `display: block`.'
|
535
|
+
- name: align_content
|
536
|
+
type: Symbol
|
537
|
+
default: "`:center`"
|
538
|
+
description: One of `:center` or `:start`.
|
539
|
+
- name: tag
|
540
|
+
type: Symbol
|
541
|
+
default: "`:button`"
|
542
|
+
description: One of `:a`, `:button`, or `:summary`.
|
543
|
+
- name: type
|
544
|
+
type: Symbol
|
545
|
+
default: "`:button`"
|
546
|
+
description: One of `:button`, `:reset`, or `:submit`.
|
547
|
+
- name: system_arguments
|
548
|
+
type: Hash
|
549
|
+
default: N/A
|
550
|
+
description: "[System arguments](/system-arguments)"
|
480
551
|
- component: ButtonGroup
|
481
552
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/button_group.rb
|
482
553
|
parameters:
|
@@ -591,6 +662,48 @@
|
|
591
662
|
type: Hash
|
592
663
|
default: N/A
|
593
664
|
description: "[System arguments](/system-arguments)"
|
665
|
+
- component: IconButton
|
666
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/icon_button.rb
|
667
|
+
parameters:
|
668
|
+
- name: icon
|
669
|
+
type: String
|
670
|
+
default: N/A
|
671
|
+
description: Name of [Octicon](https://primer.style/octicons/) to use.
|
672
|
+
- name: scheme
|
673
|
+
type: Symbol
|
674
|
+
default: "`:default`"
|
675
|
+
description: One of `:danger`, `:default`, or `:invisible`.
|
676
|
+
- name: size
|
677
|
+
type: Symbol
|
678
|
+
default: "`:medium`"
|
679
|
+
description: One of `:large`, `:medium`, or `:small`.
|
680
|
+
- name: tag
|
681
|
+
type: Symbol
|
682
|
+
default: N/A
|
683
|
+
description: One of `:a`, `:button`, or `:summary`.
|
684
|
+
- name: type
|
685
|
+
type: Symbol
|
686
|
+
default: N/A
|
687
|
+
description: One of `:button`, `:reset`, or `:submit`.
|
688
|
+
- name: aria-label
|
689
|
+
type: String
|
690
|
+
default: N/A
|
691
|
+
description: String that can be read by assistive technology. A label should be
|
692
|
+
short and concise. See the accessibility section for more information.
|
693
|
+
- name: aria-description
|
694
|
+
type: String
|
695
|
+
default: N/A
|
696
|
+
description: String that can be read by assistive technology. A description can
|
697
|
+
be longer as it is intended to provide more context and information. See the
|
698
|
+
accessibility section for more information.
|
699
|
+
- name: tooltip_direction
|
700
|
+
type: Symbol
|
701
|
+
default: "`:s`"
|
702
|
+
description: One of `:e`, `:n`, `:ne`, `:nw`, `:s`, `:se`, `:sw`, or `:w`.
|
703
|
+
- name: system_arguments
|
704
|
+
type: Hash
|
705
|
+
default: N/A
|
706
|
+
description: "[System arguments](/system-arguments)"
|
594
707
|
- component: Text
|
595
708
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/text.rb
|
596
709
|
parameters:
|
data/static/audited_at.json
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
"Primer::Alpha::AutoComplete": "",
|
3
3
|
"Primer::Alpha::AutoComplete::Item": "",
|
4
4
|
"Primer::Alpha::ButtonMarketing": "",
|
5
|
+
"Primer::Alpha::Dialog": "",
|
6
|
+
"Primer::Alpha::Dialog::Body": "",
|
7
|
+
"Primer::Alpha::Dialog::Footer": "",
|
8
|
+
"Primer::Alpha::Dialog::Header": "",
|
5
9
|
"Primer::Alpha::HiddenTextExpander": "",
|
6
10
|
"Primer::Alpha::Layout": "",
|
7
11
|
"Primer::Alpha::Layout::Main": "",
|
@@ -24,12 +28,14 @@
|
|
24
28
|
"Primer::Beta::BorderBox::Header": "",
|
25
29
|
"Primer::Beta::Breadcrumbs": "",
|
26
30
|
"Primer::Beta::Breadcrumbs::Item": "",
|
31
|
+
"Primer::Beta::Button": "",
|
27
32
|
"Primer::Beta::ButtonGroup": "",
|
28
33
|
"Primer::Beta::CloseButton": "",
|
29
34
|
"Primer::Beta::Counter": "",
|
30
35
|
"Primer::Beta::Details": "",
|
31
36
|
"Primer::Beta::Flash": "",
|
32
37
|
"Primer::Beta::Heading": "",
|
38
|
+
"Primer::Beta::IconButton": "",
|
33
39
|
"Primer::Beta::Text": "",
|
34
40
|
"Primer::Beta::Truncate": "",
|
35
41
|
"Primer::Beta::Truncate::TruncateText": "",
|
data/static/constants.json
CHANGED
@@ -38,6 +38,58 @@
|
|
38
38
|
"large"
|
39
39
|
]
|
40
40
|
},
|
41
|
+
"Primer::Alpha::Dialog": {
|
42
|
+
"Body": "Primer::Alpha::Dialog::Body",
|
43
|
+
"DEFAULT_POSITION": "center",
|
44
|
+
"DEFAULT_POSITION_NARROW": "inherit",
|
45
|
+
"DEFAULT_SIZE": "medium",
|
46
|
+
"Footer": "Primer::Alpha::Dialog::Footer",
|
47
|
+
"Header": "Primer::Alpha::Dialog::Header",
|
48
|
+
"POSITION_MAPPINGS": {
|
49
|
+
"center": "Overlay-backdrop--center",
|
50
|
+
"left": "Overlay-backdrop--side Overlay-backdrop--placement-left",
|
51
|
+
"right": "Overlay-backdrop--side Overlay-backdrop--placement-right"
|
52
|
+
},
|
53
|
+
"POSITION_NARROW_MAPPINGS": {
|
54
|
+
"inherit": "",
|
55
|
+
"bottom": "Overlay-backdrop--side-whenNarrow Overlay-backdrop--placement-bottom-whenNarrow",
|
56
|
+
"fullscreen": "Overlay-backdrop--full-whenNarrow",
|
57
|
+
"left": "Overlay-backdrop--side-whenNarrow Overlay-backdrop--placement-left-whenNarrow",
|
58
|
+
"right": "Overlay-backdrop--side-whenNarrow Overlay-backdrop--placement-right-whenNarrow"
|
59
|
+
},
|
60
|
+
"POSITION_NARROW_OPTIONS": [
|
61
|
+
"inherit",
|
62
|
+
"bottom",
|
63
|
+
"fullscreen",
|
64
|
+
"left",
|
65
|
+
"right"
|
66
|
+
],
|
67
|
+
"POSITION_OPTIONS": [
|
68
|
+
"center",
|
69
|
+
"left",
|
70
|
+
"right"
|
71
|
+
],
|
72
|
+
"SIZE_MAPPINGS": {
|
73
|
+
"small": "Overlay--size-small-portrait",
|
74
|
+
"medium_portrait": "Overlay--size-medium-portrait",
|
75
|
+
"medium": "Overlay--size-medium",
|
76
|
+
"large": "Overlay--size-large",
|
77
|
+
"xlarge": "Overlay--size-xlarge"
|
78
|
+
},
|
79
|
+
"SIZE_OPTIONS": [
|
80
|
+
"small",
|
81
|
+
"medium_portrait",
|
82
|
+
"medium",
|
83
|
+
"large",
|
84
|
+
"xlarge"
|
85
|
+
]
|
86
|
+
},
|
87
|
+
"Primer::Alpha::Dialog::Body": {
|
88
|
+
},
|
89
|
+
"Primer::Alpha::Dialog::Footer": {
|
90
|
+
},
|
91
|
+
"Primer::Alpha::Dialog::Header": {
|
92
|
+
},
|
41
93
|
"Primer::Alpha::HiddenTextExpander": {
|
42
94
|
},
|
43
95
|
"Primer::Alpha::Layout": {
|
@@ -320,6 +372,48 @@
|
|
320
372
|
},
|
321
373
|
"Primer::Beta::Breadcrumbs::Item": {
|
322
374
|
},
|
375
|
+
"Primer::Beta::Button": {
|
376
|
+
"ALIGN_CONTENT_MAPPINGS": {
|
377
|
+
"start": "Button-content--alignStart",
|
378
|
+
"center": ""
|
379
|
+
},
|
380
|
+
"ALIGN_CONTENT_OPTIONS": [
|
381
|
+
"start",
|
382
|
+
"center"
|
383
|
+
],
|
384
|
+
"DEFAULT_ALIGN_CONTENT": "center",
|
385
|
+
"DEFAULT_SCHEME": "default",
|
386
|
+
"DEFAULT_SIZE": "medium",
|
387
|
+
"LINK_SCHEME": "link",
|
388
|
+
"SCHEME_MAPPINGS": {
|
389
|
+
"default": "Button--secondary",
|
390
|
+
"primary": "Button--primary",
|
391
|
+
"secondary": "Button--secondary",
|
392
|
+
"danger": "Button--danger",
|
393
|
+
"outline": "btn-outline",
|
394
|
+
"invisible": "Button--invisible",
|
395
|
+
"link": "btn-link"
|
396
|
+
},
|
397
|
+
"SCHEME_OPTIONS": [
|
398
|
+
"default",
|
399
|
+
"primary",
|
400
|
+
"secondary",
|
401
|
+
"danger",
|
402
|
+
"outline",
|
403
|
+
"invisible",
|
404
|
+
"link"
|
405
|
+
],
|
406
|
+
"SIZE_MAPPINGS": {
|
407
|
+
"small": "Button--small",
|
408
|
+
"medium": "Button--medium",
|
409
|
+
"large": "Button--large"
|
410
|
+
},
|
411
|
+
"SIZE_OPTIONS": [
|
412
|
+
"small",
|
413
|
+
"medium",
|
414
|
+
"large"
|
415
|
+
]
|
416
|
+
},
|
323
417
|
"Primer::Beta::ButtonGroup": {
|
324
418
|
},
|
325
419
|
"Primer::Beta::CloseButton": {
|
@@ -383,6 +477,19 @@
|
|
383
477
|
"h6"
|
384
478
|
]
|
385
479
|
},
|
480
|
+
"Primer::Beta::IconButton": {
|
481
|
+
"DEFAULT_SCHEME": "default",
|
482
|
+
"SCHEME_MAPPINGS": {
|
483
|
+
"default": "Button--secondary",
|
484
|
+
"danger": "Button--danger",
|
485
|
+
"invisible": "Button--invisible"
|
486
|
+
},
|
487
|
+
"SCHEME_OPTIONS": [
|
488
|
+
"default",
|
489
|
+
"danger",
|
490
|
+
"invisible"
|
491
|
+
]
|
492
|
+
},
|
386
493
|
"Primer::Beta::Text": {
|
387
494
|
"DEFAULT_TAG": "span"
|
388
495
|
},
|
data/static/statuses.json
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
"Primer::Alpha::AutoComplete": "deprecated",
|
3
3
|
"Primer::Alpha::AutoComplete::Item": "deprecated",
|
4
4
|
"Primer::Alpha::ButtonMarketing": "alpha",
|
5
|
+
"Primer::Alpha::Dialog": "alpha",
|
6
|
+
"Primer::Alpha::Dialog::Body": "alpha",
|
7
|
+
"Primer::Alpha::Dialog::Footer": "alpha",
|
8
|
+
"Primer::Alpha::Dialog::Header": "alpha",
|
5
9
|
"Primer::Alpha::HiddenTextExpander": "alpha",
|
6
10
|
"Primer::Alpha::Layout": "alpha",
|
7
11
|
"Primer::Alpha::Layout::Main": "alpha",
|
@@ -24,12 +28,14 @@
|
|
24
28
|
"Primer::Beta::BorderBox::Header": "beta",
|
25
29
|
"Primer::Beta::Breadcrumbs": "beta",
|
26
30
|
"Primer::Beta::Breadcrumbs::Item": "alpha",
|
31
|
+
"Primer::Beta::Button": "beta",
|
27
32
|
"Primer::Beta::ButtonGroup": "beta",
|
28
33
|
"Primer::Beta::CloseButton": "beta",
|
29
34
|
"Primer::Beta::Counter": "beta",
|
30
35
|
"Primer::Beta::Details": "beta",
|
31
36
|
"Primer::Beta::Flash": "beta",
|
32
37
|
"Primer::Beta::Heading": "beta",
|
38
|
+
"Primer::Beta::IconButton": "beta",
|
33
39
|
"Primer::Beta::Text": "beta",
|
34
40
|
"Primer::Beta::Truncate": "beta",
|
35
41
|
"Primer::Beta::Truncate::TruncateText": "alpha",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: primer_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.93
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -412,13 +412,18 @@ files:
|
|
412
412
|
- app/components/primer/alpha/auto_complete/auto_complete.html.erb
|
413
413
|
- app/components/primer/alpha/auto_complete/item.rb
|
414
414
|
- app/components/primer/alpha/button_marketing.rb
|
415
|
+
- app/components/primer/alpha/dialog.html.erb
|
416
|
+
- app/components/primer/alpha/dialog.rb
|
417
|
+
- app/components/primer/alpha/dialog/body.rb
|
418
|
+
- app/components/primer/alpha/dialog/footer.rb
|
419
|
+
- app/components/primer/alpha/dialog/header.html.erb
|
420
|
+
- app/components/primer/alpha/dialog/header.rb
|
415
421
|
- app/components/primer/alpha/hidden_text_expander.rb
|
416
422
|
- app/components/primer/alpha/layout.html.erb
|
417
423
|
- app/components/primer/alpha/layout.rb
|
418
424
|
- app/components/primer/alpha/modal-dialog-element.d.ts
|
419
425
|
- app/components/primer/alpha/modal-dialog-element.js
|
420
|
-
- app/components/primer/alpha/
|
421
|
-
- app/components/primer/alpha/segmented-control-element.js
|
426
|
+
- app/components/primer/alpha/modal-dialog-element.ts
|
422
427
|
- app/components/primer/alpha/tab_nav.html.erb
|
423
428
|
- app/components/primer/alpha/tab_nav.rb
|
424
429
|
- app/components/primer/alpha/tab_panels.html.erb
|
@@ -457,6 +462,9 @@ files:
|
|
457
462
|
- app/components/primer/beta/border_box/header.rb
|
458
463
|
- app/components/primer/beta/breadcrumbs.html.erb
|
459
464
|
- app/components/primer/beta/breadcrumbs.rb
|
465
|
+
- app/components/primer/beta/button.html.erb
|
466
|
+
- app/components/primer/beta/button.pcss
|
467
|
+
- app/components/primer/beta/button.rb
|
460
468
|
- app/components/primer/beta/button_group.html.erb
|
461
469
|
- app/components/primer/beta/button_group.rb
|
462
470
|
- app/components/primer/beta/close_button.rb
|
@@ -466,6 +474,8 @@ files:
|
|
466
474
|
- app/components/primer/beta/flash.html.erb
|
467
475
|
- app/components/primer/beta/flash.rb
|
468
476
|
- app/components/primer/beta/heading.rb
|
477
|
+
- app/components/primer/beta/icon_button.html.erb
|
478
|
+
- app/components/primer/beta/icon_button.rb
|
469
479
|
- app/components/primer/beta/text.rb
|
470
480
|
- app/components/primer/beta/truncate.html.erb
|
471
481
|
- app/components/primer/beta/truncate.rb
|
@@ -498,6 +508,12 @@ files:
|
|
498
508
|
- app/components/primer/dropdown/menu.ts
|
499
509
|
- app/components/primer/dropdown_menu_component.html.erb
|
500
510
|
- app/components/primer/dropdown_menu_component.rb
|
511
|
+
- app/components/primer/experimental/action-bar-element.d.ts
|
512
|
+
- app/components/primer/experimental/action-bar-element.js
|
513
|
+
- app/components/primer/experimental/action-menu-element.d.ts
|
514
|
+
- app/components/primer/experimental/action-menu-element.js
|
515
|
+
- app/components/primer/experimental/overflow-menu-element.d.ts
|
516
|
+
- app/components/primer/experimental/overflow-menu-element.js
|
501
517
|
- app/components/primer/flex_component.rb
|
502
518
|
- app/components/primer/flex_item_component.rb
|
503
519
|
- app/components/primer/heading_component.rb
|
@@ -565,6 +581,11 @@ files:
|
|
565
581
|
- app/lib/primer/test_selector_helper.rb
|
566
582
|
- app/lib/primer/underline_nav_helper.rb
|
567
583
|
- app/lib/primer/view_helper.rb
|
584
|
+
- lib/postcss_mixins/focusBoxShadowInset.pcss
|
585
|
+
- lib/postcss_mixins/focusOutline.pcss
|
586
|
+
- lib/postcss_mixins/focusOutlineOnEmphasis.pcss
|
587
|
+
- lib/postcss_mixins/minTouchTarget.js
|
588
|
+
- lib/postcss_mixins/targetBoxShadow.pcss
|
568
589
|
- lib/primer/classify.rb
|
569
590
|
- lib/primer/classify/utilities.rb
|
570
591
|
- lib/primer/classify/utilities.yml
|
@@ -686,7 +707,6 @@ files:
|
|
686
707
|
- static/arguments.yml
|
687
708
|
- static/assets/view-components.svg
|
688
709
|
- static/audited_at.json
|
689
|
-
- static/classes.yml
|
690
710
|
- static/constants.json
|
691
711
|
- static/statuses.json
|
692
712
|
homepage: https://github.com/primer/view_components
|
@@ -1,28 +0,0 @@
|
|
1
|
-
/* eslint-disable custom-elements/no-constructor */
|
2
|
-
export default class SegmentedControlElement extends HTMLElement {
|
3
|
-
constructor() {
|
4
|
-
super();
|
5
|
-
this.addEventListener('click', (event) => {
|
6
|
-
var _a, _b;
|
7
|
-
const controls = Array.from(this.querySelectorAll('ul button')).filter(tab => tab instanceof HTMLElement && tab.closest(this.tagName) === this);
|
8
|
-
if (!(event.target instanceof Element))
|
9
|
-
return;
|
10
|
-
if (event.target.closest(this.tagName) !== this)
|
11
|
-
return;
|
12
|
-
const selectedControl = event.target.closest('button');
|
13
|
-
if (!(selectedControl instanceof HTMLElement) || !selectedControl.closest('ul'))
|
14
|
-
return;
|
15
|
-
for (const control of controls) {
|
16
|
-
(_a = control.closest('li')) === null || _a === void 0 ? void 0 : _a.classList.remove('SegmentedControl-item--selected');
|
17
|
-
control.setAttribute('aria-current', 'false');
|
18
|
-
}
|
19
|
-
(_b = selectedControl.closest('li')) === null || _b === void 0 ? void 0 : _b.classList.add('SegmentedControl-item--selected');
|
20
|
-
selectedControl.setAttribute('aria-current', 'true');
|
21
|
-
selectedControl.focus();
|
22
|
-
});
|
23
|
-
}
|
24
|
-
}
|
25
|
-
if (!window.customElements.get('segmented-control')) {
|
26
|
-
window.SegmentedControlElement = SegmentedControlElement;
|
27
|
-
window.customElements.define('segmented-control', SegmentedControlElement);
|
28
|
-
}
|