@3dsource/source-ui-native 2.0.2 → 2.0.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.
@@ -100,6 +100,30 @@
100
100
  }
101
101
  }
102
102
 
103
+ .src-icon-button--state-warning {
104
+ // @include focusRing(warning);
105
+ @include setShadow();
106
+ // most warning colors do not exist in design tokens table
107
+ // --srcButtonBorderColor: var(--src-border-button-warning);
108
+ --srcButtonIconColor: var(--src-icon-warning);
109
+
110
+ &:focus-visible {
111
+ // --srcButtonBgColor: var(--src-ui-secondary-error, rgba(239, 68, 68, 0.08));
112
+ --srcButtonIconColor: var(--src-icon-warning);
113
+ --srcButtonBorderColor: var(--src-border-button-error, #f79482);
114
+ }
115
+
116
+ @media (pointer: fine) {
117
+ &:hover {
118
+ // --srcButtonBorderColor: var(--src-border-button-error-hover, #f24122);
119
+ // --srcButtonBgColor: var(
120
+ // --src-ui-secondary-error-hover,
121
+ // rgba(239, 68, 68, 0.16)
122
+ // );
123
+ --srcButtonIconColor: var(--src-icon-warning-hover);
124
+ }
125
+ }
126
+ }
103
127
  .src-icon-button--state-error {
104
128
  @include focusRing(error);
105
129
  @include setShadow();
@@ -253,6 +277,78 @@
253
277
  }
254
278
  }
255
279
 
280
+ .src-icon-button--inline {
281
+ @include cleanShadows();
282
+ @include focusRing(default);
283
+ --srcButtonBgColor: transparent;
284
+ --srcButtonIconColor: var(--src-icon-default, #374151);
285
+ --srcButtonBorderRadius: var(--src-border-rounded, 4px);
286
+ --srcButtonPaddings: 0;
287
+ text-decoration: underline;
288
+ height: auto;
289
+
290
+ @media (pointer: fine) {
291
+ &:hover {
292
+ --srcButtonBgColor: transparent;
293
+ --srcButtonIconColor: var(--src-icon-info-hover, #016fe6);
294
+ }
295
+ }
296
+ &:active,
297
+ &.src-icon-button--pressed {
298
+ @include focusRing(default);
299
+ @include pressedButton(true);
300
+
301
+ &:hover {
302
+ --srcButtonBgColor: transparent;
303
+ }
304
+ }
305
+
306
+ &.src-icon-button--state-info {
307
+ --srcButtonBgColor: transparent;
308
+ --srcButtonIconColor: var(--src-icon-info, #017bff);
309
+
310
+ &:hover {
311
+ --srcButtonBgColor: transparent;
312
+ --srcButtonIconColor: var(--src-icon-info-hover, #016fe6);
313
+ }
314
+ }
315
+
316
+ &.src-icon-button--state-success {
317
+ --srcButtonBgColor: transparent;
318
+ --srcButtonIconColor: var(--src-icon-success, #16a34a);
319
+
320
+ &:hover {
321
+ --srcButtonBgColor: transparent;
322
+ --srcButtonIconColor: var(--src-icon-success-hover, #15803d);
323
+ }
324
+ }
325
+ &.src-icon-button--state-error,
326
+ &.src-icon-button--state-destructive {
327
+ --srcButtonBgColor: transparent;
328
+ --srcButtonIconColor: var(--src-icon-error, #f24122);
329
+
330
+ &:hover {
331
+ --srcButtonBgColor: transparent;
332
+ --srcButtonIconColor: var(--src-icon-error-hover, #c5280c);
333
+ }
334
+ }
335
+ &.src-icon-button--state-warning {
336
+ --srcButtonBgColor: transparent;
337
+ --srcButtonIconColor: var(--src-icon-warning, #d97706);
338
+
339
+ &:hover {
340
+ --srcButtonBgColor: transparent;
341
+ --srcButtonIconColor: var(--src-icon-warning-hover, #b45309);
342
+ }
343
+ }
344
+ &:disabled,
345
+ &[disabled],
346
+ &.disabled {
347
+ @include buttonText(disabled);
348
+ --srcButtonBgColor: transparent;
349
+ }
350
+ }
351
+
256
352
  .src-icon-button--plain {
257
353
  @include cleanShadows();
258
354
  @include focusRing(default);
@@ -19,15 +19,19 @@
19
19
  }
20
20
 
21
21
  .src-list__item {
22
- --srcListItemBgColor: var(--src-color-bg-default);
23
- --srcListItemBgHoverColor: var(--src-color-bg-default-hover);
22
+ --srcListItemBgColor: transparent;
23
+ --srcListItemBgHoverColor: var(
24
+ --src-ui-secondary-default-hover,
25
+ rgba(148, 163, 184, 0.16)
26
+ );
24
27
  --srcListItemBorderRadius: var(--src-border-rounded, 4px);
25
28
  --srcListItemBoxShadow: none;
26
- --srcListItemFontColor: var(--src-color-text-default);
27
- --srcListItemFontSize: var(--src-font-size-sm, 14px);
28
- --srcListItemFontWeight: var(--src-font-weight-regular, 400);
29
- --srcListItemLineHeight: var(--src-font-line-sm, 20px);
30
- --srcListItemPaddings: 8px;
29
+ --srcListItemFontColor: var(--src-text-body-secondary, #4b5563);
30
+ --srcListItemFontSize: var(--src-text-fontSize, 12px);
31
+ --srcListItemFontWeight: 500;
32
+ --srcListItemLineHeight: var(--src-text-lineHeight, 16px);
33
+ --srcListItemPaddings: var(--src-padding-xs, 8px) var(--src-padding-xs, 8px)
34
+ var(--src-padding-xs, 8px) var(--src-padding-sm, 8px);
31
35
  --srcListItemTextTransform: default;
32
36
  --srcListItemDisplay: block;
33
37
  position: relative;
@@ -41,6 +45,7 @@
41
45
  color: var(--srcListItemFontColor);
42
46
  text-transform: var(--srcListItemTextTransform);
43
47
  letter-spacing: 0;
48
+
44
49
  white-space: normal;
45
50
  background-color: var(--srcListItemBgColor);
46
51
  border-radius: var(--srcListItemBorderRadius);
@@ -50,7 +55,7 @@
50
55
  &--flex {
51
56
  --srcListItemDisplay: inline-flex;
52
57
  align-items: flex-start;
53
- gap: 8px;
58
+ gap: var(--src-gap-md, 6px);
54
59
  }
55
60
  @media (hover: hover) and (pointer: fine) {
56
61
  &:hover,
@@ -59,6 +64,10 @@
59
64
  }
60
65
  }
61
66
 
67
+ &:active {
68
+ background-color: var(--src-ui-secondary-active, rgba(1, 123, 255, 0.12));
69
+ }
70
+
62
71
  &:disabled,
63
72
  &[disabled],
64
73
  &.disabled,
@@ -1,17 +1,24 @@
1
1
  // Basic styles for typical modal component
2
2
  .src-modal {
3
- --srcModalWidth: 620px;
3
+ --srcModalWidth: 422px;
4
4
  --srcModalMaxWidth: calc(100% - 16px);
5
5
  --srcModalMaxHeight: 80vh;
6
- --srcModalBg: var(--src-color-bg-default);
7
- --srcModalBoxShadow: var(--src-shadow-large);
8
- --srcModalBorderRadius: var(--src-border-rounded-parent);
9
- --srcModalTitleSize: var(--src-font-size-base);
10
- --srcModalTitleLineHeight: var(--src-font-line-base);
11
- --srcModalTitleColor: var(--src-color-text-default);
12
- --srcModalBodyPadding: 20px;
13
- --srcModalTitleBorder: 1px solid var(--src-color-border-default, #e5e7eb);
14
- --srcModalFooterBorder: 1px solid var(--src-color-border-default, #e5e7eb);
6
+ --srcModalBg: var(--src-surface-container-main, #fff);
7
+ --srcModalBoxShadow:
8
+ 0 16px 36px 4px var(--src-shadow-hard, rgba(71, 85, 105, 0.24)),
9
+ 0 1px 4px 0 var(--src-shadow-light, rgba(148, 163, 184, 0.16));
10
+ --srcModalBorderRadius: var(--src-layout-radius-const-rounded-md, 12px);
11
+ --srcModalTitleSize: var(--src-font-size-base, 16px);
12
+ --srcModalTitleLineHeight: var(--src-font-line-base, 24px);
13
+ --srcModalTitleColor: var(--src-text-body-main, #111827);
14
+ --srcModalBodyPadding: var(--src-layout-padding-const-lg, 16px)
15
+ var(--src-layout-padding-const-xl, 24px)
16
+ var(--src-layout-padding-const-2xl, 32px)
17
+ var(--src-layout-padding-const-xl, 24px);
18
+
19
+ --srcModalTitleBorder: none;
20
+ --srcModalFooterBorder: 1px solid
21
+ var(--src-border-container-light, rgba(148, 163, 184, 0.16));
15
22
  display: grid;
16
23
  grid-template-columns: minmax(0, 1fr);
17
24
  grid-template-rows: auto minmax(0, 1fr) auto;
@@ -23,22 +30,55 @@
23
30
  border-radius: var(--srcModalBorderRadius);
24
31
  box-shadow: var(--srcModalBoxShadow);
25
32
 
33
+ color: var(--src-text-body-secondary, #4b5563);
34
+
35
+ font-family: var(--src-font-family-header, Inter);
36
+ font-size: var(--src-font-size-sm, 14px);
37
+ font-style: normal;
38
+ font-weight: 400;
39
+ line-height: var(--src-font-line-sm, 20px);
40
+
41
+ // deprecated
26
42
  &--small {
27
43
  --srcModalWidth: 380px;
28
44
  }
29
45
 
30
46
  .src-modal__header {
47
+ position: relative;
31
48
  display: flex;
32
- padding: 14px 16px 14px 20px;
49
+ padding: 0;
33
50
  width: 100%;
34
51
  border-bottom: var(--srcModalTitleBorder);
35
52
  }
36
53
 
37
54
  .src-modal__body {
55
+ display: grid;
56
+ grid-template-columns: minmax(0, 1fr);
57
+ grid-template-rows: auto minmax(0, 1fr);
58
+ gap: var(--src-layout-gap-const-md, 12px);
59
+
38
60
  padding: var(--srcModalBodyPadding);
39
61
  overflow: auto;
40
62
  scrollbar-width: thin;
41
63
  scrollbar-color: var(--src-color-border-default) transparent;
64
+ .src-modal__title,
65
+ .src-modal__scroll-box {
66
+ grid-column: 1 / -1;
67
+ }
68
+
69
+ &--icon {
70
+ grid-template-columns: 24px minmax(0, 1fr);
71
+ .src-modal__icon {
72
+ grid-column: 1 / 2;
73
+ grid-row: 1 / -1;
74
+ }
75
+ .src-modal__title {
76
+ grid-column: 2 / -1;
77
+ }
78
+ .src-modal__scroll-box {
79
+ grid-column: 2 / -1;
80
+ }
81
+ }
42
82
 
43
83
  &::-webkit-scrollbar {
44
84
  width: 4px;
@@ -58,25 +98,55 @@
58
98
  display: flex;
59
99
  justify-content: flex-end;
60
100
  align-items: center;
61
- padding: 16px;
101
+ padding: var(--src-layout-padding-const-md, 12px)
102
+ var(--src-layout-padding-const-xl, 24px)
103
+ var(--src-layout-padding-const-lg, 16px)
104
+ var(--src-layout-padding-const-xl, 24px);
62
105
  width: 100%;
63
106
  border-top: var(--srcModalFooterBorder);
107
+ gap: 8px;
108
+
109
+ @media (max-width: 767px) {
110
+ flex-direction: column-reverse;
111
+ .src-modal__footer-group {
112
+ width: 100%;
113
+ }
114
+ .src-modal__footer-group src-button {
115
+ flex-grow: 1;
116
+
117
+ .src-button {
118
+ --srcButtonWidth: 100%;
119
+ }
120
+ }
121
+ }
122
+
123
+ &:has(.src-modal__footer-group:nth-child(2)) {
124
+ justify-content: space-between;
125
+ }
126
+ }
127
+
128
+ .src-modal__footer-group {
129
+ display: flex;
64
130
  gap: 10px;
65
131
  }
66
132
 
67
133
  .src-modal__title {
68
134
  font-size: var(--srcModalTitleSize);
69
- font-weight: var(--src-font-weight-semiBold, 600);
135
+ font-weight: 600;
70
136
  line-height: var(--srcModalTitleLineHeight);
71
137
  color: var(--srcModalTitleColor);
72
138
  word-break: break-word;
73
139
  }
74
140
 
75
141
  .src-modal__back {
142
+ // Deprecated, will be removed in future versions
76
143
  margin-right: 8px;
77
144
  }
78
145
 
79
146
  .src-modal__close {
147
+ position: absolute;
148
+ top: 4px;
149
+ right: 4px;
80
150
  margin-left: auto;
81
151
  }
82
152
  }
@@ -24,8 +24,10 @@ $font-colors: (
24
24
  info: var(--src-text-ui-accent-main, #016fe6),
25
25
  error: var(--src-text-ui-distruct-main, #c5280c),
26
26
  success: var(--src-text-ui-success-main, #16a34a),
27
+ warning: var(--src-text-ui-warning-main, #d97706),
27
28
  info-hover: var(--src-text-ui-accent-hover, #0162cc),
28
29
  error-hover: var(--src-text-ui-distruct-hover, #9f200a),
30
+ warning-hover: var(--src-text-ui-warning-hover, #b45309),
29
31
  success-hover: var(--src-text-ui-success-hover, #15803d),
30
32
  );
31
33