diff --git a/build-tools/tasks/package-json.js b/build-tools/tasks/package-json.js index 22340db17f..a0d076df35 100644 --- a/build-tools/tasks/package-json.js +++ b/build-tools/tasks/package-json.js @@ -24,6 +24,8 @@ function getComponentsExports() { // Plugin api './internal/plugins': './internal/plugins/index.js', './internal/plugins/widget': './internal/plugins/widget.js', + // Public plugin api + './plugins': './plugins/index.js', // Public internal components './internal/tooltip-do-not-use': './internal/tooltip-do-not-use/index.js', './internal/do-not-use/chart-filter': './internal/do-not-use/chart-filter.js', @@ -32,6 +34,7 @@ function getComponentsExports() { './internal/do-not-use/i18n': './internal/do-not-use/i18n.js', './internal/do-not-use/tooltip': './internal/do-not-use/tooltip.js', './internal/do-not-use/drag-handle': './internal/do-not-use/drag-handle.js', + './internal/do-not-use/feature-prompt': './internal/do-not-use/feature-prompt/index.js', './internal/widget-exports': './internal/widget-exports.js', './test-utils/dom/internal/drag-handle': './test-utils/dom/internal/drag-handle.js', './test-utils/selectors/internal/drag-handle': './test-utils/selectors/internal/drag-handle.js', diff --git a/build-tools/utils/files.js b/build-tools/utils/files.js index 4ed5d018ed..5ce4c9f9a6 100644 --- a/build-tools/utils/files.js +++ b/build-tools/utils/files.js @@ -22,6 +22,7 @@ function listPublicItems(baseDir) { elem !== 'test-utils' && elem !== 'i18n' && elem !== 'theming' && + elem !== 'plugins' && elem !== 'contexts' ); } diff --git a/package-lock.json b/package-lock.json index d663110273..66823ea2d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "@cloudscape-design/components", "version": "3.0.0", + "hasInstallScript": true, "dependencies": { "@cloudscape-design/collection-hooks": "^1.0.0", "@cloudscape-design/component-toolkit": "^1.0.0-beta", diff --git a/package.json b/package.json index e3890a05dd..5e0c145c9f 100644 --- a/package.json +++ b/package.json @@ -177,7 +177,7 @@ { "path": "lib/components/internal/widget-exports.js", "brotli": false, - "limit": "1150 kB", + "limit": "1250 kB", "ignore": "react-dom" } ], diff --git a/pages/feature-notifications/feature-prompt.page.tsx b/pages/feature-notifications/feature-prompt.page.tsx index e2601d1704..2c6d04562d 100644 --- a/pages/feature-notifications/feature-prompt.page.tsx +++ b/pages/feature-notifications/feature-prompt.page.tsx @@ -1,18 +1,200 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useRef } from 'react'; +import React, { useContext, useEffect, useRef } from 'react'; -import { AppLayout, Box, Button, Header, Icon, Link, SpaceBetween } from '~components'; +import { + AppLayoutProps, + AppLayoutToolbar, + Badge, + Box, + Button, + Container, + Header, + Icon, + Link, + SpaceBetween, + Toggle, +} from '~components'; +import { I18nProvider } from '~components/i18n'; +import messages from '~components/i18n/messages/all.all'; import FeaturePrompt, { FeaturePromptProps } from '~components/internal/do-not-use/feature-prompt'; +import awsuiPlugins from '~components/internal/plugins'; +import { + clearFeatureNotifications, + FeatureNotificationsPersistenceConfig, + registerFeatureNotifications, + showFeaturePromptIfPossible, +} from '~components/internal/plugins/widget'; import { mount, unmount } from '~mount'; +import AppContext, { AppContextType } from '../app/app-context'; import { Breadcrumbs, Containers, Navigation, Tools } from '../app-layout/utils/content-blocks'; import labels from '../app-layout/utils/labels'; import * as toolsContent from '../app-layout/utils/tools-content'; import ScreenshotArea from '../utils/screenshot-area'; +awsuiPlugins.appLayout.registerDrawer({ + id: 'security', + + ariaLabels: { + closeButton: 'Security close button', + content: 'Security drawer content', + triggerButton: 'Security trigger button', + resizeHandle: 'Security resize handle', + }, + + trigger: { + iconSvg: ``, + }, + + onToggle: event => { + console.log('security drawer on toggle', event.detail); + awsuiPlugins.appLayout.updateDrawer({ id: 'security', defaultActive: event.detail.isOpen }); + }, + + resizable: true, + defaultSize: 320, + + onResize: event => { + awsuiPlugins.appLayout.updateDrawer({ id: 'security', defaultSize: event.detail.size }); + }, + + mountContent: container => { + mount(