@stoplight/ui-kit 3.0.0-beta.4 → 3.0.0-beta.40

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 (164) hide show
  1. package/AutoSizer/index.js +3 -2
  2. package/AutoSizer/index.js.map +1 -1
  3. package/CodeEditor/index.d.ts +2 -0
  4. package/CodeEditor/index.js +7 -5
  5. package/CodeEditor/index.js.map +1 -1
  6. package/CodeEditor/utils/highlightCode.js +2 -1
  7. package/CodeEditor/utils/highlightCode.js.map +1 -1
  8. package/CodeViewer/components/BlockCodeViewer/BlockCodeViewer.d.ts +8 -0
  9. package/CodeViewer/components/BlockCodeViewer/BlockCodeViewer.js +51 -0
  10. package/CodeViewer/components/BlockCodeViewer/BlockCodeViewer.js.map +1 -0
  11. package/CodeViewer/components/BlockCodeViewer/ObservableSet.d.ts +5 -0
  12. package/CodeViewer/components/BlockCodeViewer/ObservableSet.js +24 -0
  13. package/CodeViewer/components/BlockCodeViewer/ObservableSet.js.map +1 -0
  14. package/CodeViewer/components/BlockCodeViewer/SingleCodeBlock.d.ts +12 -0
  15. package/CodeViewer/components/BlockCodeViewer/SingleCodeBlock.js +59 -0
  16. package/CodeViewer/components/BlockCodeViewer/SingleCodeBlock.js.map +1 -0
  17. package/CodeViewer/components/BlockCodeViewer/consts.d.ts +1 -0
  18. package/{TableOfContents/types.js → CodeViewer/components/BlockCodeViewer/consts.js} +2 -1
  19. package/CodeViewer/components/BlockCodeViewer/consts.js.map +1 -0
  20. package/CodeViewer/components/BlockCodeViewer/hooks/useSlicedBlocks.d.ts +7 -0
  21. package/CodeViewer/components/BlockCodeViewer/hooks/useSlicedBlocks.js +29 -0
  22. package/CodeViewer/components/BlockCodeViewer/hooks/useSlicedBlocks.js.map +1 -0
  23. package/CodeViewer/components/BlockCodeViewer/index.d.ts +2 -0
  24. package/CodeViewer/components/BlockCodeViewer/index.js +5 -0
  25. package/CodeViewer/components/BlockCodeViewer/index.js.map +1 -0
  26. package/CodeViewer/components/InlineCodeViewer.d.ts +5 -0
  27. package/CodeViewer/components/InlineCodeViewer.js +11 -0
  28. package/CodeViewer/components/InlineCodeViewer.js.map +1 -0
  29. package/CodeViewer/index.d.ts +1 -2
  30. package/CodeViewer/index.js +7 -16
  31. package/CodeViewer/index.js.map +1 -1
  32. package/CodeViewer/utils/astToReact.d.ts +3 -0
  33. package/CodeViewer/utils/astToReact.js +16 -0
  34. package/CodeViewer/utils/astToReact.js.map +1 -0
  35. package/CodeViewer/utils/lineNumberify.d.ts +2 -0
  36. package/CodeViewer/utils/lineNumberify.js +94 -0
  37. package/CodeViewer/utils/lineNumberify.js.map +1 -0
  38. package/CodeViewer/utils/parseCode.d.ts +2 -0
  39. package/CodeViewer/utils/parseCode.js +58 -0
  40. package/CodeViewer/utils/parseCode.js.map +1 -0
  41. package/Dropdown/Dropdown.js +2 -2
  42. package/Dropdown/Dropdown.js.map +1 -1
  43. package/FAIcon/index.js +3 -2
  44. package/FAIcon/index.js.map +1 -1
  45. package/FormButton/index.js +1 -1
  46. package/FormButton/index.js.map +1 -1
  47. package/FormError/index.js +2 -1
  48. package/FormError/index.js.map +1 -1
  49. package/FormInput/index.js +1 -1
  50. package/FormInput/index.js.map +1 -1
  51. package/ScrollContainer/index.js +3 -3
  52. package/ScrollContainer/index.js.map +1 -1
  53. package/ScrollList/index.js +12 -6
  54. package/ScrollList/index.js.map +1 -1
  55. package/SecretInput/index.js +1 -1
  56. package/SecretInput/index.js.map +1 -1
  57. package/SimpleTabs/Tab.js +3 -3
  58. package/SimpleTabs/Tab.js.map +1 -1
  59. package/SimpleTabs/TabList.js +3 -3
  60. package/SimpleTabs/TabList.js.map +1 -1
  61. package/SimpleTabs/TabPanel.js +3 -3
  62. package/SimpleTabs/TabPanel.js.map +1 -1
  63. package/TableOfContents/index.d.ts +61 -10
  64. package/TableOfContents/index.js +171 -62
  65. package/TableOfContents/index.js.map +1 -1
  66. package/ThemeContainer/index.js +4 -3
  67. package/ThemeContainer/index.js.map +1 -1
  68. package/_hooks/useIsMobile.js +2 -1
  69. package/_hooks/useIsMobile.js.map +1 -1
  70. package/_hooks/useValidateSchema.js +2 -1
  71. package/_hooks/useValidateSchema.js.map +1 -1
  72. package/classes.d.ts +3 -1
  73. package/classes.js +1 -1
  74. package/classes.js.map +1 -1
  75. package/index.d.ts +1 -0
  76. package/index.js +1 -0
  77. package/index.js.map +1 -1
  78. package/package.json +10 -8
  79. package/styles/_blueprint.scss +4 -4
  80. package/styles/_components.scss +3 -0
  81. package/styles/blueprint/_variables.scss +3 -1
  82. package/styles/blueprint/select/blueprint-select.scss +8 -0
  83. package/styles/blueprint/select/components/_index.scss +6 -0
  84. package/styles/blueprint/select/components/omnibar/_omnibar.scss +63 -0
  85. package/styles/blueprint/select/components/select/_multi-select.scss +17 -0
  86. package/styles/blueprint/select/components/select/_select.scss +31 -0
  87. package/styles/blueprint/src/_reset.scss +43 -0
  88. package/styles/blueprint/src/_typography.scss +459 -0
  89. package/styles/blueprint/src/accessibility/_focus-states.scss +17 -0
  90. package/styles/blueprint/src/blueprint-hi-contrast.scss +22 -0
  91. package/styles/blueprint/src/blueprint.scss +16 -0
  92. package/styles/blueprint/src/common/_color-aliases.scss +43 -0
  93. package/styles/blueprint/src/common/_colors.scss +116 -0
  94. package/styles/blueprint/src/common/_flex.scss +49 -0
  95. package/styles/blueprint/src/common/_mixins.scss +128 -0
  96. package/styles/blueprint/src/common/_react-transition.scss +117 -0
  97. package/styles/blueprint/src/common/_variables.scss +131 -0
  98. package/styles/blueprint/src/components/_index.scss +38 -0
  99. package/styles/blueprint/src/components/alert/_alert.scss +33 -0
  100. package/styles/blueprint/src/components/breadcrumbs/_breadcrumbs.scss +142 -0
  101. package/styles/blueprint/src/components/button/_button-group.scss +240 -0
  102. package/styles/blueprint/src/components/button/_button.scss +206 -0
  103. package/styles/blueprint/src/components/button/_common.scss +507 -0
  104. package/styles/blueprint/src/components/callout/_callout.scss +99 -0
  105. package/styles/blueprint/src/components/card/_card.scss +91 -0
  106. package/styles/blueprint/src/components/collapse/_collapse.scss +20 -0
  107. package/styles/blueprint/src/components/context-menu/_context-menu.scss +10 -0
  108. package/styles/blueprint/src/components/dialog/_dialog.scss +146 -0
  109. package/styles/blueprint/src/components/divider/_divider.scss +19 -0
  110. package/styles/blueprint/src/components/drawer/_drawer.scss +232 -0
  111. package/styles/blueprint/src/components/editable-text/_editable-text.scss +156 -0
  112. package/styles/blueprint/src/components/forms/_common.scss +239 -0
  113. package/styles/blueprint/src/components/forms/_control-group.scss +276 -0
  114. package/styles/blueprint/src/components/forms/_controls.scss +526 -0
  115. package/styles/blueprint/src/components/forms/_file-input.scss +155 -0
  116. package/styles/blueprint/src/components/forms/_form-group.scss +111 -0
  117. package/styles/blueprint/src/components/forms/_index.scss +20 -0
  118. package/styles/blueprint/src/components/forms/_input-group.scss +247 -0
  119. package/styles/blueprint/src/components/forms/_input.scss +115 -0
  120. package/styles/blueprint/src/components/forms/_label.scss +114 -0
  121. package/styles/blueprint/src/components/forms/_numeric-input.scss +40 -0
  122. package/styles/blueprint/src/components/hotkeys/_hotkeys.scss +50 -0
  123. package/styles/blueprint/src/components/html-select/_common.scss +52 -0
  124. package/styles/blueprint/src/components/html-select/_html-select.scss +104 -0
  125. package/styles/blueprint/src/components/html-table/_html-table.scss +208 -0
  126. package/styles/blueprint/src/components/icon/_icon.scss +79 -0
  127. package/styles/blueprint/src/components/menu/_common.scss +172 -0
  128. package/styles/blueprint/src/components/menu/_menu.scss +197 -0
  129. package/styles/blueprint/src/components/menu/_submenu.scss +41 -0
  130. package/styles/blueprint/src/components/navbar/_navbar.scss +117 -0
  131. package/styles/blueprint/src/components/non-ideal-state/_non-ideal-state.scss +43 -0
  132. package/styles/blueprint/src/components/overflow-list/_overflow-list.scss +13 -0
  133. package/styles/blueprint/src/components/overlay/_overlay.scss +94 -0
  134. package/styles/blueprint/src/components/panel-stack/_panel-stack.scss +103 -0
  135. package/styles/blueprint/src/components/popover/_common.scss +171 -0
  136. package/styles/blueprint/src/components/popover/_popover.scss +127 -0
  137. package/styles/blueprint/src/components/portal/_portal.scss +15 -0
  138. package/styles/blueprint/src/components/progress-bar/_common.scss +9 -0
  139. package/styles/blueprint/src/components/progress-bar/_progress-bar.scss +98 -0
  140. package/styles/blueprint/src/components/skeleton/_common.scss +8 -0
  141. package/styles/blueprint/src/components/skeleton/_skeleton.scss +64 -0
  142. package/styles/blueprint/src/components/slider/_common.scss +48 -0
  143. package/styles/blueprint/src/components/slider/_slider.scss +216 -0
  144. package/styles/blueprint/src/components/spinner/_spinner.scss +65 -0
  145. package/styles/blueprint/src/components/tabs/_tabs.scss +199 -0
  146. package/styles/blueprint/src/components/tag/_common.scss +202 -0
  147. package/styles/blueprint/src/components/tag/_tag.scss +75 -0
  148. package/styles/blueprint/src/components/tag-input/_tag-input.scss +165 -0
  149. package/styles/blueprint/src/components/toast/_toast.scss +203 -0
  150. package/styles/blueprint/src/components/tooltip/_common.scss +11 -0
  151. package/styles/blueprint/src/components/tooltip/_tooltip.scss +61 -0
  152. package/styles/blueprint/src/components/tree/_tree.scss +194 -0
  153. package/styles/components/Code/_base.scss +104 -25
  154. package/styles/components/TableOfContents/_base.scss +50 -43
  155. package/styles/tailwind/_base.scss +15423 -10455
  156. package/styles/tailwind/tailwind.config.js +1 -0
  157. package/CodeViewer/types.d.ts +0 -9
  158. package/CodeViewer/types.js +0 -3
  159. package/CodeViewer/types.js.map +0 -1
  160. package/TableOfContents/types.d.ts +0 -14
  161. package/TableOfContents/types.js.map +0 -1
  162. package/withErrorBoundary.d.ts +0 -104
  163. package/withErrorBoundary.js +0 -51
  164. package/withErrorBoundary.js.map +0 -1
@@ -1,20 +1,20 @@
1
1
  @import 'theme-light';
2
2
  @import 'theme-dark';
3
+ @import '../../blueprint/colors.scss';
3
4
 
4
- .CodeEditor {
5
- @include lightCodeTheme;
5
+ $line-number-char-width: 10px;
6
+ $line-padding-left: 10px;
6
7
 
7
- &--inline {
8
- margin: 0 2px;
9
- border-radius: 2px;
8
+ @keyframes set-color {
9
+ 0% {
10
+ color: inherit;
10
11
  }
12
+ }
11
13
 
12
- &--line-numbers {
13
- textarea {
14
- // Need to use margin here since CodeEditor supports padding: https://github.com/stoplightio/ui-kit/blob/fd1334753a22d527b803b8554bc51761c348d319/src/CodeEditor/index.tsx#L13
15
- margin-left: 35px !important;
16
- }
17
- }
14
+
15
+ .CodeEditor,
16
+ .CodeViewer {
17
+ @include lightCodeTheme;
18
18
 
19
19
  font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace;
20
20
  background: var(--code-bg);
@@ -24,8 +24,8 @@
24
24
  hyphens: none;
25
25
  direction: ltr;
26
26
 
27
- .bp3-dark,
28
- data[theme='dark'] & {
27
+ .#{$ns}-dark &,
28
+ [data-theme="dark"] & {
29
29
  @include darkCodeTheme;
30
30
  }
31
31
 
@@ -34,23 +34,37 @@
34
34
  background: var(--code-selection-bg);
35
35
  }
36
36
 
37
- .line-number {
38
- position: relative;
39
- width: 35px;
40
- display: inline-block;
41
- left: 5px;
42
- opacity: 0.4;
43
- user-select: none;
37
+ &--inline {
38
+ margin: 0 2px;
39
+ border-radius: 2px;
40
+ }
44
41
 
45
- &::before {
46
- content: '';
47
- counter-increment: line;
48
- content: counter(line);
42
+ &--line-numbers {
43
+ .line-number {
44
+ position: relative;
45
+ display: block;
46
+
47
+ &::before {
48
+ display: inline-block;
49
+ position: absolute;
50
+ left: 0;
51
+ opacity: 0.4;
52
+ user-select: none;
53
+ text-align: right;
54
+ padding-right: $line-number-char-width;
55
+ }
49
56
  }
50
57
  }
51
58
 
52
- // Tokens
59
+ &--error {
60
+ outline: 1px solid $pt-intent-danger;
61
+ }
53
62
 
63
+ &--warning {
64
+ outline: 1px solid $pt-intent-warning;
65
+ }
66
+
67
+ // Tokens
54
68
  .token {
55
69
  &.important,
56
70
  &.bold {
@@ -171,3 +185,68 @@
171
185
  }
172
186
  }
173
187
  }
188
+
189
+ .CodeEditor {
190
+ &--line-numbers {
191
+ textarea {
192
+ outline: none;
193
+ }
194
+
195
+ @for $i from 1 through 6 {
196
+ &--#{$i} {
197
+ pre {
198
+ padding-left: $line-number-char-width * $i + $line-number-char-width + $line-padding-left !important;
199
+ }
200
+
201
+ textarea {
202
+ // Need to use margin here since CodeEditor supports padding: https://github.com/stoplightio/ui-kit/blob/fd1334753a22d527b803b8554bc51761c348d319/src/CodeEditor/index.tsx#L13
203
+ margin-left: $line-number-char-width * $i + $line-number-char-width + $line-padding-left !important;
204
+ }
205
+
206
+ .line-number {
207
+ margin-left: -$line-number-char-width * $i - $line-number-char-width;
208
+
209
+ &::before {
210
+ width: $line-number-char-width * $i + $line-number-char-width;
211
+ }
212
+ }
213
+ }
214
+ }
215
+ }
216
+
217
+ .line-number {
218
+ &::before {
219
+ counter-increment: line;
220
+ content: counter(line);
221
+ }
222
+ }
223
+ }
224
+
225
+ .CodeViewer {
226
+ .token {
227
+ animation: set-color 0.3s ease-out;
228
+ }
229
+
230
+ &--line-numbers {
231
+ @for $i from 1 through 6 {
232
+ &--#{$i} {
233
+ padding-left: $line-number-char-width * $i + $line-number-char-width + $line-padding-left !important;
234
+
235
+ .line-number {
236
+ margin-left: -$line-number-char-width * $i - $line-number-char-width;
237
+ padding-left: $line-number-char-width * $i + $line-number-char-width;
238
+
239
+ &::before {
240
+ width: $line-number-char-width * $i + $line-number-char-width;
241
+ }
242
+ }
243
+ }
244
+ }
245
+ }
246
+
247
+ .line-number {
248
+ &::before {
249
+ content: attr(data-node-index);
250
+ }
251
+ }
252
+ }
@@ -1,43 +1,50 @@
1
- // .TableOfContentsItem {
2
- // color: #5c6975;
3
-
4
- // &__name {
5
- // font-weight: 500;
6
- // word-break: break-all;
7
- // line-height: 1.5;
8
- // }
9
-
10
- // &__icon {
11
- // color: #9daab6;
12
- // }
13
-
14
- // &__inner {
15
- // padding: 7px 20px 7px 12px;
16
- // }
17
-
18
- // a {
19
- // &:hover {
20
- // text-decoration: none;
21
- // }
22
- // }
23
-
24
- // &--active {
25
- // &--child {
26
- // border-left: none;
27
- // }
28
- // }
29
-
30
- // &--divider {
31
- // &:not(:first-child) {
32
- // margin-top: 24px;
33
- // }
34
-
35
- // .TableOfContentsItem__name {
36
- // font-size: 12px;
37
- // font-weight: 700;
38
- // line-height: 1.2;
39
- // letter-spacing: 1px;
40
- // text-transform: uppercase;
41
- // }
42
- // }
43
- // }
1
+ .TableOfContentsItem {
2
+ &__name {
3
+ word-break: break-all;
4
+ line-height: 1.5;
5
+ }
6
+
7
+ &__icon {
8
+ color: #9daab6;
9
+ }
10
+
11
+ &__inner {
12
+ padding: 6px 16px 6px;
13
+ margin-top: 1px;
14
+ margin-bottom: 1px;
15
+ }
16
+
17
+ a {
18
+ &:hover {
19
+ text-decoration: none;
20
+ }
21
+ }
22
+
23
+ &--active {
24
+ &--child {
25
+ border-left: none;
26
+ }
27
+ }
28
+
29
+ &--child {
30
+ .TableOfContentsItem__inner {
31
+ padding-left: 15px;
32
+ }
33
+ }
34
+
35
+ &--divider {
36
+ &:first-child {
37
+ margin-top: -5px;
38
+ }
39
+
40
+ &:not(:first-child) {
41
+ margin-top: 12px;
42
+ }
43
+
44
+ .TableOfContentsItem__name {
45
+ line-height: 1.2;
46
+ text-transform: uppercase;
47
+ font-size: 12px;
48
+ }
49
+ }
50
+ }