@pingux/astro 2.119.0-alpha.1 → 2.119.0-alpha.3

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 (98) hide show
  1. package/lib/cjs/components/Button/Buttons.styles.d.ts +40 -0
  2. package/lib/cjs/components/Button/Buttons.styles.js +4 -0
  3. package/lib/cjs/components/ListView/ListView.stories.d.ts +3 -0
  4. package/lib/cjs/components/ListView/ListView.stories.js +2 -1
  5. package/lib/cjs/components/NavBar/NavBar.stories.d.ts +1 -0
  6. package/lib/cjs/components/NavBar/NavBar.stories.js +272 -107
  7. package/lib/cjs/{styles/themeOverrides → components/NavBar}/stories/NavBar.chromatic.stories.js +53 -53
  8. package/lib/cjs/components/NavBar/stories/NavBarNextGenComponent.js +191 -0
  9. package/lib/cjs/{styles/themeOverrides/nextGenDarkMode → components/NavBar}/stories/NextGenDarkNavStory.chomatic.stories.js +2 -2
  10. package/lib/cjs/{styles/themes/next-gen → components/NavBar}/stories/NextGenNavBar.chromatic.stories.js +1 -1
  11. package/lib/cjs/components/NavBarSection/NavBarItem.js +3 -1
  12. package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +9 -6
  13. package/lib/cjs/components/NavBarSection/NavBarItemHeader.test.d.ts +1 -0
  14. package/lib/cjs/components/NavBarSection/NavBarItemHeader.test.js +86 -0
  15. package/lib/cjs/components/Pagination/Pagination.d.ts +4 -0
  16. package/lib/cjs/components/Pagination/Pagination.js +78 -0
  17. package/lib/cjs/components/Pagination/Pagination.mdx +68 -0
  18. package/lib/cjs/components/Pagination/Pagination.stories.d.ts +39 -0
  19. package/lib/cjs/components/Pagination/Pagination.stories.js +159 -0
  20. package/lib/cjs/components/Pagination/Pagination.styles.d.ts +17 -0
  21. package/lib/cjs/components/Pagination/Pagination.styles.js +27 -0
  22. package/lib/cjs/components/Pagination/Pagination.test.d.ts +1 -0
  23. package/lib/cjs/components/Pagination/Pagination.test.js +208 -0
  24. package/lib/cjs/components/Pagination/PaginationProvider.d.ts +4 -0
  25. package/lib/cjs/components/Pagination/PaginationProvider.js +38 -0
  26. package/lib/cjs/components/Pagination/index.d.ts +2 -0
  27. package/lib/cjs/components/Pagination/index.js +33 -0
  28. package/lib/cjs/context/PaginationContext/index.d.ts +10 -0
  29. package/lib/cjs/context/PaginationContext/index.js +20 -0
  30. package/lib/cjs/hooks/index.d.ts +2 -0
  31. package/lib/cjs/hooks/index.js +14 -0
  32. package/lib/cjs/hooks/usePagination/index.d.ts +1 -0
  33. package/lib/cjs/hooks/usePagination/index.js +14 -0
  34. package/lib/cjs/hooks/usePagination/usePagination.d.ts +682 -0
  35. package/lib/cjs/hooks/usePagination/usePagination.js +178 -0
  36. package/lib/cjs/hooks/usePaginationState/index.d.ts +1 -0
  37. package/lib/cjs/hooks/usePaginationState/index.js +14 -0
  38. package/lib/cjs/hooks/usePaginationState/usePaginationState.d.ts +4 -0
  39. package/lib/cjs/hooks/usePaginationState/usePaginationState.js +18 -0
  40. package/lib/cjs/index.d.ts +3 -0
  41. package/lib/cjs/index.js +24 -0
  42. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.d.ts +3 -0
  43. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +3 -0
  44. package/lib/cjs/styles/themes/next-gen/convertedComponentList.d.ts +4 -0
  45. package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +8 -3
  46. package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +30 -0
  47. package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +17 -0
  48. package/lib/cjs/styles/themes/next-gen/variants/button.js +7 -1
  49. package/lib/cjs/styles/themes/next-gen/variants/links.d.ts +9 -0
  50. package/lib/cjs/styles/themes/next-gen/variants/links.js +12 -1
  51. package/lib/cjs/styles/themes/next-gen/variants/navbar.d.ts +4 -0
  52. package/lib/cjs/styles/themes/next-gen/variants/navbar.js +11 -7
  53. package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +4 -0
  54. package/lib/cjs/styles/variants/variants.js +3 -1
  55. package/lib/cjs/types/pagination.d.ts +46 -0
  56. package/lib/cjs/types/pagination.js +6 -0
  57. package/lib/cjs/utils/devUtils/shouldReturnComingSoon.js +8 -2
  58. package/lib/components/Button/Buttons.styles.js +4 -0
  59. package/lib/components/ListView/ListView.stories.js +1 -1
  60. package/lib/components/NavBar/NavBar.stories.js +196 -32
  61. package/lib/{styles/themeOverrides → components/NavBar}/stories/NavBar.chromatic.stories.js +2 -2
  62. package/lib/components/NavBar/stories/NavBarNextGenComponent.js +182 -0
  63. package/lib/{styles/themeOverrides/nextGenDarkMode → components/NavBar}/stories/NextGenDarkNavStory.chomatic.stories.js +2 -2
  64. package/lib/{styles/themes/next-gen → components/NavBar}/stories/NextGenNavBar.chromatic.stories.js +1 -1
  65. package/lib/components/NavBarSection/NavBarItem.js +4 -2
  66. package/lib/components/NavBarSection/NavBarItemHeader.js +7 -4
  67. package/lib/components/NavBarSection/NavBarItemHeader.test.js +83 -0
  68. package/lib/components/Pagination/Pagination.js +64 -0
  69. package/lib/components/Pagination/Pagination.mdx +68 -0
  70. package/lib/components/Pagination/Pagination.stories.js +141 -0
  71. package/lib/components/Pagination/Pagination.styles.js +19 -0
  72. package/lib/components/Pagination/Pagination.test.js +205 -0
  73. package/lib/components/Pagination/PaginationProvider.js +24 -0
  74. package/lib/components/Pagination/index.js +2 -0
  75. package/lib/context/PaginationContext/index.js +11 -0
  76. package/lib/hooks/index.js +2 -0
  77. package/lib/hooks/usePagination/index.js +1 -0
  78. package/lib/hooks/usePagination/usePagination.js +170 -0
  79. package/lib/hooks/usePaginationState/index.js +1 -0
  80. package/lib/hooks/usePaginationState/usePaginationState.js +10 -0
  81. package/lib/index.js +3 -0
  82. package/lib/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +3 -0
  83. package/lib/styles/themes/next-gen/convertedComponentList.js +6 -2
  84. package/lib/styles/themes/next-gen/variants/button.js +7 -1
  85. package/lib/styles/themes/next-gen/variants/links.js +12 -1
  86. package/lib/styles/themes/next-gen/variants/navbar.js +11 -7
  87. package/lib/styles/variants/variants.js +3 -1
  88. package/lib/types/pagination.js +1 -0
  89. package/lib/utils/devUtils/shouldReturnComingSoon.js +9 -3
  90. package/package.json +1 -1
  91. package/lib/cjs/recipes/NextGen/NavBarNextGen.stories.d.ts +0 -6
  92. package/lib/cjs/recipes/NextGen/NavBarNextGen.stories.js +0 -19
  93. package/lib/cjs/styles/themes/next-gen/stories/NavBarNextGenComponent.js +0 -191
  94. package/lib/recipes/NextGen/NavBarNextGen.stories.js +0 -9
  95. package/lib/styles/themes/next-gen/stories/NavBarNextGenComponent.js +0 -182
  96. /package/lib/cjs/{styles/themes/next-gen → components/NavBar}/stories/NavBarNextGenComponent.d.ts +0 -0
  97. /package/lib/cjs/{styles/themeOverrides/nextGenDarkMode → components/NavBar}/stories/NextGenDarkNavStory.chomatic.stories.d.ts +0 -0
  98. /package/lib/cjs/{styles/themes/next-gen → components/NavBar}/stories/NextGenNavBar.chromatic.stories.d.ts +0 -0
@@ -0,0 +1 @@
1
+ export { default } from './usePagination';
@@ -0,0 +1,170 @@
1
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
2
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
3
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
4
+ var _excluded = ["currentPageIndex", "nextButtonProps", "offsetCount", "offsetMenuProps", "offsetOptions", "onOffsetCountChange", "onPageIndexChange", "previousButtonProps", "totalCount"];
5
+ 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; }
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
8
+ import _parseInt from "@babel/runtime-corejs3/core-js-stable/parse-int";
9
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
10
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
11
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
12
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
13
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
14
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
15
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
16
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
17
+ import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
18
+ import { PaginationContext } from '../../context/PaginationContext';
19
+ import useProgressiveState from '../useProgressiveState';
20
+ var getRangeString = function getRangeString(_ref) {
21
+ var _context, _context2;
22
+ var first = _ref.first,
23
+ last = _ref.last,
24
+ total = _ref.total;
25
+ return _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = "".concat(first + 1, "-")).call(_context2, Math.min(last + 1, total), " of ")).call(_context, total);
26
+ };
27
+ var getNewIndexOnOffsetChange = function getNewIndexOnOffsetChange(_ref2) {
28
+ var first = _ref2.first,
29
+ newOffset = _ref2.newOffset;
30
+ var newLast = Math.floor(first / newOffset);
31
+ return newLast;
32
+ };
33
+ var defaultOffsetOptions = [10, 25, 50];
34
+ var usePagination = function usePagination(props) {
35
+ var currentPageIndexProp = props.currentPageIndex,
36
+ nextButtonProps = props.nextButtonProps,
37
+ offsetCountProp = props.offsetCount,
38
+ offsetMenuProps = props.offsetMenuProps,
39
+ _props$offsetOptions = props.offsetOptions,
40
+ offsetOptions = _props$offsetOptions === void 0 ? defaultOffsetOptions : _props$offsetOptions,
41
+ onOffsetCountChange = props.onOffsetCountChange,
42
+ onPageIndexChange = props.onPageIndexChange,
43
+ previousButtonProps = props.previousButtonProps,
44
+ totalCount = props.totalCount,
45
+ others = _objectWithoutProperties(props, _excluded);
46
+ var isMountedRef = useRef(false);
47
+ var initialIndexValue = currentPageIndexProp || 0;
48
+ var initialOffsetValue = offsetCountProp || 10;
49
+ var _useProgressiveState = useProgressiveState(currentPageIndexProp, initialIndexValue),
50
+ _useProgressiveState2 = _slicedToArray(_useProgressiveState, 2),
51
+ currentPageIndex = _useProgressiveState2[0],
52
+ setCurrentPageIndex = _useProgressiveState2[1];
53
+ var _useProgressiveState3 = useProgressiveState(offsetCountProp, initialOffsetValue),
54
+ _useProgressiveState4 = _slicedToArray(_useProgressiveState3, 2),
55
+ offsetCount = _useProgressiveState4[0],
56
+ setOffsetCount = _useProgressiveState4[1];
57
+ var _useState = useState(currentPageIndex),
58
+ _useState2 = _slicedToArray(_useState, 2),
59
+ firstRenderedIndex = _useState2[0],
60
+ setFirstRenderedIndex = _useState2[1];
61
+ var _useState3 = useState((currentPageIndex + 1) * offsetCount - 1),
62
+ _useState4 = _slicedToArray(_useState3, 2),
63
+ lastRenderedIndex = _useState4[0],
64
+ setLastRenderedIndex = _useState4[1];
65
+ useEffect(function () {
66
+ var calculatedLastIndex = (currentPageIndex + 1) * offsetCount - 1;
67
+ setFirstRenderedIndex(currentPageIndex * offsetCount);
68
+ setLastRenderedIndex(Math.min(calculatedLastIndex, totalCount));
69
+ }, [currentPageIndex, offsetCount, totalCount]);
70
+ useEffect(function () {
71
+ if (isMountedRef.current) {
72
+ var newIndex = getNewIndexOnOffsetChange({
73
+ newOffset: offsetCount,
74
+ first: firstRenderedIndex
75
+ });
76
+ setCurrentPageIndex(newIndex);
77
+ if (onPageIndexChange) {
78
+ onPageIndexChange(newIndex);
79
+ }
80
+ }
81
+ }, [offsetCount]);
82
+ useEffect(function () {
83
+ isMountedRef.current = true;
84
+ }, []);
85
+ var lastIndex = Math.ceil(totalCount / offsetCount);
86
+ var isFirstIndex = currentPageIndex === 0;
87
+ var isLastIndex = lastIndex - 1 === currentPageIndex;
88
+ var popoverButtonString = useMemo(function () {
89
+ return getRangeString({
90
+ first: firstRenderedIndex,
91
+ last: lastRenderedIndex,
92
+ total: totalCount
93
+ });
94
+ }, [firstRenderedIndex, lastRenderedIndex, totalCount]);
95
+ var setOffsetCountCallback = useCallback(function (keys) {
96
+ if (keys !== null && keys !== void 0 && keys.currentKey) {
97
+ setOffsetCount(_parseInt(keys.currentKey, 10));
98
+ if (onOffsetCountChange && isMountedRef.current) {
99
+ onOffsetCountChange(_parseInt(keys.currentKey, 10));
100
+ }
101
+ }
102
+ }, [setOffsetCount, onOffsetCountChange, isMountedRef]);
103
+ var paginationState = useMemo(function () {
104
+ return {
105
+ isFirstIndex: isFirstIndex,
106
+ isLastIndex: isLastIndex,
107
+ firstRenderedIndex: firstRenderedIndex,
108
+ lastRenderedIndex: lastRenderedIndex,
109
+ offsetCount: offsetCount,
110
+ totalCount: totalCount,
111
+ currentPageIndex: currentPageIndex,
112
+ popoverButtonString: popoverButtonString,
113
+ setOffsetCount: setOffsetCountCallback,
114
+ offsetOptions: offsetOptions
115
+ };
116
+ }, [isFirstIndex, isLastIndex, firstRenderedIndex, lastRenderedIndex, offsetCount, totalCount, currentPageIndex, popoverButtonString, setOffsetCountCallback, offsetOptions]);
117
+ var contextState = useMemo(function () {
118
+ return {
119
+ firstRenderedIndex: firstRenderedIndex,
120
+ lastRenderedIndex: lastRenderedIndex,
121
+ offsetCount: offsetCount,
122
+ totalCount: totalCount,
123
+ currentPageIndex: currentPageIndex
124
+ };
125
+ }, [firstRenderedIndex, lastRenderedIndex, offsetCount, totalCount, currentPageIndex]);
126
+ var _useContext = useContext(PaginationContext),
127
+ setPaginationState = _useContext.setPaginationState;
128
+ useEffect(function () {
129
+ if (setPaginationState) {
130
+ setPaginationState(_objectSpread({}, contextState));
131
+ }
132
+ }, [contextState, setPaginationState]);
133
+ var nextIndex = function nextIndex() {
134
+ if (!isLastIndex) {
135
+ setCurrentPageIndex(currentPageIndex + 1);
136
+ if (onPageIndexChange) {
137
+ onPageIndexChange(currentPageIndex + 1);
138
+ }
139
+ }
140
+ };
141
+ var previousIndex = function previousIndex() {
142
+ if (!isFirstIndex) {
143
+ setCurrentPageIndex(currentPageIndex - 1);
144
+ if (onPageIndexChange) {
145
+ onPageIndexChange(currentPageIndex - 1);
146
+ }
147
+ }
148
+ };
149
+ var nextButtonPropsSpread = _objectSpread(_objectSpread({
150
+ 'aria-label': 'Next Page'
151
+ }, nextButtonProps), {}, {
152
+ isDisabled: isLastIndex,
153
+ onPress: nextIndex
154
+ });
155
+ var previousButtonPropsSpread = _objectSpread(_objectSpread({
156
+ 'aria-label': 'Previous Page'
157
+ }, previousButtonProps), {}, {
158
+ isDisabled: isFirstIndex,
159
+ onPress: previousIndex
160
+ });
161
+ var containerProps = _objectSpread({}, others);
162
+ return {
163
+ state: paginationState,
164
+ previousButtonProps: previousButtonPropsSpread,
165
+ nextButtonProps: nextButtonPropsSpread,
166
+ containerProps: containerProps,
167
+ offsetMenuProps: offsetMenuProps
168
+ };
169
+ };
170
+ export default usePagination;
@@ -0,0 +1 @@
1
+ export { default } from './usePaginationState';
@@ -0,0 +1,10 @@
1
+ import { useContext } from 'react';
2
+ import { PaginationContext } from '../../context/PaginationContext';
3
+ var usePaginationState = function usePaginationState() {
4
+ var _useContext = useContext(PaginationContext),
5
+ paginationState = _useContext.paginationState;
6
+ return {
7
+ paginationState: paginationState
8
+ };
9
+ };
10
+ export default usePaginationState;
package/lib/index.js CHANGED
@@ -138,6 +138,8 @@ export * from './components/NumberField';
138
138
  export { default as OverlayPanel } from './components/OverlayPanel';
139
139
  export * from './components/OverlayPanel';
140
140
  export { default as PageHeader } from './components/PageHeader';
141
+ export { default as Pagination } from './components/Pagination';
142
+ export { default as PaginationProvider } from './components/Pagination/PaginationProvider';
141
143
  export { default as PanelHeader } from './components/PanelHeader';
142
144
  export { default as PanelHeaderCloseButton } from './components/PanelHeader/controls/PanelHeaderCloseButton';
143
145
  export { default as PanelHeaderMenu } from './components/PanelHeader/controls/PanelHeaderMenu';
@@ -210,6 +212,7 @@ export { default as TooltipTrigger } from './components/TooltipTrigger';
210
212
  export * from './components/TooltipTrigger';
211
213
  export { default as TreeView } from './components/TreeView';
212
214
  export * from './components/TreeView';
215
+ export { PaginationContext } from './context/PaginationContext';
213
216
  export { default as NextGenDarkTheme } from './styles/themeOverrides/nextGenDarkMode';
214
217
  export { default as OnyxDarkTheme } from './styles/themeOverrides/nextGenDarkMode';
215
218
  export { default as NextGenTheme } from './styles/themes/next-gen';
@@ -59,6 +59,9 @@ var buttons = {
59
59
  color: 'black'
60
60
  }
61
61
  },
62
+ paginationMenu: {
63
+ color: 'text.secondary'
64
+ },
62
65
  neutral: {
63
66
  color: 'gray-400'
64
67
  },
@@ -1,4 +1,4 @@
1
- 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', 'NavigationHeader', 'Avatar', 'MultivaluesField', 'Text', 'Link', 'Card', 'IconWrapper', 'ComboBoxField', 'CodeView', 'Sticker Sheet', 'NextGen ListViewItem', 'Skeleton'];
1
+ 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', 'NavigationHeader', 'Avatar', 'MultivaluesField', 'Text', 'Link', 'Card', 'IconWrapper', 'ComboBoxField', 'CodeView', 'Sticker Sheet', 'NextGen ListViewItem', 'Skeleton', 'Pagination'];
2
2
  export var componentSpecificNextGenBlacklist = {
3
3
  AstroProvider: ['Default', 'With Custom Theme Override'],
4
4
  Badge: ['Status Badge Variants', 'Badge With Left Slot And Icon', 'Callout Badges', 'Removable'],
@@ -7,7 +7,11 @@ export var componentSpecificNextGenBlacklist = {
7
7
  MultivaluesField: ['Condensed', 'Condensed With Section'],
8
8
  PasswordField: ['Success'],
9
9
  TextField: ['Success'],
10
- OverlayPanel: ['Expandable']
10
+ OverlayPanel: ['Expandable'],
11
+ NavBar: ['Default', 'Controlled', 'Auto Collapse']
12
+ };
13
+ export var astroBlacklistStory = {
14
+ NavBar: ['Onyx Default']
11
15
  };
12
16
  export var nextGenOnlyComponents = ['NavigationHeader', 'Prompt', 'AI Panel', 'Response', 'Suggestions', 'Prompt Input'];
13
17
  export default nextGenConvertedComponents;
@@ -146,6 +146,11 @@ var link = {
146
146
  outline: 'none'
147
147
  }
148
148
  };
149
+ var paginationMenu = _objectSpread(_objectSpread({}, link), {}, {
150
+ px: '0px',
151
+ py: '0px',
152
+ color: 'text.primary'
153
+ });
149
154
  var withIcon = _objectSpread(_objectSpread({}, secondary), {}, {
150
155
  display: 'inline-flex'
151
156
  });
@@ -343,6 +348,7 @@ var buttons = {
343
348
  primaryWithIcon: primaryWithIcon,
344
349
  iconButtons: iconButtons,
345
350
  modalCloseButton: modalCloseButton,
346
- aiChat: aiChat
351
+ aiChat: aiChat,
352
+ paginationMenu: paginationMenu
347
353
  };
348
354
  export default buttons;
@@ -10,6 +10,10 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
10
  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; }
11
11
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
12
12
  import buttons from './button';
13
+ var navBarFocus = {
14
+ outline: '2px solid',
15
+ outlineColor: 'active'
16
+ };
13
17
  var nextGen = {
14
18
  color: 'gray-800',
15
19
  fontSize: 'md',
@@ -62,6 +66,12 @@ var button = _objectSpread(_objectSpread({}, buttons["default"]), {}, {
62
66
  var primaryButton = _objectSpread(_objectSpread({}, buttons.primary), {}, {
63
67
  textDecoration: 'none'
64
68
  });
69
+ var navBarLogoLink = {
70
+ borderRadius: '4px',
71
+ px: 'md',
72
+ py: 'sm',
73
+ '&.is-focused': _objectSpread({}, navBarFocus)
74
+ };
65
75
  export default {
66
76
  nextGen: nextGen,
67
77
  onyx: onyx,
@@ -69,5 +79,6 @@ export default {
69
79
  footerLinks: footerLinks,
70
80
  footerHeader: footerHeader,
71
81
  button: button,
72
- primaryButton: primaryButton
82
+ primaryButton: primaryButton,
83
+ navBarLogoLink: navBarLogoLink
73
84
  };
@@ -20,11 +20,15 @@ export var navBarFocus = {
20
20
  };
21
21
  export var navBar = {
22
22
  container: {
23
+ fontFamily: 'standard',
23
24
  width: '252px',
24
25
  p: 'sm',
25
26
  backgroundColor: 'background.base',
26
27
  boxShadow: '0 .5rem 1rem rgba(0, 0, 0, .15)'
27
28
  },
29
+ sectionContainer: {
30
+ pt: '0'
31
+ },
28
32
  sectionButton: {
29
33
  borderRadius: '4px',
30
34
  '&.is-hovered': {
@@ -38,7 +42,7 @@ export var navBar = {
38
42
  itemButton: {
39
43
  py: '.75rem',
40
44
  paddingLeft: '53px',
41
- color: 'text.primary',
45
+ color: 'gray-700',
42
46
  borderRadius: '4px',
43
47
  '&.is-focused': _objectSpread({}, navBarFocus),
44
48
  '&.is-hovered': {
@@ -46,7 +50,7 @@ export var navBar = {
46
50
  },
47
51
  '&.is-pressed': {
48
52
  backgroundColor: 'gray-200',
49
- color: 'text.primary'
53
+ color: 'gray-700'
50
54
  },
51
55
  '&.is-selected': {
52
56
  bg: 'lightblue',
@@ -55,7 +59,7 @@ export var navBar = {
55
59
  }
56
60
  },
57
61
  subtitle: {
58
- color: 'text.primary'
62
+ color: 'gray-700'
59
63
  },
60
64
  headerText: {
61
65
  color: 'text.primary',
@@ -79,13 +83,13 @@ export var navBar = {
79
83
  item: {
80
84
  px: '1rem',
81
85
  py: '.75rem',
82
- color: 'text.primary',
86
+ color: 'gray-700',
83
87
  borderRadius: '4px',
84
88
  '&.is-hovered': {
85
89
  backgroundColor: 'light'
86
90
  },
87
91
  '> div > svg': {
88
- fill: 'text.primary'
92
+ fill: 'gray-700'
89
93
  },
90
94
  '&.is-pressed': {
91
95
  backgroundColor: 'gray-200'
@@ -112,10 +116,10 @@ export var navBar = {
112
116
  '&.is-selected': _objectSpread({}, navBarSelected),
113
117
  backgroundColor: 'transparent',
114
118
  '> svg': {
115
- fill: 'text.primary'
119
+ fill: 'gray-700'
116
120
  },
117
121
  '> div > svg': {
118
- fill: 'text.primary'
122
+ fill: 'gray-700'
119
123
  }
120
124
  },
121
125
  navBarItemBody: {
@@ -38,6 +38,7 @@ import message from '../../components/Messages/Message.styles';
38
38
  import modal from '../../components/Modal/Modal.styles';
39
39
  import navBar from '../../components/NavBar/NavBar.styles';
40
40
  import overlayPanel from '../../components/OverlayPanel/OverlayPanel.styles';
41
+ import pagination from '../../components/Pagination/Pagination.styles';
41
42
  import panelHeader from '../../components/PanelHeader/PanelHeader.styles';
42
43
  import popoverMenu from '../../components/PopoverMenu/PopoverMenu.styles';
43
44
  import progressBar from '../../components/ProgressBar/ProgressBar.styles';
@@ -85,8 +86,9 @@ export default _objectSpread({
85
86
  modal: modal,
86
87
  navBar: navBar,
87
88
  overlayPanel: overlayPanel,
88
- popoverMenu: popoverMenu,
89
+ pagination: pagination,
89
90
  panelHeader: panelHeader,
91
+ popoverMenu: popoverMenu,
90
92
  progressBar: progressBar,
91
93
  rockerButton: rockerButton,
92
94
  scrollBox: scrollBox,
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,8 @@
1
1
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
2
- import nextGenConvertedComponents, { componentSpecificNextGenBlacklist, nextGenOnlyComponents } from '../../styles/themes/next-gen/convertedComponentList';
2
+ import nextGenConvertedComponents, { astroBlacklistStory, componentSpecificNextGenBlacklist, nextGenOnlyComponents } from '../../styles/themes/next-gen/convertedComponentList';
3
3
  import { themes } from './constants/themes';
4
4
  export var shouldReturnComingSoon = function shouldReturnComingSoon(context, selectedTheme) {
5
- var _context;
5
+ var _context, _context2;
6
6
  var story = context.name;
7
7
  var component = context.title.split('/')[1];
8
8
  var isNextGenOnlyComponent = _includesInstanceProperty(nextGenOnlyComponents).call(nextGenOnlyComponents, component) || context.title.split('/')[0] === 'Onyx Recipes';
@@ -11,8 +11,14 @@ export var shouldReturnComingSoon = function shouldReturnComingSoon(context, sel
11
11
  return false;
12
12
  }
13
13
 
14
+ // if a story made for NextGen theme only, and the selected theme is Astro,
15
+ // return the coming soon message
16
+ if (astroBlacklistStory[component] && _includesInstanceProperty(_context = astroBlacklistStory[component]).call(_context, story) && selectedTheme === themes.ASTRO) {
17
+ return true;
18
+ }
19
+
14
20
  // if a specific story has not been converted, return the coming soon message
15
- if (componentSpecificNextGenBlacklist[component] && _includesInstanceProperty(_context = componentSpecificNextGenBlacklist[component]).call(_context, story) && (selectedTheme === themes.NEXT_GEN || selectedTheme === themes.NEXT_GEN_DARK)) {
21
+ if (componentSpecificNextGenBlacklist[component] && _includesInstanceProperty(_context2 = componentSpecificNextGenBlacklist[component]).call(_context2, story) && (selectedTheme === themes.NEXT_GEN || selectedTheme === themes.NEXT_GEN_DARK)) {
16
22
  return true;
17
23
  }
18
24
  // if the component has NOT been converted, and the active theme is NextGen
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.119.0-alpha.1",
3
+ "version": "2.119.0-alpha.3",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- declare const _default: {
3
- title: string;
4
- };
5
- export default _default;
6
- export declare const Default: () => React.JSX.Element;
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = exports.Default = void 0;
9
- var _react = _interopRequireDefault(require("react"));
10
- var _NavBarNextGenComponent = require("../../styles/themes/next-gen/stories/NavBarNextGenComponent");
11
- var _react2 = require("@emotion/react");
12
- var _default = {
13
- title: 'Onyx Recipes/NavBar'
14
- };
15
- exports["default"] = _default;
16
- var Default = function Default() {
17
- return (0, _react2.jsx)(_NavBarNextGenComponent.NavBarNextGenComponent, null);
18
- };
19
- exports.Default = Default;
@@ -1,191 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.NavBarNextGenComponent = void 0;
9
- var _react = _interopRequireDefault(require("react"));
10
- var _AccountCheckOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/AccountCheckOutlineIcon"));
11
- var _AccountMultipleOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/AccountMultipleOutlineIcon"));
12
- var _AppsIcon = _interopRequireDefault(require("@pingux/mdi-react/AppsIcon"));
13
- var _CheckCircleOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/CheckCircleOutlineIcon"));
14
- var _CodeTagsIcon = _interopRequireDefault(require("@pingux/mdi-react/CodeTagsIcon"));
15
- var _CogOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/CogOutlineIcon"));
16
- var _FileTreeIcon = _interopRequireDefault(require("@pingux/mdi-react/FileTreeIcon"));
17
- var _LayersOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/LayersOutlineIcon"));
18
- var _PaletteOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/PaletteOutlineIcon"));
19
- var _ShieldCheckOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/ShieldCheckOutlineIcon"));
20
- var _ShowChartIcon = _interopRequireDefault(require("@pingux/mdi-react/ShowChartIcon"));
21
- var _ViewDashboardOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/ViewDashboardOutlineIcon"));
22
- var _WidgetsOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/WidgetsOutlineIcon"));
23
- var _useGetTheme2 = _interopRequireDefault(require("../../../../hooks/useGetTheme"));
24
- var _index = require("../../../../index");
25
- var _react2 = require("@emotion/react");
26
- var data = [{
27
- 'data-id': 'dashboard-data-id',
28
- heading: 'Monitoring',
29
- icon: _ShowChartIcon["default"],
30
- key: 'Monitoring',
31
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
32
- key: "Dashboards",
33
- id: "Dashboards"
34
- }, "Dashboards"), (0, _react2.jsx)(_index.NavBarItemButton, {
35
- key: "Audit",
36
- id: "Audit"
37
- }, "Audits")]
38
- }, {
39
- 'data-id': 'Directory-data-id',
40
- heading: 'Directory',
41
- icon: _AccountMultipleOutlineIcon["default"],
42
- key: 'Directory',
43
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
44
- key: "Users",
45
- id: "Users"
46
- }, "Users"), (0, _react2.jsx)(_index.NavBarItemButton, {
47
- key: "Group",
48
- id: "Group"
49
- }, "Groups")]
50
- }, {
51
- 'data-id': 'Applications-data-id',
52
- heading: 'Applications',
53
- icon: _AppsIcon["default"],
54
- key: 'Applications',
55
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
56
- key: "Applications-sub",
57
- id: "Applications-sub"
58
- }, "Applications"), (0, _react2.jsx)(_index.NavBarItemButton, {
59
- key: "Resources",
60
- id: "Resources"
61
- }, "Resourcess")]
62
- }];
63
- var secondData = [{
64
- 'data-id': 'Authentication-data-id',
65
- heading: 'Authentication',
66
- icon: _CheckCircleOutlineIcon["default"],
67
- key: 'Authentication',
68
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
69
- key: "Authentication-Policies",
70
- id: "Authentication-Policies"
71
- }, "Authentication Policies"), (0, _react2.jsx)(_index.NavBarItemButton, {
72
- key: "Password-Policies",
73
- id: "Password-Policies"
74
- }, "Password Policies")]
75
- }, {
76
- 'data-id': 'Threat Protection-data-id',
77
- heading: 'Threat Protection',
78
- icon: _ShieldCheckOutlineIcon["default"],
79
- key: 'Threat Protection',
80
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
81
- key: "Risk Policies",
82
- id: "Risk Policies"
83
- }, "Risk Policies"), (0, _react2.jsx)(_index.NavBarItemButton, {
84
- key: "Predictors",
85
- id: "Predictors"
86
- }, "Predictors")]
87
- }, {
88
- 'data-id': 'Threat Protection-data-id',
89
- heading: 'Identity Verification',
90
- icon: _LayersOutlineIcon["default"],
91
- key: 'Identity Verification',
92
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
93
- key: "Verify Policies",
94
- id: "Verify Policies"
95
- }, "Verify Policies")]
96
- }, {
97
- 'data-id': 'Digital Credentials-data-id',
98
- heading: 'Digital Credentials',
99
- icon: _CodeTagsIcon["default"],
100
- key: 'Digital Credentials',
101
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
102
- key: "Management",
103
- id: "Management"
104
- }, "Management")]
105
- }, {
106
- 'data-id': 'Authorization-data-id',
107
- heading: 'Authorization',
108
- icon: _AccountCheckOutlineIcon["default"],
109
- key: 'Authorization',
110
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
111
- key: "Trust Framework",
112
- id: "Trust Framework"
113
- }, "Trust Framework"), (0, _react2.jsx)(_index.NavBarItemButton, {
114
- key: "Policies",
115
- id: "Policies"
116
- }, "Policies")]
117
- }];
118
- var thirdData = [{
119
- 'data-id': 'Integrations-data-id',
120
- heading: 'Integrations',
121
- icon: _WidgetsOutlineIcon["default"],
122
- key: 'Integrations',
123
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
124
- key: "External IDPs",
125
- id: "External IDPs"
126
- }, "External IDPs"), (0, _react2.jsx)(_index.NavBarItemButton, {
127
- key: "Provisioning",
128
- id: "Provisioning"
129
- }, "Provisioning")]
130
- }, {
131
- 'data-id': 'User Experience-data-id',
132
- heading: 'User Experience',
133
- icon: _PaletteOutlineIcon["default"],
134
- key: 'User Experience',
135
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
136
- key: "Notification Templates",
137
- id: "Notification Templates"
138
- }, "Notification Templates"), (0, _react2.jsx)(_index.NavBarItemButton, {
139
- key: "Notification Policies",
140
- id: "Notification Policies"
141
- }, "Notification Policies")]
142
- }, {
143
- 'data-id': 'Settings-data-id',
144
- heading: 'Settings',
145
- icon: _CogOutlineIcon["default"],
146
- key: 'Settings',
147
- children: [(0, _react2.jsx)(_index.NavBarItemButton, {
148
- key: "Certificates & Key Pairs",
149
- id: "Certificates & Key Pairs"
150
- }, "Certificates & Key Pairs"), (0, _react2.jsx)(_index.NavBarItemButton, {
151
- key: "Domains",
152
- id: "Domains"
153
- }, "Domains")]
154
- }];
155
- var NavBarNextGenComponent = function NavBarNextGenComponent() {
156
- var _useGetTheme = (0, _useGetTheme2["default"])(),
157
- icons = _useGetTheme.icons;
158
- return (0, _react2.jsx)(_index.NavBar, null, (0, _react2.jsx)(_index.Box, {
159
- padding: "md",
160
- key: "top-logo-parent"
161
- }, icons.pingLogoHorizontalSmall), (0, _react2.jsx)(_index.Box, {
162
- paddingBottom: "xl",
163
- key: "first-section-container"
164
- }, (0, _react2.jsx)(_index.NavBarItem, {
165
- "data-id": "nav-bar-item",
166
- icon: _ViewDashboardOutlineIcon["default"],
167
- id: "Overview",
168
- key: "Overview",
169
- text: "Overview"
170
- }), (0, _react2.jsx)(_index.NavBarSection, {
171
- items: data,
172
- "data-id": "nav-bar-section"
173
- }), (0, _react2.jsx)(_index.Separator, {
174
- variant: "separator.navBarSeparator"
175
- }), (0, _react2.jsx)(_index.NavBarItem, {
176
- "data-id": "nav-bar-item",
177
- icon: _FileTreeIcon["default"],
178
- id: "DaVinci",
179
- key: "DaVinci",
180
- text: "DaVinci"
181
- }), (0, _react2.jsx)(_index.NavBarSection, {
182
- items: secondData,
183
- "data-id": "second-nav-bar-section"
184
- }), (0, _react2.jsx)(_index.Separator, {
185
- variant: "separator.navBarSeparator"
186
- }), (0, _react2.jsx)(_index.NavBarSection, {
187
- items: thirdData,
188
- "data-id": "third-nav-bar-section"
189
- })));
190
- };
191
- exports.NavBarNextGenComponent = NavBarNextGenComponent;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { NavBarNextGenComponent } from '../../styles/themes/next-gen/stories/NavBarNextGenComponent';
3
- import { jsx as ___EmotionJSX } from "@emotion/react";
4
- export default {
5
- title: 'Onyx Recipes/NavBar'
6
- };
7
- export var Default = function Default() {
8
- return ___EmotionJSX(NavBarNextGenComponent, null);
9
- };