@nectary/components 2.12.1 → 2.12.2
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/lib/cjs/accordion/index.js +88 -0
- package/lib/cjs/accordion/types.js +1 -0
- package/lib/cjs/accordion-item/index.js +97 -0
- package/lib/cjs/accordion-item/types.js +1 -0
- package/lib/cjs/accordion-item/utils.js +7 -0
- package/lib/cjs/action-menu/index.js +197 -0
- package/lib/cjs/action-menu/types.js +1 -0
- package/lib/cjs/action-menu-option/index.js +84 -0
- package/lib/cjs/action-menu-option/types.js +1 -0
- package/lib/cjs/action-menu-option/utils.js +10 -0
- package/lib/cjs/alert/index.js +50 -0
- package/lib/cjs/alert/types.js +1 -0
- package/lib/cjs/alert/utils.js +7 -0
- package/lib/cjs/avatar/index.js +96 -0
- package/lib/cjs/avatar/types.js +1 -0
- package/lib/cjs/avatar/utils.js +15 -0
- package/lib/cjs/badge/index.js +116 -0
- package/lib/cjs/badge/types.js +1 -0
- package/lib/cjs/badge/utils.js +7 -0
- package/lib/cjs/button/index.js +184 -0
- package/lib/cjs/button/types.js +1 -0
- package/lib/cjs/button/utils.js +7 -0
- package/lib/cjs/card/index.js +135 -0
- package/lib/cjs/card/types.js +1 -0
- package/lib/cjs/card-container/index.js +13 -0
- package/lib/cjs/card-container/types.js +1 -0
- package/lib/cjs/chat/index.js +13 -0
- package/lib/cjs/chat/types.js +1 -0
- package/lib/cjs/chat-block/index.js +88 -0
- package/lib/cjs/chat-block/types.js +1 -0
- package/lib/cjs/chat-bubble/index.js +43 -0
- package/lib/cjs/chat-bubble/types.js +1 -0
- package/lib/cjs/chat-bubble/utils.js +8 -0
- package/lib/cjs/checkbox/index.js +128 -0
- package/lib/cjs/checkbox/types.js +1 -0
- package/lib/cjs/chip/index.js +146 -0
- package/lib/cjs/chip/types.js +1 -0
- package/lib/cjs/chip/utils.js +14 -0
- package/lib/cjs/code-tag/index.js +33 -0
- package/lib/cjs/code-tag/types.js +1 -0
- package/lib/cjs/color-menu/index.js +310 -0
- package/lib/cjs/color-menu/types.js +1 -0
- package/lib/cjs/color-menu/utils.js +18 -0
- package/lib/cjs/color-menu-option/index.js +50 -0
- package/lib/cjs/color-menu-option/types.js +1 -0
- package/lib/cjs/color-menu-option/utils.js +18 -0
- package/lib/cjs/color-swatch/index.js +56 -0
- package/lib/cjs/color-swatch/types.js +1 -0
- package/lib/cjs/color-swatch/utils.js +14 -0
- package/lib/cjs/date-picker/index.js +383 -0
- package/lib/cjs/date-picker/types.js +1 -0
- package/lib/cjs/date-picker/utils.js +171 -0
- package/lib/cjs/dialog/index.js +146 -0
- package/lib/cjs/dialog/types.js +1 -0
- package/lib/cjs/dialog/utils.js +26 -0
- package/lib/cjs/emoji/index.js +48 -0
- package/lib/cjs/emoji/types.js +1 -0
- package/lib/cjs/emoji/utils.js +56 -0
- package/lib/cjs/emoji-picker/index.js +311 -0
- package/lib/cjs/emoji-picker/types.js +1 -0
- package/lib/cjs/field/index.js +122 -0
- package/lib/cjs/field/types.js +1 -0
- package/lib/cjs/file-drop/index.js +207 -0
- package/lib/cjs/file-drop/types.js +1 -0
- package/lib/cjs/file-drop/utils.js +39 -0
- package/lib/cjs/file-picker/index.js +105 -0
- package/lib/cjs/file-picker/types.js +1 -0
- package/lib/cjs/file-picker/utils.js +15 -0
- package/lib/cjs/file-status/index.js +63 -0
- package/lib/cjs/file-status/types.js +1 -0
- package/lib/cjs/file-status/utils.js +7 -0
- package/lib/cjs/flag/index.js +48 -0
- package/lib/cjs/flag/types.js +1 -0
- package/lib/cjs/flag/utils.js +24 -0
- package/lib/cjs/grid/index.js +13 -0
- package/lib/cjs/grid/types.js +1 -0
- package/lib/cjs/grid-item/index.js +37 -0
- package/lib/cjs/grid-item/types.js +1 -0
- package/lib/cjs/help-tooltip/index.js +76 -0
- package/lib/cjs/help-tooltip/types.js +1 -0
- package/lib/cjs/horizontal-stepper/index.js +63 -0
- package/lib/cjs/horizontal-stepper/types.js +1 -0
- package/lib/cjs/horizontal-stepper-item/index.js +63 -0
- package/lib/cjs/horizontal-stepper-item/types.js +1 -0
- package/lib/cjs/horizontal-stepper-item/utils.js +7 -0
- package/lib/cjs/icon/index.js +34 -0
- package/lib/cjs/icon/types.js +1 -0
- package/lib/cjs/icon-button/index.js +177 -0
- package/lib/cjs/icon-button/types.js +1 -0
- package/lib/cjs/icon-button/utils.js +7 -0
- package/lib/cjs/imports.d.js +1 -0
- package/lib/cjs/imports.d.ts +9 -0
- package/lib/cjs/inline-alert/index.js +85 -0
- package/lib/cjs/inline-alert/types.js +1 -0
- package/lib/cjs/inline-alert/utils.js +7 -0
- package/lib/cjs/input/index.js +644 -0
- package/lib/cjs/input/types.js +1 -0
- package/lib/cjs/input/utils.js +317 -0
- package/lib/cjs/link/index.js +152 -0
- package/lib/cjs/link/types.js +1 -0
- package/lib/cjs/list/index.js +16 -0
- package/lib/cjs/list/types.js +1 -0
- package/lib/cjs/list-item/index.js +16 -0
- package/lib/cjs/list-item/types.js +1 -0
- package/lib/cjs/pagination/index.js +149 -0
- package/lib/cjs/pagination/types.js +1 -0
- package/lib/cjs/pop/index.js +427 -0
- package/lib/cjs/pop/types.js +1 -0
- package/lib/cjs/pop/utils.js +24 -0
- package/lib/cjs/popover/index.js +148 -0
- package/lib/cjs/popover/types.js +1 -0
- package/lib/cjs/popover/utils.js +17 -0
- package/lib/cjs/progress/index.js +60 -0
- package/lib/cjs/progress/types.js +1 -0
- package/lib/cjs/progress-stepper/index.js +208 -0
- package/lib/cjs/progress-stepper/types.js +1 -0
- package/lib/cjs/progress-stepper-item/index.js +84 -0
- package/lib/cjs/progress-stepper-item/types.js +1 -0
- package/lib/cjs/progress-stepper-item/utils.js +25 -0
- package/lib/cjs/radio/index.js +156 -0
- package/lib/cjs/radio/types.js +1 -0
- package/lib/cjs/radio-option/index.js +81 -0
- package/lib/cjs/radio-option/types.js +1 -0
- package/lib/cjs/rich-text/index.js +77 -0
- package/lib/cjs/rich-text/types.js +1 -0
- package/lib/cjs/rich-text/utils.js +117 -0
- package/lib/cjs/rich-textarea/index.js +466 -0
- package/lib/cjs/rich-textarea/types.js +1 -0
- package/lib/cjs/rich-textarea/utils.js +1754 -0
- package/lib/cjs/segment/index.js +111 -0
- package/lib/cjs/segment/types.js +1 -0
- package/lib/cjs/segment/utils.js +23 -0
- package/lib/cjs/segment-collapse/index.js +62 -0
- package/lib/cjs/segment-collapse/types.js +1 -0
- package/lib/cjs/segmented-control/index.js +87 -0
- package/lib/cjs/segmented-control/types.js +1 -0
- package/lib/cjs/segmented-control-option/index.js +97 -0
- package/lib/cjs/segmented-control-option/types.js +1 -0
- package/lib/cjs/segmented-icon-control/index.js +103 -0
- package/lib/cjs/segmented-icon-control/types.js +1 -0
- package/lib/cjs/segmented-icon-control-option/index.js +84 -0
- package/lib/cjs/segmented-icon-control-option/types.js +1 -0
- package/lib/cjs/select-button/index.js +204 -0
- package/lib/cjs/select-button/types.js +1 -0
- package/lib/cjs/select-menu/index.js +341 -0
- package/lib/cjs/select-menu/types.js +1 -0
- package/lib/cjs/select-menu-option/index.js +72 -0
- package/lib/cjs/select-menu-option/types.js +1 -0
- package/lib/cjs/skeleton/index.js +110 -0
- package/lib/cjs/skeleton/types.js +1 -0
- package/lib/cjs/skeleton-item/index.js +13 -0
- package/lib/cjs/skeleton-item/types.js +1 -0
- package/lib/cjs/spinner/index.js +60 -0
- package/lib/cjs/spinner/types.js +1 -0
- package/lib/cjs/standalone.js +89 -0
- package/lib/cjs/stop-events/index.js +29 -0
- package/lib/cjs/table/index.js +16 -0
- package/lib/cjs/table/types.js +1 -0
- package/lib/cjs/table-body/index.js +16 -0
- package/lib/cjs/table-body/types.js +1 -0
- package/lib/cjs/table-cell/index.js +23 -0
- package/lib/cjs/table-cell/types.js +1 -0
- package/lib/cjs/table-cell/utils.js +7 -0
- package/lib/cjs/table-head/index.js +16 -0
- package/lib/cjs/table-head/types.js +1 -0
- package/lib/cjs/table-head-cell/index.js +59 -0
- package/lib/cjs/table-head-cell/types.js +1 -0
- package/lib/cjs/table-row/index.js +44 -0
- package/lib/cjs/table-row/types.js +1 -0
- package/lib/cjs/tabs/index.js +82 -0
- package/lib/cjs/tabs/types.js +1 -0
- package/lib/cjs/tabs-icon-option/index.js +81 -0
- package/lib/cjs/tabs-icon-option/types.js +1 -0
- package/lib/cjs/tabs-option/index.js +88 -0
- package/lib/cjs/tabs-option/types.js +1 -0
- package/lib/cjs/tag/index.js +86 -0
- package/lib/cjs/tag/types.js +1 -0
- package/lib/cjs/tag/utils.js +14 -0
- package/lib/cjs/text/index.js +66 -0
- package/lib/cjs/text/types.js +1 -0
- package/lib/cjs/text/utils.js +7 -0
- package/lib/cjs/textarea/index.js +324 -0
- package/lib/cjs/textarea/types.js +1 -0
- package/lib/cjs/tile-control/index.js +112 -0
- package/lib/cjs/tile-control/types.js +1 -0
- package/lib/cjs/tile-control-option/index.js +100 -0
- package/lib/cjs/tile-control-option/types.js +1 -0
- package/lib/cjs/time-picker/index.js +339 -0
- package/lib/cjs/time-picker/types.js +1 -0
- package/lib/cjs/time-picker/utils.js +89 -0
- package/lib/cjs/title/index.js +62 -0
- package/lib/cjs/title/types.js +1 -0
- package/lib/cjs/title/utils.js +24 -0
- package/lib/cjs/toast/index.js +88 -0
- package/lib/cjs/toast/types.js +1 -0
- package/lib/cjs/toast/utils.js +7 -0
- package/lib/cjs/toast-manager/index.js +172 -0
- package/lib/cjs/toast-manager/types.js +1 -0
- package/lib/cjs/toast-manager/utils.js +7 -0
- package/lib/cjs/toggle/index.js +143 -0
- package/lib/cjs/toggle/types.js +1 -0
- package/lib/cjs/tooltip/index.js +277 -0
- package/lib/cjs/tooltip/tooltip-state.js +133 -0
- package/lib/cjs/tooltip/types.js +1 -0
- package/lib/cjs/tooltip/utils.js +25 -0
- package/lib/cjs/types.d.js +1 -0
- package/lib/cjs/utils/context.js +92 -0
- package/lib/cjs/utils/countries.js +9 -0
- package/lib/cjs/utils/csv.js +32 -0
- package/lib/cjs/utils/debounce.js +29 -0
- package/lib/cjs/utils/dom.js +183 -0
- package/lib/cjs/utils/element.js +58 -0
- package/lib/cjs/utils/event-target.js +36 -0
- package/lib/cjs/utils/get-react-event-handler.js +15 -0
- package/lib/cjs/utils/index.js +137 -0
- package/lib/cjs/utils/markdown.js +151 -0
- package/lib/cjs/utils/rect.js +37 -0
- package/lib/cjs/utils/size.js +9 -0
- package/lib/cjs/utils/slot.js +47 -0
- package/lib/cjs/utils/throttle.js +26 -0
- package/lib/cjs/utils/uid.js +20 -0
- package/lib/cjs/vertical-stepper/index.js +59 -0
- package/lib/cjs/vertical-stepper/types.js +1 -0
- package/lib/cjs/vertical-stepper-item/index.js +63 -0
- package/lib/cjs/vertical-stepper-item/types.js +1 -0
- package/lib/cjs/vertical-stepper-item/utils.js +7 -0
- package/lib/esm/accordion/index.d.ts +11 -0
- package/lib/esm/accordion/types.d.ts +21 -0
- package/lib/esm/accordion-item/index.d.ts +14 -0
- package/lib/esm/accordion-item/types.d.ts +36 -0
- package/lib/esm/accordion-item/utils.d.ts +2 -0
- package/lib/esm/action-menu/index.d.ts +11 -0
- package/lib/esm/action-menu/types.d.ts +13 -0
- package/lib/esm/action-menu-option/index.d.ts +12 -0
- package/lib/esm/action-menu-option/types.d.ts +23 -0
- package/lib/esm/action-menu-option/utils.d.ts +2 -0
- package/lib/esm/alert/index.d.ts +14 -0
- package/lib/esm/alert/types.d.ts +18 -0
- package/lib/esm/alert/utils.d.ts +2 -0
- package/lib/esm/avatar/index.d.ts +11 -0
- package/lib/esm/avatar/types.d.ts +37 -0
- package/lib/esm/avatar/utils.d.ts +4 -0
- package/lib/esm/badge/index.d.ts +11 -0
- package/lib/esm/badge/types.d.ts +34 -0
- package/lib/esm/badge/utils.d.ts +2 -0
- package/lib/esm/button/index.d.ts +11 -0
- package/lib/esm/button/types.d.ts +53 -0
- package/lib/esm/button/utils.d.ts +2 -0
- package/lib/esm/card/index.d.ts +13 -0
- package/lib/esm/card/types.d.ts +28 -0
- package/lib/esm/card-container/index.d.ts +11 -0
- package/lib/esm/card-container/types.d.ts +3 -0
- package/lib/esm/chat/index.d.ts +11 -0
- package/lib/esm/chat/types.d.ts +3 -0
- package/lib/esm/chat-block/index.d.ts +11 -0
- package/lib/esm/chat-block/types.d.ts +30 -0
- package/lib/esm/chat-bubble/index.d.ts +11 -0
- package/lib/esm/chat-bubble/types.d.ts +20 -0
- package/lib/esm/chat-bubble/utils.d.ts +3 -0
- package/lib/esm/checkbox/index.d.ts +11 -0
- package/lib/esm/checkbox/types.d.ts +49 -0
- package/lib/esm/chip/index.d.ts +13 -0
- package/lib/esm/chip/types.d.ts +37 -0
- package/lib/esm/chip/utils.d.ts +2 -0
- package/lib/esm/code-tag/index.d.ts +11 -0
- package/lib/esm/code-tag/types.d.ts +11 -0
- package/lib/esm/color-menu/index.d.ts +11 -0
- package/lib/esm/color-menu/types.d.ts +32 -0
- package/lib/esm/color-menu/utils.d.ts +1 -0
- package/lib/esm/color-menu-option/index.d.ts +13 -0
- package/lib/esm/color-menu-option/types.d.ts +11 -0
- package/lib/esm/color-menu-option/utils.d.ts +1 -0
- package/lib/esm/color-swatch/index.d.ts +12 -0
- package/lib/esm/color-swatch/types.d.ts +11 -0
- package/lib/esm/color-swatch/utils.d.ts +2 -0
- package/lib/esm/colors.json +88 -0
- package/lib/esm/date-picker/index.d.ts +14 -0
- package/lib/esm/date-picker/types.d.ts +70 -0
- package/lib/esm/date-picker/utils.d.ts +28 -0
- package/lib/esm/dialog/index.d.ts +15 -0
- package/lib/esm/dialog/types.d.ts +28 -0
- package/lib/esm/dialog/utils.d.ts +2 -0
- package/lib/esm/emoji/index.d.ts +11 -0
- package/lib/esm/emoji/types.d.ts +11 -0
- package/lib/esm/emoji/utils.d.ts +3 -0
- package/lib/esm/emoji-picker/data.json +1 -0
- package/lib/esm/emoji-picker/index.d.ts +22 -0
- package/lib/esm/emoji-picker/types.d.ts +26 -0
- package/lib/esm/field/index.d.ts +11 -0
- package/lib/esm/field/types.d.ts +35 -0
- package/lib/esm/file-drop/index.d.ts +13 -0
- package/lib/esm/file-drop/types.d.ts +50 -0
- package/lib/esm/file-drop/utils.d.ts +2 -0
- package/lib/esm/file-picker/index.d.ts +11 -0
- package/lib/esm/file-picker/types.d.ts +32 -0
- package/lib/esm/file-picker/utils.d.ts +1 -0
- package/lib/esm/file-status/index.d.ts +14 -0
- package/lib/esm/file-status/types.d.ts +18 -0
- package/lib/esm/file-status/utils.d.ts +2 -0
- package/lib/esm/flag/index.d.ts +11 -0
- package/lib/esm/flag/types.d.ts +11 -0
- package/lib/esm/flag/utils.d.ts +1 -0
- package/lib/esm/grid/index.d.ts +11 -0
- package/lib/esm/grid/types.d.ts +3 -0
- package/lib/esm/grid-item/index.d.ts +11 -0
- package/lib/esm/grid-item/types.d.ts +17 -0
- package/lib/esm/help-tooltip/index.d.ts +13 -0
- package/lib/esm/help-tooltip/types.d.ts +3 -0
- package/lib/esm/horizontal-stepper/index.d.ts +11 -0
- package/lib/esm/horizontal-stepper/types.d.ts +13 -0
- package/lib/esm/horizontal-stepper-item/index.d.ts +14 -0
- package/lib/esm/horizontal-stepper-item/types.d.ts +24 -0
- package/lib/esm/horizontal-stepper-item/utils.d.ts +2 -0
- package/lib/esm/icon/index.d.ts +11 -0
- package/lib/esm/icon/types.d.ts +11 -0
- package/lib/esm/icon-button/index.d.ts +12 -0
- package/lib/esm/icon-button/types.d.ts +44 -0
- package/lib/esm/icon-button/utils.d.ts +2 -0
- package/lib/esm/imports.d.js +0 -0
- package/lib/esm/imports.d.ts +9 -0
- package/lib/esm/inline-alert/index.d.ts +15 -0
- package/lib/esm/inline-alert/types.d.ts +15 -0
- package/lib/esm/inline-alert/utils.d.ts +2 -0
- package/lib/esm/input/index.d.ts +11 -0
- package/lib/esm/input/types.d.ts +86 -0
- package/lib/esm/input/utils.d.ts +26 -0
- package/lib/esm/link/index.d.ts +12 -0
- package/lib/esm/link/types.d.ts +59 -0
- package/lib/esm/list/index.d.ts +11 -0
- package/lib/esm/list/types.d.ts +3 -0
- package/lib/esm/list-item/index.d.ts +11 -0
- package/lib/esm/list-item/types.d.ts +3 -0
- package/lib/esm/pagination/index.d.ts +12 -0
- package/lib/esm/pagination/types.d.ts +16 -0
- package/lib/esm/pop/index.d.ts +11 -0
- package/lib/esm/pop/types.d.ts +35 -0
- package/lib/esm/pop/utils.d.ts +4 -0
- package/lib/esm/popover/index.d.ts +12 -0
- package/lib/esm/popover/types.d.ts +38 -0
- package/lib/esm/popover/utils.d.ts +4 -0
- package/lib/esm/progress/index.d.ts +12 -0
- package/lib/esm/progress/types.d.ts +12 -0
- package/lib/esm/progress-stepper/index.d.ts +11 -0
- package/lib/esm/progress-stepper/types.d.ts +22 -0
- package/lib/esm/progress-stepper-item/index.d.ts +12 -0
- package/lib/esm/progress-stepper-item/types.d.ts +23 -0
- package/lib/esm/progress-stepper-item/utils.d.ts +11 -0
- package/lib/esm/radio/index.d.ts +11 -0
- package/lib/esm/radio/types.d.ts +14 -0
- package/lib/esm/radio-option/index.d.ts +11 -0
- package/lib/esm/radio-option/types.d.ts +18 -0
- package/lib/esm/rich-text/index.d.ts +14 -0
- package/lib/esm/rich-text/types.d.ts +12 -0
- package/lib/esm/rich-text/utils.d.ts +7 -0
- package/lib/esm/rich-textarea/index.d.ts +11 -0
- package/lib/esm/rich-textarea/types.d.ts +48 -0
- package/lib/esm/rich-textarea/utils.d.ts +39 -0
- package/lib/esm/segment/index.d.ts +12 -0
- package/lib/esm/segment/types.d.ts +16 -0
- package/lib/esm/segment/utils.d.ts +3 -0
- package/lib/esm/segment-collapse/index.d.ts +13 -0
- package/lib/esm/segment-collapse/types.d.ts +11 -0
- package/lib/esm/segmented-control/index.d.ts +11 -0
- package/lib/esm/segmented-control/types.d.ts +11 -0
- package/lib/esm/segmented-control-option/index.d.ts +11 -0
- package/lib/esm/segmented-control-option/types.d.ts +19 -0
- package/lib/esm/segmented-icon-control/index.d.ts +11 -0
- package/lib/esm/segmented-icon-control/types.d.ts +14 -0
- package/lib/esm/segmented-icon-control-option/index.d.ts +11 -0
- package/lib/esm/segmented-icon-control-option/types.d.ts +16 -0
- package/lib/esm/select-button/index.d.ts +13 -0
- package/lib/esm/select-button/types.d.ts +50 -0
- package/lib/esm/select-menu/index.d.ts +15 -0
- package/lib/esm/select-menu/types.d.ts +41 -0
- package/lib/esm/select-menu-option/index.d.ts +28 -0
- package/lib/esm/select-menu-option/types.d.ts +26 -0
- package/lib/esm/skeleton/index.d.ts +11 -0
- package/lib/esm/skeleton/types.d.ts +9 -0
- package/lib/esm/skeleton-item/index.d.ts +11 -0
- package/lib/esm/skeleton-item/types.d.ts +13 -0
- package/lib/esm/spinner/index.d.ts +11 -0
- package/lib/esm/spinner/types.d.ts +12 -0
- package/lib/esm/standalone.d.ts +85 -0
- package/lib/esm/stop-events/index.d.ts +1 -0
- package/lib/esm/table/index.d.ts +11 -0
- package/lib/esm/table/types.d.ts +3 -0
- package/lib/esm/table-body/index.d.ts +11 -0
- package/lib/esm/table-body/types.d.ts +3 -0
- package/lib/esm/table-cell/index.d.ts +11 -0
- package/lib/esm/table-cell/types.d.ts +9 -0
- package/lib/esm/table-cell/utils.d.ts +2 -0
- package/lib/esm/table-head/index.d.ts +11 -0
- package/lib/esm/table-head/types.d.ts +3 -0
- package/lib/esm/table-head-cell/index.d.ts +12 -0
- package/lib/esm/table-head-cell/types.d.ts +15 -0
- package/lib/esm/table-row/index.d.ts +11 -0
- package/lib/esm/table-row/types.d.ts +11 -0
- package/lib/esm/tabs/index.d.ts +11 -0
- package/lib/esm/tabs/types.d.ts +18 -0
- package/lib/esm/tabs-icon-option/index.d.ts +11 -0
- package/lib/esm/tabs-icon-option/types.d.ts +19 -0
- package/lib/esm/tabs-option/index.d.ts +12 -0
- package/lib/esm/tabs-option/types.d.ts +25 -0
- package/lib/esm/tag/index.d.ts +12 -0
- package/lib/esm/tag/types.d.ts +23 -0
- package/lib/esm/tag/utils.d.ts +2 -0
- package/lib/esm/text/index.d.ts +11 -0
- package/lib/esm/text/types.d.ts +30 -0
- package/lib/esm/text/utils.d.ts +2 -0
- package/lib/esm/textarea/index.d.ts +11 -0
- package/lib/esm/textarea/types.d.ts +60 -0
- package/lib/esm/tile-control/index.d.ts +11 -0
- package/lib/esm/tile-control/types.d.ts +37 -0
- package/lib/esm/tile-control-option/index.d.ts +11 -0
- package/lib/esm/tile-control-option/types.d.ts +37 -0
- package/lib/esm/time-picker/index.d.ts +15 -0
- package/lib/esm/time-picker/types.d.ts +34 -0
- package/lib/esm/time-picker/utils.d.ts +11 -0
- package/lib/esm/title/index.d.ts +11 -0
- package/lib/esm/title/types.d.ts +31 -0
- package/lib/esm/title/utils.d.ts +3 -0
- package/lib/esm/toast/index.d.ts +13 -0
- package/lib/esm/toast/types.d.ts +28 -0
- package/lib/esm/toast/utils.d.ts +2 -0
- package/lib/esm/toast-manager/index.d.ts +13 -0
- package/lib/esm/toast-manager/types.d.ts +13 -0
- package/lib/esm/toast-manager/utils.d.ts +2 -0
- package/lib/esm/toggle/index.d.ts +11 -0
- package/lib/esm/toggle/types.d.ts +23 -0
- package/lib/esm/tooltip/index.d.ts +13 -0
- package/lib/esm/tooltip/tooltip-state.d.ts +19 -0
- package/lib/esm/tooltip/types.d.ts +42 -0
- package/lib/esm/tooltip/utils.d.ts +6 -0
- package/lib/esm/types.d.ts +14 -0
- package/lib/esm/utils/context.d.ts +20 -0
- package/lib/esm/utils/countries.d.ts +6 -0
- package/lib/esm/utils/countries.json +1217 -0
- package/lib/esm/utils/csv.d.ts +5 -0
- package/lib/esm/utils/debounce.d.ts +8 -0
- package/lib/esm/utils/dom.d.ts +34 -0
- package/lib/esm/utils/element.d.ts +16 -0
- package/lib/esm/utils/element.js +48 -0
- package/lib/esm/utils/event-target.d.ts +4 -0
- package/lib/esm/utils/get-react-event-handler.d.ts +1 -0
- package/lib/esm/utils/index.d.ts +12 -0
- package/lib/esm/utils/markdown.d.ts +19 -0
- package/lib/esm/utils/rect.d.ts +4 -0
- package/lib/esm/utils/size.d.ts +5 -0
- package/lib/esm/utils/slot.d.ts +4 -0
- package/lib/esm/utils/throttle.d.ts +4 -0
- package/lib/esm/utils/uid.d.ts +1 -0
- package/lib/esm/vertical-stepper/index.d.ts +11 -0
- package/lib/esm/vertical-stepper/types.d.ts +13 -0
- package/lib/esm/vertical-stepper/types.js +1 -0
- package/lib/esm/vertical-stepper-item/index.d.ts +14 -0
- package/lib/esm/vertical-stepper-item/types.d.ts +24 -0
- package/lib/esm/vertical-stepper-item/utils.d.ts +2 -0
- package/lib/package.json +1 -0
- package/package.json +33 -11
- package/standalone.ts +0 -93
- package/utils/element.js +0 -48
- /package/{accordion → lib/cjs/accordion}/index.d.ts +0 -0
- /package/{accordion → lib/cjs/accordion}/types.d.ts +0 -0
- /package/{accordion-item → lib/cjs/accordion-item}/index.d.ts +0 -0
- /package/{accordion-item → lib/cjs/accordion-item}/types.d.ts +0 -0
- /package/{accordion-item → lib/cjs/accordion-item}/utils.d.ts +0 -0
- /package/{action-menu → lib/cjs/action-menu}/index.d.ts +0 -0
- /package/{action-menu → lib/cjs/action-menu}/types.d.ts +0 -0
- /package/{action-menu-option → lib/cjs/action-menu-option}/index.d.ts +0 -0
- /package/{action-menu-option → lib/cjs/action-menu-option}/types.d.ts +0 -0
- /package/{action-menu-option → lib/cjs/action-menu-option}/utils.d.ts +0 -0
- /package/{alert → lib/cjs/alert}/index.d.ts +0 -0
- /package/{alert → lib/cjs/alert}/types.d.ts +0 -0
- /package/{alert → lib/cjs/alert}/utils.d.ts +0 -0
- /package/{avatar → lib/cjs/avatar}/index.d.ts +0 -0
- /package/{avatar → lib/cjs/avatar}/types.d.ts +0 -0
- /package/{avatar → lib/cjs/avatar}/utils.d.ts +0 -0
- /package/{badge → lib/cjs/badge}/index.d.ts +0 -0
- /package/{badge → lib/cjs/badge}/types.d.ts +0 -0
- /package/{badge → lib/cjs/badge}/utils.d.ts +0 -0
- /package/{button → lib/cjs/button}/index.d.ts +0 -0
- /package/{button → lib/cjs/button}/types.d.ts +0 -0
- /package/{button → lib/cjs/button}/utils.d.ts +0 -0
- /package/{card → lib/cjs/card}/index.d.ts +0 -0
- /package/{card → lib/cjs/card}/types.d.ts +0 -0
- /package/{card-container → lib/cjs/card-container}/index.d.ts +0 -0
- /package/{card-container → lib/cjs/card-container}/types.d.ts +0 -0
- /package/{chat → lib/cjs/chat}/index.d.ts +0 -0
- /package/{chat → lib/cjs/chat}/types.d.ts +0 -0
- /package/{chat-block → lib/cjs/chat-block}/index.d.ts +0 -0
- /package/{chat-block → lib/cjs/chat-block}/types.d.ts +0 -0
- /package/{chat-bubble → lib/cjs/chat-bubble}/index.d.ts +0 -0
- /package/{chat-bubble → lib/cjs/chat-bubble}/types.d.ts +0 -0
- /package/{chat-bubble → lib/cjs/chat-bubble}/utils.d.ts +0 -0
- /package/{checkbox → lib/cjs/checkbox}/index.d.ts +0 -0
- /package/{checkbox → lib/cjs/checkbox}/types.d.ts +0 -0
- /package/{chip → lib/cjs/chip}/index.d.ts +0 -0
- /package/{chip → lib/cjs/chip}/types.d.ts +0 -0
- /package/{chip → lib/cjs/chip}/utils.d.ts +0 -0
- /package/{code-tag → lib/cjs/code-tag}/index.d.ts +0 -0
- /package/{code-tag → lib/cjs/code-tag}/types.d.ts +0 -0
- /package/{color-menu → lib/cjs/color-menu}/index.d.ts +0 -0
- /package/{color-menu → lib/cjs/color-menu}/types.d.ts +0 -0
- /package/{color-menu → lib/cjs/color-menu}/utils.d.ts +0 -0
- /package/{color-menu-option → lib/cjs/color-menu-option}/index.d.ts +0 -0
- /package/{color-menu-option → lib/cjs/color-menu-option}/types.d.ts +0 -0
- /package/{color-menu-option → lib/cjs/color-menu-option}/utils.d.ts +0 -0
- /package/{color-swatch → lib/cjs/color-swatch}/index.d.ts +0 -0
- /package/{color-swatch → lib/cjs/color-swatch}/types.d.ts +0 -0
- /package/{color-swatch → lib/cjs/color-swatch}/utils.d.ts +0 -0
- /package/{colors.json → lib/cjs/colors.json} +0 -0
- /package/{date-picker → lib/cjs/date-picker}/index.d.ts +0 -0
- /package/{date-picker → lib/cjs/date-picker}/types.d.ts +0 -0
- /package/{date-picker → lib/cjs/date-picker}/utils.d.ts +0 -0
- /package/{dialog → lib/cjs/dialog}/index.d.ts +0 -0
- /package/{dialog → lib/cjs/dialog}/types.d.ts +0 -0
- /package/{dialog → lib/cjs/dialog}/utils.d.ts +0 -0
- /package/{emoji → lib/cjs/emoji}/index.d.ts +0 -0
- /package/{emoji → lib/cjs/emoji}/types.d.ts +0 -0
- /package/{emoji → lib/cjs/emoji}/utils.d.ts +0 -0
- /package/{emoji-picker → lib/cjs/emoji-picker}/data.json +0 -0
- /package/{emoji-picker → lib/cjs/emoji-picker}/index.d.ts +0 -0
- /package/{emoji-picker → lib/cjs/emoji-picker}/types.d.ts +0 -0
- /package/{field → lib/cjs/field}/index.d.ts +0 -0
- /package/{field → lib/cjs/field}/types.d.ts +0 -0
- /package/{file-drop → lib/cjs/file-drop}/index.d.ts +0 -0
- /package/{file-drop → lib/cjs/file-drop}/types.d.ts +0 -0
- /package/{file-drop → lib/cjs/file-drop}/utils.d.ts +0 -0
- /package/{file-picker → lib/cjs/file-picker}/index.d.ts +0 -0
- /package/{file-picker → lib/cjs/file-picker}/types.d.ts +0 -0
- /package/{file-picker → lib/cjs/file-picker}/utils.d.ts +0 -0
- /package/{file-status → lib/cjs/file-status}/index.d.ts +0 -0
- /package/{file-status → lib/cjs/file-status}/types.d.ts +0 -0
- /package/{file-status → lib/cjs/file-status}/utils.d.ts +0 -0
- /package/{flag → lib/cjs/flag}/index.d.ts +0 -0
- /package/{flag → lib/cjs/flag}/types.d.ts +0 -0
- /package/{flag → lib/cjs/flag}/utils.d.ts +0 -0
- /package/{grid → lib/cjs/grid}/index.d.ts +0 -0
- /package/{grid → lib/cjs/grid}/types.d.ts +0 -0
- /package/{grid-item → lib/cjs/grid-item}/index.d.ts +0 -0
- /package/{grid-item → lib/cjs/grid-item}/types.d.ts +0 -0
- /package/{help-tooltip → lib/cjs/help-tooltip}/index.d.ts +0 -0
- /package/{help-tooltip → lib/cjs/help-tooltip}/types.d.ts +0 -0
- /package/{horizontal-stepper → lib/cjs/horizontal-stepper}/index.d.ts +0 -0
- /package/{horizontal-stepper → lib/cjs/horizontal-stepper}/types.d.ts +0 -0
- /package/{horizontal-stepper-item → lib/cjs/horizontal-stepper-item}/index.d.ts +0 -0
- /package/{horizontal-stepper-item → lib/cjs/horizontal-stepper-item}/types.d.ts +0 -0
- /package/{horizontal-stepper-item → lib/cjs/horizontal-stepper-item}/utils.d.ts +0 -0
- /package/{icon → lib/cjs/icon}/index.d.ts +0 -0
- /package/{icon → lib/cjs/icon}/types.d.ts +0 -0
- /package/{icon-button → lib/cjs/icon-button}/index.d.ts +0 -0
- /package/{icon-button → lib/cjs/icon-button}/types.d.ts +0 -0
- /package/{icon-button → lib/cjs/icon-button}/utils.d.ts +0 -0
- /package/{inline-alert → lib/cjs/inline-alert}/index.d.ts +0 -0
- /package/{inline-alert → lib/cjs/inline-alert}/types.d.ts +0 -0
- /package/{inline-alert → lib/cjs/inline-alert}/utils.d.ts +0 -0
- /package/{input → lib/cjs/input}/index.d.ts +0 -0
- /package/{input → lib/cjs/input}/types.d.ts +0 -0
- /package/{input → lib/cjs/input}/utils.d.ts +0 -0
- /package/{link → lib/cjs/link}/index.d.ts +0 -0
- /package/{link → lib/cjs/link}/types.d.ts +0 -0
- /package/{list → lib/cjs/list}/index.d.ts +0 -0
- /package/{list → lib/cjs/list}/types.d.ts +0 -0
- /package/{list-item → lib/cjs/list-item}/index.d.ts +0 -0
- /package/{list-item → lib/cjs/list-item}/types.d.ts +0 -0
- /package/{pagination → lib/cjs/pagination}/index.d.ts +0 -0
- /package/{pagination → lib/cjs/pagination}/types.d.ts +0 -0
- /package/{pop → lib/cjs/pop}/index.d.ts +0 -0
- /package/{pop → lib/cjs/pop}/types.d.ts +0 -0
- /package/{pop → lib/cjs/pop}/utils.d.ts +0 -0
- /package/{popover → lib/cjs/popover}/index.d.ts +0 -0
- /package/{popover → lib/cjs/popover}/types.d.ts +0 -0
- /package/{popover → lib/cjs/popover}/utils.d.ts +0 -0
- /package/{progress → lib/cjs/progress}/index.d.ts +0 -0
- /package/{progress → lib/cjs/progress}/types.d.ts +0 -0
- /package/{progress-stepper → lib/cjs/progress-stepper}/index.d.ts +0 -0
- /package/{progress-stepper → lib/cjs/progress-stepper}/types.d.ts +0 -0
- /package/{progress-stepper-item → lib/cjs/progress-stepper-item}/index.d.ts +0 -0
- /package/{progress-stepper-item → lib/cjs/progress-stepper-item}/types.d.ts +0 -0
- /package/{progress-stepper-item → lib/cjs/progress-stepper-item}/utils.d.ts +0 -0
- /package/{radio → lib/cjs/radio}/index.d.ts +0 -0
- /package/{radio → lib/cjs/radio}/types.d.ts +0 -0
- /package/{radio-option → lib/cjs/radio-option}/index.d.ts +0 -0
- /package/{radio-option → lib/cjs/radio-option}/types.d.ts +0 -0
- /package/{rich-text → lib/cjs/rich-text}/index.d.ts +0 -0
- /package/{rich-text → lib/cjs/rich-text}/types.d.ts +0 -0
- /package/{rich-text → lib/cjs/rich-text}/utils.d.ts +0 -0
- /package/{rich-textarea → lib/cjs/rich-textarea}/index.d.ts +0 -0
- /package/{rich-textarea → lib/cjs/rich-textarea}/types.d.ts +0 -0
- /package/{rich-textarea → lib/cjs/rich-textarea}/utils.d.ts +0 -0
- /package/{segment → lib/cjs/segment}/index.d.ts +0 -0
- /package/{segment → lib/cjs/segment}/types.d.ts +0 -0
- /package/{segment → lib/cjs/segment}/utils.d.ts +0 -0
- /package/{segment-collapse → lib/cjs/segment-collapse}/index.d.ts +0 -0
- /package/{segment-collapse → lib/cjs/segment-collapse}/types.d.ts +0 -0
- /package/{segmented-control → lib/cjs/segmented-control}/index.d.ts +0 -0
- /package/{segmented-control → lib/cjs/segmented-control}/types.d.ts +0 -0
- /package/{segmented-control-option → lib/cjs/segmented-control-option}/index.d.ts +0 -0
- /package/{segmented-control-option → lib/cjs/segmented-control-option}/types.d.ts +0 -0
- /package/{segmented-icon-control → lib/cjs/segmented-icon-control}/index.d.ts +0 -0
- /package/{segmented-icon-control → lib/cjs/segmented-icon-control}/types.d.ts +0 -0
- /package/{segmented-icon-control-option → lib/cjs/segmented-icon-control-option}/index.d.ts +0 -0
- /package/{segmented-icon-control-option → lib/cjs/segmented-icon-control-option}/types.d.ts +0 -0
- /package/{select-button → lib/cjs/select-button}/index.d.ts +0 -0
- /package/{select-button → lib/cjs/select-button}/types.d.ts +0 -0
- /package/{select-menu → lib/cjs/select-menu}/index.d.ts +0 -0
- /package/{select-menu → lib/cjs/select-menu}/types.d.ts +0 -0
- /package/{select-menu-option → lib/cjs/select-menu-option}/index.d.ts +0 -0
- /package/{select-menu-option → lib/cjs/select-menu-option}/types.d.ts +0 -0
- /package/{skeleton → lib/cjs/skeleton}/index.d.ts +0 -0
- /package/{skeleton → lib/cjs/skeleton}/types.d.ts +0 -0
- /package/{skeleton-item → lib/cjs/skeleton-item}/index.d.ts +0 -0
- /package/{skeleton-item → lib/cjs/skeleton-item}/types.d.ts +0 -0
- /package/{spinner → lib/cjs/spinner}/index.d.ts +0 -0
- /package/{spinner → lib/cjs/spinner}/types.d.ts +0 -0
- /package/{standalone.d.ts → lib/cjs/standalone.d.ts} +0 -0
- /package/{stop-events → lib/cjs/stop-events}/index.d.ts +0 -0
- /package/{table → lib/cjs/table}/index.d.ts +0 -0
- /package/{table → lib/cjs/table}/types.d.ts +0 -0
- /package/{table-body → lib/cjs/table-body}/index.d.ts +0 -0
- /package/{table-body → lib/cjs/table-body}/types.d.ts +0 -0
- /package/{table-cell → lib/cjs/table-cell}/index.d.ts +0 -0
- /package/{table-cell → lib/cjs/table-cell}/types.d.ts +0 -0
- /package/{table-cell → lib/cjs/table-cell}/utils.d.ts +0 -0
- /package/{table-head → lib/cjs/table-head}/index.d.ts +0 -0
- /package/{table-head → lib/cjs/table-head}/types.d.ts +0 -0
- /package/{table-head-cell → lib/cjs/table-head-cell}/index.d.ts +0 -0
- /package/{table-head-cell → lib/cjs/table-head-cell}/types.d.ts +0 -0
- /package/{table-row → lib/cjs/table-row}/index.d.ts +0 -0
- /package/{table-row → lib/cjs/table-row}/types.d.ts +0 -0
- /package/{tabs → lib/cjs/tabs}/index.d.ts +0 -0
- /package/{tabs → lib/cjs/tabs}/types.d.ts +0 -0
- /package/{tabs-icon-option → lib/cjs/tabs-icon-option}/index.d.ts +0 -0
- /package/{tabs-icon-option → lib/cjs/tabs-icon-option}/types.d.ts +0 -0
- /package/{tabs-option → lib/cjs/tabs-option}/index.d.ts +0 -0
- /package/{tabs-option → lib/cjs/tabs-option}/types.d.ts +0 -0
- /package/{tag → lib/cjs/tag}/index.d.ts +0 -0
- /package/{tag → lib/cjs/tag}/types.d.ts +0 -0
- /package/{tag → lib/cjs/tag}/utils.d.ts +0 -0
- /package/{text → lib/cjs/text}/index.d.ts +0 -0
- /package/{text → lib/cjs/text}/types.d.ts +0 -0
- /package/{text → lib/cjs/text}/utils.d.ts +0 -0
- /package/{textarea → lib/cjs/textarea}/index.d.ts +0 -0
- /package/{textarea → lib/cjs/textarea}/types.d.ts +0 -0
- /package/{tile-control → lib/cjs/tile-control}/index.d.ts +0 -0
- /package/{tile-control → lib/cjs/tile-control}/types.d.ts +0 -0
- /package/{tile-control-option → lib/cjs/tile-control-option}/index.d.ts +0 -0
- /package/{tile-control-option → lib/cjs/tile-control-option}/types.d.ts +0 -0
- /package/{time-picker → lib/cjs/time-picker}/index.d.ts +0 -0
- /package/{time-picker → lib/cjs/time-picker}/types.d.ts +0 -0
- /package/{time-picker → lib/cjs/time-picker}/utils.d.ts +0 -0
- /package/{title → lib/cjs/title}/index.d.ts +0 -0
- /package/{title → lib/cjs/title}/types.d.ts +0 -0
- /package/{title → lib/cjs/title}/utils.d.ts +0 -0
- /package/{toast → lib/cjs/toast}/index.d.ts +0 -0
- /package/{toast → lib/cjs/toast}/types.d.ts +0 -0
- /package/{toast → lib/cjs/toast}/utils.d.ts +0 -0
- /package/{toast-manager → lib/cjs/toast-manager}/index.d.ts +0 -0
- /package/{toast-manager → lib/cjs/toast-manager}/types.d.ts +0 -0
- /package/{toast-manager → lib/cjs/toast-manager}/utils.d.ts +0 -0
- /package/{toggle → lib/cjs/toggle}/index.d.ts +0 -0
- /package/{toggle → lib/cjs/toggle}/types.d.ts +0 -0
- /package/{tooltip → lib/cjs/tooltip}/index.d.ts +0 -0
- /package/{tooltip → lib/cjs/tooltip}/tooltip-state.d.ts +0 -0
- /package/{tooltip → lib/cjs/tooltip}/types.d.ts +0 -0
- /package/{tooltip → lib/cjs/tooltip}/utils.d.ts +0 -0
- /package/{types.d.ts → lib/cjs/types.d.ts} +0 -0
- /package/{utils → lib/cjs/utils}/context.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/countries.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/countries.json +0 -0
- /package/{utils → lib/cjs/utils}/csv.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/debounce.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/dom.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/element.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/event-target.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/get-react-event-handler.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/index.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/markdown.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/rect.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/size.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/slot.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/throttle.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/uid.d.ts +0 -0
- /package/{vertical-stepper → lib/cjs/vertical-stepper}/index.d.ts +0 -0
- /package/{vertical-stepper → lib/cjs/vertical-stepper}/types.d.ts +0 -0
- /package/{vertical-stepper-item → lib/cjs/vertical-stepper-item}/index.d.ts +0 -0
- /package/{vertical-stepper-item → lib/cjs/vertical-stepper-item}/types.d.ts +0 -0
- /package/{vertical-stepper-item → lib/cjs/vertical-stepper-item}/utils.d.ts +0 -0
- /package/{accordion → lib/esm/accordion}/index.js +0 -0
- /package/{accordion → lib/esm/accordion}/types.js +0 -0
- /package/{accordion-item → lib/esm/accordion-item}/index.js +0 -0
- /package/{accordion-item → lib/esm/accordion-item}/types.js +0 -0
- /package/{accordion-item → lib/esm/accordion-item}/utils.js +0 -0
- /package/{action-menu → lib/esm/action-menu}/index.js +0 -0
- /package/{action-menu → lib/esm/action-menu}/types.js +0 -0
- /package/{action-menu-option → lib/esm/action-menu-option}/index.js +0 -0
- /package/{action-menu-option → lib/esm/action-menu-option}/types.js +0 -0
- /package/{action-menu-option → lib/esm/action-menu-option}/utils.js +0 -0
- /package/{alert → lib/esm/alert}/index.js +0 -0
- /package/{alert → lib/esm/alert}/types.js +0 -0
- /package/{alert → lib/esm/alert}/utils.js +0 -0
- /package/{avatar → lib/esm/avatar}/index.js +0 -0
- /package/{avatar → lib/esm/avatar}/types.js +0 -0
- /package/{avatar → lib/esm/avatar}/utils.js +0 -0
- /package/{badge → lib/esm/badge}/index.js +0 -0
- /package/{badge → lib/esm/badge}/types.js +0 -0
- /package/{badge → lib/esm/badge}/utils.js +0 -0
- /package/{button → lib/esm/button}/index.js +0 -0
- /package/{button → lib/esm/button}/types.js +0 -0
- /package/{button → lib/esm/button}/utils.js +0 -0
- /package/{card → lib/esm/card}/index.js +0 -0
- /package/{card → lib/esm/card}/types.js +0 -0
- /package/{card-container → lib/esm/card-container}/index.js +0 -0
- /package/{card-container → lib/esm/card-container}/types.js +0 -0
- /package/{chat → lib/esm/chat}/index.js +0 -0
- /package/{chat → lib/esm/chat}/types.js +0 -0
- /package/{chat-block → lib/esm/chat-block}/index.js +0 -0
- /package/{chat-block → lib/esm/chat-block}/types.js +0 -0
- /package/{chat-bubble → lib/esm/chat-bubble}/index.js +0 -0
- /package/{chat-bubble → lib/esm/chat-bubble}/types.js +0 -0
- /package/{chat-bubble → lib/esm/chat-bubble}/utils.js +0 -0
- /package/{checkbox → lib/esm/checkbox}/index.js +0 -0
- /package/{checkbox → lib/esm/checkbox}/types.js +0 -0
- /package/{chip → lib/esm/chip}/index.js +0 -0
- /package/{chip → lib/esm/chip}/types.js +0 -0
- /package/{chip → lib/esm/chip}/utils.js +0 -0
- /package/{code-tag → lib/esm/code-tag}/index.js +0 -0
- /package/{code-tag → lib/esm/code-tag}/types.js +0 -0
- /package/{color-menu → lib/esm/color-menu}/index.js +0 -0
- /package/{color-menu → lib/esm/color-menu}/types.js +0 -0
- /package/{color-menu → lib/esm/color-menu}/utils.js +0 -0
- /package/{color-menu-option → lib/esm/color-menu-option}/index.js +0 -0
- /package/{color-menu-option → lib/esm/color-menu-option}/types.js +0 -0
- /package/{color-menu-option → lib/esm/color-menu-option}/utils.js +0 -0
- /package/{color-swatch → lib/esm/color-swatch}/index.js +0 -0
- /package/{color-swatch → lib/esm/color-swatch}/types.js +0 -0
- /package/{color-swatch → lib/esm/color-swatch}/utils.js +0 -0
- /package/{date-picker → lib/esm/date-picker}/index.js +0 -0
- /package/{date-picker → lib/esm/date-picker}/types.js +0 -0
- /package/{date-picker → lib/esm/date-picker}/utils.js +0 -0
- /package/{dialog → lib/esm/dialog}/index.js +0 -0
- /package/{dialog → lib/esm/dialog}/types.js +0 -0
- /package/{dialog → lib/esm/dialog}/utils.js +0 -0
- /package/{emoji → lib/esm/emoji}/index.js +0 -0
- /package/{emoji → lib/esm/emoji}/types.js +0 -0
- /package/{emoji → lib/esm/emoji}/utils.js +0 -0
- /package/{emoji-picker → lib/esm/emoji-picker}/index.js +0 -0
- /package/{emoji-picker → lib/esm/emoji-picker}/types.js +0 -0
- /package/{field → lib/esm/field}/index.js +0 -0
- /package/{field → lib/esm/field}/types.js +0 -0
- /package/{file-drop → lib/esm/file-drop}/index.js +0 -0
- /package/{file-drop → lib/esm/file-drop}/types.js +0 -0
- /package/{file-drop → lib/esm/file-drop}/utils.js +0 -0
- /package/{file-picker → lib/esm/file-picker}/index.js +0 -0
- /package/{file-picker → lib/esm/file-picker}/types.js +0 -0
- /package/{file-picker → lib/esm/file-picker}/utils.js +0 -0
- /package/{file-status → lib/esm/file-status}/index.js +0 -0
- /package/{file-status → lib/esm/file-status}/types.js +0 -0
- /package/{file-status → lib/esm/file-status}/utils.js +0 -0
- /package/{flag → lib/esm/flag}/index.js +0 -0
- /package/{flag → lib/esm/flag}/types.js +0 -0
- /package/{flag → lib/esm/flag}/utils.js +0 -0
- /package/{grid → lib/esm/grid}/index.js +0 -0
- /package/{grid → lib/esm/grid}/types.js +0 -0
- /package/{grid-item → lib/esm/grid-item}/index.js +0 -0
- /package/{grid-item → lib/esm/grid-item}/types.js +0 -0
- /package/{help-tooltip → lib/esm/help-tooltip}/index.js +0 -0
- /package/{help-tooltip → lib/esm/help-tooltip}/types.js +0 -0
- /package/{horizontal-stepper → lib/esm/horizontal-stepper}/index.js +0 -0
- /package/{horizontal-stepper → lib/esm/horizontal-stepper}/types.js +0 -0
- /package/{horizontal-stepper-item → lib/esm/horizontal-stepper-item}/index.js +0 -0
- /package/{horizontal-stepper-item → lib/esm/horizontal-stepper-item}/types.js +0 -0
- /package/{horizontal-stepper-item → lib/esm/horizontal-stepper-item}/utils.js +0 -0
- /package/{icon → lib/esm/icon}/index.js +0 -0
- /package/{icon → lib/esm/icon}/types.js +0 -0
- /package/{icon-button → lib/esm/icon-button}/index.js +0 -0
- /package/{icon-button → lib/esm/icon-button}/types.js +0 -0
- /package/{icon-button → lib/esm/icon-button}/utils.js +0 -0
- /package/{inline-alert → lib/esm/inline-alert}/index.js +0 -0
- /package/{inline-alert → lib/esm/inline-alert}/types.js +0 -0
- /package/{inline-alert → lib/esm/inline-alert}/utils.js +0 -0
- /package/{input → lib/esm/input}/index.js +0 -0
- /package/{input → lib/esm/input}/types.js +0 -0
- /package/{input → lib/esm/input}/utils.js +0 -0
- /package/{link → lib/esm/link}/index.js +0 -0
- /package/{link → lib/esm/link}/types.js +0 -0
- /package/{list → lib/esm/list}/index.js +0 -0
- /package/{list → lib/esm/list}/types.js +0 -0
- /package/{list-item → lib/esm/list-item}/index.js +0 -0
- /package/{list-item → lib/esm/list-item}/types.js +0 -0
- /package/{pagination → lib/esm/pagination}/index.js +0 -0
- /package/{pagination → lib/esm/pagination}/types.js +0 -0
- /package/{pop → lib/esm/pop}/index.js +0 -0
- /package/{pop → lib/esm/pop}/types.js +0 -0
- /package/{pop → lib/esm/pop}/utils.js +0 -0
- /package/{popover → lib/esm/popover}/index.js +0 -0
- /package/{popover → lib/esm/popover}/types.js +0 -0
- /package/{popover → lib/esm/popover}/utils.js +0 -0
- /package/{progress → lib/esm/progress}/index.js +0 -0
- /package/{progress → lib/esm/progress}/types.js +0 -0
- /package/{progress-stepper → lib/esm/progress-stepper}/index.js +0 -0
- /package/{progress-stepper → lib/esm/progress-stepper}/types.js +0 -0
- /package/{progress-stepper-item → lib/esm/progress-stepper-item}/index.js +0 -0
- /package/{progress-stepper-item → lib/esm/progress-stepper-item}/types.js +0 -0
- /package/{progress-stepper-item → lib/esm/progress-stepper-item}/utils.js +0 -0
- /package/{radio → lib/esm/radio}/index.js +0 -0
- /package/{radio → lib/esm/radio}/types.js +0 -0
- /package/{radio-option → lib/esm/radio-option}/index.js +0 -0
- /package/{radio-option → lib/esm/radio-option}/types.js +0 -0
- /package/{rich-text → lib/esm/rich-text}/index.js +0 -0
- /package/{rich-text → lib/esm/rich-text}/types.js +0 -0
- /package/{rich-text → lib/esm/rich-text}/utils.js +0 -0
- /package/{rich-textarea → lib/esm/rich-textarea}/index.js +0 -0
- /package/{rich-textarea → lib/esm/rich-textarea}/types.js +0 -0
- /package/{rich-textarea → lib/esm/rich-textarea}/utils.js +0 -0
- /package/{segment → lib/esm/segment}/index.js +0 -0
- /package/{segment → lib/esm/segment}/types.js +0 -0
- /package/{segment → lib/esm/segment}/utils.js +0 -0
- /package/{segment-collapse → lib/esm/segment-collapse}/index.js +0 -0
- /package/{segment-collapse → lib/esm/segment-collapse}/types.js +0 -0
- /package/{segmented-control → lib/esm/segmented-control}/index.js +0 -0
- /package/{segmented-control → lib/esm/segmented-control}/types.js +0 -0
- /package/{segmented-control-option → lib/esm/segmented-control-option}/index.js +0 -0
- /package/{segmented-control-option → lib/esm/segmented-control-option}/types.js +0 -0
- /package/{segmented-icon-control → lib/esm/segmented-icon-control}/index.js +0 -0
- /package/{segmented-icon-control → lib/esm/segmented-icon-control}/types.js +0 -0
- /package/{segmented-icon-control-option → lib/esm/segmented-icon-control-option}/index.js +0 -0
- /package/{segmented-icon-control-option → lib/esm/segmented-icon-control-option}/types.js +0 -0
- /package/{select-button → lib/esm/select-button}/index.js +0 -0
- /package/{select-button → lib/esm/select-button}/types.js +0 -0
- /package/{select-menu → lib/esm/select-menu}/index.js +0 -0
- /package/{select-menu → lib/esm/select-menu}/types.js +0 -0
- /package/{select-menu-option → lib/esm/select-menu-option}/index.js +0 -0
- /package/{select-menu-option → lib/esm/select-menu-option}/types.js +0 -0
- /package/{skeleton → lib/esm/skeleton}/index.js +0 -0
- /package/{skeleton → lib/esm/skeleton}/types.js +0 -0
- /package/{skeleton-item → lib/esm/skeleton-item}/index.js +0 -0
- /package/{skeleton-item → lib/esm/skeleton-item}/types.js +0 -0
- /package/{spinner → lib/esm/spinner}/index.js +0 -0
- /package/{spinner → lib/esm/spinner}/types.js +0 -0
- /package/{standalone.js → lib/esm/standalone.js} +0 -0
- /package/{stop-events → lib/esm/stop-events}/index.js +0 -0
- /package/{table → lib/esm/table}/index.js +0 -0
- /package/{table → lib/esm/table}/types.js +0 -0
- /package/{table-body → lib/esm/table-body}/index.js +0 -0
- /package/{table-body → lib/esm/table-body}/types.js +0 -0
- /package/{table-cell → lib/esm/table-cell}/index.js +0 -0
- /package/{table-cell → lib/esm/table-cell}/types.js +0 -0
- /package/{table-cell → lib/esm/table-cell}/utils.js +0 -0
- /package/{table-head → lib/esm/table-head}/index.js +0 -0
- /package/{table-head → lib/esm/table-head}/types.js +0 -0
- /package/{table-head-cell → lib/esm/table-head-cell}/index.js +0 -0
- /package/{table-head-cell → lib/esm/table-head-cell}/types.js +0 -0
- /package/{table-row → lib/esm/table-row}/index.js +0 -0
- /package/{table-row → lib/esm/table-row}/types.js +0 -0
- /package/{tabs → lib/esm/tabs}/index.js +0 -0
- /package/{tabs → lib/esm/tabs}/types.js +0 -0
- /package/{tabs-icon-option → lib/esm/tabs-icon-option}/index.js +0 -0
- /package/{tabs-icon-option → lib/esm/tabs-icon-option}/types.js +0 -0
- /package/{tabs-option → lib/esm/tabs-option}/index.js +0 -0
- /package/{tabs-option → lib/esm/tabs-option}/types.js +0 -0
- /package/{tag → lib/esm/tag}/index.js +0 -0
- /package/{tag → lib/esm/tag}/types.js +0 -0
- /package/{tag → lib/esm/tag}/utils.js +0 -0
- /package/{text → lib/esm/text}/index.js +0 -0
- /package/{text → lib/esm/text}/types.js +0 -0
- /package/{text → lib/esm/text}/utils.js +0 -0
- /package/{textarea → lib/esm/textarea}/index.js +0 -0
- /package/{textarea → lib/esm/textarea}/types.js +0 -0
- /package/{tile-control → lib/esm/tile-control}/index.js +0 -0
- /package/{tile-control → lib/esm/tile-control}/types.js +0 -0
- /package/{tile-control-option → lib/esm/tile-control-option}/index.js +0 -0
- /package/{tile-control-option → lib/esm/tile-control-option}/types.js +0 -0
- /package/{time-picker → lib/esm/time-picker}/index.js +0 -0
- /package/{time-picker → lib/esm/time-picker}/types.js +0 -0
- /package/{time-picker → lib/esm/time-picker}/utils.js +0 -0
- /package/{title → lib/esm/title}/index.js +0 -0
- /package/{title → lib/esm/title}/types.js +0 -0
- /package/{title → lib/esm/title}/utils.js +0 -0
- /package/{toast → lib/esm/toast}/index.js +0 -0
- /package/{toast → lib/esm/toast}/types.js +0 -0
- /package/{toast → lib/esm/toast}/utils.js +0 -0
- /package/{toast-manager → lib/esm/toast-manager}/index.js +0 -0
- /package/{toast-manager → lib/esm/toast-manager}/types.js +0 -0
- /package/{toast-manager → lib/esm/toast-manager}/utils.js +0 -0
- /package/{toggle → lib/esm/toggle}/index.js +0 -0
- /package/{toggle → lib/esm/toggle}/types.js +0 -0
- /package/{tooltip → lib/esm/tooltip}/index.js +0 -0
- /package/{tooltip → lib/esm/tooltip}/tooltip-state.js +0 -0
- /package/{tooltip → lib/esm/tooltip}/types.js +0 -0
- /package/{tooltip → lib/esm/tooltip}/utils.js +0 -0
- /package/{vertical-stepper-item/types.js → lib/esm/types.d.js} +0 -0
- /package/{utils → lib/esm/utils}/context.js +0 -0
- /package/{utils → lib/esm/utils}/countries.js +0 -0
- /package/{utils → lib/esm/utils}/csv.js +0 -0
- /package/{utils → lib/esm/utils}/debounce.js +0 -0
- /package/{utils → lib/esm/utils}/dom.js +0 -0
- /package/{utils → lib/esm/utils}/event-target.js +0 -0
- /package/{utils → lib/esm/utils}/get-react-event-handler.js +0 -0
- /package/{utils → lib/esm/utils}/index.js +0 -0
- /package/{utils → lib/esm/utils}/markdown.js +0 -0
- /package/{utils → lib/esm/utils}/rect.js +0 -0
- /package/{utils → lib/esm/utils}/size.js +0 -0
- /package/{utils → lib/esm/utils}/slot.js +0 -0
- /package/{utils → lib/esm/utils}/throttle.js +0 -0
- /package/{utils → lib/esm/utils}/uid.js +0 -0
- /package/{vertical-stepper → lib/esm/vertical-stepper}/index.js +0 -0
- /package/{vertical-stepper-item → lib/esm/vertical-stepper-item}/index.js +0 -0
- /package/{vertical-stepper → lib/esm/vertical-stepper-item}/types.js +0 -0
- /package/{vertical-stepper-item → lib/esm/vertical-stepper-item}/utils.js +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.statusValues = exports.getAvatarColorFg = exports.getAvatarColorBg = void 0;
|
|
7
|
+
const statusValues = exports.statusValues = ['online', 'busy', 'away', 'offline'];
|
|
8
|
+
const getAvatarColorBg = id => {
|
|
9
|
+
return `var(--sinch-comp-avatar-container-color-${id}-background)`;
|
|
10
|
+
};
|
|
11
|
+
exports.getAvatarColorBg = getAvatarColorBg;
|
|
12
|
+
const getAvatarColorFg = id => {
|
|
13
|
+
return `var(--sinch-comp-avatar-container-color-${id}-foreground)`;
|
|
14
|
+
};
|
|
15
|
+
exports.getAvatarColorFg = getAvatarColorFg;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require('../utils');
|
|
4
|
+
var _size = require('../utils/size');
|
|
5
|
+
var _utils2 = require('./utils');
|
|
6
|
+
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>';
|
|
7
|
+
const template = document.createElement('template');
|
|
8
|
+
template.innerHTML = templateHTML;
|
|
9
|
+
(0, _utils.defineCustomElement)('sinch-badge', class extends _utils.NectaryElement {
|
|
10
|
+
#$badgeWrapper;
|
|
11
|
+
#$badge;
|
|
12
|
+
#$text;
|
|
13
|
+
#observer;
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
const shadowRoot = this.attachShadow();
|
|
17
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
18
|
+
this.#$badgeWrapper = shadowRoot.querySelector('#badge-wrapper');
|
|
19
|
+
this.#$badge = shadowRoot.querySelector('#badge');
|
|
20
|
+
this.#$text = shadowRoot.querySelector('#text');
|
|
21
|
+
this.#observer = new ResizeObserver(this.#onResize);
|
|
22
|
+
}
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
super.connectedCallback();
|
|
25
|
+
this.#observer.observe(this);
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
super.disconnectedCallback();
|
|
29
|
+
this.#observer.unobserve(this);
|
|
30
|
+
}
|
|
31
|
+
static get observedAttributes() {
|
|
32
|
+
return ['text', 'size', 'mode', 'hidden'];
|
|
33
|
+
}
|
|
34
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
35
|
+
if ((0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
switch (name) {
|
|
39
|
+
case 'text':
|
|
40
|
+
{
|
|
41
|
+
this.#$text.textContent = newVal;
|
|
42
|
+
(0, _utils.setClass)(this.#$badge, 'long', newVal !== null && newVal.length > 1);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
case 'size':
|
|
46
|
+
{
|
|
47
|
+
this.#updatePosition();
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
case 'mode':
|
|
51
|
+
{
|
|
52
|
+
this.#updatePosition();
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case 'hidden':
|
|
56
|
+
{
|
|
57
|
+
this.#updatePosition();
|
|
58
|
+
(0, _utils.updateBooleanAttribute)(this, name, (0, _utils.isAttrTrue)(newVal));
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
get text() {
|
|
64
|
+
return (0, _utils.getAttribute)(this, 'text', '');
|
|
65
|
+
}
|
|
66
|
+
set text(value) {
|
|
67
|
+
(0, _utils.updateAttribute)(this, 'text', value);
|
|
68
|
+
}
|
|
69
|
+
get size() {
|
|
70
|
+
return (0, _utils.getLiteralAttribute)(this, _size.sizeValues, 'size', _size.DEFAULT_SIZE);
|
|
71
|
+
}
|
|
72
|
+
set size(value) {
|
|
73
|
+
(0, _utils.updateLiteralAttribute)(this, _size.sizeValues, 'size', value);
|
|
74
|
+
}
|
|
75
|
+
get mode() {
|
|
76
|
+
return (0, _utils.getLiteralAttribute)(this, _utils2.modeValues, 'mode', 'square');
|
|
77
|
+
}
|
|
78
|
+
set mode(value) {
|
|
79
|
+
(0, _utils.updateLiteralAttribute)(this, _utils2.modeValues, 'mode', value);
|
|
80
|
+
}
|
|
81
|
+
get hidden() {
|
|
82
|
+
return (0, _utils.getBooleanAttribute)(this, 'hidden');
|
|
83
|
+
}
|
|
84
|
+
set hidden(isHidden) {
|
|
85
|
+
(0, _utils.updateBooleanAttribute)(this, 'hidden', isHidden);
|
|
86
|
+
}
|
|
87
|
+
get badgeRect() {
|
|
88
|
+
if (this.hidden) {
|
|
89
|
+
const selfRect = (0, _utils.getRect)(this);
|
|
90
|
+
return {
|
|
91
|
+
x: selfRect.x + selfRect.width,
|
|
92
|
+
y: selfRect.y,
|
|
93
|
+
width: 0,
|
|
94
|
+
height: 0
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return (0, _utils.getRect)(this.#$badgeWrapper);
|
|
98
|
+
}
|
|
99
|
+
#updatePosition() {
|
|
100
|
+
if (this.hidden) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const mode = this.mode;
|
|
104
|
+
const targetRect = this.getBoundingClientRect();
|
|
105
|
+
const badgeRect = this.#$badgeWrapper.getBoundingClientRect();
|
|
106
|
+
const offsetMultX = mode === 'circle' ? 0.85 : 1;
|
|
107
|
+
const offsetMultY = mode === 'circle' ? 0.15 : 0;
|
|
108
|
+
const posX = Math.round(targetRect.width * offsetMultX - badgeRect.height / 2);
|
|
109
|
+
const posY = Math.round(targetRect.height * offsetMultY - badgeRect.height / 2);
|
|
110
|
+
this.#$badgeWrapper.style.setProperty('left', `${posX}px`);
|
|
111
|
+
this.#$badgeWrapper.style.setProperty('top', `${posY}px`);
|
|
112
|
+
}
|
|
113
|
+
#onResize = () => {
|
|
114
|
+
this.#updatePosition();
|
|
115
|
+
};
|
|
116
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require('../utils');
|
|
4
|
+
var _size = require('../utils/size');
|
|
5
|
+
var _utils2 = require('./utils');
|
|
6
|
+
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>';
|
|
7
|
+
const template = document.createElement('template');
|
|
8
|
+
template.innerHTML = templateHTML;
|
|
9
|
+
(0, _utils.defineCustomElement)('sinch-button', class extends _utils.NectaryElement {
|
|
10
|
+
#$button;
|
|
11
|
+
#$text;
|
|
12
|
+
#controller = null;
|
|
13
|
+
#sizeContext;
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
const shadowRoot = this.attachShadow();
|
|
17
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
18
|
+
this.#$button = shadowRoot.querySelector('#button');
|
|
19
|
+
this.#$text = shadowRoot.querySelector('#text');
|
|
20
|
+
this.#sizeContext = new _utils.Context(this.#$button, 'size');
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback();
|
|
24
|
+
this.#controller = new AbortController();
|
|
25
|
+
const {
|
|
26
|
+
signal
|
|
27
|
+
} = this.#controller;
|
|
28
|
+
this.role = 'button';
|
|
29
|
+
this.tabIndex = 0;
|
|
30
|
+
this.addEventListener('click', this.#onButtonClick, {
|
|
31
|
+
signal
|
|
32
|
+
});
|
|
33
|
+
this.addEventListener('focus', this.#onButtonFocus, {
|
|
34
|
+
signal
|
|
35
|
+
});
|
|
36
|
+
this.addEventListener('blur', this.#onButtonBlur, {
|
|
37
|
+
signal
|
|
38
|
+
});
|
|
39
|
+
this.addEventListener('keydown', this.#onButtonKeydown, {
|
|
40
|
+
signal
|
|
41
|
+
});
|
|
42
|
+
this.addEventListener('-click', this.#onClickReactHandler, {
|
|
43
|
+
signal
|
|
44
|
+
});
|
|
45
|
+
this.addEventListener('-focus', this.#onFocusReactHandler, {
|
|
46
|
+
signal
|
|
47
|
+
});
|
|
48
|
+
this.addEventListener('-blur', this.#onBlurReactHandler, {
|
|
49
|
+
signal
|
|
50
|
+
});
|
|
51
|
+
(0, _utils.subscribeContext)(this, 'size', this.#onContextSize, signal);
|
|
52
|
+
this.#sizeContext.listen(signal);
|
|
53
|
+
this.#onSizeUpdate();
|
|
54
|
+
}
|
|
55
|
+
disconnectedCallback() {
|
|
56
|
+
super.disconnectedCallback();
|
|
57
|
+
this.#controller.abort();
|
|
58
|
+
this.#controller = null;
|
|
59
|
+
}
|
|
60
|
+
static get observedAttributes() {
|
|
61
|
+
return ['text', 'disabled', 'toggled', 'size', 'data-size'];
|
|
62
|
+
}
|
|
63
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
64
|
+
switch (name) {
|
|
65
|
+
case 'text':
|
|
66
|
+
{
|
|
67
|
+
this.#$text.textContent = newVal;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case 'disabled':
|
|
71
|
+
{
|
|
72
|
+
if (!(0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
73
|
+
(0, _utils.updateBooleanAttribute)(this, 'disabled', (0, _utils.isAttrTrue)(newVal));
|
|
74
|
+
}
|
|
75
|
+
this.ariaDisabled = (0, _utils.isAttrTrue)(newVal).toString();
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
case 'toggled':
|
|
79
|
+
{
|
|
80
|
+
if (!(0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
81
|
+
(0, _utils.updateBooleanAttribute)(this, 'toggled', (0, _utils.isAttrTrue)(newVal));
|
|
82
|
+
}
|
|
83
|
+
this.ariaPressed = (0, _utils.isAttrTrue)(newVal).toString();
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case 'size':
|
|
87
|
+
{
|
|
88
|
+
(0, _utils.updateAttribute)(this, 'data-size', newVal);
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case 'data-size':
|
|
92
|
+
{
|
|
93
|
+
this.#onSizeUpdate();
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
set type(value) {
|
|
99
|
+
(0, _utils.updateLiteralAttribute)(this, _utils2.typeValues, 'type', value);
|
|
100
|
+
}
|
|
101
|
+
get type() {
|
|
102
|
+
return (0, _utils.getLiteralAttribute)(this, _utils2.typeValues, 'type', 'primary');
|
|
103
|
+
}
|
|
104
|
+
set text(value) {
|
|
105
|
+
(0, _utils.updateAttribute)(this, 'text', value);
|
|
106
|
+
}
|
|
107
|
+
get text() {
|
|
108
|
+
return (0, _utils.getAttribute)(this, 'text', '');
|
|
109
|
+
}
|
|
110
|
+
set disabled(isDisabled) {
|
|
111
|
+
(0, _utils.updateBooleanAttribute)(this, 'disabled', isDisabled);
|
|
112
|
+
}
|
|
113
|
+
get disabled() {
|
|
114
|
+
return (0, _utils.getBooleanAttribute)(this, 'disabled');
|
|
115
|
+
}
|
|
116
|
+
set toggled(isToggled) {
|
|
117
|
+
(0, _utils.updateBooleanAttribute)(this, 'toggled', isToggled);
|
|
118
|
+
}
|
|
119
|
+
get toggled() {
|
|
120
|
+
return (0, _utils.getBooleanAttribute)(this, 'toggled');
|
|
121
|
+
}
|
|
122
|
+
set size(size) {
|
|
123
|
+
(0, _utils.updateLiteralAttribute)(this, _size.sizeExValues, 'size', size);
|
|
124
|
+
}
|
|
125
|
+
get size() {
|
|
126
|
+
return (0, _utils.getLiteralAttribute)(this, _size.sizeExValues, 'size', _size.DEFAULT_SIZE);
|
|
127
|
+
}
|
|
128
|
+
get focusable() {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
#onSizeUpdate() {
|
|
132
|
+
if (!this.isDomConnected) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const size = (0, _utils.getAttribute)(this, 'data-size', _size.DEFAULT_SIZE);
|
|
136
|
+
this.#sizeContext.dispatch(size);
|
|
137
|
+
}
|
|
138
|
+
#onContextSize = e => {
|
|
139
|
+
if (this.hasAttribute('size')) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
switch (e.detail) {
|
|
143
|
+
case 'l':
|
|
144
|
+
{
|
|
145
|
+
this.setAttribute('data-size', 'm');
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
default:
|
|
149
|
+
{
|
|
150
|
+
this.setAttribute('data-size', 's');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
#onButtonKeydown = e => {
|
|
155
|
+
switch (e.code) {
|
|
156
|
+
case 'Space':
|
|
157
|
+
case 'Enter':
|
|
158
|
+
{
|
|
159
|
+
e.preventDefault();
|
|
160
|
+
this.click();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
#onButtonClick = () => {
|
|
165
|
+
if (!this.disabled) {
|
|
166
|
+
this.dispatchEvent(new CustomEvent('-click'));
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
#onButtonFocus = () => {
|
|
170
|
+
this.dispatchEvent(new CustomEvent('-focus'));
|
|
171
|
+
};
|
|
172
|
+
#onButtonBlur = () => {
|
|
173
|
+
this.dispatchEvent(new CustomEvent('-blur'));
|
|
174
|
+
};
|
|
175
|
+
#onFocusReactHandler = () => {
|
|
176
|
+
(0, _utils.getReactEventHandler)(this, 'on-focus')?.();
|
|
177
|
+
};
|
|
178
|
+
#onBlurReactHandler = () => {
|
|
179
|
+
(0, _utils.getReactEventHandler)(this, 'on-blur')?.();
|
|
180
|
+
};
|
|
181
|
+
#onClickReactHandler = e => {
|
|
182
|
+
(0, _utils.getReactEventHandler)(this, 'on-click')?.(e);
|
|
183
|
+
};
|
|
184
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.typeValues = void 0;
|
|
7
|
+
const typeValues = exports.typeValues = ['primary', 'secondary', 'subtle-primary', 'subtle-secondary', 'cta-primary', 'cta-secondary', 'destructive'];
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require('../title');
|
|
4
|
+
require('../text');
|
|
5
|
+
var _utils = require('../utils');
|
|
6
|
+
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{border-radius:var(--sinch-comp-card-shape-radius);border:1px solid var(--sinch-comp-card-color-white-default-border-initial);background-color:var(--sinch-comp-card-color-white-default-background-initial);box-shadow:var(--sinch-comp-card-shadow-initial);overflow:hidden}:host(:hover) #wrapper{box-shadow:var(--sinch-comp-card-shadow-hover)}#card-body{padding:24px;box-sizing:border-box;display:flex;flex-direction:column;gap:16px}#illustration-wrapper{display:none;overflow:hidden;height:240px}#illustration-wrapper.active{display:block}#label{--sinch-comp-text-font:var(--sinch-comp-card-font-label);--sinch-global-color-text:var(--sinch-comp-card-color-white-default-title-initial)}#label:empty{display:none}#header{display:flex;flex-direction:row;align-items:center;gap:8px;--sinch-global-size-icon:var(--sinch-comp-card-size-icon)}#caption{flex:1;min-width:0;--sinch-comp-title-font:var(--sinch-comp-card-font-title);--sinch-global-color-text:var(--sinch-comp-card-color-white-default-title-initial)}#description{flex:1;min-height:0;max-height:120px;overflow-y:auto;--sinch-comp-text-font:var(--sinch-comp-card-font-description);--sinch-global-color-text:var(--sinch-comp-card-color-white-default-description-initial)}#description:empty{display:none}slot[name=action]::slotted(*){margin-top:20px;align-self:flex-start;max-width:100%}:host([draggable=true]) #header{cursor:grab}</style><div id="wrapper"><div id="illustration-wrapper"><slot name="illustration"></slot></div><div id="card-body"><sinch-text id="label" type="s" emphasized ellipsis></sinch-text><div id="header"><slot name="icon"></slot><sinch-title id="caption" type="m" level="3" ellipsis></sinch-title></div><sinch-text id="description" type="m"></sinch-text><slot name="action"></slot></div></div>';
|
|
7
|
+
const template = document.createElement('template');
|
|
8
|
+
template.innerHTML = templateHTML;
|
|
9
|
+
(0, _utils.defineCustomElement)('sinch-card', class extends _utils.NectaryElement {
|
|
10
|
+
#$text;
|
|
11
|
+
#$label;
|
|
12
|
+
#$caption;
|
|
13
|
+
#$header;
|
|
14
|
+
#$cardBody;
|
|
15
|
+
#$iconSlot;
|
|
16
|
+
#$illustrationSlot;
|
|
17
|
+
#$illustrationSlotWrapper;
|
|
18
|
+
#isDraggingCorrectHandle = false;
|
|
19
|
+
#isDraggingSubscribed = false;
|
|
20
|
+
#controller = null;
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
const shadowRoot = this.attachShadow();
|
|
24
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
25
|
+
this.#$text = shadowRoot.querySelector('#description');
|
|
26
|
+
this.#$label = shadowRoot.querySelector('#label');
|
|
27
|
+
this.#$caption = shadowRoot.querySelector('#caption');
|
|
28
|
+
this.#$header = shadowRoot.querySelector('#header');
|
|
29
|
+
this.#$cardBody = shadowRoot.querySelector('#wrapper');
|
|
30
|
+
this.#$iconSlot = shadowRoot.querySelector('slot[name="icon"]');
|
|
31
|
+
this.#$illustrationSlot = shadowRoot.querySelector('slot[name="illustration"]');
|
|
32
|
+
this.#$illustrationSlotWrapper = shadowRoot.querySelector('#illustration-wrapper');
|
|
33
|
+
}
|
|
34
|
+
connectedCallback() {
|
|
35
|
+
super.connectedCallback();
|
|
36
|
+
this.#controller = new AbortController();
|
|
37
|
+
const options = {
|
|
38
|
+
signal: this.#controller.signal
|
|
39
|
+
};
|
|
40
|
+
this.#$illustrationSlot.addEventListener('slotchange', this.#onIllustrationSlotChange, options);
|
|
41
|
+
this.#onIllustrationSlotChange();
|
|
42
|
+
if ((0, _utils.getBooleanAttribute)(this, 'draggable')) {
|
|
43
|
+
this.#enableDraggable();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback() {
|
|
47
|
+
super.disconnectedCallback();
|
|
48
|
+
this.#disableDragging();
|
|
49
|
+
this.#controller.abort();
|
|
50
|
+
this.#controller = null;
|
|
51
|
+
}
|
|
52
|
+
static get observedAttributes() {
|
|
53
|
+
return ['text', 'label', 'caption', 'draggable'];
|
|
54
|
+
}
|
|
55
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
56
|
+
switch (name) {
|
|
57
|
+
case 'text':
|
|
58
|
+
{
|
|
59
|
+
this.#$text.textContent = newVal;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
case 'label':
|
|
63
|
+
{
|
|
64
|
+
this.#$label.textContent = newVal;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
case 'caption':
|
|
68
|
+
{
|
|
69
|
+
(0, _utils.updateAttribute)(this.#$caption, 'text', newVal);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
case 'draggable':
|
|
73
|
+
{
|
|
74
|
+
if ((0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const isDraggingEnabled = (0, _utils.isAttrTrue)(newVal);
|
|
78
|
+
if (isDraggingEnabled) {
|
|
79
|
+
this.#enableDraggable();
|
|
80
|
+
} else {
|
|
81
|
+
this.#disableDragging();
|
|
82
|
+
}
|
|
83
|
+
(0, _utils.updateBooleanAttribute)(this, name, isDraggingEnabled);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
set text(value) {
|
|
89
|
+
(0, _utils.updateAttribute)(this, 'text', value);
|
|
90
|
+
}
|
|
91
|
+
get text() {
|
|
92
|
+
return (0, _utils.getAttribute)(this, 'text', '');
|
|
93
|
+
}
|
|
94
|
+
set caption(value) {
|
|
95
|
+
(0, _utils.updateAttribute)(this, 'caption', value);
|
|
96
|
+
}
|
|
97
|
+
get caption() {
|
|
98
|
+
return (0, _utils.getAttribute)(this, 'caption', '');
|
|
99
|
+
}
|
|
100
|
+
set label(value) {
|
|
101
|
+
(0, _utils.updateAttribute)(this, 'label', value);
|
|
102
|
+
}
|
|
103
|
+
get label() {
|
|
104
|
+
return (0, _utils.getAttribute)(this, 'label', '');
|
|
105
|
+
}
|
|
106
|
+
get dragRect() {
|
|
107
|
+
return this.#isDraggingSubscribed ? (0, _utils.getRect)(this.#$header) : null;
|
|
108
|
+
}
|
|
109
|
+
#onIllustrationSlotChange = () => {
|
|
110
|
+
(0, _utils.setClass)(this.#$illustrationSlotWrapper, 'active', this.#$illustrationSlot.assignedElements().length > 0);
|
|
111
|
+
};
|
|
112
|
+
#enableDraggable() {
|
|
113
|
+
if (this.isDomConnected && !this.#isDraggingSubscribed) {
|
|
114
|
+
this.addEventListener('dragstart', this.#onDragStart);
|
|
115
|
+
this.#$cardBody.addEventListener('mousedown', this.#onDraggableMouseDown);
|
|
116
|
+
this.#isDraggingSubscribed = true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
#disableDragging() {
|
|
120
|
+
if (this.#isDraggingSubscribed) {
|
|
121
|
+
this.removeEventListener('dragstart', this.#onDragStart);
|
|
122
|
+
this.#$cardBody.removeEventListener('mousedown', this.#onDraggableMouseDown);
|
|
123
|
+
this.#isDraggingSubscribed = false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
#onDraggableMouseDown = e => {
|
|
127
|
+
this.#isDraggingCorrectHandle = this.#$header.contains(e.target) || this.#$iconSlot.assignedElements().includes(e.target);
|
|
128
|
+
};
|
|
129
|
+
#onDragStart = e => {
|
|
130
|
+
if (!this.#isDraggingCorrectHandle) {
|
|
131
|
+
e.preventDefault();
|
|
132
|
+
e.stopPropagation();
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require('../utils');
|
|
4
|
+
const templateHTML = '<style>:host{display:block}#wrapper{height:100%;padding:20px 0;box-sizing:border-box;background-color:var(--sinch-comp-card-color-white-default-background-initial);border-radius:var(--sinch-comp-card-shape-radius);border:1px solid var(--sinch-comp-card-color-white-default-border-initial)}#scroll{overflow:auto;height:100%;box-sizing:border-box;padding:4px 24px}</style><div id="wrapper"><div id="scroll"><slot></slot></div></div>';
|
|
5
|
+
const template = document.createElement('template');
|
|
6
|
+
template.innerHTML = templateHTML;
|
|
7
|
+
(0, _utils.defineCustomElement)('sinch-card-container', class extends _utils.NectaryElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
const shadowRoot = this.attachShadow();
|
|
11
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require('../utils');
|
|
4
|
+
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:column;gap:32px;box-sizing:border-box;width:100%}</style><div id="wrapper"><slot></slot></div>';
|
|
5
|
+
const template = document.createElement('template');
|
|
6
|
+
template.innerHTML = templateHTML;
|
|
7
|
+
(0, _utils.defineCustomElement)('sinch-chat', class extends _utils.NectaryElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
const shadowRoot = this.attachShadow();
|
|
11
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require('../chat-bubble/utils');
|
|
4
|
+
var _utils2 = require('../utils');
|
|
5
|
+
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{position:relative;display:flex;flex-direction:column;gap:4px;align-items:flex-end;padding-left:72px}#stamp{display:flex;gap:4px;margin:0;font:var(--sinch-sys-font-body-xs);color:var(--sinch-sys-color-text-default)}#avatar{display:none;position:absolute;left:0;top:24px}:host([type=customer])>#wrapper{align-items:flex-start}:host([type=customer]) #avatar{display:block}</style><div id="wrapper"><div id="avatar"><slot name="avatar"></slot></div><p id="stamp"><span id="firstname"></span><span id="lastname"></span>•<span id="time"></span></p><slot name="bubble"></slot></div>';
|
|
6
|
+
const template = document.createElement('template');
|
|
7
|
+
template.innerHTML = templateHTML;
|
|
8
|
+
(0, _utils2.defineCustomElement)('sinch-chat-block', class extends _utils2.NectaryElement {
|
|
9
|
+
#$firstName;
|
|
10
|
+
#$lastName;
|
|
11
|
+
#$timeStamp;
|
|
12
|
+
#$bubbleSlot;
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
const shadowRoot = this.attachShadow();
|
|
16
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
17
|
+
this.#$firstName = shadowRoot.querySelector('#firstname');
|
|
18
|
+
this.#$lastName = shadowRoot.querySelector('#lastname');
|
|
19
|
+
this.#$timeStamp = shadowRoot.querySelector('#time');
|
|
20
|
+
this.#$bubbleSlot = shadowRoot.querySelector('slot[name="bubble"]');
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
this.#$bubbleSlot.addEventListener('slotchange', this.#onBubbleSlotChange);
|
|
24
|
+
}
|
|
25
|
+
disconnectedCallback() {
|
|
26
|
+
this.#$bubbleSlot.removeEventListener('slotchange', this.#onBubbleSlotChange);
|
|
27
|
+
}
|
|
28
|
+
static get observedAttributes() {
|
|
29
|
+
return ['firstname', 'lastname', 'timestamp', 'type'];
|
|
30
|
+
}
|
|
31
|
+
attributeChangedCallback(name, _, newVal) {
|
|
32
|
+
switch (name) {
|
|
33
|
+
case 'firstname':
|
|
34
|
+
{
|
|
35
|
+
this.#$firstName.textContent = newVal;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
case 'lastname':
|
|
39
|
+
{
|
|
40
|
+
this.#$lastName.textContent = newVal;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case 'timestamp':
|
|
44
|
+
{
|
|
45
|
+
this.#$timeStamp.textContent = newVal;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case 'type':
|
|
49
|
+
{
|
|
50
|
+
this.#updateBubbleTypes();
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
set type(value) {
|
|
56
|
+
(0, _utils2.updateLiteralAttribute)(this, _utils.typeValues, 'type', value);
|
|
57
|
+
}
|
|
58
|
+
get type() {
|
|
59
|
+
return (0, _utils2.getLiteralAttribute)(this, _utils.typeValues, 'type', null);
|
|
60
|
+
}
|
|
61
|
+
set firstName(value) {
|
|
62
|
+
(0, _utils2.updateAttribute)(this, 'firstname', value);
|
|
63
|
+
}
|
|
64
|
+
get firstName() {
|
|
65
|
+
return (0, _utils2.getAttribute)(this, 'firstname');
|
|
66
|
+
}
|
|
67
|
+
set lastName(value) {
|
|
68
|
+
(0, _utils2.updateAttribute)(this, 'lastname', value);
|
|
69
|
+
}
|
|
70
|
+
get lastName() {
|
|
71
|
+
return (0, _utils2.getAttribute)(this, 'lastname');
|
|
72
|
+
}
|
|
73
|
+
set timestamp(value) {
|
|
74
|
+
(0, _utils2.updateAttribute)(this, 'timestamp', value);
|
|
75
|
+
}
|
|
76
|
+
get timestamp() {
|
|
77
|
+
return (0, _utils2.getAttribute)(this, 'timestamp');
|
|
78
|
+
}
|
|
79
|
+
#onBubbleSlotChange = () => {
|
|
80
|
+
this.#updateBubbleTypes();
|
|
81
|
+
};
|
|
82
|
+
#updateBubbleTypes() {
|
|
83
|
+
const typeValue = (0, _utils2.getAttribute)(this, 'type');
|
|
84
|
+
this.#$bubbleSlot.assignedElements().forEach(el => {
|
|
85
|
+
(0, _utils2.updateAttribute)(el, 'data-type', typeValue);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|