@sentry/scraps 0.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.
- package/LICENSE.md +105 -0
- package/README.md +67 -0
- package/dist/code/inlineCode.d.ts +7 -0
- package/dist/code/inlineCode.js +38 -0
- package/dist/cssTypes.d.ts +57 -0
- package/dist/cssTypes.js +0 -0
- package/dist/hotkey/kbd.d.ts +8 -0
- package/dist/hotkey/kbd.js +31 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/layout/container.d.ts +114 -0
- package/dist/layout/container.js +161 -0
- package/dist/layout/flex.d.ts +42 -0
- package/dist/layout/flex.js +42 -0
- package/dist/layout/grid.d.ts +65 -0
- package/dist/layout/grid.js +83 -0
- package/dist/layout/index.d.ts +13 -0
- package/dist/layout/index.js +6 -0
- package/dist/layout/stack.d.ts +15 -0
- package/dist/layout/stack.js +55 -0
- package/dist/layout/styles.d.ts +118 -0
- package/dist/layout/styles.js +237 -0
- package/dist/layout/surface.d.ts +27 -0
- package/dist/layout/surface.js +28 -0
- package/dist/loader/indeterminateLoader.d.ts +5 -0
- package/dist/loader/indeterminateLoader.js +122 -0
- package/dist/loader/index.d.ts +1 -0
- package/dist/loader/index.js +1 -0
- package/dist/quote/index.d.ts +1 -0
- package/dist/quote/index.js +1 -0
- package/dist/quote/quote.d.ts +13 -0
- package/dist/quote/quote.js +73 -0
- package/dist/separator/index.d.ts +1 -0
- package/dist/separator/index.js +1 -0
- package/dist/separator/separator.d.ts +15 -0
- package/dist/separator/separator.js +29 -0
- package/dist/text/heading.d.ts +44 -0
- package/dist/text/heading.js +69 -0
- package/dist/text/index.d.ts +2 -0
- package/dist/text/index.js +2 -0
- package/dist/text/styles.d.ts +5 -0
- package/dist/text/styles.js +18 -0
- package/dist/text/text.d.ts +152 -0
- package/dist/text/text.js +81 -0
- package/dist/theme/base.d.ts +106 -0
- package/dist/theme/base.js +7 -0
- package/dist/theme/dark.d.ts +1904 -0
- package/dist/theme/dark.js +430 -0
- package/dist/theme/index.d.ts +14 -0
- package/dist/theme/index.js +3 -0
- package/dist/theme/light.d.ts +1904 -0
- package/dist/theme/light.js +430 -0
- package/dist/theme/types.d.ts +80 -0
- package/dist/theme/types.js +0 -0
- package/dist/tokens/color.d.ts +3309 -0
- package/dist/tokens/color.js +453 -0
- package/dist/tokens/index.d.ts +3 -0
- package/dist/tokens/index.js +3 -0
- package/dist/tokens/size.d.ts +372 -0
- package/dist/tokens/size.js +75 -0
- package/dist/tokens/typography.d.ts +88 -0
- package/dist/tokens/typography.js +35 -0
- package/package.json +83 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import is_prop_valid from "@emotion/is-prop-valid";
|
|
3
|
+
import { css } from "@emotion/react";
|
|
4
|
+
import styled from "@emotion/styled";
|
|
5
|
+
import { rc } from "../layout/index.js";
|
|
6
|
+
import { getFontSize, getLineHeight, getTextDecoration } from "./styles.js";
|
|
7
|
+
function getDefaultDisplay(p) {
|
|
8
|
+
if ('div' === p.as) return 'block';
|
|
9
|
+
if (p.ellipsis || p.align) return 'span' === p.as ? 'inline-block' : 'block';
|
|
10
|
+
}
|
|
11
|
+
function getNativeDisplay(as) {
|
|
12
|
+
return 'p' === as || 'div' === as || 'legend' === as ? 'block' : 'inline';
|
|
13
|
+
}
|
|
14
|
+
function resolveDisplay(p) {
|
|
15
|
+
const fallback = getDefaultDisplay(p);
|
|
16
|
+
if (void 0 === p.display) return fallback ? `display: ${fallback};` : void 0;
|
|
17
|
+
if ('string' == typeof p.display) return `display: ${p.display};`;
|
|
18
|
+
const value = void 0 === p.display.zero ? {
|
|
19
|
+
zero: fallback ?? getNativeDisplay(p.as),
|
|
20
|
+
...p.display
|
|
21
|
+
} : p.display;
|
|
22
|
+
return rc('display', value, p.theme);
|
|
23
|
+
}
|
|
24
|
+
const getTextStyles = (p)=>css`
|
|
25
|
+
${rc('font-size', p.size, p.theme, (v)=>getFontSize(v, p.theme))};
|
|
26
|
+
${rc('line-height', p.density, p.theme, (v)=>getLineHeight(v, p.theme))};
|
|
27
|
+
${resolveDisplay(p)};
|
|
28
|
+
${rc('text-align', p.align, p.theme)};
|
|
29
|
+
|
|
30
|
+
font-style: ${p.italic ? 'italic' : void 0};
|
|
31
|
+
text-decoration: ${getTextDecoration(p)};
|
|
32
|
+
cursor: ${p.cursor ?? void 0};
|
|
33
|
+
|
|
34
|
+
color: ${'inherit' === p.variant ? void 0 : p.theme.tokens.content['muted' === p.variant ? 'secondary' : p.variant ?? 'primary']};
|
|
35
|
+
|
|
36
|
+
overflow: ${p.ellipsis ? 'hidden' : void 0};
|
|
37
|
+
text-overflow: ${p.ellipsis ? 'ellipsis' : void 0};
|
|
38
|
+
white-space: ${p.wrap ? p.wrap : p.ellipsis ? 'nowrap' : void 0};
|
|
39
|
+
text-wrap: ${p.textWrap ?? void 0};
|
|
40
|
+
word-break: ${p.wordBreak ?? void 0};
|
|
41
|
+
width: ${p.ellipsis ? '100%' : void 0};
|
|
42
|
+
|
|
43
|
+
font-family: ${p.theme.font.family[p.monospace ? 'mono' : 'sans']};
|
|
44
|
+
font-weight: ${true === p.bold ? p.theme.font.weight[p.monospace ? 'mono' : 'sans'].medium : false === p.bold ? p.theme.font.weight[p.monospace ? 'mono' : 'sans'].regular : void 0};
|
|
45
|
+
font-variant-numeric: ${[
|
|
46
|
+
p.tabular ? 'tabular-nums' : void 0,
|
|
47
|
+
p.fraction ? 'diagonal-fractions' : void 0
|
|
48
|
+
].filter(Boolean).join(' ')};
|
|
49
|
+
text-transform: ${p.uppercase ? 'uppercase' : void 0};
|
|
50
|
+
|
|
51
|
+
text-box-edge: text text;
|
|
52
|
+
text-box-trim: trim-both;
|
|
53
|
+
`;
|
|
54
|
+
const Text = styled((props)=>{
|
|
55
|
+
if ('function' == typeof props.children) return props.children({
|
|
56
|
+
className: props.className ?? ''
|
|
57
|
+
});
|
|
58
|
+
const { children, ...rest } = props;
|
|
59
|
+
const Component = props.as || 'span';
|
|
60
|
+
return /*#__PURE__*/ jsx(Component, {
|
|
61
|
+
...rest,
|
|
62
|
+
children: children
|
|
63
|
+
});
|
|
64
|
+
}, {
|
|
65
|
+
shouldForwardProp: (p)=>is_prop_valid(p)
|
|
66
|
+
})`
|
|
67
|
+
${getTextStyles}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Reset any margin or padding that might be set by the global CSS styles.
|
|
71
|
+
*/
|
|
72
|
+
margin: 0;
|
|
73
|
+
padding: 0;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* This cast is required because styled-components does not preserve the generic signature of the wrapped component.
|
|
77
|
+
* By default, the generic type parameter <T> is lost, so we use 'as unknown as' to restore the correct typing.
|
|
78
|
+
* https://github.com/styled-components/styled-components/issues/1803
|
|
79
|
+
*/
|
|
80
|
+
`;
|
|
81
|
+
export { Text, getTextStyles };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export declare const baseTheme: {
|
|
2
|
+
font: {
|
|
3
|
+
size: {
|
|
4
|
+
xs: "11px";
|
|
5
|
+
sm: "12px";
|
|
6
|
+
md: "14px";
|
|
7
|
+
lg: "16px";
|
|
8
|
+
xl: "20px";
|
|
9
|
+
'2xl': "24px";
|
|
10
|
+
'3xl': "32px";
|
|
11
|
+
'4xl': "40px";
|
|
12
|
+
};
|
|
13
|
+
weight: {
|
|
14
|
+
sans: {
|
|
15
|
+
regular: 400;
|
|
16
|
+
medium: 500;
|
|
17
|
+
};
|
|
18
|
+
mono: {
|
|
19
|
+
regular: 425;
|
|
20
|
+
medium: 500;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
family: {
|
|
24
|
+
sans: "Rubik, 'Avenir Next', sans-serif";
|
|
25
|
+
mono: "'Roboto Mono', Monaco, Consolas, 'Courier New', monospace";
|
|
26
|
+
};
|
|
27
|
+
lineHeight: {
|
|
28
|
+
compressed: 1;
|
|
29
|
+
default: 1.2;
|
|
30
|
+
comfortable: 1.4;
|
|
31
|
+
fixed: "1rem";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
space: {
|
|
35
|
+
'0': "0px";
|
|
36
|
+
'2xs': "2px";
|
|
37
|
+
xs: "4px";
|
|
38
|
+
sm: "6px";
|
|
39
|
+
md: "8px";
|
|
40
|
+
lg: "12px";
|
|
41
|
+
xl: "16px";
|
|
42
|
+
'2xl': "24px";
|
|
43
|
+
'3xl': "32px";
|
|
44
|
+
};
|
|
45
|
+
size: {
|
|
46
|
+
'2xs': "48px";
|
|
47
|
+
xs: "64px";
|
|
48
|
+
sm: "80px";
|
|
49
|
+
md: "128px";
|
|
50
|
+
lg: "256px";
|
|
51
|
+
xl: "512px";
|
|
52
|
+
'2xl': "640px";
|
|
53
|
+
'3xl': "768px";
|
|
54
|
+
'4xl': "960px";
|
|
55
|
+
'5xl': "1024px";
|
|
56
|
+
'6xl': "1280px";
|
|
57
|
+
'7xl': "1440px";
|
|
58
|
+
};
|
|
59
|
+
border: {
|
|
60
|
+
'0': "0px";
|
|
61
|
+
md: "1px";
|
|
62
|
+
lg: "1.5px";
|
|
63
|
+
xl: "2px";
|
|
64
|
+
'2xl': "4px";
|
|
65
|
+
};
|
|
66
|
+
radius: {
|
|
67
|
+
'0': "0px";
|
|
68
|
+
'2xs': "3px";
|
|
69
|
+
xs: "4px";
|
|
70
|
+
sm: "5px";
|
|
71
|
+
md: "6px";
|
|
72
|
+
lg: "8px";
|
|
73
|
+
xl: "12px";
|
|
74
|
+
'2xl': "16px";
|
|
75
|
+
full: "999px";
|
|
76
|
+
};
|
|
77
|
+
elevation: {
|
|
78
|
+
sm: "1px";
|
|
79
|
+
md: "2px";
|
|
80
|
+
lg: "4px";
|
|
81
|
+
xl: "6px";
|
|
82
|
+
};
|
|
83
|
+
breakpoints: {
|
|
84
|
+
'2xs': "0px";
|
|
85
|
+
xs: "500px";
|
|
86
|
+
sm: "800px";
|
|
87
|
+
md: "992px";
|
|
88
|
+
lg: "1200px";
|
|
89
|
+
xl: "1440px";
|
|
90
|
+
'2xl': "2560px";
|
|
91
|
+
};
|
|
92
|
+
container: {
|
|
93
|
+
zero: "0px";
|
|
94
|
+
'3xs': "320px";
|
|
95
|
+
'2xs': "384px";
|
|
96
|
+
xs: "448px";
|
|
97
|
+
sm: "512px";
|
|
98
|
+
md: "576px";
|
|
99
|
+
lg: "640px";
|
|
100
|
+
xl: "768px";
|
|
101
|
+
'2xl': "896px";
|
|
102
|
+
'3xl': "1024px";
|
|
103
|
+
'4xl': "1152px";
|
|
104
|
+
'5xl': "1280px";
|
|
105
|
+
};
|
|
106
|
+
};
|