@rolemodel/optics 2.1.4 → 2.2.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.
@@ -1,6 +1,6 @@
1
- ## Task
1
+ # Task
2
2
 
3
- [TR #XXX]()
3
+ [OP-XXX](link to ticket)
4
4
 
5
5
  ## Why?
6
6
 
@@ -15,15 +15,24 @@ What changed in this PR?
15
15
  - [ ] Change 2
16
16
  - [ ] ...
17
17
 
18
- ## Sanity Check
18
+ ## Quality Assurance
19
19
 
20
+ Add an X to all that apply like this: [X]
21
+ Cross out all that don't apply with ~~ ~~ around it like ~~this~~
22
+
23
+ - [ ] Have you tagged the PR with the correct labels?
24
+ - [ ] Have you validated the changes?
25
+ - [ ] Have you run linters? (yarn sanity-check)
26
+ - [ ] Have you run prettier?
27
+ - [ ] Have you tried building the css?
28
+ - [ ] Have you tried building storybook?
20
29
  - [ ] Have you updated any usage of changed tokens?
21
- - [ ] Have you updated the docs with any component changes?
22
- - [ ] Have you updated the dependency graph with any component changes?
23
- - [ ] Have you run linters?
24
- - [ ] Have you run prettier?
25
- - [ ] Have you tried building the css?
26
- - [ ] Have you tried building storybook?
30
+ - [ ] Did you add a component?
31
+ - [ ] Have you added it to the dependency graph?
32
+ - [ ] Have you added it to the docs?
33
+ - [ ] Did you update a component?
34
+ - [ ] Have you updated the dependency graph?
35
+ - [ ] Have you updated the docs?
27
36
  - [ ] Do you need to update the package version?
28
37
 
29
38
  ## Screenshots
@@ -18,7 +18,7 @@ jobs:
18
18
  - name: Use Node.js
19
19
  uses: actions/setup-node@v3
20
20
  with:
21
- node-version: '18.x'
21
+ node-version: '24.x'
22
22
  cache: 'npm'
23
23
  - name: Install
24
24
  run: yarn install
@@ -16,7 +16,7 @@ jobs:
16
16
  - name: Setup Node
17
17
  uses: actions/setup-node@v3
18
18
  with:
19
- node-version: '18.x'
19
+ node-version: '24.x'
20
20
  registry-url: 'https://registry.npmjs.org'
21
21
  - name: Install 🔧
22
22
  run: | # Install npm packages
@@ -11,7 +11,7 @@ jobs:
11
11
  - uses: actions/checkout@v3
12
12
  - uses: actions/setup-node@v3
13
13
  with:
14
- node-version: '18.x'
14
+ node-version: '24.x'
15
15
  registry-url: 'https://registry.npmjs.org'
16
16
  - run: yarn install --immutable
17
17
  - run: yarn build
@@ -24,7 +24,7 @@ jobs:
24
24
  - uses: actions/checkout@v3
25
25
  - uses: actions/setup-node@v3
26
26
  with:
27
- node-version: '18.x'
27
+ node-version: '24.x'
28
28
  registry-url: https://npm.pkg.github.com/
29
29
  - run: yarn install --immutable
30
30
  - run: yarn build
package/.node-version ADDED
@@ -0,0 +1 @@
1
+ 22.14.0
package/.prettierignore CHANGED
@@ -1,3 +1,4 @@
1
1
  # Tools
2
2
  tools/templates
3
3
  .yarn/*
4
+ optics-design-system.code-workspace
Binary file
package/README.md CHANGED
@@ -28,18 +28,36 @@ npm install @rolemodel/optics
28
28
  yarn add @rolemodel/optics
29
29
  ```
30
30
 
31
- ### Import
31
+ ### Importing with a compiler
32
32
 
33
33
  You can add this import to the top of your root level `css` file.
34
34
 
35
35
  ```css
36
36
  @import '@rolemodel/optics'; /* Using webpack to compile */
37
37
  /* Or */
38
- @import '@rolemodel/optics/dist/css/optics'; /* Using a different compiler or no compiler */
38
+ @import '@rolemodel/optics/dist/css/optics'; /* Using a different compiler */
39
39
  /* Or */
40
40
  @import '@rolemodel/optics/dist/css/optics.min.css'; /* If you want a single file with all the styles in it. */
41
41
  ```
42
42
 
43
+ ### Importing without a compiler
44
+
45
+ To use Optics without compilation, use a CDN like [jsDelivr](https://www.jsdelivr.com/) or [unpkg](https://unpkg.com/).
46
+ Add a link in your HTML head or an `@import` to the top of your root level `css` file.
47
+
48
+ ```html
49
+ <link
50
+ rel="stylesheet"
51
+ href="https://cdn.jsdelivr.net/npm/@rolemodel/optics@[desired version]/dist/css/optics.min.css"
52
+ />
53
+ ```
54
+
55
+ ```css
56
+ @import 'https://cdn.jsdelivr.net/npm/@rolemodel/optics@[desired version]/dist/css/optics.min.css';
57
+ ```
58
+
59
+ Note: You can use this method to use Optics with [CodePen](https://codepen.io/). In a CodePen project, go to `Settings > CSS`, find the section for adding external stylesheets, and add the CDN link as a resource.
60
+
43
61
  ## Documentation
44
62
 
45
63
  We use [Storybook](https://storybook.js.org/docs/html/get-started/introduction) as a way to provide informative and interactive documentation.
package/dist/README.md CHANGED
@@ -28,18 +28,36 @@ npm install @rolemodel/optics
28
28
  yarn add @rolemodel/optics
29
29
  ```
30
30
 
31
- ### Import
31
+ ### Importing with a compiler
32
32
 
33
33
  You can add this import to the top of your root level `css` file.
34
34
 
35
35
  ```css
36
36
  @import '@rolemodel/optics'; /* Using webpack to compile */
37
37
  /* Or */
38
- @import '@rolemodel/optics/dist/css/optics'; /* Using a different compiler or no compiler */
38
+ @import '@rolemodel/optics/dist/css/optics'; /* Using a different compiler */
39
39
  /* Or */
40
40
  @import '@rolemodel/optics/dist/css/optics.min.css'; /* If you want a single file with all the styles in it. */
41
41
  ```
42
42
 
43
+ ### Importing without a compiler
44
+
45
+ To use Optics without compilation, use a CDN like [jsDelivr](https://www.jsdelivr.com/) or [unpkg](https://unpkg.com/).
46
+ Add a link in your HTML head or an `@import` to the top of your root level `css` file.
47
+
48
+ ```html
49
+ <link
50
+ rel="stylesheet"
51
+ href="https://cdn.jsdelivr.net/npm/@rolemodel/optics@[desired version]/dist/css/optics.min.css"
52
+ />
53
+ ```
54
+
55
+ ```css
56
+ @import 'https://cdn.jsdelivr.net/npm/@rolemodel/optics@[desired version]/dist/css/optics.min.css';
57
+ ```
58
+
59
+ Note: You can use this method to use Optics with [CodePen](https://codepen.io/). In a CodePen project, go to `Settings > CSS`, find the section for adding external stylesheets, and add the CDN link as a resource.
60
+
43
61
  ## Documentation
44
62
 
45
63
  We use [Storybook](https://storybook.js.org/docs/html/get-started/introduction) as a way to provide informative and interactive documentation.
@@ -0,0 +1,38 @@
1
+ .content-header {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+ justify-content: space-between;
5
+ gap: var(--op-space-medium);
6
+ padding-block: var(--op-space-medium);
7
+
8
+ .content-header__details {
9
+ display: grid;
10
+ gap: var(--op-space-3x-small);
11
+ }
12
+
13
+ .content-header__context {
14
+ color: var(--op-color-on-background-alt);
15
+ font-size: var(--op-font-small);
16
+ }
17
+
18
+ .content-header__title {
19
+ margin: 0;
20
+ color: var(--op-color-on-background);
21
+ font-size: var(--op-font-2x-large);
22
+ font-weight: var(--op-font-weight-medium);
23
+ }
24
+
25
+ .content-header__subline {
26
+ color: var(--op-color-on-background-alt);
27
+ font-size: var(--op-font-medium);
28
+ }
29
+
30
+ .content-header__aside {
31
+ display: flex;
32
+ flex-wrap: wrap;
33
+ align-items: start;
34
+ justify-content: end;
35
+ gap: var(--op-space-2x-small);
36
+ margin-inline-start: auto;
37
+ }
38
+ }
@@ -259,7 +259,8 @@ textarea.form-control:not([type='radio'], [type='checkbox']) {
259
259
  .form-label,
260
260
  .form-error,
261
261
  .form-hint,
262
- .form-control:not([type='radio'], [type='checkbox']) {
262
+ .form-control:not([type='radio'], [type='checkbox']),
263
+ .segmented-control {
263
264
  grid-column: 1 / 3;
264
265
  }
265
266
  /* stylelint-enable no-descending-specificity */
@@ -7,12 +7,14 @@
7
7
  @import 'button_group';
8
8
  @import 'card';
9
9
  @import 'confirm-dialog';
10
+ @import 'content-header';
10
11
  @import 'divider';
11
12
  @import 'form';
12
13
  @import 'icon';
13
14
  @import 'modal';
14
15
  @import 'navbar';
15
16
  @import 'pagination';
17
+ @import 'segmented-control';
16
18
  @import 'sidebar';
17
19
  @import 'side_panel';
18
20
  @import 'spinner';
@@ -0,0 +1,135 @@
1
+ .segmented-control {
2
+ --op-input-inner-focus: 0 0 0 var(--op-border-width-large);
3
+ --op-input-focus-primary:
4
+ var(--op-input-inner-focus) var(--op-color-primary-plus-two),
5
+ var(--op-input-outer-focus) var(--op-color-primary-plus-five);
6
+
7
+ /* Public API (customizable component options) */
8
+ --_op-segmented-control-height-small: var(--op-input-height-small);
9
+ --_op-segmented-control-height-medium: var(--op-input-height-medium);
10
+ --_op-segmented-control-height-large: var(--op-input-height-large);
11
+
12
+ --_op-segmented-control-font-small: var(--op-font-x-small);
13
+ --_op-segmented-control-font-medium: var(--op-font-small);
14
+ --_op-segmented-control-font-large: var(--op-font-small);
15
+
16
+ --_op-segmented-control-label-padding-small: var(--op-space-x-small);
17
+ --_op-segmented-control-label-padding-medium: var(--op-space-small);
18
+ --_op-segmented-control-label-padding-large: var(--op-space-small);
19
+
20
+ --_op-segmented-control-label-gap-small: var(--op-space-3x-small);
21
+ --_op-segmented-control-label-gap-medium: var(--op-space-2x-small);
22
+ --_op-segmented-control-label-gap-large: var(--op-space-2x-small);
23
+
24
+ --_op-segmented-control-color-icon-default: var(--op-color-neutral-on-plus-eight-alt);
25
+ --_op-segmented-control-color-icon-active: light-dark(
26
+ var(--op-color-primary-plus-four),
27
+ var(--op-color-primary-minus-six)
28
+ );
29
+
30
+ /* Private API (component option defaults) */
31
+ --__op-segmented-control-height: var(--_op-segmented-control-height-large);
32
+ --__op-segmented-control-font-size: var(--_op-segmented-control-font-large);
33
+ --__op-segmented-control-label-padding: var(--_op-segmented-control-label-padding-large);
34
+ --__op-segmented-control-label-gap: var(--_op-segmented-control-label-gap-large);
35
+ --__op-segmented-control-color-icon: var(--_op-segmented-control-color-icon-default);
36
+
37
+ position: relative;
38
+ display: grid;
39
+ width: fit-content;
40
+ height: var(--__op-segmented-control-height);
41
+ padding: var(--op-space-2x-small);
42
+ border-radius: var(--op-radius-medium);
43
+ background-color: var(--op-color-neutral-plus-eight);
44
+ box-shadow: var(--op-border-all) var(--op-color-border);
45
+ color: var(--op-color-neutral-on-plus-eight);
46
+ font-size: var(--__op-segmented-control-font-size);
47
+ gap: var(--op-space-2x-small);
48
+ grid-auto-flow: column;
49
+
50
+ &.segmented-control--full-width {
51
+ width: 100%;
52
+ }
53
+
54
+ .icon {
55
+ color: var(--__op-segmented-control-color-icon);
56
+ }
57
+
58
+ .segmented-control__input {
59
+ position: absolute;
60
+ overflow: hidden;
61
+ width: 1px;
62
+ height: 1px;
63
+ padding: 0;
64
+ border-width: 0;
65
+ margin: -1px;
66
+ clip: rect(0, 0, 0, 0);
67
+ white-space: nowrap;
68
+
69
+ /* Selected Option */
70
+ &:checked + .segmented-control__label {
71
+ --__op-segmented-control-color-icon: var(--_op-segmented-control-color-icon-active);
72
+
73
+ background-color: var(--op-color-primary-plus-one);
74
+ color: var(--op-color-primary-on-plus-one);
75
+ }
76
+
77
+ &:focus-visible {
78
+ + .segmented-control__label {
79
+ box-shadow: var(--op-input-focus-primary);
80
+ }
81
+ }
82
+ }
83
+
84
+ .segmented-control__label {
85
+ display: inline-flex;
86
+ align-items: center;
87
+ justify-content: center;
88
+ border-radius: var(--op-radius-small);
89
+ gap: var(--__op-segmented-control-label-gap);
90
+ padding-inline: var(--__op-segmented-control-label-padding);
91
+ white-space: nowrap;
92
+
93
+ &:hover {
94
+ background-color: var(--op-color-neutral-plus-five);
95
+ color: var(--op-color-neutral-on-plus-five);
96
+ }
97
+ }
98
+
99
+ /* Size Modifiers */
100
+ &.segmented-control--small {
101
+ --__op-segmented-control-height: var(--_op-segmented-control-height-small);
102
+ --__op-segmented-control-font-size: var(--_op-segmented-control-font-small);
103
+ --__op-segmented-control-label-padding: var(--_op-segmented-control-label-padding-small);
104
+ --__op-segmented-control-label-gap: var(--_op-segmented-control-label-gap-small);
105
+
106
+ .icon {
107
+ --__op-icon-font-size: var(--_op-icon-font-size-small);
108
+ --__op-icon-optical-size: var(--_op-icon-optical-size-small);
109
+ }
110
+ }
111
+
112
+ &.segmented-control--medium {
113
+ --__op-segmented-control-height: var(--_op-segmented-control-height-medium);
114
+ --__op-segmented-control-font-size: var(--_op-segmented-control-font-medium);
115
+ --__op-segmented-control-label-padding: var(--_op-segmented-control-label-padding-medium);
116
+ --__op-segmented-control-label-gap: var(--_op-segmented-control-label-gap-medium);
117
+
118
+ .icon {
119
+ --__op-icon-font-size: var(--_op-icon-font-size-medium);
120
+ --__op-icon-optical-size: var(--_op-icon-optical-size-medium);
121
+ }
122
+ }
123
+
124
+ &.segmented-control--large {
125
+ --__op-segmented-control-height: var(--_op-segmented-control-height-large);
126
+ --__op-segmented-control-font-size: var(--_op-segmented-control-font-large);
127
+ --__op-segmented-control-label-padding: var(--_op-segmented-control-label-padding-large);
128
+ --__op-segmented-control-label-gap: var(--_op-segmented-control-label-gap-large);
129
+
130
+ .icon {
131
+ --__op-icon-font-size: var(--_op-icon-font-size-medium);
132
+ --__op-icon-optical-size: var(--_op-icon-optical-size-medium);
133
+ }
134
+ }
135
+ }
@@ -297,17 +297,23 @@
297
297
  */
298
298
  --op-input-inner-focus: inset 0 0 0 var(--op-border-width-large);
299
299
  --op-input-outer-focus: 0 0 0 var(--op-border-width-x-large);
300
- --op-input-focus-primary: var(--op-input-inner-focus) var(--op-color-primary-plus-two),
300
+ --op-input-focus-primary:
301
+ var(--op-input-inner-focus) var(--op-color-primary-plus-two),
301
302
  var(--op-input-outer-focus) var(--op-color-primary-plus-five);
302
- --op-input-focus-neutral: var(--op-input-inner-focus) var(--op-color-neutral-plus-two),
303
+ --op-input-focus-neutral:
304
+ var(--op-input-inner-focus) var(--op-color-neutral-plus-two),
303
305
  var(--op-input-outer-focus) var(--op-color-neutral-plus-five);
304
- --op-input-focus-danger: var(--op-input-inner-focus) var(--op-color-alerts-danger-plus-two),
306
+ --op-input-focus-danger:
307
+ var(--op-input-inner-focus) var(--op-color-alerts-danger-plus-two),
305
308
  var(--op-input-outer-focus) var(--op-color-alerts-danger-plus-five);
306
- --op-input-focus-warning: var(--op-input-inner-focus) var(--op-color-alerts-warning-plus-two),
309
+ --op-input-focus-warning:
310
+ var(--op-input-inner-focus) var(--op-color-alerts-warning-plus-two),
307
311
  var(--op-input-outer-focus) var(--op-color-alerts-warning-plus-five);
308
- --op-input-focus-info: var(--op-input-inner-focus) var(--op-color-alerts-info-plus-two),
312
+ --op-input-focus-info:
313
+ var(--op-input-inner-focus) var(--op-color-alerts-info-plus-two),
309
314
  var(--op-input-outer-focus) var(--op-color-alerts-info-plus-five);
310
- --op-input-focus-notice: var(--op-input-inner-focus) var(--op-color-alerts-notice-plus-two),
315
+ --op-input-focus-notice:
316
+ var(--op-input-inner-focus) var(--op-color-alerts-notice-plus-two),
311
317
  var(--op-input-outer-focus) var(--op-color-alerts-notice-plus-five);
312
318
  }
313
319
 
@@ -392,17 +392,23 @@ Noto Sans supports:
392
392
  */
393
393
  --op-input-inner-focus: inset 0 0 0 var(--op-border-width-large);
394
394
  --op-input-outer-focus: 0 0 0 var(--op-border-width-x-large);
395
- --op-input-focus-primary: var(--op-input-inner-focus) var(--op-color-primary-plus-two),
395
+ --op-input-focus-primary:
396
+ var(--op-input-inner-focus) var(--op-color-primary-plus-two),
396
397
  var(--op-input-outer-focus) var(--op-color-primary-plus-five);
397
- --op-input-focus-neutral: var(--op-input-inner-focus) var(--op-color-neutral-plus-two),
398
+ --op-input-focus-neutral:
399
+ var(--op-input-inner-focus) var(--op-color-neutral-plus-two),
398
400
  var(--op-input-outer-focus) var(--op-color-neutral-plus-five);
399
- --op-input-focus-danger: var(--op-input-inner-focus) var(--op-color-alerts-danger-plus-two),
401
+ --op-input-focus-danger:
402
+ var(--op-input-inner-focus) var(--op-color-alerts-danger-plus-two),
400
403
  var(--op-input-outer-focus) var(--op-color-alerts-danger-plus-five);
401
- --op-input-focus-warning: var(--op-input-inner-focus) var(--op-color-alerts-warning-plus-two),
404
+ --op-input-focus-warning:
405
+ var(--op-input-inner-focus) var(--op-color-alerts-warning-plus-two),
402
406
  var(--op-input-outer-focus) var(--op-color-alerts-warning-plus-five);
403
- --op-input-focus-info: var(--op-input-inner-focus) var(--op-color-alerts-info-plus-two),
407
+ --op-input-focus-info:
408
+ var(--op-input-inner-focus) var(--op-color-alerts-info-plus-two),
404
409
  var(--op-input-outer-focus) var(--op-color-alerts-info-plus-five);
405
- --op-input-focus-notice: var(--op-input-inner-focus) var(--op-color-alerts-notice-plus-two),
410
+ --op-input-focus-notice:
411
+ var(--op-input-inner-focus) var(--op-color-alerts-notice-plus-two),
406
412
  var(--op-input-outer-focus) var(--op-color-alerts-notice-plus-five);
407
413
  }
408
414
  /* Animations */
@@ -3279,6 +3285,44 @@ small {
3279
3285
  }
3280
3286
  }
3281
3287
  /* stylelint-enable no-descending-specificity */
3288
+ .content-header {
3289
+ display: flex;
3290
+ flex-wrap: wrap;
3291
+ justify-content: space-between;
3292
+ gap: var(--op-space-medium);
3293
+ padding-block: var(--op-space-medium);
3294
+
3295
+ .content-header__details {
3296
+ display: grid;
3297
+ gap: var(--op-space-3x-small);
3298
+ }
3299
+
3300
+ .content-header__context {
3301
+ color: var(--op-color-on-background-alt);
3302
+ font-size: var(--op-font-small);
3303
+ }
3304
+
3305
+ .content-header__title {
3306
+ margin: 0;
3307
+ color: var(--op-color-on-background);
3308
+ font-size: var(--op-font-2x-large);
3309
+ font-weight: var(--op-font-weight-medium);
3310
+ }
3311
+
3312
+ .content-header__subline {
3313
+ color: var(--op-color-on-background-alt);
3314
+ font-size: var(--op-font-medium);
3315
+ }
3316
+
3317
+ .content-header__aside {
3318
+ display: flex;
3319
+ flex-wrap: wrap;
3320
+ align-items: start;
3321
+ justify-content: end;
3322
+ gap: var(--op-space-2x-small);
3323
+ margin-inline-start: auto;
3324
+ }
3325
+ }
3282
3326
  .divider {
3283
3327
  /* Public API (customizable component options) */
3284
3328
  --_op-divider-vertical-min-height: var(--op-space-large);
@@ -3583,7 +3627,8 @@ textarea.form-control:not([type='radio'], [type='checkbox']) {
3583
3627
  .form-label,
3584
3628
  .form-error,
3585
3629
  .form-hint,
3586
- .form-control:not([type='radio'], [type='checkbox']) {
3630
+ .form-control:not([type='radio'], [type='checkbox']),
3631
+ .segmented-control {
3587
3632
  grid-column: 1 / 3;
3588
3633
  }
3589
3634
  /* stylelint-enable no-descending-specificity */
@@ -4026,6 +4071,141 @@ dialog.modal {
4026
4071
  padding-inline: var(--op-space-x-small);
4027
4072
  }
4028
4073
  }
4074
+ .segmented-control {
4075
+ --op-input-inner-focus: 0 0 0 var(--op-border-width-large);
4076
+ --op-input-focus-primary:
4077
+ var(--op-input-inner-focus) var(--op-color-primary-plus-two),
4078
+ var(--op-input-outer-focus) var(--op-color-primary-plus-five);
4079
+
4080
+ /* Public API (customizable component options) */
4081
+ --_op-segmented-control-height-small: var(--op-input-height-small);
4082
+ --_op-segmented-control-height-medium: var(--op-input-height-medium);
4083
+ --_op-segmented-control-height-large: var(--op-input-height-large);
4084
+
4085
+ --_op-segmented-control-font-small: var(--op-font-x-small);
4086
+ --_op-segmented-control-font-medium: var(--op-font-small);
4087
+ --_op-segmented-control-font-large: var(--op-font-small);
4088
+
4089
+ --_op-segmented-control-label-padding-small: var(--op-space-x-small);
4090
+ --_op-segmented-control-label-padding-medium: var(--op-space-small);
4091
+ --_op-segmented-control-label-padding-large: var(--op-space-small);
4092
+
4093
+ --_op-segmented-control-label-gap-small: var(--op-space-3x-small);
4094
+ --_op-segmented-control-label-gap-medium: var(--op-space-2x-small);
4095
+ --_op-segmented-control-label-gap-large: var(--op-space-2x-small);
4096
+
4097
+ --_op-segmented-control-color-icon-default: var(--op-color-neutral-on-plus-eight-alt);
4098
+ --_op-segmented-control-color-icon-active: light-dark(
4099
+ var(--op-color-primary-plus-four),
4100
+ var(--op-color-primary-minus-six)
4101
+ );
4102
+
4103
+ /* Private API (component option defaults) */
4104
+ --__op-segmented-control-height: var(--_op-segmented-control-height-large);
4105
+ --__op-segmented-control-font-size: var(--_op-segmented-control-font-large);
4106
+ --__op-segmented-control-label-padding: var(--_op-segmented-control-label-padding-large);
4107
+ --__op-segmented-control-label-gap: var(--_op-segmented-control-label-gap-large);
4108
+ --__op-segmented-control-color-icon: var(--_op-segmented-control-color-icon-default);
4109
+
4110
+ position: relative;
4111
+ display: grid;
4112
+ width: fit-content;
4113
+ height: var(--__op-segmented-control-height);
4114
+ padding: var(--op-space-2x-small);
4115
+ border-radius: var(--op-radius-medium);
4116
+ background-color: var(--op-color-neutral-plus-eight);
4117
+ box-shadow: var(--op-border-all) var(--op-color-border);
4118
+ color: var(--op-color-neutral-on-plus-eight);
4119
+ font-size: var(--__op-segmented-control-font-size);
4120
+ gap: var(--op-space-2x-small);
4121
+ grid-auto-flow: column;
4122
+
4123
+ &.segmented-control--full-width {
4124
+ width: 100%;
4125
+ }
4126
+
4127
+ .icon {
4128
+ color: var(--__op-segmented-control-color-icon);
4129
+ }
4130
+
4131
+ .segmented-control__input {
4132
+ position: absolute;
4133
+ overflow: hidden;
4134
+ width: 1px;
4135
+ height: 1px;
4136
+ padding: 0;
4137
+ border-width: 0;
4138
+ margin: -1px;
4139
+ clip: rect(0, 0, 0, 0);
4140
+ white-space: nowrap;
4141
+
4142
+ /* Selected Option */
4143
+ &:checked + .segmented-control__label {
4144
+ --__op-segmented-control-color-icon: var(--_op-segmented-control-color-icon-active);
4145
+
4146
+ background-color: var(--op-color-primary-plus-one);
4147
+ color: var(--op-color-primary-on-plus-one);
4148
+ }
4149
+
4150
+ &:focus-visible {
4151
+ + .segmented-control__label {
4152
+ box-shadow: var(--op-input-focus-primary);
4153
+ }
4154
+ }
4155
+ }
4156
+
4157
+ .segmented-control__label {
4158
+ display: inline-flex;
4159
+ align-items: center;
4160
+ justify-content: center;
4161
+ border-radius: var(--op-radius-small);
4162
+ gap: var(--__op-segmented-control-label-gap);
4163
+ padding-inline: var(--__op-segmented-control-label-padding);
4164
+ white-space: nowrap;
4165
+
4166
+ &:hover {
4167
+ background-color: var(--op-color-neutral-plus-five);
4168
+ color: var(--op-color-neutral-on-plus-five);
4169
+ }
4170
+ }
4171
+
4172
+ /* Size Modifiers */
4173
+ &.segmented-control--small {
4174
+ --__op-segmented-control-height: var(--_op-segmented-control-height-small);
4175
+ --__op-segmented-control-font-size: var(--_op-segmented-control-font-small);
4176
+ --__op-segmented-control-label-padding: var(--_op-segmented-control-label-padding-small);
4177
+ --__op-segmented-control-label-gap: var(--_op-segmented-control-label-gap-small);
4178
+
4179
+ .icon {
4180
+ --__op-icon-font-size: var(--_op-icon-font-size-small);
4181
+ --__op-icon-optical-size: var(--_op-icon-optical-size-small);
4182
+ }
4183
+ }
4184
+
4185
+ &.segmented-control--medium {
4186
+ --__op-segmented-control-height: var(--_op-segmented-control-height-medium);
4187
+ --__op-segmented-control-font-size: var(--_op-segmented-control-font-medium);
4188
+ --__op-segmented-control-label-padding: var(--_op-segmented-control-label-padding-medium);
4189
+ --__op-segmented-control-label-gap: var(--_op-segmented-control-label-gap-medium);
4190
+
4191
+ .icon {
4192
+ --__op-icon-font-size: var(--_op-icon-font-size-medium);
4193
+ --__op-icon-optical-size: var(--_op-icon-optical-size-medium);
4194
+ }
4195
+ }
4196
+
4197
+ &.segmented-control--large {
4198
+ --__op-segmented-control-height: var(--_op-segmented-control-height-large);
4199
+ --__op-segmented-control-font-size: var(--_op-segmented-control-font-large);
4200
+ --__op-segmented-control-label-padding: var(--_op-segmented-control-label-padding-large);
4201
+ --__op-segmented-control-label-gap: var(--_op-segmented-control-label-gap-large);
4202
+
4203
+ .icon {
4204
+ --__op-icon-font-size: var(--_op-icon-font-size-medium);
4205
+ --__op-icon-optical-size: var(--_op-icon-optical-size-medium);
4206
+ }
4207
+ }
4208
+ }
4029
4209
  .sidebar {
4030
4210
  /* Public API (customizable component options) */
4031
4211