@soxa-ui/theme-base 0.3.0-beta.1 → 0.3.1-beta.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.
@@ -43,10 +43,18 @@
43
43
  }
44
44
 
45
45
  .so-tabs {
46
+ min-width: 0;
46
47
  display: flex;
47
48
  width: 100%;
48
49
  }
49
50
 
51
+ /* Keep a long tab row reachable inside its own viewport on narrow screens. */
52
+ .so-tabs--orientation-horizontal > .so-tabs__bar {
53
+ min-width: 0;
54
+ overflow-x: auto;
55
+ overflow-y: hidden;
56
+ }
57
+
50
58
  .so-tabs--orientation-horizontal {
51
59
  flex-direction: column;
52
60
  }
@@ -122,22 +130,35 @@
122
130
  justify-content: center;
123
131
  }
124
132
 
125
- /* Выключенный набор гаснет корнем целиком — табы вместе с панелями
126
- * (`disabled.css`): набор читается выключенным весь, а выключить поля в
127
- * панелях — дело приложения. Нажатия гаснут у всего набора, в панелях тоже.
128
- * Состояние — `data-disabled` корня: ядро пишет его на любом теге, а
129
- * модификатора `--disabled` у блока нет. Табы выключены вместе с набором — их
130
- * `disabled` распространяется от владельца — и под погасшим корнем второй раз
131
- * не гаснут. */
133
+ /* Keep panel content readable when the set is disabled. Only the tab bar
134
+ * dims; its disabled descendants must not dim a second time. Interaction
135
+ * stays disabled for the whole set, including its panels. */
132
136
  .so-tabs[data-disabled='true'] {
133
- opacity: var(--so-disabled-opacity);
134
137
  pointer-events: none;
135
138
  }
136
139
 
137
- .so-tabs[data-disabled='true'] > * {
140
+ .so-tabs[data-disabled='true'] > .so-tabs__bar {
141
+ opacity: var(--so-disabled-opacity);
142
+ }
143
+
144
+ .so-tabs[data-disabled='true'] > .so-tabs__bar > * {
138
145
  --so-disabled-opacity: 1;
139
146
  }
140
147
 
148
+ /* WebKit scrolls a focused container only when the container can receive
149
+ * pointer events. Restore the measured scroll surface or a focused inner stop,
150
+ * while its contents
151
+ * keep the disabled subtree's pointer policy and native disabled state. */
152
+ .so-tabs[data-disabled='true'] > .so-tabs__bar:is([tabindex='0'], :focus-within) {
153
+ pointer-events: auto;
154
+ }
155
+
156
+ .so-tabs[data-disabled='true']
157
+ > .so-tabs__bar:is([tabindex='0'], :focus-within)
158
+ > :is(.so-tabs__leading, .so-tabs__list, .so-tabs__trailing) {
159
+ pointer-events: none;
160
+ }
161
+
141
162
  /* Строка таба и кнопка закрытия — соседи в одну линию. Внутри строки кнопке
142
163
  * не место: строка — `<button role="tab">`, интерактивный потомок у кнопки
143
164
  * запрещён, а подпись крестика вошла бы в имя таба. Поэтому всё, что
@@ -0,0 +1,30 @@
1
+ /* A group of buttons, laid out on one axis. The buttons keep the Button scale. */
2
+ :root {
3
+ --so-toggle-group-gap: 0.25rem;
4
+ --so-toggle-group-bleed: 0.25rem;
5
+ }
6
+
7
+ .so-toggle-group {
8
+ display: inline-flex;
9
+ min-inline-size: 0;
10
+ max-inline-size: 100%;
11
+ align-items: center;
12
+ gap: var(--so-toggle-group-gap);
13
+ }
14
+
15
+ /* Keep every action reachable without widening the page. Padding preserves
16
+ * the buttons' outer focus rings inside the scroll viewport. */
17
+ .so-toggle-group--orientation-horizontal {
18
+ overflow-x: auto;
19
+ padding: var(--so-toggle-group-bleed);
20
+ scroll-padding-inline: var(--so-toggle-group-bleed);
21
+ }
22
+
23
+ .so-toggle-group--orientation-horizontal > .so-toggle-group-item {
24
+ flex-shrink: 0;
25
+ }
26
+
27
+ .so-toggle-group--orientation-vertical {
28
+ flex-direction: column;
29
+ align-items: stretch;
30
+ }
package/src/index.css CHANGED
@@ -44,12 +44,12 @@
44
44
  * the README of the package. */
45
45
 
46
46
  @layer so.reset, so.direction, so.disabled, so.caption, so.required, so.target, so.group,
47
- so.anchored, so.swipe, so.place, so.icon, so.button, so.check-box, so.accordion, so.date-input,
48
- so.modal, so.dialog, so.drag-and-drop, so.drawer, so.input, so.label, so.field, so.list-box,
49
- so.menu, so.number-input, so.pagination, so.popover, so.calendar, so.date-picker,
47
+ so.anchored, so.swipe, so.place, so.icon, so.avatar, so.avatar-group, so.button, so.toggle-group, so.check-box, so.accordion, so.date-input,
48
+ so.modal, so.dialog, so.alert-dialog, so.drag-and-drop, so.drawer, so.input, so.badge, so.label, so.field, so.list-box,
49
+ so.menu, so.breadcrumbs, so.number-input, so.pagination, so.popover, so.calendar, so.date-picker,
50
50
  so.progress-linear, so.progress-spinner, so.radio-group, so.rating, so.scroller, so.select,
51
- so.skeleton, so.slider, so.switch, so.table, so.tabs, so.tags, so.textarea, so.toasts,
52
- so.tooltip;
51
+ so.separator, so.skeleton, so.slider, so.switch, so.table, so.tabs, so.tags, so.textarea, so.toasts,
52
+ so.tooltip, so.code-block, so.alert;
53
53
 
54
54
  @import './reset.css' layer(so.reset);
55
55
  @import './direction.css' layer(so.direction);
@@ -62,19 +62,25 @@
62
62
  @import './swipe.css' layer(so.swipe);
63
63
  @import './place.css' layer(so.place);
64
64
  @import './components/icon.css' layer(so.icon);
65
+ @import './components/avatar.css' layer(so.avatar);
66
+ @import './components/avatar-group.css' layer(so.avatar-group);
65
67
  @import './components/button.css' layer(so.button);
68
+ @import './components/toggle-group.css' layer(so.toggle-group);
66
69
  @import './components/check-box.css' layer(so.check-box);
67
70
  @import './components/accordion.css' layer(so.accordion);
68
71
  @import './components/date-input.css' layer(so.date-input);
69
72
  @import './modal.css' layer(so.modal);
70
73
  @import './components/dialog.css' layer(so.dialog);
74
+ @import './components/alert-dialog.css' layer(so.alert-dialog);
71
75
  @import './components/drag-and-drop.css' layer(so.drag-and-drop);
72
76
  @import './components/drawer.css' layer(so.drawer);
73
77
  @import './components/input.css' layer(so.input);
78
+ @import './components/badge.css' layer(so.badge);
74
79
  @import './components/label.css' layer(so.label);
75
80
  @import './components/field.css' layer(so.field);
76
81
  @import './components/list-box.css' layer(so.list-box);
77
82
  @import './components/menu.css' layer(so.menu);
83
+ @import './components/breadcrumbs.css' layer(so.breadcrumbs);
78
84
  @import './components/number-input.css' layer(so.number-input);
79
85
  @import './components/pagination.css' layer(so.pagination);
80
86
  @import './components/popover.css' layer(so.popover);
@@ -86,6 +92,7 @@
86
92
  @import './components/rating.css' layer(so.rating);
87
93
  @import './components/scroller.css' layer(so.scroller);
88
94
  @import './components/select.css' layer(so.select);
95
+ @import './components/separator.css' layer(so.separator);
89
96
  @import './components/skeleton.css' layer(so.skeleton);
90
97
  @import './components/slider.css' layer(so.slider);
91
98
  @import './components/switch.css' layer(so.switch);
@@ -95,3 +102,7 @@
95
102
  @import './components/textarea.css' layer(so.textarea);
96
103
  @import './components/toasts.css' layer(so.toasts);
97
104
  @import './components/tooltip.css' layer(so.tooltip);
105
+
106
+ @import './components/code-block.css' layer(so.code-block);
107
+
108
+ @import './components/alert.css' layer(so.alert);
package/src/modal.css CHANGED
@@ -61,20 +61,23 @@
61
61
  }
62
62
 
63
63
  .so-dialog__backdrop,
64
- .so-drawer__backdrop {
64
+ .so-drawer__backdrop,
65
+ .so-alert-dialog__backdrop {
65
66
  position: fixed;
66
67
  inset: 0;
67
68
  }
68
69
 
69
70
  .so-dialog,
70
- .so-drawer {
71
+ .so-drawer,
72
+ .so-alert-dialog {
71
73
  display: grid;
72
74
  overflow: hidden;
73
75
  }
74
76
 
75
77
  /* Заголовок рисуется всегда: на него панель ссылается `aria-labelledby`. */
76
78
  .so-dialog__title,
77
- .so-drawer__title {
79
+ .so-drawer__title,
80
+ .so-alert-dialog__title {
78
81
  grid-area: title;
79
82
  padding: var(--so-modal-padding) var(--so-modal-padding) 0;
80
83
  line-height: var(--so-modal-title-line);
@@ -82,12 +85,14 @@
82
85
  }
83
86
 
84
87
  .so-dialog__title:empty,
85
- .so-drawer__title:empty {
88
+ .so-drawer__title:empty,
89
+ .so-alert-dialog__title:empty {
86
90
  display: none;
87
91
  }
88
92
 
89
93
  .so-dialog__body,
90
- .so-drawer__body {
94
+ .so-drawer__body,
95
+ .so-alert-dialog__body {
91
96
  grid-area: body;
92
97
  min-height: 0;
93
98
  padding: var(--so-modal-gap) var(--so-modal-padding);
@@ -96,13 +101,18 @@
96
101
  overflow-wrap: break-word;
97
102
  }
98
103
 
99
- :where(.so-dialog__body > .so-table__viewport, .so-drawer__body > .so-table__viewport) {
104
+ :where(
105
+ .so-dialog__body > .so-table__viewport,
106
+ .so-drawer__body > .so-table__viewport,
107
+ .so-alert-dialog__body > .so-table__viewport
108
+ ) {
100
109
  --so-table-head-offset: calc(-1 * var(--so-modal-gap));
101
110
  }
102
111
 
103
112
  /* Подвал — ряд действий в конце строки, в RTL он сам встаёт слева. */
104
113
  .so-dialog__footer,
105
- .so-drawer__footer {
114
+ .so-drawer__footer,
115
+ .so-alert-dialog__footer {
106
116
  grid-area: footer;
107
117
  display: flex;
108
118
  flex-wrap: wrap;
@@ -113,7 +123,8 @@
113
123
  }
114
124
 
115
125
  .so-dialog__footer:empty,
116
- .so-drawer__footer:empty {
126
+ .so-drawer__footer:empty,
127
+ .so-alert-dialog__footer:empty {
117
128
  display: none;
118
129
  }
119
130
 
@@ -121,7 +132,9 @@
121
132
  * панели полным отступом, а не промежутком после шапки. */
122
133
  .so-dialog:not(:has(> .so-dialog__title:not(:empty), > .so-dialog__maximize, > .so-dialog__close))
123
134
  > .so-dialog__body,
124
- .so-drawer:not(:has(> .so-drawer__title:not(:empty), > .so-drawer__close)) > .so-drawer__body {
135
+ .so-drawer:not(:has(> .so-drawer__title:not(:empty), > .so-drawer__close)) > .so-drawer__body,
136
+ .so-alert-dialog:not(:has(> .so-alert-dialog__title:not(:empty), > .so-alert-dialog__close))
137
+ > .so-alert-dialog__body {
125
138
  padding-block-start: var(--so-modal-padding);
126
139
  }
127
140
 
@@ -133,6 +146,9 @@
133
146
  > .so-table__viewport,
134
147
  .so-drawer:not(:has(> .so-drawer__title:not(:empty), > .so-drawer__close))
135
148
  > .so-drawer__body
149
+ > .so-table__viewport,
150
+ .so-alert-dialog:not(:has(> .so-alert-dialog__title:not(:empty), > .so-alert-dialog__close))
151
+ > .so-alert-dialog__body
136
152
  > .so-table__viewport
137
153
  ) {
138
154
  --so-table-head-offset: calc(-1 * var(--so-modal-padding));
@@ -140,13 +156,15 @@
140
156
 
141
157
  /* Подвала нет — тело кончается у нижнего края панели полным отступом. */
142
158
  .so-dialog:has(> .so-dialog__footer:empty) > .so-dialog__body,
143
- .so-drawer:has(> .so-drawer__footer:empty) > .so-drawer__body {
159
+ .so-drawer:has(> .so-drawer__footer:empty) > .so-drawer__body,
160
+ .so-alert-dialog:has(> .so-alert-dialog__footer:empty) > .so-alert-dialog__body {
144
161
  padding-block-end: var(--so-modal-padding);
145
162
  }
146
163
 
147
164
  .so-dialog__maximize,
148
165
  .so-dialog__close,
149
- .so-drawer__close {
166
+ .so-drawer__close,
167
+ .so-alert-dialog__close {
150
168
  flex-shrink: 0;
151
169
  align-self: flex-start;
152
170
  aspect-ratio: 1;
@@ -159,7 +177,8 @@
159
177
 
160
178
  .so-dialog__maximize:last-child,
161
179
  .so-dialog__close:last-child,
162
- .so-drawer__close:last-child {
180
+ .so-drawer__close:last-child,
181
+ .so-alert-dialog__close:last-child {
163
182
  margin-inline-end: calc(var(--so-modal-padding) - var(--so-button-height-normal) / 4);
164
183
  }
165
184
 
@@ -168,7 +187,8 @@
168
187
  * потребителя, что бы в нём ни лежало. */
169
188
  .so-dialog__maximize > .so-button__text,
170
189
  .so-dialog__close > .so-button__text,
171
- .so-drawer__close > .so-button__text {
190
+ .so-drawer__close > .so-button__text,
191
+ .so-alert-dialog__close > .so-button__text {
172
192
  display: flex;
173
193
  justify-content: center;
174
194
  }
@@ -178,6 +198,7 @@
178
198
  }
179
199
 
180
200
  .so-dialog__close,
181
- .so-drawer__close {
201
+ .so-drawer__close,
202
+ .so-alert-dialog__close {
182
203
  grid-area: close;
183
204
  }
package/src/place.css CHANGED
@@ -24,6 +24,7 @@
24
24
  .so-menu__panel,
25
25
  .so-menu-item__panel,
26
26
  .so-dialog,
27
+ .so-alert-dialog,
27
28
  .so-drawer,
28
29
  .so-toasts-item__card {
29
30
  --so-place-surface: var(--so-panel-surface);