Skip to content

Commit 5340243

Browse files
authored
Remove large size options from SegmentedControl (primer#2551)
1 parent 1d20198 commit 5340243

File tree

14 files changed

+7
-74
lines changed

14 files changed

+7
-74
lines changed

.changeset/red-parrots-tap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/view-components": minor
3+
---
4+
5+
Remove large size options from SegmentedControl

app/components/primer/alpha/segmented_control.pcss

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,6 @@
5050
}
5151
}
5252

53-
.SegmentedControl--large {
54-
& .SegmentedControl-item {
55-
height: var(--control-large-size);
56-
57-
& .Button {
58-
padding-inline: calc(var(--control-large-paddingInline-normal) - var(--segmentedControl-item-padding));
59-
}
60-
}
61-
62-
&.SegmentedControl--iconOnly {
63-
& .SegmentedControl-item {
64-
width: var(--control-large-size);
65-
}
66-
}
67-
}
68-
6953
/* item */
7054

7155
.SegmentedControl-item {

app/components/primer/alpha/segmented_control.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class SegmentedControl < Primer::Component
1717
SIZE_MAPPINGS = {
1818
:small => "SegmentedControl--small",
1919
:medium => "SegmentedControl--medium",
20-
:large => "SegmentedControl--large",
2120
DEFAULT_SIZE => "SegmentedControl--medium"
2221
}.freeze
2322
SIZE_OPTIONS = SIZE_MAPPINGS.keys

previews/primer/alpha/segmented_control_preview.rb

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class SegmentedControlPreview < ViewComponent::Preview
1111
# @param full_width [Boolean] toggle
1212
# @param hide_labels [Boolean] toggle
1313
# @param icon [Symbol] octicon
14-
# @param size select [small, medium, large]
14+
# @param size select [small, medium]
1515
def playground(full_width: false, hide_labels: false, size: :medium, icon: :none)
1616
if icon == :none
1717
icon = hide_labels ? :zap : nil
@@ -55,17 +55,6 @@ def full_width_medium(hide_labels: false)
5555
component.with_item(label: "Blame")
5656
end
5757
end
58-
59-
# @label Size large
60-
# @param hide_labels [Boolean] toggle
61-
# @snapshot
62-
def full_width_large(hide_labels: false)
63-
render(Primer::Alpha::SegmentedControl.new("aria-label": "File view", hide_labels: hide_labels, full_width: true, size: :large)) do |component|
64-
component.with_item(label: "Preview", selected: true)
65-
component.with_item(label: "Raw")
66-
component.with_item(label: "Blame")
67-
end
68-
end
6958
# @!endgroup
7059

7160
# @!group Icons and text
@@ -88,16 +77,6 @@ def icons_and_text_medium
8877
component.with_item(label: "Blame", icon: :people)
8978
end
9079
end
91-
92-
# @label Size large
93-
# @snapshot
94-
def icons_and_text_large
95-
render(Primer::Alpha::SegmentedControl.new("aria-label": "File view", size: :large)) do |component|
96-
component.with_item(label: "Preview", icon: :eye, selected: true)
97-
component.with_item(label: "Raw", icon: :"file-code")
98-
component.with_item(label: "Blame", icon: :people)
99-
end
100-
end
10180
# @!endgroup
10281

10382
# @!group Trailing Label
@@ -122,17 +101,6 @@ def trailing_label_width_medium
122101
end
123102
end
124103
end
125-
126-
# @label Size large
127-
# @snapshot
128-
def trailing_label_width_large
129-
render(Primer::Alpha::SegmentedControl.new("aria-label": "Billing duration", size: :large)) do |component|
130-
component.with_item(label: "Monthly")
131-
component.with_item(label: "Yearly", selected: true) do |button|
132-
button.with_trailing_visual_label(scheme: :accent) { "-8%" }
133-
end
134-
end
135-
end
136104
# @!endgroup
137105

138106
# @!group Icons only
@@ -156,16 +124,6 @@ def icon_only_medium
156124
end
157125
end
158126

159-
# @label Size large
160-
# @snapshot
161-
def icon_only_large
162-
render(Primer::Alpha::SegmentedControl.new("aria-label": "File view", hide_labels: true, size: :large)) do |component|
163-
component.with_item(label: "Preview", icon: :eye, selected: true)
164-
component.with_item(label: "Raw", icon: :"file-code")
165-
component.with_item(label: "Blame", icon: :people)
166-
end
167-
end
168-
169127
# @label Full width, size small
170128
def icon_only_full_width_small
171129
render(Primer::Alpha::SegmentedControl.new("aria-label": "File view", hide_labels: true, full_width: true, size: :small)) do |component|
@@ -183,15 +141,6 @@ def icon_only_full_width_medium
183141
component.with_item(label: "Blame", icon: :people)
184142
end
185143
end
186-
187-
# @label Full width, size large
188-
def icon_only_full_width_large
189-
render(Primer::Alpha::SegmentedControl.new("aria-label": "File view", hide_labels: true, full_width: true, size: :large)) do |component|
190-
component.with_item(label: "Preview", icon: :eye, selected: true)
191-
component.with_item(label: "Raw", icon: :"file-code")
192-
component.with_item(label: "Blame", icon: :people)
193-
end
194-
end
195144
# @!endgroup
196145

197146
# NOTE: this preview uses a group to force it's display below the other groups

static/classes.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,6 @@
468468
"SegmentedControl--iconOnly": [
469469
"Primer::Alpha::SegmentedControl"
470470
],
471-
"SegmentedControl--large": [
472-
"Primer::Alpha::SegmentedControl"
473-
],
474471
"SegmentedControl--medium": [
475472
"Primer::Alpha::SegmentedControl"
476473
],

static/constants.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,7 @@
565565
"Item": "Primer::Alpha::SegmentedControl::Item",
566566
"SIZE_MAPPINGS": {
567567
"small": "SegmentedControl--small",
568-
"medium": "SegmentedControl--medium",
569-
"large": "SegmentedControl--large"
568+
"medium": "SegmentedControl--medium"
570569
},
571570
"SIZE_OPTIONS": [
572571
"small",

0 commit comments

Comments
 (0)