@nectary/components 2.12.1 → 2.12.3
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,427 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require('../utils');
|
|
4
|
+
var _utils2 = require('./utils');
|
|
5
|
+
const templateHTML = '<style>:host{display:contents;position:relative}dialog{position:fixed;left:0;top:0;margin:0;outline:0;padding:0;border:none;box-sizing:border-box;max-width:unset;max-height:unset;z-index:1;background:0 0;overflow:visible}dialog:not([open]){display:none}dialog::backdrop{background-color:transparent}#content{position:relative;z-index:1}#target-open{display:flex;flex-direction:column;position:absolute;left:0;top:0}#focus{display:none;position:absolute;width:0;height:0}</style><slot id="target" name="target" aria-haspopup="dialog" aria-expanded="false"></slot><div id="focus"></div><dialog id="dialog"><div id="target-open"><slot name="target-open"></slot></div><div id="content"><slot name="content"></slot></div></dialog>';
|
|
6
|
+
const template = document.createElement('template');
|
|
7
|
+
template.innerHTML = templateHTML;
|
|
8
|
+
(0, _utils.defineCustomElement)('sinch-pop', class extends _utils.NectaryElement {
|
|
9
|
+
#$targetWrapper;
|
|
10
|
+
#$focus;
|
|
11
|
+
#$dialog;
|
|
12
|
+
#resizeThrottle;
|
|
13
|
+
#$targetSlot;
|
|
14
|
+
#$targetOpenSlot;
|
|
15
|
+
#$contentSlot;
|
|
16
|
+
#$targetOpenWrapper;
|
|
17
|
+
#targetActiveElement = null;
|
|
18
|
+
#controller;
|
|
19
|
+
#keydownContext;
|
|
20
|
+
#visibilityContext;
|
|
21
|
+
#targetStyleValue = null;
|
|
22
|
+
#modalWidth = 0;
|
|
23
|
+
#modalHeight = 0;
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
const shadowRoot = this.attachShadow();
|
|
27
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
28
|
+
this.#$targetWrapper = shadowRoot.querySelector('#target');
|
|
29
|
+
this.#$focus = shadowRoot.querySelector('#focus');
|
|
30
|
+
this.#$dialog = shadowRoot.querySelector('#dialog');
|
|
31
|
+
this.#$targetSlot = shadowRoot.querySelector('slot[name="target"]');
|
|
32
|
+
this.#$targetOpenSlot = shadowRoot.querySelector('slot[name="target-open"]');
|
|
33
|
+
this.#$contentSlot = shadowRoot.querySelector('slot[name="content"]');
|
|
34
|
+
this.#$targetOpenWrapper = shadowRoot.querySelector('#target-open');
|
|
35
|
+
this.#resizeThrottle = (0, _utils.throttleAnimationFrame)(this.#updateOrientation);
|
|
36
|
+
this.#keydownContext = new _utils.Context(this.#$contentSlot, 'keydown');
|
|
37
|
+
this.#visibilityContext = new _utils.Context(this.#$contentSlot, 'visibility');
|
|
38
|
+
this.#controller = new AbortController();
|
|
39
|
+
}
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
super.connectedCallback();
|
|
42
|
+
if (this.#controller === null) {
|
|
43
|
+
this.#controller = new AbortController();
|
|
44
|
+
}
|
|
45
|
+
const {
|
|
46
|
+
signal
|
|
47
|
+
} = this.#controller;
|
|
48
|
+
this.#keydownContext.listen(signal);
|
|
49
|
+
this.#visibilityContext.listen(signal);
|
|
50
|
+
this.role = 'dialog';
|
|
51
|
+
this.#$dialog.addEventListener('cancel', this.#onCancel, {
|
|
52
|
+
signal
|
|
53
|
+
});
|
|
54
|
+
this.#$dialog.addEventListener('mousedown', this.#onBackdropMouseDown, {
|
|
55
|
+
signal
|
|
56
|
+
});
|
|
57
|
+
this.addEventListener('-close', this.#onCloseReactHandler, {
|
|
58
|
+
signal
|
|
59
|
+
});
|
|
60
|
+
(0, _utils.subscribeContext)(this, 'visibility', this.#onContextVisibility, signal);
|
|
61
|
+
if ((0, _utils.getBooleanAttribute)(this, 'open')) {
|
|
62
|
+
this.#onExpand();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
disconnectedCallback() {
|
|
66
|
+
super.disconnectedCallback();
|
|
67
|
+
this.#controller.abort();
|
|
68
|
+
this.#controller = null;
|
|
69
|
+
this.#resizeThrottle.cancel();
|
|
70
|
+
this.#onCollapse();
|
|
71
|
+
}
|
|
72
|
+
static get observedAttributes() {
|
|
73
|
+
return ['orientation', 'open'];
|
|
74
|
+
}
|
|
75
|
+
set modal(isModal) {
|
|
76
|
+
(0, _utils.updateBooleanAttribute)(this, 'modal', isModal);
|
|
77
|
+
}
|
|
78
|
+
get modal() {
|
|
79
|
+
return (0, _utils.getBooleanAttribute)(this, 'modal');
|
|
80
|
+
}
|
|
81
|
+
set open(isOpen) {
|
|
82
|
+
(0, _utils.updateBooleanAttribute)(this, 'open', isOpen);
|
|
83
|
+
}
|
|
84
|
+
get open() {
|
|
85
|
+
return (0, _utils.getBooleanAttribute)(this, 'open');
|
|
86
|
+
}
|
|
87
|
+
get orientation() {
|
|
88
|
+
return (0, _utils.getLiteralAttribute)(this, _utils2.orientationValues, 'orientation');
|
|
89
|
+
}
|
|
90
|
+
set orientation(value) {
|
|
91
|
+
(0, _utils.updateLiteralAttribute)(this, _utils2.orientationValues, 'orientation', value);
|
|
92
|
+
}
|
|
93
|
+
set inset(inset) {
|
|
94
|
+
(0, _utils.updateIntegerAttribute)(this, 'inset', inset);
|
|
95
|
+
}
|
|
96
|
+
get inset() {
|
|
97
|
+
return (0, _utils.getIntegerAttribute)(this, 'inset', 0);
|
|
98
|
+
}
|
|
99
|
+
get footprintRect() {
|
|
100
|
+
return this.#getTargetRect();
|
|
101
|
+
}
|
|
102
|
+
get popoverRect() {
|
|
103
|
+
return (0, _utils.getRect)(this.#$dialog);
|
|
104
|
+
}
|
|
105
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
106
|
+
if ((0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
switch (name) {
|
|
110
|
+
case 'open':
|
|
111
|
+
{
|
|
112
|
+
const shouldOpen = (0, _utils.isAttrTrue)(newVal);
|
|
113
|
+
if (shouldOpen) {
|
|
114
|
+
requestAnimationFrame(() => {
|
|
115
|
+
if (this.isDomConnected && (0, _utils.getBooleanAttribute)(this, 'open')) {
|
|
116
|
+
this.#onExpand();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
} else {
|
|
120
|
+
this.#onCollapse();
|
|
121
|
+
}
|
|
122
|
+
(0, _utils.updateBooleanAttribute)(this, 'open', shouldOpen);
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
case 'orientation':
|
|
126
|
+
{
|
|
127
|
+
if (this.#$dialog.open) {
|
|
128
|
+
this.#updateOrientation();
|
|
129
|
+
}
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
#getTargetRect() {
|
|
135
|
+
let item = (0, _utils.getFirstSlotElement)(this.#$targetSlot, true);
|
|
136
|
+
if (item === null && this.#$dialog.open) {
|
|
137
|
+
item = (0, _utils.getFirstSlotElement)(this.#$targetOpenSlot, true);
|
|
138
|
+
}
|
|
139
|
+
if (item === null) {
|
|
140
|
+
return (0, _utils.getRect)(this.#$targetWrapper);
|
|
141
|
+
}
|
|
142
|
+
if (Reflect.has(item, 'footprintRect')) {
|
|
143
|
+
return item.footprintRect;
|
|
144
|
+
}
|
|
145
|
+
return (0, _utils.getRect)(item);
|
|
146
|
+
}
|
|
147
|
+
#getFirstTargetElement(slot) {
|
|
148
|
+
const item = (0, _utils.getFirstSlotElement)(slot, true);
|
|
149
|
+
if (item === null) {
|
|
150
|
+
return this.#$targetWrapper;
|
|
151
|
+
}
|
|
152
|
+
return item;
|
|
153
|
+
}
|
|
154
|
+
#onExpand() {
|
|
155
|
+
if (!this.isDomConnected || this.#$dialog.open) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this.#$targetSlot.addEventListener('blur', this.#stopEventPropagation, true);
|
|
159
|
+
this.#$focus.setAttribute('tabindex', '-1');
|
|
160
|
+
this.#$focus.style.display = 'block';
|
|
161
|
+
this.#$focus.addEventListener('focus', this.#captureRelatedActiveElement);
|
|
162
|
+
this.#$focus.focus();
|
|
163
|
+
this.#$focus.removeEventListener('focus', this.#captureRelatedActiveElement);
|
|
164
|
+
this.#$targetSlot.removeEventListener('blur', this.#stopEventPropagation, true);
|
|
165
|
+
this.#$focus.removeAttribute('tabindex');
|
|
166
|
+
this.#$focus.removeAttribute('style');
|
|
167
|
+
this.#$dialog.showModal();
|
|
168
|
+
this.#$targetWrapper.setAttribute('aria-expanded', 'true');
|
|
169
|
+
this.#updateOrientation();
|
|
170
|
+
if (this.modal) {
|
|
171
|
+
(0, _utils.getFirstFocusableElement)(this.#$contentSlot)?.focus();
|
|
172
|
+
} else {
|
|
173
|
+
const $targetEl = this.#getFirstTargetElement(this.#$targetSlot);
|
|
174
|
+
const targetElComputedStyle = getComputedStyle($targetEl);
|
|
175
|
+
const marginLeft = parseInt(targetElComputedStyle.marginLeft);
|
|
176
|
+
const marginRight = parseInt(targetElComputedStyle.marginRight);
|
|
177
|
+
const marginTop = parseInt(targetElComputedStyle.marginTop);
|
|
178
|
+
const marginBottom = parseInt(targetElComputedStyle.marginBottom);
|
|
179
|
+
const targetRect = this.#getTargetRect();
|
|
180
|
+
this.#$targetWrapper.style.setProperty('display', 'block');
|
|
181
|
+
this.#$targetWrapper.style.setProperty('width', `${targetRect.width + marginLeft + marginRight}px`);
|
|
182
|
+
this.#$targetWrapper.style.setProperty('height', `${targetRect.height + marginTop + marginBottom}px`);
|
|
183
|
+
this.#$targetOpenWrapper.style.setProperty('width', `${targetRect.width}px`);
|
|
184
|
+
this.#$targetOpenWrapper.style.setProperty('height', `${targetRect.height}px`);
|
|
185
|
+
this.#targetStyleValue = $targetEl.getAttribute('style');
|
|
186
|
+
$targetEl.style.setProperty('margin', '0');
|
|
187
|
+
$targetEl.style.setProperty('position', 'static');
|
|
188
|
+
if (targetElComputedStyle.transform !== 'none') {
|
|
189
|
+
const matrix = new DOMMatrixReadOnly(targetElComputedStyle.transform);
|
|
190
|
+
$targetEl.style.setProperty('transform', matrix.translate(-matrix.e, -matrix.f).toString());
|
|
191
|
+
}
|
|
192
|
+
(0, _utils.getFirstSlotElement)(this.#$targetSlot)?.setAttribute('slot', 'target-open');
|
|
193
|
+
this.#$targetOpenSlot.addEventListener('keydown', this.#onTargetKeydown);
|
|
194
|
+
if (this.#targetActiveElement !== null) {
|
|
195
|
+
this.#$targetOpenSlot.addEventListener('focus', this.#stopEventPropagation, true);
|
|
196
|
+
this.#targetActiveElement.focus();
|
|
197
|
+
this.#$targetOpenSlot.removeEventListener('focus', this.#stopEventPropagation, true);
|
|
198
|
+
if (!(0, _utils.isElementFocused)(this.#targetActiveElement)) {
|
|
199
|
+
requestAnimationFrame(() => {
|
|
200
|
+
if (this.isDomConnected && this.#$dialog.open) {
|
|
201
|
+
this.#$targetOpenSlot.addEventListener('focus', this.#stopEventPropagation, true);
|
|
202
|
+
this.#targetActiveElement.focus();
|
|
203
|
+
this.#$targetOpenSlot.removeEventListener('focus', this.#stopEventPropagation, true);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
(0, _utils2.disableOverscroll)();
|
|
210
|
+
window.addEventListener('scroll', this.#updatePosition, {
|
|
211
|
+
passive: false
|
|
212
|
+
});
|
|
213
|
+
window.addEventListener('resize', this.#onResize);
|
|
214
|
+
requestAnimationFrame(() => {
|
|
215
|
+
if (this.isDomConnected && this.#$dialog.open) {
|
|
216
|
+
this.#$contentSlot.addEventListener('slotchange', this.#onContentSlotChange);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
this.#dispatchContentVisibility(true);
|
|
220
|
+
}
|
|
221
|
+
#onCollapse() {
|
|
222
|
+
if (!this.#$dialog.open) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const isNonModal = !this.modal;
|
|
226
|
+
this.#dispatchContentVisibility(false);
|
|
227
|
+
this.#$targetOpenSlot.removeEventListener('keydown', this.#onTargetKeydown);
|
|
228
|
+
if (isNonModal) {
|
|
229
|
+
this.#$targetOpenSlot.addEventListener('blur', this.#captureActiveElement, true);
|
|
230
|
+
}
|
|
231
|
+
this.#$dialog.close();
|
|
232
|
+
this.#$targetWrapper.setAttribute('aria-expanded', 'false');
|
|
233
|
+
if (isNonModal) {
|
|
234
|
+
this.#$targetOpenSlot.removeEventListener('blur', this.#captureActiveElement, true);
|
|
235
|
+
}
|
|
236
|
+
if (isNonModal) {
|
|
237
|
+
const targetEl = this.#getFirstTargetElement(this.#$targetOpenSlot);
|
|
238
|
+
targetEl.style.removeProperty('margin');
|
|
239
|
+
targetEl.style.removeProperty('position');
|
|
240
|
+
targetEl.style.removeProperty('transform');
|
|
241
|
+
if (this.#targetStyleValue !== null) {
|
|
242
|
+
targetEl.setAttribute('style', this.#targetStyleValue);
|
|
243
|
+
this.#targetStyleValue = null;
|
|
244
|
+
}
|
|
245
|
+
(0, _utils.getFirstSlotElement)(this.#$targetOpenSlot)?.setAttribute('slot', 'target');
|
|
246
|
+
this.#$targetWrapper.style.removeProperty('display');
|
|
247
|
+
this.#$targetWrapper.style.removeProperty('width');
|
|
248
|
+
this.#$targetWrapper.style.removeProperty('height');
|
|
249
|
+
}
|
|
250
|
+
if (this.#targetActiveElement !== null) {
|
|
251
|
+
if (!(0, _utils.isElementFocused)(this.#targetActiveElement)) {
|
|
252
|
+
this.#$targetSlot.addEventListener('focus', this.#stopEventPropagation, true);
|
|
253
|
+
this.#targetActiveElement.focus({
|
|
254
|
+
preventScroll: true
|
|
255
|
+
});
|
|
256
|
+
this.#$targetSlot.removeEventListener('focus', this.#stopEventPropagation, true);
|
|
257
|
+
if (!(0, _utils.isElementFocused)(this.#targetActiveElement)) {
|
|
258
|
+
const $targetEl = this.#targetActiveElement;
|
|
259
|
+
requestAnimationFrame(() => {
|
|
260
|
+
if (this.isDomConnected && !this.#$dialog.open) {
|
|
261
|
+
this.#$targetSlot.addEventListener('focus', this.#stopEventPropagation, true);
|
|
262
|
+
$targetEl.focus({
|
|
263
|
+
preventScroll: true
|
|
264
|
+
});
|
|
265
|
+
this.#$targetSlot.removeEventListener('focus', this.#stopEventPropagation, true);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
this.#targetActiveElement = null;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
(0, _utils2.enableOverscroll)();
|
|
273
|
+
this.#resizeThrottle.cancel();
|
|
274
|
+
window.removeEventListener('resize', this.#onResize);
|
|
275
|
+
window.removeEventListener('scroll', this.#updatePosition);
|
|
276
|
+
this.#$contentSlot.removeEventListener('slotchange', this.#onContentSlotChange);
|
|
277
|
+
}
|
|
278
|
+
#onResize = () => {
|
|
279
|
+
this.#resizeThrottle.fn();
|
|
280
|
+
};
|
|
281
|
+
#updatePosition = () => {
|
|
282
|
+
const targetRect = this.modal ? this.#getTargetRect() : this.#$targetWrapper.getBoundingClientRect();
|
|
283
|
+
const orient = this.orientation;
|
|
284
|
+
const modalWidth = this.#modalWidth;
|
|
285
|
+
const modalHeight = this.#modalHeight;
|
|
286
|
+
const inset = this.inset;
|
|
287
|
+
let xPos = 0;
|
|
288
|
+
let yPos = 0;
|
|
289
|
+
if (orient === 'bottom-right' || orient === 'top-right' || orient === 'top-stretch' || orient === 'bottom-stretch') {
|
|
290
|
+
xPos = targetRect.x;
|
|
291
|
+
}
|
|
292
|
+
if (orient === 'bottom-left' || orient === 'top-left') {
|
|
293
|
+
xPos = targetRect.x + targetRect.width - modalWidth;
|
|
294
|
+
}
|
|
295
|
+
if (orient === 'bottom-center' || orient === 'top-center') {
|
|
296
|
+
xPos = targetRect.x + targetRect.width / 2 - modalWidth / 2;
|
|
297
|
+
}
|
|
298
|
+
if (orient === 'center-right') {
|
|
299
|
+
xPos = targetRect.x + targetRect.width;
|
|
300
|
+
}
|
|
301
|
+
if (orient === 'center-left') {
|
|
302
|
+
xPos = targetRect.x - modalWidth;
|
|
303
|
+
}
|
|
304
|
+
if (orient === 'bottom-left' || orient === 'bottom-right' || orient === 'bottom-stretch' || orient === 'bottom-center') {
|
|
305
|
+
yPos = targetRect.y + targetRect.height;
|
|
306
|
+
}
|
|
307
|
+
if (orient === 'top-left' || orient === 'top-right' || orient === 'top-stretch' || orient === 'top-center') {
|
|
308
|
+
yPos = targetRect.y - modalHeight;
|
|
309
|
+
}
|
|
310
|
+
if (orient === 'center-left' || orient === 'center-right') {
|
|
311
|
+
yPos = targetRect.y + targetRect.height / 2 - modalHeight / 2;
|
|
312
|
+
}
|
|
313
|
+
const clampedXPos = Math.max(inset, Math.min(xPos, window.innerWidth - modalWidth - inset));
|
|
314
|
+
const clampedYPos = Math.max(inset, Math.min(yPos, window.innerHeight - modalHeight - inset));
|
|
315
|
+
this.#$dialog.style.setProperty('left', `${clampedXPos}px`);
|
|
316
|
+
this.#$dialog.style.setProperty('top', `${clampedYPos}px`);
|
|
317
|
+
if (!this.modal) {
|
|
318
|
+
const targetLeftPos = targetRect.x - clampedXPos;
|
|
319
|
+
const targetTopPos = targetRect.y - clampedYPos;
|
|
320
|
+
this.#$targetOpenWrapper.style.setProperty('left', `${targetLeftPos}px`);
|
|
321
|
+
this.#$targetOpenWrapper.style.setProperty('top', `${targetTopPos}px`);
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
#updateOrientation = () => {
|
|
325
|
+
this.#$dialog.style.setProperty('width', 'max-content');
|
|
326
|
+
const targetRect = this.#getTargetRect();
|
|
327
|
+
const modalRect = this.#$dialog.getBoundingClientRect();
|
|
328
|
+
const orient = this.orientation;
|
|
329
|
+
const shouldSetWidthToTarget = orient === 'top-stretch' || orient === 'bottom-stretch';
|
|
330
|
+
const modalHeight = modalRect.height;
|
|
331
|
+
const modalWidth = shouldSetWidthToTarget ? targetRect.width : modalRect.width;
|
|
332
|
+
const inset = this.inset;
|
|
333
|
+
let xPos = 0;
|
|
334
|
+
let yPos = 0;
|
|
335
|
+
this.#modalHeight = modalHeight;
|
|
336
|
+
this.#modalWidth = modalWidth;
|
|
337
|
+
if (orient === 'bottom-right' || orient === 'top-right' || orient === 'top-stretch' || orient === 'bottom-stretch') {
|
|
338
|
+
xPos = targetRect.x;
|
|
339
|
+
}
|
|
340
|
+
if (orient === 'bottom-left' || orient === 'top-left') {
|
|
341
|
+
xPos = targetRect.x + targetRect.width - modalWidth;
|
|
342
|
+
}
|
|
343
|
+
if (orient === 'bottom-center' || orient === 'top-center') {
|
|
344
|
+
xPos = targetRect.x + targetRect.width / 2 - modalWidth / 2;
|
|
345
|
+
}
|
|
346
|
+
if (orient === 'center-right') {
|
|
347
|
+
xPos = targetRect.x + targetRect.width;
|
|
348
|
+
}
|
|
349
|
+
if (orient === 'center-left') {
|
|
350
|
+
xPos = targetRect.x - modalWidth;
|
|
351
|
+
}
|
|
352
|
+
if (orient === 'bottom-left' || orient === 'bottom-right' || orient === 'bottom-stretch' || orient === 'bottom-center') {
|
|
353
|
+
yPos = targetRect.y + targetRect.height;
|
|
354
|
+
}
|
|
355
|
+
if (orient === 'top-left' || orient === 'top-right' || orient === 'top-stretch' || orient === 'top-center') {
|
|
356
|
+
yPos = targetRect.y - modalHeight;
|
|
357
|
+
}
|
|
358
|
+
if (orient === 'center-left' || orient === 'center-right') {
|
|
359
|
+
yPos = targetRect.y + targetRect.height / 2 - modalHeight / 2;
|
|
360
|
+
}
|
|
361
|
+
xPos = Math.round(Math.max(inset, Math.min(xPos, window.innerWidth - modalWidth - inset)));
|
|
362
|
+
yPos = Math.round(Math.max(inset, Math.min(yPos, window.innerHeight - modalHeight - inset)));
|
|
363
|
+
this.#$dialog.style.setProperty('left', `${xPos}px`);
|
|
364
|
+
this.#$dialog.style.setProperty('top', `${yPos}px`);
|
|
365
|
+
this.#$dialog.style.setProperty('width', `${modalWidth}px`);
|
|
366
|
+
if (!this.modal) {
|
|
367
|
+
const targetLeftPos = targetRect.x - xPos;
|
|
368
|
+
const targetTopPos = targetRect.y - yPos;
|
|
369
|
+
this.#$targetOpenWrapper.style.setProperty('left', `${targetLeftPos}px`);
|
|
370
|
+
this.#$targetOpenWrapper.style.setProperty('top', `${targetTopPos}px`);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
#onBackdropMouseDown = e => {
|
|
374
|
+
if ((0, _utils.isTargetEqual)(e, this.#$dialog)) {
|
|
375
|
+
const rect = this.popoverRect;
|
|
376
|
+
const isInside = e.x >= rect.x && e.x < rect.x + rect.width && e.y >= rect.y && e.y < rect.y + rect.height;
|
|
377
|
+
if (!isInside) {
|
|
378
|
+
e.stopPropagation();
|
|
379
|
+
this.#dispatchCloseEvent();
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
#onCancel = e => {
|
|
384
|
+
e.preventDefault();
|
|
385
|
+
e.stopPropagation();
|
|
386
|
+
this.#dispatchCloseEvent();
|
|
387
|
+
};
|
|
388
|
+
#onCloseReactHandler = e => {
|
|
389
|
+
(0, _utils.getReactEventHandler)(this, 'on-close')?.(e);
|
|
390
|
+
};
|
|
391
|
+
#dispatchCloseEvent() {
|
|
392
|
+
this.dispatchEvent(new CustomEvent('-close'));
|
|
393
|
+
}
|
|
394
|
+
#captureRelatedActiveElement = e => {
|
|
395
|
+
e.stopPropagation();
|
|
396
|
+
this.#targetActiveElement = e.relatedTarget;
|
|
397
|
+
};
|
|
398
|
+
#captureActiveElement = e => {
|
|
399
|
+
e.stopPropagation();
|
|
400
|
+
this.#targetActiveElement = e.target;
|
|
401
|
+
};
|
|
402
|
+
#stopEventPropagation = e => {
|
|
403
|
+
e.stopPropagation();
|
|
404
|
+
};
|
|
405
|
+
#dispatchContentVisibility(isVisible) {
|
|
406
|
+
this.#visibilityContext.dispatch(isVisible);
|
|
407
|
+
}
|
|
408
|
+
#onTargetKeydown = e => {
|
|
409
|
+
this.#keydownContext.dispatch({
|
|
410
|
+
code: e.code,
|
|
411
|
+
preventDefault: () => {
|
|
412
|
+
e.preventDefault();
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
#onContextVisibility = e => {
|
|
417
|
+
if (!e.detail) {
|
|
418
|
+
this.#dispatchCloseEvent();
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
#onContentSlotChange = e => {
|
|
422
|
+
e.stopPropagation();
|
|
423
|
+
if (this.#$dialog.open) {
|
|
424
|
+
this.#updateOrientation();
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.orientationValues = exports.enableOverscroll = exports.disableOverscroll = void 0;
|
|
7
|
+
const orientationValues = exports.orientationValues = ['top-left', 'top-right', 'bottom-left', 'bottom-right', 'bottom-stretch', 'bottom-center', 'top-stretch', 'top-center', 'center-left', 'center-right'];
|
|
8
|
+
const bodyEl = document.body;
|
|
9
|
+
const disableOverscroll = () => {
|
|
10
|
+
bodyEl.__pop_counter__ = (bodyEl.__pop_counter__ ?? 0) + 1;
|
|
11
|
+
if (bodyEl.__pop_counter__ === 1) {
|
|
12
|
+
bodyEl.style.setProperty('overscroll-behavior', 'none');
|
|
13
|
+
document.documentElement.style.setProperty('overscroll-behavior', 'none');
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.disableOverscroll = disableOverscroll;
|
|
17
|
+
const enableOverscroll = () => {
|
|
18
|
+
bodyEl.__pop_counter__ = Math.max(0, (bodyEl.__pop_counter__ ?? 0) - 1);
|
|
19
|
+
if (bodyEl.__pop_counter__ === 0) {
|
|
20
|
+
bodyEl.style.removeProperty('overscroll-behavior');
|
|
21
|
+
document.documentElement.style.removeProperty('overscroll-behavior');
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.enableOverscroll = enableOverscroll;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require('../pop');
|
|
4
|
+
var _utils = require('../utils');
|
|
5
|
+
var _utils2 = require('./utils');
|
|
6
|
+
const templateHTML = '<style>:host{display:contents}#content-wrapper{position:relative;padding-top:4px}:host([tip]) #content-wrapper{padding-top:12px;filter:drop-shadow(var(--sinch-comp-popover-shadow))}:host([orientation^=top]) #content-wrapper{padding-top:0;padding-bottom:4px}:host([orientation^=top][tip]) #content-wrapper{padding-top:0;padding-bottom:12px}#content{background-color:var(--sinch-comp-popover-color-default-background-initial);border:1px solid var(--sinch-comp-popover-color-default-border-initial);border-radius:var(--sinch-comp-popover-shape-radius);box-shadow:var(--sinch-comp-popover-shadow);overflow:hidden}:host([tip]) #content{box-shadow:none}#tip{position:absolute;left:50%;top:13px;transform:translateX(-50%) rotate(180deg);transform-origin:top center;fill:var(--sinch-comp-popover-color-default-background-initial);stroke:var(--sinch-comp-popover-color-default-border-initial);stroke-linecap:square;pointer-events:none;display:none}:host([orientation^=top]) #tip{transform:translateX(-50%) rotate(0);top:calc(100% - 13px)}:host([tip]) #tip:not(.hidden){display:block}</style><sinch-pop id="pop" inset="4"><slot name="target" slot="target"></slot><div id="content-wrapper" slot="content"><div id="content"><slot name="content"></slot></div><svg id="tip" width="16" height="9" aria-hidden="true"><path d="m0 0 8 8 8 -8"/></svg></div></sinch-pop>';
|
|
7
|
+
const TIP_SIZE = 16;
|
|
8
|
+
const template = document.createElement('template');
|
|
9
|
+
template.innerHTML = templateHTML;
|
|
10
|
+
(0, _utils.defineCustomElement)('sinch-popover', class extends _utils.NectaryElement {
|
|
11
|
+
#$pop;
|
|
12
|
+
#$content;
|
|
13
|
+
#$tip;
|
|
14
|
+
#controller = null;
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
const shadowRoot = this.attachShadow();
|
|
18
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
19
|
+
this.#$pop = shadowRoot.querySelector('#pop');
|
|
20
|
+
this.#$content = shadowRoot.querySelector('#content');
|
|
21
|
+
this.#$tip = shadowRoot.querySelector('#tip');
|
|
22
|
+
}
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
this.#controller = new AbortController();
|
|
25
|
+
const {
|
|
26
|
+
signal
|
|
27
|
+
} = this.#controller;
|
|
28
|
+
this.addEventListener('-close', this.#onCloseReactHandler, {
|
|
29
|
+
signal
|
|
30
|
+
});
|
|
31
|
+
this.#$pop.addEventListener('-close', this.#onPopClose, {
|
|
32
|
+
signal
|
|
33
|
+
});
|
|
34
|
+
(0, _utils.subscribeContext)(this.#$content, 'visibility', this.#onContextVisibility, signal);
|
|
35
|
+
(0, _utils.updateAttribute)(this.#$pop, 'orientation', (0, _utils2.getPopOrientation)(this.orientation));
|
|
36
|
+
}
|
|
37
|
+
disconnectedCallback() {
|
|
38
|
+
this.#controller.abort();
|
|
39
|
+
this.#controller = null;
|
|
40
|
+
}
|
|
41
|
+
static get observedAttributes() {
|
|
42
|
+
return ['orientation', 'open', 'modal', 'tip', 'aria-label', 'aria-description'];
|
|
43
|
+
}
|
|
44
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
45
|
+
if ((0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
switch (name) {
|
|
49
|
+
case 'orientation':
|
|
50
|
+
{
|
|
51
|
+
(0, _utils.updateAttribute)(this.#$pop, 'orientation', (0, _utils2.getPopOrientation)(this.orientation));
|
|
52
|
+
if (this.#$pop.open) {
|
|
53
|
+
this.#updateTipOrientation();
|
|
54
|
+
}
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
case 'tip':
|
|
58
|
+
{
|
|
59
|
+
const hasTip = (0, _utils.isAttrTrue)(newVal);
|
|
60
|
+
if (hasTip && this.#$pop.open) {
|
|
61
|
+
this.#updateTipOrientation();
|
|
62
|
+
}
|
|
63
|
+
(0, _utils.updateBooleanAttribute)(this, name, hasTip);
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
case 'modal':
|
|
67
|
+
case 'open':
|
|
68
|
+
{
|
|
69
|
+
(0, _utils.updateAttribute)(this.#$pop, name, newVal);
|
|
70
|
+
(0, _utils.updateBooleanAttribute)(this, name, (0, _utils.isAttrTrue)(newVal));
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case 'aria-label':
|
|
74
|
+
case 'aria-description':
|
|
75
|
+
{
|
|
76
|
+
(0, _utils.updateAttribute)(this.#$pop, name, newVal);
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
set modal(isModal) {
|
|
82
|
+
(0, _utils.updateBooleanAttribute)(this, 'modal', isModal);
|
|
83
|
+
}
|
|
84
|
+
get modal() {
|
|
85
|
+
return (0, _utils.getBooleanAttribute)(this, 'modal');
|
|
86
|
+
}
|
|
87
|
+
set open(isOpen) {
|
|
88
|
+
(0, _utils.updateBooleanAttribute)(this, 'open', isOpen);
|
|
89
|
+
}
|
|
90
|
+
get open() {
|
|
91
|
+
return (0, _utils.getBooleanAttribute)(this, 'open');
|
|
92
|
+
}
|
|
93
|
+
set tip(hasTip) {
|
|
94
|
+
(0, _utils.updateBooleanAttribute)(this, 'tip', hasTip);
|
|
95
|
+
}
|
|
96
|
+
get tip() {
|
|
97
|
+
return (0, _utils.getBooleanAttribute)(this, 'tip');
|
|
98
|
+
}
|
|
99
|
+
get orientation() {
|
|
100
|
+
return (0, _utils.getLiteralAttribute)(this, _utils2.orientationValues, 'orientation', 'bottom-left');
|
|
101
|
+
}
|
|
102
|
+
set orientation(value) {
|
|
103
|
+
(0, _utils.updateLiteralAttribute)(this, _utils2.orientationValues, 'orientation', value);
|
|
104
|
+
}
|
|
105
|
+
get footprintRect() {
|
|
106
|
+
return this.#$pop.footprintRect;
|
|
107
|
+
}
|
|
108
|
+
get popoverRect() {
|
|
109
|
+
return this.#$pop.popoverRect;
|
|
110
|
+
}
|
|
111
|
+
#onPopClose = () => {
|
|
112
|
+
this.#dispatchCloseEvent();
|
|
113
|
+
};
|
|
114
|
+
#onCloseReactHandler = e => {
|
|
115
|
+
(0, _utils.getReactEventHandler)(this, 'onClose')?.();
|
|
116
|
+
(0, _utils.getReactEventHandler)(this, 'on-close')?.(e);
|
|
117
|
+
};
|
|
118
|
+
#dispatchCloseEvent() {
|
|
119
|
+
this.dispatchEvent(new CustomEvent('-close'));
|
|
120
|
+
}
|
|
121
|
+
#onContextVisibility = e => {
|
|
122
|
+
if (e.detail) {
|
|
123
|
+
this.#updateTipOrientation();
|
|
124
|
+
} else {
|
|
125
|
+
this.#resetTipOrientation();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
#resetTipOrientation() {
|
|
129
|
+
this.#$tip.style.top = '';
|
|
130
|
+
this.#$tip.style.left = '';
|
|
131
|
+
}
|
|
132
|
+
#updateTipOrientation = () => {
|
|
133
|
+
const orientation = this.orientation;
|
|
134
|
+
const targetRect = this.#$pop.footprintRect;
|
|
135
|
+
const contentRect = this.#$content.getBoundingClientRect();
|
|
136
|
+
const diffX = targetRect.x - contentRect.x;
|
|
137
|
+
let desiredX = diffX + targetRect.width / 2;
|
|
138
|
+
if (orientation === 'bottom-left' || orientation === 'top-left') {
|
|
139
|
+
desiredX = Math.max(desiredX, contentRect.width * 0.75);
|
|
140
|
+
}
|
|
141
|
+
if (orientation === 'bottom-right' || orientation === 'top-right') {
|
|
142
|
+
desiredX = Math.min(desiredX, contentRect.width * 0.25);
|
|
143
|
+
}
|
|
144
|
+
const xPos = Math.max(TIP_SIZE, Math.min(desiredX, contentRect.width - TIP_SIZE));
|
|
145
|
+
this.#$tip.style.left = `${xPos}px`;
|
|
146
|
+
(0, _utils.setClass)(this.#$tip, 'hidden', (0, _utils.rectOverlap)(targetRect, contentRect));
|
|
147
|
+
};
|
|
148
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.orientationValues = exports.getPopOrientation = void 0;
|
|
7
|
+
const orientationValues = exports.orientationValues = ['top-left', 'top-right', 'bottom-left', 'bottom-right', 'bottom', 'top'];
|
|
8
|
+
const getPopOrientation = orientation => {
|
|
9
|
+
if (orientation === 'top') {
|
|
10
|
+
return 'top-stretch';
|
|
11
|
+
}
|
|
12
|
+
if (orientation === 'bottom') {
|
|
13
|
+
return 'bottom-stretch';
|
|
14
|
+
}
|
|
15
|
+
return orientation;
|
|
16
|
+
};
|
|
17
|
+
exports.getPopOrientation = getPopOrientation;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require('../text');
|
|
4
|
+
var _utils = require('../utils');
|
|
5
|
+
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;align-items:center;height:24px}#bar,#progress{height:8px;border-radius:4px}#progress{background-color:var(--sinch-comp-progress-color-default-background-initial);flex:1;min-width:0}#bar{background-color:var(--sinch-comp-progress-color-default-bar-initial);width:0}#text{display:none;width:46px;--sinch-global-color-text:var(--sinch-comp-progress-color-default-text-initial)}:host([detailed]) #text{display:block}</style><div id="wrapper"><sinch-text id="text" type="m"></sinch-text><div id="progress"><div id="bar"></div></div></div>';
|
|
6
|
+
const template = document.createElement('template');
|
|
7
|
+
template.innerHTML = templateHTML;
|
|
8
|
+
(0, _utils.defineCustomElement)('sinch-progress', class extends _utils.NectaryElement {
|
|
9
|
+
#$bar;
|
|
10
|
+
#$text;
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
const shadowRoot = this.attachShadow();
|
|
14
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
15
|
+
this.#$bar = shadowRoot.querySelector('#bar');
|
|
16
|
+
this.#$text = shadowRoot.querySelector('#text');
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
this.setAttribute('role', 'progressbar');
|
|
20
|
+
}
|
|
21
|
+
static get observedAttributes() {
|
|
22
|
+
return ['value', 'detailed'];
|
|
23
|
+
}
|
|
24
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
25
|
+
switch (name) {
|
|
26
|
+
case 'value':
|
|
27
|
+
{
|
|
28
|
+
const int = (0, _utils.attrValueToInteger)(newVal, {
|
|
29
|
+
min: 0,
|
|
30
|
+
max: 100
|
|
31
|
+
});
|
|
32
|
+
const intCss = int === null ? '0%' : `${int}%`;
|
|
33
|
+
this.#$bar.style.width = intCss;
|
|
34
|
+
this.#$text.textContent = intCss;
|
|
35
|
+
this.setAttribute('valuenow', int !== null ? String(int) : '0');
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
case 'detailed':
|
|
39
|
+
{
|
|
40
|
+
if ((0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
(0, _utils.updateBooleanAttribute)(this, name, (0, _utils.isAttrTrue)(newVal));
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
get value() {
|
|
49
|
+
return (0, _utils.getIntegerAttribute)(this, 'value', 0);
|
|
50
|
+
}
|
|
51
|
+
set value(value) {
|
|
52
|
+
(0, _utils.updateAttribute)(this, 'value', value);
|
|
53
|
+
}
|
|
54
|
+
get detailed() {
|
|
55
|
+
return (0, _utils.getBooleanAttribute)(this, 'detailed');
|
|
56
|
+
}
|
|
57
|
+
set detailed(isDetailed) {
|
|
58
|
+
(0, _utils.updateBooleanAttribute)(this, 'detailed', isDetailed);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|