@cloudscape-design/components-themeable 3.0.1167 → 3.0.1168
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.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/app-layout/styles.scss +1 -0
- package/lib/internal/scss/error-boundary/styles.scss +11 -0
- package/lib/internal/scss/error-boundary/test-classes/styles.scss +13 -0
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/panel-layout/styles.scss +63 -0
- package/lib/internal/scss/panel-layout/test-classes/styles.scss +11 -0
- package/lib/internal/template/app-layout/utils/use-pointer-events.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-pointer-events.js +1 -1
- package/lib/internal/template/app-layout/utils/use-pointer-events.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/drawers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/drawers.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh/drawers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/main.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/main.js +3 -1
- package/lib/internal/template/app-layout/visual-refresh/main.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js +2 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/lib/internal/template/container/internal.d.ts +6 -1
- package/lib/internal/template/container/internal.d.ts.map +1 -1
- package/lib/internal/template/container/internal.js +32 -28
- package/lib/internal/template/container/internal.js.map +1 -1
- package/lib/internal/template/drawer/implementation.d.ts.map +1 -1
- package/lib/internal/template/drawer/implementation.js +5 -3
- package/lib/internal/template/drawer/implementation.js.map +1 -1
- package/lib/internal/template/error-boundary/fallback.d.ts +3 -0
- package/lib/internal/template/error-boundary/fallback.d.ts.map +1 -0
- package/lib/internal/template/error-boundary/fallback.js +61 -0
- package/lib/internal/template/error-boundary/fallback.js.map +1 -0
- package/lib/internal/template/error-boundary/index.d.ts +5 -0
- package/lib/internal/template/error-boundary/index.d.ts.map +1 -0
- package/lib/internal/template/error-boundary/index.js +22 -0
- package/lib/internal/template/error-boundary/index.js.map +1 -0
- package/lib/internal/template/error-boundary/interfaces.d.ts +85 -0
- package/lib/internal/template/error-boundary/interfaces.d.ts.map +1 -0
- package/lib/internal/template/error-boundary/interfaces.js +4 -0
- package/lib/internal/template/error-boundary/interfaces.js.map +1 -0
- package/lib/internal/template/error-boundary/internal.d.ts +23 -0
- package/lib/internal/template/error-boundary/internal.d.ts.map +1 -0
- package/lib/internal/template/error-boundary/internal.js +58 -0
- package/lib/internal/template/error-boundary/internal.js.map +1 -0
- package/lib/internal/template/error-boundary/styles.css.js +9 -0
- package/lib/internal/template/error-boundary/styles.scoped.css +10 -0
- package/lib/internal/template/error-boundary/styles.selectors.js +10 -0
- package/lib/internal/template/error-boundary/test-classes/styles.css.js +11 -0
- package/lib/internal/template/error-boundary/test-classes/styles.scoped.css +12 -0
- package/lib/internal/template/error-boundary/test-classes/styles.selectors.js +12 -0
- package/lib/internal/template/error-boundary/utils.d.ts +2 -0
- package/lib/internal/template/error-boundary/utils.d.ts.map +1 -0
- package/lib/internal/template/error-boundary/utils.js +7 -0
- package/lib/internal/template/error-boundary/utils.js.map +1 -0
- package/lib/internal/template/form/internal.d.ts.map +1 -1
- package/lib/internal/template/form/internal.js +20 -14
- package/lib/internal/template/form/internal.js.map +1 -1
- package/lib/internal/template/i18n/messages/all.all.js +1 -1
- package/lib/internal/template/i18n/messages/all.all.json +1 -1
- package/lib/internal/template/i18n/messages/all.ar.js +1 -1
- package/lib/internal/template/i18n/messages/all.ar.json +1 -1
- package/lib/internal/template/i18n/messages/all.de.js +1 -1
- package/lib/internal/template/i18n/messages/all.de.json +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
- package/lib/internal/template/i18n/messages/all.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.json +1 -1
- package/lib/internal/template/i18n/messages/all.es.js +1 -1
- package/lib/internal/template/i18n/messages/all.es.json +1 -1
- package/lib/internal/template/i18n/messages/all.fr.js +1 -1
- package/lib/internal/template/i18n/messages/all.fr.json +1 -1
- package/lib/internal/template/i18n/messages/all.id.js +1 -1
- package/lib/internal/template/i18n/messages/all.id.json +1 -1
- package/lib/internal/template/i18n/messages/all.it.js +1 -1
- package/lib/internal/template/i18n/messages/all.it.json +1 -1
- package/lib/internal/template/i18n/messages/all.ja.js +1 -1
- package/lib/internal/template/i18n/messages/all.ja.json +1 -1
- package/lib/internal/template/i18n/messages/all.ko.js +1 -1
- package/lib/internal/template/i18n/messages/all.ko.json +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
- package/lib/internal/template/i18n/messages/all.tr.js +1 -1
- package/lib/internal/template/i18n/messages/all.tr.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
- package/lib/internal/template/i18n/messages-types.d.ts +9 -4
- package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages-types.js.map +1 -1
- package/lib/internal/template/icon/generated/icons.d.ts +3 -0
- package/lib/internal/template/icon/generated/icons.d.ts.map +1 -1
- package/lib/internal/template/icon/generated/icons.js +9 -0
- package/lib/internal/template/icon/generated/icons.js.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts +3 -0
- package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
- package/lib/internal/template/index.d.ts +2 -0
- package/lib/internal/template/index.d.ts.map +1 -1
- package/lib/internal/template/index.js +2 -0
- package/lib/internal/template/index.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.js +3 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/modal/internal.d.ts.map +1 -1
- package/lib/internal/template/modal/internal.js +8 -5
- package/lib/internal/template/modal/internal.js.map +1 -1
- package/lib/internal/template/package.json +2 -0
- package/lib/internal/template/panel-layout/index.d.ts +6 -0
- package/lib/internal/template/panel-layout/index.d.ts.map +1 -0
- package/lib/internal/template/panel-layout/index.js +25 -0
- package/lib/internal/template/panel-layout/index.js.map +1 -0
- package/lib/internal/template/panel-layout/interfaces.d.ts +100 -0
- package/lib/internal/template/panel-layout/interfaces.d.ts.map +1 -0
- package/lib/internal/template/panel-layout/interfaces.js +2 -0
- package/lib/internal/template/panel-layout/interfaces.js.map +1 -0
- package/lib/internal/template/panel-layout/internal.d.ts +10 -0
- package/lib/internal/template/panel-layout/internal.d.ts.map +1 -0
- package/lib/internal/template/panel-layout/internal.js +65 -0
- package/lib/internal/template/panel-layout/internal.js.map +1 -0
- package/lib/internal/template/panel-layout/styles.css.js +12 -0
- package/lib/internal/template/panel-layout/styles.scoped.css +263 -0
- package/lib/internal/template/panel-layout/styles.selectors.js +13 -0
- package/lib/internal/template/panel-layout/test-classes/styles.css.js +9 -0
- package/lib/internal/template/panel-layout/test-classes/styles.scoped.css +10 -0
- package/lib/internal/template/panel-layout/test-classes/styles.selectors.js +10 -0
- package/lib/internal/template/popover/body.d.ts.map +1 -1
- package/lib/internal/template/popover/body.js +10 -8
- package/lib/internal/template/popover/body.js.map +1 -1
- package/lib/internal/template/split-panel/implementation.d.ts.map +1 -1
- package/lib/internal/template/split-panel/implementation.js +5 -2
- package/lib/internal/template/split-panel/implementation.js.map +1 -1
- package/lib/internal/template/tabs/index.d.ts.map +1 -1
- package/lib/internal/template/tabs/index.js +1 -1
- package/lib/internal/template/tabs/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/error-boundary/index.d.ts +9 -0
- package/lib/internal/template/test-utils/dom/error-boundary/index.js +26 -0
- package/lib/internal/template/test-utils/dom/error-boundary/index.js.map +1 -0
- package/lib/internal/template/test-utils/dom/index.d.ts +40 -0
- package/lib/internal/template/test-utils/dom/index.js +30 -2
- package/lib/internal/template/test-utils/dom/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/panel-layout/index.d.ts +17 -0
- package/lib/internal/template/test-utils/dom/panel-layout/index.js +30 -0
- package/lib/internal/template/test-utils/dom/panel-layout/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/error-boundary/index.d.ts +9 -0
- package/lib/internal/template/test-utils/selectors/error-boundary/index.js +26 -0
- package/lib/internal/template/test-utils/selectors/error-boundary/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/index.d.ts +36 -0
- package/lib/internal/template/test-utils/selectors/index.js +30 -2
- package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/panel-layout/index.d.ts +17 -0
- package/lib/internal/template/test-utils/selectors/panel-layout/index.js +30 -0
- package/lib/internal/template/test-utils/selectors/panel-layout/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAc,MAAM,SAAS,CAAC;AACvD,OAAO,EAA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AAiB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,KAAK,EAAc,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAmB,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAiB,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAe,MAAM,UAAU,CAAC;AAC1D,cAAc,cAAc,CAAC","sourcesContent":["export { default as Alert, AlertProps } from './alert';\nexport { default as AnchorNavigation, AnchorNavigationProps } from './anchor-navigation';\nexport { default as AnnotationContext, AnnotationContextProps } from './annotation-context';\nexport { default as AppLayout, AppLayoutProps } from './app-layout';\nexport { default as AppLayoutToolbar, AppLayoutToolbarProps } from './app-layout-toolbar';\nexport { default as AreaChart, AreaChartProps } from './area-chart';\nexport { default as AttributeEditor, AttributeEditorProps } from './attribute-editor';\nexport { default as Autosuggest, AutosuggestProps } from './autosuggest';\nexport { default as Badge, BadgeProps } from './badge';\nexport { default as BarChart, BarChartProps } from './bar-chart';\nexport { default as Box, BoxProps } from './box';\nexport { default as BreadcrumbGroup, BreadcrumbGroupProps } from './breadcrumb-group';\nexport { default as Button, ButtonProps } from './button';\nexport { default as ButtonDropdown, ButtonDropdownProps } from './button-dropdown';\nexport { default as ButtonGroup, ButtonGroupProps } from './button-group';\nexport { default as Calendar, CalendarProps } from './calendar';\nexport { default as Cards, CardsProps } from './cards';\nexport { default as Checkbox, CheckboxProps } from './checkbox';\nexport { default as CodeEditor, CodeEditorProps } from './code-editor';\nexport { default as CollectionPreferences, CollectionPreferencesProps } from './collection-preferences';\nexport { default as ColumnLayout, ColumnLayoutProps } from './column-layout';\nexport { default as Container, ContainerProps } from './container';\nexport { default as ContentLayout, ContentLayoutProps } from './content-layout';\nexport { default as CopyToClipboard, CopyToClipboardProps } from './copy-to-clipboard';\nexport { default as DateInput, DateInputProps } from './date-input';\nexport { default as DatePicker, DatePickerProps } from './date-picker';\nexport { default as DateRangePicker, DateRangePickerProps } from './date-range-picker';\nexport { default as Drawer, DrawerProps } from './drawer';\nexport { default as ExpandableSection, ExpandableSectionProps } from './expandable-section';\nexport { default as FileDropzone, FileDropzoneProps } from './file-dropzone';\nexport { default as FileInput, FileInputProps } from './file-input';\nexport { default as FileTokenGroup, FileTokenGroupProps } from './file-token-group';\nexport { default as FileUpload, FileUploadProps } from './file-upload';\nexport { default as Flashbar, FlashbarProps } from './flashbar';\nexport { default as Form, FormProps } from './form';\nexport { default as FormField, FormFieldProps } from './form-field';\nexport { default as Grid, GridProps } from './grid';\nexport { default as Header, HeaderProps } from './header';\nexport { default as HelpPanel, HelpPanelProps } from './help-panel';\nexport { default as Hotspot, HotspotProps } from './hotspot';\nexport { default as Icon, IconProps } from './icon';\nexport { default as IconProvider, IconProviderProps } from './icon-provider';\nexport { default as Input, InputProps } from './input';\nexport { default as KeyValuePairs, KeyValuePairsProps } from './key-value-pairs';\nexport { default as LineChart, LineChartProps } from './line-chart';\nexport { default as Link, LinkProps } from './link';\nexport { default as List, ListProps } from './list';\nexport { default as LiveRegion, LiveRegionProps } from './live-region';\nexport { default as MixedLineBarChart, MixedLineBarChartProps } from './mixed-line-bar-chart';\nexport { default as Modal, ModalProps } from './modal';\nexport { default as Multiselect, MultiselectProps } from './multiselect';\nexport { default as NavigableGroup, NavigableGroupProps } from './navigable-group';\nexport { default as Pagination, PaginationProps } from './pagination';\nexport { default as PieChart, PieChartProps } from './pie-chart';\nexport { default as Popover, PopoverProps } from './popover';\nexport { default as ProgressBar, ProgressBarProps } from './progress-bar';\nexport { default as PromptInput, PromptInputProps } from './prompt-input';\nexport { default as PropertyFilter, PropertyFilterProps } from './property-filter';\nexport { default as RadioButton, RadioButtonProps } from './radio-button';\nexport { default as RadioGroup, RadioGroupProps } from './radio-group';\nexport { default as S3ResourceSelector, S3ResourceSelectorProps } from './s3-resource-selector';\nexport { default as SegmentedControl, SegmentedControlProps } from './segmented-control';\nexport { default as Select, SelectProps } from './select';\nexport { default as SideNavigation, SideNavigationProps } from './side-navigation';\nexport { default as Slider, SliderProps } from './slider';\nexport { default as SpaceBetween, SpaceBetweenProps } from './space-between';\nexport { default as Spinner, SpinnerProps } from './spinner';\nexport { default as SplitPanel, SplitPanelProps } from './split-panel';\nexport { default as StatusIndicator, StatusIndicatorProps } from './status-indicator';\nexport { default as Steps, StepsProps } from './steps';\nexport { default as Table, TableProps } from './table';\nexport { default as Tabs, TabsProps } from './tabs';\nexport { default as TagEditor, TagEditorProps } from './tag-editor';\nexport { default as TextContent, TextContentProps } from './text-content';\nexport { default as TextFilter, TextFilterProps } from './text-filter';\nexport { default as Textarea, TextareaProps } from './textarea';\nexport { default as Tiles, TilesProps } from './tiles';\nexport { default as TimeInput, TimeInputProps } from './time-input';\nexport { default as Toggle, ToggleProps } from './toggle';\nexport { default as ToggleButton, ToggleButtonProps } from './toggle-button';\nexport { default as Token, TokenProps } from './token';\nexport { default as TokenGroup, TokenGroupProps } from './token-group';\nexport { default as TopNavigation, TopNavigationProps } from './top-navigation';\nexport { default as TreeView, TreeViewProps } from './tree-view';\nexport { default as TutorialPanel, TutorialPanelProps } from './tutorial-panel';\nexport { default as Wizard, WizardProps } from './wizard';\nexport * from './interfaces';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAc,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAyB,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAA0B,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,OAAO,IAAI,SAAS,EAAkB,MAAM,cAAc,CAAC;AACpE,OAAO,E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AS,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAmB,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAiB,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAe,MAAM,UAAU,CAAC;AAC1D,cAAc,cAAc,CAAC","sourcesContent":["export { default as Alert, AlertProps } from './alert';\nexport { default as AnchorNavigation, AnchorNavigationProps } from './anchor-navigation';\nexport { default as AnnotationContext, AnnotationContextProps } from './annotation-context';\nexport { default as AppLayout, AppLayoutProps } from './app-layout';\nexport { default as AppLayoutToolbar, AppLayoutToolbarProps } from './app-layout-toolbar';\nexport { default as AreaChart, AreaChartProps } from './area-chart';\nexport { default as AttributeEditor, AttributeEditorProps } from './attribute-editor';\nexport { default as Autosuggest, AutosuggestProps } from './autosuggest';\nexport { default as Badge, BadgeProps } from './badge';\nexport { default as BarChart, BarChartProps } from './bar-chart';\nexport { default as Box, BoxProps } from './box';\nexport { default as BreadcrumbGroup, BreadcrumbGroupProps } from './breadcrumb-group';\nexport { default as Button, ButtonProps } from './button';\nexport { default as ButtonDropdown, ButtonDropdownProps } from './button-dropdown';\nexport { default as ButtonGroup, ButtonGroupProps } from './button-group';\nexport { default as Calendar, CalendarProps } from './calendar';\nexport { default as Cards, CardsProps } from './cards';\nexport { default as Checkbox, CheckboxProps } from './checkbox';\nexport { default as CodeEditor, CodeEditorProps } from './code-editor';\nexport { default as CollectionPreferences, CollectionPreferencesProps } from './collection-preferences';\nexport { default as ColumnLayout, ColumnLayoutProps } from './column-layout';\nexport { default as Container, ContainerProps } from './container';\nexport { default as ContentLayout, ContentLayoutProps } from './content-layout';\nexport { default as CopyToClipboard, CopyToClipboardProps } from './copy-to-clipboard';\nexport { default as DateInput, DateInputProps } from './date-input';\nexport { default as DatePicker, DatePickerProps } from './date-picker';\nexport { default as DateRangePicker, DateRangePickerProps } from './date-range-picker';\nexport { default as Drawer, DrawerProps } from './drawer';\nexport { default as ErrorBoundary, ErrorBoundaryProps } from './error-boundary';\nexport { default as ExpandableSection, ExpandableSectionProps } from './expandable-section';\nexport { default as FileDropzone, FileDropzoneProps } from './file-dropzone';\nexport { default as FileInput, FileInputProps } from './file-input';\nexport { default as FileTokenGroup, FileTokenGroupProps } from './file-token-group';\nexport { default as FileUpload, FileUploadProps } from './file-upload';\nexport { default as Flashbar, FlashbarProps } from './flashbar';\nexport { default as Form, FormProps } from './form';\nexport { default as FormField, FormFieldProps } from './form-field';\nexport { default as Grid, GridProps } from './grid';\nexport { default as Header, HeaderProps } from './header';\nexport { default as HelpPanel, HelpPanelProps } from './help-panel';\nexport { default as Hotspot, HotspotProps } from './hotspot';\nexport { default as Icon, IconProps } from './icon';\nexport { default as IconProvider, IconProviderProps } from './icon-provider';\nexport { default as Input, InputProps } from './input';\nexport { default as KeyValuePairs, KeyValuePairsProps } from './key-value-pairs';\nexport { default as LineChart, LineChartProps } from './line-chart';\nexport { default as Link, LinkProps } from './link';\nexport { default as List, ListProps } from './list';\nexport { default as LiveRegion, LiveRegionProps } from './live-region';\nexport { default as MixedLineBarChart, MixedLineBarChartProps } from './mixed-line-bar-chart';\nexport { default as Modal, ModalProps } from './modal';\nexport { default as Multiselect, MultiselectProps } from './multiselect';\nexport { default as NavigableGroup, NavigableGroupProps } from './navigable-group';\nexport { default as Pagination, PaginationProps } from './pagination';\nexport { default as PanelLayout, PanelLayoutProps } from './panel-layout';\nexport { default as PieChart, PieChartProps } from './pie-chart';\nexport { default as Popover, PopoverProps } from './popover';\nexport { default as ProgressBar, ProgressBarProps } from './progress-bar';\nexport { default as PromptInput, PromptInputProps } from './prompt-input';\nexport { default as PropertyFilter, PropertyFilterProps } from './property-filter';\nexport { default as RadioButton, RadioButtonProps } from './radio-button';\nexport { default as RadioGroup, RadioGroupProps } from './radio-group';\nexport { default as S3ResourceSelector, S3ResourceSelectorProps } from './s3-resource-selector';\nexport { default as SegmentedControl, SegmentedControlProps } from './segmented-control';\nexport { default as Select, SelectProps } from './select';\nexport { default as SideNavigation, SideNavigationProps } from './side-navigation';\nexport { default as Slider, SliderProps } from './slider';\nexport { default as SpaceBetween, SpaceBetweenProps } from './space-between';\nexport { default as Spinner, SpinnerProps } from './spinner';\nexport { default as SplitPanel, SplitPanelProps } from './split-panel';\nexport { default as StatusIndicator, StatusIndicatorProps } from './status-indicator';\nexport { default as Steps, StepsProps } from './steps';\nexport { default as Table, TableProps } from './table';\nexport { default as Tabs, TabsProps } from './tabs';\nexport { default as TagEditor, TagEditorProps } from './tag-editor';\nexport { default as TextContent, TextContentProps } from './text-content';\nexport { default as TextFilter, TextFilterProps } from './text-filter';\nexport { default as Textarea, TextareaProps } from './textarea';\nexport { default as Tiles, TilesProps } from './tiles';\nexport { default as TimeInput, TimeInputProps } from './time-input';\nexport { default as Toggle, ToggleProps } from './toggle';\nexport { default as ToggleButton, ToggleButtonProps } from './toggle-button';\nexport { default as Token, TokenProps } from './token';\nexport { default as TokenGroup, TokenGroupProps } from './token-group';\nexport { default as TopNavigation, TopNavigationProps } from './top-navigation';\nexport { default as TreeView, TreeViewProps } from './tree-view';\nexport { default as TutorialPanel, TutorialPanelProps } from './tutorial-panel';\nexport { default as Wizard, WizardProps } from './wizard';\nexport * from './interfaces';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAA2B,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIrE,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,EAAE,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC;IACtD,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;;AAED,wBAuCG"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
+
import { useInternalI18n } from '../../do-not-use/i18n';
|
|
5
6
|
import InternalDragHandle from '../drag-handle';
|
|
6
7
|
import styles from './styles.css.js';
|
|
7
8
|
export default React.forwardRef(function PanelResizeHandle({ className, ariaLabel, tooltipText, ariaValuenow, position, onDirectionClick, onKeyDown, onPointerDown, disabled }, ref) {
|
|
8
|
-
|
|
9
|
+
const i18n = useInternalI18n('panel-resize-handle');
|
|
10
|
+
return (React.createElement(InternalDragHandle, { className: clsx(className, styles.slider, styles[`slider-${position}`]), ariaLabel: i18n('i18nStrings.resizeHandleAriaLabel', ariaLabel), tooltipText: i18n('i18nStrings.resizeHandleTooltipText', tooltipText), ariaValue: { valueMin: 0, valueMax: 100, valueNow: ariaValuenow !== null && ariaValuenow !== void 0 ? ariaValuenow : 0 }, variant: ['side', 'side-start'].includes(position) ? 'resize-horizontal' : 'resize-vertical', directions: disabled
|
|
9
11
|
? {
|
|
10
12
|
'inline-start': 'disabled',
|
|
11
13
|
'inline-end': 'disabled',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,kBAAuC,MAAM,gBAAgB,CAAC;AAErE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,eAAe,KAAK,CAAC,UAAU,CAAoC,SAAS,iBAAiB,CAC3F,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,EACnH,GAAG;IAEH,OAAO,CACL,oBAAC,kBAAkB,IACjB,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,QAAQ,EAAE,CAAC,CAAC,EACvE,SAAS,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,kBAAuC,MAAM,gBAAgB,CAAC;AAErE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,eAAe,KAAK,CAAC,UAAU,CAAoC,SAAS,iBAAiB,CAC3F,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,EACnH,GAAG;IAEH,M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C,CAAC,CAAC,QAAQ;wBACvD,aAAa,EAAE,YAAY,KAAK,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ;qBAC5D,EAEX,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useInternalI18n } from '../../do-not-use/i18n';\nimport InternalDragHandle, { DragHandleProps } from '../drag-handle';\n\nimport styles from './styles.css.js';\n\ninterface ResizeHandleProps {\n className?: string;\n ariaLabel: string | undefined;\n tooltipText?: string | undefined;\n position: 'side-start' | 'side' | 'bottom';\n ariaValuenow: number;\n onDirectionClick: DragHandleProps['onDirectionClick'];\n onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;\n onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;\n disabled?: boolean;\n}\n\nexport default React.forwardRef<HTMLDivElement, ResizeHandleProps>(function PanelResizeHandle(\n { className, ariaLabel, tooltipText, ariaValuenow, position, onDirectionClick, onKeyDown, onPointerDown, disabled },\n ref\n) {\n const i18n = useInternalI18n('panel-resize-handle');\n return (\n <InternalDragHandle\n className={clsx(className, styles.slider, styles[`slider-${position}`])}\n ariaLabel={i18n('i18nStrings.resizeHandleAriaLabel', ariaLabel)}\n tooltipText={i18n('i18nStrings.resizeHandleTooltipText', tooltipText)}\n ariaValue={{ valueMin: 0, valueMax: 100, valueNow: ariaValuenow ?? 0 }}\n variant={['side', 'side-start'].includes(position) ? 'resize-horizontal' : 'resize-vertical'}\n directions={\n disabled\n ? {\n 'inline-start': 'disabled',\n 'inline-end': 'disabled',\n }\n : position === 'side'\n ? {\n 'inline-end': ariaValuenow === 0 ? 'disabled' : 'active',\n 'inline-start': ariaValuenow === 100 ? 'disabled' : 'active',\n }\n : position === 'side-start'\n ? {\n 'inline-end': ariaValuenow === 100 ? 'disabled' : 'active',\n 'inline-start': ariaValuenow === 0 ? 'disabled' : 'active',\n }\n : {\n 'block-end': ariaValuenow === 0 ? 'disabled' : 'active',\n 'block-start': ariaValuenow === 100 ? 'disabled' : 'active',\n }\n }\n onDirectionClick={onDirectionClick}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n ref={ref}\n />\n );\n});\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (37a490cb)";
|
|
3
|
+
export var GIT_SHA = "37a490cb";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "core";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/modal/internal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/modal/internal.tsx"],"names":[],"mappings":"AAeA,OAAO,EAEL,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,WAAW,EAA8C,MAAM,wCAAwC,CAAC;AAGjH,OAAO,EAAiB,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAKvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,eAqB9D;AAED,KAAK,kBAAkB,GAAG,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,GACxD,0BAA0B,GAAG;IAC3B,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,iBAAiB,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;IAC9D,YAAY,CAAC,EAAE,yBAAyB,CAAC,YAAY,CAAC,CAAC;IACvD,oBAAoB,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,CAAC;IACvE,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,aAAa,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEJ,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,eAM9G"}
|
|
@@ -5,7 +5,9 @@ import clsx from 'clsx';
|
|
|
5
5
|
import { useContainerQuery } from '@cloudscape-design/component-toolkit';
|
|
6
6
|
import { Portal, useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';
|
|
7
7
|
import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
|
|
8
|
+
import InternalBox from '../box/internal';
|
|
8
9
|
import { InternalButton } from '../button/internal';
|
|
10
|
+
import { BuiltInErrorBoundary } from '../error-boundary/internal';
|
|
9
11
|
import InternalHeader from '../header/internal';
|
|
10
12
|
import { useInternalI18n } from '../i18n/context';
|
|
11
13
|
import { PerformanceMetrics } from '../internal/analytics';
|
|
@@ -159,10 +161,11 @@ function PortaledModal({ size, visible, header, children, footer, disableContent
|
|
|
159
161
|
}) },
|
|
160
162
|
React.createElement(InternalButton, { ariaLabel: closeAriaLabel, className: styles['dismiss-control'], variant: "modal-dismiss", iconName: "close", formAction: "none", onClick: onCloseButtonClick })) },
|
|
161
163
|
React.createElement("span", { ref: headerRef, id: headerId, className: styles['header--text'] }, header))),
|
|
162
|
-
React.createElement(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
React.createElement(
|
|
164
|
+
React.createElement(BuiltInErrorBoundary, { wrapper: content => React.createElement(InternalBox, { padding: { bottom: 'm', horizontal: 'l' } }, content) },
|
|
165
|
+
React.createElement("div", { ref: __subStepRef, ...__subStepFunnelProps, className: clsx(styles.content, { [styles['no-paddings']]: disableContentPaddings }) },
|
|
166
|
+
children,
|
|
167
|
+
React.createElement("div", { ref: stickySentinelRef })),
|
|
168
|
+
footer && (React.createElement(ButtonContext.Provider, { value: { onClick: onButtonClick } },
|
|
169
|
+
React.createElement("div", { ref: footerRef, className: clsx(styles.footer, footerStuck && styles['footer--stuck']) }, footer))))))))))));
|
|
167
170
|
}
|
|
168
171
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/modal/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,yBAAyB,GAG1B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAe,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAw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,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,sBAAsB,EAAE,CAAC;oCAEnF,QAAQ;oCACT,6BAAK,GAAG,EAAE,iBAAiB,GAAI,CAC3B;gCACL,MAAM,IAAI,CACT,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;oCACvD,6BAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC,IACxF,MAAM,CACH,CACiB,CAC1B,CACG,CACF,CACI,CACR,CACgB,CACF,CACW,CACtC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { Portal, useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalButton } from '../button/internal';\nimport InternalHeader from '../header/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { PerformanceMetrics } from '../internal/analytics';\nimport {\n FunnelNameSelectorContext,\n FunnelStepContextValue,\n FunnelSubStepContextValue,\n} from '../internal/analytics/context/analytics-context';\nimport { FunnelProps, useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getBaseProps } from '../internal/base-component';\nimport FocusLock from '../internal/components/focus-lock';\nimport { ButtonContext, ButtonContextProps } from '../internal/context/button-context';\nimport { ModalContext } from '../internal/context/modal-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useIntersectionObserver } from '../internal/hooks/use-intersection-observer';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { KeyCode } from '../internal/keycode';\nimport { SomeRequired } from '../internal/types';\nimport {\n GeneratedAnalyticsMetadataModalComponent,\n GeneratedAnalyticsMetadataModalDismiss,\n} from './analytics-metadata/interfaces';\nimport { disableBodyScrolling, enableBodyScrolling } from './body-scroll';\nimport { ModalProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport function InternalModalAsFunnel(props: InternalModalProps) {\n const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel();\n const { funnelStepProps } = useFunnelStep();\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const onButtonClick: ButtonContextProps['onClick'] = ({ variant }) => {\n if (variant === 'primary') {\n funnelNextOrSubmitAttempt();\n funnelSubmit();\n }\n };\n\n return (\n <InternalModal\n __funnelProps={funnelProps}\n __funnelStepProps={funnelStepProps}\n __subStepRef={subStepRef}\n __subStepFunnelProps={funnelSubStepProps}\n onButtonClick={onButtonClick}\n {...props}\n />\n );\n}\n\ntype InternalModalProps = SomeRequired<ModalProps, 'size'> &\n InternalBaseComponentProps & {\n __funnelProps?: FunnelProps;\n __funnelStepProps?: FunnelStepContextValue['funnelStepProps'];\n __subStepRef?: FunnelSubStepContextValue['subStepRef'];\n __subStepFunnelProps?: FunnelSubStepContextValue['funnelSubStepProps'];\n __injectAnalyticsComponentMetadata?: boolean;\n onButtonClick?: ButtonContextProps['onClick'];\n referrerId?: string;\n };\n\nexport default function InternalModal({ modalRoot, getModalRoot, removeModalRoot, ...rest }: InternalModalProps) {\n return (\n <Portal container={modalRoot} getContainer={getModalRoot} removeContainer={removeModalRoot}>\n <PortaledModal {...rest} />\n </Portal>\n );\n}\n\ntype PortaledModalProps = Omit<InternalModalProps, 'modalRoot' | 'getModalRoot' | 'removeModalRoot'>;\n\n// Separate component to prevent the Portal from getting in the way of refs, as it needs extra cycles to render the inner components.\n// useContainerQuery needs its targeted element to exist on the first render in order to work properly.\nfunction PortaledModal({\n size,\n visible,\n header,\n children,\n footer,\n disableContentPaddings,\n onButtonClick = () => {},\n onDismiss,\n __internalRootRef,\n __injectAnalyticsComponentMetadata,\n __funnelProps,\n __funnelStepProps,\n __subStepRef,\n __subStepFunnelProps,\n referrerId,\n ...rest\n}: PortaledModalProps) {\n const instanceUniqueId = useUniqueId();\n const headerId = `${rest.id || instanceUniqueId}-header`;\n const lastMouseDownElementRef = useRef<HTMLElement | null>(null);\n const [breakpoint, breakpointsRef] = useContainerBreakpoints(['xs']);\n\n const i18n = useInternalI18n('modal');\n const closeAriaLabel = i18n('closeAriaLabel', rest.closeAriaLabel);\n\n const refObject = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(breakpointsRef, refObject, __internalRootRef);\n\n const isRefresh = useVisualRefresh();\n\n const baseProps = getBaseProps(rest);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataModalComponent = {\n name: 'awsui.Modal',\n label: `.${analyticsSelectors.header} h2`,\n };\n const metadataAttribute = __injectAnalyticsComponentMetadata\n ? getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })\n : {};\n const loadStartTime = useRef<number>(0);\n const loadCompleteTime = useRef<number>(0);\n const componentLoadingCount = useRef<number>(0);\n const performanceMetricLogged = useRef<boolean>(false);\n\n // enable body scroll and restore focus if unmounting while visible\n useEffect(() => {\n return () => {\n enableBodyScrolling();\n };\n }, []);\n\n const resetModalPerformanceData = () => {\n loadStartTime.current = performance.now();\n loadCompleteTime.current = 0;\n performanceMetricLogged.current = false;\n };\n\n const emitTimeToContentReadyInModal = (loadCompleteTime: number) => {\n if (\n componentLoadingCount.current === 0 &&\n loadStartTime.current &&\n loadStartTime.current !== 0 &&\n !performanceMetricLogged.current\n ) {\n const timeToContentReadyInModal = loadCompleteTime - loadStartTime.current;\n PerformanceMetrics.modalPerformanceData({\n timeToContentReadyInModal,\n instanceIdentifier: instanceUniqueId,\n componentIdentifier: headerRef.current?.textContent || '',\n });\n performanceMetricLogged.current = true;\n }\n };\n\n const MODAL_READY_TIMEOUT = 100;\n /**\n * This useEffect is triggered when the visible attribute of modal changes.\n * When modal becomes visible, modal performance metrics are reset marking the beginning loading process.\n * To ensure that the modal component ready metric is always emitted, a setTimeout is implemented.\n * This setTimeout automatically emits the component ready metric after a specified duration.\n */\n useEffect(() => {\n if (visible) {\n disableBodyScrolling();\n resetModalPerformanceData();\n setTimeout(() => {\n emitTimeToContentReadyInModal(loadStartTime.current);\n }, MODAL_READY_TIMEOUT);\n } else {\n enableBodyScrolling();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [visible]);\n\n // Because we hide the element with styles (and not actually detach it from DOM), we need to scroll to top\n useEffect(() => {\n if (visible && refObject.current) {\n refObject.current.scrollTop = 0;\n }\n }, [visible]);\n\n const dismiss = (reason: string) => fireNonCancelableEvent(onDismiss, { reason });\n\n const onOverlayMouseDown = (event: React.MouseEvent) => {\n lastMouseDownElementRef.current = event.target as HTMLElement;\n };\n const onOverlayClick = (event: React.MouseEvent) => {\n const overlay = refObject.current;\n const lastClicked = lastMouseDownElementRef.current;\n\n if (event.target === overlay && lastClicked === overlay) {\n dismiss('overlay');\n }\n };\n const onCloseButtonClick = () => dismiss('closeButton');\n const escKeyHandler = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n dismiss('keyboard');\n }\n };\n\n // We use an empty div element at the end of the content slot as a sentinel\n // to detect when the user has scrolled to the bottom.\n const { ref: stickySentinelRef, isIntersecting: footerStuck } = useIntersectionObserver();\n\n // Add extra scroll padding to account for the height of the sticky footer,\n // to prevent it from covering focused elements.\n const [footerHeight, footerRef] = useContainerQuery(rect => rect.borderBoxHeight);\n const headerRef = useRef<HTMLDivElement>(null);\n const { subStepRef } = useFunnelSubStep();\n\n return (\n <FunnelNameSelectorContext.Provider value={`.${styles['header--text']}`}>\n <ResetContextsForModal>\n <ModalContext.Provider\n value={{\n isInModal: true,\n componentLoadingCount,\n emitTimeToContentReadyInModal,\n }}\n >\n <div\n {...baseProps}\n {...__funnelProps}\n {...__funnelStepProps}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible },\n baseProps.className,\n isRefresh && styles.refresh\n )}\n role=\"dialog\"\n aria-labelledby={headerId}\n onMouseDown={onOverlayMouseDown}\n onClick={onOverlayClick}\n ref={mergedRef}\n style={footerHeight ? { scrollPaddingBottom: footerHeight } : undefined}\n data-awsui-referrer-id={subStepRef.current?.id || referrerId}\n >\n <FocusLock disabled={!visible} autoFocus={true} restoreFocus={true} className={styles['focus-lock']}>\n <div\n className={clsx(\n styles.dialog,\n styles[size],\n styles[`breakpoint-${breakpoint}`],\n isRefresh && styles.refresh\n )}\n onKeyDown={escKeyHandler}\n {...metadataAttribute}\n >\n <div className={styles.container}>\n <div className={clsx(styles.header, analyticsSelectors.header)}>\n <InternalHeader\n variant=\"h2\"\n __disableActionsWrapping={true}\n actions={\n <div\n {...getAnalyticsMetadataAttribute({\n action: 'dismiss',\n } as Partial<GeneratedAnalyticsMetadataModalDismiss>)}\n >\n <InternalButton\n ariaLabel={closeAriaLabel}\n className={styles['dismiss-control']}\n variant=\"modal-dismiss\"\n iconName=\"close\"\n formAction=\"none\"\n onClick={onCloseButtonClick}\n />\n </div>\n }\n >\n <span ref={headerRef} id={headerId} className={styles['header--text']}>\n {header}\n </span>\n </InternalHeader>\n </div>\n <div\n ref={__subStepRef}\n {...__subStepFunnelProps}\n className={clsx(styles.content, { [styles['no-paddings']]: disableContentPaddings })}\n >\n {children}\n <div ref={stickySentinelRef} />\n </div>\n {footer && (\n <ButtonContext.Provider value={{ onClick: onButtonClick }}>\n <div ref={footerRef} className={clsx(styles.footer, footerStuck && styles['footer--stuck'])}>\n {footer}\n </div>\n </ButtonContext.Provider>\n )}\n </div>\n </div>\n </FocusLock>\n </div>\n </ModalContext.Provider>\n </ResetContextsForModal>\n </FunnelNameSelectorContext.Provider>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/modal/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,yBAAyB,GAG1B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAe,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAsB,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,qBAAqB,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,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AAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;wCACvD,6BAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC,IACxF,MAAM,CACH,CACiB,CAC1B,CACoB,CACnB,CACF,CACI,CACR,CACgB,CACF,CACW,CACtC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { Portal, useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalBox from '../box/internal';\nimport { InternalButton } from '../button/internal';\nimport { BuiltInErrorBoundary } from '../error-boundary/internal';\nimport InternalHeader from '../header/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { PerformanceMetrics } from '../internal/analytics';\nimport {\n FunnelNameSelectorContext,\n FunnelStepContextValue,\n FunnelSubStepContextValue,\n} from '../internal/analytics/context/analytics-context';\nimport { FunnelProps, useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getBaseProps } from '../internal/base-component';\nimport FocusLock from '../internal/components/focus-lock';\nimport { ButtonContext, ButtonContextProps } from '../internal/context/button-context';\nimport { ModalContext } from '../internal/context/modal-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useIntersectionObserver } from '../internal/hooks/use-intersection-observer';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { KeyCode } from '../internal/keycode';\nimport { SomeRequired } from '../internal/types';\nimport {\n GeneratedAnalyticsMetadataModalComponent,\n GeneratedAnalyticsMetadataModalDismiss,\n} from './analytics-metadata/interfaces';\nimport { disableBodyScrolling, enableBodyScrolling } from './body-scroll';\nimport { ModalProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport function InternalModalAsFunnel(props: InternalModalProps) {\n const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel();\n const { funnelStepProps } = useFunnelStep();\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const onButtonClick: ButtonContextProps['onClick'] = ({ variant }) => {\n if (variant === 'primary') {\n funnelNextOrSubmitAttempt();\n funnelSubmit();\n }\n };\n\n return (\n <InternalModal\n __funnelProps={funnelProps}\n __funnelStepProps={funnelStepProps}\n __subStepRef={subStepRef}\n __subStepFunnelProps={funnelSubStepProps}\n onButtonClick={onButtonClick}\n {...props}\n />\n );\n}\n\ntype InternalModalProps = SomeRequired<ModalProps, 'size'> &\n InternalBaseComponentProps & {\n __funnelProps?: FunnelProps;\n __funnelStepProps?: FunnelStepContextValue['funnelStepProps'];\n __subStepRef?: FunnelSubStepContextValue['subStepRef'];\n __subStepFunnelProps?: FunnelSubStepContextValue['funnelSubStepProps'];\n __injectAnalyticsComponentMetadata?: boolean;\n onButtonClick?: ButtonContextProps['onClick'];\n referrerId?: string;\n };\n\nexport default function InternalModal({ modalRoot, getModalRoot, removeModalRoot, ...rest }: InternalModalProps) {\n return (\n <Portal container={modalRoot} getContainer={getModalRoot} removeContainer={removeModalRoot}>\n <PortaledModal {...rest} />\n </Portal>\n );\n}\n\ntype PortaledModalProps = Omit<InternalModalProps, 'modalRoot' | 'getModalRoot' | 'removeModalRoot'>;\n\n// Separate component to prevent the Portal from getting in the way of refs, as it needs extra cycles to render the inner components.\n// useContainerQuery needs its targeted element to exist on the first render in order to work properly.\nfunction PortaledModal({\n size,\n visible,\n header,\n children,\n footer,\n disableContentPaddings,\n onButtonClick = () => {},\n onDismiss,\n __internalRootRef,\n __injectAnalyticsComponentMetadata,\n __funnelProps,\n __funnelStepProps,\n __subStepRef,\n __subStepFunnelProps,\n referrerId,\n ...rest\n}: PortaledModalProps) {\n const instanceUniqueId = useUniqueId();\n const headerId = `${rest.id || instanceUniqueId}-header`;\n const lastMouseDownElementRef = useRef<HTMLElement | null>(null);\n const [breakpoint, breakpointsRef] = useContainerBreakpoints(['xs']);\n\n const i18n = useInternalI18n('modal');\n const closeAriaLabel = i18n('closeAriaLabel', rest.closeAriaLabel);\n\n const refObject = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(breakpointsRef, refObject, __internalRootRef);\n\n const isRefresh = useVisualRefresh();\n\n const baseProps = getBaseProps(rest);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataModalComponent = {\n name: 'awsui.Modal',\n label: `.${analyticsSelectors.header} h2`,\n };\n const metadataAttribute = __injectAnalyticsComponentMetadata\n ? getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })\n : {};\n const loadStartTime = useRef<number>(0);\n const loadCompleteTime = useRef<number>(0);\n const componentLoadingCount = useRef<number>(0);\n const performanceMetricLogged = useRef<boolean>(false);\n\n // enable body scroll and restore focus if unmounting while visible\n useEffect(() => {\n return () => {\n enableBodyScrolling();\n };\n }, []);\n\n const resetModalPerformanceData = () => {\n loadStartTime.current = performance.now();\n loadCompleteTime.current = 0;\n performanceMetricLogged.current = false;\n };\n\n const emitTimeToContentReadyInModal = (loadCompleteTime: number) => {\n if (\n componentLoadingCount.current === 0 &&\n loadStartTime.current &&\n loadStartTime.current !== 0 &&\n !performanceMetricLogged.current\n ) {\n const timeToContentReadyInModal = loadCompleteTime - loadStartTime.current;\n PerformanceMetrics.modalPerformanceData({\n timeToContentReadyInModal,\n instanceIdentifier: instanceUniqueId,\n componentIdentifier: headerRef.current?.textContent || '',\n });\n performanceMetricLogged.current = true;\n }\n };\n\n const MODAL_READY_TIMEOUT = 100;\n /**\n * This useEffect is triggered when the visible attribute of modal changes.\n * When modal becomes visible, modal performance metrics are reset marking the beginning loading process.\n * To ensure that the modal component ready metric is always emitted, a setTimeout is implemented.\n * This setTimeout automatically emits the component ready metric after a specified duration.\n */\n useEffect(() => {\n if (visible) {\n disableBodyScrolling();\n resetModalPerformanceData();\n setTimeout(() => {\n emitTimeToContentReadyInModal(loadStartTime.current);\n }, MODAL_READY_TIMEOUT);\n } else {\n enableBodyScrolling();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [visible]);\n\n // Because we hide the element with styles (and not actually detach it from DOM), we need to scroll to top\n useEffect(() => {\n if (visible && refObject.current) {\n refObject.current.scrollTop = 0;\n }\n }, [visible]);\n\n const dismiss = (reason: string) => fireNonCancelableEvent(onDismiss, { reason });\n\n const onOverlayMouseDown = (event: React.MouseEvent) => {\n lastMouseDownElementRef.current = event.target as HTMLElement;\n };\n const onOverlayClick = (event: React.MouseEvent) => {\n const overlay = refObject.current;\n const lastClicked = lastMouseDownElementRef.current;\n\n if (event.target === overlay && lastClicked === overlay) {\n dismiss('overlay');\n }\n };\n const onCloseButtonClick = () => dismiss('closeButton');\n const escKeyHandler = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n dismiss('keyboard');\n }\n };\n\n // We use an empty div element at the end of the content slot as a sentinel\n // to detect when the user has scrolled to the bottom.\n const { ref: stickySentinelRef, isIntersecting: footerStuck } = useIntersectionObserver();\n\n // Add extra scroll padding to account for the height of the sticky footer,\n // to prevent it from covering focused elements.\n const [footerHeight, footerRef] = useContainerQuery(rect => rect.borderBoxHeight);\n const headerRef = useRef<HTMLDivElement>(null);\n const { subStepRef } = useFunnelSubStep();\n\n return (\n <FunnelNameSelectorContext.Provider value={`.${styles['header--text']}`}>\n <ResetContextsForModal>\n <ModalContext.Provider\n value={{\n isInModal: true,\n componentLoadingCount,\n emitTimeToContentReadyInModal,\n }}\n >\n <div\n {...baseProps}\n {...__funnelProps}\n {...__funnelStepProps}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible },\n baseProps.className,\n isRefresh && styles.refresh\n )}\n role=\"dialog\"\n aria-labelledby={headerId}\n onMouseDown={onOverlayMouseDown}\n onClick={onOverlayClick}\n ref={mergedRef}\n style={footerHeight ? { scrollPaddingBottom: footerHeight } : undefined}\n data-awsui-referrer-id={subStepRef.current?.id || referrerId}\n >\n <FocusLock disabled={!visible} autoFocus={true} restoreFocus={true} className={styles['focus-lock']}>\n <div\n className={clsx(\n styles.dialog,\n styles[size],\n styles[`breakpoint-${breakpoint}`],\n isRefresh && styles.refresh\n )}\n onKeyDown={escKeyHandler}\n {...metadataAttribute}\n >\n <div className={styles.container}>\n <div className={clsx(styles.header, analyticsSelectors.header)}>\n <InternalHeader\n variant=\"h2\"\n __disableActionsWrapping={true}\n actions={\n <div\n {...getAnalyticsMetadataAttribute({\n action: 'dismiss',\n } as Partial<GeneratedAnalyticsMetadataModalDismiss>)}\n >\n <InternalButton\n ariaLabel={closeAriaLabel}\n className={styles['dismiss-control']}\n variant=\"modal-dismiss\"\n iconName=\"close\"\n formAction=\"none\"\n onClick={onCloseButtonClick}\n />\n </div>\n }\n >\n <span ref={headerRef} id={headerId} className={styles['header--text']}>\n {header}\n </span>\n </InternalHeader>\n </div>\n <BuiltInErrorBoundary\n wrapper={content => <InternalBox padding={{ bottom: 'm', horizontal: 'l' }}>{content}</InternalBox>}\n >\n <div\n ref={__subStepRef}\n {...__subStepFunnelProps}\n className={clsx(styles.content, { [styles['no-paddings']]: disableContentPaddings })}\n >\n {children}\n <div ref={stickySentinelRef} />\n </div>\n {footer && (\n <ButtonContext.Provider value={{ onClick: onButtonClick }}>\n <div ref={footerRef} className={clsx(styles.footer, footerStuck && styles['footer--stuck'])}>\n {footer}\n </div>\n </ButtonContext.Provider>\n )}\n </BuiltInErrorBoundary>\n </div>\n </div>\n </FocusLock>\n </div>\n </ModalContext.Provider>\n </ResetContextsForModal>\n </FunnelNameSelectorContext.Provider>\n );\n}\n"]}
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"./date-picker": "./date-picker/index.js",
|
|
59
59
|
"./date-range-picker": "./date-range-picker/index.js",
|
|
60
60
|
"./drawer": "./drawer/index.js",
|
|
61
|
+
"./error-boundary": "./error-boundary/index.js",
|
|
61
62
|
"./expandable-section": "./expandable-section/index.js",
|
|
62
63
|
"./file-dropzone": "./file-dropzone/index.js",
|
|
63
64
|
"./file-input": "./file-input/index.js",
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
"./multiselect": "./multiselect/index.js",
|
|
84
85
|
"./navigable-group": "./navigable-group/index.js",
|
|
85
86
|
"./pagination": "./pagination/index.js",
|
|
87
|
+
"./panel-layout": "./panel-layout/index.js",
|
|
86
88
|
"./pie-chart": "./pie-chart/index.js",
|
|
87
89
|
"./popover": "./popover/index.js",
|
|
88
90
|
"./progress-bar": "./progress-bar/index.js",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PanelLayoutProps } from './interfaces';
|
|
3
|
+
export { PanelLayoutProps };
|
|
4
|
+
declare const PanelLayout: React.ForwardRefExoticComponent<PanelLayoutProps & React.RefAttributes<PanelLayoutProps.Ref>>;
|
|
5
|
+
export default PanelLayout;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panel-layout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FAyBf,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
'use client';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
6
|
+
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
7
|
+
import { getExternalProps } from '../internal/utils/external-props';
|
|
8
|
+
import InternalPanelLayout from './internal';
|
|
9
|
+
const PanelLayout = React.forwardRef(function PanelLayout({ panelPosition = 'side-start', resizable = false, display = 'all', ...props }, ref) {
|
|
10
|
+
const baseComponentProps = useBaseComponent('PanelLayout', {
|
|
11
|
+
props: { panelPosition, resizable },
|
|
12
|
+
metadata: {
|
|
13
|
+
mainFocusable: props.mainFocusable !== undefined,
|
|
14
|
+
panelFocusable: props.panelFocusable !== undefined,
|
|
15
|
+
hasDefaultPanelSize: props.defaultPanelSize !== undefined,
|
|
16
|
+
hasPanelSize: props.panelSize !== undefined,
|
|
17
|
+
hasMinPanelSize: props.minPanelSize !== undefined,
|
|
18
|
+
hasMaxPanelSize: props.maxPanelSize !== undefined,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
return (React.createElement(InternalPanelLayout, { ref: ref, panelPosition: panelPosition, resizable: resizable, display: display, ...getExternalProps(props), ...baseComponentProps }));
|
|
22
|
+
});
|
|
23
|
+
export default PanelLayout;
|
|
24
|
+
applyDisplayName(PanelLayout, 'PanelLayout');
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/panel-layout/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,mBAAmB,MAAM,YAAY,CAAC;AAI7C,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAyC,SAAS,WAAW,CAC/F,EAAE,aAAa,GAAG,YAAY,EAAE,SAAS,GAAG,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAC9E,GAAG;IAEH,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,aAAa,EAAE;QACzD,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE;QACnC,QAAQ,EAAE;YACR,aAAa,EAAE,KAAK,CAAC,aAAa,KAAK,SAAS;YAChD,cAAc,EAAE,KAAK,CAAC,cAAc,KAAK,SAAS;YAClD,mBAAmB,EAAE,KAAK,CAAC,gBAAgB,KAAK,SAAS;YACzD,YAAY,EAAE,KAAK,CAAC,SAAS,KAAK,SAAS;YAC3C,eAAe,EAAE,KAAK,CAAC,YAAY,KAAK,SAAS;YACjD,eAAe,EAAE,KAAK,CAAC,YAAY,KAAK,SAAS;SAClD;KACF,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,mBAAmB,IAClB,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,KACZ,gBAAgB,CAAC,KAAK,CAAC,KACvB,kBAAkB,GACtB,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC;AAE3B,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { PanelLayoutProps } from './interfaces';\nimport InternalPanelLayout from './internal';\n\nexport { PanelLayoutProps };\n\nconst PanelLayout = React.forwardRef<PanelLayoutProps.Ref, PanelLayoutProps>(function PanelLayout(\n { panelPosition = 'side-start', resizable = false, display = 'all', ...props },\n ref\n) {\n const baseComponentProps = useBaseComponent('PanelLayout', {\n props: { panelPosition, resizable },\n metadata: {\n mainFocusable: props.mainFocusable !== undefined,\n panelFocusable: props.panelFocusable !== undefined,\n hasDefaultPanelSize: props.defaultPanelSize !== undefined,\n hasPanelSize: props.panelSize !== undefined,\n hasMinPanelSize: props.minPanelSize !== undefined,\n hasMaxPanelSize: props.maxPanelSize !== undefined,\n },\n });\n return (\n <InternalPanelLayout\n ref={ref}\n panelPosition={panelPosition}\n resizable={resizable}\n display={display}\n {...getExternalProps(props)}\n {...baseComponentProps}\n />\n );\n});\n\nexport default PanelLayout;\n\napplyDisplayName(PanelLayout, 'PanelLayout');\n"]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../internal/base-component';
|
|
3
|
+
import { NonCancelableEventHandler } from '../internal/events';
|
|
4
|
+
export interface PanelLayoutProps extends BaseComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Position of the panel with respect to the main content
|
|
7
|
+
*/
|
|
8
|
+
panelPosition?: PanelLayoutProps.PanelPosition;
|
|
9
|
+
/**
|
|
10
|
+
* Initial panel size, for uncontrolled behavior.
|
|
11
|
+
*
|
|
12
|
+
* The actual size will be constrained by `minPanelSize` and `maxPanelSize`, if set.
|
|
13
|
+
*/
|
|
14
|
+
defaultPanelSize?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Size of the panel. If provided, and panel is resizable, the component is controlled,
|
|
17
|
+
* so you must also provide `onPanelResize`.
|
|
18
|
+
*
|
|
19
|
+
* The actual size will be constrained by `minPanelSize` and `maxPanelSize`, if set.
|
|
20
|
+
*/
|
|
21
|
+
panelSize?: number;
|
|
22
|
+
/**
|
|
23
|
+
* The minimum size of the panel.
|
|
24
|
+
*/
|
|
25
|
+
minPanelSize?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The maximum size of the panel.
|
|
28
|
+
*/
|
|
29
|
+
maxPanelSize?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Indicates whether the panel is resizable.
|
|
32
|
+
*/
|
|
33
|
+
resizable?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Panel contents.
|
|
36
|
+
*/
|
|
37
|
+
panelContent: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Main content area displayed next to the panel.
|
|
40
|
+
*/
|
|
41
|
+
mainContent: ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Makes the panel content focusable. This should be used if there are no focusable elements
|
|
44
|
+
* inside the panel, to ensure it is keyboard scrollable.
|
|
45
|
+
*
|
|
46
|
+
* Provide either `{ariaLabel: "Panel label"}` or `{ariaLabelledby: "panel-label-id"}`
|
|
47
|
+
*/
|
|
48
|
+
panelFocusable?: PanelLayoutProps.FocusableConfig;
|
|
49
|
+
/**
|
|
50
|
+
* Makes the main content area focusable. This should be used if there are no focusable elements
|
|
51
|
+
* inside the content, to ensure it is keyboard scrollable.
|
|
52
|
+
*
|
|
53
|
+
* Provide either `{ariaLabel: "Main label"}` or `{ariaLabelledby: "main-label-id"}`
|
|
54
|
+
*/
|
|
55
|
+
mainFocusable?: PanelLayoutProps.FocusableConfig;
|
|
56
|
+
/**
|
|
57
|
+
* Determines which content is displayed:
|
|
58
|
+
* - 'all': Both panel and main content are displayed.
|
|
59
|
+
* - 'panel-only': Only panel is displayed.
|
|
60
|
+
* - 'main-only': Only main content is displayed.
|
|
61
|
+
*/
|
|
62
|
+
display?: PanelLayoutProps.Display;
|
|
63
|
+
/**
|
|
64
|
+
* An object containing all the necessary localized strings required by the component.
|
|
65
|
+
* @i18n
|
|
66
|
+
*/
|
|
67
|
+
i18nStrings?: PanelLayoutProps.I18nStrings;
|
|
68
|
+
/**
|
|
69
|
+
* Called when the user resizes the panel.
|
|
70
|
+
*/
|
|
71
|
+
onPanelResize?: NonCancelableEventHandler<PanelLayoutProps.PanelResizeDetail>;
|
|
72
|
+
/**
|
|
73
|
+
* Called when the panel and/or main content size changes. This can be due
|
|
74
|
+
* to user resizing or changes to the available space on the page.
|
|
75
|
+
*/
|
|
76
|
+
onLayoutChange?: NonCancelableEventHandler<PanelLayoutProps.PanelResizeDetail>;
|
|
77
|
+
}
|
|
78
|
+
export declare namespace PanelLayoutProps {
|
|
79
|
+
type PanelPosition = 'side-start' | 'side-end';
|
|
80
|
+
type Display = 'all' | 'panel-only' | 'main-only';
|
|
81
|
+
interface PanelResizeDetail {
|
|
82
|
+
totalSize: number;
|
|
83
|
+
panelSize: number;
|
|
84
|
+
}
|
|
85
|
+
interface FocusableConfig {
|
|
86
|
+
ariaLabel?: string;
|
|
87
|
+
ariaLabelledby?: string;
|
|
88
|
+
}
|
|
89
|
+
interface I18nStrings {
|
|
90
|
+
resizeHandleAriaLabel?: string;
|
|
91
|
+
resizeHandleTooltipText?: string;
|
|
92
|
+
}
|
|
93
|
+
interface Ref {
|
|
94
|
+
/**
|
|
95
|
+
* Focuses the resize handle of the panel layout.
|
|
96
|
+
*/
|
|
97
|
+
focusResizeHandle(): void;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/panel-layout/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC;IAE/C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,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"file":"interfaces.js","sourceRoot":"","sources":["../../../src/panel-layout/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface PanelLayoutProps extends BaseComponentProps {\n /**\n * Position of the panel with respect to the main content\n */\n panelPosition?: PanelLayoutProps.PanelPosition;\n\n /**\n * Initial panel size, for uncontrolled behavior.\n *\n * The actual size will be constrained by `minPanelSize` and `maxPanelSize`, if set.\n */\n defaultPanelSize?: number;\n\n /**\n * Size of the panel. If provided, and panel is resizable, the component is controlled,\n * so you must also provide `onPanelResize`.\n *\n * The actual size will be constrained by `minPanelSize` and `maxPanelSize`, if set.\n */\n panelSize?: number;\n\n /**\n * The minimum size of the panel.\n */\n minPanelSize?: number;\n\n /**\n * The maximum size of the panel.\n */\n maxPanelSize?: number;\n\n /**\n * Indicates whether the panel is resizable.\n */\n resizable?: boolean;\n\n /**\n * Panel contents.\n */\n panelContent: ReactNode;\n\n /**\n * Main content area displayed next to the panel.\n */\n mainContent: ReactNode;\n\n /**\n * Makes the panel content focusable. This should be used if there are no focusable elements\n * inside the panel, to ensure it is keyboard scrollable.\n *\n * Provide either `{ariaLabel: \"Panel label\"}` or `{ariaLabelledby: \"panel-label-id\"}`\n */\n panelFocusable?: PanelLayoutProps.FocusableConfig;\n\n /**\n * Makes the main content area focusable. This should be used if there are no focusable elements\n * inside the content, to ensure it is keyboard scrollable.\n *\n * Provide either `{ariaLabel: \"Main label\"}` or `{ariaLabelledby: \"main-label-id\"}`\n */\n mainFocusable?: PanelLayoutProps.FocusableConfig;\n\n /**\n * Determines which content is displayed:\n * - 'all': Both panel and main content are displayed.\n * - 'panel-only': Only panel is displayed.\n * - 'main-only': Only main content is displayed.\n */\n display?: PanelLayoutProps.Display;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: PanelLayoutProps.I18nStrings;\n\n /**\n * Called when the user resizes the panel.\n */\n onPanelResize?: NonCancelableEventHandler<PanelLayoutProps.PanelResizeDetail>;\n\n /**\n * Called when the panel and/or main content size changes. This can be due\n * to user resizing or changes to the available space on the page.\n */\n onLayoutChange?: NonCancelableEventHandler<PanelLayoutProps.PanelResizeDetail>;\n}\n\nexport namespace PanelLayoutProps {\n export type PanelPosition = 'side-start' | 'side-end';\n export type Display = 'all' | 'panel-only' | 'main-only';\n\n export interface PanelResizeDetail {\n totalSize: number;\n panelSize: number;\n }\n\n export interface FocusableConfig {\n ariaLabel?: string;\n ariaLabelledby?: string;\n }\n\n export interface I18nStrings {\n resizeHandleAriaLabel?: string;\n resizeHandleTooltipText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the resize handle of the panel layout.\n */\n focusResizeHandle(): void;\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
3
|
+
import { PanelLayoutProps } from './interfaces';
|
|
4
|
+
declare const InternalPanelLayout: React.ForwardRefExoticComponent<PanelLayoutProps & {
|
|
5
|
+
display: PanelLayoutProps.Display;
|
|
6
|
+
resizable: boolean;
|
|
7
|
+
panelPosition: PanelLayoutProps.PanelPosition;
|
|
8
|
+
} & InternalBaseComponentProps & React.RefAttributes<PanelLayoutProps.Ref>>;
|
|
9
|
+
export default InternalPanelLayout;
|
|
10
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/panel-layout/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUhD,QAAA,MAAM,mBAAmB;;;;2EAsIxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React, { useEffect } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { useMergeRefs, useStableCallback } from '@cloudscape-design/component-toolkit/internal';
|
|
6
|
+
import { useResize } from '../app-layout/visual-refresh-toolbar/drawer/use-resize';
|
|
7
|
+
import { getBaseProps } from '../internal/base-component';
|
|
8
|
+
import PanelResizeHandle from '../internal/components/panel-resize-handle';
|
|
9
|
+
import { fireNonCancelableEvent } from '../internal/events';
|
|
10
|
+
import { useControllable } from '../internal/hooks/use-controllable';
|
|
11
|
+
import useContainerWidth from '../internal/utils/use-container-width';
|
|
12
|
+
import styles from './styles.css.js';
|
|
13
|
+
import testStyles from './test-classes/styles.css.js';
|
|
14
|
+
const DEFAULT_PANEL_SIZE = 200;
|
|
15
|
+
const InternalPanelLayout = React.forwardRef(({ panelPosition, panelContent, mainContent, defaultPanelSize, panelSize: controlledPanelSize, resizable, onPanelResize, onLayoutChange, minPanelSize, maxPanelSize, i18nStrings, display, panelFocusable, mainFocusable, __internalRootRef, ...props }, ref) => {
|
|
16
|
+
const baseProps = getBaseProps(props);
|
|
17
|
+
const resizeHandleRef = React.useRef(null);
|
|
18
|
+
const panelRef = React.useRef(null);
|
|
19
|
+
const [containerWidth, rootRef] = useContainerWidth();
|
|
20
|
+
React.useImperativeHandle(ref, () => ({
|
|
21
|
+
focusResizeHandle() {
|
|
22
|
+
var _a;
|
|
23
|
+
(_a = resizeHandleRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
24
|
+
},
|
|
25
|
+
}), []);
|
|
26
|
+
const [panelSize = DEFAULT_PANEL_SIZE, setPanelSize] = useControllable(controlledPanelSize, onPanelResize, defaultPanelSize !== null && defaultPanelSize !== void 0 ? defaultPanelSize : minPanelSize, {
|
|
27
|
+
componentName: 'PanelLayout',
|
|
28
|
+
controlledProp: 'panelSize',
|
|
29
|
+
changeHandler: 'onPanelResize',
|
|
30
|
+
});
|
|
31
|
+
const actualMaxSize = Math.min(maxPanelSize !== null && maxPanelSize !== void 0 ? maxPanelSize : containerWidth, containerWidth);
|
|
32
|
+
const actualMinSize = minPanelSize !== null && minPanelSize !== void 0 ? minPanelSize : 0;
|
|
33
|
+
const actualPanelSize = Math.max(Math.min(panelSize, actualMaxSize), actualMinSize);
|
|
34
|
+
const stableLayoutChangeEvent = useStableCallback((details) => fireNonCancelableEvent(onLayoutChange, details));
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
stableLayoutChangeEvent({ totalSize: containerWidth, panelSize: actualPanelSize });
|
|
37
|
+
}, [containerWidth, actualPanelSize, stableLayoutChangeEvent]);
|
|
38
|
+
const resizeHandlePosition = panelPosition === 'side-end' ? 'side' : panelPosition;
|
|
39
|
+
const resizeProps = useResize({
|
|
40
|
+
currentWidth: actualPanelSize,
|
|
41
|
+
minWidth: actualMinSize,
|
|
42
|
+
maxWidth: actualMaxSize,
|
|
43
|
+
panelRef: panelRef,
|
|
44
|
+
handleRef: resizeHandleRef,
|
|
45
|
+
position: resizeHandlePosition,
|
|
46
|
+
onResize: size => {
|
|
47
|
+
setPanelSize(size);
|
|
48
|
+
fireNonCancelableEvent(onPanelResize, { totalSize: containerWidth, panelSize: size });
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
const mergedRef = useMergeRefs(rootRef, __internalRootRef, ref);
|
|
52
|
+
const wrappedPanelContent = (React.createElement("div", { className: clsx(styles['panel-content'], display !== 'main-only' && testStyles.panel), tabIndex: panelFocusable && 0, role: panelFocusable && 'region', "aria-label": panelFocusable === null || panelFocusable === void 0 ? void 0 : panelFocusable.ariaLabel, "aria-labelledby": panelFocusable === null || panelFocusable === void 0 ? void 0 : panelFocusable.ariaLabelledby }, panelContent));
|
|
53
|
+
const wrappedMainContent = (React.createElement("div", { className: clsx(styles.content, display !== 'panel-only' && testStyles.content), tabIndex: mainFocusable && 0, role: mainFocusable && 'region', "aria-label": mainFocusable === null || mainFocusable === void 0 ? void 0 : mainFocusable.ariaLabel, "aria-labelledby": mainFocusable === null || mainFocusable === void 0 ? void 0 : mainFocusable.ariaLabelledby }, mainContent));
|
|
54
|
+
const handle = (React.createElement("div", { className: styles.handle },
|
|
55
|
+
React.createElement(PanelResizeHandle, { ref: resizeHandleRef, className: testStyles['resize-handle'], position: resizeHandlePosition, ariaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.resizeHandleAriaLabel, tooltipText: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.resizeHandleTooltipText, ariaValuenow: resizeProps.relativeSize, onKeyDown: resizeProps.onKeyDown, onDirectionClick: resizeProps.onDirectionClick, onPointerDown: resizeProps.onPointerDown })));
|
|
56
|
+
return (React.createElement("div", { ...baseProps, ref: mergedRef, className: clsx(baseProps.className, styles.root, testStyles.root, styles[`display-${display}`]) },
|
|
57
|
+
panelPosition === 'side-end' && wrappedMainContent,
|
|
58
|
+
React.createElement("div", { className: clsx(styles.panel), ref: panelRef, style: display === 'all' ? { inlineSize: `${actualPanelSize}px` } : undefined },
|
|
59
|
+
panelPosition === 'side-start' && wrappedPanelContent,
|
|
60
|
+
resizable && display === 'all' && handle,
|
|
61
|
+
panelPosition === 'side-end' && wrappedPanelContent),
|
|
62
|
+
panelPosition === 'side-start' && wrappedMainContent));
|
|
63
|
+
});
|
|
64
|
+
export default InternalPanelLayout;
|
|
65
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/panel-layout/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;A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,YAAY,EAAE,WAAW,CAAC,YAAY,EACtC,SAAS,EAAE,WAAW,CAAC,SAAS,EAChC,gBAAgB,EAAE,WAAW,CAAC,gBAAgB,EAC9C,aAAa,EAAE,WAAW,CAAC,aAAa,GACxC,CACE,CACP,CAAC;IAEF,OAAO,CACL,gCACM,SAAS,EACb,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC;QAE/F,aAAa,KAAK,UAAU,IAAI,kBAAkB;QACnD,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7B,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,eAAe,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;YAE5E,aAAa,KAAK,YAAY,IAAI,mBAAmB;YACrD,SAAS,IAAI,OAAO,KAAK,KAAK,IAAI,MAAM;YACxC,aAAa,KAAK,UAAU,IAAI,mBAAmB,CAChD;QACL,aAAa,KAAK,YAAY,IAAI,kBAAkB,CACjD,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useResize } from '../app-layout/visual-refresh-toolbar/drawer/use-resize';\nimport { getBaseProps } from '../internal/base-component';\nimport PanelResizeHandle from '../internal/components/panel-resize-handle';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { SomeRequired } from '../internal/types';\nimport useContainerWidth from '../internal/utils/use-container-width';\nimport { PanelLayoutProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\nconst DEFAULT_PANEL_SIZE = 200;\n\ntype InternalPanelLayoutProps = SomeRequired<PanelLayoutProps, 'panelPosition' | 'resizable' | 'display'> &\n InternalBaseComponentProps;\n\nconst InternalPanelLayout = React.forwardRef<PanelLayoutProps.Ref, InternalPanelLayoutProps>(\n (\n {\n panelPosition,\n panelContent,\n mainContent,\n defaultPanelSize,\n panelSize: controlledPanelSize,\n resizable,\n onPanelResize,\n onLayoutChange,\n minPanelSize,\n maxPanelSize,\n i18nStrings,\n display,\n panelFocusable,\n mainFocusable,\n __internalRootRef,\n ...props\n },\n ref\n ) => {\n const baseProps = getBaseProps(props);\n\n const resizeHandleRef = React.useRef<HTMLDivElement>(null);\n const panelRef = React.useRef<HTMLDivElement>(null);\n const [containerWidth, rootRef] = useContainerWidth();\n\n React.useImperativeHandle(\n ref,\n () => ({\n focusResizeHandle() {\n resizeHandleRef.current?.focus();\n },\n }),\n []\n );\n\n const [panelSize = DEFAULT_PANEL_SIZE, setPanelSize] = useControllable(\n controlledPanelSize,\n onPanelResize,\n defaultPanelSize ?? minPanelSize,\n {\n componentName: 'PanelLayout',\n controlledProp: 'panelSize',\n changeHandler: 'onPanelResize',\n }\n );\n\n const actualMaxSize = Math.min(maxPanelSize ?? containerWidth, containerWidth);\n const actualMinSize = minPanelSize ?? 0;\n const actualPanelSize = Math.max(Math.min(panelSize, actualMaxSize), actualMinSize);\n\n const stableLayoutChangeEvent = useStableCallback((details: PanelLayoutProps.PanelResizeDetail) =>\n fireNonCancelableEvent(onLayoutChange, details)\n );\n useEffect(() => {\n stableLayoutChangeEvent({ totalSize: containerWidth, panelSize: actualPanelSize });\n }, [containerWidth, actualPanelSize, stableLayoutChangeEvent]);\n\n const resizeHandlePosition = panelPosition === 'side-end' ? 'side' : panelPosition;\n const resizeProps = useResize({\n currentWidth: actualPanelSize,\n minWidth: actualMinSize,\n maxWidth: actualMaxSize,\n panelRef: panelRef,\n handleRef: resizeHandleRef,\n position: resizeHandlePosition,\n onResize: size => {\n setPanelSize(size);\n fireNonCancelableEvent(onPanelResize, { totalSize: containerWidth, panelSize: size });\n },\n });\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef, ref);\n\n const wrappedPanelContent = (\n <div\n className={clsx(styles['panel-content'], display !== 'main-only' && testStyles.panel)}\n tabIndex={panelFocusable && 0}\n role={panelFocusable && 'region'}\n aria-label={panelFocusable?.ariaLabel}\n aria-labelledby={panelFocusable?.ariaLabelledby}\n >\n {panelContent}\n </div>\n );\n const wrappedMainContent = (\n <div\n className={clsx(styles.content, display !== 'panel-only' && testStyles.content)}\n tabIndex={mainFocusable && 0}\n role={mainFocusable && 'region'}\n aria-label={mainFocusable?.ariaLabel}\n aria-labelledby={mainFocusable?.ariaLabelledby}\n >\n {mainContent}\n </div>\n );\n const handle = (\n <div className={styles.handle}>\n <PanelResizeHandle\n ref={resizeHandleRef}\n className={testStyles['resize-handle']}\n position={resizeHandlePosition}\n ariaLabel={i18nStrings?.resizeHandleAriaLabel}\n tooltipText={i18nStrings?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n );\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(baseProps.className, styles.root, testStyles.root, styles[`display-${display}`])}\n >\n {panelPosition === 'side-end' && wrappedMainContent}\n <div\n className={clsx(styles.panel)}\n ref={panelRef}\n style={display === 'all' ? { inlineSize: `${actualPanelSize}px` } : undefined}\n >\n {panelPosition === 'side-start' && wrappedPanelContent}\n {resizable && display === 'all' && handle}\n {panelPosition === 'side-end' && wrappedPanelContent}\n </div>\n {panelPosition === 'side-start' && wrappedMainContent}\n </div>\n );\n }\n);\n\nexport default InternalPanelLayout;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
import './styles.scoped.css';
|
|
3
|
+
export default {
|
|
4
|
+
"root": "awsui_root_1ksu1_1yvik_185",
|
|
5
|
+
"panel": "awsui_panel_1ksu1_1yvik_220",
|
|
6
|
+
"handle": "awsui_handle_1ksu1_1yvik_224",
|
|
7
|
+
"panel-content": "awsui_panel-content_1ksu1_1yvik_228",
|
|
8
|
+
"display-main-only": "awsui_display-main-only_1ksu1_1yvik_241",
|
|
9
|
+
"display-panel-only": "awsui_display-panel-only_1ksu1_1yvik_244",
|
|
10
|
+
"content": "awsui_content_1ksu1_1yvik_248"
|
|
11
|
+
};
|
|
12
|
+
|