@rolemodel/optics 2.2.0 → 2.3.1

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 (52) hide show
  1. package/.github/pull_request_template.md +3 -0
  2. package/.github/workflows/deploy-to-ghp.yml +20 -0
  3. package/.github/workflows/{release-package.yml → deploy-to-npm.yml} +4 -15
  4. package/.github/workflows/linting.yml +2 -1
  5. package/.github/workflows/publish-storybook.yml +2 -1
  6. package/.stylelintrc.json +3 -2
  7. package/.yarn/install-state.gz +0 -0
  8. package/build_token_json.js +5 -4
  9. package/dist/css/addons/panel.css +3 -3
  10. package/dist/css/addons/tom-select.css +5 -5
  11. package/dist/css/components/accordion.css +3 -3
  12. package/dist/css/components/alert.css +2 -2
  13. package/dist/css/components/avatar.css +6 -6
  14. package/dist/css/components/button.css +3 -3
  15. package/dist/css/components/button_group.css +4 -4
  16. package/dist/css/components/card.css +4 -4
  17. package/dist/css/components/confirm-dialog.css +1 -1
  18. package/dist/css/components/divider.css +7 -6
  19. package/dist/css/components/form.css +13 -14
  20. package/dist/css/components/icon.css +4 -4
  21. package/dist/css/components/modal.css +25 -43
  22. package/dist/css/components/navbar.css +6 -4
  23. package/dist/css/components/pagination.css +1 -1
  24. package/dist/css/components/segmented-control.css +5 -5
  25. package/dist/css/components/side_panel.css +4 -4
  26. package/dist/css/components/sidebar.css +11 -8
  27. package/dist/css/components/spinner.css +3 -3
  28. package/dist/css/components/switch.css +8 -8
  29. package/dist/css/components/table.css +3 -3
  30. package/dist/css/components/tooltip.css +2 -2
  31. package/dist/css/core/base.css +3 -4
  32. package/dist/css/core/layout.css +114 -7
  33. package/dist/css/core/tokens/base_tokens.css +6 -5
  34. package/dist/css/core/utilities.css +93 -68
  35. package/dist/css/optics+feather_icons.css +5967 -0
  36. package/dist/css/optics+feather_icons.min.css +1 -0
  37. package/dist/css/optics+lucide_icons.css +9927 -0
  38. package/dist/css/optics+lucide_icons.min.css +1 -0
  39. package/dist/css/optics+material_outlined_variable.css +5267 -0
  40. package/dist/css/optics+material_outlined_variable.min.css +1 -0
  41. package/dist/css/optics+no_icons.css +5258 -0
  42. package/dist/css/optics+no_icons.min.css +1 -0
  43. package/dist/css/optics+phosphor_icons.css +5298 -0
  44. package/dist/css/optics+phosphor_icons.min.css +1 -0
  45. package/dist/css/optics+tabler_icons.css +5267 -0
  46. package/dist/css/optics+tabler_icons.min.css +1 -0
  47. package/dist/css/optics.css +321 -209
  48. package/dist/css/optics.min.css +1 -1
  49. package/dist/package.json +18 -17
  50. package/dist/tokens/tokens.json +1 -1
  51. package/package.json +18 -17
  52. package/postcss.config.js +9 -1
@@ -7,13 +7,13 @@
7
7
  --_op-side-panel-section-padding: var(--op-space-medium);
8
8
 
9
9
  display: flex;
10
- width: var(--_op-side-panel-width);
11
- min-width: var(--_op-side-panel-width);
12
- height: 100vh;
13
- max-height: 100%;
14
10
  flex-direction: column;
15
11
  background-color: var(--op-color-background);
12
+ block-size: 100vh;
16
13
  color: var(--op-color-on-background);
14
+ inline-size: var(--_op-side-panel-width);
15
+ max-block-size: 100%;
16
+ min-inline-size: var(--_op-side-panel-width);
17
17
 
18
18
  /* Modifiers */
19
19
  &.side-panel--border-left {
@@ -29,23 +29,25 @@
29
29
 
30
30
  z-index: var(--op-z-index-sidebar);
31
31
  display: flex;
32
- width: var(--__op-sidebar-width);
33
- min-width: var(--__op-sidebar-width);
34
32
  flex-direction: column;
35
33
  background-color: var(--_op-sidebar-background-color);
36
- box-shadow: var(--op-border-right) var(--_op-sidebar-border-color);
34
+ box-shadow:
35
+ var(--op-border-left) var(--_op-sidebar-border-color),
36
+ var(--op-border-right) var(--_op-sidebar-border-color);
37
37
  color: var(--_op-sidebar-text-color);
38
+ inline-size: var(--__op-sidebar-width);
39
+ min-inline-size: var(--__op-sidebar-width);
38
40
  overflow-y: auto;
39
41
  transition: var(--_op-sidebar-transition);
40
42
 
41
43
  /* Elements */
42
44
  .sidebar__brand {
43
- height: var(--__op-sidebar-brand-width);
44
45
  padding: var(--_op-sidebar-brand-spacing);
46
+ block-size: var(--__op-sidebar-brand-width);
45
47
  margin-inline: auto;
46
48
 
47
49
  img {
48
- height: 100%;
50
+ block-size: 100%;
49
51
  }
50
52
  }
51
53
 
@@ -118,13 +120,14 @@
118
120
  align-items: center;
119
121
 
120
122
  > * {
121
- /* Need to get icon behavior */
122
- width: var(--__op-btn-height);
123
- min-width: var(--__op-btn-height);
124
123
  justify-content: center;
125
124
  padding: 0;
126
125
  font-size: 0;
127
126
  gap: 0;
127
+
128
+ /* Need to get icon behavior */
129
+ inline-size: var(--__op-btn-height);
130
+ min-inline-size: var(--__op-btn-height);
128
131
  }
129
132
  }
130
133
  }
@@ -17,12 +17,12 @@
17
17
  --__op-spinner-diameter: var(--_op-spinner-diameter-large);
18
18
  --__op-spinner-track-width: var(--_op-spinner-track-width-large);
19
19
 
20
- width: var(--__op-spinner-diameter);
21
- height: var(--__op-spinner-diameter);
22
20
  border: var(--__op-spinner-track-width) solid var(--_op-spinner-track-color);
23
21
  border-radius: var(--__op-spinner-diameter);
24
- border-top-color: var(--_op-spinner-indicator-color);
25
22
  animation: spinner var(--_op-spinner-animation-duration) var(--_op-spinner-animation-timing-function) infinite;
23
+ block-size: var(--__op-spinner-diameter);
24
+ border-block-start-color: var(--_op-spinner-indicator-color);
25
+ inline-size: var(--__op-spinner-diameter);
26
26
 
27
27
  &.spinner--x-small {
28
28
  --__op-spinner-diameter: var(--_op-spinner-diameter-x-small);
@@ -20,20 +20,20 @@
20
20
  label {
21
21
  position: relative;
22
22
  display: block;
23
- width: var(--__op-switch-width);
24
- height: var(--__op-switch-height);
25
23
  border-radius: var(--op-radius-pill);
26
24
  background: var(--op-color-neutral-base);
25
+ block-size: var(--__op-switch-height);
27
26
  box-shadow: inset var(--op-border-all) var(--op-color-neutral-plus-three);
27
+ inline-size: var(--__op-switch-width);
28
28
  text-indent: -9999px; /* Normally text would not be put in the label, but this hides it in case you do put text in the label */
29
29
 
30
30
  &::after {
31
31
  position: absolute;
32
- width: var(--__op-switch-switch-size);
33
- height: var(--__op-switch-switch-size);
34
32
  border-radius: var(--op-radius-circle);
35
33
  background-color: var(--op-color-neutral-plus-eight);
34
+ block-size: var(--__op-switch-switch-size);
36
35
  content: '';
36
+ inline-size: var(--__op-switch-switch-size);
37
37
  inset-block-start: var(--__op-switch-half-switch-padding);
38
38
  inset-inline-start: var(--__op-switch-half-switch-padding);
39
39
  transition: var(--op-transition-input);
@@ -42,12 +42,12 @@
42
42
 
43
43
  /* Prevent labels after the toggle being full width */
44
44
  & + label {
45
- width: fit-content;
45
+ inline-size: fit-content;
46
46
  }
47
47
 
48
48
  input {
49
- width: 0;
50
- height: 0;
49
+ block-size: 0;
50
+ inline-size: 0;
51
51
  margin-inline-end: calc(-1 * var(--op-space-x-small));
52
52
 
53
53
  &:disabled {
@@ -64,7 +64,7 @@
64
64
  box-shadow: none;
65
65
 
66
66
  &::after {
67
- left: calc(100% - var(--__op-switch-half-switch-padding));
67
+ inset-inline-start: calc(100% - var(--__op-switch-half-switch-padding));
68
68
  transform: translateX(-100%);
69
69
  }
70
70
  }
@@ -11,11 +11,11 @@
11
11
  /* These allow for overriding specific padding versions easier. */
12
12
  --__op-table-cell-height: var(--_op-table-cell-height-default);
13
13
 
14
- width: 100%;
15
14
  border-radius: var(--op-radius-medium);
16
15
  border-collapse: collapse;
17
16
  box-shadow: var(--op-border-all) var(--op-color-border);
18
17
  contain: paint;
18
+ inline-size: 100%;
19
19
  table-layout: auto;
20
20
 
21
21
  /* Elements */
@@ -33,7 +33,7 @@
33
33
 
34
34
  th {
35
35
  font-weight: var(--op-font-weight-semi-bold);
36
- text-align: left;
36
+ text-align: start;
37
37
  }
38
38
 
39
39
  tbody,
@@ -44,7 +44,7 @@
44
44
 
45
45
  th,
46
46
  td {
47
- height: var(--__op-table-cell-height);
47
+ block-size: var(--__op-table-cell-height);
48
48
  font-size: var(--op-font-small);
49
49
  padding-block: var(--op-space-2x-small);
50
50
  padding-inline: var(--op-space-small);
@@ -24,8 +24,6 @@
24
24
  position: absolute;
25
25
  z-index: var(--op-z-index-tooltip);
26
26
  display: block;
27
- width: max-content;
28
- max-width: var(--_op-tooltip-max-width);
29
27
  padding: var(--_op-tooltip-padding);
30
28
  border-radius: var(--_op-tooltip-tooltip-radius);
31
29
  background-color: var(--_op-tooltip-background-color);
@@ -33,6 +31,8 @@
33
31
  content: attr(data-tooltip-text);
34
32
  font-family: var(--op-font-family); /* Makes tooltips on icons work */
35
33
  font-size: var(--_op-tooltip-tooltip-font-size);
34
+ inline-size: max-content;
35
+ max-inline-size: var(--_op-tooltip-max-width);
36
36
  overflow-wrap: break-word;
37
37
  pointer-events: none;
38
38
  text-align: center;
@@ -8,8 +8,8 @@ html {
8
8
 
9
9
  body {
10
10
  overflow: auto;
11
- height: 100vh;
12
11
  background: var(--op-color-background);
12
+ block-size: 100vh;
13
13
  color: var(--op-color-on-background);
14
14
  font-size: var(--op-font-medium);
15
15
  }
@@ -56,9 +56,8 @@ h3,
56
56
  h4,
57
57
  h5,
58
58
  h6 {
59
- margin-top: 0;
60
- margin-bottom: var(--op-space-small);
61
59
  font-weight: var(--op-font-weight-normal);
60
+ margin-block: 0 var(--op-space-small);
62
61
  }
63
62
 
64
63
  h1 {
@@ -86,8 +85,8 @@ h6 {
86
85
  }
87
86
 
88
87
  p {
89
- margin-bottom: var(--op-space-small);
90
88
  font-size: var(--op-font-medium);
89
+ margin-block-end: var(--op-space-small);
91
90
  }
92
91
 
93
92
  small {
@@ -1,8 +1,8 @@
1
1
  .app-with-sidebar {
2
2
  display: grid;
3
- width: 100%;
4
- height: 100vh;
3
+ block-size: 100vh;
5
4
  grid-template-columns: auto 1fr auto;
5
+ inline-size: 100%;
6
6
  }
7
7
 
8
8
  .app-body {
@@ -14,30 +14,137 @@
14
14
  .app__header {
15
15
  position: sticky;
16
16
  z-index: var(--op-z-index-header);
17
- top: 0;
18
17
  flex-grow: 0;
19
18
  flex-shrink: 0;
19
+ inset-block-start: 0;
20
20
  }
21
21
 
22
22
  .app__content {
23
- width: 100%;
24
- max-width: var(--op-breakpoint-medium);
25
23
  flex-grow: 1;
26
24
  padding: 0 var(--op-space-large);
27
25
  margin: 0 auto;
26
+ inline-size: 100%;
27
+ max-inline-size: var(--op-breakpoint-medium);
28
28
  }
29
29
 
30
30
  .app__content-no-margin {
31
- width: 100%;
32
31
  flex-grow: 1;
33
32
  padding: 0 var(--op-space-large);
33
+ inline-size: 100%;
34
34
  overflow-y: auto;
35
35
  }
36
36
 
37
37
  .app__footer {
38
38
  position: sticky;
39
39
  z-index: var(--op-z-index-footer);
40
- bottom: 0;
41
40
  flex-grow: 0;
42
41
  flex-shrink: 0;
42
+ inset-block-end: 0;
43
+ }
44
+
45
+ /*
46
+ <html lang='en'>
47
+ <head>...</head>
48
+ <body class="op-page">
49
+ <div class="op-page__sidebar">...</div>
50
+ <div class="op-page__main">
51
+ <div class="op-page__main-header">...</div>
52
+ <div class="op-page__main-content">...</div>
53
+ <div class="op-page__main-footer">...</div>
54
+ </div>
55
+ <div class="op-page__sidebar op-page__sidebar--right">...</div>
56
+ </body>
57
+ </html>
58
+ */
59
+
60
+ :root:has(.op-page) {
61
+ /* Reset existing Optics layout */
62
+ overflow: unset;
63
+
64
+ body {
65
+ overflow: unset;
66
+ }
67
+
68
+ /* New Layout */
69
+ html,
70
+ body {
71
+ padding: 0;
72
+ margin: 0;
73
+ block-size: 100%;
74
+ min-block-size: 100%;
75
+ }
76
+ }
77
+
78
+ .op-page {
79
+ display: grid;
80
+ grid-template-areas: 'sidebar-left main sidebar-right';
81
+ grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
82
+ min-block-size: 100dvh;
83
+
84
+ .op-page__sidebar {
85
+ grid-area: sidebar-left;
86
+
87
+ &.op-page__sidebar--right {
88
+ grid-area: sidebar-right;
89
+ }
90
+ }
91
+
92
+ .op-page__main {
93
+ grid-area: main;
94
+ }
95
+
96
+ .op-page__sidebar {
97
+ position: sticky;
98
+ z-index: var(--op-z-index-sidebar);
99
+ block-size: 100dvh;
100
+ inset-block-start: 0;
101
+ max-block-size: 100dvh;
102
+
103
+ > * {
104
+ block-size: 100%;
105
+ }
106
+ }
107
+
108
+ .op-page__main {
109
+ display: grid;
110
+ grid-template-areas:
111
+ 'main-header'
112
+ 'main-content'
113
+ 'main-footer';
114
+ grid-template-columns: minmax(0, 1fr);
115
+ grid-template-rows: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
116
+ min-block-size: 100%;
117
+
118
+ .op-page__main-header {
119
+ grid-area: main-header;
120
+ }
121
+
122
+ .op-page__main-content {
123
+ grid-area: main-content;
124
+ }
125
+
126
+ .op-page__main-footer {
127
+ grid-area: main-footer;
128
+ }
129
+
130
+ .op-page__main-header {
131
+ position: sticky;
132
+ z-index: var(--op-z-index-header);
133
+ inset-block-start: 0;
134
+ }
135
+
136
+ .op-page__main-content {
137
+ inline-size: 100%;
138
+ margin-inline: auto;
139
+ max-inline-size: var(--op-breakpoint-medium);
140
+ padding-block: var(--op-space-medium);
141
+ padding-inline: var(--op-space-large);
142
+ }
143
+
144
+ .op-page__main-footer {
145
+ position: sticky;
146
+ z-index: var(--op-z-index-footer);
147
+ inset-block-end: 0;
148
+ }
149
+ }
43
150
  }
@@ -203,7 +203,8 @@
203
203
  --op-transition-accordion-content: height 300ms ease, content-visibility 300ms ease allow-discrete;
204
204
  --op-transition-input: all 120ms ease-in;
205
205
  --op-transition-sidebar: all 200ms ease-in-out;
206
- --op-transition-modal: all 300ms ease-in;
206
+ --op-transition-modal-time: 300ms;
207
+ --op-transition-modal: all var(--op-transition-modal-time) ease-in;
207
208
  --op-transition-panel: right 400ms ease-in;
208
209
  --op-transition-tooltip: all 300ms ease-in 300ms;
209
210
 
@@ -324,21 +325,21 @@
324
325
  Start off the Screen
325
326
  */
326
327
  0% {
327
- right: -100%;
328
+ inset-inline-end: -100%;
328
329
  }
329
330
 
330
331
  /* Animate onto the screen for 0.5s */
331
332
  10% {
332
- right: var(--op-space-large);
333
+ inset-inline-end: var(--op-space-large);
333
334
  }
334
335
 
335
336
  /* Stay on the screen for 3s */
336
337
  70% {
337
- right: var(--op-space-large);
338
+ inset-inline-end: var(--op-space-large);
338
339
  }
339
340
 
340
341
  /* Animate off the screen for 1.5s */
341
342
  100% {
342
- right: -100%;
343
+ inset-inline-end: -100%;
343
344
  }
344
345
  }