@pingux/astro 2.84.0-alpha.1 → 2.84.0-alpha.2

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 (49) hide show
  1. package/lib/cjs/components/CodeView/CodeView.js +5 -2
  2. package/lib/cjs/components/CodeView/CodeView.styles.d.ts +2 -1
  3. package/lib/cjs/components/CodeView/CodeView.styles.js +4 -3
  4. package/lib/cjs/components/Link/Link.js +3 -1
  5. package/lib/cjs/components/MenuItem/MenuItem.styles.d.ts +1 -0
  6. package/lib/cjs/components/MenuItem/MenuItem.styles.js +2 -1
  7. package/lib/cjs/components/Tabs/Tabs.js +0 -1
  8. package/lib/cjs/components/Tabs/Tabs.style.d.ts +1 -0
  9. package/lib/cjs/components/Tabs/Tabs.style.js +2 -1
  10. package/lib/cjs/styles/theme.js +5 -1
  11. package/lib/cjs/styles/themes/next-gen/codeView/codeView.d.ts +105 -0
  12. package/lib/cjs/styles/themes/next-gen/codeView/codeView.js +134 -0
  13. package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +1 -1
  14. package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +278 -6
  15. package/lib/cjs/styles/themes/next-gen/next-gen.js +31 -4
  16. package/lib/cjs/styles/themes/next-gen/spacing.d.ts +9 -0
  17. package/lib/cjs/styles/themes/next-gen/spacing.js +17 -0
  18. package/lib/cjs/styles/themes/next-gen/text.d.ts +2 -2
  19. package/lib/cjs/styles/themes/next-gen/text.js +8 -13
  20. package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +36 -3
  21. package/lib/cjs/styles/themes/next-gen/variants/button.js +25 -5
  22. package/lib/cjs/styles/themes/next-gen/variants/cards.d.ts +20 -0
  23. package/lib/cjs/styles/themes/next-gen/variants/cards.js +28 -0
  24. package/lib/cjs/styles/themes/next-gen/variants/links.d.ts +56 -0
  25. package/lib/cjs/styles/themes/next-gen/variants/links.js +62 -0
  26. package/lib/cjs/styles/themes/next-gen/variants/text.d.ts +7 -0
  27. package/lib/cjs/styles/themes/next-gen/variants/text.js +9 -2
  28. package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +31 -1
  29. package/lib/cjs/styles/themes/next-gen/variants/variants.js +38 -5
  30. package/lib/cjs/types/codeView.d.ts +1 -0
  31. package/lib/cjs/types/link.d.ts +1 -0
  32. package/lib/components/CodeView/CodeView.js +5 -2
  33. package/lib/components/CodeView/CodeView.styles.js +4 -3
  34. package/lib/components/Link/Link.js +3 -1
  35. package/lib/components/MenuItem/MenuItem.styles.js +2 -1
  36. package/lib/components/Tabs/Tabs.js +0 -1
  37. package/lib/components/Tabs/Tabs.style.js +2 -1
  38. package/lib/styles/theme.js +5 -1
  39. package/lib/styles/themes/next-gen/codeView/codeView.js +126 -0
  40. package/lib/styles/themes/next-gen/convertedComponentList.js +1 -1
  41. package/lib/styles/themes/next-gen/next-gen.js +31 -4
  42. package/lib/styles/themes/next-gen/spacing.js +9 -0
  43. package/lib/styles/themes/next-gen/text.js +8 -13
  44. package/lib/styles/themes/next-gen/variants/button.js +25 -5
  45. package/lib/styles/themes/next-gen/variants/cards.js +20 -0
  46. package/lib/styles/themes/next-gen/variants/links.js +54 -0
  47. package/lib/styles/themes/next-gen/variants/text.js +9 -2
  48. package/lib/styles/themes/next-gen/variants/variants.js +38 -5
  49. package/package.json +1 -1
@@ -29,7 +29,7 @@ var _ = require("../..");
29
29
  var _hooks = require("../../hooks");
30
30
  var _CodeView = _interopRequireDefault(require("./CodeView.styles"));
31
31
  var _react2 = require("@emotion/react");
32
- var _excluded = ["children", "className", "hasLineNumbers", "hasNoCopyButton", "language", "Prism"];
32
+ var _excluded = ["children", "className", "hasLineNumbers", "hasNoCopyButton", "language", "Prism", "stylesProp"];
33
33
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
34
34
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
35
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -41,6 +41,8 @@ var CodeView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
41
41
  hasNoCopyButton = props.hasNoCopyButton,
42
42
  language = props.language,
43
43
  customPrism = props.Prism,
44
+ _props$stylesProp = props.stylesProp,
45
+ stylesProp = _props$stylesProp === void 0 ? _CodeView["default"] : _props$stylesProp,
44
46
  others = (0, _objectWithoutProperties2["default"])(props, _excluded);
45
47
  var _useFocusRing = (0, _focus.useFocusRing)(),
46
48
  isFocusVisible = _useFocusRing.isFocusVisible,
@@ -57,12 +59,13 @@ var CodeView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
57
59
  classNames = _useStatusClasses.classNames;
58
60
 
59
61
  // Get the width for the line number element depending on the total amount of lines
62
+
60
63
  var getLineNoWidth = function getLineNoWidth(tokens) {
61
64
  return tokens.length.toString().length * 12;
62
65
  };
63
66
  var code = (children === null || children === void 0 ? void 0 : (0, _trim["default"])(children).call(children)) || '';
64
67
  var content = (0, _react2.jsx)(_prismReactRenderer["default"], (0, _extends2["default"])({}, _prismReactRenderer.defaultProps, {
65
- theme: _CodeView["default"].theme,
68
+ theme: stylesProp.theme,
66
69
  code: code,
67
70
  language: language,
68
71
  Prism: customPrism || _prismReactRenderer.Prism
@@ -43,7 +43,7 @@ declare const _default: {
43
43
  pre: {
44
44
  backgroundColor: string;
45
45
  m: number;
46
- p: number;
46
+ p: string;
47
47
  pr: number;
48
48
  height: string;
49
49
  width: string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  overflowY: string;
52
52
  fontFamily: string;
53
53
  fontSize: string;
54
+ lineHeight: string;
54
55
  '& .token-line': {
55
56
  display: string;
56
57
  alignItems: string;
@@ -112,14 +112,15 @@ var wrapper = {
112
112
  pre: {
113
113
  backgroundColor: 'transparent',
114
114
  m: 0,
115
- p: 10,
115
+ p: 'sm',
116
116
  pr: 0,
117
117
  height: '100%',
118
118
  width: '100%',
119
119
  overflowX: 'hidden',
120
120
  overflowY: 'auto',
121
- fontFamily: 'standard',
122
- fontSize: 'sm',
121
+ fontFamily: 'codeView',
122
+ fontSize: '13px',
123
+ lineHeight: 'md',
123
124
  '& .token-line': {
124
125
  display: 'block',
125
126
  alignItems: 'center',
@@ -17,13 +17,14 @@ var _interactions = require("@react-aria/interactions");
17
17
  var _themeUi = require("theme-ui");
18
18
  var _hooks = require("../../hooks");
19
19
  var _react2 = require("@emotion/react");
20
- var _excluded = ["className", "isDisabled", "onPress", "isSafariCompatible"];
20
+ var _excluded = ["className", "isDisabled", "onPress", "isSelected", "isSafariCompatible"];
21
21
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
22
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
23
  var Link = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
24
24
  var className = props.className,
25
25
  isDisabled = props.isDisabled,
26
26
  onPress = props.onPress,
27
+ isSelected = props.isSelected,
27
28
  isSafariCompatible = props.isSafariCompatible,
28
29
  others = (0, _objectWithoutProperties2["default"])(props, _excluded);
29
30
  var linkRef = (0, _react.useRef)(null);
@@ -46,6 +47,7 @@ var Link = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
46
47
  pressProps = _usePress.pressProps,
47
48
  isPressed = _usePress.isPressed;
48
49
  var _useStatusClasses = (0, _hooks.useStatusClasses)(className, {
50
+ isSelected: isSelected,
49
51
  isDisabled: isDisabled,
50
52
  isFocused: isFocusVisible,
51
53
  isHovered: isHovered,
@@ -20,6 +20,7 @@ declare const _default: {
20
20
  '& > [role="separator"]': {
21
21
  margin: string;
22
22
  };
23
+ outline: string;
23
24
  };
24
25
  };
25
26
  export default _default;
@@ -25,7 +25,8 @@ var separator = {
25
25
  padding: '0px',
26
26
  '& > [role="separator"]': {
27
27
  margin: '0px'
28
- }
28
+ },
29
+ outline: 'none'
29
30
  };
30
31
  var _default = {
31
32
  item: item,
@@ -96,7 +96,6 @@ var Tabs = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
96
96
  value: state
97
97
  }, (0, _react2.jsx)(_Box["default"], others, (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
98
98
  variant: "tabs",
99
- gap: "25px",
100
99
  isRow: orientation === _orientation["default"].HORIZONTAL
101
100
  }, tabListProps, raTabListProps, {
102
101
  ref: tabListRef,
@@ -37,6 +37,7 @@ export declare const tabs: {
37
37
  borderBottomStyle: string;
38
38
  borderBottomColor: string;
39
39
  mb: string;
40
+ gap: string;
40
41
  };
41
42
  export declare const menuTab: {
42
43
  color: string;
@@ -53,7 +53,8 @@ var tabs = {
53
53
  borderBottomWidth: 1,
54
54
  borderBottomStyle: 'solid',
55
55
  borderBottomColor: 'neutral.90',
56
- mb: 'lg'
56
+ mb: 'lg',
57
+ gap: '25px'
57
58
  };
58
59
  exports.tabs = tabs;
59
60
  var menuTab = _objectSpread(_objectSpread({}, _Buttons.quiet), {}, {
@@ -37,10 +37,14 @@ var _default = {
37
37
  },
38
38
  breakpoints: _breakpoints["default"],
39
39
  fonts: {
40
- standard: '"Helvetica Neue", Helvetica, sans-serif'
40
+ standard: '"Helvetica Neue", Helvetica, sans-serif',
41
+ codeView: '"Roboto Mono", "Lucida Console", Courier, monospace'
41
42
  },
42
43
  fontSizes: _text.fontSizes,
43
44
  fontWeights: _text.fontWeights,
45
+ lineHeights: {
46
+ md: '1.5'
47
+ },
44
48
  sizes: {
45
49
  buttonHeight: 36,
46
50
  column: 400,
@@ -0,0 +1,105 @@
1
+ declare const _default: {
2
+ theme: {
3
+ plain: {
4
+ color: string;
5
+ backgroundColor: string;
6
+ };
7
+ styles: ({
8
+ types: string[];
9
+ style: {
10
+ color: string;
11
+ background?: undefined;
12
+ fontWeight?: undefined;
13
+ cursor?: undefined;
14
+ };
15
+ } | {
16
+ types: string[];
17
+ style: {
18
+ color: string;
19
+ background: string;
20
+ fontWeight?: undefined;
21
+ cursor?: undefined;
22
+ };
23
+ } | {
24
+ types: string[];
25
+ style: {
26
+ fontWeight: string;
27
+ color?: undefined;
28
+ background?: undefined;
29
+ cursor?: undefined;
30
+ };
31
+ } | {
32
+ types: string[];
33
+ style: {
34
+ cursor: string;
35
+ color?: undefined;
36
+ background?: undefined;
37
+ fontWeight?: undefined;
38
+ };
39
+ })[];
40
+ };
41
+ wrapper: {
42
+ bg: string;
43
+ border: string;
44
+ borderColor: string;
45
+ width: number;
46
+ height: number;
47
+ my: string;
48
+ overflow: string;
49
+ alignItems: string;
50
+ '&.is-focused, &:focus': {
51
+ boxShadow: string;
52
+ outline: string;
53
+ };
54
+ pre: {
55
+ backgroundColor: string;
56
+ padding: string;
57
+ height: string;
58
+ width: string;
59
+ overflowX: string;
60
+ overflowY: string;
61
+ fontSize: string;
62
+ '& .token-line': {
63
+ display: string;
64
+ alignItems: string;
65
+ '& .token': {
66
+ whiteSpace: string;
67
+ wordBreak: string;
68
+ };
69
+ };
70
+ fontFamily: string;
71
+ lineHeight: number;
72
+ };
73
+ '&.has-no-copy-button': {
74
+ pre: {
75
+ p: string;
76
+ };
77
+ };
78
+ '&.has-line-numbers': {
79
+ pre: {
80
+ p: string;
81
+ overflow: string;
82
+ '& .token-line:first-of-type *': {
83
+ pt: string;
84
+ };
85
+ '& .token-line': {
86
+ display: string;
87
+ '& .token': {
88
+ whiteSpace: string;
89
+ };
90
+ };
91
+ };
92
+ };
93
+ };
94
+ lineNo: {
95
+ display: string;
96
+ userSelect: string;
97
+ px: string;
98
+ m: string;
99
+ bg: string;
100
+ minWidth: number;
101
+ color: string;
102
+ lineHeight: string;
103
+ };
104
+ };
105
+ export default _default;
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var nextGenCodeViewTheme = {
9
+ plain: {
10
+ color: '#f8f8f2',
11
+ backgroundColor: '#272822'
12
+ },
13
+ styles: [{
14
+ types: ['comment', 'prolog', 'doctype', 'cdata'],
15
+ style: {
16
+ color: '#93a1a1'
17
+ }
18
+ }, {
19
+ types: ['punctuation'],
20
+ style: {
21
+ color: '#999999'
22
+ }
23
+ }, {
24
+ types: ['deleted', 'property', 'tag', 'boolean', 'number', 'constant', 'symbol'],
25
+ style: {
26
+ color: '#c792ea'
27
+ }
28
+ }, {
29
+ types: ['inserted', 'selector', 'string', 'char', 'builtin', 'inserted', 'attr-name'],
30
+ style: {
31
+ color: '#A1C281'
32
+ }
33
+ }, {
34
+ types: ['operator', 'entity', 'url', 'language-css', 'style'],
35
+ style: {
36
+ color: '#dfc084',
37
+ background: 'transparent'
38
+ }
39
+ }, {
40
+ types: ['atrule', 'attr-value', 'keyword'],
41
+ style: {
42
+ color: '#c792ea'
43
+ }
44
+ }, {
45
+ types: ['function'],
46
+ style: {
47
+ color: '#53bcfd'
48
+ }
49
+ }, {
50
+ types: ['regex', 'important', 'variable'],
51
+ style: {
52
+ color: '#f07178'
53
+ }
54
+ }, {
55
+ types: ['important', 'bold'],
56
+ style: {
57
+ fontWeight: 'bold'
58
+ }
59
+ }, {
60
+ types: ['entity'],
61
+ style: {
62
+ cursor: 'help'
63
+ }
64
+ }]
65
+ };
66
+ var nextGenCodeViewWrapper = {
67
+ bg: 'accent.99',
68
+ border: '1px solid',
69
+ borderColor: 'accent.95',
70
+ width: 400,
71
+ height: 200,
72
+ my: 'xs',
73
+ overflow: 'auto',
74
+ alignItems: 'center',
75
+ '&.is-focused, &:focus': {
76
+ boxShadow: 'focus',
77
+ outline: 'none'
78
+ },
79
+ pre: {
80
+ backgroundColor: 'transparent',
81
+ padding: '1em',
82
+ height: '100%',
83
+ width: '100%',
84
+ overflowX: 'hidden',
85
+ overflowY: 'auto',
86
+ fontSize: '13px',
87
+ '& .token-line': {
88
+ display: 'block',
89
+ alignItems: 'center',
90
+ '& .token': {
91
+ whiteSpace: 'pre-wrap',
92
+ wordBreak: 'break-all'
93
+ }
94
+ },
95
+ fontFamily: 'Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace',
96
+ lineHeight: 1.75
97
+ },
98
+ '&.has-no-copy-button': {
99
+ pre: {
100
+ p: 'sm'
101
+ }
102
+ },
103
+ '&.has-line-numbers': {
104
+ pre: {
105
+ p: '0 10px 0 0',
106
+ overflow: 'auto',
107
+ '& .token-line:first-of-type *': {
108
+ pt: 'sm'
109
+ },
110
+ '& .token-line': {
111
+ display: 'flex',
112
+ '& .token': {
113
+ whiteSpace: 'pre'
114
+ }
115
+ }
116
+ }
117
+ }
118
+ };
119
+ var lineNo = {
120
+ display: 'table-cell',
121
+ userSelect: 'none',
122
+ px: 'xs',
123
+ m: '0 10px 0 0',
124
+ bg: 'accent.30',
125
+ minWidth: 26,
126
+ color: 'white',
127
+ lineHeight: '20px'
128
+ };
129
+ var _default = {
130
+ theme: nextGenCodeViewTheme,
131
+ wrapper: nextGenCodeViewWrapper,
132
+ lineNo: lineNo
133
+ };
134
+ exports["default"] = _default;
@@ -5,6 +5,6 @@ _Object$defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports["default"] = void 0;
8
- var nextGenConvertedComponents = ['DataTable', 'Message', 'Button', 'Badge', 'IconButton', 'CheckboxField', 'Messages', 'PopoverMenu', 'TextField', 'PasswordField', 'SearchField', 'SelectField', 'Modal', 'RadioField', 'MultiValuesField', 'TextAreaField', 'RadioGroupField', 'Tabs', 'ProgressBar', 'NavBar', 'OverlayPanel', 'AstroProvider', 'ListView'];
8
+ var nextGenConvertedComponents = ['DataTable', 'Message', 'Button', 'Badge', 'IconButton', 'CheckboxField', 'Messages', 'PopoverMenu', 'TextField', 'PasswordField', 'SearchField', 'SelectField', 'Modal', 'RadioField', 'MultiValuesField', 'TextAreaField', 'RadioGroupField', 'Tabs', 'ProgressBar', 'NavBar', 'OverlayPanel', 'AstroProvider', 'ListView', 'MultivaluesField', 'Text', 'Link', 'Card'];
9
9
  var _default = nextGenConvertedComponents;
10
10
  exports["default"] = _default;