@pingux/astro 1.1.0-alpha.9 → 1.1.1-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 (64) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/lib/cjs/components/CodeView/CodeView.js +175 -0
  3. package/lib/cjs/components/CodeView/CodeView.stories.js +93 -0
  4. package/lib/cjs/components/CodeView/CodeView.test.js +211 -0
  5. package/lib/cjs/components/CodeView/index.js +18 -0
  6. package/lib/cjs/components/CopyText/CopyText.js +34 -11
  7. package/lib/cjs/components/FileInputField/FileItem.js +2 -1
  8. package/lib/cjs/components/NavBar/NavBar.js +38 -0
  9. package/lib/cjs/components/NavBar/NavBar.stories.js +679 -0
  10. package/lib/cjs/components/NavBar/NavBar.test.js +116 -0
  11. package/lib/cjs/components/NavBar/index.js +18 -0
  12. package/lib/cjs/components/NavBarSection/NavBarItemBody.js +56 -0
  13. package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +47 -0
  14. package/lib/cjs/components/NavBarSection/NavBarSection.js +82 -0
  15. package/lib/cjs/components/NavBarSection/index.js +18 -0
  16. package/lib/cjs/components/OverlayPanel/OverlayPanel.js +53 -6
  17. package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +59 -47
  18. package/lib/cjs/components/OverlayPanel/OverlayPanel.test.js +84 -0
  19. package/lib/cjs/components/PopoverMenu/PopoverMenu.js +1 -3
  20. package/lib/cjs/components/Separator/Separator.js +1 -1
  21. package/lib/cjs/components/TooltipTrigger/TooltipTrigger.js +10 -5
  22. package/lib/cjs/hooks/useOverlayPanelState/useOverlayPanelState.js +20 -1
  23. package/lib/cjs/hooks/useOverlayPanelState/useOverlayPanelState.test.js +7 -3
  24. package/lib/cjs/index.js +84 -30
  25. package/lib/cjs/styles/variants/accordion.js +32 -1
  26. package/lib/cjs/styles/variants/boxes.js +24 -1
  27. package/lib/cjs/styles/variants/buttons.js +29 -1
  28. package/lib/cjs/styles/variants/codeView.js +77 -0
  29. package/lib/cjs/styles/variants/link.js +1 -1
  30. package/lib/cjs/styles/variants/separator.js +46 -3
  31. package/lib/cjs/styles/variants/text.js +15 -0
  32. package/lib/cjs/styles/variants/variants.js +3 -0
  33. package/lib/components/CodeView/CodeView.js +139 -0
  34. package/lib/components/CodeView/CodeView.stories.js +67 -0
  35. package/lib/components/CodeView/CodeView.test.js +171 -0
  36. package/lib/components/CodeView/index.js +1 -0
  37. package/lib/components/CopyText/CopyText.js +35 -11
  38. package/lib/components/FileInputField/FileItem.js +2 -1
  39. package/lib/components/NavBar/NavBar.js +24 -0
  40. package/lib/components/NavBar/NavBar.stories.js +650 -0
  41. package/lib/components/NavBar/NavBar.test.js +92 -0
  42. package/lib/components/NavBar/index.js +1 -0
  43. package/lib/components/NavBarSection/NavBarItemBody.js +37 -0
  44. package/lib/components/NavBarSection/NavBarItemHeader.js +31 -0
  45. package/lib/components/NavBarSection/NavBarSection.js +65 -0
  46. package/lib/components/NavBarSection/index.js +1 -0
  47. package/lib/components/OverlayPanel/OverlayPanel.js +52 -8
  48. package/lib/components/OverlayPanel/OverlayPanel.stories.js +59 -49
  49. package/lib/components/OverlayPanel/OverlayPanel.test.js +73 -1
  50. package/lib/components/PopoverMenu/PopoverMenu.js +1 -3
  51. package/lib/components/Separator/Separator.js +1 -1
  52. package/lib/components/TooltipTrigger/TooltipTrigger.js +10 -5
  53. package/lib/hooks/useOverlayPanelState/useOverlayPanelState.js +20 -1
  54. package/lib/hooks/useOverlayPanelState/useOverlayPanelState.test.js +7 -3
  55. package/lib/index.js +5 -0
  56. package/lib/styles/variants/accordion.js +32 -1
  57. package/lib/styles/variants/boxes.js +24 -1
  58. package/lib/styles/variants/buttons.js +29 -1
  59. package/lib/styles/variants/codeView.js +67 -0
  60. package/lib/styles/variants/link.js +1 -1
  61. package/lib/styles/variants/separator.js +33 -1
  62. package/lib/styles/variants/text.js +15 -0
  63. package/lib/styles/variants/variants.js +2 -0
  64. package/package.json +3 -2
@@ -1,8 +1,8 @@
1
- import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
1
  import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
3
2
  import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
3
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
4
4
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
5
- import React, { forwardRef, useEffect, useState } from 'react';
5
+ import React, { forwardRef, useEffect, useRef, useState } from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import { useFocusRing } from '@react-aria/focus';
8
8
  import { Pressable, useHover } from '@react-aria/interactions';
@@ -14,19 +14,20 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
14
14
 
15
15
  var TooltipWrapper = function TooltipWrapper(_ref) {
16
16
  var children = _ref.children,
17
- isOpen = _ref.isOpen,
18
- tooltip = _ref.tooltip;
19
- return ___EmotionJSX(TooltipTrigger, {
17
+ tooltip = _ref.tooltip,
18
+ others = _objectWithoutProperties(_ref, ["children", "tooltip"]);
19
+
20
+ return ___EmotionJSX(TooltipTrigger, _extends({
20
21
  key: tooltip,
21
22
  direction: "top",
22
23
  isNotFlippable: true,
23
- isOpen: isOpen,
24
24
  offset: 5
25
- }, children, ___EmotionJSX(Tooltip, null, tooltip));
25
+ }, others), children, ___EmotionJSX(Tooltip, null, tooltip));
26
26
  };
27
27
 
28
28
  TooltipWrapper.propTypes = {
29
29
  isOpen: PropTypes.bool,
30
+ targetRef: PropTypes.shape({}),
30
31
  tooltip: PropTypes.string
31
32
  };
32
33
  /**
@@ -38,7 +39,9 @@ var CopyText = /*#__PURE__*/forwardRef(function (props, ref) {
38
39
  textToCopy = props.textToCopy,
39
40
  tooltipText = props.tooltipText,
40
41
  mode = props.mode,
41
- others = _objectWithoutProperties(props, ["children", "textToCopy", "tooltipText", "mode"]);
42
+ tooltipProps = props.tooltipProps,
43
+ wrapperProps = props.wrapperProps,
44
+ others = _objectWithoutProperties(props, ["children", "textToCopy", "tooltipText", "mode", "tooltipProps", "wrapperProps"]);
42
45
 
43
46
  var value = textToCopy || (mode === 'link' ? children.props.href : children.props.children);
44
47
 
@@ -75,13 +78,28 @@ var CopyText = /*#__PURE__*/forwardRef(function (props, ref) {
75
78
  return undefined;
76
79
  }, [isCopied]);
77
80
  var copyToClipboard = useCopyToClipboard(value, setIsCopied);
78
- var content = mode === 'link' ? children : ___EmotionJSX(Button, _extends({
81
+ var content = mode === 'link' || mode === 'nonClickableContent' ? children : ___EmotionJSX(Button, _extends({
79
82
  variant: "quiet",
80
83
  onPress: copyToClipboard,
81
84
  "aria-label": "copy-content"
82
85
  }, focusProps), children);
83
86
  var tooltip = isCopied ? 'Copied!' : tooltipText;
84
87
  var isTooltipOpen = isFocusVisible || isHovered || isCopied;
88
+ var wrapperRef = useRef();
89
+
90
+ if (mode === 'nonClickableContent') {
91
+ return ___EmotionJSX(TooltipWrapper, _extends({
92
+ isOpen: isTooltipOpen,
93
+ tooltip: tooltip,
94
+ targetRef: wrapperRef
95
+ }, tooltipProps), ___EmotionJSX(Box, _extends({
96
+ ref: wrapperRef,
97
+ isRow: true,
98
+ tabIndex: 0
99
+ }, mergeProps(hoverProps, others), wrapperProps), content, ___EmotionJSX(CopyButton, _extends({
100
+ onPress: copyToClipboard
101
+ }, focusProps))));
102
+ }
85
103
 
86
104
  if (mode === 'link') {
87
105
  return ___EmotionJSX(Box, _extends({
@@ -109,13 +127,19 @@ var CopyText = /*#__PURE__*/forwardRef(function (props, ref) {
109
127
  });
110
128
  CopyText.propTypes = {
111
129
  /** The behavioral pattern to apply to the component. */
112
- mode: PropTypes.oneOf(['text', 'link']),
130
+ mode: PropTypes.oneOf(['text', 'link', 'nonClickableContent']),
113
131
 
114
132
  /** The text to be copied instead of the text inside the child component. */
115
133
  textToCopy: PropTypes.string,
116
134
 
117
135
  /** The text to be displayed in the tooltip. */
118
- tooltipText: PropTypes.string
136
+ tooltipText: PropTypes.string,
137
+
138
+ /** Props to apply to the tooltip in nonClickableContent mode. */
139
+ tooltipProps: PropTypes.shape({}),
140
+
141
+ /** Props to apply to the wrapper in nonClickableContent mode. */
142
+ wrapperProps: PropTypes.shape({})
119
143
  };
120
144
  CopyText.defaultProps = {
121
145
  mode: 'text',
@@ -37,7 +37,8 @@ var FileItem = function FileItem(props) {
37
37
 
38
38
  default:
39
39
  return {
40
- icon: InsertDriveFileIcon
40
+ icon: InsertDriveFileIcon,
41
+ color: 'neutral.10'
41
42
  };
42
43
  }
43
44
  }, [status]);
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import Box from '../Box/Box';
3
+ /**
4
+ * Composed component that spreads children.
5
+ *
6
+ * This component is built to have the NavBarSection component passed into it.
7
+ *
8
+ * NavBarSection is an iterative component that
9
+ * will build an AccordionGridGroup using
10
+ * the array of objects that is passed into it.
11
+ *
12
+ */
13
+
14
+ import { jsx as ___EmotionJSX } from "@emotion/react";
15
+
16
+ var NavBar = function NavBar(props) {
17
+ return ___EmotionJSX(Box, {
18
+ variant: "boxes.navBar",
19
+ role: "navigation",
20
+ as: "nav"
21
+ }, props.children);
22
+ };
23
+
24
+ export default NavBar;