@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
|
@@ -1,303 +1,134 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
const checkBoxStyles = css `
|
|
3
|
-
/* ========================================
|
|
4
|
-
* CHECKBOX CSS VARIABLES - FALLBACK VALUES
|
|
5
|
-
* ========================================
|
|
6
|
-
* These fallback values ensure the component works even without theme files
|
|
7
|
-
*/
|
|
8
|
-
:host {
|
|
9
|
-
/* Base checkbox appearance */
|
|
10
|
-
--nuraly-checkbox-background: var(--nuraly-color-checkbox-background, #ffffff);
|
|
11
|
-
--nuraly-checkbox-text-color: var(--nuraly-color-checkbox-text, rgba(0, 0, 0, 0.88));
|
|
12
|
-
--nuraly-checkbox-label-color: var(--nuraly-color-checkbox-label, rgba(0, 0, 0, 0.88));
|
|
13
|
-
|
|
14
|
-
/* Checkbox borders and outline */
|
|
15
|
-
--nuraly-checkbox-border: var(--nuraly-border-width-checkbox, 1px) solid var(--nuraly-color-checkbox-border, #d9d9d9);
|
|
16
|
-
--nuraly-checkbox-border-radius: var(--nuraly-border-radius-checkbox, 2px);
|
|
17
|
-
--nuraly-checkbox-border-focus: var(--nuraly-border-width-checkbox, 1px) solid var(--nuraly-color-checkbox-border-focus, #1890ff);
|
|
18
|
-
--nuraly-checkbox-border-hover: var(--nuraly-border-width-checkbox, 1px) solid var(--nuraly-color-checkbox-border-hover, #40a9ff);
|
|
19
|
-
|
|
20
|
-
/* Checked/active states */
|
|
21
|
-
--nuraly-checkbox-checked-background: var(--nuraly-color-checkbox-checked-background, #1890ff);
|
|
22
|
-
--nuraly-checkbox-checked-border: var(--nuraly-color-checkbox-checked-border, #1890ff);
|
|
23
|
-
--nuraly-checkbox-checkmark-color: var(--nuraly-color-checkbox-checkmark, #ffffff);
|
|
24
|
-
--nuraly-checkbox-indeterminate-background: var(--nuraly-color-checkbox-indeterminate-background, #1890ff);
|
|
25
|
-
--nuraly-checkbox-indeterminate-mark-color: var(--nuraly-color-checkbox-indeterminate-mark, #ffffff);
|
|
26
|
-
|
|
27
|
-
/* Disabled states */
|
|
28
|
-
--nuraly-checkbox-disabled-background: var(--nuraly-color-checkbox-disabled-background, #f5f5f5);
|
|
29
|
-
--nuraly-checkbox-disabled-border: var(--nuraly-color-checkbox-disabled-border, #d9d9d9);
|
|
30
|
-
--nuraly-checkbox-disabled-text-color: var(--nuraly-color-checkbox-disabled-text, rgba(0, 0, 0, 0.25));
|
|
31
|
-
--nuraly-checkbox-disabled-checkmark-color: var(--nuraly-color-checkbox-disabled-checkmark, rgba(0, 0, 0, 0.25));
|
|
32
|
-
|
|
33
|
-
/* Focus states */
|
|
34
|
-
--nuraly-checkbox-focus-outline: var(--nuraly-size-checkbox-focus-outline, 2px) solid var(--nuraly-color-checkbox-focus-outline, rgba(24, 144, 255, 0.2));
|
|
35
|
-
|
|
36
|
-
/* Typography */
|
|
37
|
-
--nuraly-checkbox-font-family: var(--nuraly-font-family-checkbox, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif);
|
|
38
|
-
--nuraly-checkbox-font-size: var(--nuraly-font-size-checkbox, 14px);
|
|
39
|
-
--nuraly-checkbox-font-weight: var(--nuraly-font-weight-checkbox, 400);
|
|
40
|
-
--nuraly-checkbox-line-height: var(--nuraly-line-height-checkbox, 1.5715);
|
|
41
|
-
|
|
42
|
-
/* Sizing */
|
|
43
|
-
--nuraly-checkbox-size-small: var(--nuraly-size-checkbox-small, 14px);
|
|
44
|
-
--nuraly-checkbox-size-medium: var(--nuraly-size-checkbox-medium, 16px);
|
|
45
|
-
--nuraly-checkbox-size-large: var(--nuraly-size-checkbox-large, 18px);
|
|
46
|
-
|
|
47
|
-
/* Spacing */
|
|
48
|
-
--nuraly-checkbox-gap: var(--nuraly-spacing-checkbox-gap, 8px);
|
|
49
|
-
--nuraly-checkbox-padding: var(--nuraly-spacing-checkbox-padding, 4px);
|
|
50
|
-
|
|
51
|
-
/* Animation */
|
|
52
|
-
--nuraly-checkbox-transition: var(--nuraly-transition-checkbox, all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1));
|
|
53
|
-
|
|
54
|
-
/* ========================================
|
|
55
|
-
* LEGACY COMPATIBILITY VARIABLES
|
|
56
|
-
* ========================================
|
|
57
|
-
* Keep old variable names for backward compatibility
|
|
58
|
-
* These will be deprecated in future versions
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
/* Legacy local variables for backward compatibility */
|
|
62
|
-
--nuraly-checkbox-local-filled-background-color: var(--nuraly-checkbox-checked-background);
|
|
63
|
-
--nuraly-checkbox-local-color: var(--nuraly-checkbox-text-color);
|
|
64
|
-
--nuraly-checkbox-local-empty-background-color: var(--nuraly-checkbox-background);
|
|
65
|
-
--nuraly-checkbox-local-disabled-background-color: var(--nuraly-checkbox-disabled-background);
|
|
66
|
-
--nuraly-checkbox-local-disabled-text-color: var(--nuraly-checkbox-disabled-text-color);
|
|
67
|
-
--nuraly-checkbox-local-empty-border: var(--nuraly-checkbox-border);
|
|
68
|
-
--nuraly-checkbox-local-symbol-color: var(--nuraly-checkbox-checkmark-color);
|
|
69
|
-
--nuraly-checkbox-local-focus-border: var(--nuraly-checkbox-border-focus);
|
|
70
|
-
--nuraly-checkbox-local-focus-outline: var(--nuraly-checkbox-focus-outline);
|
|
71
|
-
--nuraly-checkbox-local-font-family: var(--nuraly-checkbox-font-family);
|
|
72
|
-
--nuraly-checkbox-local-border-radius: var(--nuraly-checkbox-border-radius);
|
|
73
|
-
--nuraly-checkbox-local-gap: var(--nuraly-checkbox-gap);
|
|
74
|
-
|
|
75
|
-
/* Legacy size variables */
|
|
76
|
-
--nuraly-checkbox-local-medium-width: var(--nuraly-checkbox-size-medium);
|
|
77
|
-
--nuraly-checkbox-local-medium-height: var(--nuraly-checkbox-size-medium);
|
|
78
|
-
--nuraly-checkbox-local-small-width: var(--nuraly-checkbox-size-small);
|
|
79
|
-
--nuraly-checkbox-local-small-height: var(--nuraly-checkbox-size-small);
|
|
80
|
-
--nuraly-checkbox-local-large-width: var(--nuraly-checkbox-size-large);
|
|
81
|
-
--nuraly-checkbox-local-large-height: var(--nuraly-checkbox-size-large);
|
|
82
|
-
|
|
83
|
-
/* Legacy checkmark sizing */
|
|
84
|
-
--nuraly-checkbox-local-small-indeterminate-size: calc(var(--nuraly-checkbox-size-small) * 0.7);
|
|
85
|
-
--nuraly-checkbox-local-large-indeterminate-size: calc(var(--nuraly-checkbox-size-large) * 0.7);
|
|
86
|
-
--nuraly-checkbox-local-medium-indeterminate-size: calc(var(--nuraly-checkbox-size-medium) * 0.7);
|
|
87
|
-
|
|
88
|
-
--nuraly-checkbox-local-small-checked-width: calc(var(--nuraly-checkbox-size-small) * 0.14);
|
|
89
|
-
--nuraly-checkbox-local-small-checked-height: calc(var(--nuraly-checkbox-size-small) * 0.5);
|
|
90
|
-
--nuraly-checkbox-local-medium-checked-width: calc(var(--nuraly-checkbox-size-medium) * 0.19);
|
|
91
|
-
--nuraly-checkbox-local-medium-checked-height: calc(var(--nuraly-checkbox-size-medium) * 0.56);
|
|
92
|
-
--nuraly-checkbox-local-large-checked-width: calc(var(--nuraly-checkbox-size-large) * 0.22);
|
|
93
|
-
--nuraly-checkbox-local-large-checked-height: calc(var(--nuraly-checkbox-size-large) * 0.56);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/* ========================================
|
|
97
|
-
* CHECKBOX COMPONENT STYLES
|
|
98
|
-
* ========================================
|
|
99
|
-
* Modern checkbox component with theme-aware styling
|
|
100
|
-
* Uses CSS custom properties for consistent theming
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
3
|
:host {
|
|
104
4
|
display: flex;
|
|
105
5
|
align-items: center;
|
|
106
6
|
flex-wrap: wrap;
|
|
107
|
-
gap:
|
|
108
|
-
font-family:
|
|
109
|
-
font-size:
|
|
110
|
-
font-weight:
|
|
111
|
-
line-height:
|
|
112
|
-
color:
|
|
7
|
+
gap: 8px;
|
|
8
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
font-weight: 400;
|
|
11
|
+
line-height: 1.5715;
|
|
12
|
+
color: #161616;
|
|
113
13
|
cursor: pointer;
|
|
114
|
-
transition:
|
|
14
|
+
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
115
15
|
}
|
|
116
16
|
|
|
117
|
-
/*
|
|
118
|
-
* CHECKBOX INPUT ELEMENT STYLES
|
|
119
|
-
* ======================================== */
|
|
120
|
-
|
|
17
|
+
/* Input base */
|
|
121
18
|
input {
|
|
122
19
|
appearance: none;
|
|
123
20
|
-webkit-appearance: none;
|
|
124
21
|
-moz-appearance: none;
|
|
125
22
|
cursor: pointer;
|
|
126
23
|
position: relative;
|
|
127
|
-
border-radius:
|
|
128
|
-
background-color:
|
|
129
|
-
border:
|
|
130
|
-
transition:
|
|
24
|
+
border-radius: 2px;
|
|
25
|
+
background-color: #ffffff;
|
|
26
|
+
border: 1px solid #d9d9d9;
|
|
27
|
+
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
131
28
|
margin: 0;
|
|
132
29
|
outline: none;
|
|
133
30
|
}
|
|
134
31
|
|
|
135
|
-
/*
|
|
136
|
-
* SIZE VARIATIONS
|
|
137
|
-
* ======================================== */
|
|
138
|
-
|
|
139
|
-
/* Medium size (default) */
|
|
32
|
+
/* Sizes */
|
|
140
33
|
input {
|
|
141
|
-
width:
|
|
142
|
-
height:
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
:host([size='small']) input {
|
|
146
|
-
width: var(--nuraly-checkbox-size-small);
|
|
147
|
-
height: var(--nuraly-checkbox-size-small);
|
|
34
|
+
width: 16px;
|
|
35
|
+
height: 16px;
|
|
148
36
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
height: var(--nuraly-checkbox-size-large);
|
|
37
|
+
:host([size="small"]) input {
|
|
38
|
+
width: 14px;
|
|
39
|
+
height: 14px;
|
|
153
40
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
* ======================================== */
|
|
158
|
-
|
|
159
|
-
/* Empty/unchecked state */
|
|
160
|
-
:host(:not([checked]):not([indeterminate]):not([disabled])) input {
|
|
161
|
-
background-color: var(--nuraly-checkbox-background);
|
|
162
|
-
border: var(--nuraly-checkbox-border);
|
|
41
|
+
:host([size="large"]) input {
|
|
42
|
+
width: 18px;
|
|
43
|
+
height: 18px;
|
|
163
44
|
}
|
|
164
45
|
|
|
165
|
-
/* Checked
|
|
46
|
+
/* Checked / indeterminate */
|
|
166
47
|
:host(:not([disabled])[checked]) input,
|
|
167
48
|
:host(:not([disabled])[indeterminate]) input {
|
|
168
|
-
background-color:
|
|
169
|
-
border: 1px solid
|
|
49
|
+
background-color: #7c3aed;
|
|
50
|
+
border: 1px solid #7c3aed;
|
|
170
51
|
}
|
|
171
52
|
|
|
172
|
-
/* Hover
|
|
173
|
-
:host(:not([disabled]):hover
|
|
174
|
-
border:
|
|
53
|
+
/* Hover */
|
|
54
|
+
:host(:not([disabled])):hover input {
|
|
55
|
+
border-color: #7c3aed;
|
|
175
56
|
}
|
|
176
57
|
|
|
177
|
-
|
|
178
|
-
:host(:not([disabled]):hover[indeterminate]) input {
|
|
179
|
-
background-color: var(--nuraly-checkbox-checked-background);
|
|
180
|
-
border: 1px solid var(--nuraly-checkbox-border-hover);
|
|
181
|
-
filter: brightness(1.1);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/* Focus states */
|
|
58
|
+
/* Focus */
|
|
185
59
|
input:focus,
|
|
186
60
|
input:focus-visible {
|
|
187
|
-
border:
|
|
188
|
-
outline:
|
|
61
|
+
border-color: #7c3aed;
|
|
62
|
+
outline: 2px solid rgba(124, 58, 237, 0.2);
|
|
189
63
|
outline-offset: 2px;
|
|
190
64
|
}
|
|
191
65
|
|
|
192
|
-
/*
|
|
193
|
-
* DISABLED STATE
|
|
194
|
-
* ======================================== */
|
|
195
|
-
|
|
66
|
+
/* Disabled */
|
|
196
67
|
:host([disabled]) {
|
|
197
|
-
color:
|
|
68
|
+
color: rgba(0, 0, 0, 0.25);
|
|
198
69
|
cursor: not-allowed;
|
|
199
70
|
}
|
|
200
|
-
|
|
201
71
|
:host([disabled]) input {
|
|
202
|
-
background-color:
|
|
203
|
-
border: 1px solid
|
|
72
|
+
background-color: #f5f5f5;
|
|
73
|
+
border: 1px solid #d9d9d9;
|
|
204
74
|
cursor: not-allowed;
|
|
205
75
|
}
|
|
206
76
|
|
|
207
|
-
/*
|
|
208
|
-
* CHECKMARK AND INDETERMINATE SYMBOLS
|
|
209
|
-
* ======================================== */
|
|
210
|
-
|
|
211
|
-
/* Base symbol styling */
|
|
77
|
+
/* Checkmark base */
|
|
212
78
|
input:after {
|
|
213
|
-
color:
|
|
79
|
+
color: #ffffff;
|
|
214
80
|
position: absolute;
|
|
215
81
|
left: 50%;
|
|
216
82
|
top: 50%;
|
|
217
83
|
transform: translate(-50%, -51%);
|
|
218
|
-
transition:
|
|
84
|
+
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
219
85
|
}
|
|
220
86
|
|
|
221
|
-
/* Checked
|
|
87
|
+
/* Checked checkmark */
|
|
222
88
|
:host([checked]) input:after {
|
|
223
|
-
border: solid
|
|
89
|
+
border: solid #ffffff;
|
|
224
90
|
border-width: 0 2px 2px 0;
|
|
225
91
|
transform: translate(-50%, -51%) rotate(45deg);
|
|
226
92
|
content: '';
|
|
227
|
-
width: var(--nuraly-checkbox-local-medium-checked-width); /* Default to medium size */
|
|
228
|
-
height: var(--nuraly-checkbox-local-medium-checked-height); /* Default to medium size */
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/* Checkmark sizing per size variant */
|
|
232
|
-
:host([checked][size='small']) input:after {
|
|
233
|
-
width: var(--nuraly-checkbox-local-small-checked-width);
|
|
234
|
-
height: var(--nuraly-checkbox-local-small-checked-height);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
:host([checked][size='medium']) input:after {
|
|
238
|
-
width: var(--nuraly-checkbox-local-medium-checked-width);
|
|
239
|
-
height: var(--nuraly-checkbox-local-medium-checked-height);
|
|
240
93
|
}
|
|
94
|
+
:host([checked]) input:after { width: 3px; height: 9px; }
|
|
95
|
+
:host([checked][size="small"]) input:after { width: 2px; height: 7px; }
|
|
96
|
+
:host([checked][size="large"]) input:after { width: 4px; height: 10px; }
|
|
241
97
|
|
|
242
|
-
|
|
243
|
-
width: var(--nuraly-checkbox-local-large-checked-width);
|
|
244
|
-
height: var(--nuraly-checkbox-local-large-checked-height);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/* Indeterminate state symbol */
|
|
98
|
+
/* Indeterminate */
|
|
248
99
|
:host([indeterminate]:not([checked])) input:after {
|
|
249
100
|
content: '-';
|
|
250
|
-
color:
|
|
101
|
+
color: #ffffff;
|
|
251
102
|
font-weight: bold;
|
|
252
103
|
transform: translate(-50%, -51%);
|
|
253
104
|
}
|
|
105
|
+
:host([indeterminate][size="small"]) input:after { font-size: 10px; }
|
|
106
|
+
:host([indeterminate][size="medium"]) input:after { font-size: 11px; }
|
|
107
|
+
:host([indeterminate][size="large"]) input:after { font-size: 13px; }
|
|
254
108
|
|
|
255
|
-
/*
|
|
256
|
-
:host([indeterminate][size='small']) input:after {
|
|
257
|
-
font-size: var(--nuraly-checkbox-local-small-indeterminate-size);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
:host([indeterminate][size='medium']) input:after {
|
|
261
|
-
font-size: var(--nuraly-checkbox-local-medium-indeterminate-size);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
:host([indeterminate][size='large']) input:after {
|
|
265
|
-
font-size: var(--nuraly-checkbox-local-large-indeterminate-size);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/* Empty state - no symbol */
|
|
109
|
+
/* Empty state */
|
|
269
110
|
:host(:not([checked]):not([indeterminate])) input:after {
|
|
270
111
|
content: '';
|
|
271
112
|
}
|
|
272
113
|
|
|
273
|
-
/*
|
|
274
|
-
* DISABLED STATE SYMBOLS
|
|
275
|
-
* ======================================== */
|
|
276
|
-
|
|
114
|
+
/* Disabled checkmark */
|
|
277
115
|
:host([disabled]) input:after {
|
|
278
|
-
color:
|
|
279
|
-
border-color:
|
|
116
|
+
color: rgba(0, 0, 0, 0.25);
|
|
117
|
+
border-color: rgba(0, 0, 0, 0.25);
|
|
280
118
|
}
|
|
281
119
|
|
|
282
|
-
/*
|
|
283
|
-
* LABEL TEXT STYLING
|
|
284
|
-
* ======================================== */
|
|
285
|
-
|
|
120
|
+
/* Label */
|
|
286
121
|
.checkbox-label {
|
|
287
122
|
flex: 1;
|
|
288
123
|
cursor: pointer;
|
|
289
124
|
user-select: none;
|
|
290
|
-
transition:
|
|
125
|
+
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
291
126
|
}
|
|
292
|
-
|
|
293
127
|
:host([disabled]) .checkbox-label {
|
|
294
128
|
cursor: not-allowed;
|
|
295
129
|
}
|
|
296
130
|
|
|
297
|
-
/*
|
|
298
|
-
* ACCESSIBILITY IMPROVEMENTS
|
|
299
|
-
* ======================================== */
|
|
300
|
-
|
|
131
|
+
/* Accessibility */
|
|
301
132
|
@media (prefers-reduced-motion: reduce) {
|
|
302
133
|
:host,
|
|
303
134
|
input,
|
|
@@ -307,16 +138,10 @@ const checkBoxStyles = css `
|
|
|
307
138
|
}
|
|
308
139
|
}
|
|
309
140
|
|
|
310
|
-
/* High contrast mode support */
|
|
311
141
|
@media (prefers-contrast: high) {
|
|
312
|
-
input {
|
|
313
|
-
border-width: 2px;
|
|
314
|
-
}
|
|
315
|
-
|
|
142
|
+
input { border-width: 2px; }
|
|
316
143
|
:host([checked]) input:after,
|
|
317
|
-
:host([indeterminate]) input:after {
|
|
318
|
-
font-weight: 900;
|
|
319
|
-
}
|
|
144
|
+
:host([indeterminate]) input:after { font-weight: 900; }
|
|
320
145
|
}
|
|
321
146
|
`;
|
|
322
147
|
export const styles = checkBoxStyles;
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import{css as
|
|
1
|
+
import{css as t,html as e,LitElement as i}from"lit";import{property as r,customElement as o}from"lit/decorators.js";import{createRef as n,ref as s}from"lit/directives/ref.js";import{CodeJar as a}from"codejar";import l from"highlight.js/lib/core";import h from"highlight.js/lib/languages/javascript";import c from"highlight.js/lib/languages/typescript";import d from"highlight.js/lib/languages/json";import g from"highlight.js/lib/languages/xml";import u from"highlight.js/lib/languages/css";import m from"highlight.js/lib/languages/markdown";import p from"highlight.js/lib/languages/python";import b from"highlight.js/lib/languages/sql";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2024 Nuraly
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
6
|
-
*/const
|
|
6
|
+
*/const f=t`
|
|
7
7
|
:host {
|
|
8
|
-
--nuraly-code-editor-width: 100%;
|
|
9
|
-
--nuraly-code-editor-height: 100%;
|
|
10
|
-
--nuraly-code-editor-min-height: 0;
|
|
11
|
-
--nuraly-code-editor-max-height: none;
|
|
12
|
-
--nuraly-code-editor-border-radius: 4px;
|
|
13
|
-
--nuraly-code-editor-border: 1px solid var(--nuraly-border-color, #e0e0e0);
|
|
14
|
-
|
|
15
8
|
display: block;
|
|
16
|
-
width:
|
|
17
|
-
height:
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
18
11
|
}
|
|
19
12
|
|
|
20
13
|
:host([hidden]) {
|
|
@@ -22,34 +15,167 @@ import{css as e,html as t,LitElement as i}from"lit";import{property as a,customE
|
|
|
22
15
|
}
|
|
23
16
|
|
|
24
17
|
.editor-container {
|
|
18
|
+
display: flex;
|
|
25
19
|
width: 100%;
|
|
26
20
|
height: 100%;
|
|
27
|
-
min-height:
|
|
28
|
-
|
|
29
|
-
border
|
|
21
|
+
min-height: 80px;
|
|
22
|
+
border-radius: 8px;
|
|
23
|
+
border: 1px solid var(--nr-border, #e0e0e0);
|
|
24
|
+
overflow: auto;
|
|
25
|
+
font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
|
|
26
|
+
font-size: 13px;
|
|
27
|
+
line-height: 1.6;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Light theme */
|
|
31
|
+
.editor-container.light {
|
|
32
|
+
background: #fafafa;
|
|
33
|
+
color: #24292e;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.editor-container.light .line-numbers-gutter {
|
|
37
|
+
background: #f0f0f0;
|
|
38
|
+
color: #999;
|
|
39
|
+
border-right: 1px solid #e0e0e0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Dark theme */
|
|
43
|
+
.editor-container.dark {
|
|
44
|
+
background: #1e1e1e;
|
|
45
|
+
color: #d4d4d4;
|
|
46
|
+
border-color: #333;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.editor-container.dark .line-numbers-gutter {
|
|
50
|
+
background: #1a1a1a;
|
|
51
|
+
color: #555;
|
|
52
|
+
border-right: 1px solid #333;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Line numbers gutter */
|
|
56
|
+
.line-numbers-gutter {
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
width: 48px;
|
|
59
|
+
padding: 10px 0;
|
|
60
|
+
text-align: right;
|
|
61
|
+
user-select: none;
|
|
30
62
|
overflow: hidden;
|
|
31
63
|
}
|
|
32
64
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
65
|
+
.line-number {
|
|
66
|
+
padding: 0 12px 0 0;
|
|
67
|
+
font-size: inherit;
|
|
68
|
+
line-height: inherit;
|
|
36
69
|
}
|
|
70
|
+
|
|
71
|
+
/* Editor area */
|
|
72
|
+
.editor {
|
|
73
|
+
flex: 1;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
padding: 10px 16px;
|
|
76
|
+
outline: none;
|
|
77
|
+
overflow: auto;
|
|
78
|
+
font-family: inherit;
|
|
79
|
+
font-size: inherit;
|
|
80
|
+
line-height: inherit;
|
|
81
|
+
white-space: pre;
|
|
82
|
+
-webkit-font-smoothing: antialiased;
|
|
83
|
+
-moz-osx-font-smoothing: grayscale;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.editor:focus {
|
|
87
|
+
outline: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Selection colors */
|
|
91
|
+
.editor-container.light .editor::selection,
|
|
92
|
+
.editor-container.light .editor *::selection {
|
|
93
|
+
background: rgba(124, 58, 237, 0.15);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.editor-container.dark .editor::selection,
|
|
97
|
+
.editor-container.dark .editor *::selection {
|
|
98
|
+
background: rgba(124, 58, 237, 0.3);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Caret color */
|
|
102
|
+
.editor-container.light .editor {
|
|
103
|
+
caret-color: #24292e;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.editor-container.dark .editor {
|
|
107
|
+
caret-color: #d4d4d4;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Readonly state */
|
|
111
|
+
:host([readonly]) .editor {
|
|
112
|
+
opacity: 0.7;
|
|
113
|
+
cursor: default;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* ======== Syntax highlighting — Light theme ======== */
|
|
117
|
+
.editor-container.light .hljs-keyword { color: #d73a49; }
|
|
118
|
+
.editor-container.light .hljs-string { color: #032f62; }
|
|
119
|
+
.editor-container.light .hljs-number { color: #005cc5; }
|
|
120
|
+
.editor-container.light .hljs-comment { color: #6a737d; font-style: italic; }
|
|
121
|
+
.editor-container.light .hljs-function { color: #6f42c1; }
|
|
122
|
+
.editor-container.light .hljs-title { color: #6f42c1; }
|
|
123
|
+
.editor-container.light .hljs-params { color: #24292e; }
|
|
124
|
+
.editor-container.light .hljs-built_in { color: #e36209; }
|
|
125
|
+
.editor-container.light .hljs-literal { color: #005cc5; }
|
|
126
|
+
.editor-container.light .hljs-type { color: #005cc5; }
|
|
127
|
+
.editor-container.light .hljs-attr { color: #005cc5; }
|
|
128
|
+
.editor-container.light .hljs-tag { color: #22863a; }
|
|
129
|
+
.editor-container.light .hljs-name { color: #22863a; }
|
|
130
|
+
.editor-container.light .hljs-selector-class { color: #6f42c1; }
|
|
131
|
+
.editor-container.light .hljs-selector-id { color: #005cc5; }
|
|
132
|
+
.editor-container.light .hljs-attribute { color: #005cc5; }
|
|
133
|
+
.editor-container.light .hljs-variable { color: #e36209; }
|
|
134
|
+
.editor-container.light .hljs-regexp { color: #032f62; }
|
|
135
|
+
.editor-container.light .hljs-symbol { color: #005cc5; }
|
|
136
|
+
.editor-container.light .hljs-meta { color: #6a737d; }
|
|
137
|
+
.editor-container.light .hljs-punctuation { color: #24292e; }
|
|
138
|
+
|
|
139
|
+
/* ======== Syntax highlighting — Dark theme ======== */
|
|
140
|
+
.editor-container.dark .hljs-keyword { color: #c678dd; }
|
|
141
|
+
.editor-container.dark .hljs-string { color: #98c379; }
|
|
142
|
+
.editor-container.dark .hljs-number { color: #d19a66; }
|
|
143
|
+
.editor-container.dark .hljs-comment { color: #5c6370; font-style: italic; }
|
|
144
|
+
.editor-container.dark .hljs-function { color: #61afef; }
|
|
145
|
+
.editor-container.dark .hljs-title { color: #61afef; }
|
|
146
|
+
.editor-container.dark .hljs-params { color: #abb2bf; }
|
|
147
|
+
.editor-container.dark .hljs-built_in { color: #e6c07b; }
|
|
148
|
+
.editor-container.dark .hljs-literal { color: #d19a66; }
|
|
149
|
+
.editor-container.dark .hljs-type { color: #e6c07b; }
|
|
150
|
+
.editor-container.dark .hljs-attr { color: #d19a66; }
|
|
151
|
+
.editor-container.dark .hljs-tag { color: #e06c75; }
|
|
152
|
+
.editor-container.dark .hljs-name { color: #e06c75; }
|
|
153
|
+
.editor-container.dark .hljs-selector-class { color: #e6c07b; }
|
|
154
|
+
.editor-container.dark .hljs-selector-id { color: #61afef; }
|
|
155
|
+
.editor-container.dark .hljs-attribute { color: #d19a66; }
|
|
156
|
+
.editor-container.dark .hljs-variable { color: #e06c75; }
|
|
157
|
+
.editor-container.dark .hljs-regexp { color: #98c379; }
|
|
158
|
+
.editor-container.dark .hljs-symbol { color: #56b6c2; }
|
|
159
|
+
.editor-container.dark .hljs-meta { color: #5c6370; }
|
|
160
|
+
.editor-container.dark .hljs-punctuation { color: #abb2bf; }
|
|
37
161
|
`
|
|
38
162
|
/**
|
|
39
163
|
* @license
|
|
40
164
|
* Copyright 2024 Nuraly
|
|
41
165
|
* SPDX-License-Identifier: MIT
|
|
42
|
-
*/,
|
|
166
|
+
*/,v={Light:"vs",Dark:"vs-dark",HighContrastDark:"hc-black",HighContrastLight:"hc-light"},j={JavaScript:"javascript",TypeScript:"typescript",JSON:"json",HTML:"html",CSS:"css",Markdown:"markdown",Python:"python",PlainText:"plaintext"},k=t=>class extends t{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 t,e,i;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(e=this.designSystemObserver)||void 0===e||e.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t;const e=this.explicitTheme;return e||((null===(t=window.matchMedia)||void 0===t?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get explicitTheme(){var t;return(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme")||null}get currentDesignSystem(){var t;const e=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===e?e:"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))}};
|
|
43
167
|
/**
|
|
44
168
|
* @license
|
|
45
169
|
* Copyright 2024 Nuraly
|
|
46
170
|
* SPDX-License-Identifier: MIT
|
|
47
171
|
*/
|
|
48
|
-
var
|
|
49
|
-
<
|
|
50
|
-
${
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
172
|
+
var y=function(t,e,i,r){for(var o,n=arguments.length,s=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,i,s):o(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};l.registerLanguage("javascript",h),l.registerLanguage("typescript",c),l.registerLanguage("json",d),l.registerLanguage("html",g),l.registerLanguage("xml",g),l.registerLanguage("css",u),l.registerLanguage("markdown",m),l.registerLanguage("python",p),l.registerLanguage("sql",b);let w=class extends(k(i)){constructor(){super(...arguments),this.isEditorReady=!1,this.editorRef=n(),this.suppressChange=!1,this.readonly=!1,this.theme=v.Dark,this.language="javascript",this.code="",this.lineNumbers=!0,this.fontSize=13,this.wordWrap=!1,this.tabSize=2}render(){const t=this.isDarkTheme();return e`
|
|
173
|
+
<div class="editor-container ${t?"dark":"light"}" part="editor-container">
|
|
174
|
+
<div class="line-numbers-gutter" style="display: ${this.lineNumbers?"block":"none"}"></div>
|
|
175
|
+
<code
|
|
176
|
+
${s(this.editorRef)}
|
|
177
|
+
class="editor language-${this.language}"
|
|
178
|
+
style="font-size: ${this.fontSize}px; tab-size: ${this.tabSize}; white-space: ${this.wordWrap?"pre-wrap":"pre"};"
|
|
179
|
+
></code>
|
|
54
180
|
</div>
|
|
55
|
-
`}getValue(){var e
|
|
181
|
+
`}getValue(){var t,e;return null!==(e=null===(t=this.editorRef.value)||void 0===t?void 0:t.textContent)&&void 0!==e?e:""}setValue(t){this.jar&&(this.suppressChange=!0,this.jar.updateCode(t),this.suppressChange=!1)}focus(){var t;null===(t=this.editorRef.value)||void 0===t||t.focus()}firstUpdated(){this.editorRef.value&&this.initializeEditor()}initializeEditor(){const t=this.editorRef.value;t.textContent=this.code;this.jar=a(t,t=>{const e=t.textContent||"",i=this.language||"plaintext";try{"plaintext"!==i&&l.getLanguage(i)?t.innerHTML=l.highlight(e,{language:i}).value:t.innerHTML=this.escapeHtml(e)}catch(i){t.innerHTML=this.escapeHtml(e)}},{tab:" ".repeat(this.tabSize),indentOn:/[({[]$/,addClosing:!0,catchTab:!0,preserveIdent:!0,history:!0}),this.isEditorReady=!0,this.jar.onUpdate(t=>{this.suppressChange||(this.code=t,this.updateLineNumbers(),this.emit("nr-change",{value:t}))}),t.addEventListener("keydown",t=>{this.readonly?t.preventDefault():this.emit("nr-keydown",this.createKeyEventDetail(t))}),t.addEventListener("keyup",t=>{this.emit("nr-keyup",this.createKeyEventDetail(t))}),t.addEventListener("focus",()=>this.emit("nr-focus")),t.addEventListener("blur",()=>this.emit("nr-blur")),this.readonly&&t.setAttribute("contenteditable","false"),this.updateLineNumbers(),this.emit("nr-ready",{editor:this.jar})}escapeHtml(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}updateLineNumbers(){var t,e,i;const r=null!==(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".line-numbers-gutter"))&&void 0!==e?e:null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(".line-numbers-gutter");if(!r||!this.lineNumbers)return;const o=this.getValue().split("\n").length;r.innerHTML=Array.from({length:o},(t,e)=>`<div class="line-number">${e+1}</div>`).join("")}createKeyEventDetail(t){return{event:t,key:t.key,code:t.code,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey}}emit(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}isDarkTheme(){var t,e;return this.theme===v.Dark||this.theme===v.HighContrastDark||this.theme!==v.Light&&this.theme!==v.HighContrastLight&&(null!==(e=null===(t=this.currentTheme)||void 0===t?void 0:t.includes("dark"))&&void 0!==e&&e)}updated(t){var e;if(super.updated(t),this.isEditorReady&&this.jar){if(t.has("code")&&this.code!==t.get("code")){const t=this.getValue();this.code!==t&&(this.setValue(this.code),this.updateLineNumbers())}t.has("readonly")&&(null===(e=this.editorRef.value)||void 0===e||e.setAttribute("contenteditable",this.readonly?"false":"true"))}}disconnectedCallback(){super.disconnectedCallback(),this.jar&&(this.jar.destroy(),this.jar=void 0),this.isEditorReady=!1}};w.styles=f,w.useShadowDom=!0,y([r({type:Boolean,reflect:!0})],w.prototype,"readonly",void 0),y([r({type:String,reflect:!0})],w.prototype,"theme",void 0),y([r({type:String,reflect:!0})],w.prototype,"language",void 0),y([r({type:String})],w.prototype,"code",void 0),y([r({type:Boolean,attribute:"line-numbers"})],w.prototype,"lineNumbers",void 0),y([r({type:Number,attribute:"font-size"})],w.prototype,"fontSize",void 0),y([r({type:Boolean,attribute:"word-wrap"})],w.prototype,"wordWrap",void 0),y([r({type:Number,attribute:"tab-size"})],w.prototype,"tabSize",void 0),w=y([o("nr-code-editor")],w);export{j as CODE_EDITOR_LANGUAGE,v as CODE_EDITOR_THEME,w as NrCodeEditorElement,f as codeEditorStyles};
|
|
Binary file
|