@sentry/scraps 0.1.0 → 0.2.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.
- package/README.md +13 -21
- package/dist/alert/alert.d.ts +25 -0
- package/dist/alert/alert.js +262 -0
- package/dist/alert/alertLink.d.ts +32 -0
- package/dist/alert/alertLink.js +94 -0
- package/dist/alert/index.d.ts +2 -0
- package/dist/alert/index.js +2 -0
- package/dist/backdrop/backdrop.d.ts +9 -0
- package/dist/backdrop/backdrop.js +28 -0
- package/dist/backdrop/index.d.ts +1 -0
- package/dist/backdrop/index.js +1 -0
- package/dist/badge/badge.d.ts +12 -0
- package/dist/badge/badge.js +80 -0
- package/dist/badge/featureBadge.d.ts +6 -0
- package/dist/badge/featureBadge.js +86 -0
- package/dist/badge/index.d.ts +3 -0
- package/dist/badge/index.js +3 -0
- package/dist/badge/tag.d.ts +15 -0
- package/dist/badge/tag.js +119 -0
- package/dist/boundaryContext.d.ts +2 -0
- package/dist/boundaryContext.js +5 -0
- package/dist/button/button.d.ts +3 -0
- package/dist/button/button.js +83 -0
- package/dist/button/buttonBar.d.ts +10 -0
- package/dist/button/buttonBar.js +135 -0
- package/dist/button/index.d.ts +5 -0
- package/dist/button/index.js +4 -0
- package/dist/button/linkButton.d.ts +3 -0
- package/dist/button/linkButton.js +110 -0
- package/dist/button/styles.d.ts +10 -0
- package/dist/button/styles.js +247 -0
- package/dist/button/types.d.ts +77 -0
- package/dist/button/types.js +0 -0
- package/dist/button/useButtonFunctionality.d.ts +5 -0
- package/dist/button/useButtonFunctionality.js +9 -0
- package/dist/checkbox/checkbox.d.ts +20 -0
- package/dist/checkbox/checkbox.js +193 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/chip/chip.d.ts +128 -0
- package/dist/chip/chip.js +364 -0
- package/dist/chip/index.d.ts +1 -0
- package/dist/chip/index.js +1 -0
- package/dist/code/inlineCode.d.ts +1 -0
- package/dist/datetime.d.ts +39 -0
- package/dist/datetime.js +20 -0
- package/dist/descriptionList/descriptionList.d.ts +69 -0
- package/dist/descriptionList/descriptionList.js +76 -0
- package/dist/descriptionList/index.d.ts +1 -0
- package/dist/descriptionList/index.js +1 -0
- package/dist/disclosure/disclosure.d.ts +37 -0
- package/dist/disclosure/disclosure.js +155 -0
- package/dist/disclosure/index.d.ts +1 -0
- package/dist/disclosure/index.js +1 -0
- package/dist/emptyState/emptyState.d.ts +10 -0
- package/dist/emptyState/emptyState.js +81 -0
- package/dist/emptyState/index.d.ts +1 -0
- package/dist/emptyState/index.js +1 -0
- package/dist/hotkey/hotkey.d.ts +22 -0
- package/dist/hotkey/hotkey.js +41 -0
- package/dist/hotkey/index.d.ts +4 -0
- package/dist/hotkey/index.js +3 -0
- package/dist/hotkey/kbd.d.ts +1 -0
- package/dist/hotkey/keyMappings.d.ts +23 -0
- package/dist/hotkey/keyMappings.js +223 -0
- package/dist/hotkey/useHotkeys.d.ts +47 -0
- package/dist/hotkey/useHotkeys.js +44 -0
- package/dist/image/image.d.ts +21 -0
- package/dist/image/image.js +20 -0
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +1 -0
- package/dist/info/index.d.ts +2 -0
- package/dist/info/index.js +2 -0
- package/dist/info/infoText.d.ts +15 -0
- package/dist/info/infoText.js +43 -0
- package/dist/info/infoTip.d.ts +10 -0
- package/dist/info/infoTip.js +54 -0
- package/dist/interactionStateLayer/index.d.ts +1 -0
- package/dist/interactionStateLayer/index.js +1 -0
- package/dist/interactionStateLayer/interactionStateLayer.d.ts +23 -0
- package/dist/interactionStateLayer/interactionStateLayer.js +67 -0
- package/dist/layout/flex.d.ts +1 -0
- package/dist/layout/grid.d.ts +1 -0
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/layout/stack.d.ts +1 -0
- package/dist/layout/styles.d.ts +1 -1
- package/dist/layout/surface.d.ts +1 -0
- package/dist/link/index.d.ts +2 -0
- package/dist/link/index.js +2 -0
- package/dist/link/link.d.ts +43 -0
- package/dist/link/link.js +71 -0
- package/dist/link/linkBehaviorContext.d.ts +14 -0
- package/dist/link/linkBehaviorContext.js +31 -0
- package/dist/loader/indeterminateLoader.d.ts +1 -0
- package/dist/overlay.d.ts +59 -0
- package/dist/overlay.js +113 -0
- package/dist/overlayArrow.d.ts +9 -0
- package/dist/overlayArrow.js +55 -0
- package/dist/overlayPositioning.d.ts +61 -0
- package/dist/overlayPositioning.js +126 -0
- package/dist/panelProvider.d.ts +8 -0
- package/dist/panelProvider.js +20 -0
- package/dist/quote/quote.js +1 -1
- package/dist/radio/index.d.ts +1 -0
- package/dist/radio/index.js +1 -0
- package/dist/radio/radio.d.ts +9 -0
- package/dist/radio/radio.js +77 -0
- package/dist/renderToString.d.ts +2 -0
- package/dist/renderToString.js +25 -0
- package/dist/revealOnHover/index.d.ts +1 -0
- package/dist/revealOnHover/index.js +1 -0
- package/dist/revealOnHover/revealOnHover.d.ts +20 -0
- package/dist/revealOnHover/revealOnHover.js +62 -0
- package/dist/segmentedControl/index.d.ts +1 -0
- package/dist/segmentedControl/index.js +1 -0
- package/dist/segmentedControl/segmentedControl.d.ts +41 -0
- package/dist/segmentedControl/segmentedControl.js +217 -0
- package/dist/separator/separator.d.ts +4 -3
- package/dist/separator/separator.js +1 -1
- package/dist/sizeContext.d.ts +9 -0
- package/dist/sizeContext.js +13 -0
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +1 -0
- package/dist/slider/slider.d.ts +41 -0
- package/dist/slider/slider.js +386 -0
- package/dist/slot/index.d.ts +1 -0
- package/dist/slot/index.js +1 -0
- package/dist/slot/knownContexts.d.ts +1 -0
- package/dist/slot/knownContexts.js +7 -0
- package/dist/slot/slot.d.ts +26 -0
- package/dist/slot/slot.js +274 -0
- package/dist/statusIndicator/index.d.ts +1 -0
- package/dist/statusIndicator/index.js +1 -0
- package/dist/statusIndicator/statusIndicator.d.ts +24 -0
- package/dist/statusIndicator/statusIndicator.js +130 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch/switch.d.ts +6 -0
- package/dist/switch/switch.js +172 -0
- package/dist/text/heading.d.ts +1 -0
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.js +1 -0
- package/dist/text/prose.d.ts +8 -0
- package/dist/text/prose.js +45 -0
- package/dist/text/text.d.ts +1 -0
- package/dist/theme/dark.d.ts +129 -10
- package/dist/theme/dark.js +41 -13
- package/dist/theme/index.d.ts +3 -12
- package/dist/theme/index.js +2 -2
- package/dist/theme/light.d.ts +129 -10
- package/dist/theme/light.js +42 -14
- package/dist/theme/swatch.d.ts +27 -0
- package/dist/theme/swatch.js +37 -0
- package/dist/theme/theme.d.ts +648 -0
- package/dist/theme/theme.js +780 -0
- package/dist/theme/types.d.ts +1 -0
- package/dist/theme/useInvertedTheme.d.ts +1 -0
- package/dist/theme/useInvertedTheme.js +7 -0
- package/dist/tooltip/index.d.ts +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/tooltip.d.ts +166 -0
- package/dist/tooltip/tooltip.js +181 -0
- package/dist/tooltip/useDisabledTooltip.d.ts +22 -0
- package/dist/tooltip/useDisabledTooltip.js +24 -0
- package/dist/trackingContext.d.ts +34 -0
- package/dist/trackingContext.js +29 -0
- package/dist/translation/index.d.ts +4 -0
- package/dist/translation/index.js +4 -0
- package/dist/translation/translationContext.d.ts +6 -0
- package/dist/translation/translationContext.js +6 -0
- package/dist/translation/useTranslation.d.ts +1 -0
- package/dist/translation/useTranslation.js +6 -0
- package/dist/unreachable.d.ts +1 -0
- package/dist/unreachable.js +4 -0
- package/dist/useHoverOverlay.d.ts +113 -0
- package/dist/useHoverOverlay.js +370 -0
- package/dist/useIsInsideInteractiveElement.d.ts +6 -0
- package/dist/useIsInsideInteractiveElement.js +31 -0
- package/dist/useOverlay.d.ts +82 -0
- package/dist/useOverlay.js +216 -0
- package/dist/useScrollLock.d.ts +5 -0
- package/dist/useScrollLock.js +100 -0
- package/dist/useStableMergeRef.d.ts +9 -0
- package/dist/useStableMergeRef.js +18 -0
- package/package.json +193 -11
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -9
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { inlineCodeStyles } from "../code/inlineCode.js";
|
|
4
|
+
import { kbdStyles } from "../hotkey/kbd.js";
|
|
5
|
+
const Prose = styled(({ children, as = 'article', ...rest })=>{
|
|
6
|
+
const Component = as;
|
|
7
|
+
return /*#__PURE__*/ jsx(Component, {
|
|
8
|
+
...rest,
|
|
9
|
+
children: children
|
|
10
|
+
});
|
|
11
|
+
})`
|
|
12
|
+
/* stylelint-disable no-descending-specificity */
|
|
13
|
+
h1,
|
|
14
|
+
h2,
|
|
15
|
+
h3,
|
|
16
|
+
h4,
|
|
17
|
+
h5,
|
|
18
|
+
h6,
|
|
19
|
+
p,
|
|
20
|
+
/* Exclude ol/ul elements inside interactive selectors/menus */
|
|
21
|
+
ul:not([role='listbox'], [role='grid'], [role='menu']),
|
|
22
|
+
ol:not([role='listbox'], [role='grid'], [role='menu']),
|
|
23
|
+
table,
|
|
24
|
+
dl,
|
|
25
|
+
blockquote,
|
|
26
|
+
form,
|
|
27
|
+
pre,
|
|
28
|
+
.auto-select-text,
|
|
29
|
+
.section,
|
|
30
|
+
[class^='highlight-'] {
|
|
31
|
+
margin-bottom: ${(p)=>p.theme.space['2xl']};
|
|
32
|
+
|
|
33
|
+
&:last-child {
|
|
34
|
+
margin-bottom: 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
code:not(pre code) {
|
|
38
|
+
${(p)=>inlineCodeStyles(p.theme)};
|
|
39
|
+
}
|
|
40
|
+
kbd {
|
|
41
|
+
${(p)=>kbdStyles(p.theme)};
|
|
42
|
+
}
|
|
43
|
+
/* stylelint-enable */
|
|
44
|
+
`;
|
|
45
|
+
export { Prose };
|
package/dist/text/text.d.ts
CHANGED
package/dist/theme/dark.d.ts
CHANGED
|
@@ -793,6 +793,13 @@ export declare const darkTheme: {
|
|
|
793
793
|
*/
|
|
794
794
|
other: string;
|
|
795
795
|
};
|
|
796
|
+
sequential: {
|
|
797
|
+
magma: {
|
|
798
|
+
series5: readonly [string, "#7C2282", "#F0369A", "#FA6769", "#FFD00E"];
|
|
799
|
+
series6: readonly [string, "#7C2282", "#B0009C", "#F0369A", "#FF9838", "#FFD00E"];
|
|
800
|
+
series7: readonly [string, "#7C2282", "#B0009C", "#F0369A", "#FA6769", "#FF9838", string];
|
|
801
|
+
};
|
|
802
|
+
};
|
|
796
803
|
};
|
|
797
804
|
elevation: {
|
|
798
805
|
/**
|
|
@@ -1778,22 +1785,134 @@ export declare const darkTheme: {
|
|
|
1778
1785
|
*/
|
|
1779
1786
|
variable: string;
|
|
1780
1787
|
ansi: {
|
|
1788
|
+
/**
|
|
1789
|
+
*
|
|
1790
|
+
* 
|
|
1791
|
+
*
|
|
1792
|
+
* `ansi.black` `#E7E5EA`
|
|
1793
|
+
*
|
|
1794
|
+
*/
|
|
1781
1795
|
black: string;
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1796
|
+
/**
|
|
1797
|
+
*
|
|
1798
|
+
* 
|
|
1799
|
+
*
|
|
1800
|
+
* `ansi.blue` `#BCBAFD`
|
|
1801
|
+
*
|
|
1802
|
+
*/
|
|
1785
1803
|
blue: string;
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1804
|
+
/**
|
|
1805
|
+
*
|
|
1806
|
+
* 
|
|
1807
|
+
*
|
|
1808
|
+
* `ansi.brightBlack` `#C4C0CB`
|
|
1809
|
+
*
|
|
1810
|
+
*/
|
|
1789
1811
|
brightBlack: string;
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1812
|
+
/**
|
|
1813
|
+
*
|
|
1814
|
+
* 
|
|
1815
|
+
*
|
|
1816
|
+
* `ansi.brightBlue` `#CFCEFF`
|
|
1817
|
+
*
|
|
1818
|
+
*/
|
|
1793
1819
|
brightBlue: string;
|
|
1794
|
-
|
|
1820
|
+
/**
|
|
1821
|
+
*
|
|
1822
|
+
* 
|
|
1823
|
+
*
|
|
1824
|
+
* `ansi.brightCyan` `#91d8d7`
|
|
1825
|
+
*
|
|
1826
|
+
*/
|
|
1795
1827
|
brightCyan: string;
|
|
1828
|
+
/**
|
|
1829
|
+
*
|
|
1830
|
+
* 
|
|
1831
|
+
*
|
|
1832
|
+
* `ansi.brightGreen` `#A8E6AF`
|
|
1833
|
+
*
|
|
1834
|
+
*/
|
|
1835
|
+
brightGreen: string;
|
|
1836
|
+
/**
|
|
1837
|
+
*
|
|
1838
|
+
* 
|
|
1839
|
+
*
|
|
1840
|
+
* `ansi.brightMagenta` `#F8C3D8`
|
|
1841
|
+
*
|
|
1842
|
+
*/
|
|
1843
|
+
brightMagenta: string;
|
|
1844
|
+
/**
|
|
1845
|
+
*
|
|
1846
|
+
* 
|
|
1847
|
+
*
|
|
1848
|
+
* `ansi.brightRed` `#FFC2BC`
|
|
1849
|
+
*
|
|
1850
|
+
*/
|
|
1851
|
+
brightRed: string;
|
|
1852
|
+
/**
|
|
1853
|
+
*
|
|
1854
|
+
* 
|
|
1855
|
+
*
|
|
1856
|
+
* `ansi.brightWhite` `#F9F8F9`
|
|
1857
|
+
*
|
|
1858
|
+
*/
|
|
1796
1859
|
brightWhite: string;
|
|
1860
|
+
/**
|
|
1861
|
+
*
|
|
1862
|
+
* 
|
|
1863
|
+
*
|
|
1864
|
+
* `ansi.brightYellow` `#E9D290`
|
|
1865
|
+
*
|
|
1866
|
+
*/
|
|
1867
|
+
brightYellow: string;
|
|
1868
|
+
/**
|
|
1869
|
+
*
|
|
1870
|
+
* 
|
|
1871
|
+
*
|
|
1872
|
+
* `ansi.cyan` `#77cecd`
|
|
1873
|
+
*
|
|
1874
|
+
*/
|
|
1875
|
+
cyan: string;
|
|
1876
|
+
/**
|
|
1877
|
+
*
|
|
1878
|
+
* 
|
|
1879
|
+
*
|
|
1880
|
+
* `ansi.green` `#83DA90`
|
|
1881
|
+
*
|
|
1882
|
+
*/
|
|
1883
|
+
green: string;
|
|
1884
|
+
/**
|
|
1885
|
+
*
|
|
1886
|
+
* 
|
|
1887
|
+
*
|
|
1888
|
+
* `ansi.magenta` `#F1AAC8`
|
|
1889
|
+
*
|
|
1890
|
+
*/
|
|
1891
|
+
magenta: string;
|
|
1892
|
+
/**
|
|
1893
|
+
*
|
|
1894
|
+
* 
|
|
1895
|
+
*
|
|
1896
|
+
* `ansi.red` `#FCAAA2`
|
|
1897
|
+
*
|
|
1898
|
+
*/
|
|
1899
|
+
red: string;
|
|
1900
|
+
/**
|
|
1901
|
+
*
|
|
1902
|
+
* 
|
|
1903
|
+
*
|
|
1904
|
+
* `ansi.white` `#E7E5EA`
|
|
1905
|
+
*
|
|
1906
|
+
*/
|
|
1907
|
+
white: string;
|
|
1908
|
+
/**
|
|
1909
|
+
*
|
|
1910
|
+
* 
|
|
1911
|
+
*
|
|
1912
|
+
* `ansi.yellow` `#E0C05E`
|
|
1913
|
+
*
|
|
1914
|
+
*/
|
|
1915
|
+
yellow: string;
|
|
1797
1916
|
};
|
|
1798
1917
|
};
|
|
1799
1918
|
};
|
package/dist/theme/dark.js
CHANGED
|
@@ -225,6 +225,34 @@ const dataviz = {
|
|
|
225
225
|
bad: color.red.dark.opaque900,
|
|
226
226
|
release: color.neutral.dark.opaque1100,
|
|
227
227
|
other: color.neutral.dark.opaque800
|
|
228
|
+
},
|
|
229
|
+
sequential: {
|
|
230
|
+
magma: {
|
|
231
|
+
series5: [
|
|
232
|
+
color.blue.dark.opaque700,
|
|
233
|
+
color.categorical.dark.plum,
|
|
234
|
+
color.categorical.light.pink,
|
|
235
|
+
color.categorical.dark.salmon,
|
|
236
|
+
color.categorical.dark.yellow
|
|
237
|
+
],
|
|
238
|
+
series6: [
|
|
239
|
+
color.blue.dark.opaque700,
|
|
240
|
+
color.categorical.dark.plum,
|
|
241
|
+
color.categorical.dark.magenta,
|
|
242
|
+
color.categorical.dark.pink,
|
|
243
|
+
color.categorical.dark.orange,
|
|
244
|
+
color.categorical.dark.yellow
|
|
245
|
+
],
|
|
246
|
+
series7: [
|
|
247
|
+
color.blue.dark.opaque700,
|
|
248
|
+
color.categorical.dark.plum,
|
|
249
|
+
color.categorical.dark.magenta,
|
|
250
|
+
color.categorical.dark.pink,
|
|
251
|
+
color.categorical.dark.salmon,
|
|
252
|
+
color.categorical.dark.orange,
|
|
253
|
+
color.yellow.dark.opaque1200
|
|
254
|
+
]
|
|
255
|
+
}
|
|
228
256
|
}
|
|
229
257
|
};
|
|
230
258
|
const elevation = {
|
|
@@ -390,21 +418,21 @@ const syntax = {
|
|
|
390
418
|
variable: content.primary,
|
|
391
419
|
ansi: {
|
|
392
420
|
black: color.neutral.dark.opaque1500,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
magenta: color.pink.dark.opaque1200,
|
|
398
|
-
cyan: color.blue.dark.opaque1100,
|
|
399
|
-
white: color.neutral.dark.opaque1500,
|
|
400
|
-
brightBlack: color.neutral.dark.opaque1200,
|
|
401
|
-
brightRed: color.red.dark.opaque1300,
|
|
421
|
+
blue: color.blue.dark.opaque1300,
|
|
422
|
+
brightBlack: color.neutral.dark.opaque1300,
|
|
423
|
+
brightBlue: color.blue.dark.opaque1400,
|
|
424
|
+
brightCyan: '#91d8d7',
|
|
402
425
|
brightGreen: color.green.dark.opaque1400,
|
|
426
|
+
brightMagenta: color.pink.dark.opaque1400,
|
|
427
|
+
brightRed: color.red.dark.opaque1400,
|
|
428
|
+
brightWhite: color.neutral.dark.opaque1600,
|
|
403
429
|
brightYellow: color.yellow.dark.opaque1400,
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
430
|
+
cyan: '#77cecd',
|
|
431
|
+
green: color.green.dark.opaque1300,
|
|
432
|
+
magenta: color.pink.dark.opaque1300,
|
|
433
|
+
red: color.red.dark.opaque1300,
|
|
434
|
+
white: color.neutral.dark.opaque1500,
|
|
435
|
+
yellow: color.yellow.dark.opaque1300
|
|
408
436
|
}
|
|
409
437
|
};
|
|
410
438
|
const shadow = {
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { lightTheme } from './light.js';
|
|
4
|
-
export { darkTheme } from './dark.js';
|
|
1
|
+
export { lightTheme, darkTheme } from './theme.js';
|
|
2
|
+
export type { SentryTheme as Theme, StrictCSSObject } from './theme.js';
|
|
5
3
|
export { baseTheme } from './base.js';
|
|
6
4
|
export type * from './types.js';
|
|
7
|
-
export
|
|
8
|
-
[Key in keyof typeof lightTheme]: (typeof lightTheme)[Key] | (typeof darkTheme)[Key];
|
|
9
|
-
};
|
|
10
|
-
type ScrapsTheme = Theme;
|
|
11
|
-
declare module '@emotion/react' {
|
|
12
|
-
interface Theme extends ScrapsTheme {
|
|
13
|
-
}
|
|
14
|
-
}
|
|
5
|
+
export { useInvertedTheme } from './useInvertedTheme.js';
|
package/dist/theme/index.js
CHANGED
package/dist/theme/light.d.ts
CHANGED
|
@@ -793,6 +793,13 @@ export declare const lightTheme: {
|
|
|
793
793
|
*/
|
|
794
794
|
other: string;
|
|
795
795
|
};
|
|
796
|
+
sequential: {
|
|
797
|
+
magma: {
|
|
798
|
+
series5: readonly [string, "#FFD00E", "#FF9838", "#F0369A", "#7553FF"];
|
|
799
|
+
series6: readonly [string, "#FFD00E", "#FA6769", string, "#7C2282", "#3A1873"];
|
|
800
|
+
series7: readonly [string, "#FFD00E", "#FF9838", string, string, "#7C2282", "#3A1873"];
|
|
801
|
+
};
|
|
802
|
+
};
|
|
796
803
|
};
|
|
797
804
|
elevation: {
|
|
798
805
|
/**
|
|
@@ -1778,22 +1785,134 @@ export declare const lightTheme: {
|
|
|
1778
1785
|
*/
|
|
1779
1786
|
variable: string;
|
|
1780
1787
|
ansi: {
|
|
1788
|
+
/**
|
|
1789
|
+
*
|
|
1790
|
+
* 
|
|
1791
|
+
*
|
|
1792
|
+
* `ansi.black` `#3E3B45`
|
|
1793
|
+
*
|
|
1794
|
+
*/
|
|
1781
1795
|
black: string;
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1796
|
+
/**
|
|
1797
|
+
*
|
|
1798
|
+
* 
|
|
1799
|
+
*
|
|
1800
|
+
* `ansi.blue` `#5827D6`
|
|
1801
|
+
*
|
|
1802
|
+
*/
|
|
1785
1803
|
blue: string;
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1804
|
+
/**
|
|
1805
|
+
*
|
|
1806
|
+
* 
|
|
1807
|
+
*
|
|
1808
|
+
* `ansi.brightBlack` `#4C4954`
|
|
1809
|
+
*
|
|
1810
|
+
*/
|
|
1789
1811
|
brightBlack: string;
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1812
|
+
/**
|
|
1813
|
+
*
|
|
1814
|
+
* 
|
|
1815
|
+
*
|
|
1816
|
+
* `ansi.brightBlue` `#4C0FC0`
|
|
1817
|
+
*
|
|
1818
|
+
*/
|
|
1793
1819
|
brightBlue: string;
|
|
1794
|
-
|
|
1820
|
+
/**
|
|
1821
|
+
*
|
|
1822
|
+
* 
|
|
1823
|
+
*
|
|
1824
|
+
* `ansi.brightCyan` `#004e4e`
|
|
1825
|
+
*
|
|
1826
|
+
*/
|
|
1795
1827
|
brightCyan: string;
|
|
1828
|
+
/**
|
|
1829
|
+
*
|
|
1830
|
+
* 
|
|
1831
|
+
*
|
|
1832
|
+
* `ansi.brightGreen` `#005600`
|
|
1833
|
+
*
|
|
1834
|
+
*/
|
|
1835
|
+
brightGreen: string;
|
|
1836
|
+
/**
|
|
1837
|
+
*
|
|
1838
|
+
* 
|
|
1839
|
+
*
|
|
1840
|
+
* `ansi.brightMagenta` `#88004F`
|
|
1841
|
+
*
|
|
1842
|
+
*/
|
|
1843
|
+
brightMagenta: string;
|
|
1844
|
+
/**
|
|
1845
|
+
*
|
|
1846
|
+
* 
|
|
1847
|
+
*
|
|
1848
|
+
* `ansi.brightRed` `#920000`
|
|
1849
|
+
*
|
|
1850
|
+
*/
|
|
1851
|
+
brightRed: string;
|
|
1852
|
+
/**
|
|
1853
|
+
*
|
|
1854
|
+
* 
|
|
1855
|
+
*
|
|
1856
|
+
* `ansi.brightWhite` `#302E36`
|
|
1857
|
+
*
|
|
1858
|
+
*/
|
|
1796
1859
|
brightWhite: string;
|
|
1860
|
+
/**
|
|
1861
|
+
*
|
|
1862
|
+
* 
|
|
1863
|
+
*
|
|
1864
|
+
* `ansi.brightYellow` `#5f4b00`
|
|
1865
|
+
*
|
|
1866
|
+
*/
|
|
1867
|
+
brightYellow: string;
|
|
1868
|
+
/**
|
|
1869
|
+
*
|
|
1870
|
+
* 
|
|
1871
|
+
*
|
|
1872
|
+
* `ansi.cyan` `#005959`
|
|
1873
|
+
*
|
|
1874
|
+
*/
|
|
1875
|
+
cyan: string;
|
|
1876
|
+
/**
|
|
1877
|
+
*
|
|
1878
|
+
* 
|
|
1879
|
+
*
|
|
1880
|
+
* `ansi.green` `#006700`
|
|
1881
|
+
*
|
|
1882
|
+
*/
|
|
1883
|
+
green: string;
|
|
1884
|
+
/**
|
|
1885
|
+
*
|
|
1886
|
+
* 
|
|
1887
|
+
*
|
|
1888
|
+
* `ansi.magenta` `#9F005F`
|
|
1889
|
+
*
|
|
1890
|
+
*/
|
|
1891
|
+
magenta: string;
|
|
1892
|
+
/**
|
|
1893
|
+
*
|
|
1894
|
+
* 
|
|
1895
|
+
*
|
|
1896
|
+
* `ansi.red` `#AB0000`
|
|
1897
|
+
*
|
|
1898
|
+
*/
|
|
1899
|
+
red: string;
|
|
1900
|
+
/**
|
|
1901
|
+
*
|
|
1902
|
+
* 
|
|
1903
|
+
*
|
|
1904
|
+
* `ansi.white` `#3E3B45`
|
|
1905
|
+
*
|
|
1906
|
+
*/
|
|
1907
|
+
white: string;
|
|
1908
|
+
/**
|
|
1909
|
+
*
|
|
1910
|
+
* 
|
|
1911
|
+
*
|
|
1912
|
+
* `ansi.yellow` `#6b5500`
|
|
1913
|
+
*
|
|
1914
|
+
*/
|
|
1915
|
+
yellow: string;
|
|
1797
1916
|
};
|
|
1798
1917
|
};
|
|
1799
1918
|
};
|
package/dist/theme/light.js
CHANGED
|
@@ -225,6 +225,34 @@ const dataviz = {
|
|
|
225
225
|
bad: color.red.light.opaque1200,
|
|
226
226
|
release: color.neutral.light.opaque900,
|
|
227
227
|
other: color.neutral.light.opaque400
|
|
228
|
+
},
|
|
229
|
+
sequential: {
|
|
230
|
+
magma: {
|
|
231
|
+
series5: [
|
|
232
|
+
color.yellow.light.opaque300,
|
|
233
|
+
color.categorical.light.yellow,
|
|
234
|
+
color.categorical.light.orange,
|
|
235
|
+
color.categorical.light.pink,
|
|
236
|
+
color.categorical.light.blurple
|
|
237
|
+
],
|
|
238
|
+
series6: [
|
|
239
|
+
color.yellow.light.opaque300,
|
|
240
|
+
color.categorical.light.yellow,
|
|
241
|
+
color.categorical.light.salmon,
|
|
242
|
+
color.pink.light.opaque1000,
|
|
243
|
+
color.categorical.light.plum,
|
|
244
|
+
color.categorical.light.indigo
|
|
245
|
+
],
|
|
246
|
+
series7: [
|
|
247
|
+
color.yellow.light.opaque300,
|
|
248
|
+
color.categorical.light.yellow,
|
|
249
|
+
color.categorical.light.orange,
|
|
250
|
+
color.red.light.opaque800,
|
|
251
|
+
color.pink.light.opaque1000,
|
|
252
|
+
color.categorical.light.plum,
|
|
253
|
+
color.categorical.light.indigo
|
|
254
|
+
]
|
|
255
|
+
}
|
|
228
256
|
}
|
|
229
257
|
};
|
|
230
258
|
const elevation = {
|
|
@@ -390,21 +418,21 @@ const syntax = {
|
|
|
390
418
|
variable: content.primary,
|
|
391
419
|
ansi: {
|
|
392
420
|
black: color.neutral.light.opaque1400,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
421
|
+
blue: color.blue.light.opaque1200,
|
|
422
|
+
brightBlack: color.neutral.light.opaque1300,
|
|
423
|
+
brightBlue: color.blue.light.opaque1300,
|
|
424
|
+
brightCyan: '#004e4e',
|
|
425
|
+
brightGreen: color.green.light.opaque1400,
|
|
426
|
+
brightMagenta: color.pink.light.opaque1400,
|
|
427
|
+
brightRed: color.red.light.opaque1400,
|
|
428
|
+
brightWhite: color.neutral.light.opaque1500,
|
|
429
|
+
brightYellow: '#5f4b00',
|
|
430
|
+
cyan: '#005959',
|
|
431
|
+
green: color.green.light.opaque1300,
|
|
432
|
+
magenta: color.pink.light.opaque1300,
|
|
433
|
+
red: color.red.light.opaque1300,
|
|
399
434
|
white: color.neutral.light.opaque1400,
|
|
400
|
-
|
|
401
|
-
brightRed: color.red.light.opaque1200,
|
|
402
|
-
brightGreen: color.green.light.opaque1200,
|
|
403
|
-
brightYellow: color.yellow.light.opaque1200,
|
|
404
|
-
brightBlue: color.blue.light.opaque1200,
|
|
405
|
-
brightMagenta: color.pink.light.opaque1200,
|
|
406
|
-
brightCyan: color.blue.light.opaque1000,
|
|
407
|
-
brightWhite: color.neutral.light.opaque1400
|
|
435
|
+
yellow: '#6b5500'
|
|
408
436
|
}
|
|
409
437
|
};
|
|
410
438
|
const shadow = {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type OnVibrant = {
|
|
2
|
+
dark: string;
|
|
3
|
+
light: string;
|
|
4
|
+
};
|
|
5
|
+
export type Swatch = ReturnType<typeof makeSwatch>;
|
|
6
|
+
export declare function makeSwatch(palette: Record<string, string>, onVibrant: OnVibrant): {
|
|
7
|
+
/**
|
|
8
|
+
* Given a string input, deterministically pick a single color from the
|
|
9
|
+
* categorical palette. Returns both the background color and the correct
|
|
10
|
+
* contrasting content (text) color.
|
|
11
|
+
*
|
|
12
|
+
* The same input always produces the same color pair.
|
|
13
|
+
*/
|
|
14
|
+
get(input: string): {
|
|
15
|
+
background: string;
|
|
16
|
+
content: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Returns an iterator over the categorical color palette values.
|
|
20
|
+
*
|
|
21
|
+
* The iteration order should not be relied on as an API detail.
|
|
22
|
+
* To deterministically pick a color for a given input, use
|
|
23
|
+
* `get(input)` instead.
|
|
24
|
+
*/
|
|
25
|
+
values(): IterableIterator<string>;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const SWATCH_CONTRAST_MAP = {
|
|
2
|
+
blurple: 'light',
|
|
3
|
+
purple: 'light',
|
|
4
|
+
indigo: 'light',
|
|
5
|
+
plum: 'light',
|
|
6
|
+
magenta: 'light',
|
|
7
|
+
pink: 'light',
|
|
8
|
+
salmon: 'dark',
|
|
9
|
+
orange: 'dark',
|
|
10
|
+
yellow: 'dark',
|
|
11
|
+
green: 'dark'
|
|
12
|
+
};
|
|
13
|
+
function hashIdentifier(identifier) {
|
|
14
|
+
let hash = 0;
|
|
15
|
+
for(let i = 0; i < identifier.length; i++)hash += identifier.charCodeAt(i);
|
|
16
|
+
return hash;
|
|
17
|
+
}
|
|
18
|
+
function makeSwatch(palette, onVibrant) {
|
|
19
|
+
const entries = Object.entries(palette);
|
|
20
|
+
const swatchColors = entries.map(([key, hex])=>({
|
|
21
|
+
background: hex,
|
|
22
|
+
content: onVibrant[SWATCH_CONTRAST_MAP[key]]
|
|
23
|
+
}));
|
|
24
|
+
const colorSet = Object.freeze(new Set(entries.map(([, hex])=>hex)));
|
|
25
|
+
return {
|
|
26
|
+
get (input) {
|
|
27
|
+
const index = hashIdentifier(input ?? '') % swatchColors.length;
|
|
28
|
+
return {
|
|
29
|
+
...swatchColors[index]
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
values () {
|
|
33
|
+
return colorSet.values();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export { makeSwatch };
|