@rolemodel/optics 2.1.2 → 2.1.4

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.
Files changed (44) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/.yarn/releases/yarn-4.8.1.cjs +935 -0
  3. package/.yarnrc.yml +1 -1
  4. package/README.md +1 -1
  5. package/dist/README.md +1 -1
  6. package/dist/css/components/accordion.css +66 -0
  7. package/dist/css/components/alert.css +171 -0
  8. package/dist/css/components/avatar.css +95 -0
  9. package/dist/css/components/badge.css +73 -0
  10. package/dist/css/components/breadcrumbs.css +37 -0
  11. package/dist/css/components/button.css +273 -0
  12. package/dist/css/components/button_group.css +47 -0
  13. package/dist/css/components/card.css +70 -0
  14. package/dist/css/components/confirm-dialog.css +80 -0
  15. package/dist/css/components/divider.css +55 -0
  16. package/dist/css/components/form.css +360 -0
  17. package/dist/css/components/icon.css +121 -0
  18. package/dist/css/components/index.css +24 -0
  19. package/dist/css/components/modal.css +149 -0
  20. package/dist/css/components/navbar.css +60 -0
  21. package/dist/css/components/pagination.css +24 -0
  22. package/dist/css/components/side_panel.css +90 -0
  23. package/dist/css/components/sidebar.css +138 -0
  24. package/dist/css/components/spinner.css +52 -0
  25. package/dist/css/components/switch.css +107 -0
  26. package/dist/css/components/tab.css +76 -0
  27. package/dist/css/components/table.css +133 -0
  28. package/dist/css/components/tag.css +168 -0
  29. package/dist/css/components/text_pair.css +55 -0
  30. package/dist/css/components/tooltip.css +134 -0
  31. package/dist/css/core/base.css +95 -0
  32. package/dist/css/core/fonts/icon_fonts.css +8 -0
  33. package/dist/css/core/fonts/index.css +8 -0
  34. package/dist/css/core/fonts/text_fonts.css +16 -0
  35. package/dist/css/core/layout.css +43 -0
  36. package/dist/css/core/tokens/base_tokens.css +338 -0
  37. package/dist/css/core/tokens/index.css +2 -0
  38. package/dist/css/core/tokens/scale_color_tokens.css +1498 -0
  39. package/dist/css/core/utilities.css +429 -0
  40. package/dist/css/optics.css +10 -2
  41. package/dist/css/optics.min.css +1 -1
  42. package/dist/package.json +3 -3
  43. package/package.json +3 -3
  44. package/.yarn/releases/yarn-4.2.2.cjs +0 -894
@@ -0,0 +1,168 @@
1
+ .tag {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ padding: var(--op-space-2x-small);
6
+ border-radius: var(--op-radius-pill);
7
+ background-color: var(--op-color-neutral-plus-four);
8
+ color: var(--op-color-neutral-on-plus-four);
9
+ font-size: var(--op-font-x-small);
10
+ font-weight: var(--op-font-weight-bold);
11
+ letter-spacing: var(--op-letter-spacing-label);
12
+ line-height: var(--op-line-height-dense);
13
+ user-select: none;
14
+ white-space: nowrap;
15
+
16
+ /* Elements */
17
+
18
+ .tag__label {
19
+ padding-inline: var(--op-space-2x-small);
20
+ }
21
+
22
+ .btn--icon {
23
+ --__op-btn-height: var(--op-font-medium);
24
+
25
+ /* Hover State */
26
+ &:hover {
27
+ background-color: var(--op-color-neutral-minus-three);
28
+ box-shadow: none;
29
+ color: var(--op-color-neutral-on-minus-three);
30
+ }
31
+
32
+ /* Focus State */
33
+ &:focus-visible {
34
+ background-color: var(--op-color-neutral-base);
35
+ box-shadow: var(--op-input-focus-neutral);
36
+ color: var(--op-color-neutral-on-base);
37
+ }
38
+ }
39
+
40
+ /* Modifiers */
41
+
42
+ &.tag--read-only {
43
+ /* This is here for consistency */
44
+ }
45
+
46
+ &.tag--primary {
47
+ background-color: var(--op-color-primary-base);
48
+ color: var(--op-color-primary-on-base);
49
+
50
+ .btn--icon {
51
+ color: var(--op-color-primary-on-base);
52
+
53
+ /* Hover State */
54
+ &:hover {
55
+ background-color: var(--op-color-primary-minus-three);
56
+ box-shadow: none;
57
+ color: var(--op-color-primary-on-minus-three);
58
+ }
59
+
60
+ /* Focus State */
61
+ &:focus-visible {
62
+ background-color: var(--op-color-primary-base);
63
+ box-shadow: var(--op-input-focus-primary);
64
+ color: var(--op-color-primary-on-base);
65
+ }
66
+ }
67
+ }
68
+
69
+ &.tag--danger {
70
+ background-color: var(--op-color-alerts-danger-base);
71
+ color: var(--op-color-alerts-danger-on-base);
72
+
73
+ /* stylelint-disable no-descending-specificity */
74
+ .btn--icon {
75
+ color: var(--op-color-alerts-danger-on-base);
76
+
77
+ /* Hover State */
78
+ &:hover {
79
+ background-color: var(--op-color-alerts-danger-minus-three);
80
+ box-shadow: none;
81
+ color: var(--op-color-alerts-danger-on-minus-three);
82
+ }
83
+
84
+ /* Focus State */
85
+ &:focus-visible {
86
+ background-color: var(--op-color-alerts-danger-base);
87
+ box-shadow: var(--op-input-focus-danger);
88
+ color: var(--op-color-alerts-danger-on-base);
89
+ }
90
+ }
91
+ /* stylelint-enable no-descending-specificity */
92
+ }
93
+
94
+ &.tag--warning {
95
+ background-color: var(--op-color-alerts-warning-base);
96
+ color: var(--op-color-alerts-warning-on-base);
97
+
98
+ /* stylelint-disable no-descending-specificity */
99
+ .btn--icon {
100
+ color: var(--op-color-alerts-warning-on-base);
101
+
102
+ /* Hover State */
103
+ &:hover {
104
+ background-color: var(--op-color-alerts-warning-minus-three);
105
+ box-shadow: none;
106
+ color: var(--op-color-alerts-warning-on-minus-three);
107
+ }
108
+
109
+ /* Focus State */
110
+ &:focus-visible {
111
+ background-color: var(--op-color-alerts-warning-base);
112
+ box-shadow: var(--op-input-focus-warning);
113
+ color: var(--op-color-alerts-warning-on-base);
114
+ }
115
+ }
116
+ /* stylelint-enable no-descending-specificity */
117
+ }
118
+
119
+ &.tag--info {
120
+ background-color: var(--op-color-alerts-info-base);
121
+ color: var(--op-color-alerts-info-on-base);
122
+
123
+ /* stylelint-disable no-descending-specificity */
124
+ .btn--icon {
125
+ color: var(--op-color-alerts-info-on-base);
126
+
127
+ /* Hover State */
128
+ &:hover {
129
+ background-color: var(--op-color-alerts-info-minus-three);
130
+ box-shadow: none;
131
+ color: var(--op-color-alerts-info-on-minus-three);
132
+ }
133
+
134
+ /* Focus State */
135
+ &:focus-visible {
136
+ background-color: var(--op-color-alerts-info-base);
137
+ box-shadow: var(--op-input-focus-info);
138
+ color: var(--op-color-alerts-info-on-base);
139
+ }
140
+ }
141
+ /* stylelint-enable no-descending-specificity */
142
+ }
143
+
144
+ &.tag--notice {
145
+ background-color: var(--op-color-alerts-notice-base);
146
+ color: var(--op-color-alerts-notice-on-base);
147
+
148
+ /* stylelint-disable no-descending-specificity */
149
+ .btn--icon {
150
+ color: var(--op-color-alerts-notice-on-base);
151
+
152
+ /* Hover State */
153
+ &:hover {
154
+ background-color: var(--op-color-alerts-notice-minus-three);
155
+ box-shadow: none;
156
+ color: var(--op-color-alerts-notice-on-minus-three);
157
+ }
158
+
159
+ /* Focus State */
160
+ &:focus-visible {
161
+ background-color: var(--op-color-alerts-notice-base);
162
+ box-shadow: var(--op-input-focus-notice);
163
+ color: var(--op-color-alerts-notice-on-base);
164
+ }
165
+ }
166
+ /* stylelint-enable no-descending-specificity */
167
+ }
168
+ }
@@ -0,0 +1,55 @@
1
+ .text-pair {
2
+ /* Public API (customizable component options) */
3
+ --_op-text-pair-font-size-small: var(--op-font-small);
4
+ --_op-text-pair-font-size-medium: var(--op-font-medium);
5
+ --_op-text-pair-font-size-large: var(--op-font-large);
6
+
7
+ /* Private API (component option defaults) */
8
+ --__op-text-pair-title-font-size: var(--_op-text-pair-font-size-medium);
9
+ --__op-text-pair-subtitle-font-size: var(--_op-text-pair-font-size-small);
10
+
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: var(--op-space-x-small);
14
+
15
+ &.text-pair--inline {
16
+ flex-direction: row;
17
+ align-items: baseline;
18
+ }
19
+
20
+ .text-pair__title {
21
+ font-size: var(--__op-text-pair-title-font-size);
22
+ font-weight: var(--op-font-weight-semi-bold);
23
+ line-height: var(--op-line-height-dense);
24
+
25
+ &.text-pair__title--small {
26
+ --__op-text-pair-title-font-size: var(--_op-text-pair-font-size-small);
27
+ }
28
+
29
+ &.text-pair__title--medium {
30
+ --__op-text-pair-title-font-size: var(--_op-text-pair-font-size-medium);
31
+ }
32
+
33
+ &.text-pair__title--large {
34
+ --__op-text-pair-title-font-size: var(--_op-text-pair-font-size-large);
35
+ }
36
+ }
37
+
38
+ .text-pair__subtitle {
39
+ font-size: var(--__op-text-pair-subtitle-font-size);
40
+ font-weight: var(--op-font-weight-normal);
41
+ line-height: var(--op-line-height-dense);
42
+
43
+ &.text-pair__subtitle--small {
44
+ --__op-text-pair-subtitle-font-size: var(--_op-text-pair-font-size-small);
45
+ }
46
+
47
+ &.text-pair__subtitle--medium {
48
+ --__op-text-pair-subtitle-font-size: var(--_op-text-pair-font-size-medium);
49
+ }
50
+
51
+ &.text-pair__subtitle--large {
52
+ --__op-text-pair-subtitle-font-size: var(--_op-text-pair-font-size-large);
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,134 @@
1
+ /* Inspired by https://blog.logrocket.com/creating-beautiful-tooltips-with-only-css/ */
2
+
3
+ [data-tooltip-text] {
4
+ /* Public API (customizable component options) */
5
+ --_op-tooltip-max-width: calc(50 * var(--op-size-unit)); /* 200px */
6
+ --_op-tooltip-padding: var(--op-space-x-small) var(--op-space-medium);
7
+ --_op-tooltip-background-color: var(--op-color-neutral-minus-max);
8
+ --_op-tooltip-text-color: var(--op-color-neutral-on-minus-max);
9
+ --_op-tooltip-arrow-size: calc(var(--op-space-small) / 2);
10
+ --_op-tooltip-tooltip-offset: var(--op-space-x-small);
11
+ --_op-tooltip-tooltip-radius: var(--op-radius-medium);
12
+ --_op-tooltip-tooltip-font-size: var(--op-font-small);
13
+
14
+ position: relative;
15
+
16
+ &::before,
17
+ &::after {
18
+ opacity: var(--op-opacity-none);
19
+ transition: var(--op-transition-tooltip);
20
+ visibility: hidden;
21
+ }
22
+
23
+ &::before {
24
+ position: absolute;
25
+ z-index: var(--op-z-index-tooltip);
26
+ display: block;
27
+ width: max-content;
28
+ max-width: var(--_op-tooltip-max-width);
29
+ padding: var(--_op-tooltip-padding);
30
+ border-radius: var(--_op-tooltip-tooltip-radius);
31
+ background-color: var(--_op-tooltip-background-color);
32
+ color: var(--_op-tooltip-text-color);
33
+ content: attr(data-tooltip-text);
34
+ font-family: var(--op-font-family); /* Makes tooltips on icons work */
35
+ font-size: var(--_op-tooltip-tooltip-font-size);
36
+ overflow-wrap: break-word;
37
+ pointer-events: none;
38
+ text-align: center;
39
+ white-space: normal;
40
+ }
41
+
42
+ &::after {
43
+ position: absolute;
44
+ z-index: var(--op-z-index-tooltip);
45
+ border: var(--_op-tooltip-arrow-size) solid var(--_op-tooltip-background-color);
46
+ content: '';
47
+ pointer-events: none;
48
+ }
49
+
50
+ &:hover {
51
+ &::before,
52
+ &::after {
53
+ opacity: var(--op-opacity-full);
54
+ visibility: visible;
55
+ }
56
+ }
57
+
58
+ &[data-tooltip-position='top'],
59
+ &:not([data-tooltip-position]) {
60
+ &::before,
61
+ &::after {
62
+ inset-inline-start: 50%;
63
+ transform: translateX(-50%);
64
+ }
65
+
66
+ &::before {
67
+ inset-block-end: 100%;
68
+ margin-block-end: calc(var(--_op-tooltip-arrow-size) + var(--_op-tooltip-tooltip-offset));
69
+ }
70
+
71
+ &::after {
72
+ border-color: var(--_op-tooltip-background-color) transparent transparent transparent;
73
+ inset-block-end: 100%;
74
+ margin-block-end: calc(-1 * var(--_op-tooltip-arrow-size) + var(--_op-tooltip-tooltip-offset));
75
+ }
76
+ }
77
+
78
+ &[data-tooltip-position='left'] {
79
+ &::before,
80
+ &::after {
81
+ inset-block-start: 50%;
82
+ transform: translateY(-50%);
83
+ }
84
+
85
+ &::before {
86
+ inset-inline-end: 100%;
87
+ margin-inline-end: calc(var(--_op-tooltip-arrow-size) + var(--_op-tooltip-tooltip-offset));
88
+ }
89
+
90
+ &::after {
91
+ border-color: transparent transparent transparent var(--_op-tooltip-background-color);
92
+ inset-inline-end: 100%;
93
+ margin-inline-end: calc(-1 * var(--_op-tooltip-arrow-size) + var(--_op-tooltip-tooltip-offset));
94
+ }
95
+ }
96
+
97
+ &[data-tooltip-position='bottom'] {
98
+ &::before,
99
+ &::after {
100
+ inset-inline-start: 50%;
101
+ transform: translateX(-50%);
102
+ }
103
+
104
+ &::before {
105
+ inset-block-start: 100%;
106
+ margin-block-start: calc(var(--_op-tooltip-arrow-size) + var(--_op-tooltip-tooltip-offset));
107
+ }
108
+
109
+ &::after {
110
+ border-color: transparent transparent var(--_op-tooltip-background-color) transparent;
111
+ inset-block-start: 100%;
112
+ margin-block-start: calc(-1 * var(--_op-tooltip-arrow-size) + var(--_op-tooltip-tooltip-offset));
113
+ }
114
+ }
115
+
116
+ &[data-tooltip-position='right'] {
117
+ &::before,
118
+ &::after {
119
+ inset-block-start: 50%;
120
+ transform: translateY(-50%);
121
+ }
122
+
123
+ &::before {
124
+ inset-inline-start: 100%;
125
+ margin-inline-start: calc(var(--_op-tooltip-arrow-size) + var(--_op-tooltip-tooltip-offset));
126
+ }
127
+
128
+ &::after {
129
+ border-color: transparent var(--_op-tooltip-background-color) transparent transparent;
130
+ inset-inline-start: 100%;
131
+ margin-inline-start: calc(-1 * var(--_op-tooltip-arrow-size) + var(--_op-tooltip-tooltip-offset));
132
+ }
133
+ }
134
+ }
@@ -0,0 +1,95 @@
1
+ /* After a reset, introduce base element styles specific to this system */
2
+
3
+ html {
4
+ overflow: hidden; /* Needed to prevent flash messages and panels from causing overflow */
5
+ font-family: var(--op-font-family);
6
+ font-size: 62.5%; /* 1rem = 10px */
7
+ }
8
+
9
+ body {
10
+ overflow: auto;
11
+ height: 100vh;
12
+ background: var(--op-color-background);
13
+ color: var(--op-color-on-background);
14
+ font-size: var(--op-font-medium);
15
+ }
16
+
17
+ button {
18
+ background: none;
19
+ cursor: pointer;
20
+ }
21
+
22
+ button,
23
+ input[type='submit'] {
24
+ border: 0;
25
+ }
26
+
27
+ label {
28
+ display: inline-block;
29
+
30
+ &:hover {
31
+ cursor: pointer;
32
+ }
33
+ }
34
+
35
+ a {
36
+ color: var(--op-color-primary-original);
37
+ }
38
+
39
+ blockquote,
40
+ dl,
41
+ dd,
42
+ h1,
43
+ h2,
44
+ h3,
45
+ h4,
46
+ h5,
47
+ h6,
48
+ figure,
49
+ pre {
50
+ margin: 0;
51
+ }
52
+
53
+ h1,
54
+ h2,
55
+ h3,
56
+ h4,
57
+ h5,
58
+ h6 {
59
+ margin-top: 0;
60
+ margin-bottom: var(--op-space-small);
61
+ font-weight: var(--op-font-weight-normal);
62
+ }
63
+
64
+ h1 {
65
+ font-size: var(--op-font-3x-large);
66
+ }
67
+
68
+ h2 {
69
+ font-size: var(--op-font-2x-large);
70
+ }
71
+
72
+ h3 {
73
+ font-size: var(--op-font-large);
74
+ }
75
+
76
+ h4 {
77
+ font-size: var(--op-font-medium);
78
+ }
79
+
80
+ h5 {
81
+ font-size: var(--op-font-small);
82
+ }
83
+
84
+ h6 {
85
+ font-size: var(--op-font-x-small);
86
+ }
87
+
88
+ p {
89
+ margin-bottom: var(--op-space-small);
90
+ font-size: var(--op-font-medium);
91
+ }
92
+
93
+ small {
94
+ font-size: var(--op-font-small);
95
+ }
@@ -0,0 +1,8 @@
1
+ /*
2
+ See all icons at: https://fonts.google.com/icons?icon.set=Material+Symbols
3
+ This import of Material Symbols supports:
4
+ font weight set through: font-variation-settings: 'wght' {100..700}
5
+ */
6
+
7
+ /* Material Symbols */
8
+ @import 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght@100..700&display=block';
@@ -0,0 +1,8 @@
1
+ /*
2
+ Instead of hosting the font files locally which requires a compiler to handle them, we pull fonts
3
+ from Google's CDN. For more information on the variable font, see:
4
+ https://developers.google.com/fonts/docs/material_symbols#variable_font_with_google_fonts
5
+ */
6
+
7
+ @import 'text_fonts';
8
+ @import 'icon_fonts';
@@ -0,0 +1,16 @@
1
+ /*
2
+ Noto Sans supports:
3
+ font-weight: {anything between 100 and 900}
4
+ font-stretch: {anything between 62.5% and 100%}
5
+ font-style: {normal or italic}
6
+ */
7
+
8
+ /*
9
+ Noto Serif supports:
10
+ font-weight: {anything between 100 and 900}
11
+ font-stretch: {anything between 62.5% and 100%}
12
+ font-style: {normal or italic}
13
+ */
14
+
15
+ /* Noto Sans and Noto Serif */
16
+ @import 'https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wdth,wght@0,62.5..100,100..900;1,62.5..100,100..900&family=Noto+Serif:ital,wdth,wght@0,62.5..100,100..900;1,62.5..100,100..900&display=swap';
@@ -0,0 +1,43 @@
1
+ .app-with-sidebar {
2
+ display: grid;
3
+ width: 100%;
4
+ height: 100vh;
5
+ grid-template-columns: auto 1fr auto;
6
+ }
7
+
8
+ .app-body {
9
+ display: flex;
10
+ overflow: auto;
11
+ flex-direction: column;
12
+ }
13
+
14
+ .app__header {
15
+ position: sticky;
16
+ z-index: var(--op-z-index-header);
17
+ top: 0;
18
+ flex-grow: 0;
19
+ flex-shrink: 0;
20
+ }
21
+
22
+ .app__content {
23
+ width: 100%;
24
+ max-width: var(--op-breakpoint-medium);
25
+ flex-grow: 1;
26
+ padding: 0 var(--op-space-large);
27
+ margin: 0 auto;
28
+ }
29
+
30
+ .app__content-no-margin {
31
+ width: 100%;
32
+ flex-grow: 1;
33
+ padding: 0 var(--op-space-large);
34
+ overflow-y: auto;
35
+ }
36
+
37
+ .app__footer {
38
+ position: sticky;
39
+ z-index: var(--op-z-index-footer);
40
+ bottom: 0;
41
+ flex-grow: 0;
42
+ flex-shrink: 0;
43
+ }