tgui-core 4.0.3 → 4.1.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.
Files changed (107) hide show
  1. package/README.md +7 -0
  2. package/dist/common/constants.d.ts +1 -1
  3. package/dist/common/constants.js +1 -1
  4. package/dist/common/events.js +1 -1
  5. package/dist/common/fuzzysearch.js +1 -1
  6. package/dist/common/hotkeys.js +1 -1
  7. package/dist/common/random.js +1 -1
  8. package/dist/common/ui.js +1 -1
  9. package/dist/common/uuid.js +1 -1
  10. package/dist/common/vector.js +1 -1
  11. package/dist/components/AnimatedNumber.d.ts +2 -42
  12. package/dist/components/AnimatedNumber.js +1 -1
  13. package/dist/components/Autofocus.js +1 -1
  14. package/dist/components/Blink.js +1 -1
  15. package/dist/components/BlockQuote.js +1 -1
  16. package/dist/components/Box.d.ts +2 -2
  17. package/dist/components/Box.js +1 -1
  18. package/dist/components/Button.d.ts +1 -1
  19. package/dist/components/Button.js +1 -1
  20. package/dist/components/ByondUi.js +1 -1
  21. package/dist/components/Chart.js +1 -1
  22. package/dist/components/Collapsible.js +1 -1
  23. package/dist/components/ColorBox.js +1 -1
  24. package/dist/components/Dialog.js +1 -1
  25. package/dist/components/Dimmer.js +1 -1
  26. package/dist/components/Divider.js +1 -1
  27. package/dist/components/DmIcon.js +1 -1
  28. package/dist/components/DraggableControl.d.ts +4 -1
  29. package/dist/components/DraggableControl.js +1 -1
  30. package/dist/components/Dropdown.d.ts +2 -0
  31. package/dist/components/Dropdown.js +1 -1
  32. package/dist/components/FitText.js +1 -1
  33. package/dist/components/Flex.d.ts +1 -1
  34. package/dist/components/Flex.js +1 -1
  35. package/dist/components/Floating.d.ts +2 -1
  36. package/dist/components/Floating.js +1 -1
  37. package/dist/components/Icon.d.ts +1 -1
  38. package/dist/components/Icon.js +1 -1
  39. package/dist/components/Image.d.ts +7 -1
  40. package/dist/components/Image.js +1 -1
  41. package/dist/components/ImageButton.d.ts +1 -1
  42. package/dist/components/ImageButton.js +1 -1
  43. package/dist/components/InfinitePlane.js +1 -1
  44. package/dist/components/Input.js +1 -1
  45. package/dist/components/KeyListener.d.ts +1 -1
  46. package/dist/components/KeyListener.js +1 -1
  47. package/dist/components/Knob.d.ts +5 -5
  48. package/dist/components/Knob.js +1 -1
  49. package/dist/components/LabeledControls.js +1 -1
  50. package/dist/components/LabeledList.d.ts +1 -1
  51. package/dist/components/LabeledList.js +1 -1
  52. package/dist/components/MenuBar.js +1 -1
  53. package/dist/components/Modal.d.ts +2 -3
  54. package/dist/components/Modal.js +1 -1
  55. package/dist/components/NoticeBox.js +1 -1
  56. package/dist/components/NumberInput.d.ts +3 -3
  57. package/dist/components/NumberInput.js +1 -1
  58. package/dist/components/Popper.js +1 -1
  59. package/dist/components/ProgressBar.js +1 -1
  60. package/dist/components/RestrictedInput.js +1 -1
  61. package/dist/components/RoundGauge.js +1 -1
  62. package/dist/components/Section.js +1 -1
  63. package/dist/components/Slider.d.ts +4 -4
  64. package/dist/components/Slider.js +1 -1
  65. package/dist/components/Stack.js +1 -1
  66. package/dist/components/StyleableSection.js +1 -1
  67. package/dist/components/Table.js +1 -1
  68. package/dist/components/Tabs.js +1 -1
  69. package/dist/components/TextArea.js +1 -1
  70. package/dist/components/TimeDisplay.js +1 -1
  71. package/dist/components/Tooltip.js +1 -1
  72. package/dist/components/TrackOutsideClicks.js +1 -1
  73. package/dist/components/VirtualList.js +1 -1
  74. package/dist/components/index.js +1 -1
  75. package/package.json +15 -20
  76. package/styles/atomic/candystripe.scss +8 -0
  77. package/styles/atomic/centered-image.scss +7 -0
  78. package/styles/atomic/color.scss +17 -0
  79. package/styles/atomic/debug-layout.scss +12 -0
  80. package/styles/atomic/fit-text.scss +15 -0
  81. package/styles/atomic/links.scss +21 -0
  82. package/styles/atomic/outline.scss +43 -0
  83. package/styles/atomic/text.scss +39 -0
  84. package/styles/atomic.scss +11 -0
  85. package/styles/components/BlockQuote.scss +0 -2
  86. package/styles/components/Button.scss +83 -84
  87. package/styles/components/Dimmer.scss +0 -2
  88. package/styles/components/Divider.scss +0 -5
  89. package/styles/components/Dropdown.scss +8 -0
  90. package/styles/components/ImageButton.scss +104 -102
  91. package/styles/components/Input.scss +4 -1
  92. package/styles/components/Knob.scss +5 -21
  93. package/styles/components/LabeledList.scss +0 -2
  94. package/styles/components/NoticeBox.scss +15 -21
  95. package/styles/components/NumberInput.scss +1 -9
  96. package/styles/components/ProgressBar.scss +27 -48
  97. package/styles/components/RestrictedInput.scss +3 -0
  98. package/styles/components/RoundGauge.scss +8 -13
  99. package/styles/components/Section.scss +0 -7
  100. package/styles/components/Slider.scss +49 -42
  101. package/styles/components/Tabs.scss +1 -12
  102. package/styles/components/TextArea.scss +3 -0
  103. package/styles/components/Tooltip.scss +0 -4
  104. package/styles/functions.scss +10 -0
  105. package/styles/main.scss +0 -1
  106. package/styles/reset.scss +1 -0
  107. package/styles/vars-components.scss +5 -2
@@ -1,52 +1,59 @@
1
1
  @use "../base";
2
2
 
3
- $cursor-color: 0 !default;
4
- $popup-background-color: 0 !default;
5
- $popup-text-color: 0 !default;
6
-
7
3
  .Slider {
8
4
  cursor: e-resize;
9
5
  user-select: none;
10
- }
11
6
 
12
- .Slider__cursorOffset {
13
- position: absolute;
14
- inset: 0;
15
- transition: none !important;
16
- }
7
+ &--editing {
8
+ .Slider__cursor:before {
9
+ display: none;
10
+ }
11
+ }
17
12
 
18
- .Slider__cursor {
19
- position: absolute;
20
- top: 0;
21
- right: calc(-1 * var(--space-xxs));
22
- bottom: 0;
23
- width: 0;
24
- border-left: var(--border-thickness-small) solid var(--slider-cursor-color);
25
- }
13
+ &__cursor {
14
+ position: absolute;
15
+ inset: 0 calc(-1 * var(--space-xxs));
16
+ left: unset;
17
+ border-left: var(--border-thickness-small) solid var(--slider-cursor-color);
18
+ border-radius: var(--border-radius-circular);
26
19
 
27
- .Slider__pointer {
28
- position: absolute;
29
- right: 0;
30
- bottom: 0;
31
- width: 0;
32
- height: 0;
33
- border-left: base.em(5px) solid transparent;
34
- border-right: base.em(5px) solid transparent;
35
- border-bottom: base.em(5px) solid var(--slider-cursor-color);
36
- transform: translate(50%, calc(100% - var(--border-thickness-tiny)));
37
- }
20
+ &Offset {
21
+ position: absolute;
22
+ inset: 0;
23
+ transition: none !important;
24
+ }
38
25
 
39
- .Slider__popupValue {
40
- user-select: none;
41
- white-space: nowrap;
42
- position: absolute;
43
- right: 0;
44
- top: -2rem;
45
- font-size: 1rem;
46
- padding: var(--space-s) var(--space-m);
47
- background-color: var(--slider-popup-background);
48
- color: var(--slider-popup-color);
49
- border-radius: var(--slider-popup-border-radius);
50
- transform: translateX(50%);
51
- backdrop-filter: var(--slider-popup-blur);
26
+ &:before {
27
+ content: "";
28
+ aspect-ratio: 1 / 1;
29
+ position: absolute;
30
+ right: 0;
31
+ bottom: 0;
32
+ border-left: inherit;
33
+ transform: scale(4) translateY(50%) rotate(45deg);
34
+ transform-origin: center;
35
+ mask-image: linear-gradient(135deg, black 50%, transparent 50%);
36
+ }
37
+ }
38
+
39
+ &__popupValue {
40
+ user-select: none;
41
+ white-space: nowrap;
42
+ position: absolute;
43
+ top: -2em;
44
+ right: 0;
45
+ font-size: 1em;
46
+ padding: var(--space-s) var(--space-m);
47
+ background-color: var(--slider-popup-background);
48
+ color: var(--slider-popup-color);
49
+ border-radius: var(--slider-popup-border-radius);
50
+ transform: translateX(50%);
51
+ backdrop-filter: var(--slider-popup-blur);
52
+ }
53
+
54
+ .NumberInput__input {
55
+ inset: 2px;
56
+ width: auto;
57
+ height: auto;
58
+ }
52
59
  }
@@ -1,16 +1,5 @@
1
1
  @use "../colors";
2
2
 
3
- $fg-map: colors.$color-map !default;
4
-
5
- $color-default: 0 !default;
6
- $text-color: 0 !default;
7
- $text-color-selected: 0 !default;
8
- $tab-color: 0 !default;
9
- $tab-color-hovered: 0 !default;
10
- $tab-color-selected: 0 !default;
11
- $transition-duration: 0 !default;
12
- $border-radius: 0 !default;
13
-
14
3
  @mixin indicator($position) {
15
4
  position: relative;
16
5
  padding-#{$position}: var(--tab-indicator-size);
@@ -145,7 +134,7 @@ $border-radius: 0 !default;
145
134
  }
146
135
  }
147
136
 
148
- @each $color-name, $color-value in $fg-map {
137
+ @each $color-name, $color-value in colors.$color-map {
149
138
  .Tab--selected.Tab--color--#{$color-name} {
150
139
  color: hsl(from $color-value h s calc(l + 17.5));
151
140
  }
@@ -1,3 +1,6 @@
1
1
  .TextArea {
2
2
  resize: none;
3
+ scrollbar-width: thin;
4
+ scrollbar-gutter: stable;
5
+ scrollbar-color: var(--color-scrollbar-thumb) transparent;
3
6
  }
@@ -1,9 +1,5 @@
1
1
  @use "../base";
2
2
 
3
- $color: 0 !default;
4
- $background-color: 0 !default;
5
- $border-radius: 0 !default;
6
-
7
3
  .Tooltip {
8
4
  backdrop-filter: var(--tooltip-blur);
9
5
  background-color: var(--tooltip-background);
@@ -11,3 +11,13 @@
11
11
  }
12
12
  @return math.div($value, $value * 0 + 1);
13
13
  }
14
+
15
+ // Increases perceptual color lightness.
16
+ @function lighten($color, $amount) {
17
+ @return color.adjust($color, $lightness: $amount * 1%, $space: hsl);
18
+ }
19
+
20
+ // Decreases perceptual color lightness.
21
+ @function darken($color, $amount) {
22
+ @return color.adjust($color, $lightness: -$amount * 1%, $space: hsl);
23
+ }
package/styles/main.scss CHANGED
@@ -9,7 +9,6 @@
9
9
  @include meta.load-css("./reset.scss");
10
10
 
11
11
  // Components
12
-
13
12
  @include meta.load-css("./components/BlockQuote.scss");
14
13
  @include meta.load-css("./components/Button.scss");
15
14
  @include meta.load-css("./components/ColorBox.scss");
package/styles/reset.scss CHANGED
@@ -15,6 +15,7 @@ html {
15
15
 
16
16
  body {
17
17
  overflow: auto;
18
+ position: relative;
18
19
  font-family: var(--font-family, Verdana, Geneva, sans-serif);
19
20
  }
20
21
 
@@ -27,12 +27,15 @@
27
27
  --blockquote-border: var(--border-thickness-small) solid;
28
28
 
29
29
  /* Button */
30
+ --button-height: 1.667em;
30
31
  --button-color: var(--color-white);
31
32
  --button-color-transparent: var(--color-text-translucent);
32
33
  --button-background-default: var(--color-primary);
33
34
  --button-background-selected: var(--color-green);
34
35
  --button-background-caution: var(--color-yellow);
35
36
  --button-background-danger: var(--color-red);
37
+ --button-background-disabled: var(--undefined); // Used for theming
38
+ --button-disabled-opacity: 0.5;
36
39
  --button-border-radius: var(--border-radius-tiny);
37
40
  --button-transition: var(--transition-time-medium);
38
41
  --button-transition-timing: ease;
@@ -119,8 +122,8 @@
119
122
 
120
123
  /* Notice Box */
121
124
  --notice-box-stripes: hsla(0, 0%, 0%, 0.1);
122
- --notice-box-background: hsl(37.5, 40%, 57.5%);
123
- --notice-box-color: var(--color-text-fixed-black);
125
+ --notice-box-background: hsl(37.5, 55%, 57.5%);
126
+ --notice-box-color: var(--color-text-fixed-white);
124
127
 
125
128
  /* Number Input */
126
129
  --number-input-background: var(--input-background);