@nectary/components 2.8.8 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/accordion/index.d.ts +0 -11
- package/accordion/index.js +0 -86
- package/accordion/types.d.ts +0 -21
- package/accordion/types.js +0 -1
- package/accordion-item/index.d.ts +0 -14
- package/accordion-item/index.js +0 -95
- package/accordion-item/types.d.ts +0 -36
- package/accordion-item/types.js +0 -1
- package/accordion-item/utils.d.ts +0 -2
- package/accordion-item/utils.js +0 -1
- package/action-menu/index.d.ts +0 -11
- package/action-menu/index.js +0 -195
- package/action-menu/types.d.ts +0 -13
- package/action-menu/types.js +0 -1
- package/action-menu-option/index.d.ts +0 -12
- package/action-menu-option/index.js +0 -82
- package/action-menu-option/types.d.ts +0 -23
- package/action-menu-option/types.js +0 -1
- package/action-menu-option/utils.d.ts +0 -2
- package/action-menu-option/utils.js +0 -3
- package/alert/index.d.ts +0 -14
- package/alert/index.js +0 -48
- package/alert/types.d.ts +0 -18
- package/alert/types.js +0 -1
- package/alert/utils.d.ts +0 -2
- package/alert/utils.js +0 -1
- package/avatar/index.d.ts +0 -11
- package/avatar/index.js +0 -94
- package/avatar/types.d.ts +0 -37
- package/avatar/types.js +0 -1
- package/avatar/utils.d.ts +0 -4
- package/avatar/utils.js +0 -7
- package/badge/index.d.ts +0 -11
- package/badge/index.js +0 -114
- package/badge/types.d.ts +0 -34
- package/badge/types.js +0 -1
- package/badge/utils.d.ts +0 -2
- package/badge/utils.js +0 -1
- package/button/index.d.ts +0 -11
- package/button/index.js +0 -182
- package/button/types.d.ts +0 -53
- package/button/types.js +0 -1
- package/button/utils.d.ts +0 -2
- package/button/utils.js +0 -1
- package/card/index.d.ts +0 -13
- package/card/index.js +0 -133
- package/card/types.d.ts +0 -28
- package/card/types.js +0 -1
- package/card-container/index.d.ts +0 -11
- package/card-container/index.js +0 -11
- package/card-container/types.d.ts +0 -3
- package/card-container/types.js +0 -1
- package/chat/index.d.ts +0 -11
- package/chat/index.js +0 -11
- package/chat/types.d.ts +0 -3
- package/chat/types.js +0 -1
- package/chat-block/index.d.ts +0 -11
- package/chat-block/index.js +0 -86
- package/chat-block/types.d.ts +0 -30
- package/chat-block/types.js +0 -1
- package/chat-bubble/index.d.ts +0 -11
- package/chat-bubble/index.js +0 -41
- package/chat-bubble/types.d.ts +0 -20
- package/chat-bubble/types.js +0 -1
- package/chat-bubble/utils.d.ts +0 -3
- package/chat-bubble/utils.js +0 -2
- package/checkbox/index.d.ts +0 -11
- package/checkbox/index.js +0 -126
- package/checkbox/types.d.ts +0 -49
- package/checkbox/types.js +0 -1
- package/chip/index.d.ts +0 -13
- package/chip/index.js +0 -144
- package/chip/types.d.ts +0 -37
- package/chip/types.js +0 -1
- package/chip/utils.d.ts +0 -2
- package/chip/utils.js +0 -6
- package/code-tag/index.d.ts +0 -11
- package/code-tag/index.js +0 -31
- package/code-tag/types.d.ts +0 -11
- package/code-tag/types.js +0 -1
- package/color-menu/index.d.ts +0 -11
- package/color-menu/index.js +0 -308
- package/color-menu/types.d.ts +0 -32
- package/color-menu/types.js +0 -1
- package/color-menu/utils.d.ts +0 -1
- package/color-menu/utils.js +0 -11
- package/color-menu-option/index.d.ts +0 -13
- package/color-menu-option/index.js +0 -48
- package/color-menu-option/types.d.ts +0 -11
- package/color-menu-option/types.js +0 -1
- package/color-menu-option/utils.d.ts +0 -1
- package/color-menu-option/utils.js +0 -11
- package/color-swatch/index.d.ts +0 -12
- package/color-swatch/index.js +0 -54
- package/color-swatch/types.d.ts +0 -11
- package/color-swatch/types.js +0 -1
- package/color-swatch/utils.d.ts +0 -2
- package/color-swatch/utils.js +0 -6
- package/date-picker/index.d.ts +0 -14
- package/date-picker/index.js +0 -381
- package/date-picker/types.d.ts +0 -70
- package/date-picker/types.js +0 -1
- package/date-picker/utils.d.ts +0 -28
- package/date-picker/utils.js +0 -142
- package/dialog/index.d.ts +0 -15
- package/dialog/index.js +0 -144
- package/dialog/types.d.ts +0 -28
- package/dialog/types.js +0 -1
- package/dialog/utils.d.ts +0 -2
- package/dialog/utils.js +0 -18
- package/emoji/index.d.ts +0 -11
- package/emoji/index.js +0 -46
- package/emoji/types.d.ts +0 -11
- package/emoji/types.js +0 -1
- package/emoji/utils.d.ts +0 -3
- package/emoji/utils.js +0 -47
- package/emoji-picker/index.d.ts +0 -22
- package/emoji-picker/index.js +0 -308
- package/emoji-picker/types.d.ts +0 -26
- package/emoji-picker/types.js +0 -1
- package/field/index.d.ts +0 -11
- package/field/index.js +0 -120
- package/field/types.d.ts +0 -35
- package/field/types.js +0 -1
- package/file-drop/index.d.ts +0 -13
- package/file-drop/index.js +0 -205
- package/file-drop/types.d.ts +0 -50
- package/file-drop/types.js +0 -1
- package/file-drop/utils.d.ts +0 -2
- package/file-drop/utils.js +0 -31
- package/file-picker/index.d.ts +0 -11
- package/file-picker/index.js +0 -103
- package/file-picker/types.d.ts +0 -32
- package/file-picker/types.js +0 -1
- package/file-picker/utils.d.ts +0 -1
- package/file-picker/utils.js +0 -8
- package/file-status/index.d.ts +0 -14
- package/file-status/index.js +0 -61
- package/file-status/types.d.ts +0 -18
- package/file-status/types.js +0 -1
- package/file-status/utils.d.ts +0 -2
- package/file-status/utils.js +0 -1
- package/flag/index.d.ts +0 -11
- package/flag/index.js +0 -46
- package/flag/types.d.ts +0 -11
- package/flag/types.js +0 -1
- package/flag/utils.d.ts +0 -1
- package/flag/utils.js +0 -17
- package/grid/index.d.ts +0 -11
- package/grid/index.js +0 -11
- package/grid/types.d.ts +0 -3
- package/grid/types.js +0 -1
- package/grid-item/index.d.ts +0 -11
- package/grid-item/index.js +0 -35
- package/grid-item/types.d.ts +0 -17
- package/grid-item/types.js +0 -1
- package/help-tooltip/index.d.ts +0 -13
- package/help-tooltip/index.js +0 -74
- package/help-tooltip/types.d.ts +0 -3
- package/help-tooltip/types.js +0 -1
- package/horizontal-stepper/index.d.ts +0 -11
- package/horizontal-stepper/index.js +0 -61
- package/horizontal-stepper/types.d.ts +0 -13
- package/horizontal-stepper/types.js +0 -1
- package/horizontal-stepper-item/index.d.ts +0 -14
- package/horizontal-stepper-item/index.js +0 -61
- package/horizontal-stepper-item/types.d.ts +0 -24
- package/horizontal-stepper-item/types.js +0 -1
- package/horizontal-stepper-item/utils.d.ts +0 -2
- package/horizontal-stepper-item/utils.js +0 -1
- package/icon/index.d.ts +0 -11
- package/icon/index.js +0 -32
- package/icon/types.d.ts +0 -11
- package/icon/types.js +0 -1
- package/icon-button/index.d.ts +0 -12
- package/icon-button/index.js +0 -175
- package/icon-button/types.d.ts +0 -44
- package/icon-button/types.js +0 -1
- package/icon-button/utils.d.ts +0 -2
- package/icon-button/utils.js +0 -1
- package/inline-alert/index.d.ts +0 -15
- package/inline-alert/index.js +0 -83
- package/inline-alert/types.d.ts +0 -15
- package/inline-alert/types.js +0 -1
- package/inline-alert/utils.d.ts +0 -2
- package/inline-alert/utils.js +0 -1
- package/input/index.d.ts +0 -11
- package/input/index.js +0 -637
- package/input/types.d.ts +0 -86
- package/input/types.js +0 -1
- package/input/utils.d.ts +0 -26
- package/input/utils.js +0 -302
- package/link/index.d.ts +0 -12
- package/link/index.js +0 -150
- package/link/types.d.ts +0 -59
- package/link/types.js +0 -1
- package/list/index.d.ts +0 -11
- package/list/index.js +0 -14
- package/list/types.d.ts +0 -3
- package/list/types.js +0 -1
- package/list-item/index.d.ts +0 -11
- package/list-item/index.js +0 -14
- package/list-item/types.d.ts +0 -3
- package/list-item/types.js +0 -1
- package/pagination/index.d.ts +0 -12
- package/pagination/index.js +0 -147
- package/pagination/types.d.ts +0 -16
- package/pagination/types.js +0 -1
- package/pop/index.d.ts +0 -11
- package/pop/index.js +0 -425
- package/pop/types.d.ts +0 -35
- package/pop/types.js +0 -1
- package/pop/utils.d.ts +0 -4
- package/pop/utils.js +0 -16
- package/popover/index.d.ts +0 -12
- package/popover/index.js +0 -146
- package/popover/types.d.ts +0 -40
- package/popover/types.js +0 -1
- package/popover/utils.d.ts +0 -4
- package/popover/utils.js +0 -10
- package/progress/index.d.ts +0 -12
- package/progress/index.js +0 -58
- package/progress/types.d.ts +0 -12
- package/progress/types.js +0 -1
- package/progress-stepper/index.d.ts +0 -11
- package/progress-stepper/index.js +0 -206
- package/progress-stepper/types.d.ts +0 -22
- package/progress-stepper/types.js +0 -1
- package/progress-stepper-item/index.d.ts +0 -12
- package/progress-stepper-item/index.js +0 -82
- package/progress-stepper-item/types.d.ts +0 -23
- package/progress-stepper-item/types.js +0 -1
- package/progress-stepper-item/utils.d.ts +0 -11
- package/progress-stepper-item/utils.js +0 -13
- package/radio/index.d.ts +0 -11
- package/radio/index.js +0 -154
- package/radio/types.d.ts +0 -14
- package/radio/types.js +0 -1
- package/radio-option/index.d.ts +0 -11
- package/radio-option/index.js +0 -79
- package/radio-option/types.d.ts +0 -18
- package/radio-option/types.js +0 -1
- package/rich-text/index.d.ts +0 -14
- package/rich-text/index.js +0 -75
- package/rich-text/types.d.ts +0 -12
- package/rich-text/types.js +0 -1
- package/rich-text/utils.d.ts +0 -7
- package/rich-text/utils.js +0 -107
- package/rich-textarea/index.d.ts +0 -11
- package/rich-textarea/index.js +0 -464
- package/rich-textarea/types.d.ts +0 -48
- package/rich-textarea/types.js +0 -1
- package/rich-textarea/utils.d.ts +0 -39
- package/rich-textarea/utils.js +0 -1730
- package/segment/index.d.ts +0 -12
- package/segment/index.js +0 -109
- package/segment/types.d.ts +0 -16
- package/segment/types.js +0 -1
- package/segment/utils.d.ts +0 -3
- package/segment/utils.js +0 -16
- package/segment-collapse/index.d.ts +0 -13
- package/segment-collapse/index.js +0 -60
- package/segment-collapse/types.d.ts +0 -11
- package/segment-collapse/types.js +0 -1
- package/segmented-control/index.d.ts +0 -11
- package/segmented-control/index.js +0 -85
- package/segmented-control/types.d.ts +0 -11
- package/segmented-control/types.js +0 -1
- package/segmented-control-option/index.d.ts +0 -11
- package/segmented-control-option/index.js +0 -95
- package/segmented-control-option/types.d.ts +0 -19
- package/segmented-control-option/types.js +0 -1
- package/segmented-icon-control/index.d.ts +0 -11
- package/segmented-icon-control/index.js +0 -101
- package/segmented-icon-control/types.d.ts +0 -14
- package/segmented-icon-control/types.js +0 -1
- package/segmented-icon-control-option/index.d.ts +0 -11
- package/segmented-icon-control-option/index.js +0 -82
- package/segmented-icon-control-option/types.d.ts +0 -16
- package/segmented-icon-control-option/types.js +0 -1
- package/select-button/index.d.ts +0 -13
- package/select-button/index.js +0 -202
- package/select-button/types.d.ts +0 -50
- package/select-button/types.js +0 -1
- package/select-menu/index.d.ts +0 -15
- package/select-menu/index.js +0 -339
- package/select-menu/types.d.ts +0 -41
- package/select-menu/types.js +0 -1
- package/select-menu-option/index.d.ts +0 -28
- package/select-menu-option/index.js +0 -65
- package/select-menu-option/types.d.ts +0 -26
- package/select-menu-option/types.js +0 -1
- package/skeleton/index.d.ts +0 -11
- package/skeleton/index.js +0 -108
- package/skeleton/types.d.ts +0 -9
- package/skeleton/types.js +0 -1
- package/skeleton-item/index.d.ts +0 -11
- package/skeleton-item/index.js +0 -11
- package/skeleton-item/types.d.ts +0 -13
- package/skeleton-item/types.js +0 -1
- package/spinner/index.d.ts +0 -11
- package/spinner/index.js +0 -58
- package/spinner/types.d.ts +0 -12
- package/spinner/types.js +0 -1
- package/standalone.d.ts +0 -85
- package/standalone.js +0 -87
- package/stop-events/index.d.ts +0 -1
- package/stop-events/index.js +0 -27
- package/table/index.d.ts +0 -11
- package/table/index.js +0 -14
- package/table/types.d.ts +0 -3
- package/table/types.js +0 -1
- package/table-body/index.d.ts +0 -11
- package/table-body/index.js +0 -14
- package/table-body/types.d.ts +0 -3
- package/table-body/types.js +0 -1
- package/table-cell/index.d.ts +0 -11
- package/table-cell/index.js +0 -21
- package/table-cell/types.d.ts +0 -9
- package/table-cell/types.js +0 -1
- package/table-cell/utils.d.ts +0 -2
- package/table-cell/utils.js +0 -1
- package/table-head/index.d.ts +0 -11
- package/table-head/index.js +0 -14
- package/table-head/types.d.ts +0 -3
- package/table-head/types.js +0 -1
- package/table-head-cell/index.d.ts +0 -12
- package/table-head-cell/index.js +0 -57
- package/table-head-cell/types.d.ts +0 -15
- package/table-head-cell/types.js +0 -1
- package/table-row/index.d.ts +0 -11
- package/table-row/index.js +0 -42
- package/table-row/types.d.ts +0 -11
- package/table-row/types.js +0 -1
- package/tabs/index.d.ts +0 -11
- package/tabs/index.js +0 -80
- package/tabs/types.d.ts +0 -18
- package/tabs/types.js +0 -1
- package/tabs-icon-option/index.d.ts +0 -11
- package/tabs-icon-option/index.js +0 -79
- package/tabs-icon-option/types.d.ts +0 -19
- package/tabs-icon-option/types.js +0 -1
- package/tabs-option/index.d.ts +0 -12
- package/tabs-option/index.js +0 -86
- package/tabs-option/types.d.ts +0 -25
- package/tabs-option/types.js +0 -1
- package/tag/index.d.ts +0 -12
- package/tag/index.js +0 -84
- package/tag/types.d.ts +0 -23
- package/tag/types.js +0 -1
- package/tag/utils.d.ts +0 -2
- package/tag/utils.js +0 -6
- package/text/index.d.ts +0 -11
- package/text/index.js +0 -64
- package/text/types.d.ts +0 -30
- package/text/types.js +0 -1
- package/text/utils.d.ts +0 -2
- package/text/utils.js +0 -1
- package/textarea/index.d.ts +0 -11
- package/textarea/index.js +0 -322
- package/textarea/types.d.ts +0 -60
- package/textarea/types.js +0 -1
- package/tile-control/index.d.ts +0 -11
- package/tile-control/index.js +0 -110
- package/tile-control/types.d.ts +0 -37
- package/tile-control/types.js +0 -1
- package/tile-control-option/index.d.ts +0 -11
- package/tile-control-option/index.js +0 -98
- package/tile-control-option/types.d.ts +0 -37
- package/tile-control-option/types.js +0 -1
- package/time-picker/index.d.ts +0 -15
- package/time-picker/index.js +0 -337
- package/time-picker/types.d.ts +0 -34
- package/time-picker/types.js +0 -1
- package/time-picker/utils.d.ts +0 -11
- package/time-picker/utils.js +0 -75
- package/title/index.d.ts +0 -11
- package/title/index.js +0 -60
- package/title/types.d.ts +0 -31
- package/title/types.js +0 -1
- package/title/utils.d.ts +0 -3
- package/title/utils.js +0 -17
- package/toast/index.d.ts +0 -13
- package/toast/index.js +0 -86
- package/toast/types.d.ts +0 -28
- package/toast/types.js +0 -1
- package/toast/utils.d.ts +0 -2
- package/toast/utils.js +0 -1
- package/toast-manager/index.d.ts +0 -13
- package/toast-manager/index.js +0 -170
- package/toast-manager/types.d.ts +0 -13
- package/toast-manager/types.js +0 -1
- package/toast-manager/utils.d.ts +0 -2
- package/toast-manager/utils.js +0 -1
- package/toggle/index.d.ts +0 -11
- package/toggle/index.js +0 -141
- package/toggle/types.d.ts +0 -23
- package/toggle/types.js +0 -1
- package/tooltip/index.d.ts +0 -13
- package/tooltip/index.js +0 -264
- package/tooltip/tooltip-state.d.ts +0 -19
- package/tooltip/tooltip-state.js +0 -126
- package/tooltip/types.d.ts +0 -35
- package/tooltip/types.js +0 -1
- package/tooltip/utils.d.ts +0 -5
- package/tooltip/utils.js +0 -17
- package/utils/context.d.ts +0 -20
- package/utils/context.js +0 -84
- package/utils/countries.d.ts +0 -6
- package/utils/countries.js +0 -2
- package/utils/csv.d.ts +0 -5
- package/utils/csv.js +0 -22
- package/utils/debounce.d.ts +0 -8
- package/utils/debounce.js +0 -22
- package/utils/dom.d.ts +0 -34
- package/utils/dom.js +0 -154
- package/utils/element.d.ts +0 -16
- package/utils/element.js +0 -48
- package/utils/event-target.d.ts +0 -4
- package/utils/event-target.js +0 -26
- package/utils/get-react-event-handler.d.ts +0 -1
- package/utils/get-react-event-handler.js +0 -8
- package/utils/index.d.ts +0 -12
- package/utils/index.js +0 -12
- package/utils/markdown.d.ts +0 -19
- package/utils/markdown.js +0 -143
- package/utils/rect.d.ts +0 -4
- package/utils/rect.js +0 -28
- package/utils/size.d.ts +0 -5
- package/utils/size.js +0 -3
- package/utils/slot.d.ts +0 -4
- package/utils/slot.js +0 -38
- package/utils/throttle.d.ts +0 -4
- package/utils/throttle.js +0 -20
- package/utils/uid.d.ts +0 -1
- package/utils/uid.js +0 -13
- package/vertical-stepper/index.d.ts +0 -11
- package/vertical-stepper/index.js +0 -57
- package/vertical-stepper/types.d.ts +0 -13
- package/vertical-stepper/types.js +0 -1
- package/vertical-stepper-item/index.d.ts +0 -14
- package/vertical-stepper-item/index.js +0 -61
- package/vertical-stepper-item/types.d.ts +0 -24
- package/vertical-stepper-item/types.js +0 -1
- package/vertical-stepper-item/utils.d.ts +0 -2
- package/vertical-stepper-item/utils.js +0 -1
package/alert/index.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import '../icon';
|
|
2
|
-
import '../rich-text';
|
|
3
|
-
import '../text';
|
|
4
|
-
import { defineCustomElement, getAttribute, getLiteralAttribute, updateAttribute, updateLiteralAttribute, NectaryElement } from '../utils';
|
|
5
|
-
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:row;gap:8px;align-items:center;padding:8px 16px;box-sizing:border-box;width:100%;min-height:48px}:host([type=warn]) #wrapper{background-color:var(--sinch-comp-alert-color-warning-default-background)}:host([type=error]) #wrapper{background-color:var(--sinch-comp-alert-color-error-default-background)}:host([type=info]) #wrapper{background-color:var(--sinch-comp-alert-color-info-default-background)}#icon-error,#icon-info,#icon-warn{display:none}#icon-warn{--sinch-global-color-icon:var(--sinch-comp-alert-color-warning-default-icon)}#icon-error{--sinch-global-color-icon:var(--sinch-comp-alert-color-error-default-icon)}#icon-info{--sinch-global-color-icon:var(--sinch-comp-alert-color-info-default-icon)}:host([type=error]) #icon-error,:host([type=info]) #icon-info,:host([type=warn]) #icon-warn{display:block}#text{display:flex;flex-direction:column;gap:8px;flex:1;min-width:0;--sinch-comp-rich-text-font:var(--sinch-comp-alert-font-body)}:host([type=warn]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-warning-default-text)}:host([type=error]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-error-default-text)}:host([type=info]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-info-default-text)}</style><div id="wrapper"><sinch-icon id="icon-info" name="info"></sinch-icon><sinch-icon id="icon-warn" name="report_problem"></sinch-icon><sinch-icon id="icon-error" name="report"></sinch-icon><sinch-rich-text id="text"></sinch-rich-text><slot name="action"></slot><slot name="close"></slot></div>';
|
|
6
|
-
import { typeValues } from './utils';
|
|
7
|
-
const template = document.createElement('template');
|
|
8
|
-
template.innerHTML = templateHTML;
|
|
9
|
-
defineCustomElement('sinch-alert', class extends NectaryElement {
|
|
10
|
-
#$text;
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
const shadowRoot = this.attachShadow();
|
|
14
|
-
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
15
|
-
this.#$text = shadowRoot.querySelector('#text');
|
|
16
|
-
}
|
|
17
|
-
connectedCallback() {
|
|
18
|
-
super.connectedCallback();
|
|
19
|
-
this.setAttribute('role', 'alert');
|
|
20
|
-
}
|
|
21
|
-
disconnectedCallback() {
|
|
22
|
-
super.disconnectedCallback();
|
|
23
|
-
}
|
|
24
|
-
static get observedAttributes() {
|
|
25
|
-
return ['text'];
|
|
26
|
-
}
|
|
27
|
-
attributeChangedCallback(name, _, newVal) {
|
|
28
|
-
switch (name) {
|
|
29
|
-
case 'text':
|
|
30
|
-
{
|
|
31
|
-
updateAttribute(this.#$text, 'text', newVal);
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
get type() {
|
|
37
|
-
return getLiteralAttribute(this, typeValues, 'type');
|
|
38
|
-
}
|
|
39
|
-
set type(value) {
|
|
40
|
-
updateLiteralAttribute(this, typeValues, 'type', value);
|
|
41
|
-
}
|
|
42
|
-
get text() {
|
|
43
|
-
return getAttribute(this, 'text', '');
|
|
44
|
-
}
|
|
45
|
-
set text(value) {
|
|
46
|
-
updateAttribute(this, 'text', value);
|
|
47
|
-
}
|
|
48
|
-
});
|
package/alert/types.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { TSinchElementReact } from '../types';
|
|
2
|
-
export type TSinchAlertType = 'info' | 'warn' | 'error';
|
|
3
|
-
export type TSinchAlertElement = HTMLElement & {
|
|
4
|
-
/** Type */
|
|
5
|
-
type: TSinchAlertType;
|
|
6
|
-
/** Text */
|
|
7
|
-
text: string;
|
|
8
|
-
/** Type */
|
|
9
|
-
setAttribute(name: 'type', value: TSinchAlertType): void;
|
|
10
|
-
/** Text */
|
|
11
|
-
setAttribute(name: 'text', value: string): void;
|
|
12
|
-
};
|
|
13
|
-
export type TSinchAlertReact = TSinchElementReact<TSinchAlertElement> & {
|
|
14
|
-
/** Type */
|
|
15
|
-
type: TSinchAlertType;
|
|
16
|
-
/** Text */
|
|
17
|
-
text: string;
|
|
18
|
-
};
|
package/alert/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/alert/utils.d.ts
DELETED
package/alert/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const typeValues = ['info', 'warn', 'error'];
|
package/avatar/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { TSinchAvatarElement, TSinchAvatarReact } from './types';
|
|
2
|
-
declare global {
|
|
3
|
-
namespace JSX {
|
|
4
|
-
interface IntrinsicElements {
|
|
5
|
-
'sinch-avatar': TSinchAvatarReact;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
interface HTMLElementTagNameMap {
|
|
9
|
-
'sinch-avatar': TSinchAvatarElement;
|
|
10
|
-
}
|
|
11
|
-
}
|
package/avatar/index.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { defineCustomElement, getAttribute, getLiteralAttribute, NectaryElement, updateAttribute, updateLiteralAttribute } from '../utils';
|
|
2
|
-
import { DEFAULT_SIZE, sizeValues } from '../utils/size';
|
|
3
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;width:var(--sinch-local-size);height:var(--sinch-local-size);background-color:var(--sinch-comp-avatar-border-color-default-initial);border-radius:var(--sinch-comp-avatar-shape-radius);--sinch-local-size:var(--sinch-comp-avatar-size-m)}:host([size="l"]) #wrapper{--sinch-local-size:var(--sinch-comp-avatar-size-l)}:host([size="s"]) #wrapper{--sinch-local-size:var(--sinch-comp-avatar-size-s)}#text{display:block;width:100%;height:100%;font:var(--sinch-comp-avatar-container-font-size-m-text);line-height:calc(var(--sinch-local-size) - 2px);text-transform:uppercase;text-align:center}:host([size="l"]) #text{font:var(--sinch-comp-avatar-container-font-size-l-text);line-height:calc(var(--sinch-local-size) - 2px)}:host([size="s"]) #text{font:var(--sinch-comp-avatar-container-font-size-s-text);line-height:calc(var(--sinch-local-size) - 2px)}#circle{position:relative;width:calc(100% - 2px);height:calc(100% - 2px);left:1px;top:1px;border-radius:50%;-webkit-mask:linear-gradient(#fff,#000);mask:linear-gradient(#fff,#000);background-color:var(--sinch-comp-avatar-container-color-default-background);color:var(--sinch-comp-avatar-container-color-default-foreground)}#image{display:none;position:absolute;left:0;top:0;width:100%;height:100%;object-fit:contain}:host([src]:not([src=""])) #image{display:block}#person{display:none;position:absolute;left:0;top:0;width:100%;height:100%;fill:var(--sinch-comp-avatar-container-color-default-foreground);opacity:.15}:host(:not([src]):is(:not([alt]),[alt=""])) #person{display:block}#status-wrapper{position:absolute;left:calc(85% - 5px);top:calc(85% - 5px);width:10px;height:10px;padding:1px;box-sizing:border-box;border-radius:50%;background-color:var(--sinch-comp-avatar-border-color-default-initial);display:none;pointer-events:none}#status{width:8px;height:8px;border-radius:50%}:host([status=away]) #status-wrapper,:host([status=busy]) #status-wrapper,:host([status=offline]) #status-wrapper,:host([status=online]) #status-wrapper{display:block}:host([status=online]) #status{background-color:var(--sinch-comp-avatar-status-color-online-default-background)}:host([status=away]) #status{background-color:var(--sinch-comp-avatar-status-color-away-default-background)}:host([status=busy]) #status{background-color:var(--sinch-comp-avatar-status-color-busy-default-background)}:host([status=offline]) #status{background-color:var(--sinch-comp-avatar-status-color-offline-default-background)}</style><div id="wrapper"><div id="circle"><span id="text"></span><img id="image" alt=""/><svg id="person" viewBox="0 0 40 40" fill="none"><path d="M29.451 15.785a9.451 9.451 0 1 1-18.902 0 9.452 9.452 0 0 1 18.902 0ZM4.734 40.5c.119-7.085 5.899-12.792 13.012-12.792h4.508c7.113 0 12.893 5.707 13.012 12.792H4.734Z"/></svg></div><div id="status-wrapper"><div id="status"></div></div></div>';
|
|
4
|
-
import { getAvatarColorBg, getAvatarColorFg, statusValues } from './utils';
|
|
5
|
-
const template = document.createElement('template');
|
|
6
|
-
template.innerHTML = templateHTML;
|
|
7
|
-
defineCustomElement('sinch-avatar', class extends NectaryElement {
|
|
8
|
-
#$circle;
|
|
9
|
-
#$text;
|
|
10
|
-
#$image;
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
const shadowRoot = this.attachShadow();
|
|
14
|
-
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
15
|
-
this.#$circle = shadowRoot.querySelector('#circle');
|
|
16
|
-
this.#$text = shadowRoot.querySelector('#text');
|
|
17
|
-
this.#$image = shadowRoot.querySelector('#image');
|
|
18
|
-
}
|
|
19
|
-
connectedCallback() {
|
|
20
|
-
super.connectedCallback();
|
|
21
|
-
this.#updateColor();
|
|
22
|
-
}
|
|
23
|
-
disconnectedCallback() {
|
|
24
|
-
super.disconnectedCallback();
|
|
25
|
-
}
|
|
26
|
-
static get observedAttributes() {
|
|
27
|
-
return ['alt', 'src', 'color'];
|
|
28
|
-
}
|
|
29
|
-
attributeChangedCallback(name, _, newVal) {
|
|
30
|
-
switch (name) {
|
|
31
|
-
case 'alt':
|
|
32
|
-
{
|
|
33
|
-
this.#$text.textContent = newVal;
|
|
34
|
-
this.#$image.alt = newVal ?? '';
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
case 'src':
|
|
38
|
-
{
|
|
39
|
-
this.#$image.src = newVal ?? '';
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
case 'color':
|
|
43
|
-
{
|
|
44
|
-
this.#updateColor();
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
get src() {
|
|
50
|
-
return getAttribute(this, 'src');
|
|
51
|
-
}
|
|
52
|
-
set src(value) {
|
|
53
|
-
updateAttribute(this, 'src', value);
|
|
54
|
-
}
|
|
55
|
-
get alt() {
|
|
56
|
-
return getAttribute(this, 'alt', '');
|
|
57
|
-
}
|
|
58
|
-
set alt(value) {
|
|
59
|
-
updateAttribute(this, 'alt', value);
|
|
60
|
-
}
|
|
61
|
-
get color() {
|
|
62
|
-
return getAttribute(this, 'color');
|
|
63
|
-
}
|
|
64
|
-
set color(value) {
|
|
65
|
-
updateAttribute(this, 'color', value);
|
|
66
|
-
}
|
|
67
|
-
get size() {
|
|
68
|
-
return getLiteralAttribute(this, sizeValues, 'size', DEFAULT_SIZE);
|
|
69
|
-
}
|
|
70
|
-
set size(value) {
|
|
71
|
-
updateLiteralAttribute(this, sizeValues, 'size', value);
|
|
72
|
-
}
|
|
73
|
-
get status() {
|
|
74
|
-
return getLiteralAttribute(this, statusValues, 'status', null);
|
|
75
|
-
}
|
|
76
|
-
set status(value) {
|
|
77
|
-
updateLiteralAttribute(this, statusValues, 'status', value);
|
|
78
|
-
}
|
|
79
|
-
#updateColor() {
|
|
80
|
-
if (!this.isDomConnected) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const colorName = this.color;
|
|
84
|
-
if (colorName !== null && colorName.length > 0) {
|
|
85
|
-
const bg = getAvatarColorBg(colorName);
|
|
86
|
-
const fg = getAvatarColorFg(colorName);
|
|
87
|
-
this.#$circle.style.setProperty('background-color', bg);
|
|
88
|
-
this.#$circle.style.setProperty('color', fg);
|
|
89
|
-
} else {
|
|
90
|
-
this.#$circle.style.removeProperty('background-color');
|
|
91
|
-
this.#$circle.style.removeProperty('color');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
});
|
package/avatar/types.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { TSinchElementReact } from '../types';
|
|
2
|
-
import type { TSinchSize } from '../utils/size';
|
|
3
|
-
export type TSinchAvatarStatus = 'online' | 'busy' | 'away' | 'offline';
|
|
4
|
-
export type TSinchAvatarElement = HTMLElement & {
|
|
5
|
-
/** Image source */
|
|
6
|
-
src: string | null;
|
|
7
|
-
/** Alt text */
|
|
8
|
-
alt: string;
|
|
9
|
-
/** Background color */
|
|
10
|
-
color: string | null;
|
|
11
|
-
/** Status */
|
|
12
|
-
status: TSinchAvatarStatus | null;
|
|
13
|
-
/** Size, `m` by default */
|
|
14
|
-
size: TSinchSize;
|
|
15
|
-
/** Image source */
|
|
16
|
-
setAttribute(name: 'src', value: string): void;
|
|
17
|
-
/** Alt text */
|
|
18
|
-
setAttribute(name: 'alt', value: string): void;
|
|
19
|
-
/** Background color */
|
|
20
|
-
setAttribute(name: 'color', value: string): void;
|
|
21
|
-
/** Size, `m` by default */
|
|
22
|
-
setAttribute(name: 'size', value: TSinchSize): void;
|
|
23
|
-
/** Status */
|
|
24
|
-
setAttribute(name: 'status', value: TSinchAvatarStatus): void;
|
|
25
|
-
};
|
|
26
|
-
export type TSinchAvatarReact = TSinchElementReact<TSinchAvatarElement> & {
|
|
27
|
-
/** Image source */
|
|
28
|
-
src?: string;
|
|
29
|
-
/** Alt text */
|
|
30
|
-
alt?: string;
|
|
31
|
-
/** Background color */
|
|
32
|
-
color?: string;
|
|
33
|
-
/** Size, `m` by default */
|
|
34
|
-
size?: TSinchSize;
|
|
35
|
-
/** Status */
|
|
36
|
-
status?: TSinchAvatarStatus;
|
|
37
|
-
};
|
package/avatar/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/avatar/utils.d.ts
DELETED
package/avatar/utils.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export const statusValues = ['online', 'busy', 'away', 'offline'];
|
|
2
|
-
export const getAvatarColorBg = id => {
|
|
3
|
-
return `var(--sinch-comp-avatar-container-color-${id}-background)`;
|
|
4
|
-
};
|
|
5
|
-
export const getAvatarColorFg = id => {
|
|
6
|
-
return `var(--sinch-comp-avatar-container-color-${id}-foreground)`;
|
|
7
|
-
};
|
package/badge/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { TSinchBadgeElement, TSinchBadgeReact } from './types';
|
|
2
|
-
declare global {
|
|
3
|
-
namespace JSX {
|
|
4
|
-
interface IntrinsicElements {
|
|
5
|
-
'sinch-badge': TSinchBadgeReact;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
interface HTMLElementTagNameMap {
|
|
9
|
-
'sinch-badge': TSinchBadgeElement;
|
|
10
|
-
}
|
|
11
|
-
}
|
package/badge/index.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { defineCustomElement, getAttribute, getBooleanAttribute, getLiteralAttribute, getRect, isAttrEqual, isAttrTrue, NectaryElement, setClass, updateAttribute, updateBooleanAttribute, updateLiteralAttribute } from '../utils';
|
|
2
|
-
import { DEFAULT_SIZE, sizeValues } from '../utils/size';
|
|
3
|
-
const templateHTML = '<style>:host{display:inline-flex;flex-direction:column;position:relative}#badge-wrapper{position:absolute;left:0;top:0;width:fit-content;border-radius:var(--sinch-comp-badge-shape-radius);padding:1px;pointer-events:none;background-color:var(--sinch-comp-badge-color-border)}#badge{box-sizing:border-box;color:var(--sinch-comp-badge-color-text);background-color:var(--sinch-comp-badge-color-background);width:20px;height:20px;border-radius:var(--sinch-comp-badge-shape-radius)}#badge.long{width:fit-content;padding:0 5px}#text{display:block;width:100%;height:100%;text-align:center;font:var(--sinch-comp-badge-font-size-l);line-height:20px;text-rendering:optimizelegibility}:host([size="m"]) #badge-wrapper{left:calc(100% - 8px);top:-8px}:host([size="m"]) #badge{width:14px;height:14px}:host([size="m"]) #badge.long{width:fit-content;padding:0 3px}:host([size="m"]) #text{font:var(--sinch-comp-badge-font-size-m);line-height:14px}:host([size="s"]) #badge{width:8px;height:8px;padding:0}:host([size="s"]) #text{display:none}:host([hidden]) #badge-wrapper{display:none}</style><slot id="slot"></slot><div id="badge-wrapper"><div id="badge"><span id="text"></span></div></div>';
|
|
4
|
-
import { modeValues } from './utils';
|
|
5
|
-
const template = document.createElement('template');
|
|
6
|
-
template.innerHTML = templateHTML;
|
|
7
|
-
defineCustomElement('sinch-badge', class extends NectaryElement {
|
|
8
|
-
#$badgeWrapper;
|
|
9
|
-
#$badge;
|
|
10
|
-
#$text;
|
|
11
|
-
#observer;
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
const shadowRoot = this.attachShadow();
|
|
15
|
-
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
16
|
-
this.#$badgeWrapper = shadowRoot.querySelector('#badge-wrapper');
|
|
17
|
-
this.#$badge = shadowRoot.querySelector('#badge');
|
|
18
|
-
this.#$text = shadowRoot.querySelector('#text');
|
|
19
|
-
this.#observer = new ResizeObserver(this.#onResize);
|
|
20
|
-
}
|
|
21
|
-
connectedCallback() {
|
|
22
|
-
super.connectedCallback();
|
|
23
|
-
this.#observer.observe(this);
|
|
24
|
-
}
|
|
25
|
-
disconnectedCallback() {
|
|
26
|
-
super.disconnectedCallback();
|
|
27
|
-
this.#observer.unobserve(this);
|
|
28
|
-
}
|
|
29
|
-
static get observedAttributes() {
|
|
30
|
-
return ['text', 'size', 'mode', 'hidden'];
|
|
31
|
-
}
|
|
32
|
-
attributeChangedCallback(name, oldVal, newVal) {
|
|
33
|
-
if (isAttrEqual(oldVal, newVal)) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
switch (name) {
|
|
37
|
-
case 'text':
|
|
38
|
-
{
|
|
39
|
-
this.#$text.textContent = newVal;
|
|
40
|
-
setClass(this.#$badge, 'long', newVal !== null && newVal.length > 1);
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
case 'size':
|
|
44
|
-
{
|
|
45
|
-
this.#updatePosition();
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
case 'mode':
|
|
49
|
-
{
|
|
50
|
-
this.#updatePosition();
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
case 'hidden':
|
|
54
|
-
{
|
|
55
|
-
this.#updatePosition();
|
|
56
|
-
updateBooleanAttribute(this, name, isAttrTrue(newVal));
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
get text() {
|
|
62
|
-
return getAttribute(this, 'text', '');
|
|
63
|
-
}
|
|
64
|
-
set text(value) {
|
|
65
|
-
updateAttribute(this, 'text', value);
|
|
66
|
-
}
|
|
67
|
-
get size() {
|
|
68
|
-
return getLiteralAttribute(this, sizeValues, 'size', DEFAULT_SIZE);
|
|
69
|
-
}
|
|
70
|
-
set size(value) {
|
|
71
|
-
updateLiteralAttribute(this, sizeValues, 'size', value);
|
|
72
|
-
}
|
|
73
|
-
get mode() {
|
|
74
|
-
return getLiteralAttribute(this, modeValues, 'mode', 'square');
|
|
75
|
-
}
|
|
76
|
-
set mode(value) {
|
|
77
|
-
updateLiteralAttribute(this, modeValues, 'mode', value);
|
|
78
|
-
}
|
|
79
|
-
get hidden() {
|
|
80
|
-
return getBooleanAttribute(this, 'hidden');
|
|
81
|
-
}
|
|
82
|
-
set hidden(isHidden) {
|
|
83
|
-
updateBooleanAttribute(this, 'hidden', isHidden);
|
|
84
|
-
}
|
|
85
|
-
get badgeRect() {
|
|
86
|
-
if (this.hidden) {
|
|
87
|
-
const selfRect = getRect(this);
|
|
88
|
-
return {
|
|
89
|
-
x: selfRect.x + selfRect.width,
|
|
90
|
-
y: selfRect.y,
|
|
91
|
-
width: 0,
|
|
92
|
-
height: 0
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
return getRect(this.#$badgeWrapper);
|
|
96
|
-
}
|
|
97
|
-
#updatePosition() {
|
|
98
|
-
if (this.hidden) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const mode = this.mode;
|
|
102
|
-
const targetRect = this.getBoundingClientRect();
|
|
103
|
-
const badgeRect = this.#$badgeWrapper.getBoundingClientRect();
|
|
104
|
-
const offsetMultX = mode === 'circle' ? 0.85 : 1;
|
|
105
|
-
const offsetMultY = mode === 'circle' ? 0.15 : 0;
|
|
106
|
-
const posX = Math.round(targetRect.width * offsetMultX - badgeRect.height / 2);
|
|
107
|
-
const posY = Math.round(targetRect.height * offsetMultY - badgeRect.height / 2);
|
|
108
|
-
this.#$badgeWrapper.style.setProperty('left', `${posX}px`);
|
|
109
|
-
this.#$badgeWrapper.style.setProperty('top', `${posY}px`);
|
|
110
|
-
}
|
|
111
|
-
#onResize = () => {
|
|
112
|
-
this.#updatePosition();
|
|
113
|
-
};
|
|
114
|
-
});
|
package/badge/types.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { TRect, TSinchElementReact } from '../types';
|
|
2
|
-
import type { TSinchSize } from '../utils/size';
|
|
3
|
-
export type TSinchBadgeMode = 'square' | 'circle';
|
|
4
|
-
export type TSinchBadgeElement = HTMLElement & {
|
|
5
|
-
/** Text */
|
|
6
|
-
text: string;
|
|
7
|
-
/** Size */
|
|
8
|
-
size: TSinchSize;
|
|
9
|
-
/** Mode, `square` by default */
|
|
10
|
-
mode: TSinchBadgeMode;
|
|
11
|
-
/** Hidden */
|
|
12
|
-
hidden: boolean;
|
|
13
|
-
readonly badgeRect: TRect;
|
|
14
|
-
/** Text */
|
|
15
|
-
setAttribute(name: 'text', value: string): void;
|
|
16
|
-
/** Size */
|
|
17
|
-
setAttribute(name: 'size', value: TSinchSize): void;
|
|
18
|
-
/** Mode, `square` by default */
|
|
19
|
-
setAttribute(name: 'mode', value: TSinchBadgeMode): void;
|
|
20
|
-
/** Color */
|
|
21
|
-
setAttribute(name: 'color', value: string): void;
|
|
22
|
-
/** Hidden */
|
|
23
|
-
setAttribute(name: 'hidden', value: ''): void;
|
|
24
|
-
};
|
|
25
|
-
export type TSinchBadgeReact = TSinchElementReact<TSinchBadgeElement> & {
|
|
26
|
-
/** Text */
|
|
27
|
-
text: string;
|
|
28
|
-
/** Size */
|
|
29
|
-
size?: TSinchSize;
|
|
30
|
-
/** Mode, `square` by default */
|
|
31
|
-
mode?: TSinchBadgeMode;
|
|
32
|
-
/** Hidden */
|
|
33
|
-
hidden?: boolean;
|
|
34
|
-
};
|
package/badge/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/badge/utils.d.ts
DELETED
package/badge/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const modeValues = ['square', 'circle'];
|
package/button/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { TSinchButtonElement, TSinchButtonReact } from './types';
|
|
2
|
-
declare global {
|
|
3
|
-
namespace JSX {
|
|
4
|
-
interface IntrinsicElements {
|
|
5
|
-
'sinch-button': TSinchButtonReact;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
interface HTMLElementTagNameMap {
|
|
9
|
-
'sinch-button': TSinchButtonElement;
|
|
10
|
-
}
|
|
11
|
-
}
|
package/button/index.js
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { defineCustomElement, getBooleanAttribute, getAttribute, isAttrTrue, updateBooleanAttribute, updateAttribute, NectaryElement, getReactEventHandler, getLiteralAttribute, updateLiteralAttribute, Context, subscribeContext, isAttrEqual } from '../utils';
|
|
2
|
-
import { DEFAULT_SIZE, sizeExValues } from '../utils/size';
|
|
3
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0;cursor:pointer;user-select:none}:host([disabled]){cursor:initial}#button{all:initial;display:block;position:relative;width:100%;height:var(--sinch-local-size);user-select:none;--sinch-local-size:var(--sinch-comp-button-size-container-m);--sinch-local-padding:16px;--sinch-local-font:var(--sinch-comp-button-font-size-m-text);--sinch-local-shape-radius:var(--sinch-comp-button-shape-radius-size-m);--sinch-global-size-icon:var(--sinch-comp-button-size-icon-m);--sinch-global-color-icon:var(--sinch-local-color-icon)}:host([data-size="l"])>#button{--sinch-local-size:var(--sinch-comp-button-size-container-l);--sinch-local-shape-radius:var(--sinch-comp-button-shape-radius-size-l);--sinch-local-font:var(--sinch-comp-button-font-size-l-text);--sinch-global-size-icon:var(--sinch-comp-button-size-icon-l)}:host([data-size="m"])>#button{--sinch-local-size:var(--sinch-comp-button-size-container-m);--sinch-local-shape-radius:var(--sinch-comp-button-shape-radius-size-m);--sinch-local-font:var(--sinch-comp-button-font-size-m-text);--sinch-global-size-icon:var(--sinch-comp-button-size-icon-m)}:host([data-size="s"])>#button{--sinch-local-size:var(--sinch-comp-button-size-container-s);--sinch-local-shape-radius:var(--sinch-comp-button-shape-radius-size-s);--sinch-local-font:var(--sinch-comp-button-font-size-s-text);--sinch-global-size-icon:var(--sinch-comp-button-size-icon-s)}:host([data-size=xs])>#button{--sinch-local-size:var(--sinch-comp-button-size-container-xs);--sinch-local-padding:8px;--sinch-local-shape-radius:var(--sinch-comp-button-shape-radius-size-xs);--sinch-local-font:var(--sinch-comp-button-font-size-s-text);--sinch-global-size-icon:var(--sinch-comp-button-size-icon-xs)}:host(:is([text=""],:not([text])))>#button{--sinch-local-padding:8px}:host([data-size="s"]:is([text=""],:not([text])))>#button{--sinch-local-padding:4px}:host([data-size=xs]:is([text=""],:not([text])))>#button{--sinch-local-padding:4px}:host([type=primary])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-primary-default-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-primary-default-border-initial);--sinch-local-color-text:var(--sinch-comp-button-color-primary-default-text-initial);--sinch-local-color-icon:var(--sinch-comp-button-color-primary-default-icon-initial);--sinch-local-color-outline-focus:var(--sinch-comp-button-color-primary-default-outline-focus);--sinch-local-shadow:var(--sinch-comp-button-shadow-primary-initial)}:host(:not([type]))>#button,:host([type=secondary])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-secondary-default-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-secondary-default-border-initial);--sinch-local-color-outline-focus:var(--sinch-comp-button-color-secondary-default-outline-focus);--sinch-local-color-text:var(--sinch-comp-button-color-secondary-default-text-initial);--sinch-local-color-icon:var(--sinch-comp-button-color-secondary-default-icon-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-secondary-initial)}:host([type=subtle-primary])>#button,:host([type=tertiary])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-primary-default-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-subtle-primary-default-border-initial);--sinch-local-color-outline-focus:var(--sinch-comp-button-color-subtle-primary-default-outline-focus);--sinch-local-color-text:var(--sinch-comp-button-color-subtle-primary-default-text-initial);--sinch-local-color-icon:var(--sinch-comp-button-color-subtle-primary-default-icon-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-initial)}:host(:not([type]):is([text=""],:not([text])))>#button,:host([type=subtle-secondary])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-secondary-default-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-subtle-secondary-default-border-initial);--sinch-local-color-outline-focus:var(--sinch-comp-button-color-subtle-secondary-default-outline-focus);--sinch-local-color-text:var(--sinch-comp-button-color-subtle-secondary-default-text-initial);--sinch-local-color-icon:var(--sinch-comp-button-color-subtle-secondary-default-icon-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-initial)}:host([type=cta-primary])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-cta-primary-default-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-cta-primary-default-border-initial);--sinch-local-color-outline-focus:var(--sinch-comp-button-color-cta-primary-default-outline-focus);--sinch-local-color-text:var(--sinch-comp-button-color-cta-primary-default-text-initial);--sinch-local-color-icon:var(--sinch-comp-button-color-cta-primary-default-icon-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-cta-primary-initial)}:host([type=cta-secondary])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-cta-secondary-default-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-cta-secondary-default-border-initial);--sinch-local-color-outline-focus:var(--sinch-comp-button-color-cta-secondary-default-outline-focus);--sinch-local-color-text:var(--sinch-comp-button-color-cta-secondary-default-text-initial);--sinch-local-color-icon:var(--sinch-comp-button-color-cta-secondary-default-icon-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-cta-secondary-initial)}:host([type=destructive])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-danger-default-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-danger-default-border-initial);--sinch-local-color-text:var(--sinch-comp-button-color-danger-default-text-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-danger-initial);--sinch-global-color-icon:var(--sinch-comp-button-color-danger-default-icon-initial)}:host([type=primary]:focus-visible)>#button{--sinch-local-shadow:var(--sinch-comp-button-shadow-primary-focus)}:host(:not([type]):focus-visible)>#button,:host([type=secondary]:focus-visible)>#button{--sinch-local-shadow:var(--sinch-comp-button-shadow-secondary-focus)}:host([type=subtle-primary]:focus-visible)>#button,:host([type=tertiary]:focus-visible)>#button{--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-focus)}:host(:not([type]):is([text=""],:not([text])):focus-visible)>#button,:host([type=subtle-secondary]:focus-visible)>#button{--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-focus)}:host([type=cta-primary]:focus-visible)>#button{--sinch-local-shadow:var(--sinch-comp-button-shadow-cta-primary-focus)}:host([type=cta-secondary]:focus-visible)>#button{--sinch-local-shadow:var(--sinch-comp-button-shadow-cta-secondary-focus)}:host([type=destructive]:focus-visible)>#button{--sinch-local-shadow:var(--sinch-comp-button-shadow-danger-focus)}:host([toggled]:not([disabled])[type=subtle-primary])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-primary-toggled-background-initial)}:host([toggled]:not([disabled]):not([type]):is([text=""],:not([text])))>#button,:host([toggled]:not([disabled])[type=subtle-secondary])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-secondary-toggled-background-initial)}:host([type=primary]:hover)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-primary-default-background-hover);--sinch-local-shadow:var(--sinch-comp-button-shadow-primary-hover)}:host([type=primary]:active)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-primary-default-background-active);--sinch-local-shadow:var(--sinch-comp-button-shadow-primary-active)}:host(:not([type]):hover)>#button,:host([type=secondary]:hover)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-secondary-default-background-hover);--sinch-local-shadow:var(--sinch-comp-button-shadow-secondary-hover)}:host(:not([type]):active)>#button,:host([type=secondary]:active)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-secondary-default-background-active);--sinch-local-shadow:var(--sinch-comp-button-shadow-secondary-active)}:host([type=subtle-primary]:hover)>#button,:host([type=tertiary]:hover)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-primary-default-background-hover);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-hover)}:host([type=subtle-primary]:active)>#button,:host([type=tertiary]:active)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-primary-default-background-active);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-active)}:host(:not([type]):is([text=""],:not([text])):hover)>#button,:host([type=subtle-secondary]:hover)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-secondary-default-background-hover);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-hover)}:host(:not([type]):is([text=""],:not([text])):active)>#button,:host([type=subtle-secondary]:active)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-secondary-default-background-active);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-active)}:host([type=cta-primary]:hover)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-cta-primary-default-background-hover);--sinch-local-shadow:var(--sinch-comp-button-shadow-cta-primary-hover)}:host([type=cta-primary]:active)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-cta-primary-default-background-active);--sinch-local-shadow:var(--sinch-comp-button-shadow-cta-primary-active)}:host([type=cta-secondary]:hover)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-cta-secondary-default-background-hover);--sinch-local-shadow:var(--sinch-comp-button-shadow-cta-secondary-hover)}:host([type=cta-secondary]:active)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-cta-secondary-default-background-active);--sinch-local-shadow:var(--sinch-comp-button-shadow-cta-secondary-active)}:host([type=destructive]:hover)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-danger-default-background-hover);--sinch-local-shadow:var(--sinch-comp-button-shadow-danger-hover)}:host([type=destructive]:active)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-danger-default-background-active);--sinch-local-shadow:var(--sinch-comp-button-shadow-danger-active)}:host([toggled]:not([disabled])[type=subtle-primary]:hover)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-primary-default-background-hover);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-hover)}:host([toggled]:not([disabled])[type=subtle-primary]:active)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-primary-default-background-active);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-active)}:host([toggled]:not([disabled]):not([type]):is([text=""],:not([text])):hover)>#button,:host([toggled]:not([disabled])[type=subtle-secondary]:hover)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-secondary-default-background-hover);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-hover)}:host([toggled]:not([disabled]):not([type]):is([text=""],:not([text])):active)>#button,:host([toggled]:not([disabled])[type=subtle-secondary]:active)>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-secondary-default-background-active);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-active)}:host([type=primary][disabled])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-primary-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-primary-disabled-border-initial);--sinch-local-color-text:var(--sinch-comp-button-color-primary-disabled-text-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-primary-disabled);--sinch-global-color-icon:var(--sinch-comp-button-color-primary-disabled-icon-initial)}:host(:not([type])[disabled])>#button,:host([type=secondary][disabled])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-secondary-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-secondary-disabled-border-initial);--sinch-local-color-text:var(--sinch-comp-button-color-secondary-disabled-text-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-secondary-disabled);--sinch-global-color-icon:var(--sinch-comp-button-color-secondary-disabled-icon-initial)}:host([type=subtle-primary][disabled])>#button,:host([type=tertiary][disabled])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-primary-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-subtle-primary-disabled-border-initial);--sinch-local-color-text:var(--sinch-comp-button-color-subtle-primary-disabled-text-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-disabled);--sinch-global-color-icon:var(--sinch-comp-button-color-subtle-primary-disabled-icon-initial)}:host(:not([type]):is([text=""],:not([text]))[disabled])>#button,:host([type=subtle-secondary][disabled])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-subtle-secondary-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-subtle-secondary-disabled-border-initial);--sinch-local-color-text:var(--sinch-comp-button-color-subtle-secondary-disabled-text-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-subtle-disabled);--sinch-global-color-icon:var(--sinch-comp-button-color-subtle-secondary-disabled-icon-initial)}:host([type=cta-primary][disabled])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-cta-primary-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-cta-primary-disabled-border-initial);--sinch-local-color-text:var(--sinch-comp-button-color-cta-primary-disabled-text-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-cta-primary-disabled);--sinch-global-color-icon:var(--sinch-comp-button-color-cta-primary-disabled-icon-initial)}:host([type=cta-secondary][disabled])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-cta-secondary-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-cta-secondary-disabled-border-initial);--sinch-local-color-text:var(--sinch-comp-button-color-cta-secondary-disabled-text-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-cta-secondary-disabled);--sinch-global-color-icon:var(--sinch-comp-button-color-cta-secondary-disabled-icon-initial)}:host([type=destructive][disabled])>#button{--sinch-local-color-background:var(--sinch-comp-button-color-danger-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-button-color-danger-disabled-border-initial);--sinch-local-color-text:var(--sinch-comp-button-color-danger-disabled-text-initial);--sinch-local-shadow:var(--sinch-comp-button-shadow-danger-disabled);--sinch-global-color-icon:var(--sinch-comp-button-color-danger-disabled-icon-initial)}#button::before{content:"";position:absolute;inset:0;background-color:var(--sinch-local-color-background);border:1px solid var(--sinch-local-color-border);border-radius:var(--sinch-local-shape-radius);box-shadow:var(--sinch-local-shadow);pointer-events:none}:host(:not([disabled]):active) #button::before{border-width:2px}:host(:focus-visible) #button::after{position:absolute;content:"";inset:-3px;border:2px solid var(--sinch-local-color-outline-focus);border-radius:calc(var(--sinch-local-shape-radius) + 3px);pointer-events:none}#content{position:relative;display:flex;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;padding:0 var(--sinch-local-padding);box-sizing:border-box;pointer-events:none;overflow:hidden}#text{font:var(--sinch-local-font);color:var(--sinch-local-color-text);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0}:host(:is([text=""],:not([text]))) :is(#left-icon,#right-icon,#text){display:none}::slotted(*){display:block}</style><div id="button" inert><div id="content"><slot id="left-icon" name="left-icon"></slot><slot id="icon" name="icon"></slot><span id="text"></span><slot id="right-icon" name="right-icon"></slot></div></div>';
|
|
4
|
-
import { typeValues } from './utils';
|
|
5
|
-
const template = document.createElement('template');
|
|
6
|
-
template.innerHTML = templateHTML;
|
|
7
|
-
defineCustomElement('sinch-button', class extends NectaryElement {
|
|
8
|
-
#$button;
|
|
9
|
-
#$text;
|
|
10
|
-
#controller = null;
|
|
11
|
-
#sizeContext;
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
const shadowRoot = this.attachShadow();
|
|
15
|
-
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
16
|
-
this.#$button = shadowRoot.querySelector('#button');
|
|
17
|
-
this.#$text = shadowRoot.querySelector('#text');
|
|
18
|
-
this.#sizeContext = new Context(this.#$button, 'size');
|
|
19
|
-
}
|
|
20
|
-
connectedCallback() {
|
|
21
|
-
super.connectedCallback();
|
|
22
|
-
this.#controller = new AbortController();
|
|
23
|
-
const {
|
|
24
|
-
signal
|
|
25
|
-
} = this.#controller;
|
|
26
|
-
this.role = 'button';
|
|
27
|
-
this.tabIndex = 0;
|
|
28
|
-
this.addEventListener('click', this.#onButtonClick, {
|
|
29
|
-
signal
|
|
30
|
-
});
|
|
31
|
-
this.addEventListener('focus', this.#onButtonFocus, {
|
|
32
|
-
signal
|
|
33
|
-
});
|
|
34
|
-
this.addEventListener('blur', this.#onButtonBlur, {
|
|
35
|
-
signal
|
|
36
|
-
});
|
|
37
|
-
this.addEventListener('keydown', this.#onButtonKeydown, {
|
|
38
|
-
signal
|
|
39
|
-
});
|
|
40
|
-
this.addEventListener('-click', this.#onClickReactHandler, {
|
|
41
|
-
signal
|
|
42
|
-
});
|
|
43
|
-
this.addEventListener('-focus', this.#onFocusReactHandler, {
|
|
44
|
-
signal
|
|
45
|
-
});
|
|
46
|
-
this.addEventListener('-blur', this.#onBlurReactHandler, {
|
|
47
|
-
signal
|
|
48
|
-
});
|
|
49
|
-
subscribeContext(this, 'size', this.#onContextSize, signal);
|
|
50
|
-
this.#sizeContext.listen(signal);
|
|
51
|
-
this.#onSizeUpdate();
|
|
52
|
-
}
|
|
53
|
-
disconnectedCallback() {
|
|
54
|
-
super.disconnectedCallback();
|
|
55
|
-
this.#controller.abort();
|
|
56
|
-
this.#controller = null;
|
|
57
|
-
}
|
|
58
|
-
static get observedAttributes() {
|
|
59
|
-
return ['text', 'disabled', 'toggled', 'size', 'data-size'];
|
|
60
|
-
}
|
|
61
|
-
attributeChangedCallback(name, oldVal, newVal) {
|
|
62
|
-
switch (name) {
|
|
63
|
-
case 'text':
|
|
64
|
-
{
|
|
65
|
-
this.#$text.textContent = newVal;
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
case 'disabled':
|
|
69
|
-
{
|
|
70
|
-
if (!isAttrEqual(oldVal, newVal)) {
|
|
71
|
-
updateBooleanAttribute(this, 'disabled', isAttrTrue(newVal));
|
|
72
|
-
}
|
|
73
|
-
this.ariaDisabled = isAttrTrue(newVal).toString();
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
case 'toggled':
|
|
77
|
-
{
|
|
78
|
-
if (!isAttrEqual(oldVal, newVal)) {
|
|
79
|
-
updateBooleanAttribute(this, 'toggled', isAttrTrue(newVal));
|
|
80
|
-
}
|
|
81
|
-
this.ariaPressed = isAttrTrue(newVal).toString();
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
case 'size':
|
|
85
|
-
{
|
|
86
|
-
updateAttribute(this, 'data-size', newVal);
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
case 'data-size':
|
|
90
|
-
{
|
|
91
|
-
this.#onSizeUpdate();
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
set type(value) {
|
|
97
|
-
updateLiteralAttribute(this, typeValues, 'type', value);
|
|
98
|
-
}
|
|
99
|
-
get type() {
|
|
100
|
-
return getLiteralAttribute(this, typeValues, 'type', 'primary');
|
|
101
|
-
}
|
|
102
|
-
set text(value) {
|
|
103
|
-
updateAttribute(this, 'text', value);
|
|
104
|
-
}
|
|
105
|
-
get text() {
|
|
106
|
-
return getAttribute(this, 'text', '');
|
|
107
|
-
}
|
|
108
|
-
set disabled(isDisabled) {
|
|
109
|
-
updateBooleanAttribute(this, 'disabled', isDisabled);
|
|
110
|
-
}
|
|
111
|
-
get disabled() {
|
|
112
|
-
return getBooleanAttribute(this, 'disabled');
|
|
113
|
-
}
|
|
114
|
-
set toggled(isToggled) {
|
|
115
|
-
updateBooleanAttribute(this, 'toggled', isToggled);
|
|
116
|
-
}
|
|
117
|
-
get toggled() {
|
|
118
|
-
return getBooleanAttribute(this, 'toggled');
|
|
119
|
-
}
|
|
120
|
-
set size(size) {
|
|
121
|
-
updateLiteralAttribute(this, sizeExValues, 'size', size);
|
|
122
|
-
}
|
|
123
|
-
get size() {
|
|
124
|
-
return getLiteralAttribute(this, sizeExValues, 'size', DEFAULT_SIZE);
|
|
125
|
-
}
|
|
126
|
-
get focusable() {
|
|
127
|
-
return true;
|
|
128
|
-
}
|
|
129
|
-
#onSizeUpdate() {
|
|
130
|
-
if (!this.isDomConnected) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const size = getAttribute(this, 'data-size', DEFAULT_SIZE);
|
|
134
|
-
this.#sizeContext.dispatch(size);
|
|
135
|
-
}
|
|
136
|
-
#onContextSize = e => {
|
|
137
|
-
if (this.hasAttribute('size')) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
switch (e.detail) {
|
|
141
|
-
case 'l':
|
|
142
|
-
{
|
|
143
|
-
this.setAttribute('data-size', 'm');
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
default:
|
|
147
|
-
{
|
|
148
|
-
this.setAttribute('data-size', 's');
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
#onButtonKeydown = e => {
|
|
153
|
-
switch (e.code) {
|
|
154
|
-
case 'Space':
|
|
155
|
-
case 'Enter':
|
|
156
|
-
{
|
|
157
|
-
e.preventDefault();
|
|
158
|
-
this.click();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
#onButtonClick = () => {
|
|
163
|
-
if (!this.disabled) {
|
|
164
|
-
this.dispatchEvent(new CustomEvent('-click'));
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
#onButtonFocus = () => {
|
|
168
|
-
this.dispatchEvent(new CustomEvent('-focus'));
|
|
169
|
-
};
|
|
170
|
-
#onButtonBlur = () => {
|
|
171
|
-
this.dispatchEvent(new CustomEvent('-blur'));
|
|
172
|
-
};
|
|
173
|
-
#onFocusReactHandler = () => {
|
|
174
|
-
getReactEventHandler(this, 'on-focus')?.();
|
|
175
|
-
};
|
|
176
|
-
#onBlurReactHandler = () => {
|
|
177
|
-
getReactEventHandler(this, 'on-blur')?.();
|
|
178
|
-
};
|
|
179
|
-
#onClickReactHandler = e => {
|
|
180
|
-
getReactEventHandler(this, 'on-click')?.(e);
|
|
181
|
-
};
|
|
182
|
-
});
|