@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 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require('../utils');
|
|
4
|
+
const templateHTML = '<style>:host{display:block;outline:0;--sinch-grid-num-columns:1}#wrapper{display:grid;grid-template-columns:repeat(var(--sinch-grid-num-columns),auto);gap:16px;width:fit-content}:host([small]) #wrapper{gap:8px}:host([cols="2"]){--sinch-grid-num-columns:2}:host([cols="3"]){--sinch-grid-num-columns:3}:host([cols="4"]){--sinch-grid-num-columns:4}:host([cols="5"]){--sinch-grid-num-columns:5}:host([cols="6"]){--sinch-grid-num-columns:6}:host([cols="7"]){--sinch-grid-num-columns:7}:host([cols="8"]){--sinch-grid-num-columns:8}:host([cols="9"]){--sinch-grid-num-columns:9}:host([cols="10"]){--sinch-grid-num-columns:10}</style><div id="wrapper"><slot></slot></div>';
|
|
5
|
+
const template = document.createElement('template');
|
|
6
|
+
template.innerHTML = templateHTML;
|
|
7
|
+
(0, _utils.defineCustomElement)('sinch-tile-control', class extends _utils.NectaryElement {
|
|
8
|
+
#$slot;
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
const shadowRoot = this.attachShadow();
|
|
12
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
13
|
+
this.#$slot = shadowRoot.querySelector('slot');
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.setAttribute('role', 'tablist');
|
|
17
|
+
this.#$slot.addEventListener('option-change', this.#onOptionChange);
|
|
18
|
+
this.#$slot.addEventListener('slotchange', this.#onSlotChange);
|
|
19
|
+
this.addEventListener('-change', this.#onChangeReactHandler);
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
this.#$slot.removeEventListener('option-change', this.#onOptionChange);
|
|
23
|
+
this.#$slot.removeEventListener('slotchange', this.#onSlotChange);
|
|
24
|
+
this.removeEventListener('-change', this.#onChangeReactHandler);
|
|
25
|
+
}
|
|
26
|
+
static get observedAttributes() {
|
|
27
|
+
return ['value', 'small', 'multiple'];
|
|
28
|
+
}
|
|
29
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
30
|
+
if ((0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
switch (name) {
|
|
34
|
+
case 'value':
|
|
35
|
+
{
|
|
36
|
+
this.#onValueChange(newVal ?? '');
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
case 'small':
|
|
40
|
+
{
|
|
41
|
+
this.#onSmallChange();
|
|
42
|
+
(0, _utils.updateBooleanAttribute)(this, name, (0, _utils.isAttrTrue)(newVal));
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
case 'multiple':
|
|
46
|
+
{
|
|
47
|
+
this.#onValueChange(this.value);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
set value(value) {
|
|
52
|
+
(0, _utils.updateAttribute)(this, 'value', value);
|
|
53
|
+
}
|
|
54
|
+
get value() {
|
|
55
|
+
return (0, _utils.getAttribute)(this, 'value', '');
|
|
56
|
+
}
|
|
57
|
+
set small(isSmall) {
|
|
58
|
+
(0, _utils.updateBooleanAttribute)(this, 'small', isSmall);
|
|
59
|
+
}
|
|
60
|
+
get small() {
|
|
61
|
+
return (0, _utils.getBooleanAttribute)(this, 'small');
|
|
62
|
+
}
|
|
63
|
+
set multiple(isMultiple) {
|
|
64
|
+
(0, _utils.updateBooleanAttribute)(this, 'multiple', isMultiple);
|
|
65
|
+
}
|
|
66
|
+
get multiple() {
|
|
67
|
+
return (0, _utils.getBooleanAttribute)(this, 'multiple');
|
|
68
|
+
}
|
|
69
|
+
set cols(value) {
|
|
70
|
+
(0, _utils.updateIntegerAttribute)(this, 'cols', value);
|
|
71
|
+
}
|
|
72
|
+
get cols() {
|
|
73
|
+
return (0, _utils.getIntegerAttribute)(this, 'cols', 1);
|
|
74
|
+
}
|
|
75
|
+
#onSlotChange = () => {
|
|
76
|
+
this.#onValueChange(this.value);
|
|
77
|
+
this.#onSmallChange();
|
|
78
|
+
};
|
|
79
|
+
#onOptionChange = e => {
|
|
80
|
+
e.stopPropagation();
|
|
81
|
+
const $elem = e.target;
|
|
82
|
+
const value = e.detail;
|
|
83
|
+
const detail = this.multiple ? (0, _utils.updateCsv)(this.value, value, !(0, _utils.getBooleanAttribute)($elem, 'data-checked')) : value;
|
|
84
|
+
this.dispatchEvent(new CustomEvent('-change', {
|
|
85
|
+
detail
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
#onValueChange(csv) {
|
|
89
|
+
if (this.multiple) {
|
|
90
|
+
const values = (0, _utils.unpackCsv)(csv);
|
|
91
|
+
for (const $option of this.#$slot.assignedElements()) {
|
|
92
|
+
const isChecked = !(0, _utils.getBooleanAttribute)($option, 'disabled') && values.includes((0, _utils.getAttribute)($option, 'value', ''));
|
|
93
|
+
(0, _utils.updateBooleanAttribute)($option, 'data-checked', isChecked);
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
const value = (0, _utils.getFirstCsvValue)(csv);
|
|
97
|
+
for (const $option of this.#$slot.assignedElements()) {
|
|
98
|
+
const isChecked = !(0, _utils.getBooleanAttribute)($option, 'disabled') && value === (0, _utils.getAttribute)($option, 'value', '');
|
|
99
|
+
(0, _utils.updateBooleanAttribute)($option, 'data-checked', isChecked);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
#onSmallChange() {
|
|
104
|
+
const isSmall = this.small;
|
|
105
|
+
for (const $opt of this.#$slot.assignedElements()) {
|
|
106
|
+
(0, _utils.updateBooleanAttribute)($opt, 'data-small', isSmall);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
#onChangeReactHandler = e => {
|
|
110
|
+
(0, _utils.getReactEventHandler)(this, 'on-change')?.(e);
|
|
111
|
+
};
|
|
112
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require('../utils');
|
|
4
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}button{all:initial;position:relative;display:flex;flex-direction:column;justify-content:space-between;box-sizing:border-box;width:var(--sinch-local-size);height:var(--sinch-local-size);padding:16px 8px 8px;border-radius:var(--sinch-local-shape-radius);background-color:var(--sinch-local-color-background);box-shadow:var(--sinch-local-shadow);cursor:pointer;--sinch-local-color-background:var(--sinch-comp-tile-control-color-default-background-initial);--sinch-local-color-border:var(--sinch-comp-tile-control-color-default-border-initial);--sinch-local-color-text:var(--sinch-comp-tile-control-color-default-text-initial);--sinch-local-color-icon:var(--sinch-comp-tile-control-color-default-icon-initial);--sinch-local-shadow:var(--sinch-comp-tile-control-shadow-initial);--sinch-local-shape-radius:var(--sinch-comp-tile-control-shape-radius-l);--sinch-local-size:88px;--sinch-local-size-icon:var(--sinch-comp-tile-control-size-m-icon)}button::before{content:"";position:absolute;inset:0;border:1px solid var(--sinch-local-color-border);border-radius:var(--sinch-local-shape-radius);pointer-events:none}button:focus-visible::after{position:absolute;content:"";inset:-4px;padding:2px;border:2px solid var(--sinch-comp-tile-control-color-default-outline-focus);border-radius:calc(var(--sinch-local-shape-radius) + 4px);pointer-events:none}:host([data-small])>button{padding:12px 4px 4px;--sinch-local-shape-radius:var(--sinch-comp-tile-control-shape-radius-s);--sinch-local-size:64px;--sinch-local-size-icon:var(--sinch-comp-tile-control-size-s-icon)}button:enabled:hover{--sinch-local-color-background:var(--sinch-comp-tile-control-color-default-background-hover);--sinch-local-color-border:var(--sinch-comp-tile-control-color-default-border-hover);--sinch-local-shadow:var(--sinch-comp-tile-control-shadow-hover)}:host([data-checked])>button:enabled,button:enabled:active{--sinch-local-color-background:var(--sinch-comp-tile-control-color-checked-background-initial);--sinch-local-color-border:var(--sinch-comp-tile-control-color-checked-border-initial);--sinch-local-color-text:var(--sinch-comp-tile-control-color-checked-text-initial);--sinch-local-color-icon:var(--sinch-comp-tile-control-color-checked-icon-initial);--sinch-local-shadow:var(--sinch-comp-tile-control-shadow-active)}:host([data-checked])>button:enabled::before,button:enabled:active::before{border-width:2px}button:disabled{cursor:initial;--sinch-local-color-background:var(--sinch-comp-tile-control-color-disabled-background-initial);--sinch-local-color-border:var(--sinch-comp-tile-control-color-disabled-border-initial);--sinch-local-color-text:var(--sinch-comp-tile-control-color-disabled-text-initial);--sinch-local-color-icon:var(--sinch-comp-tile-control-color-disabled-icon-initial);--sinch-local-shadow:var(--sinch-comp-tile-control-shadow-disabled)}#text{display:inline-block;min-height:20px;text-align:center;font:var(--sinch-comp-tile-control-font-label);color:var(--sinch-local-color-text);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#icon{width:var(--sinch-local-size-icon);height:var(--sinch-local-size-icon);align-self:center;--sinch-global-size-icon:var(--sinch-local-size-icon);--sinch-global-color-icon:var(--sinch-local-color-icon)}</style><button><div id="icon"><slot name="icon"></slot></div><span id="text"></span></button>';
|
|
5
|
+
const template = document.createElement('template');
|
|
6
|
+
template.innerHTML = templateHTML;
|
|
7
|
+
(0, _utils.defineCustomElement)('sinch-tile-control-option', class extends _utils.NectaryElement {
|
|
8
|
+
#$button;
|
|
9
|
+
#$text;
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
const shadowRoot = this.attachShadow();
|
|
13
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
14
|
+
this.#$button = shadowRoot.querySelector('button');
|
|
15
|
+
this.#$text = shadowRoot.querySelector('#text');
|
|
16
|
+
}
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
this.setAttribute('role', 'tab');
|
|
19
|
+
this.#$button.addEventListener('click', this.#onButtonClick);
|
|
20
|
+
this.#$button.addEventListener('focus', this.#onButtonFocus);
|
|
21
|
+
this.#$button.addEventListener('blur', this.#onButtonBlur);
|
|
22
|
+
this.addEventListener('-focus', this.#onFocusReactHandler);
|
|
23
|
+
this.addEventListener('-blur', this.#onBlurReactHandler);
|
|
24
|
+
}
|
|
25
|
+
disconnectedCallback() {
|
|
26
|
+
this.#$button.removeEventListener('click', this.#onButtonClick);
|
|
27
|
+
this.#$button.removeEventListener('focus', this.#onButtonFocus);
|
|
28
|
+
this.#$button.removeEventListener('blur', this.#onButtonBlur);
|
|
29
|
+
this.removeEventListener('-focus', this.#onFocusReactHandler);
|
|
30
|
+
this.removeEventListener('-blur', this.#onBlurReactHandler);
|
|
31
|
+
}
|
|
32
|
+
static get observedAttributes() {
|
|
33
|
+
return ['data-checked', 'text', 'disabled'];
|
|
34
|
+
}
|
|
35
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
36
|
+
switch (name) {
|
|
37
|
+
case 'text':
|
|
38
|
+
{
|
|
39
|
+
this.#$text.textContent = newVal;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case 'data-checked':
|
|
43
|
+
{
|
|
44
|
+
(0, _utils.updateExplicitBooleanAttribute)(this, 'aria-selected', (0, _utils.isAttrTrue)(newVal));
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case 'disabled':
|
|
48
|
+
{
|
|
49
|
+
this.#$button.disabled = (0, _utils.isAttrTrue)(newVal);
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
set value(value) {
|
|
55
|
+
(0, _utils.updateAttribute)(this, 'value', value);
|
|
56
|
+
}
|
|
57
|
+
get value() {
|
|
58
|
+
return (0, _utils.getAttribute)(this, 'value', '');
|
|
59
|
+
}
|
|
60
|
+
set disabled(isDisabled) {
|
|
61
|
+
(0, _utils.updateBooleanAttribute)(this, 'disabled', isDisabled);
|
|
62
|
+
}
|
|
63
|
+
get disabled() {
|
|
64
|
+
return (0, _utils.getBooleanAttribute)(this, 'disabled');
|
|
65
|
+
}
|
|
66
|
+
set text(value) {
|
|
67
|
+
(0, _utils.updateAttribute)(this, 'text', value);
|
|
68
|
+
}
|
|
69
|
+
get text() {
|
|
70
|
+
return (0, _utils.getAttribute)(this, 'text', '');
|
|
71
|
+
}
|
|
72
|
+
get focusable() {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
focus() {
|
|
76
|
+
this.#$button.focus();
|
|
77
|
+
}
|
|
78
|
+
blur() {
|
|
79
|
+
this.#$button.blur();
|
|
80
|
+
}
|
|
81
|
+
#onButtonClick = e => {
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
this.dispatchEvent(new CustomEvent('option-change', {
|
|
84
|
+
detail: this.value,
|
|
85
|
+
bubbles: true
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
#onButtonFocus = () => {
|
|
89
|
+
this.dispatchEvent(new CustomEvent('-focus'));
|
|
90
|
+
};
|
|
91
|
+
#onButtonBlur = () => {
|
|
92
|
+
this.dispatchEvent(new CustomEvent('-blur'));
|
|
93
|
+
};
|
|
94
|
+
#onFocusReactHandler = () => {
|
|
95
|
+
(0, _utils.getReactEventHandler)(this, 'on-focus')?.();
|
|
96
|
+
};
|
|
97
|
+
#onBlurReactHandler = () => {
|
|
98
|
+
(0, _utils.getReactEventHandler)(this, 'on-blur')?.();
|
|
99
|
+
};
|
|
100
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require('../icon-button');
|
|
4
|
+
require('../icon');
|
|
5
|
+
require('../segmented-control');
|
|
6
|
+
require('../segmented-control-option');
|
|
7
|
+
var _utils = require('../utils');
|
|
8
|
+
var _utils2 = require('./utils');
|
|
9
|
+
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:column;width:248px;padding:16px;box-sizing:border-box;gap:16px}#header{position:relative;width:100%;height:48px;font:var(--sinch-comp-time-picker-header-font);line-height:48px;user-select:none;color:var(--sinch-comp-time-picker-header-color-default-text-initial)}#footer{display:flex;justify-content:center;width:100%;height:32px}#picker{position:relative;width:216px;height:216px;border-radius:50%;box-sizing:border-box;border:1px solid var(--sinch-comp-time-picker-watch-face-color-default-border-initial);background-color:var(--sinch-comp-time-picker-watch-face-color-default-background-initial)}#picker-hours,#picker-minutes{position:absolute;left:0;top:0;width:100%;height:100%;border-radius:50%;pointer-events:none;user-select:none}.digit-hour-12,.digit-hour-24,.digit-minute{position:absolute;width:28px;height:28px;text-align:center;top:calc(50% - 14px);left:calc(50% - 14px);z-index:1;cursor:pointer}.digit-hour-12{font:var(--sinch-comp-time-picker-digit-font-default-h12);color:var(--sinch-comp-time-picker-digit-color-default-h12-initial);line-height:28px}.digit-hour-12.selected{font:var(--sinch-comp-time-picker-digit-font-checked-h12);color:var(--sinch-comp-time-picker-digit-color-checked-h12-default)}.digit-hour-24{font:var(--sinch-comp-time-picker-digit-font-default-h24);color:var(--sinch-comp-time-picker-digit-color-default-h24-initial);line-height:28px}.digit-hour-24.selected{font:var(--sinch-comp-time-picker-digit-font-checked-h24);color:var(--sinch-comp-time-picker-digit-color-checked-h24-initial)}.digit-minute{font:var(--sinch-comp-time-picker-digit-font-default-minutes);color:var(--sinch-comp-time-picker-digit-color-default-minute-initial);line-height:28px}.digit-minute.selected{font:var(--sinch-comp-time-picker-digit-font-checked-minutes);color:var(--sinch-comp-time-picker-digit-color-checked-minute-initial)}#picker-touch{position:absolute;left:0;top:0;width:100%;height:100%;cursor:pointer;border-radius:50%}#needle-hour,#needle-minute,#picker-touch::after{background-color:var(--sinch-comp-time-picker-needle-color-default-background-initial)}#needle-hour,#needle-minute{position:absolute;transform-origin:bottom center;transform:rotate(0);bottom:50%;height:50px;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:transform height;z-index:2;outline:0}@media (prefers-reduced-motion){#needle-hour,#needle-minute{transition:none}}#needle-hour{width:4px;left:calc(50% - 2px);border-radius:2px}#needle-minute{width:2px;left:calc(50% - 1px);border-radius:1px}#needle-hour:focus-visible,#needle-minute:focus-visible{background-color:var(--sinch-comp-time-picker-needle-color-default-background-focus)}#needle-minute:not(.selected)::after{content:"";position:absolute;transform:translateX(-50%);left:0;top:-16px;width:4px;height:4px;border-radius:50%;background-color:var(--sinch-comp-time-picker-digit-color-checked-minute-initial)}#picker-touch::after{content:"";position:absolute;top:50%;left:50%;width:12px;height:12px;border-radius:50%;transform:translate(-50%,-50%)}#header-hours,#header-minutes{position:absolute;padding:0 4px;width:50px;outline:0}#header-hours{right:calc(50% + 8px);text-align:right}#header-minutes{left:calc(50% + 8px)}#header-colon{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}#submit{position:absolute;right:0;top:50%;transform:translateY(-50%)}#submit-icon{--sinch-global-color-icon:var(--sinch-comp-time-picker-header-color-default-icon-initial)}:host([ampm]) .digit-hour-24{display:none}:host(:not([ampm])) #footer{display:none}</style><div id="wrapper"><div id="header"><div id="header-hours" role="meter" aria-valuemin="0" aria-valuemax="23" aria-valuenow="0" aria-valuetext="0"><span>00</span></div><div id="header-colon">:</div><div id="header-minutes" role="meter" aria-valuemin="0" aria-valuemax="59" aria-valuenow="0" aria-valuetext="0"><span>00</span></div><sinch-icon-button id="submit" size="s" aria-label="Submit"><sinch-icon id="icon-submit" slot="icon" name="done"></sinch-icon></sinch-icon-button></div><div id="picker" aria-hidden="true"><div id="picker-hours"></div><div id="picker-minutes"></div><div id="picker-touch"><div id="needle-hour" tabindex="0"></div><div id="needle-minute" tabindex="0"></div></div></div><div id="footer"><sinch-segmented-control id="ampm"><sinch-segmented-control-option value="am" text="AM" aria-label="AM"></sinch-segmented-control-option><sinch-segmented-control-option value="pm" text="PM" aria-label="PM"></sinch-segmented-control-option></sinch-segmented-control></div></div>';
|
|
10
|
+
const template = document.createElement('template');
|
|
11
|
+
template.innerHTML = templateHTML;
|
|
12
|
+
const PICKER_RADIUS = 216 / 2;
|
|
13
|
+
const MINUTE_DIGIT_SIZE = 30;
|
|
14
|
+
const HOUR_12_DIGIT_SIZE = 26;
|
|
15
|
+
const HOUR_24_DIGIT_SIZE = 26;
|
|
16
|
+
const MINUTE_RADIUS = PICKER_RADIUS - MINUTE_DIGIT_SIZE;
|
|
17
|
+
const HOUR_12_RADIUS = MINUTE_RADIUS - HOUR_12_DIGIT_SIZE;
|
|
18
|
+
const HOUR_24_RADIUS = HOUR_12_RADIUS - HOUR_24_DIGIT_SIZE;
|
|
19
|
+
const NEEDLE_HOUR_12_LENGTH = HOUR_12_RADIUS;
|
|
20
|
+
const NEEDLE_HOUR_24_LENGTH = HOUR_24_RADIUS;
|
|
21
|
+
const NEEDLE_MINUTE_LENGTH = MINUTE_RADIUS;
|
|
22
|
+
(0, _utils.defineCustomElement)('sinch-time-picker', class extends _utils.NectaryElement {
|
|
23
|
+
#$pickerHours;
|
|
24
|
+
#$pickerMinutes;
|
|
25
|
+
#$pickerTouch;
|
|
26
|
+
#$needleHour;
|
|
27
|
+
#$needleMinute;
|
|
28
|
+
#$headerHours;
|
|
29
|
+
#$headerHoursText;
|
|
30
|
+
#$headerMinutes;
|
|
31
|
+
#$headerMinutesText;
|
|
32
|
+
#$ampm;
|
|
33
|
+
#$submitButton;
|
|
34
|
+
#hour = 0;
|
|
35
|
+
#minute = 0;
|
|
36
|
+
#controller = null;
|
|
37
|
+
constructor() {
|
|
38
|
+
super();
|
|
39
|
+
const shadowRoot = this.attachShadow();
|
|
40
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
41
|
+
this.#$pickerHours = shadowRoot.querySelector('#picker-hours');
|
|
42
|
+
this.#$pickerMinutes = shadowRoot.querySelector('#picker-minutes');
|
|
43
|
+
this.#$pickerTouch = shadowRoot.querySelector('#picker');
|
|
44
|
+
this.#$needleHour = shadowRoot.querySelector('#needle-hour');
|
|
45
|
+
this.#$needleMinute = shadowRoot.querySelector('#needle-minute');
|
|
46
|
+
this.#$headerHours = shadowRoot.querySelector('#header-hours');
|
|
47
|
+
this.#$headerMinutes = shadowRoot.querySelector('#header-minutes');
|
|
48
|
+
this.#$headerHoursText = shadowRoot.querySelector('#header-hours > span');
|
|
49
|
+
this.#$headerMinutesText = shadowRoot.querySelector('#header-minutes > span');
|
|
50
|
+
this.#$ampm = shadowRoot.querySelector('#ampm');
|
|
51
|
+
this.#$submitButton = shadowRoot.querySelector('#submit');
|
|
52
|
+
this.#$needleMinute.style.height = `${NEEDLE_MINUTE_LENGTH}px`;
|
|
53
|
+
this.#$needleHour.style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
|
|
54
|
+
const MINUTE_DIGIT_RADIUS = MINUTE_RADIUS + MINUTE_DIGIT_SIZE / 2;
|
|
55
|
+
const HOUR_12_DIGIT_RADIUS = HOUR_12_RADIUS + HOUR_12_DIGIT_SIZE / 2;
|
|
56
|
+
const HOUR_24_DIGIT_RADIUS = HOUR_24_RADIUS + HOUR_24_DIGIT_SIZE / 2;
|
|
57
|
+
const hours12Frag = document.createDocumentFragment();
|
|
58
|
+
for (let i = 0; i < 12; i++) {
|
|
59
|
+
const rad = Math.PI / 6 * (i - 3);
|
|
60
|
+
const el = document.createElement('div');
|
|
61
|
+
const x = Math.cos(rad) * HOUR_12_DIGIT_RADIUS;
|
|
62
|
+
const y = Math.sin(rad) * HOUR_12_DIGIT_RADIUS;
|
|
63
|
+
const hourDisplayValue = (0, _utils2.stringifyHourFace)(i);
|
|
64
|
+
el.className = 'digit-hour-12';
|
|
65
|
+
el.style.transform = `translate(${x}px, ${y}px)`;
|
|
66
|
+
el.textContent = hourDisplayValue;
|
|
67
|
+
hours12Frag.appendChild(el);
|
|
68
|
+
}
|
|
69
|
+
this.#$pickerHours.appendChild(hours12Frag);
|
|
70
|
+
const hours24Frag = document.createDocumentFragment();
|
|
71
|
+
for (let i = 12; i < 24; i++) {
|
|
72
|
+
const rad = Math.PI / 6 * (i - 3);
|
|
73
|
+
const el = document.createElement('div');
|
|
74
|
+
const x = Math.cos(rad) * HOUR_24_DIGIT_RADIUS;
|
|
75
|
+
const y = Math.sin(rad) * HOUR_24_DIGIT_RADIUS;
|
|
76
|
+
const hourDisplayValue = (0, _utils2.stringifyHourFace)(i);
|
|
77
|
+
el.className = 'digit-hour-24';
|
|
78
|
+
el.style.transform = `translate(${x}px, ${y}px)`;
|
|
79
|
+
el.textContent = hourDisplayValue;
|
|
80
|
+
hours24Frag.appendChild(el);
|
|
81
|
+
}
|
|
82
|
+
this.#$pickerHours.appendChild(hours24Frag);
|
|
83
|
+
const minutesFrag = document.createDocumentFragment();
|
|
84
|
+
for (let i = 0; i < 60; i += 5) {
|
|
85
|
+
const rad = Math.PI / 30 * (i - 15);
|
|
86
|
+
const el = document.createElement('div');
|
|
87
|
+
const x = Math.cos(rad) * MINUTE_DIGIT_RADIUS;
|
|
88
|
+
const y = Math.sin(rad) * MINUTE_DIGIT_RADIUS;
|
|
89
|
+
el.className = 'digit-minute';
|
|
90
|
+
el.style.transform = `translate(${x}px, ${y}px)`;
|
|
91
|
+
el.textContent = (0, _utils2.stringifyMinute)(i);
|
|
92
|
+
minutesFrag.appendChild(el);
|
|
93
|
+
}
|
|
94
|
+
this.#$pickerMinutes.appendChild(minutesFrag);
|
|
95
|
+
}
|
|
96
|
+
connectedCallback() {
|
|
97
|
+
this.#controller = new AbortController();
|
|
98
|
+
const options = {
|
|
99
|
+
signal: this.#controller.signal
|
|
100
|
+
};
|
|
101
|
+
this.#$pickerTouch.addEventListener('click', this.#onPickerClick, options);
|
|
102
|
+
this.#$ampm.addEventListener('-change', this.#onAmPmChange, options);
|
|
103
|
+
this.#$submitButton.addEventListener('click', this.#onSubmitButtonClick, options);
|
|
104
|
+
this.#$needleHour.addEventListener('keydown', this.#onHoursKeydown, options);
|
|
105
|
+
this.#$needleMinute.addEventListener('keydown', this.#onMinutesKeydown, options);
|
|
106
|
+
this.addEventListener('-change', this.#onChangeReactHandler, options);
|
|
107
|
+
}
|
|
108
|
+
disconnectedCallback() {
|
|
109
|
+
this.#controller.abort();
|
|
110
|
+
this.#controller = null;
|
|
111
|
+
}
|
|
112
|
+
static get observedAttributes() {
|
|
113
|
+
return ['value', 'ampm', 'submit-aria-label'];
|
|
114
|
+
}
|
|
115
|
+
attributeChangedCallback(name, prevValue, newVal) {
|
|
116
|
+
if ((0, _utils.isAttrEqual)(prevValue, newVal)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
switch (name) {
|
|
120
|
+
case 'value':
|
|
121
|
+
{
|
|
122
|
+
const {
|
|
123
|
+
hours,
|
|
124
|
+
minutes
|
|
125
|
+
} = (0, _utils2.parseTime)(newVal);
|
|
126
|
+
this.#hour = hours;
|
|
127
|
+
this.#minute = minutes;
|
|
128
|
+
this.#render();
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
case 'ampm':
|
|
132
|
+
{
|
|
133
|
+
this.#render();
|
|
134
|
+
(0, _utils.updateBooleanAttribute)(this, 'ampm', (0, _utils.isAttrTrue)(newVal));
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
case 'submit-aria-label':
|
|
138
|
+
{
|
|
139
|
+
(0, _utils.updateAttribute)(this.#$submitButton, 'aria-label', newVal);
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
set value(value) {
|
|
145
|
+
(0, _utils.updateAttribute)(this, 'value', value);
|
|
146
|
+
}
|
|
147
|
+
get value() {
|
|
148
|
+
return (0, _utils.getAttribute)(this, 'value', '');
|
|
149
|
+
}
|
|
150
|
+
set ampm(value) {
|
|
151
|
+
(0, _utils.updateBooleanAttribute)(this, 'ampm', value);
|
|
152
|
+
}
|
|
153
|
+
get ampm() {
|
|
154
|
+
return (0, _utils.getBooleanAttribute)(this, 'ampm');
|
|
155
|
+
}
|
|
156
|
+
set submitAriaLabel(value) {
|
|
157
|
+
(0, _utils.updateAttribute)(this, 'submit-aria-label', value);
|
|
158
|
+
}
|
|
159
|
+
get submitAriaLabel() {
|
|
160
|
+
return (0, _utils.getAttribute)(this, 'submit-aria-label', '');
|
|
161
|
+
}
|
|
162
|
+
get submitButtonRect() {
|
|
163
|
+
return (0, _utils.getRect)(this.#$submitButton);
|
|
164
|
+
}
|
|
165
|
+
get amButtonRect() {
|
|
166
|
+
if (!this.ampm) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
const $am = this.#$ampm.querySelector('[value="am"]');
|
|
170
|
+
return $am != null ? (0, _utils.getRect)($am) : null;
|
|
171
|
+
}
|
|
172
|
+
get pmButtonRect() {
|
|
173
|
+
if (!this.ampm) {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
const $pm = this.#$ampm.querySelector('[value="pm"]');
|
|
177
|
+
return $pm != null ? (0, _utils.getRect)($pm) : null;
|
|
178
|
+
}
|
|
179
|
+
hourDigitRect(hour) {
|
|
180
|
+
const $digit = this.#$pickerHours.children[(0, _utils2.hourToIndex)(hour, !this.ampm)];
|
|
181
|
+
return $digit != null ? (0, _utils.getRect)($digit) : null;
|
|
182
|
+
}
|
|
183
|
+
minuteDigitRect(minute) {
|
|
184
|
+
const $digit = this.#$pickerMinutes.children[Math.round(minute / 5)];
|
|
185
|
+
return $digit != null ? (0, _utils.getRect)($digit) : null;
|
|
186
|
+
}
|
|
187
|
+
#getClickDegree(x, y) {
|
|
188
|
+
const touchRect = this.#$pickerTouch.getBoundingClientRect();
|
|
189
|
+
const cx = touchRect.width / 2;
|
|
190
|
+
const cy = touchRect.height / 2;
|
|
191
|
+
const px = x - touchRect.x;
|
|
192
|
+
const py = touchRect.height - y + touchRect.y;
|
|
193
|
+
const dx = px - cx;
|
|
194
|
+
const dy = py - cy;
|
|
195
|
+
const len = Math.sqrt(dx * dx + dy * dy);
|
|
196
|
+
const cosRad = dx / len;
|
|
197
|
+
const rad = Math.acos(cosRad * (dy < 0 ? -1 : 1));
|
|
198
|
+
const deg = rad * (180 / Math.PI);
|
|
199
|
+
let cssDeg = (deg - 90 - 360) % 360 * -1;
|
|
200
|
+
if (dy < 0) {
|
|
201
|
+
cssDeg += 180;
|
|
202
|
+
}
|
|
203
|
+
const rowIndex = len > MINUTE_RADIUS ? 0 : len > HOUR_12_RADIUS ? 1 : 2;
|
|
204
|
+
return [cssDeg, rowIndex];
|
|
205
|
+
}
|
|
206
|
+
#onPickerClick = e => {
|
|
207
|
+
const [cssDeg, rowIndex] = this.#getClickDegree(e.x, e.y);
|
|
208
|
+
const isHourRowClick = rowIndex > 0;
|
|
209
|
+
const isHour24RowClick = rowIndex > 1;
|
|
210
|
+
if (isHourRowClick) {
|
|
211
|
+
const digitIndex = Math.round(cssDeg / 30) % 12;
|
|
212
|
+
const is24 = (0, _utils.getBooleanAttribute)(this, 'ampm') === false;
|
|
213
|
+
if (is24) {
|
|
214
|
+
if (isHour24RowClick) {
|
|
215
|
+
this.#hour = digitIndex === 0 ? 0 : digitIndex + 12;
|
|
216
|
+
} else {
|
|
217
|
+
this.#hour = digitIndex === 0 ? 12 : digitIndex;
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
this.#hour = digitIndex + (this.#$ampm.value === 'pm' ? 12 : 0);
|
|
221
|
+
}
|
|
222
|
+
this.#$headerHours.focus();
|
|
223
|
+
} else {
|
|
224
|
+
this.#minute = Math.round(cssDeg / 6) % 60;
|
|
225
|
+
this.#$headerMinutes.focus();
|
|
226
|
+
}
|
|
227
|
+
this.#render();
|
|
228
|
+
};
|
|
229
|
+
#render() {
|
|
230
|
+
const is24 = (0, _utils.getBooleanAttribute)(this, 'ampm') === false;
|
|
231
|
+
this.#selectHour(is24);
|
|
232
|
+
this.#selectMinute();
|
|
233
|
+
this.#$headerHoursText.textContent = (0, _utils2.stringifyHour)(this.#hour, is24);
|
|
234
|
+
this.#$headerMinutesText.textContent = (0, _utils2.stringifyMinute)(this.#minute);
|
|
235
|
+
(0, _utils.updateAttribute)(this.#$headerHours, 'aria-valuenow', this.#hour);
|
|
236
|
+
(0, _utils.updateAttribute)(this.#$headerHours, 'aria-valuetext', this.#hour);
|
|
237
|
+
(0, _utils.updateAttribute)(this.#$headerMinutes, 'aria-valuenow', this.#minute);
|
|
238
|
+
(0, _utils.updateAttribute)(this.#$headerMinutes, 'aria-valuetext', this.#minute);
|
|
239
|
+
}
|
|
240
|
+
#selectHour(is24) {
|
|
241
|
+
const $hours = this.#$pickerHours.children;
|
|
242
|
+
const hourDigitIndex = this.#hour % 12;
|
|
243
|
+
const selectedIndex = (0, _utils2.hourToIndex)(this.#hour, is24);
|
|
244
|
+
const currentCssDeg = (0, _utils2.getNeedleRotationDeg)(this.#$needleHour);
|
|
245
|
+
const hourCssDeg = (0, _utils2.getShortestCssDeg)(currentCssDeg, hourDigitIndex * 30);
|
|
246
|
+
for (let i = 0; i < $hours.length; i++) {
|
|
247
|
+
(0, _utils.setClass)($hours[i], 'selected', i === selectedIndex);
|
|
248
|
+
}
|
|
249
|
+
this.#$needleHour.style.transform = `rotate(${hourCssDeg}deg)`;
|
|
250
|
+
if (is24) {
|
|
251
|
+
if (this.#hour > 0 && this.#hour <= 12) {
|
|
252
|
+
this.#$needleHour.style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
|
|
253
|
+
} else {
|
|
254
|
+
this.#$needleHour.style.height = `${NEEDLE_HOUR_24_LENGTH}px`;
|
|
255
|
+
}
|
|
256
|
+
} else {
|
|
257
|
+
this.#$needleHour.style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
|
|
258
|
+
}
|
|
259
|
+
this.#$ampm.setAttribute('value', this.#hour >= 0 && this.#hour < 12 ? 'am' : 'pm');
|
|
260
|
+
}
|
|
261
|
+
#selectMinute() {
|
|
262
|
+
const $minutes = this.#$pickerMinutes.children;
|
|
263
|
+
const isNeedleSelected = this.#minute % 5 === 0;
|
|
264
|
+
const selectedIndex = this.#minute / 5;
|
|
265
|
+
const currentCssDeg = (0, _utils2.getNeedleRotationDeg)(this.#$needleMinute);
|
|
266
|
+
const minuteCssDeg = (0, _utils2.getShortestCssDeg)(currentCssDeg, this.#minute * 6);
|
|
267
|
+
for (let i = 0; i < $minutes.length; i++) {
|
|
268
|
+
(0, _utils.setClass)($minutes[i], 'selected', selectedIndex === i);
|
|
269
|
+
}
|
|
270
|
+
(0, _utils.setClass)(this.#$needleMinute, 'selected', isNeedleSelected);
|
|
271
|
+
this.#$needleMinute.style.transform = `rotate(${minuteCssDeg}deg)`;
|
|
272
|
+
}
|
|
273
|
+
#onAmPmChange = e => {
|
|
274
|
+
const value = e.detail;
|
|
275
|
+
switch (value) {
|
|
276
|
+
case 'am':
|
|
277
|
+
{
|
|
278
|
+
if (this.#hour >= 12) {
|
|
279
|
+
this.#hour -= 12;
|
|
280
|
+
this.#render();
|
|
281
|
+
}
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
case 'pm':
|
|
285
|
+
{
|
|
286
|
+
if (this.#hour < 12) {
|
|
287
|
+
this.#hour += 12;
|
|
288
|
+
this.#render();
|
|
289
|
+
}
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
#onSubmitButtonClick = () => {
|
|
295
|
+
const value = (0, _utils2.stringifyTime)(this.#hour, this.#minute);
|
|
296
|
+
this.dispatchEvent(new CustomEvent('-change', {
|
|
297
|
+
detail: value
|
|
298
|
+
}));
|
|
299
|
+
};
|
|
300
|
+
#onHoursKeydown = e => {
|
|
301
|
+
switch (e.key) {
|
|
302
|
+
case 'ArrowUp':
|
|
303
|
+
{
|
|
304
|
+
e.preventDefault();
|
|
305
|
+
this.#hour = (this.#hour + 1) % 24;
|
|
306
|
+
this.#render();
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
case 'ArrowDown':
|
|
310
|
+
{
|
|
311
|
+
e.preventDefault();
|
|
312
|
+
this.#hour = (this.#hour + 23) % 24;
|
|
313
|
+
this.#render();
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
#onMinutesKeydown = e => {
|
|
319
|
+
switch (e.key) {
|
|
320
|
+
case 'ArrowUp':
|
|
321
|
+
{
|
|
322
|
+
e.preventDefault();
|
|
323
|
+
this.#minute = (this.#minute + 1) % 60;
|
|
324
|
+
this.#render();
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
case 'ArrowDown':
|
|
328
|
+
{
|
|
329
|
+
e.preventDefault();
|
|
330
|
+
this.#minute = (this.#minute + 59) % 60;
|
|
331
|
+
this.#render();
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
#onChangeReactHandler = e => {
|
|
337
|
+
(0, _utils.getReactEventHandler)(this, 'on-change')?.(e);
|
|
338
|
+
};
|
|
339
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.stringifyTime = exports.stringifyMinute = exports.stringifyHourFace = exports.stringifyHour = exports.parseTime = exports.hourToIndex = exports.getShortestCssDeg = exports.getNeedleRotationDeg = void 0;
|
|
7
|
+
const parseTime = value => {
|
|
8
|
+
if (value === '' || value === null) {
|
|
9
|
+
return {
|
|
10
|
+
hours: 0,
|
|
11
|
+
minutes: 0
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const timeParts = value.split(':');
|
|
15
|
+
const hours = parseInt(timeParts[0] ?? '00');
|
|
16
|
+
const minutes = parseInt(timeParts[1] ?? '00');
|
|
17
|
+
if (isNaN(hours) || hours > 23 || hours < 0) {
|
|
18
|
+
return {
|
|
19
|
+
hours: 0,
|
|
20
|
+
minutes: 0
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (isNaN(minutes) || minutes > 59 || minutes < 0) {
|
|
24
|
+
return {
|
|
25
|
+
hours: 0,
|
|
26
|
+
minutes: 0
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
hours,
|
|
31
|
+
minutes
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exports.parseTime = parseTime;
|
|
35
|
+
const pad = value => {
|
|
36
|
+
return value.toString().padStart(2, '0');
|
|
37
|
+
};
|
|
38
|
+
const stringifyTime = (hour, minute) => {
|
|
39
|
+
return `${pad(hour)}:${pad(minute)}:00`;
|
|
40
|
+
};
|
|
41
|
+
exports.stringifyTime = stringifyTime;
|
|
42
|
+
const stringifyHour = (hour, is24) => {
|
|
43
|
+
if (is24) {
|
|
44
|
+
return pad(hour);
|
|
45
|
+
}
|
|
46
|
+
if (hour === 0 || hour === 12) {
|
|
47
|
+
return '12';
|
|
48
|
+
}
|
|
49
|
+
return pad(hour % 12);
|
|
50
|
+
};
|
|
51
|
+
exports.stringifyHour = stringifyHour;
|
|
52
|
+
const stringifyHourFace = hour => {
|
|
53
|
+
return hour === 0 ? '12' : hour === 12 ? '24' : String(hour);
|
|
54
|
+
};
|
|
55
|
+
exports.stringifyHourFace = stringifyHourFace;
|
|
56
|
+
const stringifyMinute = minute => {
|
|
57
|
+
return pad(minute);
|
|
58
|
+
};
|
|
59
|
+
exports.stringifyMinute = stringifyMinute;
|
|
60
|
+
const hourToIndex = (hour, is24) => {
|
|
61
|
+
if (is24) {
|
|
62
|
+
if (hour === 0) {
|
|
63
|
+
return 12;
|
|
64
|
+
}
|
|
65
|
+
if (hour === 12) {
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
return hour;
|
|
69
|
+
}
|
|
70
|
+
return hour % 12;
|
|
71
|
+
};
|
|
72
|
+
exports.hourToIndex = hourToIndex;
|
|
73
|
+
const getNeedleRotationDeg = elem => {
|
|
74
|
+
const match = elem.style.transform.match(/^rotate\((-?\d+)deg\)$/);
|
|
75
|
+
if (match === null) {
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
return Number(match[1]);
|
|
79
|
+
};
|
|
80
|
+
exports.getNeedleRotationDeg = getNeedleRotationDeg;
|
|
81
|
+
const getShortestCssDeg = (currentDeg, nextDeg) => {
|
|
82
|
+
const angle = currentDeg % 360;
|
|
83
|
+
const diff = (360 - (angle - nextDeg)) % 360;
|
|
84
|
+
if (diff > 180) {
|
|
85
|
+
return currentDeg - 360 + diff;
|
|
86
|
+
}
|
|
87
|
+
return currentDeg + diff;
|
|
88
|
+
};
|
|
89
|
+
exports.getShortestCssDeg = getShortestCssDeg;
|