@viasat/beam-web-components 2.0.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.
- package/Accordion/Accordion.d.ts +56 -0
- package/Accordion/Accordion.js +12 -0
- package/Accordion/AccordionGroup.context.d.ts +10 -0
- package/Accordion/AccordionGroup.context.js +8 -0
- package/Accordion/AccordionGroup.d.ts +33 -0
- package/Accordion/AccordionGroup.js +79 -0
- package/Accordion/index.d.ts +3 -0
- package/Accordion/index.js +6 -0
- package/Alert/Alert.d.ts +64 -0
- package/Alert/Alert.js +300 -0
- package/Alert/index.d.ts +2 -0
- package/Alert/index.js +4 -0
- package/Avatar/Avatar.d.ts +60 -0
- package/Avatar/Avatar.js +12 -0
- package/Avatar/AvatarGroup.context.d.ts +11 -0
- package/Avatar/AvatarGroup.context.js +8 -0
- package/Avatar/AvatarGroup.d.ts +43 -0
- package/Avatar/AvatarGroup.js +181 -0
- package/Avatar/index.d.ts +3 -0
- package/Avatar/index.js +6 -0
- package/Badge/Badge.d.ts +40 -0
- package/Badge/Badge.js +125 -0
- package/Badge/index.d.ts +2 -0
- package/Badge/index.js +4 -0
- package/BadgeDot/BadgeDot.d.ts +38 -0
- package/BadgeDot/BadgeDot.js +59 -0
- package/BadgeDot/index.d.ts +2 -0
- package/BadgeDot/index.js +4 -0
- package/Box/Box.d.ts +99 -0
- package/Box/Box.js +115 -0
- package/Box/index.d.ts +2 -0
- package/Box/index.js +4 -0
- package/Breadcrumbs/Breadcrumbs.context.d.ts +10 -0
- package/Breadcrumbs/Breadcrumbs.context.js +8 -0
- package/Breadcrumbs/Breadcrumbs.d.ts +38 -0
- package/Breadcrumbs/Breadcrumbs.js +115 -0
- package/Breadcrumbs/BreadcrumbsItem.d.ts +39 -0
- package/Breadcrumbs/BreadcrumbsItem.js +13 -0
- package/Breadcrumbs/index.d.ts +3 -0
- package/Breadcrumbs/index.js +6 -0
- package/Button/Button.d.ts +73 -0
- package/Button/Button.js +125 -0
- package/Button/index.d.ts +2 -0
- package/Button/index.js +4 -0
- package/CloseButton/CloseButton.d.ts +25 -0
- package/CloseButton/CloseButton.js +60 -0
- package/CloseButton/index.d.ts +2 -0
- package/CloseButton/index.js +4 -0
- package/Divider/Divider.d.ts +56 -0
- package/Divider/Divider.js +111 -0
- package/Divider/index.d.ts +2 -0
- package/Divider/index.js +4 -0
- package/EmptyState/EmptyState.d.ts +36 -0
- package/EmptyState/EmptyState.js +56 -0
- package/EmptyState/index.d.ts +2 -0
- package/EmptyState/index.js +4 -0
- package/HelperText/HelperText.d.ts +45 -0
- package/HelperText/HelperText.js +11 -0
- package/HelperText/index.d.ts +2 -0
- package/HelperText/index.js +4 -0
- package/Icon/Icon.d.ts +35 -0
- package/Icon/Icon.js +62 -0
- package/Icon/index.d.ts +2 -0
- package/Icon/index.js +4 -0
- package/InputChoiceGroup/InputChoiceGroup.context.d.ts +13 -0
- package/InputChoiceGroup/InputChoiceGroup.context.js +8 -0
- package/InputChoiceGroup/InputChoiceGroup.d.ts +87 -0
- package/InputChoiceGroup/InputChoiceGroup.js +205 -0
- package/InputChoiceGroup/index.d.ts +2 -0
- package/InputChoiceGroup/index.js +4 -0
- package/Link/Link.d.ts +48 -0
- package/Link/Link.js +77 -0
- package/Link/index.d.ts +2 -0
- package/Link/index.js +4 -0
- package/List/List.context.d.ts +15 -0
- package/List/List.context.js +8 -0
- package/List/List.d.ts +43 -0
- package/List/List.js +101 -0
- package/List/ListItem.d.ts +23 -0
- package/List/ListItem.js +90 -0
- package/List/index.d.ts +3 -0
- package/List/index.js +6 -0
- package/ProgressBar/ProgressBar.d.ts +52 -0
- package/ProgressBar/ProgressBar.js +128 -0
- package/ProgressBar/index.d.ts +2 -0
- package/ProgressBar/index.js +4 -0
- package/README.md +360 -0
- package/SegmentedControl/SegmentedControl.context.d.ts +16 -0
- package/SegmentedControl/SegmentedControl.context.js +8 -0
- package/SegmentedControl/SegmentedControl.d.ts +41 -0
- package/SegmentedControl/SegmentedControl.js +103 -0
- package/SegmentedControl/SegmentedControlItem.d.ts +54 -0
- package/SegmentedControl/SegmentedControlItem.js +284 -0
- package/SegmentedControl/SegmentedControlList.d.ts +23 -0
- package/SegmentedControl/SegmentedControlList.js +61 -0
- package/SegmentedControl/SegmentedControlPanel.d.ts +21 -0
- package/SegmentedControl/SegmentedControlPanel.js +43 -0
- package/SegmentedControl/index.d.ts +5 -0
- package/SegmentedControl/index.js +10 -0
- package/Spinner/Spinner.d.ts +50 -0
- package/Spinner/Spinner.js +186 -0
- package/Spinner/index.d.ts +2 -0
- package/Spinner/index.js +4 -0
- package/StateLayer/StateLayer.d.ts +17 -0
- package/StateLayer/StateLayer.js +6 -0
- package/StateLayer/index.d.ts +2 -0
- package/StateLayer/index.js +5 -0
- package/Text/Text.d.ts +85 -0
- package/Text/Text.js +103 -0
- package/Text/index.d.ts +2 -0
- package/Text/index.js +4 -0
- package/Tooltip/Tooltip.d.ts +139 -0
- package/Tooltip/Tooltip.js +1827 -0
- package/Tooltip/index.d.ts +2 -0
- package/Tooltip/index.js +5 -0
- package/chunks/Accordion.DYD3XcAx.js +161 -0
- package/chunks/Avatar.C2rfzUGP.js +174 -0
- package/chunks/BreadcrumbsItem.4ZR6wbMz.js +121 -0
- package/chunks/CSSLookup.BdqZ5Li9.js +106 -0
- package/chunks/HelperText.CcVVOtA3.js +108 -0
- package/chunks/Upload.B9YEyp7b.js +12 -0
- package/chunks/WarningOutlined.DPfQnPPj.js +12 -0
- package/chunks/classNames.Cq_tbDRp.js +94 -0
- package/chunks/constants.jOWREYQE.js +30 -0
- package/chunks/delegate.baxDQosr.js +63 -0
- package/chunks/dom.C98AFbJh.js +22 -0
- package/chunks/fileUpload.module.kN6o64aL.js +4 -0
- package/chunks/globals.Bz4SVF2g.js +4 -0
- package/chunks/helpers.AwJwaZvv.js +53 -0
- package/chunks/list.module.CZRPBLzy.js +4 -0
- package/chunks/register-custom-element.DHGKOhmA.js +17 -0
- package/chunks/segmentedControl.module.BPXEWodj.js +4 -0
- package/chunks/tokens.CTW8Tt94.js +9 -0
- package/custom-elements.json +11341 -0
- package/local/Accordion/Accordion.js +12 -0
- package/local/Accordion/AccordionGroup.context.js +8 -0
- package/local/Accordion/AccordionGroup.js +78 -0
- package/local/Accordion/index.js +6 -0
- package/local/Alert/Alert.js +301 -0
- package/local/Alert/index.js +4 -0
- package/local/Avatar/Avatar.js +11 -0
- package/local/Avatar/AvatarGroup.context.js +8 -0
- package/local/Avatar/AvatarGroup.js +180 -0
- package/local/Avatar/index.js +6 -0
- package/local/Badge/Badge.js +123 -0
- package/local/Badge/index.js +4 -0
- package/local/BadgeDot/BadgeDot.js +57 -0
- package/local/BadgeDot/index.js +4 -0
- package/local/Box/Box.js +113 -0
- package/local/Box/index.js +4 -0
- package/local/Breadcrumbs/Breadcrumbs.context.js +8 -0
- package/local/Breadcrumbs/Breadcrumbs.js +113 -0
- package/local/Breadcrumbs/BreadcrumbsItem.js +13 -0
- package/local/Breadcrumbs/index.js +6 -0
- package/local/Button/Button.js +154 -0
- package/local/Button/index.js +4 -0
- package/local/CloseButton/CloseButton.js +58 -0
- package/local/CloseButton/index.js +4 -0
- package/local/Divider/Divider.js +111 -0
- package/local/Divider/index.js +4 -0
- package/local/EmptyState/EmptyState.js +54 -0
- package/local/EmptyState/index.js +4 -0
- package/local/HelperText/HelperText.js +9 -0
- package/local/HelperText/index.js +4 -0
- package/local/Icon/Icon.js +60 -0
- package/local/Icon/index.js +4 -0
- package/local/InputChoiceGroup/InputChoiceGroup.context.js +8 -0
- package/local/InputChoiceGroup/InputChoiceGroup.js +205 -0
- package/local/InputChoiceGroup/index.js +4 -0
- package/local/Link/Link.js +75 -0
- package/local/Link/index.js +4 -0
- package/local/List/List.context.js +8 -0
- package/local/List/List.js +101 -0
- package/local/List/ListItem.js +90 -0
- package/local/List/index.js +6 -0
- package/local/ProgressBar/ProgressBar.js +126 -0
- package/local/ProgressBar/index.js +4 -0
- package/local/SegmentedControl/SegmentedControl.context.js +8 -0
- package/local/SegmentedControl/SegmentedControl.js +103 -0
- package/local/SegmentedControl/SegmentedControlItem.js +284 -0
- package/local/SegmentedControl/SegmentedControlList.js +59 -0
- package/local/SegmentedControl/SegmentedControlPanel.js +41 -0
- package/local/SegmentedControl/index.js +10 -0
- package/local/Spinner/Spinner.js +185 -0
- package/local/Spinner/index.js +4 -0
- package/local/StateLayer/StateLayer.js +6 -0
- package/local/StateLayer/index.js +5 -0
- package/local/Text/Text.js +121 -0
- package/local/Text/index.js +4 -0
- package/local/Tooltip/Tooltip.js +1826 -0
- package/local/Tooltip/index.js +5 -0
- package/local/chunks/Accordion.PGU7OILE.js +161 -0
- package/local/chunks/Avatar.CvTOzaRT.js +172 -0
- package/local/chunks/BreadcrumbsItem.GM6sBp_o.js +121 -0
- package/local/chunks/CSSLookup.BdqZ5Li9.js +106 -0
- package/local/chunks/Upload.B9YEyp7b.js +12 -0
- package/local/chunks/WarningOutlined.DPfQnPPj.js +12 -0
- package/local/chunks/base.D76d76ww.js +9 -0
- package/local/chunks/classNames.C6fNrXWF.js +106 -0
- package/local/chunks/constants.jOWREYQE.js +30 -0
- package/local/chunks/consume.Ce9k1-wN.js +47 -0
- package/local/chunks/context-request-event.Bl9Vpkzl.js +13 -0
- package/local/chunks/create-context.DS1OG3vJ.js +11 -0
- package/local/chunks/delegate.baxDQosr.js +63 -0
- package/local/chunks/directive.kLG6oqUu.js +27 -0
- package/local/chunks/dom.C98AFbJh.js +22 -0
- package/local/chunks/fileUpload.module.kN6o64aL.js +4 -0
- package/local/chunks/globals.Bz4SVF2g.js +4 -0
- package/local/chunks/helpers.BWcXAteC.js +53 -0
- package/local/chunks/index.Bz1Jq4c2.js +106 -0
- package/local/chunks/list.module.CZRPBLzy.js +4 -0
- package/local/chunks/lit-element.CJtt9wj5.js +557 -0
- package/local/chunks/provide.i2FlUkOu.js +110 -0
- package/local/chunks/query-assigned-elements.Drkgpk9q.js +19 -0
- package/local/chunks/query-assigned-nodes.Dgvsf6BR.js +19 -0
- package/local/chunks/query.lbpOn5CD.js +20 -0
- package/local/chunks/ref.B7e1Hu4F.js +107 -0
- package/local/chunks/register-custom-element.vod7zfGv.js +51 -0
- package/local/chunks/segmentedControl.module.BPXEWodj.js +4 -0
- package/local/chunks/state.CqiuSzAl.js +12 -0
- package/local/chunks/tokens.CTW8Tt94.js +9 -0
- package/local/chunks/unsafe-html.BzhXEygn.js +27 -0
- package/local/chunks/unsafe-svg.HSGf1NCU.js +14 -0
- package/local/wip/Checkbox/Checkbox.js +102 -0
- package/local/wip/Checkbox/CheckboxGroup/CheckboxGroup.js +27 -0
- package/local/wip/Checkbox/index.js +6 -0
- package/local/wip/FileUpload/FileUpload.Button.js +75 -0
- package/local/wip/FileUpload/FileUpload.Dropzone.js +149 -0
- package/local/wip/FileUpload/FileUpload.List.Item.js +201 -0
- package/local/wip/FileUpload/FileUpload.List.js +105 -0
- package/local/wip/FileUpload/FileUpload.js +452 -0
- package/local/wip/FileUpload/FileUploadContext.js +8 -0
- package/local/wip/FileUpload/FileUploadListContext.js +8 -0
- package/local/wip/FileUpload/index.js +13 -0
- package/local/wip/Form/Form.context.js +20 -0
- package/local/wip/Form/Form.decorator.js +145 -0
- package/local/wip/Form/Form.js +288 -0
- package/local/wip/Form/Form.utils.js +8 -0
- package/local/wip/Form/index.js +7 -0
- package/local/wip/Label/Label.js +86 -0
- package/local/wip/Label/index.js +4 -0
- package/local/wip/NativeSelect/NativeSelect.js +162 -0
- package/local/wip/NativeSelect/index.js +4 -0
- package/local/wip/RadioButton/RadioButton.js +123 -0
- package/local/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.js +96 -0
- package/local/wip/RadioButton/index.js +6 -0
- package/local/wip/Switch/Switch.js +153 -0
- package/local/wip/Switch/SwitchGroup/SwitchGroup.js +15 -0
- package/local/wip/Switch/index.js +6 -0
- package/local/wip/TextArea/TextArea.js +192 -0
- package/local/wip/TextArea/index.js +4 -0
- package/local/wip/TextField/TextField.js +169 -0
- package/local/wip/TextField/index.js +4 -0
- package/package.json +78 -0
- package/vscode.css-custom-data.json +6 -0
- package/vscode.html-custom-data.json +2704 -0
- package/wip/Checkbox/Checkbox.d.ts +55 -0
- package/wip/Checkbox/Checkbox.js +104 -0
- package/wip/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +11 -0
- package/wip/Checkbox/CheckboxGroup/CheckboxGroup.js +27 -0
- package/wip/Checkbox/index.d.ts +3 -0
- package/wip/Checkbox/index.js +6 -0
- package/wip/FileUpload/FileUpload.Button.d.ts +36 -0
- package/wip/FileUpload/FileUpload.Button.js +77 -0
- package/wip/FileUpload/FileUpload.Dropzone.d.ts +55 -0
- package/wip/FileUpload/FileUpload.Dropzone.js +150 -0
- package/wip/FileUpload/FileUpload.List.Item.d.ts +62 -0
- package/wip/FileUpload/FileUpload.List.Item.js +203 -0
- package/wip/FileUpload/FileUpload.List.d.ts +46 -0
- package/wip/FileUpload/FileUpload.List.js +106 -0
- package/wip/FileUpload/FileUpload.d.ts +101 -0
- package/wip/FileUpload/FileUpload.js +451 -0
- package/wip/FileUpload/FileUploadContext.d.ts +5 -0
- package/wip/FileUpload/FileUploadContext.js +8 -0
- package/wip/FileUpload/FileUploadListContext.d.ts +5 -0
- package/wip/FileUpload/FileUploadListContext.js +8 -0
- package/wip/FileUpload/index.d.ts +6 -0
- package/wip/FileUpload/index.js +13 -0
- package/wip/Form/Form.context.d.ts +19 -0
- package/wip/Form/Form.context.js +20 -0
- package/wip/Form/Form.d.ts +50 -0
- package/wip/Form/Form.decorator.d.ts +47 -0
- package/wip/Form/Form.decorator.js +144 -0
- package/wip/Form/Form.js +288 -0
- package/wip/Form/Form.utils.d.ts +2 -0
- package/wip/Form/Form.utils.js +8 -0
- package/wip/Form/index.d.ts +3 -0
- package/wip/Form/index.js +7 -0
- package/wip/Label/Label.d.ts +43 -0
- package/wip/Label/Label.js +87 -0
- package/wip/Label/index.d.ts +2 -0
- package/wip/Label/index.js +4 -0
- package/wip/NativeSelect/NativeSelect.d.ts +69 -0
- package/wip/NativeSelect/NativeSelect.js +163 -0
- package/wip/NativeSelect/index.d.ts +2 -0
- package/wip/NativeSelect/index.js +4 -0
- package/wip/RadioButton/RadioButton.d.ts +56 -0
- package/wip/RadioButton/RadioButton.js +125 -0
- package/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.d.ts +23 -0
- package/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.js +96 -0
- package/wip/RadioButton/index.d.ts +3 -0
- package/wip/RadioButton/index.js +6 -0
- package/wip/Switch/Switch.d.ts +62 -0
- package/wip/Switch/Switch.js +155 -0
- package/wip/Switch/SwitchGroup/SwitchGroup.d.ts +15 -0
- package/wip/Switch/SwitchGroup/SwitchGroup.js +15 -0
- package/wip/Switch/index.d.ts +3 -0
- package/wip/Switch/index.js +6 -0
- package/wip/TextArea/TextArea.d.ts +89 -0
- package/wip/TextArea/TextArea.js +193 -0
- package/wip/TextArea/index.d.ts +2 -0
- package/wip/TextArea/index.js +4 -0
- package/wip/TextField/TextField.d.ts +70 -0
- package/wip/TextField/TextField.js +169 -0
- package/wip/TextField/index.d.ts +2 -0
- package/wip/TextField/index.js +4 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { AccordionSizes } from '@viasat/beam-shared/components/accordion';
|
|
3
|
+
/**
|
|
4
|
+
* `bm-accordion`
|
|
5
|
+
*
|
|
6
|
+
* @fires bm-toggle - Dispatched when the Accordion is toggled
|
|
7
|
+
* @slot default - Specify body content for the Accordion
|
|
8
|
+
* @slot icon - Display an icon before the Accordion heading
|
|
9
|
+
* @slot heading - Specify heading content for the Accordion
|
|
10
|
+
*/
|
|
11
|
+
export declare class BmAccordion extends LitElement {
|
|
12
|
+
#private;
|
|
13
|
+
/**
|
|
14
|
+
* Specify size of an Accordion
|
|
15
|
+
* @default 'md'
|
|
16
|
+
*/
|
|
17
|
+
size: AccordionSizes | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Specify heading content for the Accordion
|
|
20
|
+
*/
|
|
21
|
+
heading?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Specify if an Accordion is open.
|
|
24
|
+
* If this is specified, the component becomes controlled
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
open?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Specify if an Accordion is open by default
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
defaultOpen: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Unique identifier of Accordion
|
|
35
|
+
*/
|
|
36
|
+
id: string;
|
|
37
|
+
private _isOpen;
|
|
38
|
+
private _accordionUniqueId;
|
|
39
|
+
private iconNodes?;
|
|
40
|
+
private get hasIconSlot();
|
|
41
|
+
private group?;
|
|
42
|
+
static styles: import('lit').CSSResult;
|
|
43
|
+
connectedCallback(): void;
|
|
44
|
+
disconnectedCallback(): void;
|
|
45
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
46
|
+
private handleToggle;
|
|
47
|
+
private dispatchToggleEvent;
|
|
48
|
+
private handleKeyDown;
|
|
49
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
50
|
+
}
|
|
51
|
+
declare global {
|
|
52
|
+
interface HTMLElementTagNameMap {
|
|
53
|
+
'bm-accordion': BmAccordion;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "@lit/context";
|
|
2
|
+
import "lit";
|
|
3
|
+
import "lit/decorators.js";
|
|
4
|
+
import "lit/directives/unsafe-svg.js";
|
|
5
|
+
import "clsx";
|
|
6
|
+
import { B as e } from "../chunks/Accordion.DYD3XcAx.js";
|
|
7
|
+
import "../chunks/classNames.Cq_tbDRp.js";
|
|
8
|
+
import "../chunks/register-custom-element.DHGKOhmA.js";
|
|
9
|
+
import "./AccordionGroup.context.js";
|
|
10
|
+
export {
|
|
11
|
+
e as BmAccordion
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AccordionSizes } from '@viasat/beam-shared/components/accordion';
|
|
2
|
+
export interface AccordionGroupCtxValue {
|
|
3
|
+
size?: AccordionSizes;
|
|
4
|
+
register: (el: HTMLElement) => void;
|
|
5
|
+
unregister: (el: HTMLElement) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const AccordionGroupCtx: {
|
|
8
|
+
__context__: AccordionGroupCtxValue;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=AccordionGroup.context.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { AccordionSizes } from '@viasat/beam-shared/components/accordion';
|
|
3
|
+
import { AccordionGroupCtxValue } from './AccordionGroup.context';
|
|
4
|
+
/**
|
|
5
|
+
* `bm-accordion-group`
|
|
6
|
+
* @slot default - Specify which Accordions are in the AccordionGroup
|
|
7
|
+
*/
|
|
8
|
+
export declare class BmAccordionGroup extends LitElement {
|
|
9
|
+
#private;
|
|
10
|
+
/**
|
|
11
|
+
* Specify the size of the AccordionGroup
|
|
12
|
+
* @default 'md'
|
|
13
|
+
*/
|
|
14
|
+
size: AccordionSizes;
|
|
15
|
+
/**
|
|
16
|
+
* Specify if only one row item can be expanded at a time
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
singleExpand: boolean;
|
|
20
|
+
groupCtx: AccordionGroupCtxValue;
|
|
21
|
+
static styles: import('lit').CSSResult;
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
disconnectedCallback(): void;
|
|
24
|
+
handleAccordionToggle: (event: CustomEvent) => void;
|
|
25
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
26
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface HTMLElementTagNameMap {
|
|
30
|
+
'bm-accordion-group': BmAccordionGroup;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=AccordionGroup.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { provide as u } from "@lit/context";
|
|
2
|
+
import { unsafeCSS as v, css as _, LitElement as C, html as x } from "lit";
|
|
3
|
+
import { property as f, state as y } from "lit/decorators.js";
|
|
4
|
+
import E from "clsx";
|
|
5
|
+
import { g as w } from "../chunks/classNames.Cq_tbDRp.js";
|
|
6
|
+
import { a as A } from "../chunks/Accordion.DYD3XcAx.js";
|
|
7
|
+
import { c as z } from "../chunks/register-custom-element.DHGKOhmA.js";
|
|
8
|
+
import { AccordionGroupCtx as O } from "./AccordionGroup.context.js";
|
|
9
|
+
var S = Object.defineProperty, G = Object.getOwnPropertyDescriptor, g = (e) => {
|
|
10
|
+
throw TypeError(e);
|
|
11
|
+
}, p = (e, t, r, i) => {
|
|
12
|
+
for (var s = i > 1 ? void 0 : i ? G(t, r) : t, c = e.length - 1, l; c >= 0; c--)
|
|
13
|
+
(l = e[c]) && (s = (i ? l(t, r, s) : l(s)) || s);
|
|
14
|
+
return i && s && S(t, r, s), s;
|
|
15
|
+
}, P = (e, t, r) => t.has(e) || g("Cannot " + r), a = (e, t, r) => (P(e, t, "read from private field"), r ? r.call(e) : t.get(e)), d = (e, t, r) => t.has(e) ? g("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), n, h, m;
|
|
16
|
+
const { baseClassNamePrefix: k } = w("accordion");
|
|
17
|
+
let o = class extends C {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments), this.size = "md", this.singleExpand = !1, d(this, n, /* @__PURE__ */ new Set()), this.groupCtx = {
|
|
20
|
+
register: (e) => a(this, h).call(this, e),
|
|
21
|
+
unregister: (e) => a(this, m).call(this, e),
|
|
22
|
+
size: this.size
|
|
23
|
+
}, d(this, h, (e) => {
|
|
24
|
+
a(this, n).add(e), this.requestUpdate();
|
|
25
|
+
}), d(this, m, (e) => {
|
|
26
|
+
a(this, n).delete(e), this.requestUpdate();
|
|
27
|
+
}), this.handleAccordionToggle = (e) => {
|
|
28
|
+
const { accordion: t, isOpen: r } = e.detail;
|
|
29
|
+
this.singleExpand && r && Array.from(a(this, n)).forEach((s) => {
|
|
30
|
+
s !== t && (s.open === void 0 ? (s._isOpen = !1, s.requestUpdate()) : s.open = !1);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
connectedCallback() {
|
|
35
|
+
super.connectedCallback(), this.addEventListener("bm-toggle", this.handleAccordionToggle);
|
|
36
|
+
}
|
|
37
|
+
disconnectedCallback() {
|
|
38
|
+
this.removeEventListener(
|
|
39
|
+
"bm-toggle",
|
|
40
|
+
this.handleAccordionToggle
|
|
41
|
+
), super.disconnectedCallback();
|
|
42
|
+
}
|
|
43
|
+
willUpdate(e) {
|
|
44
|
+
e.has("size") && (this.groupCtx = {
|
|
45
|
+
...this.groupCtx,
|
|
46
|
+
size: this.size
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
const e = E(k);
|
|
51
|
+
return x`
|
|
52
|
+
<div class=${e}>
|
|
53
|
+
<slot></slot>
|
|
54
|
+
</div>
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
n = /* @__PURE__ */ new WeakMap();
|
|
59
|
+
h = /* @__PURE__ */ new WeakMap();
|
|
60
|
+
m = /* @__PURE__ */ new WeakMap();
|
|
61
|
+
o.styles = _`
|
|
62
|
+
${v(A)}
|
|
63
|
+
`;
|
|
64
|
+
p([
|
|
65
|
+
f({ type: String })
|
|
66
|
+
], o.prototype, "size", 2);
|
|
67
|
+
p([
|
|
68
|
+
f({ type: Boolean })
|
|
69
|
+
], o.prototype, "singleExpand", 2);
|
|
70
|
+
p([
|
|
71
|
+
u({ context: O }),
|
|
72
|
+
y()
|
|
73
|
+
], o.prototype, "groupCtx", 2);
|
|
74
|
+
o = p([
|
|
75
|
+
z("bm-accordion-group")
|
|
76
|
+
], o);
|
|
77
|
+
export {
|
|
78
|
+
o as BmAccordionGroup
|
|
79
|
+
};
|
package/Alert/Alert.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { LitElement, nothing, PropertyValues } from 'lit';
|
|
2
|
+
import { AlertAppearances, AlertSizes } from '@viasat/beam-shared/components/alert';
|
|
3
|
+
import { ThemeTypes } from '@viasat/beam-shared/utils/constants';
|
|
4
|
+
/**
|
|
5
|
+
* `bm-alert`
|
|
6
|
+
*
|
|
7
|
+
* @fires bm-dismiss - Dispatched when the Alert has been dismissed
|
|
8
|
+
* @slot icon - Specify a different icon for the Alert
|
|
9
|
+
* @slot heading - Specify the heading text for Alert or pass the `heading` attribute to set the heading
|
|
10
|
+
* @slot body - Specify the body text for Alert or pass the `body` attribute to set the body
|
|
11
|
+
* @slot actions - Specify if actions display on the Alert
|
|
12
|
+
*/
|
|
13
|
+
export declare class BmAlert extends LitElement {
|
|
14
|
+
#private;
|
|
15
|
+
static styles: import('lit').CSSResult;
|
|
16
|
+
constructor();
|
|
17
|
+
/** Specify the heading text for Alert */
|
|
18
|
+
heading: string | undefined;
|
|
19
|
+
/** Specify the body text for Alert */
|
|
20
|
+
body: string | undefined;
|
|
21
|
+
/** Specify the size of the Alert @default 'sm' */
|
|
22
|
+
size: AlertSizes;
|
|
23
|
+
/** Specify if the Alert has no border radius @default false */
|
|
24
|
+
fullWidth: boolean;
|
|
25
|
+
/** Specify the theme of the Alert. By default it inherits the theme from the parent */
|
|
26
|
+
theme: ThemeTypes | undefined;
|
|
27
|
+
/** Specify the appearance of the Alert @default 'infoPrimary' */
|
|
28
|
+
appearance: AlertAppearances;
|
|
29
|
+
/** Specify if the Alert is hidden @default false */
|
|
30
|
+
hidden: boolean;
|
|
31
|
+
/** Specify if the icon displays on the Alert @default false */
|
|
32
|
+
hideIcon: boolean;
|
|
33
|
+
/** Specify if the Alert can be dismissed @default false */
|
|
34
|
+
dismissible: boolean;
|
|
35
|
+
/** Prevent autofocus on show @default false */
|
|
36
|
+
disableAutoFocus: boolean;
|
|
37
|
+
/** Prevent Escape from closing @default false */
|
|
38
|
+
disableCloseOnEscape: boolean;
|
|
39
|
+
private headingNodes?;
|
|
40
|
+
private bodyNodes?;
|
|
41
|
+
private iconNodes?;
|
|
42
|
+
private actionsNodes?;
|
|
43
|
+
private headingSlot?;
|
|
44
|
+
private bodySlot?;
|
|
45
|
+
private _isContentWrapping;
|
|
46
|
+
private _contentRef;
|
|
47
|
+
private _actionSlotWrapperRef;
|
|
48
|
+
private _closeButtonRef;
|
|
49
|
+
private get hasHeadingSlot();
|
|
50
|
+
private get hasBodySlot();
|
|
51
|
+
private get hasIconSlot();
|
|
52
|
+
private get hasActionSlot();
|
|
53
|
+
connectedCallback(): void;
|
|
54
|
+
disconnectedCallback(): void;
|
|
55
|
+
firstUpdated(): void;
|
|
56
|
+
updated(changed: PropertyValues<this>): void;
|
|
57
|
+
render(): typeof nothing | import('lit-html').TemplateResult<1>;
|
|
58
|
+
}
|
|
59
|
+
declare global {
|
|
60
|
+
interface HTMLElementTagNameMap {
|
|
61
|
+
'bm-alert': BmAlert;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=Alert.d.ts.map
|
package/Alert/Alert.js
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { unsafeCSS as J, LitElement as Q, nothing as n, html as d } from "lit";
|
|
2
|
+
import { property as l, queryAssignedNodes as P, query as $, state as X } from "lit/decorators.js";
|
|
3
|
+
import { unsafeSVG as Y } from "lit/directives/unsafe-svg.js";
|
|
4
|
+
import u from "clsx";
|
|
5
|
+
import { W as j } from "../chunks/WarningOutlined.DPfQnPPj.js";
|
|
6
|
+
import { t as ee, a as oe } from "../chunks/constants.jOWREYQE.js";
|
|
7
|
+
import { c as re } from "../chunks/CSSLookup.BdqZ5Li9.js";
|
|
8
|
+
import { n as f, g as ae, f as te, c as ie, e as se } from "../chunks/classNames.Cq_tbDRp.js";
|
|
9
|
+
import { r as ne } from "../chunks/delegate.baxDQosr.js";
|
|
10
|
+
import { c as me } from "../chunks/register-custom-element.DHGKOhmA.js";
|
|
11
|
+
import "../CloseButton/CloseButton.js";
|
|
12
|
+
const le = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
+
<path
|
|
14
|
+
fill-rule="evenodd"
|
|
15
|
+
clip-rule="evenodd"
|
|
16
|
+
d="M16.59 7.58L10 14.17L6.41 10.59L5 12L10 17L18 9L16.59 7.58ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
`, I = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
21
|
+
<path
|
|
22
|
+
fill-rule="evenodd"
|
|
23
|
+
clip-rule="evenodd"
|
|
24
|
+
d="M11 17H13V11H11V17ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM11 9H13V7H11V9Z"
|
|
25
|
+
fill="currentColor"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
`, ce = (e) => re(e === "sm" ? 2.625 : 3.125), _ = {
|
|
29
|
+
positive: "Success",
|
|
30
|
+
warning: "Warning",
|
|
31
|
+
negative: "Error",
|
|
32
|
+
infoPrimary: "Information",
|
|
33
|
+
infoSecondary: "Information"
|
|
34
|
+
}, pe = "Dismiss Alert", be = ':root,:host,.bm-light,.bm-dark .bm-inverse,[data-bm-theme~=bm-light]{--bm-comp-alert-color-positive-bg: var( --bm-sem-color-surface-positive, #daf7cf );--bm-comp-alert-color-positive-icon: var( --bm-sem-color-icon-positive-strong, #187c36 );--bm-comp-alert-color-positive-heading: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-positive-body: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-positive-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-warning-bg: var( --bm-sem-color-surface-warning, #ffe4c9 );--bm-comp-alert-color-warning-icon: var( --bm-sem-color-icon-warning-strong, #ac4902 );--bm-comp-alert-color-warning-heading: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-warning-body: var(--bm-sem-color-text-primary, #141d24);--bm-comp-alert-color-warning-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-negative-bg: var( --bm-sem-color-surface-negative, #fee6e7 );--bm-comp-alert-color-negative-icon: var( --bm-sem-color-icon-negative-strong, #cc2429 );--bm-comp-alert-color-negative-heading: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-negative-body: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-negative-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-info-primary-bg: var( --bm-sem-color-surface-info-primary, #ccf0ff );--bm-comp-alert-color-info-primary-icon: var( --bm-sem-color-icon-info-primary-strong, #006ead );--bm-comp-alert-color-info-primary-heading: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-info-primary-body: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-info-primary-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-alert-color-info-secondary-bg: var( --bm-sem-color-surface-info-secondary, #dfe7ec );--bm-comp-alert-color-info-secondary-icon: var( --bm-sem-color-icon-info-secondary-strong, #465967 );--bm-comp-alert-color-info-secondary-heading: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-info-secondary-body: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-info-secondary-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-alert-space-x: var(--bm-sem-space-100, 1rem);--bm-comp-alert-space-y: var(--bm-sem-space-100, 1rem);--bm-comp-alert-space-sm-y: var(--bm-sem-space-75, .75rem);--bm-comp-alert-space-gap: var(--bm-sem-space-50, .5rem);--bm-comp-alert-space-text-gap: var(--bm-sem-space-12, .125rem);--bm-comp-alert-space-actions-gap: var(--bm-sem-space-50, .5rem);--bm-comp-alert-radius-in-page: var(--bm-sem-radius-md, .5rem);--bm-comp-alert-radius-full-width: var(--bm-sem-radius-none);--bm-comp-alert-border-width: var(--bm-sem-border-width-none, 0);--bm-comp-alert-size-sm-icon: var(--bm-sem-size-icon-md, 1.25rem);--bm-comp-alert-size-md-icon: var(--bm-sem-size-icon-lg, 1.5rem);--bm-comp-alert-typo-sm-heading: var( --bm-sem-typo-heading-xs, 700 1rem/1.25rem "Uni Neue" );--bm-comp-alert-typo-sm-body: var( --bm-sem-typo-body-sm, 400 .875rem/1.25rem "Source Sans Pro" );--bm-comp-alert-typo-md-heading: var( --bm-sem-typo-heading-sm, 700 1.125rem/1.5rem "Uni Neue" );--bm-comp-alert-typo-md-body: var( --bm-sem-typo-body-md, 400 1rem/1.5rem "Source Sans Pro" );--bm-comp-alert-shadow: var(--bm-sem-shadow-none, 0 0 0 0 rgb(0, 0, 0, 0))}:host,.bm-dark,.bm-light .bm-inverse,[data-bm-theme~=bm-dark]{--bm-comp-alert-color-positive-bg: var( --bm-sem-color-surface-positive, #02310e );--bm-comp-alert-color-positive-icon: var( --bm-sem-color-icon-positive-strong, #b3eb9e );--bm-comp-alert-color-positive-heading: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-positive-body: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-positive-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-warning-bg: var( --bm-sem-color-surface-warning, #3e1a00 );--bm-comp-alert-color-warning-icon: var( --bm-sem-color-icon-warning-strong, #ffd4a8 );--bm-comp-alert-color-warning-heading: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-warning-body: var(--bm-sem-color-text-primary, #ffffff);--bm-comp-alert-color-warning-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-negative-bg: var( --bm-sem-color-surface-negative, #520f11 );--bm-comp-alert-color-negative-icon: var( --bm-sem-color-icon-negative-strong, #f67378 );--bm-comp-alert-color-negative-heading: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-negative-body: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-negative-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-info-primary-bg: var( --bm-sem-color-surface-info-primary, #002f57 );--bm-comp-alert-color-info-primary-icon: var( --bm-sem-color-icon-info-primary-strong, #9be1ff );--bm-comp-alert-color-info-primary-heading: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-info-primary-body: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-info-primary-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-alert-color-info-secondary-bg: var( --bm-sem-color-surface-info-secondary, #202e39 );--bm-comp-alert-color-info-secondary-icon: var( --bm-sem-color-icon-info-secondary-strong, #c3cdd5 );--bm-comp-alert-color-info-secondary-heading: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-info-secondary-body: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-info-secondary-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-alert-space-x: var(--bm-sem-space-100, 1rem);--bm-comp-alert-space-y: var(--bm-sem-space-100, 1rem);--bm-comp-alert-space-sm-y: var(--bm-sem-space-75, .75rem);--bm-comp-alert-space-gap: var(--bm-sem-space-50, .5rem);--bm-comp-alert-space-text-gap: var(--bm-sem-space-12, .125rem);--bm-comp-alert-space-actions-gap: var(--bm-sem-space-50, .5rem);--bm-comp-alert-radius-in-page: var(--bm-sem-radius-md, .5rem);--bm-comp-alert-radius-full-width: var(--bm-sem-radius-none);--bm-comp-alert-border-width: var(--bm-sem-border-width-none, 0);--bm-comp-alert-size-sm-icon: var(--bm-sem-size-icon-md, 1.25rem);--bm-comp-alert-size-md-icon: var(--bm-sem-size-icon-lg, 1.5rem);--bm-comp-alert-typo-sm-heading: var( --bm-sem-typo-heading-xs, 700 1rem/1.25rem "Uni Neue" );--bm-comp-alert-typo-sm-body: var( --bm-sem-typo-body-sm, 400 .875rem/1.25rem "Source Sans Pro" );--bm-comp-alert-typo-md-heading: var( --bm-sem-typo-heading-sm, 700 1.125rem/1.5rem "Uni Neue" );--bm-comp-alert-typo-md-body: var( --bm-sem-typo-body-md, 400 1rem/1.5rem "Source Sans Pro" );--bm-comp-alert-shadow: var(--bm-sem-shadow-none, 0 0 0 0 rgb(0, 0, 0, 0))}.bm-alert{display:flex;align-items:center;word-break:break-word;gap:var(--bm-comp-alert-space-gap);padding:var(--bm-comp-alert-space-sm-y) var(--bm-comp-alert-space-x);box-shadow:var(--bm-comp-alert-shadow);border-width:var(--bm-comp-alert-border-width);border-style:solid;border-radius:var(--bm-comp-alert-radius-in-page)}.bm-alert__content__wrapper{flex:1 0 0;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:var(--bm-comp-alert-space-gap)}.bm-alert .bm-alert__content{display:flex;flex-direction:column;gap:var(--bm-comp-alert-space-text-gap);font:var(--bm-comp-alert-typo-sm-body)}.bm-alert .bm-alert__content__heading{font:var(--bm-comp-alert-typo-sm-heading)}.bm-alert__actions{display:flex;gap:var(--bm-comp-alert-space-actions-gap)}.bm-alert .bm-alert__icon,.bm-alert .bm-alert__icon svg{display:flex;align-self:center;align-items:center;min-width:var(--bm-comp-alert-size-sm-icon);min-height:var(--bm-comp-alert-size-sm-icon)}.bm-alert .bm-alert__icon--wrapping,.bm-alert .bm-alert__icon svg--wrapping{align-self:flex-start}.bm-alert__close-button{display:flex;align-self:center}.bm-alert__close-button--wrapping{align-self:baseline}.bm-alert--full-width{border-radius:var(--bm-comp-alert-radius-full-width)}.bm-alert--md{padding:var(--bm-comp-alert-space-y) var(--bm-comp-alert-space-x)}.bm-alert--md .bm-alert__content{font:var(--bm-comp-alert-typo-md-body)}.bm-alert--md .bm-alert__content__heading{font:var(--bm-comp-alert-typo-md-heading)}.bm-alert--md .bm-alert__icon,.bm-alert--md .bm-alert__icon svg{min-width:var(--bm-comp-alert-size-md-icon);min-height:var(--bm-comp-alert-size-md-icon)}.bm-alert--positive{background-color:var(--bm-comp-alert-color-positive-bg);border-color:var(--bm-comp-alert-color-positive-border)}.bm-alert--positive .bm-alert__icon,.bm-alert--positive .bm-alert__icon svg{color:var(--bm-comp-alert-color-positive-icon)}.bm-alert--positive .bm-alert__content{color:var(--bm-comp-alert-color-positive-body)}.bm-alert--warning{background-color:var(--bm-comp-alert-color-warning-bg);border-color:var(--bm-comp-alert-color-warning-border)}.bm-alert--warning .bm-alert__icon,.bm-alert--warning .bm-alert__icon svg{color:var(--bm-comp-alert-color-warning-icon)}.bm-alert--warning .bm-alert__content{color:var(--bm-comp-alert-color-warning-body)}.bm-alert--negative{background-color:var(--bm-comp-alert-color-negative-bg);border-color:var(--bm-comp-alert-color-negative-border)}.bm-alert--negative .bm-alert__icon,.bm-alert--negative .bm-alert__icon svg{color:var(--bm-comp-alert-color-negative-icon)}.bm-alert--negative .bm-alert__content{color:var(--bm-comp-alert-color-negative-body)}.bm-alert--infoPrimary{background-color:var(--bm-comp-alert-color-info-primary-bg);border-color:var(--bm-comp-alert-color-info-primary-border)}.bm-alert--infoPrimary .bm-alert__icon,.bm-alert--infoPrimary .bm-alert__icon svg{color:var(--bm-comp-alert-color-info-primary-icon)}.bm-alert--infoPrimary .bm-alert__content{color:var(--bm-comp-alert-color-info-primary-body)}.bm-alert--infoSecondary{background-color:var(--bm-comp-alert-color-info-secondary-bg);border-color:var(--bm-comp-alert-color-info-secondary-border)}.bm-alert--infoSecondary .bm-alert__icon,.bm-alert--infoSecondary .bm-alert__icon svg{color:var(--bm-comp-alert-color-info-secondary-icon)}.bm-alert--infoSecondary .bm-alert__content{color:var(--bm-comp-alert-color-info-secondary-body)}.bm-alert[dir=rtl]{flex-direction:row-reverse}.bm-alert--no-box{display:contents}';
|
|
35
|
+
var de = Object.defineProperty, fe = Object.getOwnPropertyDescriptor, G = (e) => {
|
|
36
|
+
throw TypeError(e);
|
|
37
|
+
}, i = (e, o, a, m) => {
|
|
38
|
+
for (var c = m > 1 ? void 0 : m ? fe(o, a) : o, g = e.length - 1, y; g >= 0; g--)
|
|
39
|
+
(y = e[g]) && (c = (m ? y(o, a, c) : y(c)) || c);
|
|
40
|
+
return m && c && de(o, a, c), c;
|
|
41
|
+
}, T = (e, o, a) => o.has(e) || G("Cannot " + a), r = (e, o, a) => (T(e, o, "read from private field"), a ? a.call(e) : o.get(e)), s = (e, o, a) => o.has(e) ? G("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(e) : o.set(e, a), H = (e, o, a, m) => (T(e, o, "write to private field"), o.set(e, a), a), B, x, C, b, A, M, R, h, v, z, N, S, L, O, F, U, D;
|
|
42
|
+
const { baseClassNamePrefix: he, subElementClassPrefix: p, classModifierPrefix: w } = ae("alert");
|
|
43
|
+
let t = class extends Q {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(), this.size = "sm", this.fullWidth = !1, this.appearance = "infoPrimary", this.hidden = !1, this.hideIcon = !1, this.dismissible = !1, this.disableAutoFocus = !1, this.disableCloseOnEscape = !1, this._isContentWrapping = !1, s(this, B, document.activeElement), s(this, x, () => !!this.heading || this.hasHeadingSlot), s(this, C, () => !!this.body || this.hasBodySlot), s(this, b, () => this.requestUpdate()), s(this, A, () => {
|
|
46
|
+
var e;
|
|
47
|
+
this.dispatchEvent(
|
|
48
|
+
new CustomEvent("bm-dismiss", {
|
|
49
|
+
detail: { message: "bm-alert dismissed" },
|
|
50
|
+
bubbles: !0,
|
|
51
|
+
composed: !0
|
|
52
|
+
})
|
|
53
|
+
), this.hidden = !0, (e = r(this, B)) == null || e.focus();
|
|
54
|
+
}), s(this, M, (e) => {
|
|
55
|
+
e.key === "Escape" && this.dismissible && !this.disableCloseOnEscape && r(this, A).call(this);
|
|
56
|
+
}), s(this, R, () => {
|
|
57
|
+
var e;
|
|
58
|
+
if (!this.disableAutoFocus) {
|
|
59
|
+
if (this.hasActionSlot && !this.hidden) {
|
|
60
|
+
const o = this._actionSlotWrapperRef.assignedNodes({
|
|
61
|
+
flatten: !0
|
|
62
|
+
})[0], a = te(
|
|
63
|
+
o
|
|
64
|
+
);
|
|
65
|
+
a == null || a.focus();
|
|
66
|
+
} else if (this.dismissible && !this.hasActionSlot && !this.hidden) {
|
|
67
|
+
const o = (e = this._closeButtonRef.shadowRoot) == null ? void 0 : e.querySelector("button");
|
|
68
|
+
o == null || o.focus();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}), s(this, h), s(this, v), s(this, z, () => {
|
|
72
|
+
const e = this._contentRef;
|
|
73
|
+
e && (H(this, v, ie(() => {
|
|
74
|
+
const o = e.offsetHeight, a = ce(this.size);
|
|
75
|
+
this._isContentWrapping = o > a;
|
|
76
|
+
}, oe)), H(this, h, new ResizeObserver(r(this, v))), r(this, h).observe(e), r(this, v).call(this));
|
|
77
|
+
}), s(this, N, () => {
|
|
78
|
+
var e;
|
|
79
|
+
r(this, h) && r(this, h).disconnect(), (e = r(this, v)) == null || e.cancel();
|
|
80
|
+
}), s(this, S, () => {
|
|
81
|
+
const e = r(this, x).call(this), o = r(this, C).call(this), a = this.hasActionSlot, m = this.dismissible, { role: c } = this, g = c === "alertdialog", y = !!(!this.disableAutoFocus && (a || m)), Z = g || y, K = Z ? "alertdialog" : c, q = e ? "heading" : n, k = o ? "body" : n;
|
|
82
|
+
let W = n;
|
|
83
|
+
const E = Z || m;
|
|
84
|
+
E && e ? W = q : E && o && (W = k);
|
|
85
|
+
let V = n;
|
|
86
|
+
return E && o && W !== k && (V = k), { role: K, ariaLabelledBy: W, ariaDescribedBy: V, headingId: q, bodyId: k };
|
|
87
|
+
}), s(this, L, () => {
|
|
88
|
+
if (this.hideIcon) return n;
|
|
89
|
+
const { icon: e, label: o } = {
|
|
90
|
+
infoPrimary: { icon: I, label: _.infoPrimary },
|
|
91
|
+
infoSecondary: { icon: I, label: _.infoSecondary },
|
|
92
|
+
negative: { icon: I, label: _.negative },
|
|
93
|
+
positive: { icon: le, label: _.positive },
|
|
94
|
+
warning: { icon: j, label: _.warning }
|
|
95
|
+
}[this.appearance], a = se(e, { role: "img", "aria-label": o });
|
|
96
|
+
return d`
|
|
97
|
+
<span
|
|
98
|
+
class=${u(
|
|
99
|
+
`${p}icon`,
|
|
100
|
+
(this._isContentWrapping || r(this, x).call(this) && r(this, C).call(this)) && `${p}icon--wrapping`
|
|
101
|
+
)}
|
|
102
|
+
>
|
|
103
|
+
<slot name="icon" @slotchange=${r(this, b)}></slot>
|
|
104
|
+
${this.hasIconSlot ? n : Y(a)}
|
|
105
|
+
</span>
|
|
106
|
+
`;
|
|
107
|
+
}), s(this, O, () => {
|
|
108
|
+
const e = r(this, x).call(this), o = `${p}content__heading`, { headingId: a } = r(this, S).call(this);
|
|
109
|
+
return d`
|
|
110
|
+
<span
|
|
111
|
+
id=${e ? a : n}
|
|
112
|
+
class=${u(
|
|
113
|
+
o,
|
|
114
|
+
!e && `${w}no-box`
|
|
115
|
+
)}
|
|
116
|
+
>
|
|
117
|
+
<slot name="heading" @slotchange=${r(this, b)}></slot>
|
|
118
|
+
${this.hasHeadingSlot ? n : this.heading ?? n}
|
|
119
|
+
</hasBodySlot>
|
|
120
|
+
`;
|
|
121
|
+
}), s(this, F, () => {
|
|
122
|
+
const e = r(this, C).call(this), { bodyId: o } = r(this, S).call(this);
|
|
123
|
+
return d`
|
|
124
|
+
<span
|
|
125
|
+
id=${e ? o : n}
|
|
126
|
+
class=${u(!e && `${w}no-box`)}
|
|
127
|
+
>
|
|
128
|
+
<slot name="body" @slotchange=${r(this, b)}></slot>
|
|
129
|
+
${this.hasBodySlot ? n : this.body ?? n}
|
|
130
|
+
</span>
|
|
131
|
+
`;
|
|
132
|
+
}), s(this, U, () => d`
|
|
133
|
+
<div class="${p}actions" ?hidden=${!this.hasActionSlot}>
|
|
134
|
+
<slot
|
|
135
|
+
id="actions-slot-wrapper"
|
|
136
|
+
name="actions"
|
|
137
|
+
@slotchange=${r(this, b)}
|
|
138
|
+
></slot>
|
|
139
|
+
</div>
|
|
140
|
+
`), s(this, D, () => this.dismissible ? d`<span
|
|
141
|
+
class=${u(
|
|
142
|
+
`${p}close-button`,
|
|
143
|
+
this._isContentWrapping && `${p}close-button--wrapping`
|
|
144
|
+
)}
|
|
145
|
+
>
|
|
146
|
+
<bm-close-button
|
|
147
|
+
size=${this.size}
|
|
148
|
+
@click=${r(this, A)}
|
|
149
|
+
style="display: flex;"
|
|
150
|
+
id="close-button"
|
|
151
|
+
aria-label=${pe}
|
|
152
|
+
></bm-close-button>
|
|
153
|
+
</span>` : n);
|
|
154
|
+
}
|
|
155
|
+
get hasHeadingSlot() {
|
|
156
|
+
return f(this.headingNodes);
|
|
157
|
+
}
|
|
158
|
+
get hasBodySlot() {
|
|
159
|
+
return f(this.bodyNodes);
|
|
160
|
+
}
|
|
161
|
+
get hasIconSlot() {
|
|
162
|
+
return f(this.iconNodes);
|
|
163
|
+
}
|
|
164
|
+
get hasActionSlot() {
|
|
165
|
+
return f(this.actionsNodes);
|
|
166
|
+
}
|
|
167
|
+
// ---------- Lifecycle ----------
|
|
168
|
+
connectedCallback() {
|
|
169
|
+
super.connectedCallback(), this.addEventListener("keydown", r(this, M)), H(this, B, document.activeElement);
|
|
170
|
+
}
|
|
171
|
+
disconnectedCallback() {
|
|
172
|
+
super.disconnectedCallback(), r(this, N).call(this), this.removeEventListener("keydown", r(this, M));
|
|
173
|
+
}
|
|
174
|
+
firstUpdated() {
|
|
175
|
+
r(this, z).call(this), queueMicrotask(() => {
|
|
176
|
+
var o, a;
|
|
177
|
+
(f((o = this.headingSlot) == null ? void 0 : o.assignedNodes({ flatten: !0 })) || f((a = this.bodySlot) == null ? void 0 : a.assignedNodes({ flatten: !0 }))) && r(this, b).call(this);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
updated(e) {
|
|
181
|
+
r(this, R).call(this), e.has("size") && (r(this, N).call(this), r(this, z).call(this));
|
|
182
|
+
}
|
|
183
|
+
// ---------- Main render ----------
|
|
184
|
+
render() {
|
|
185
|
+
if (this.hidden) return n;
|
|
186
|
+
const { role: e, ariaLabelledBy: o, ariaDescribedBy: a } = r(this, S).call(this), m = u(
|
|
187
|
+
he,
|
|
188
|
+
this.fullWidth && `${w}full-width`,
|
|
189
|
+
this.size && `${w}${this.size}`,
|
|
190
|
+
this.theme && ee(this.theme),
|
|
191
|
+
this.appearance && `${w}${this.appearance}`
|
|
192
|
+
);
|
|
193
|
+
return d`
|
|
194
|
+
<div
|
|
195
|
+
role=${e}
|
|
196
|
+
class=${m}
|
|
197
|
+
aria-labelledby=${o}
|
|
198
|
+
aria-describedby=${a}
|
|
199
|
+
aria-modal="false"
|
|
200
|
+
>
|
|
201
|
+
${r(this, L).call(this)}
|
|
202
|
+
<div id="content" class="${p}content__wrapper">
|
|
203
|
+
<div class="${p}content">
|
|
204
|
+
${r(this, O).call(this)} ${r(this, F).call(this)}
|
|
205
|
+
</div>
|
|
206
|
+
${r(this, U).call(this)}
|
|
207
|
+
</div>
|
|
208
|
+
${r(this, D).call(this)}
|
|
209
|
+
</div>
|
|
210
|
+
`;
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
B = /* @__PURE__ */ new WeakMap();
|
|
214
|
+
x = /* @__PURE__ */ new WeakMap();
|
|
215
|
+
C = /* @__PURE__ */ new WeakMap();
|
|
216
|
+
b = /* @__PURE__ */ new WeakMap();
|
|
217
|
+
A = /* @__PURE__ */ new WeakMap();
|
|
218
|
+
M = /* @__PURE__ */ new WeakMap();
|
|
219
|
+
R = /* @__PURE__ */ new WeakMap();
|
|
220
|
+
h = /* @__PURE__ */ new WeakMap();
|
|
221
|
+
v = /* @__PURE__ */ new WeakMap();
|
|
222
|
+
z = /* @__PURE__ */ new WeakMap();
|
|
223
|
+
N = /* @__PURE__ */ new WeakMap();
|
|
224
|
+
S = /* @__PURE__ */ new WeakMap();
|
|
225
|
+
L = /* @__PURE__ */ new WeakMap();
|
|
226
|
+
O = /* @__PURE__ */ new WeakMap();
|
|
227
|
+
F = /* @__PURE__ */ new WeakMap();
|
|
228
|
+
U = /* @__PURE__ */ new WeakMap();
|
|
229
|
+
D = /* @__PURE__ */ new WeakMap();
|
|
230
|
+
ne(t);
|
|
231
|
+
t.styles = J(be);
|
|
232
|
+
i([
|
|
233
|
+
l()
|
|
234
|
+
], t.prototype, "heading", 2);
|
|
235
|
+
i([
|
|
236
|
+
l()
|
|
237
|
+
], t.prototype, "body", 2);
|
|
238
|
+
i([
|
|
239
|
+
l({ type: String })
|
|
240
|
+
], t.prototype, "size", 2);
|
|
241
|
+
i([
|
|
242
|
+
l({ type: Boolean })
|
|
243
|
+
], t.prototype, "fullWidth", 2);
|
|
244
|
+
i([
|
|
245
|
+
l({ type: String })
|
|
246
|
+
], t.prototype, "theme", 2);
|
|
247
|
+
i([
|
|
248
|
+
l({ type: String })
|
|
249
|
+
], t.prototype, "appearance", 2);
|
|
250
|
+
i([
|
|
251
|
+
l({ type: Boolean })
|
|
252
|
+
], t.prototype, "hidden", 2);
|
|
253
|
+
i([
|
|
254
|
+
l({ type: Boolean })
|
|
255
|
+
], t.prototype, "hideIcon", 2);
|
|
256
|
+
i([
|
|
257
|
+
l({ type: Boolean })
|
|
258
|
+
], t.prototype, "dismissible", 2);
|
|
259
|
+
i([
|
|
260
|
+
l({ type: Boolean })
|
|
261
|
+
], t.prototype, "disableAutoFocus", 2);
|
|
262
|
+
i([
|
|
263
|
+
l({ type: Boolean })
|
|
264
|
+
], t.prototype, "disableCloseOnEscape", 2);
|
|
265
|
+
i([
|
|
266
|
+
P({ slot: "heading", flatten: !0 })
|
|
267
|
+
], t.prototype, "headingNodes", 2);
|
|
268
|
+
i([
|
|
269
|
+
P({ slot: "body", flatten: !0 })
|
|
270
|
+
], t.prototype, "bodyNodes", 2);
|
|
271
|
+
i([
|
|
272
|
+
P({ slot: "icon", flatten: !0 })
|
|
273
|
+
], t.prototype, "iconNodes", 2);
|
|
274
|
+
i([
|
|
275
|
+
P({ slot: "actions", flatten: !0 })
|
|
276
|
+
], t.prototype, "actionsNodes", 2);
|
|
277
|
+
i([
|
|
278
|
+
$('slot[name="heading"]')
|
|
279
|
+
], t.prototype, "headingSlot", 2);
|
|
280
|
+
i([
|
|
281
|
+
$('slot[name="body"]')
|
|
282
|
+
], t.prototype, "bodySlot", 2);
|
|
283
|
+
i([
|
|
284
|
+
X()
|
|
285
|
+
], t.prototype, "_isContentWrapping", 2);
|
|
286
|
+
i([
|
|
287
|
+
$("#content")
|
|
288
|
+
], t.prototype, "_contentRef", 2);
|
|
289
|
+
i([
|
|
290
|
+
$("#actions-slot-wrapper")
|
|
291
|
+
], t.prototype, "_actionSlotWrapperRef", 2);
|
|
292
|
+
i([
|
|
293
|
+
$("#close-button")
|
|
294
|
+
], t.prototype, "_closeButtonRef", 2);
|
|
295
|
+
t = i([
|
|
296
|
+
me("bm-alert")
|
|
297
|
+
], t);
|
|
298
|
+
export {
|
|
299
|
+
t as BmAlert
|
|
300
|
+
};
|
package/Alert/index.d.ts
ADDED
package/Alert/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { AvatarAppearance, AvatarShape, AvatarSize } from '@viasat/beam-shared/components/avatar';
|
|
3
|
+
/**
|
|
4
|
+
* `bm-avatar`
|
|
5
|
+
*
|
|
6
|
+
* @slot icon - Customize the default icon
|
|
7
|
+
*/
|
|
8
|
+
export declare class BmAvatar extends LitElement {
|
|
9
|
+
#private;
|
|
10
|
+
static styles: import('lit').CSSResult[];
|
|
11
|
+
/**
|
|
12
|
+
* Specify the appearance of the Avatar
|
|
13
|
+
*/
|
|
14
|
+
appearance?: AvatarAppearance;
|
|
15
|
+
/**
|
|
16
|
+
* Specify a name to display initials in the Avatar
|
|
17
|
+
*/
|
|
18
|
+
name?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Pass an image to the Avatar
|
|
21
|
+
*/
|
|
22
|
+
src?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Specify alt for image
|
|
25
|
+
*/
|
|
26
|
+
alt?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Specify the size of the Avatar
|
|
29
|
+
* @default 'md'
|
|
30
|
+
*/
|
|
31
|
+
size?: AvatarSize;
|
|
32
|
+
/**
|
|
33
|
+
* Specify if the Avatar is disabled
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Specify the shape of the Avatar
|
|
38
|
+
* @default 'circle'
|
|
39
|
+
*/
|
|
40
|
+
shape?: AvatarShape;
|
|
41
|
+
/**
|
|
42
|
+
* If Avatar is interactive, use `isInteractive` to make the Avatar focusable and show state layer
|
|
43
|
+
*/
|
|
44
|
+
isInteractive: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* If Avatar is not interactive and Tooltip is provided, use `isFocusable` to make the Avatar focusable
|
|
47
|
+
*/
|
|
48
|
+
isFocusable: boolean;
|
|
49
|
+
withBorder: boolean;
|
|
50
|
+
private group?;
|
|
51
|
+
connectedCallback(): void;
|
|
52
|
+
disconnectedCallback(): void;
|
|
53
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
54
|
+
}
|
|
55
|
+
declare global {
|
|
56
|
+
interface HTMLElementTagNameMap {
|
|
57
|
+
'bm-avatar': BmAvatar;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=Avatar.d.ts.map
|