@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
|
@@ -15,43 +15,43 @@ export const styles = css `
|
|
|
15
15
|
:host {
|
|
16
16
|
display: block;
|
|
17
17
|
position: fixed;
|
|
18
|
-
z-index:
|
|
18
|
+
z-index: 1200;
|
|
19
19
|
pointer-events: none;
|
|
20
20
|
|
|
21
21
|
/* Force CSS custom property inheritance to ensure theme switching works properly */
|
|
22
|
-
color:
|
|
23
|
-
font-family:
|
|
22
|
+
color: #161616;
|
|
23
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/* Container positioning */
|
|
27
27
|
:host([position="top-right"]) {
|
|
28
|
-
top:
|
|
29
|
-
right:
|
|
28
|
+
top: 1rem;
|
|
29
|
+
right: 1rem;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
:host([position="top-left"]) {
|
|
33
|
-
top:
|
|
34
|
-
left:
|
|
33
|
+
top: 1rem;
|
|
34
|
+
left: 1rem;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
:host([position="top-center"]) {
|
|
38
|
-
top:
|
|
38
|
+
top: 1rem;
|
|
39
39
|
left: 50%;
|
|
40
40
|
transform: translateX(-50%);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
:host([position="bottom-right"]) {
|
|
44
|
-
bottom:
|
|
45
|
-
right:
|
|
44
|
+
bottom: 1rem;
|
|
45
|
+
right: 1rem;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
:host([position="bottom-left"]) {
|
|
49
|
-
bottom:
|
|
50
|
-
left:
|
|
49
|
+
bottom: 1rem;
|
|
50
|
+
left: 1rem;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
:host([position="bottom-center"]) {
|
|
54
|
-
bottom:
|
|
54
|
+
bottom: 1rem;
|
|
55
55
|
left: 50%;
|
|
56
56
|
transform: translateX(-50%);
|
|
57
57
|
}
|
|
@@ -59,61 +59,61 @@ export const styles = css `
|
|
|
59
59
|
.toast-container {
|
|
60
60
|
display: flex;
|
|
61
61
|
flex-direction: column;
|
|
62
|
-
gap:
|
|
63
|
-
min-width:
|
|
64
|
-
max-width:
|
|
62
|
+
gap: 0.5rem;
|
|
63
|
+
min-width: 280px;
|
|
64
|
+
max-width: 480px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.toast {
|
|
68
68
|
display: flex;
|
|
69
69
|
align-items: start;
|
|
70
|
-
gap:
|
|
71
|
-
padding:
|
|
72
|
-
background-color:
|
|
73
|
-
color:
|
|
74
|
-
border: 1px solid
|
|
75
|
-
border-radius:
|
|
76
|
-
box-shadow:
|
|
70
|
+
gap: 0.75rem;
|
|
71
|
+
padding: 0.75rem 1rem;
|
|
72
|
+
background-color: #ffffff;
|
|
73
|
+
color: #161616;
|
|
74
|
+
border: 1px solid #e0e0e0;
|
|
75
|
+
border-radius: 6px;
|
|
76
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
|
77
77
|
pointer-events: auto;
|
|
78
78
|
cursor: default;
|
|
79
|
-
transition: all
|
|
79
|
+
transition: all 0.15s ease;
|
|
80
80
|
position: relative;
|
|
81
81
|
overflow: hidden;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.toast:hover {
|
|
85
|
-
box-shadow:
|
|
85
|
+
box-shadow: 0 4px 16px rgba(0,0,0,0.2);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
/* Toast type variants */
|
|
89
89
|
.toast--default {
|
|
90
|
-
background-color:
|
|
91
|
-
border-color:
|
|
92
|
-
color:
|
|
90
|
+
background-color: #ffffff;
|
|
91
|
+
border-color: #e0e0e0;
|
|
92
|
+
color: #161616;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
.toast--success {
|
|
96
|
-
background-color:
|
|
97
|
-
border-color:
|
|
98
|
-
color:
|
|
96
|
+
background-color: #defbe6;
|
|
97
|
+
border-color: #198038;
|
|
98
|
+
color: #0e6027;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.toast--error {
|
|
102
|
-
background-color:
|
|
103
|
-
border-color:
|
|
104
|
-
color:
|
|
102
|
+
background-color: #fff1f1;
|
|
103
|
+
border-color: #dc2626;
|
|
104
|
+
color: #a61a1a;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
.toast--warning {
|
|
108
|
-
background-color:
|
|
109
|
-
border-color:
|
|
110
|
-
color:
|
|
108
|
+
background-color: #fdf4d3;
|
|
109
|
+
border-color: #f1c21b;
|
|
110
|
+
color: #75490a;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
.toast--info {
|
|
114
|
-
background-color:
|
|
115
|
-
border-color:
|
|
116
|
-
color:
|
|
114
|
+
background-color: #edf5ff;
|
|
115
|
+
border-color: #0043ce;
|
|
116
|
+
color: #003087;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/* Toast icon */
|
|
@@ -134,12 +134,12 @@ export const styles = css `
|
|
|
134
134
|
flex: 1;
|
|
135
135
|
display: flex;
|
|
136
136
|
flex-direction: column;
|
|
137
|
-
gap:
|
|
137
|
+
gap: 0.5rem;
|
|
138
138
|
min-width: 0;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
.toast__text {
|
|
142
|
-
font-size:
|
|
142
|
+
font-size: 0.875rem;
|
|
143
143
|
line-height: 1.5;
|
|
144
144
|
word-break: break-word;
|
|
145
145
|
}
|
|
@@ -148,7 +148,7 @@ export const styles = css `
|
|
|
148
148
|
.toast__button {
|
|
149
149
|
display: flex;
|
|
150
150
|
align-items: center;
|
|
151
|
-
margin-top:
|
|
151
|
+
margin-top: 0.25rem;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
.toast__button nr-button {
|
|
@@ -158,8 +158,8 @@ export const styles = css `
|
|
|
158
158
|
/* Close button */
|
|
159
159
|
.toast__close {
|
|
160
160
|
flex-shrink: 0;
|
|
161
|
-
min-width:
|
|
162
|
-
min-height:
|
|
161
|
+
min-width: 1.5rem;
|
|
162
|
+
min-height: 1.5rem;
|
|
163
163
|
padding: 0;
|
|
164
164
|
border: none;
|
|
165
165
|
background: transparent;
|
|
@@ -168,19 +168,19 @@ export const styles = css `
|
|
|
168
168
|
display: flex;
|
|
169
169
|
align-items: center;
|
|
170
170
|
justify-content: center;
|
|
171
|
-
border-radius:
|
|
172
|
-
transition: all
|
|
173
|
-
opacity:
|
|
171
|
+
border-radius: 4px;
|
|
172
|
+
transition: all 0.15s ease;
|
|
173
|
+
opacity: 0.6;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
.toast__close:hover {
|
|
177
|
-
opacity:
|
|
178
|
-
background-color:
|
|
177
|
+
opacity: 1;
|
|
178
|
+
background-color: rgba(0,0,0,0.08);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
.toast__close:focus {
|
|
182
|
-
outline:
|
|
183
|
-
outline-offset:
|
|
182
|
+
outline: 2px solid #7c3aed;
|
|
183
|
+
outline-offset: 2px;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
.toast__close nr-icon {
|
|
@@ -290,38 +290,38 @@ export const styles = css `
|
|
|
290
290
|
|
|
291
291
|
/* Animation classes */
|
|
292
292
|
.toast--fade-in {
|
|
293
|
-
animation: toast-fade-in
|
|
293
|
+
animation: toast-fade-in 0.3s ease;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
.toast--fade-out {
|
|
297
|
-
animation: toast-fade-out
|
|
297
|
+
animation: toast-fade-out 0.3s ease;
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
.toast--slide-in {
|
|
301
|
-
animation: toast-slide-in-right
|
|
301
|
+
animation: toast-slide-in-right 0.3s ease;
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
.toast--slide-out {
|
|
305
|
-
animation: toast-slide-out-right
|
|
305
|
+
animation: toast-slide-out-right 0.3s ease;
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
.toast--bounce-in {
|
|
309
|
-
animation: toast-bounce-in
|
|
309
|
+
animation: toast-bounce-in 0.3s ease;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
.toast--bounce-out {
|
|
313
|
-
animation: toast-bounce-out
|
|
313
|
+
animation: toast-bounce-out 0.3s ease;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
/* Position-specific slide animations */
|
|
317
317
|
:host([position="top-left"]) .toast--slide-in,
|
|
318
318
|
:host([position="bottom-left"]) .toast--slide-in {
|
|
319
|
-
animation: toast-slide-in-left
|
|
319
|
+
animation: toast-slide-in-left 0.3s ease;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
:host([position="top-left"]) .toast--slide-out,
|
|
323
323
|
:host([position="bottom-left"]) .toast--slide-out {
|
|
324
|
-
animation: toast-slide-out-left
|
|
324
|
+
animation: toast-slide-out-left 0.3s ease;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
/* Progress bar for duration indicator */
|
|
@@ -329,9 +329,9 @@ export const styles = css `
|
|
|
329
329
|
position: absolute;
|
|
330
330
|
bottom: 0;
|
|
331
331
|
left: 0;
|
|
332
|
-
height:
|
|
332
|
+
height: 3px;
|
|
333
333
|
background-color: currentColor;
|
|
334
|
-
opacity:
|
|
334
|
+
opacity: 0.4;
|
|
335
335
|
transition: width linear;
|
|
336
336
|
}
|
|
337
337
|
`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{css as t,LitElement as i,html as
|
|
1
|
+
import{css as t,LitElement as i,html as s,nothing as o}from"lit";import{property as e,state as n,customElement as h}from"lit/decorators.js";const r=[t`
|
|
2
2
|
:host([show]) {
|
|
3
|
-
background-color:
|
|
4
|
-
color:
|
|
3
|
+
background-color: #161616;
|
|
4
|
+
color: #ffffff;
|
|
5
5
|
position: fixed;
|
|
6
6
|
padding: 5px;
|
|
7
7
|
text-align: center;
|
|
@@ -51,20 +51,20 @@ import{css as t,LitElement as i,html as o,nothing as s}from"lit";import{property
|
|
|
51
51
|
border: 5px solid transparent;
|
|
52
52
|
}
|
|
53
53
|
:host(.top-position)::after {
|
|
54
|
-
border-top-color:
|
|
54
|
+
border-top-color: #161616;
|
|
55
55
|
top: 100%;
|
|
56
56
|
}
|
|
57
57
|
:host(.left-position)::after {
|
|
58
|
-
border-left-color:
|
|
58
|
+
border-left-color: #161616;
|
|
59
59
|
left: 100%;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
:host(.right-position)::after {
|
|
63
|
-
border-right-color:
|
|
63
|
+
border-right-color: #161616;
|
|
64
64
|
right: 100%;
|
|
65
65
|
}
|
|
66
66
|
:host(.bottom-position)::after {
|
|
67
|
-
border-bottom-color:
|
|
67
|
+
border-bottom-color: #161616;
|
|
68
68
|
bottom: 100%;
|
|
69
69
|
}
|
|
70
70
|
:host(.alignement-center.top-position)::after,
|
|
@@ -107,8 +107,8 @@ import{css as t,LitElement as i,html as o,nothing as s}from"lit";import{property
|
|
|
107
107
|
--nuraly-tooltip-text-color: #161616;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
`];var a,
|
|
111
|
-
<div class="popconfirm-container">
|
|
110
|
+
`];var a,p;!function(t){t.Top="top",t.Bottom="bottom",t.Right="right",t.Left="left"}(a||(a={})),function(t){t.Start="start",t.Center="center",t.End="end"}(p||(p={}));var l=function(t,i,s,o){for(var e,n=arguments.length,h=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,s):o,r=t.length-1;r>=0;r--)(e=t[r])&&(h=(n<3?e(h):n>3?e(i,s,h):e(i,s))||h);return n>3&&h&&Object.defineProperty(i,s,h),h};let c=class extends i{constructor(){super(...arguments),this.position=a.Bottom,this.alignement=p.Center,this.show=!1,this.isPopConfirm=!1,this.popConfirmTitle="",this.popConfirmDescription="",this.okText="Yes",this.cancelText="No",this.horizontalOffset=10,this.verticalOffset=10,this.onMouseOver=()=>{this.show=!0},this.onMouseLeave=()=>{this.show=!1,this.initStyles()},this.onClick=()=>{this.show=!this.show},this.calculatePosition=()=>{this.initStyles(),this.style.width=`${this.clientWidth}px`,this.position===a.Bottom||this.position===a.Top?(this.calculateYposition(),this.calculateYalignement()):(this.calculateXposition(),this.calculateXalignement())},this.calculateYposition=()=>{const t=this.target.getBoundingClientRect(),i=t.bottom,s=t.top,o=window.visualViewport.height,e=this.clientHeight,n=e+this.verticalOffset<o-i,h=e+this.verticalOffset<s;this.position===a.Bottom?n||!h?(this.classList.add("bottom-position"),this.style.top=`${i+this.verticalOffset}px`):(this.classList.add("top-position"),this.style.top=s-e-this.verticalOffset+"px"):h||!n?(this.classList.add("top-position"),this.style.top=s-e-this.verticalOffset+"px"):(this.classList.add("bottom-position"),this.style.top=`${i+this.verticalOffset}px`)},this.calculateYalignement=()=>{const t=this.target.getBoundingClientRect(),i=t.right,s=t.width,o=t.left,e=this.clientWidth,n=o+s/2,h=window.visualViewport.width,r=h-i+s/2;if(this.alignement===p.Start){e+o<h?(this.classList.add("alignement-start"),this.style.left=o-this.horizontalOffset+"px"):(this.classList.add("alignement-end"),this.style.left=`${o-e+this.horizontalOffset}px`)}else if(this.alignement===p.End){e<o?(this.classList.add("alignement-end"),this.style.left=`${o-e+this.horizontalOffset}px`):(this.classList.add("alignement-start"),this.style.left=o-this.horizontalOffset+"px")}else{const t=e<n;e/2<n&&e/2<r||e>n&&e>r?(this.classList.add("alignement-center"),this.style.left=o-e/2+s/2+"px"):t?(this.classList.add("alignement-end"),this.style.left=`${o-e+this.horizontalOffset}px`):(this.classList.add("alignement-start"),this.style.left=o-this.horizontalOffset+"px")}},this.calculateXposition=()=>{const t=this.target.getBoundingClientRect(),i=t.left,s=t.right,o=window.visualViewport.width,e=this.clientWidth,n=e+this.horizontalOffset<o-s,h=e+this.horizontalOffset<i;this.position===a.Right?n||!h?(this.classList.add("right-position"),this.style.left=`${s+this.horizontalOffset}px`):(this.classList.add("left-position"),this.style.left=i-e-this.horizontalOffset+"px"):h||!n?(this.classList.add("left-position"),this.style.left=i-e-this.horizontalOffset+"px"):(this.classList.add("right-position"),this.style.left=`${s+this.horizontalOffset}px`)},this.calculateXalignement=()=>{const t=this.target.getBoundingClientRect(),i=t.top,s=t.height,o=t.bottom,e=this.clientHeight,n=window.visualViewport.height,h=n-o;if(this.alignement===p.End){e<i?(this.classList.add("alignement-end"),this.style.top=o-e+"px"):(this.classList.add("alignement-start"),this.style.top=i-s/4+"px")}else if(this.alignement===p.Start){e<n-o?(this.classList.add("alignement-start"),this.style.top=i-s/4+"px"):(this.classList.add("alignement-end"),this.style.top=o-e+"px")}else{const t=e<i;e/2<i&&e/2<h||e>i&&e>h?(this.classList.add("alignement-center"),this.style.top=i+s/2-e/2+"px"):t?(this.classList.add("alignement-end"),this.style.top=o-e+"px"):(this.classList.add("alignement-start"),this.style.top=i-s/4+"px")}},this.onClickOutside=t=>{const i=t.composedPath();!i.includes(this.target)&&!i.includes(this)&&(this.show=!1)}}connectedCallback(){super.connectedCallback(),this.target=this.target||this.previousElementSibling,this.target?this.isPopConfirm?(document.addEventListener("scroll",this.calculatePosition),this.target.addEventListener("click",this.onClick),document.addEventListener("click",this.onClickOutside)):(this.target.addEventListener("mouseover",this.onMouseOver),this.target.addEventListener("mouseleave",this.onMouseLeave)):console.error("Tooltip target is not defined or found. Ensure target is explicitly set or precedes the tooltip.")}initStyles(){this.style.top="",this.style.left="",this.style.width="",this.classList.remove(...this.classList.values())}updated(t){this.show&&this.calculatePosition()}onPopConfirmCancel(){this.dispatchEvent(new CustomEvent("onCancel")),this.show=!1,this.initStyles()}onPopConfirmConfirm(){this.dispatchEvent(new CustomEvent("onConfirm")),this.show=!1,this.initStyles()}disconnectedCallback(){super.disconnectedCallback(),this.isPopConfirm?(this.target.removeEventListener("click",this.onClick),document.removeEventListener("scroll",this.calculatePosition)):(this.target.removeEventListener("mouseover",this.onMouseOver),this.target.removeEventListener("mouseleave",this.onMouseLeave))}render(){return this.isPopConfirm?this.show?s`
|
|
111
|
+
<div class="popconfirm-container" part="container">
|
|
112
112
|
<p class="popconfirm-title">${this.popConfirmTitle}</p>
|
|
113
113
|
<p class="popconfirm-description">${this.popConfirmDescription}</p>
|
|
114
114
|
<div class="btn-block">
|
|
@@ -120,4 +120,4 @@ import{css as t,LitElement as i,html as o,nothing as s}from"lit";import{property
|
|
|
120
120
|
>
|
|
121
121
|
</div>
|
|
122
122
|
</div>
|
|
123
|
-
`:
|
|
123
|
+
`:o:this.show?s`<slot></slot>`:o}};c.styles=r,c.useShadowDom=!0,l([e({reflect:!0})],c.prototype,"position",void 0),l([e({reflect:!0})],c.prototype,"alignement",void 0),l([n()],c.prototype,"target",void 0),l([e({reflect:!0,type:Boolean})],c.prototype,"show",void 0),l([e()],c.prototype,"isPopConfirm",void 0),l([e()],c.prototype,"popConfirmTitle",void 0),l([e()],c.prototype,"popConfirmDescription",void 0),l([e()],c.prototype,"okText",void 0),l([e()],c.prototype,"cancelText",void 0),c=l([h("hy-tooltip")],c);export{c as TooltipElement};
|
|
Binary file
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { LitElement, nothing, PropertyValueMap } from 'lit';
|
|
2
2
|
import { TooltipAlignment, TooltipPosition } from './tooltips.constant.js';
|
|
3
|
+
/**
|
|
4
|
+
* Tooltip / popconfirm overlay component.
|
|
5
|
+
*
|
|
6
|
+
* @element hy-tooltip
|
|
7
|
+
*
|
|
8
|
+
* @csspart container - The popconfirm inner container
|
|
9
|
+
*/
|
|
3
10
|
export declare class TooltipElement extends LitElement {
|
|
4
11
|
static styles: import("lit").CSSResult[];
|
|
12
|
+
static useShadowDom: boolean;
|
|
5
13
|
position: TooltipPosition;
|
|
6
14
|
alignement: TooltipAlignment;
|
|
7
15
|
target: Element;
|
|
@@ -9,6 +9,13 @@ import { html, LitElement, nothing } from 'lit';
|
|
|
9
9
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
10
10
|
import { styles } from './tooltips.style.js';
|
|
11
11
|
import { EMPTY_STRING, TooltipAlignment, TooltipPosition } from './tooltips.constant.js';
|
|
12
|
+
/**
|
|
13
|
+
* Tooltip / popconfirm overlay component.
|
|
14
|
+
*
|
|
15
|
+
* @element hy-tooltip
|
|
16
|
+
*
|
|
17
|
+
* @csspart container - The popconfirm inner container
|
|
18
|
+
*/
|
|
12
19
|
let TooltipElement = class TooltipElement extends LitElement {
|
|
13
20
|
constructor() {
|
|
14
21
|
super(...arguments);
|
|
@@ -262,7 +269,7 @@ let TooltipElement = class TooltipElement extends LitElement {
|
|
|
262
269
|
: nothing
|
|
263
270
|
: this.show
|
|
264
271
|
? html `
|
|
265
|
-
<div class="popconfirm-container">
|
|
272
|
+
<div class="popconfirm-container" part="container">
|
|
266
273
|
<p class="popconfirm-title">${this.popConfirmTitle}</p>
|
|
267
274
|
<p class="popconfirm-description">${this.popConfirmDescription}</p>
|
|
268
275
|
<div class="btn-block">
|
|
@@ -279,6 +286,7 @@ let TooltipElement = class TooltipElement extends LitElement {
|
|
|
279
286
|
}
|
|
280
287
|
};
|
|
281
288
|
TooltipElement.styles = styles;
|
|
289
|
+
TooltipElement.useShadowDom = true;
|
|
282
290
|
__decorate([
|
|
283
291
|
property({ reflect: true })
|
|
284
292
|
], TooltipElement.prototype, "position", void 0);
|
|
@@ -2,8 +2,8 @@ import { css } from 'lit';
|
|
|
2
2
|
import { styleVariables } from './tooltips.variables.js';
|
|
3
3
|
const tooltipStyles = css `
|
|
4
4
|
:host([show]) {
|
|
5
|
-
background-color:
|
|
6
|
-
color:
|
|
5
|
+
background-color: #161616;
|
|
6
|
+
color: #ffffff;
|
|
7
7
|
position: fixed;
|
|
8
8
|
padding: 5px;
|
|
9
9
|
text-align: center;
|
|
@@ -53,20 +53,20 @@ const tooltipStyles = css `
|
|
|
53
53
|
border: 5px solid transparent;
|
|
54
54
|
}
|
|
55
55
|
:host(.top-position)::after {
|
|
56
|
-
border-top-color:
|
|
56
|
+
border-top-color: #161616;
|
|
57
57
|
top: 100%;
|
|
58
58
|
}
|
|
59
59
|
:host(.left-position)::after {
|
|
60
|
-
border-left-color:
|
|
60
|
+
border-left-color: #161616;
|
|
61
61
|
left: 100%;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
:host(.right-position)::after {
|
|
65
|
-
border-right-color:
|
|
65
|
+
border-right-color: #161616;
|
|
66
66
|
right: 100%;
|
|
67
67
|
}
|
|
68
68
|
:host(.bottom-position)::after {
|
|
69
|
-
border-bottom-color:
|
|
69
|
+
border-bottom-color: #161616;
|
|
70
70
|
bottom: 100%;
|
|
71
71
|
}
|
|
72
72
|
:host(.alignement-center.top-position)::after,
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import{css as e,
|
|
1
|
+
import{css as e,html as t,LitElement as i}from"lit";import{property as o,state as s,customElement as r}from"lit/decorators.js";import{classMap as n}from"lit/directives/class-map.js";import{styleMap as a}from"lit/directives/style-map.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
5
|
+
* SPDX-License-Identifier: MIT
|
|
6
|
+
*/const d=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))}},l=()=>{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(l())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(!l())return!0;let t=!0;for(const i of this.requiredComponents)if(!this.isComponentAvailable(i)){t=!1;const o=new Error(`Required component "${i}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);e?e(i,o):console.error(o.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)}},c=e=>class extends e{dispatchCustomEvent(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(e,t){var i;const o=Object.assign(Object.assign({},t),{timestamp:Date.now(),componentName:(null===(i=this.tagName)||void 0===i?void 0:i.toLowerCase())||"unknown"});this.dispatchCustomEvent(e,o)}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 o=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,o)}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,u=new Map;
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
10
|
+
* SPDX-License-Identifier: MIT
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
15
|
+
* SPDX-License-Identifier: MIT
|
|
16
|
+
*/
|
|
17
|
+
const v=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=m(i);e&&function(e,t,i){var o;if(!u.has(e)){const i=new CSSStyleSheet;i.replaceSync(t),u.set(e,i)}const s=u.get(e),r=`doc:${e}`;if(p.has(r)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,s],p.add(r)),i){let t=i;for(;t;){const i=t.getRootNode();if(!(i instanceof ShadowRoot))break;{const r=`shadow:${((null===(o=i.host)||void 0===o?void 0:o.tagName)||"").toLowerCase()}:${e}`;p.has(r)||(i.adoptedStyleSheets=[...i.adoptedStyleSheets,s],p.add(r)),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 m(e){return Array.isArray(e)?e.map(e=>m(e)).filter(Boolean).join("\n"):e&&"string"==typeof e.cssText?e.cssText:"string"==typeof e?e:""}var b=e`
|
|
2
18
|
:host {
|
|
3
19
|
display: inline-block;
|
|
4
20
|
box-sizing: border-box;
|
|
@@ -12,14 +28,14 @@ import{css as e,LitElement as i,html as o}from"lit";import{property as r,state a
|
|
|
12
28
|
position: relative;
|
|
13
29
|
width: 100%;
|
|
14
30
|
height: 100%;
|
|
15
|
-
background-color:
|
|
31
|
+
background-color: #000;
|
|
16
32
|
}
|
|
17
33
|
|
|
18
34
|
video {
|
|
19
35
|
display: block;
|
|
20
36
|
width: 100%;
|
|
21
37
|
height: 100%;
|
|
22
|
-
border-radius:
|
|
38
|
+
border-radius: 4px;
|
|
23
39
|
}
|
|
24
40
|
|
|
25
41
|
.video--error {
|
|
@@ -27,8 +43,8 @@ import{css as e,LitElement as i,html as o}from"lit";import{property as r,state a
|
|
|
27
43
|
align-items: center;
|
|
28
44
|
justify-content: center;
|
|
29
45
|
min-height: 200px;
|
|
30
|
-
background-color: var(--
|
|
31
|
-
color: var(--
|
|
46
|
+
background-color: var(--nr-bg-hover, #f4f4f4);
|
|
47
|
+
color: var(--nr-text-secondary, #525252);
|
|
32
48
|
}
|
|
33
49
|
|
|
34
50
|
.error-message {
|
|
@@ -43,7 +59,6 @@ import{css as e,LitElement as i,html as o}from"lit";import{property as r,state a
|
|
|
43
59
|
opacity: 0.5;
|
|
44
60
|
}
|
|
45
61
|
|
|
46
|
-
/* Preview/Fullscreen Modal */
|
|
47
62
|
.preview-modal {
|
|
48
63
|
position: fixed;
|
|
49
64
|
top: 0;
|
|
@@ -53,15 +68,15 @@ import{css as e,LitElement as i,html as o}from"lit";import{property as r,state a
|
|
|
53
68
|
display: flex;
|
|
54
69
|
align-items: center;
|
|
55
70
|
justify-content: center;
|
|
56
|
-
background-color:
|
|
57
|
-
z-index:
|
|
58
|
-
animation: fadeIn 0.3s ease;
|
|
71
|
+
background-color: rgba(0, 0, 0, 0.95);
|
|
72
|
+
z-index: 1000;
|
|
73
|
+
animation: nr-video-fadeIn 0.3s ease;
|
|
59
74
|
}
|
|
60
75
|
|
|
61
76
|
.preview-modal video {
|
|
62
77
|
max-width: 90%;
|
|
63
78
|
max-height: 90%;
|
|
64
|
-
border-radius:
|
|
79
|
+
border-radius: 4px;
|
|
65
80
|
}
|
|
66
81
|
|
|
67
82
|
.preview-close {
|
|
@@ -70,10 +85,10 @@ import{css as e,LitElement as i,html as o}from"lit";import{property as r,state a
|
|
|
70
85
|
right: 20px;
|
|
71
86
|
width: 40px;
|
|
72
87
|
height: 40px;
|
|
73
|
-
background:
|
|
88
|
+
background: rgba(255, 255, 255, 0.2);
|
|
74
89
|
border: none;
|
|
75
90
|
border-radius: 50%;
|
|
76
|
-
color:
|
|
91
|
+
color: white;
|
|
77
92
|
font-size: 24px;
|
|
78
93
|
line-height: 1;
|
|
79
94
|
cursor: pointer;
|
|
@@ -85,19 +100,19 @@ import{css as e,LitElement as i,html as o}from"lit";import{property as r,state a
|
|
|
85
100
|
}
|
|
86
101
|
|
|
87
102
|
.preview-close:hover {
|
|
88
|
-
background:
|
|
103
|
+
background: rgba(255, 255, 255, 0.3);
|
|
89
104
|
}
|
|
90
105
|
|
|
91
106
|
.preview-button {
|
|
92
107
|
position: absolute;
|
|
93
108
|
top: 10px;
|
|
94
109
|
right: 10px;
|
|
95
|
-
background-color:
|
|
110
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
96
111
|
border: none;
|
|
97
112
|
border-radius: 4px;
|
|
98
113
|
padding: 8px 12px;
|
|
99
114
|
cursor: pointer;
|
|
100
|
-
color:
|
|
115
|
+
color: white;
|
|
101
116
|
font-size: 12px;
|
|
102
117
|
display: flex;
|
|
103
118
|
align-items: center;
|
|
@@ -107,29 +122,25 @@ import{css as e,LitElement as i,html as o}from"lit";import{property as r,state a
|
|
|
107
122
|
}
|
|
108
123
|
|
|
109
124
|
.preview-button:hover {
|
|
110
|
-
background-color:
|
|
125
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
111
126
|
}
|
|
112
127
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
opacity: 0;
|
|
117
|
-
}
|
|
118
|
-
to {
|
|
119
|
-
opacity: 1;
|
|
120
|
-
}
|
|
128
|
+
@keyframes nr-video-fadeIn {
|
|
129
|
+
from { opacity: 0; }
|
|
130
|
+
to { opacity: 1; }
|
|
121
131
|
}
|
|
122
|
-
`,
|
|
123
|
-
<div class=${
|
|
124
|
-
<div class="error-message">
|
|
132
|
+
`,g=function(e,t,i,o){for(var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o,a=e.length-1;a>=0;a--)(s=e[a])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let w=class extends((e=>h(d(c(v(e)))))(i)){constructor(){super(...arguments),this.width="auto",this.height="auto",this.autoplay=!1,this.loop=!1,this.muted=!1,this.controls=!0,this.preload="metadata",this.previewable=!1,this.block=!1,this.showPreview=!1,this.hasError=!1,this.defaultFallback="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQwIiBoZWlnaHQ9IjE4MCIgdmlld0JveD0iMCAwIDI0MCAxODAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHJlY3Qgd2lkdGg9IjI0MCIgaGVpZ2h0PSIxODAiIGZpbGw9IiNGM0Y0RjYiLz48cGF0aCBkPSJNMTg4IDY5TDE2OCA4OU0xNjggNjlMMTg4IDg5IiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PC9zdmc+"}handleError(){this.hasError=!0,this.dispatchEvent(new CustomEvent("nr-video-error",{bubbles:!0,composed:!0,detail:{error:`Error loading video: ${this.src}`,src:this.src}}))}handlePlay(){this.dispatchEvent(new CustomEvent("nr-video-play",{bubbles:!0,composed:!0,detail:{src:this.src}}))}handlePause(){this.dispatchEvent(new CustomEvent("nr-video-pause",{bubbles:!0,composed:!0,detail:{src:this.src}}))}handleEnded(){this.dispatchEvent(new CustomEvent("nr-video-ended",{bubbles:!0,composed:!0,detail:{src:this.src}}))}showPreviewModal(){this.previewable&&!this.hasError&&(this.showPreview=!0,this.dispatchEvent(new CustomEvent("nr-video-preview-open",{bubbles:!0,composed:!0,detail:{src:this.src}})))}closePreviewModal(){this.showPreview=!1,this.dispatchEvent(new CustomEvent("nr-video-preview-close",{bubbles:!0,composed:!0,detail:{src:this.src}}))}render(){const e={"video-container":!0,"video--error":this.hasError},i={width:"number"==typeof this.width?`${this.width}px`:this.width,height:"number"==typeof this.height?`${this.height}px`:this.height};return this.hasError?t`
|
|
133
|
+
<div part="container" class=${n(e)}>
|
|
134
|
+
<div part="error-message" class="error-message">
|
|
125
135
|
<img class="error-icon" src=${this.defaultFallback} alt="Video error" />
|
|
126
136
|
<p>Unable to load video</p>
|
|
127
137
|
</div>
|
|
128
138
|
</div>
|
|
129
|
-
`:
|
|
130
|
-
<div class=${
|
|
139
|
+
`:t`
|
|
140
|
+
<div part="container" class=${n(e)}>
|
|
131
141
|
<video
|
|
132
|
-
|
|
142
|
+
part="video"
|
|
143
|
+
style=${a(i)}
|
|
133
144
|
?autoplay=${this.autoplay}
|
|
134
145
|
?loop=${this.loop}
|
|
135
146
|
?muted=${this.muted}
|
|
@@ -144,8 +155,8 @@ import{css as e,LitElement as i,html as o}from"lit";import{property as r,state a
|
|
|
144
155
|
<source src=${this.src} />
|
|
145
156
|
Your browser does not support the video tag.
|
|
146
157
|
</video>
|
|
147
|
-
${this.previewable?
|
|
148
|
-
<button class="preview-button" @click=${this.showPreviewModal}>
|
|
158
|
+
${this.previewable?t`
|
|
159
|
+
<button part="preview-button" class="preview-button" @click=${this.showPreviewModal}>
|
|
149
160
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
150
161
|
<path d="M5.5 5.5A.5.5 0 0 1 6 6v3a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0V6z"/>
|
|
151
162
|
<path d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H2zM1 2a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2z"/>
|
|
@@ -153,9 +164,9 @@ import{css as e,LitElement as i,html as o}from"lit";import{property as r,state a
|
|
|
153
164
|
Fullscreen
|
|
154
165
|
</button>
|
|
155
166
|
`:""}
|
|
156
|
-
${this.showPreview?
|
|
157
|
-
<div class="preview-modal" @click=${this.closePreviewModal}>
|
|
158
|
-
<button class="preview-close" @click=${this.closePreviewModal} aria-label="Close preview">×</button>
|
|
167
|
+
${this.showPreview?t`
|
|
168
|
+
<div part="preview-modal" class="preview-modal" @click=${this.closePreviewModal}>
|
|
169
|
+
<button part="preview-close" class="preview-close" @click=${this.closePreviewModal} aria-label="Close preview">×</button>
|
|
159
170
|
<video
|
|
160
171
|
?autoplay=${!0}
|
|
161
172
|
?loop=${this.loop}
|
|
@@ -168,4 +179,4 @@ import{css as e,LitElement as i,html as o}from"lit";import{property as r,state a
|
|
|
168
179
|
</div>
|
|
169
180
|
`:""}
|
|
170
181
|
</div>
|
|
171
|
-
`}};
|
|
182
|
+
`}};w.styles=b,w.useShadowDom=!0,g([o({type:String})],w.prototype,"src",void 0),g([o({type:String})],w.prototype,"poster",void 0),g([o({type:String})],w.prototype,"width",void 0),g([o({type:String})],w.prototype,"height",void 0),g([o({type:Boolean})],w.prototype,"autoplay",void 0),g([o({type:Boolean})],w.prototype,"loop",void 0),g([o({type:Boolean})],w.prototype,"muted",void 0),g([o({type:Boolean})],w.prototype,"controls",void 0),g([o({type:String})],w.prototype,"preload",void 0),g([o({type:Boolean})],w.prototype,"previewable",void 0),g([o({type:Boolean,reflect:!0})],w.prototype,"block",void 0),g([s()],w.prototype,"showPreview",void 0),g([s()],w.prototype,"hasError",void 0),w=g([r("nr-video")],w);export{w as NrVideoElement};
|
|
Binary file
|