@aws-amplify/ui-react 6.0.7 → 6.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.
@@ -0,0 +1,9 @@
1
+ import React__default from 'react';
2
+
3
+ const FilterChildren = ({ allowedFilters, children = null, targetFilter, }) => {
4
+ const showContent = Array.isArray(allowedFilters) &&
5
+ allowedFilters.some((filter) => filter === targetFilter);
6
+ return showContent ? React__default.createElement(React__default.Fragment, null, children) : null;
7
+ };
8
+
9
+ export { FilterChildren };
@@ -2,6 +2,7 @@ export { useAuth } from './hooks/useAuth.mjs';
2
2
  export { useStorageURL } from './hooks/useStorageURL.mjs';
3
3
  export { useThemeBreakpoint } from './hooks/useThemeBreakpoint.mjs';
4
4
  export { useColorMode } from './hooks/useTheme.mjs';
5
+ export { FilterChildren } from './components/FilterChildren/FilterChildren.mjs';
5
6
  export { AlertIcon } from './primitives/Alert/AlertIcon.mjs';
6
7
  export { IconAdd } from './primitives/Icon/icons/IconAdd.mjs';
7
8
  export { IconCheckCircleOutline } from './primitives/Icon/icons/IconCheckCircleOutline.mjs';
@@ -1,3 +1,3 @@
1
- const VERSION = '6.0.7';
1
+ const VERSION = '6.1.0';
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -2383,7 +2383,7 @@ const defaultDeleteUserDisplayText = {
2383
2383
  warningText: 'Deleting your account is not reversible. You will lose access to your account and all data associated with it.',
2384
2384
  };
2385
2385
 
2386
- const VERSION = '6.0.7';
2386
+ const VERSION = '6.1.0';
2387
2387
 
2388
2388
  const logger$2 = ui.getLogger('AccountSettings');
2389
2389
  const getIsDisabled = (formValues, validationError) => {
package/dist/internal.js CHANGED
@@ -10,6 +10,8 @@ var uiReactCore = require('@aws-amplify/ui-react-core');
10
10
  require('@aws-amplify/core');
11
11
  require('aws-amplify/auth');
12
12
 
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
13
15
  function _interopNamespace(e) {
14
16
  if (e && e.__esModule) return e;
15
17
  var n = Object.create(null);
@@ -29,6 +31,7 @@ function _interopNamespace(e) {
29
31
  }
30
32
 
31
33
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
34
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
32
35
  var Storage__namespace = /*#__PURE__*/_interopNamespace(Storage);
33
36
 
34
37
  const useStorageURL = ({ key, options, fallbackURL, onStorageGetError, }) => {
@@ -80,6 +83,12 @@ const useThemeBreakpoint = () => {
80
83
  return breakpoint;
81
84
  };
82
85
 
86
+ const FilterChildren = ({ allowedFilters, children = null, targetFilter, }) => {
87
+ const showContent = Array.isArray(allowedFilters) &&
88
+ allowedFilters.some((filter) => filter === targetFilter);
89
+ return showContent ? React__default["default"].createElement(React__default["default"].Fragment, null, children) : null;
90
+ };
91
+
83
92
  /**
84
93
  * @internal For internal Amplify UI use only. May be removed in a future release.
85
94
  */
@@ -16395,6 +16404,7 @@ exports.useAuth = Field.useAuth;
16395
16404
  exports.useColorMode = Field.useColorMode;
16396
16405
  exports.useDropZone = Field.useDropZone;
16397
16406
  exports.useIcons = Field.useIcons;
16407
+ exports.FilterChildren = FilterChildren;
16398
16408
  exports.IconCheckCircleOutline = IconCheckCircleOutline;
16399
16409
  exports.IconEdit = IconEdit;
16400
16410
  exports.IconFile = IconFile;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface FilterChildrenProps {
3
+ children?: React.ReactNode;
4
+ /**
5
+ * string values to match against `targetFilter` against
6
+ */
7
+ allowedFilters?: string[];
8
+ targetFilter?: string;
9
+ }
10
+ export declare const FilterChildren: ({ allowedFilters, children, targetFilter, }: FilterChildrenProps) => JSX.Element | null;
@@ -0,0 +1 @@
1
+ export { FilterChildren, FilterChildrenProps } from './FilterChildren';
@@ -2,6 +2,7 @@ export * from './hooks/useAuth';
2
2
  export * from './hooks/useStorageURL';
3
3
  export * from './hooks/useThemeBreakpoint';
4
4
  export { useColorMode } from './hooks/useTheme';
5
+ export * from './components/FilterChildren';
5
6
  export { AlertIcon } from './primitives/Alert/AlertIcon';
6
7
  export * from './primitives/Icon/internal';
7
8
  export { useDropZone } from './primitives/DropZone/useDropZone';
@@ -1 +1 @@
1
- export declare const VERSION = "6.0.7";
1
+ export declare const VERSION = "6.1.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react",
3
- "version": "6.0.7",
3
+ "version": "6.1.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {