@pingux/astro 1.1.0-alpha.11 → 1.1.0-alpha.12
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/CHANGELOG.md +11 -0
- package/lib/cjs/components/CodeView/CodeView.js +165 -0
- package/lib/cjs/components/CodeView/CodeView.stories.js +93 -0
- package/lib/cjs/components/CodeView/CodeView.test.js +211 -0
- package/lib/cjs/components/CodeView/index.js +18 -0
- package/lib/cjs/components/CopyText/CopyText.js +34 -11
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.js +10 -5
- package/lib/cjs/index.js +10 -0
- package/lib/cjs/styles/variants/codeView.js +80 -0
- package/lib/cjs/styles/variants/variants.js +3 -0
- package/lib/components/CodeView/CodeView.js +130 -0
- package/lib/components/CodeView/CodeView.stories.js +67 -0
- package/lib/components/CodeView/CodeView.test.js +171 -0
- package/lib/components/CodeView/index.js +1 -0
- package/lib/components/CopyText/CopyText.js +35 -11
- package/lib/components/TooltipTrigger/TooltipTrigger.js +10 -5
- package/lib/index.js +1 -0
- package/lib/styles/variants/codeView.js +68 -0
- package/lib/styles/variants/variants.js +2 -0
- package/package.json +3 -1
@@ -0,0 +1,68 @@
|
|
1
|
+
import 'a11y-syntax-highlighting/dist/prism/a11y-light.min.css';
|
2
|
+
var wrapper = {
|
3
|
+
bg: 'accent.99',
|
4
|
+
border: '1px solid',
|
5
|
+
borderColor: 'accent.95',
|
6
|
+
width: 400,
|
7
|
+
height: 200,
|
8
|
+
my: 5,
|
9
|
+
overflow: 'auto',
|
10
|
+
alignItems: 'center',
|
11
|
+
'&.is-focused, &:focus': {
|
12
|
+
boxShadow: 'focus',
|
13
|
+
outline: 'none'
|
14
|
+
},
|
15
|
+
pre: {
|
16
|
+
backgroundColor: 'transparent',
|
17
|
+
m: 0,
|
18
|
+
p: 10,
|
19
|
+
pr: 0,
|
20
|
+
height: '100%',
|
21
|
+
width: '100%',
|
22
|
+
overflowX: 'hidden',
|
23
|
+
overflowY: 'auto',
|
24
|
+
fontFamily: 'standard',
|
25
|
+
fontSize: 'sm',
|
26
|
+
'& .token-line': {
|
27
|
+
display: 'block',
|
28
|
+
alignItems: 'center',
|
29
|
+
'& .token': {
|
30
|
+
whiteSpace: 'pre-wrap',
|
31
|
+
wordBreak: 'break-all'
|
32
|
+
}
|
33
|
+
}
|
34
|
+
},
|
35
|
+
'&.has-no-copy-button': {
|
36
|
+
pre: {
|
37
|
+
p: 10
|
38
|
+
}
|
39
|
+
},
|
40
|
+
'&.has-line-numbers': {
|
41
|
+
pre: {
|
42
|
+
p: '0 10px 0 0',
|
43
|
+
overflow: 'auto',
|
44
|
+
'& .token-line:first-of-type *': {
|
45
|
+
pt: 10
|
46
|
+
},
|
47
|
+
'& .token-line': {
|
48
|
+
display: 'flex',
|
49
|
+
'& .token': {
|
50
|
+
whiteSpace: 'pre'
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
};
|
56
|
+
var lineNo = {
|
57
|
+
display: 'table-cell',
|
58
|
+
userSelect: 'none',
|
59
|
+
p: 5,
|
60
|
+
m: '0 10px 0 0',
|
61
|
+
bg: 'accent.30',
|
62
|
+
minWidth: 26,
|
63
|
+
color: 'white'
|
64
|
+
};
|
65
|
+
export default {
|
66
|
+
wrapper: wrapper,
|
67
|
+
lineNo: lineNo
|
68
|
+
};
|
@@ -14,6 +14,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
14
14
|
|
15
15
|
import accordion from './accordion';
|
16
16
|
import boxes from './boxes';
|
17
|
+
import codeView from './codeView';
|
17
18
|
import images from './images';
|
18
19
|
import imageUpload from './imageUpload';
|
19
20
|
import link from './link';
|
@@ -35,6 +36,7 @@ import tooltip from './tooltip';
|
|
35
36
|
export default _objectSpread(_objectSpread({
|
36
37
|
accordion: accordion,
|
37
38
|
boxes: boxes,
|
39
|
+
codeView: codeView,
|
38
40
|
images: images,
|
39
41
|
imageUpload: imageUpload,
|
40
42
|
loader: loader,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pingux/astro",
|
3
|
-
"version": "1.1.0-alpha.
|
3
|
+
"version": "1.1.0-alpha.12",
|
4
4
|
"description": "PingUX themeable React component library",
|
5
5
|
"author": "uxdev@pingidentity.com",
|
6
6
|
"license": "Apache-2.0",
|
@@ -126,12 +126,14 @@
|
|
126
126
|
"@styled-system/props": "^5.1.5",
|
127
127
|
"@styled-system/theme-get": "^5.1.2",
|
128
128
|
"@tippyjs/react": "4.2.0",
|
129
|
+
"a11y-syntax-highlighting": "0.2.0",
|
129
130
|
"chroma-js": "^2.1.0",
|
130
131
|
"classnames": "^2.2.6",
|
131
132
|
"emotion-normalize": "^11.0.1",
|
132
133
|
"lodash": "^4.17.21",
|
133
134
|
"mdi-react": "^7.4.0",
|
134
135
|
"moment": "^2.29.1",
|
136
|
+
"prism-react-renderer": "^1.2.1",
|
135
137
|
"prop-types": "^15.7.2",
|
136
138
|
"react-calendar": "^3.4.0",
|
137
139
|
"react-color": "^2.19.3",
|