@nuraly/lumenui 0.1.0 → 0.2.1
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/dist/nuralyui.bundle.js +23024 -17355
- package/dist/nuralyui.bundle.js.gz +0 -0
- package/dist/src/components/alert/alert.component.d.ts +8 -5
- package/dist/src/components/alert/alert.component.js +24 -20
- package/dist/src/components/alert/alert.style.d.ts +0 -7
- package/dist/src/components/alert/alert.style.js +48 -90
- package/dist/src/components/alert/bundle.js +82 -108
- package/dist/src/components/alert/bundle.js.gz +0 -0
- package/dist/src/components/badge/badge.component.d.ts +9 -8
- package/dist/src/components/badge/badge.component.js +17 -14
- package/dist/src/components/badge/badge.style.d.ts +0 -7
- package/dist/src/components/badge/badge.style.js +49 -107
- package/dist/src/components/badge/bundle.js +81 -119
- package/dist/src/components/badge/bundle.js.gz +0 -0
- package/dist/src/components/breadcrumb/breadcrumb.component.d.ts +8 -10
- package/dist/src/components/breadcrumb/breadcrumb.component.js +16 -15
- package/dist/src/components/breadcrumb/breadcrumb.style.d.ts +0 -7
- package/dist/src/components/breadcrumb/breadcrumb.style.js +42 -60
- package/dist/src/components/breadcrumb/bundle.js +96 -93
- package/dist/src/components/breadcrumb/bundle.js.gz +0 -0
- package/dist/src/components/button/bundle.js +221 -470
- package/dist/src/components/button/bundle.js.gz +0 -0
- package/dist/src/components/button/button.component.d.ts +2 -1
- package/dist/src/components/button/button.component.js +6 -6
- package/dist/src/components/button/button.style.d.ts +0 -7
- package/dist/src/components/button/button.style.js +167 -433
- package/dist/src/components/canvas/base-canvas.component.d.ts +2 -1
- package/dist/src/components/canvas/base-canvas.component.js +1 -0
- package/dist/src/components/canvas/bundle.js +16919 -9595
- package/dist/src/components/canvas/bundle.js.gz +0 -0
- package/dist/src/components/canvas/canvas.constants.d.ts +1 -1
- package/dist/src/components/canvas/canvas.constants.js +1 -1
- package/dist/src/components/canvas/chatbot-panel.style.js +31 -31
- package/dist/src/components/canvas/index.d.ts +2 -0
- package/dist/src/components/canvas/index.js +3 -0
- package/dist/src/components/canvas/whiteboard-canvas.component.d.ts +3 -1
- package/dist/src/components/canvas/whiteboard-canvas.component.js +19 -1
- package/dist/src/components/canvas/whiteboard-canvas.style.js +159 -138
- package/dist/src/components/canvas/whiteboard-node.component.d.ts +2 -1
- package/dist/src/components/canvas/whiteboard-node.component.js +2 -1
- package/dist/src/components/canvas/whiteboard-node.style.js +44 -44
- package/dist/src/components/canvas/workflow-canvas-only.d.ts +4 -0
- package/dist/src/components/canvas/workflow-canvas-only.js +5 -0
- package/dist/src/components/canvas/workflow-canvas.component.d.ts +3 -1
- package/dist/src/components/canvas/workflow-canvas.component.js +24 -2
- package/dist/src/components/canvas/workflow-canvas.style.js +776 -648
- package/dist/src/components/canvas/workflow-canvas.types.d.ts +113 -4
- package/dist/src/components/canvas/workflow-canvas.types.js +646 -3
- package/dist/src/components/canvas/workflow-node.component.d.ts +3 -2
- package/dist/src/components/canvas/workflow-node.component.js +5 -5
- package/dist/src/components/canvas/workflow-node.style.js +183 -181
- package/dist/src/components/card/bundle.js +43 -35
- package/dist/src/components/card/bundle.js.gz +0 -0
- package/dist/src/components/card/card.component.d.ts +6 -1
- package/dist/src/components/card/card.component.js +8 -2
- package/dist/src/components/card/card.style.js +26 -30
- package/dist/src/components/carousel/bundle.js +8 -8
- package/dist/src/components/carousel/bundle.js.gz +0 -0
- package/dist/src/components/carousel/carousel.component.d.ts +12 -0
- package/dist/src/components/carousel/carousel.component.js +16 -4
- package/dist/src/components/chatbot/bundle.js +422 -406
- package/dist/src/components/chatbot/bundle.js.gz +0 -0
- package/dist/src/components/chatbot/chatbot.component.d.ts +2 -1
- package/dist/src/components/chatbot/chatbot.component.js +1 -0
- package/dist/src/components/chatbot/chatbot.style.js +277 -277
- package/dist/src/components/checkbox/bundle.js +86 -245
- package/dist/src/components/checkbox/bundle.js.gz +0 -0
- package/dist/src/components/checkbox/checkbox.component.d.ts +5 -2
- package/dist/src/components/checkbox/checkbox.component.js +11 -13
- package/dist/src/components/checkbox/checkbox.style.js +56 -231
- package/dist/src/components/code-editor/bundle.js +151 -25
- package/dist/src/components/code-editor/bundle.js.gz +0 -0
- package/dist/src/components/code-editor/code-editor.component.d.ts +18 -56
- package/dist/src/components/code-editor/code-editor.component.js +141 -394
- package/dist/src/components/code-editor/code-editor.style.js +139 -15
- package/dist/src/components/collapse/bundle.js +97 -84
- package/dist/src/components/collapse/bundle.js.gz +0 -0
- package/dist/src/components/collapse/collapse.component.d.ts +7 -1
- package/dist/src/components/collapse/collapse.component.js +11 -2
- package/dist/src/components/collapse/collapse.style.js +60 -60
- package/dist/src/components/colorpicker/bundle.js +85 -48
- package/dist/src/components/colorpicker/bundle.js.gz +0 -0
- package/dist/src/components/colorpicker/color-holder.component.d.ts +2 -4
- package/dist/src/components/colorpicker/color-holder.component.js +5 -6
- package/dist/src/components/colorpicker/color-holder.style.js +11 -11
- package/dist/src/components/colorpicker/color-picker.component.d.ts +2 -1
- package/dist/src/components/colorpicker/color-picker.component.js +1 -0
- package/dist/src/components/colorpicker/color-picker.style.js +12 -12
- package/dist/src/components/colorpicker/default-color-sets.component.d.ts +2 -2
- package/dist/src/components/colorpicker/default-color-sets.component.js +4 -3
- package/dist/src/components/colorpicker/default-color-sets.style.js +5 -5
- package/dist/src/components/container/bundle.js +24 -14
- package/dist/src/components/container/bundle.js.gz +0 -0
- package/dist/src/components/container/container.component.d.ts +4 -1
- package/dist/src/components/container/container.component.js +7 -5
- package/dist/src/components/container/container.style.js +9 -9
- package/dist/src/components/datepicker/bundle.js +193 -177
- package/dist/src/components/datepicker/bundle.js.gz +0 -0
- package/dist/src/components/datepicker/datepicker.component.d.ts +2 -1
- package/dist/src/components/datepicker/datepicker.component.js +1 -0
- package/dist/src/components/datepicker/datepicker.style.js +65 -65
- package/dist/src/components/datepicker/datepicker.style.variables.js +91 -91
- package/dist/src/components/db-connection-select/bundle.js +7 -6
- package/dist/src/components/db-connection-select/bundle.js.gz +0 -0
- package/dist/src/components/db-connection-select/db-connection-select.component.d.ts +3 -0
- package/dist/src/components/db-connection-select/db-connection-select.component.js +4 -0
- package/dist/src/components/divider/bundle.js +61 -35
- package/dist/src/components/divider/bundle.js.gz +0 -0
- package/dist/src/components/divider/divider.component.d.ts +4 -6
- package/dist/src/components/divider/divider.component.js +10 -14
- package/dist/src/components/divider/divider.style.js +41 -31
- package/dist/src/components/document/bundle.js +50 -48
- package/dist/src/components/document/bundle.js.gz +0 -0
- package/dist/src/components/document/document.component.d.ts +12 -1
- package/dist/src/components/document/document.component.js +18 -6
- package/dist/src/components/document/document.style.js +21 -36
- package/dist/src/components/dropdown/bundle.js +117 -101
- package/dist/src/components/dropdown/bundle.js.gz +0 -0
- package/dist/src/components/dropdown/dropdown.component.d.ts +2 -1
- package/dist/src/components/dropdown/dropdown.component.js +1 -0
- package/dist/src/components/dropdown/dropdown.style.js +68 -68
- package/dist/src/components/file-upload/bundle.js +82 -76
- package/dist/src/components/file-upload/bundle.js.gz +0 -0
- package/dist/src/components/file-upload/file-upload.component.d.ts +2 -1
- package/dist/src/components/file-upload/file-upload.component.js +1 -0
- package/dist/src/components/file-upload/styles.js +59 -59
- package/dist/src/components/flex/bundle.js +18 -8
- package/dist/src/components/flex/bundle.js.gz +0 -0
- package/dist/src/components/flex/flex.component.d.ts +4 -1
- package/dist/src/components/flex/flex.component.js +7 -4
- package/dist/src/components/flex/flex.style.js +2 -2
- package/dist/src/components/form/bundle.js +22 -10
- package/dist/src/components/form/bundle.js.gz +0 -0
- package/dist/src/components/form/form.component.d.ts +4 -1
- package/dist/src/components/form/form.component.js +5 -1
- package/dist/src/components/form/form.style.js +2 -2
- package/dist/src/components/grid/bundle.js +26 -14
- package/dist/src/components/grid/bundle.js.gz +0 -0
- package/dist/src/components/grid/col.component.d.ts +4 -1
- package/dist/src/components/grid/col.component.js +4 -1
- package/dist/src/components/grid/col.style.js +2 -2
- package/dist/src/components/grid/row.component.d.ts +4 -1
- package/dist/src/components/grid/row.component.js +4 -1
- package/dist/src/components/grid/row.style.js +2 -2
- package/dist/src/components/icon/bundle.js +78 -252
- package/dist/src/components/icon/bundle.js.gz +0 -0
- package/dist/src/components/icon/icon-paths.d.ts +2 -0
- package/dist/src/components/icon/icon-paths.js +141 -0
- package/dist/src/components/icon/icon.component.d.ts +10 -12
- package/dist/src/components/icon/icon.component.js +42 -93
- package/dist/src/components/icon/icon.style.js +42 -130
- package/dist/src/components/icon/icon.variables.js +9 -9
- package/dist/src/components/iconpicker/bundle.js +859 -1511
- package/dist/src/components/iconpicker/bundle.js.gz +0 -0
- package/dist/src/components/iconpicker/icon-picker.component.d.ts +2 -1
- package/dist/src/components/iconpicker/icon-picker.component.js +1 -0
- package/dist/src/components/iconpicker/icon-picker.style.js +13 -13
- package/dist/src/components/image/bundle.js +43 -33
- package/dist/src/components/image/bundle.js.gz +0 -0
- package/dist/src/components/image/image.component.d.ts +10 -1
- package/dist/src/components/image/image.component.js +13 -3
- package/dist/src/components/image/image.style.js +19 -26
- package/dist/src/components/input/bundle.js +420 -644
- package/dist/src/components/input/bundle.js.gz +0 -0
- package/dist/src/components/input/input.component.d.ts +16 -3
- package/dist/src/components/input/input.component.js +43 -27
- package/dist/src/components/input/input.style.d.ts +1 -1
- package/dist/src/components/input/input.style.js +331 -634
- package/dist/src/components/kv-secret-select/bundle.js +2 -1
- package/dist/src/components/kv-secret-select/bundle.js.gz +0 -0
- package/dist/src/components/kv-secret-select/kv-secret-select.component.d.ts +3 -0
- package/dist/src/components/kv-secret-select/kv-secret-select.component.js +4 -0
- package/dist/src/components/label/bundle.js +37 -60
- package/dist/src/components/label/bundle.js.gz +0 -0
- package/dist/src/components/label/label.component.d.ts +8 -4
- package/dist/src/components/label/label.component.js +9 -14
- package/dist/src/components/label/label.style.js +17 -25
- package/dist/src/components/label/label.style.variables.js +18 -18
- package/dist/src/components/layout/bundle.js +86 -70
- package/dist/src/components/layout/bundle.js.gz +0 -0
- package/dist/src/components/layout/content.component.d.ts +2 -1
- package/dist/src/components/layout/content.component.js +2 -1
- package/dist/src/components/layout/content.style.js +3 -3
- package/dist/src/components/layout/footer.component.d.ts +2 -1
- package/dist/src/components/layout/footer.component.js +3 -2
- package/dist/src/components/layout/footer.style.js +7 -7
- package/dist/src/components/layout/header.component.d.ts +2 -1
- package/dist/src/components/layout/header.component.js +3 -2
- package/dist/src/components/layout/header.style.js +7 -7
- package/dist/src/components/layout/layout.component.d.ts +4 -7
- package/dist/src/components/layout/layout.component.js +9 -22
- package/dist/src/components/layout/layout.style.js +1 -1
- package/dist/src/components/layout/sider.component.d.ts +3 -1
- package/dist/src/components/layout/sider.component.js +3 -1
- package/dist/src/components/layout/sider.style.js +29 -29
- package/dist/src/components/menu/bundle.js +135 -125
- package/dist/src/components/menu/bundle.js.gz +0 -0
- package/dist/src/components/menu/menu.component.d.ts +2 -1
- package/dist/src/components/menu/menu.component.js +1 -0
- package/dist/src/components/menu/menu.style.js +87 -87
- package/dist/src/components/modal/bundle.js +105 -96
- package/dist/src/components/modal/bundle.js.gz +0 -0
- package/dist/src/components/modal/modal.component.d.ts +2 -1
- package/dist/src/components/modal/modal.component.js +1 -0
- package/dist/src/components/modal/modal.style.js +69 -71
- package/dist/src/components/panel/bundle.js +190 -391
- package/dist/src/components/panel/bundle.js.gz +0 -0
- package/dist/src/components/panel/panel.component.d.ts +2 -1
- package/dist/src/components/panel/panel.component.js +1 -0
- package/dist/src/components/panel/panel.style.js +65 -65
- package/dist/src/components/popconfirm/bundle.js +107 -93
- package/dist/src/components/popconfirm/bundle.js.gz +0 -0
- package/dist/src/components/popconfirm/popconfirm-manager.component.d.ts +2 -1
- package/dist/src/components/popconfirm/popconfirm-manager.component.js +1 -0
- package/dist/src/components/popconfirm/popconfirm-manager.style.js +16 -16
- package/dist/src/components/popconfirm/popconfirm.component.d.ts +2 -1
- package/dist/src/components/popconfirm/popconfirm.component.js +9 -5
- package/dist/src/components/popconfirm/popconfirm.style.js +43 -43
- package/dist/src/components/radio/bundle.js +56 -86
- package/dist/src/components/radio/bundle.js.gz +0 -0
- package/dist/src/components/radio/radio.component.d.ts +8 -2
- package/dist/src/components/radio/radio.component.js +17 -9
- package/dist/src/components/radio/radio.style.js +30 -77
- package/dist/src/components/radio-group/bundle.js +125 -89
- package/dist/src/components/radio-group/bundle.js.gz +0 -0
- package/dist/src/components/radio-group/radio-group.component.d.ts +5 -1
- package/dist/src/components/radio-group/radio-group.component.js +18 -10
- package/dist/src/components/radio-group/radio-group.style.js +44 -44
- package/dist/src/components/select/bundle.js +260 -367
- package/dist/src/components/select/bundle.js.gz +0 -0
- package/dist/src/components/select/select.component.d.ts +12 -17
- package/dist/src/components/select/select.component.js +35 -35
- package/dist/src/components/select/select.style.js +184 -324
- package/dist/src/components/skeleton/bundle.js +82 -162
- package/dist/src/components/skeleton/bundle.js.gz +0 -0
- package/dist/src/components/skeleton/skeleton.component.d.ts +10 -5
- package/dist/src/components/skeleton/skeleton.component.js +20 -7
- package/dist/src/components/skeleton/skeleton.style.js +34 -133
- package/dist/src/components/slider-input/bundle.js +89 -88
- package/dist/src/components/slider-input/bundle.js.gz +0 -0
- package/dist/src/components/slider-input/slider-input.component.d.ts +11 -0
- package/dist/src/components/slider-input/slider-input.component.js +20 -8
- package/dist/src/components/slider-input/slider-input.style.js +47 -47
- package/dist/src/components/slider-input/slider-input.style.variables.js +32 -32
- package/dist/src/components/table/bundle.js +149 -128
- package/dist/src/components/table/bundle.js.gz +0 -0
- package/dist/src/components/table/table.component.d.ts +2 -1
- package/dist/src/components/table/table.component.js +1 -0
- package/dist/src/components/table/table.style.js +79 -79
- package/dist/src/components/tabs/bundle.js +462 -663
- package/dist/src/components/tabs/bundle.js.gz +0 -0
- package/dist/src/components/tabs/tabs.component.d.ts +6 -1
- package/dist/src/components/tabs/tabs.component.js +8 -1
- package/dist/src/components/tabs/tabs.style.js +200 -201
- package/dist/src/components/tag/bundle.js +44 -36
- package/dist/src/components/tag/bundle.js.gz +0 -0
- package/dist/src/components/tag/tag.component.d.ts +7 -6
- package/dist/src/components/tag/tag.component.js +10 -19
- package/dist/src/components/tag/tag.style.js +20 -24
- package/dist/src/components/textarea/bundle.js +131 -94
- package/dist/src/components/textarea/bundle.js.gz +0 -0
- package/dist/src/components/textarea/textarea.component.d.ts +7 -1
- package/dist/src/components/textarea/textarea.component.js +10 -3
- package/dist/src/components/textarea/textarea.style.d.ts +1 -13
- package/dist/src/components/textarea/textarea.style.js +79 -91
- package/dist/src/components/timeline/bundle.js +71 -134
- package/dist/src/components/timeline/bundle.js.gz +0 -0
- package/dist/src/components/timeline/timeline.component.d.ts +9 -6
- package/dist/src/components/timeline/timeline.component.js +16 -13
- package/dist/src/components/timeline/timeline.style.d.ts +0 -7
- package/dist/src/components/timeline/timeline.style.js +41 -122
- package/dist/src/components/timepicker/bundle.js +196 -166
- package/dist/src/components/timepicker/bundle.js.gz +0 -0
- package/dist/src/components/timepicker/timepicker.component.d.ts +2 -1
- package/dist/src/components/timepicker/timepicker.component.js +1 -0
- package/dist/src/components/timepicker/timepicker.style.js +42 -42
- package/dist/src/components/timepicker/timepicker.style.variables.js +91 -91
- package/dist/src/components/toast/bundle.js +97 -81
- package/dist/src/components/toast/bundle.js.gz +0 -0
- package/dist/src/components/toast/toast.component.d.ts +2 -1
- package/dist/src/components/toast/toast.component.js +1 -0
- package/dist/src/components/toast/toast.style.js +62 -62
- package/dist/src/components/tooltips/bundle.js +10 -10
- package/dist/src/components/tooltips/bundle.js.gz +0 -0
- package/dist/src/components/tooltips/tooltips.component.d.ts +8 -0
- package/dist/src/components/tooltips/tooltips.component.js +9 -1
- package/dist/src/components/tooltips/tooltips.style.js +6 -6
- package/dist/src/components/video/bundle.js +47 -36
- package/dist/src/components/video/bundle.js.gz +0 -0
- package/dist/src/components/video/video.component.d.ts +12 -1
- package/dist/src/components/video/video.component.js +18 -6
- package/dist/src/components/video/video.style.js +18 -24
- package/package.json +25 -12
- package/packages/common/dist/VERSIONS.md +2 -2
- package/packages/common/dist/shared/base-mixin.d.ts +21 -19
- package/packages/common/dist/shared/base-mixin.d.ts.map +1 -1
- package/packages/common/dist/shared/base-mixin.js +102 -18
- package/packages/common/dist/shared/base-mixin.js.map +1 -1
- package/packages/common/dist/shared/index.d.ts +1 -0
- package/packages/common/dist/shared/index.d.ts.map +1 -1
- package/packages/common/dist/shared/index.js +2 -0
- package/packages/common/dist/shared/index.js.map +1 -1
- package/packages/common/dist/shared/style-injector.d.ts +11 -0
- package/packages/common/dist/shared/style-injector.d.ts.map +1 -0
- package/packages/common/dist/shared/style-injector.js +53 -0
- package/packages/common/dist/shared/style-injector.js.map +1 -0
- package/packages/common/dist/shared/theme-mixin.d.ts +2 -24
- package/packages/common/dist/shared/theme-mixin.d.ts.map +1 -1
- package/packages/common/dist/shared/theme-mixin.js +5 -38
- package/packages/common/dist/shared/theme-mixin.js.map +1 -1
- package/packages/themes/dist/default.css +0 -10
- package/packages/themes/dist/package.json +1 -1
|
Binary file
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { LitElement, nothing } from 'lit';
|
|
7
7
|
import { AlertType } from './alert.types.js';
|
|
8
|
-
declare const NrAlertElement_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & typeof LitElement;
|
|
8
|
+
declare const NrAlertElement_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & (new (...args: any[]) => import("packages/common/src/shared/base-mixin.js").LightDomContent) & typeof LitElement;
|
|
9
9
|
/**
|
|
10
10
|
* Alert component for displaying important messages.
|
|
11
11
|
*
|
|
@@ -50,13 +50,16 @@ declare const NrAlertElement_base: (new (...args: any[]) => import("@nuralyui/co
|
|
|
50
50
|
* @slot icon - Custom icon slot
|
|
51
51
|
* @slot action - Custom action buttons or links
|
|
52
52
|
*
|
|
53
|
-
* @
|
|
54
|
-
* @
|
|
55
|
-
* @
|
|
56
|
-
* @
|
|
53
|
+
* @csspart alert - The root alert container element
|
|
54
|
+
* @csspart icon - The icon wrapper div (visible when show-icon is true)
|
|
55
|
+
* @csspart content - The content area holding message, description, and slots
|
|
56
|
+
* @csspart message - The message text element
|
|
57
|
+
* @csspart description - The description text element
|
|
58
|
+
* @csspart close - The close button (visible when closable is true)
|
|
57
59
|
*/
|
|
58
60
|
export declare class NrAlertElement extends NrAlertElement_base {
|
|
59
61
|
static styles: import("lit").CSSResult;
|
|
62
|
+
static useShadowDom: boolean;
|
|
60
63
|
requiredComponents: string[];
|
|
61
64
|
/** Alert message text */
|
|
62
65
|
message: string;
|
|
@@ -59,10 +59,12 @@ import { EMPTY_STRING } from './alert.types.js';
|
|
|
59
59
|
* @slot icon - Custom icon slot
|
|
60
60
|
* @slot action - Custom action buttons or links
|
|
61
61
|
*
|
|
62
|
-
* @
|
|
63
|
-
* @
|
|
64
|
-
* @
|
|
65
|
-
* @
|
|
62
|
+
* @csspart alert - The root alert container element
|
|
63
|
+
* @csspart icon - The icon wrapper div (visible when show-icon is true)
|
|
64
|
+
* @csspart content - The content area holding message, description, and slots
|
|
65
|
+
* @csspart message - The message text element
|
|
66
|
+
* @csspart description - The description text element
|
|
67
|
+
* @csspart close - The close button (visible when closable is true)
|
|
66
68
|
*/
|
|
67
69
|
let NrAlertElement = class NrAlertElement extends NuralyUIBaseMixin(LitElement) {
|
|
68
70
|
constructor() {
|
|
@@ -150,34 +152,35 @@ let NrAlertElement = class NrAlertElement extends NuralyUIBaseMixin(LitElement)
|
|
|
150
152
|
'alert--closing': this.closing,
|
|
151
153
|
};
|
|
152
154
|
return html `
|
|
153
|
-
<div class=${classMap(classes)} role="alert">
|
|
155
|
+
<div part="alert" class=${classMap(classes)} role="alert">
|
|
154
156
|
${this.showIcon ? html `
|
|
155
|
-
<div class="alert__icon">
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
<div part="icon" class="alert__icon">
|
|
158
|
+
${this.querySelector('[slot="icon"]') !== null
|
|
159
|
+
? html `<slot name="icon"></slot>`
|
|
160
|
+
: html `<nr-icon
|
|
161
|
+
name=${this.getDefaultIcon()}
|
|
162
|
+
size=${this.hasDescription() ? 'large' : 'small'}
|
|
163
|
+
></nr-icon>`}
|
|
162
164
|
</div>
|
|
163
165
|
` : nothing}
|
|
164
|
-
|
|
165
|
-
<div class="alert__content">
|
|
166
|
+
|
|
167
|
+
<div part="content" class="alert__content">
|
|
166
168
|
${this.message ? html `
|
|
167
|
-
<div class="alert__message">${this.message}</div>
|
|
169
|
+
<div part="message" class="alert__message">${this.message}</div>
|
|
168
170
|
` : nothing}
|
|
169
|
-
|
|
171
|
+
|
|
170
172
|
${this.description ? html `
|
|
171
|
-
<div class="alert__description">${this.description}</div>
|
|
173
|
+
<div part="description" class="alert__description">${this.description}</div>
|
|
172
174
|
` : nothing}
|
|
173
|
-
|
|
175
|
+
|
|
174
176
|
<slot></slot>
|
|
175
|
-
|
|
177
|
+
|
|
176
178
|
<slot name="action"></slot>
|
|
177
179
|
</div>
|
|
178
|
-
|
|
180
|
+
|
|
179
181
|
${this.closable ? html `
|
|
180
182
|
<button
|
|
183
|
+
part="close"
|
|
181
184
|
class="alert__close"
|
|
182
185
|
@click=${this.handleCloseClick}
|
|
183
186
|
aria-label="Close alert"
|
|
@@ -191,6 +194,7 @@ let NrAlertElement = class NrAlertElement extends NuralyUIBaseMixin(LitElement)
|
|
|
191
194
|
}
|
|
192
195
|
};
|
|
193
196
|
NrAlertElement.styles = styles;
|
|
197
|
+
NrAlertElement.useShadowDom = true;
|
|
194
198
|
__decorate([
|
|
195
199
|
property({ type: String })
|
|
196
200
|
], NrAlertElement.prototype, "message", void 0);
|
|
@@ -3,12 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* Alert component styles for the Hybrid UI Library
|
|
8
|
-
* Using shared CSS variables from /src/shared/themes/
|
|
9
|
-
*
|
|
10
|
-
* This file contains all the styling for the nr-alert component with
|
|
11
|
-
* clean CSS variable usage without local fallbacks and proper theme switching support.
|
|
12
|
-
*/
|
|
13
6
|
export declare const styles: import("lit").CSSResult;
|
|
14
7
|
//# sourceMappingURL=alert.style.d.ts.map
|
|
@@ -4,19 +4,12 @@
|
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
*/
|
|
6
6
|
import { css } from 'lit';
|
|
7
|
-
/**
|
|
8
|
-
* Alert component styles for the Hybrid UI Library
|
|
9
|
-
* Using shared CSS variables from /src/shared/themes/
|
|
10
|
-
*
|
|
11
|
-
* This file contains all the styling for the nr-alert component with
|
|
12
|
-
* clean CSS variable usage without local fallbacks and proper theme switching support.
|
|
13
|
-
*/
|
|
14
7
|
export const styles = css `
|
|
15
8
|
:host {
|
|
16
9
|
display: block;
|
|
17
|
-
font-family:
|
|
18
|
-
font-size:
|
|
19
|
-
line-height:
|
|
10
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
11
|
+
font-size: 0.875rem;
|
|
12
|
+
line-height: 1.5;
|
|
20
13
|
}
|
|
21
14
|
|
|
22
15
|
:host([hidden]) {
|
|
@@ -27,11 +20,11 @@ export const styles = css `
|
|
|
27
20
|
position: relative;
|
|
28
21
|
display: flex;
|
|
29
22
|
align-items: flex-start;
|
|
30
|
-
gap:
|
|
31
|
-
padding:
|
|
23
|
+
gap: 0.5rem;
|
|
24
|
+
padding: 0.5rem 0.75rem;
|
|
32
25
|
border: 1px solid transparent;
|
|
33
|
-
border-radius:
|
|
34
|
-
transition:
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
transition: all 0.3s ease;
|
|
35
28
|
}
|
|
36
29
|
|
|
37
30
|
.alert--banner {
|
|
@@ -40,55 +33,42 @@ export const styles = css `
|
|
|
40
33
|
border-right: none;
|
|
41
34
|
}
|
|
42
35
|
|
|
43
|
-
/*
|
|
36
|
+
/* Success */
|
|
44
37
|
.alert--success {
|
|
45
|
-
background-color:
|
|
46
|
-
border-color:
|
|
47
|
-
color:
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.alert--success .alert__icon {
|
|
51
|
-
color: var(--nuraly-color-success, #52c41a);
|
|
38
|
+
background-color: #f6ffed;
|
|
39
|
+
border-color: #52c41a;
|
|
40
|
+
color: #389e0d;
|
|
52
41
|
}
|
|
42
|
+
.alert--success .alert__icon { color: #52c41a; }
|
|
53
43
|
|
|
54
|
-
/*
|
|
44
|
+
/* Info */
|
|
55
45
|
.alert--info {
|
|
56
|
-
background-color:
|
|
57
|
-
border-color:
|
|
58
|
-
color:
|
|
46
|
+
background-color: #e6f7ff;
|
|
47
|
+
border-color: #1890ff;
|
|
48
|
+
color: #096dd9;
|
|
59
49
|
}
|
|
50
|
+
.alert--info .alert__icon { color: #1890ff; }
|
|
60
51
|
|
|
61
|
-
|
|
62
|
-
color: var(--nuraly-color-info, #1890ff);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/* Alert type variants - Warning */
|
|
52
|
+
/* Warning */
|
|
66
53
|
.alert--warning {
|
|
67
|
-
background-color:
|
|
68
|
-
border-color:
|
|
69
|
-
color:
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.alert--warning .alert__icon {
|
|
73
|
-
color: var(--nuraly-color-warning, #faad14);
|
|
54
|
+
background-color: #fffbe6;
|
|
55
|
+
border-color: #faad14;
|
|
56
|
+
color: #d48806;
|
|
74
57
|
}
|
|
58
|
+
.alert--warning .alert__icon { color: #faad14; }
|
|
75
59
|
|
|
76
|
-
/*
|
|
60
|
+
/* Error */
|
|
77
61
|
.alert--error {
|
|
78
|
-
background-color:
|
|
79
|
-
border-color:
|
|
80
|
-
color:
|
|
62
|
+
background-color: #fff2f0;
|
|
63
|
+
border-color: #ff4d4f;
|
|
64
|
+
color: #cf1322;
|
|
81
65
|
}
|
|
66
|
+
.alert--error .alert__icon { color: #ff4d4f; }
|
|
82
67
|
|
|
83
|
-
|
|
84
|
-
color: var(--nuraly-color-error, #ff4d4f);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* Alert with description */
|
|
68
|
+
/* With description */
|
|
88
69
|
.alert--with-description {
|
|
89
|
-
padding:
|
|
70
|
+
padding: 0.75rem 1rem;
|
|
90
71
|
}
|
|
91
|
-
|
|
92
72
|
.alert--with-description .alert__icon {
|
|
93
73
|
font-size: 1.5rem;
|
|
94
74
|
}
|
|
@@ -108,20 +88,20 @@ export const styles = css `
|
|
|
108
88
|
}
|
|
109
89
|
|
|
110
90
|
.alert__message {
|
|
111
|
-
font-weight:
|
|
91
|
+
font-weight: 500;
|
|
112
92
|
margin: 0;
|
|
113
|
-
line-height:
|
|
93
|
+
line-height: 1.5;
|
|
114
94
|
}
|
|
115
95
|
|
|
116
96
|
.alert--with-description .alert__message {
|
|
117
|
-
font-size:
|
|
118
|
-
margin-bottom:
|
|
97
|
+
font-size: 1.125rem;
|
|
98
|
+
margin-bottom: 0.25rem;
|
|
119
99
|
}
|
|
120
100
|
|
|
121
101
|
.alert__description {
|
|
122
|
-
margin:
|
|
123
|
-
font-size:
|
|
124
|
-
line-height:
|
|
102
|
+
margin: 0.25rem 0 0;
|
|
103
|
+
font-size: 0.875rem;
|
|
104
|
+
line-height: 1.6;
|
|
125
105
|
opacity: 0.85;
|
|
126
106
|
}
|
|
127
107
|
|
|
@@ -137,55 +117,33 @@ export const styles = css `
|
|
|
137
117
|
justify-content: center;
|
|
138
118
|
color: currentColor;
|
|
139
119
|
opacity: 0.6;
|
|
140
|
-
transition: opacity
|
|
120
|
+
transition: opacity 0.15s ease;
|
|
141
121
|
line-height: 1;
|
|
142
122
|
}
|
|
143
123
|
|
|
144
|
-
.alert__close:hover {
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.alert__close:focus {
|
|
149
|
-
outline: none;
|
|
150
|
-
opacity: 1;
|
|
151
|
-
}
|
|
152
|
-
|
|
124
|
+
.alert__close:hover { opacity: 1; }
|
|
125
|
+
.alert__close:focus { outline: none; opacity: 1; }
|
|
153
126
|
.alert__close:focus-visible {
|
|
154
127
|
outline: 2px solid currentColor;
|
|
155
128
|
outline-offset: 2px;
|
|
156
|
-
border-radius:
|
|
129
|
+
border-radius: 2px;
|
|
157
130
|
}
|
|
158
131
|
|
|
159
|
-
/*
|
|
160
|
-
@keyframes alertFadeOut {
|
|
161
|
-
from {
|
|
162
|
-
|
|
163
|
-
max-height: 200px;
|
|
164
|
-
}
|
|
165
|
-
to {
|
|
166
|
-
opacity: 0;
|
|
167
|
-
max-height: 0;
|
|
168
|
-
padding-top: 0;
|
|
169
|
-
padding-bottom: 0;
|
|
170
|
-
margin-top: 0;
|
|
171
|
-
margin-bottom: 0;
|
|
172
|
-
}
|
|
132
|
+
/* Closing animation */
|
|
133
|
+
@keyframes nr-alertFadeOut {
|
|
134
|
+
from { opacity: 1; max-height: 200px; }
|
|
135
|
+
to { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; }
|
|
173
136
|
}
|
|
174
137
|
|
|
175
138
|
.alert--closing {
|
|
176
|
-
animation: alertFadeOut 0.3s ease forwards;
|
|
139
|
+
animation: nr-alertFadeOut 0.3s ease forwards;
|
|
177
140
|
overflow: hidden;
|
|
178
141
|
}
|
|
179
142
|
|
|
180
|
-
/* Responsive
|
|
143
|
+
/* Responsive */
|
|
181
144
|
@media (max-width: 768px) {
|
|
182
|
-
.alert {
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.alert--with-description {
|
|
187
|
-
padding: var(--nuraly-spacing-3) var(--nuraly-spacing-4);
|
|
188
|
-
}
|
|
145
|
+
.alert { padding: 0.5rem 0.75rem; }
|
|
146
|
+
.alert--with-description { padding: 0.75rem 1rem; }
|
|
189
147
|
}
|
|
190
148
|
`;
|
|
191
149
|
//# sourceMappingURL=alert.style.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{css as
|
|
1
|
+
import{css as e,nothing as t,html as i,LitElement as r}from"lit";import{property as s,state as o,customElement as n}from"lit/decorators.js";import{classMap as a}from"lit/directives/class-map.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
6
|
-
*/const
|
|
6
|
+
*/const l=e`
|
|
7
7
|
:host {
|
|
8
8
|
display: block;
|
|
9
|
-
font-family:
|
|
10
|
-
font-size:
|
|
11
|
-
line-height:
|
|
9
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
10
|
+
font-size: 0.875rem;
|
|
11
|
+
line-height: 1.5;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:host([hidden]) {
|
|
@@ -19,11 +19,11 @@ import{css as r,LitElement as e,nothing as t,html as a}from"lit";import{property
|
|
|
19
19
|
position: relative;
|
|
20
20
|
display: flex;
|
|
21
21
|
align-items: flex-start;
|
|
22
|
-
gap:
|
|
23
|
-
padding:
|
|
22
|
+
gap: 0.5rem;
|
|
23
|
+
padding: 0.5rem 0.75rem;
|
|
24
24
|
border: 1px solid transparent;
|
|
25
|
-
border-radius:
|
|
26
|
-
transition:
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
transition: all 0.3s ease;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.alert--banner {
|
|
@@ -32,55 +32,42 @@ import{css as r,LitElement as e,nothing as t,html as a}from"lit";import{property
|
|
|
32
32
|
border-right: none;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
/*
|
|
35
|
+
/* Success */
|
|
36
36
|
.alert--success {
|
|
37
|
-
background-color:
|
|
38
|
-
border-color:
|
|
39
|
-
color:
|
|
37
|
+
background-color: #f6ffed;
|
|
38
|
+
border-color: #52c41a;
|
|
39
|
+
color: #389e0d;
|
|
40
40
|
}
|
|
41
|
+
.alert--success .alert__icon { color: #52c41a; }
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
color: var(--nuraly-color-success, #52c41a);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* Alert type variants - Info */
|
|
43
|
+
/* Info */
|
|
47
44
|
.alert--info {
|
|
48
|
-
background-color:
|
|
49
|
-
border-color:
|
|
50
|
-
color:
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.alert--info .alert__icon {
|
|
54
|
-
color: var(--nuraly-color-info, #1890ff);
|
|
45
|
+
background-color: #e6f7ff;
|
|
46
|
+
border-color: #1890ff;
|
|
47
|
+
color: #096dd9;
|
|
55
48
|
}
|
|
49
|
+
.alert--info .alert__icon { color: #1890ff; }
|
|
56
50
|
|
|
57
|
-
/*
|
|
51
|
+
/* Warning */
|
|
58
52
|
.alert--warning {
|
|
59
|
-
background-color:
|
|
60
|
-
border-color:
|
|
61
|
-
color:
|
|
53
|
+
background-color: #fffbe6;
|
|
54
|
+
border-color: #faad14;
|
|
55
|
+
color: #d48806;
|
|
62
56
|
}
|
|
57
|
+
.alert--warning .alert__icon { color: #faad14; }
|
|
63
58
|
|
|
64
|
-
|
|
65
|
-
color: var(--nuraly-color-warning, #faad14);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/* Alert type variants - Error */
|
|
59
|
+
/* Error */
|
|
69
60
|
.alert--error {
|
|
70
|
-
background-color:
|
|
71
|
-
border-color:
|
|
72
|
-
color:
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.alert--error .alert__icon {
|
|
76
|
-
color: var(--nuraly-color-error, #ff4d4f);
|
|
61
|
+
background-color: #fff2f0;
|
|
62
|
+
border-color: #ff4d4f;
|
|
63
|
+
color: #cf1322;
|
|
77
64
|
}
|
|
65
|
+
.alert--error .alert__icon { color: #ff4d4f; }
|
|
78
66
|
|
|
79
|
-
/*
|
|
67
|
+
/* With description */
|
|
80
68
|
.alert--with-description {
|
|
81
|
-
padding:
|
|
69
|
+
padding: 0.75rem 1rem;
|
|
82
70
|
}
|
|
83
|
-
|
|
84
71
|
.alert--with-description .alert__icon {
|
|
85
72
|
font-size: 1.5rem;
|
|
86
73
|
}
|
|
@@ -100,20 +87,20 @@ import{css as r,LitElement as e,nothing as t,html as a}from"lit";import{property
|
|
|
100
87
|
}
|
|
101
88
|
|
|
102
89
|
.alert__message {
|
|
103
|
-
font-weight:
|
|
90
|
+
font-weight: 500;
|
|
104
91
|
margin: 0;
|
|
105
|
-
line-height:
|
|
92
|
+
line-height: 1.5;
|
|
106
93
|
}
|
|
107
94
|
|
|
108
95
|
.alert--with-description .alert__message {
|
|
109
|
-
font-size:
|
|
110
|
-
margin-bottom:
|
|
96
|
+
font-size: 1.125rem;
|
|
97
|
+
margin-bottom: 0.25rem;
|
|
111
98
|
}
|
|
112
99
|
|
|
113
100
|
.alert__description {
|
|
114
|
-
margin:
|
|
115
|
-
font-size:
|
|
116
|
-
line-height:
|
|
101
|
+
margin: 0.25rem 0 0;
|
|
102
|
+
font-size: 0.875rem;
|
|
103
|
+
line-height: 1.6;
|
|
117
104
|
opacity: 0.85;
|
|
118
105
|
}
|
|
119
106
|
|
|
@@ -129,96 +116,83 @@ import{css as r,LitElement as e,nothing as t,html as a}from"lit";import{property
|
|
|
129
116
|
justify-content: center;
|
|
130
117
|
color: currentColor;
|
|
131
118
|
opacity: 0.6;
|
|
132
|
-
transition: opacity
|
|
119
|
+
transition: opacity 0.15s ease;
|
|
133
120
|
line-height: 1;
|
|
134
121
|
}
|
|
135
122
|
|
|
136
|
-
.alert__close:hover {
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.alert__close:focus {
|
|
141
|
-
outline: none;
|
|
142
|
-
opacity: 1;
|
|
143
|
-
}
|
|
144
|
-
|
|
123
|
+
.alert__close:hover { opacity: 1; }
|
|
124
|
+
.alert__close:focus { outline: none; opacity: 1; }
|
|
145
125
|
.alert__close:focus-visible {
|
|
146
126
|
outline: 2px solid currentColor;
|
|
147
127
|
outline-offset: 2px;
|
|
148
|
-
border-radius:
|
|
128
|
+
border-radius: 2px;
|
|
149
129
|
}
|
|
150
130
|
|
|
151
|
-
/*
|
|
152
|
-
@keyframes alertFadeOut {
|
|
153
|
-
from {
|
|
154
|
-
|
|
155
|
-
max-height: 200px;
|
|
156
|
-
}
|
|
157
|
-
to {
|
|
158
|
-
opacity: 0;
|
|
159
|
-
max-height: 0;
|
|
160
|
-
padding-top: 0;
|
|
161
|
-
padding-bottom: 0;
|
|
162
|
-
margin-top: 0;
|
|
163
|
-
margin-bottom: 0;
|
|
164
|
-
}
|
|
131
|
+
/* Closing animation */
|
|
132
|
+
@keyframes nr-alertFadeOut {
|
|
133
|
+
from { opacity: 1; max-height: 200px; }
|
|
134
|
+
to { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; }
|
|
165
135
|
}
|
|
166
136
|
|
|
167
137
|
.alert--closing {
|
|
168
|
-
animation: alertFadeOut 0.3s ease forwards;
|
|
138
|
+
animation: nr-alertFadeOut 0.3s ease forwards;
|
|
169
139
|
overflow: hidden;
|
|
170
140
|
}
|
|
171
141
|
|
|
172
|
-
/* Responsive
|
|
142
|
+
/* Responsive */
|
|
173
143
|
@media (max-width: 768px) {
|
|
174
|
-
.alert {
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.alert--with-description {
|
|
179
|
-
padding: var(--nuraly-spacing-3) var(--nuraly-spacing-4);
|
|
180
|
-
}
|
|
144
|
+
.alert { padding: 0.5rem 0.75rem; }
|
|
145
|
+
.alert--with-description { padding: 0.75rem 1rem; }
|
|
181
146
|
}
|
|
182
147
|
`
|
|
183
148
|
/**
|
|
184
149
|
* @license
|
|
185
150
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
186
151
|
* SPDX-License-Identifier: MIT
|
|
187
|
-
*/,d="";
|
|
152
|
+
*/,c=e=>class extends e{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var e,t,i;super.disconnectedCallback(),null===(e=this.themeObserver)||void 0===e||e.disconnect(),null===(t=this.designSystemObserver)||void 0===t||t.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var e,t;const i=(null===(e=this.closest("[data-theme]"))||void 0===e?void 0:e.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return i||((null===(t=window.matchMedia)||void 0===t?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var e;const t=(null===(e=this.closest("[design-system]"))||void 0===e?void 0:e.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===t?t:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver(()=>{this.requestUpdate()}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver(()=>{this.requestUpdate()}),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},d=()=>{var e;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(e=process.env)||void 0===e?void 0:e.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},h=e=>class extends e{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(d())for(const e of this.requiredComponents)if(!this.isComponentAvailable(e))throw new Error(`Required component "${e}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${e}';`)}validateDependenciesWithHandler(e){if(!d())return!0;let t=!0;for(const i of this.requiredComponents)if(!this.isComponentAvailable(i)){t=!1;const r=new Error(`Required component "${i}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);e?e(i,r):console.error(r.message)}return t}isComponentAvailable(e){return!!customElements.get(e)}getMissingDependencies(){return this.requiredComponents.filter(e=>!this.isComponentAvailable(e))}areDependenciesAvailable(){return this.requiredComponents.every(e=>this.isComponentAvailable(e))}addRequiredComponent(e){this.requiredComponents.includes(e)||this.requiredComponents.push(e)}removeRequiredComponent(e){const t=this.requiredComponents.indexOf(e);t>-1&&this.requiredComponents.splice(t,1)}},u=e=>class extends e{dispatchCustomEvent(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(e,t){var i;const r=Object.assign(Object.assign({},t),{timestamp:Date.now(),componentName:(null===(i=this.tagName)||void 0===i?void 0:i.toLowerCase())||"unknown"});this.dispatchCustomEvent(e,r)}dispatchInputEvent(e,t){const i=Object.assign({target:t.target||this,value:t.value,originalEvent:t.originalEvent},t);this.dispatchCustomEvent(e,i)}dispatchFocusEvent(e,t){const i=Object.assign({target:t.target||this,value:t.value,focused:t.focused,cursorPosition:t.cursorPosition,selectedText:t.selectedText},t);this.dispatchCustomEvent(e,i)}dispatchValidationEvent(e,t){var i;const r=Object.assign({target:t.target||this,value:t.value,isValid:null!==(i=t.isValid)&&void 0!==i&&i,error:t.error},t);this.dispatchCustomEvent(e,r)}dispatchActionEvent(e,t){const i=Object.assign({target:t.target||this,action:t.action,previousValue:t.previousValue,newValue:t.newValue},t);this.dispatchCustomEvent(e,i)}isReadonlyKeyAllowed(e){if(e.ctrlKey||e.metaKey){return["KeyA","KeyC"].includes(e.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key)}isActivationKey(e){return"Enter"===e.key||" "===e.key}},p=new Set,m=new Map;
|
|
188
153
|
/**
|
|
189
154
|
* @license
|
|
190
155
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
191
156
|
* SPDX-License-Identifier: MIT
|
|
192
157
|
*/
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
158
|
+
const f=e=>{class t extends e{constructor(){super(...arguments),this.t=null}createRenderRoot(){return this.constructor.useShadowDom?super.createRenderRoot():this}connectedCallback(){const e=this.constructor.useShadowDom;if(!e&&null===this.t)for(this.t=[];this.firstChild;)this.t.push(this.removeChild(this.firstChild));if(super.connectedCallback(),!e){const e=this.constructor,t=this.tagName.toLowerCase(),i=e.styles;if(i){const e=g(i);e&&function(e,t,i){var r;if(!m.has(e)){const i=new CSSStyleSheet;i.replaceSync(t),m.set(e,i)}const s=m.get(e),o=`doc:${e}`;if(p.has(o)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,s],p.add(o)),i){let t=i;for(;t;){const i=t.getRootNode();if(!(i instanceof ShadowRoot))break;{const o=`shadow:${((null===(r=i.host)||void 0===r?void 0:r.tagName)||"").toLowerCase()}:${e}`;p.has(o)||(i.adoptedStyleSheets=[...i.adoptedStyleSheets,s],p.add(o)),t=i.host}}}}(t,e,this)}}}get lightChildren(){return this.t?this.t.filter(e=>!(e instanceof Element&&e.hasAttribute("slot"))):[]}lightChildrenNamed(e){return this.t?this.t.filter(t=>t instanceof Element&&t.getAttribute("slot")===e):[]}}return t.useShadowDom=!1,t};function g(e){return Array.isArray(e)?e.map(e=>g(e)).filter(Boolean).join("\n"):e&&"string"==typeof e.cssText?e.cssText:"string"==typeof e?e:""}
|
|
159
|
+
/**
|
|
160
|
+
* @license
|
|
161
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
162
|
+
* SPDX-License-Identifier: MIT
|
|
163
|
+
*/const v="";
|
|
164
|
+
/**
|
|
165
|
+
* @license
|
|
166
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
167
|
+
* SPDX-License-Identifier: MIT
|
|
168
|
+
*/var b=function(e,t,i,r){for(var s,o=arguments.length,n=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r,a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let w=class extends((e=>h(c(u(f(e)))))(r)){constructor(){super(...arguments),this.requiredComponents=["nr-icon"],this.message="",this.type="info",this.description="",this.closable=!1,this.showIcon=!1,this.icon="",this.banner=!1,this.visible=!0,this.closing=!1}close(){this.visible&&!this.closing&&(this.closing=!0,setTimeout(()=>{this.visible=!1,this.closing=!1,this.dispatchEvent(new CustomEvent("nr-alert-close",{detail:{message:this.message,type:this.type},bubbles:!0,composed:!0}))},300))}handleCloseClick(e){e.stopPropagation(),this.close()}getDefaultIcon(){if(this.icon)return this.icon;switch(this.type){case"success":return"check-circle";case"info":return"info";case"warning":return"alert-triangle";case"error":return"x-circle";default:return""}}hasDescription(){return!!this.description}render(){if(!this.visible)return t;const e={alert:!0,[`alert--${this.type}`]:!0,"alert--with-description":this.hasDescription(),"alert--banner":this.banner,"alert--closing":this.closing};return i`
|
|
169
|
+
<div part="alert" class=${a(e)} role="alert">
|
|
170
|
+
${this.showIcon?i`
|
|
171
|
+
<div part="icon" class="alert__icon">
|
|
172
|
+
${null!==this.querySelector('[slot="icon"]')?i`<slot name="icon"></slot>`:i`<nr-icon
|
|
173
|
+
name=${this.getDefaultIcon()}
|
|
174
|
+
size=${this.hasDescription()?"large":"small"}
|
|
175
|
+
></nr-icon>`}
|
|
203
176
|
</div>
|
|
204
177
|
`:t}
|
|
205
|
-
|
|
206
|
-
<div class="alert__content">
|
|
207
|
-
${this.message?
|
|
208
|
-
<div class="alert__message">${this.message}</div>
|
|
178
|
+
|
|
179
|
+
<div part="content" class="alert__content">
|
|
180
|
+
${this.message?i`
|
|
181
|
+
<div part="message" class="alert__message">${this.message}</div>
|
|
209
182
|
`:t}
|
|
210
|
-
|
|
211
|
-
${this.description?
|
|
212
|
-
<div class="alert__description">${this.description}</div>
|
|
183
|
+
|
|
184
|
+
${this.description?i`
|
|
185
|
+
<div part="description" class="alert__description">${this.description}</div>
|
|
213
186
|
`:t}
|
|
214
|
-
|
|
187
|
+
|
|
215
188
|
<slot></slot>
|
|
216
|
-
|
|
189
|
+
|
|
217
190
|
<slot name="action"></slot>
|
|
218
191
|
</div>
|
|
219
|
-
|
|
220
|
-
${this.closable?
|
|
192
|
+
|
|
193
|
+
${this.closable?i`
|
|
221
194
|
<button
|
|
195
|
+
part="close"
|
|
222
196
|
class="alert__close"
|
|
223
197
|
@click=${this.handleCloseClick}
|
|
224
198
|
aria-label="Close alert"
|
|
@@ -228,4 +202,4 @@ var u=function(r,e,t,a){for(var i,o=arguments.length,n=o<3?e:null===a?a=Object.g
|
|
|
228
202
|
</button>
|
|
229
203
|
`:t}
|
|
230
204
|
</div>
|
|
231
|
-
`}};
|
|
205
|
+
`}};w.styles=l,w.useShadowDom=!0,b([s({type:String})],w.prototype,"message",void 0),b([s({type:String,reflect:!0})],w.prototype,"type",void 0),b([s({type:String})],w.prototype,"description",void 0),b([s({type:Boolean})],w.prototype,"closable",void 0),b([s({type:Boolean,attribute:"show-icon"})],w.prototype,"showIcon",void 0),b([s({type:String})],w.prototype,"icon",void 0),b([s({type:Boolean})],w.prototype,"banner",void 0),b([o()],w.prototype,"visible",void 0),b([o()],w.prototype,"closing",void 0),w=b([n("nr-alert")],w);export{v as EMPTY_STRING,w as NrAlertElement};
|
|
Binary file
|