@nectary/components 5.0.2 → 5.0.4
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/accordion/index.js +2 -1
- package/accordion-item/index.js +1 -1
- package/action-menu/index.js +1 -1
- package/action-menu-option/index.js +1 -1
- package/alert/index.js +1 -1
- package/avatar/index.js +1 -1
- package/badge/index.js +1 -1
- package/bundle.js +110 -77
- package/button/index.js +1 -1
- package/button-group/index.js +1 -1
- package/button-group-item/index.js +1 -1
- package/card-container/index.js +1 -1
- package/card-v2/index.js +1 -1
- package/card-v2-title/index.js +1 -1
- package/checkbox/index.js +2 -1
- package/chip/index.js +1 -1
- package/code-tag/index.js +1 -1
- package/color-menu/index.js +2 -1
- package/color-menu-option/index.js +1 -1
- package/color-swatch/index.js +1 -1
- package/date-picker/index.js +2 -1
- package/dialog/index.js +2 -1
- package/emoji/index.js +1 -1
- package/emoji-picker/index.js +2 -1
- package/field/index.js +1 -1
- package/file-drop/index.js +3 -1
- package/file-picker/index.js +3 -1
- package/file-status/index.js +1 -1
- package/flag/index.js +1 -1
- package/grid/index.js +1 -1
- package/grid-item/index.js +1 -1
- package/help-tooltip/index.js +3 -1
- package/icon/index.js +1 -1
- package/inline-alert/index.js +1 -1
- package/input/index.js +2 -1
- package/link/index.js +1 -1
- package/list/index.js +1 -1
- package/list-item/index.js +1 -1
- package/package.json +3 -3
- package/pagination/index.js +2 -1
- package/persistent-overlay/index.js +2 -1
- package/pop/index.js +2 -1
- package/popover/index.js +1 -1
- package/progress/index.js +1 -1
- package/progress-stepper/index.js +2 -1
- package/progress-stepper-item/index.js +1 -1
- package/radio/index.js +2 -1
- package/radio-option/index.js +1 -1
- package/rich-text/index.js +2 -1
- package/rich-textarea/index.js +3 -1
- package/segment-collapse/index.js +2 -1
- package/segmented-control/index.js +2 -1
- package/segmented-control-option/index.js +1 -1
- package/segmented-icon-control/index.js +2 -1
- package/segmented-icon-control-option/index.js +1 -1
- package/select-button/index.js +1 -1
- package/select-menu/index.js +3 -1
- package/select-menu-option/index.js +1 -1
- package/skeleton/index.js +1 -1
- package/skeleton-item/index.js +1 -1
- package/spinner/index.js +1 -1
- package/table/index.js +1 -1
- package/table-body/index.js +1 -1
- package/table-cell/index.js +1 -1
- package/table-head/index.js +1 -1
- package/table-head-cell/index.js +1 -1
- package/table-row/index.js +1 -1
- package/tabs/index.js +2 -1
- package/tabs-icon-option/index.js +1 -1
- package/tabs-option/index.js +1 -1
- package/tag/index.js +1 -1
- package/text/index.js +1 -1
- package/textarea/index.js +2 -1
- package/time-picker/index.js +2 -1
- package/title/index.js +1 -1
- package/toast/index.js +2 -1
- package/toast-manager/index.js +1 -1
- package/toggle/index.js +2 -1
- package/tooltip/index.js +3 -1
- package/types.d.ts +2 -2
- package/utils/adapters.d.ts +1 -0
package/time-picker/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { defineCustomElement, NectaryElement } from "../utils/element.js";
|
|
|
6
6
|
import { getRect } from "../utils/rect.js";
|
|
7
7
|
import { getReactEventHandler } from "../utils/get-react-event-handler.js";
|
|
8
8
|
import { stringifyHourFace, stringifyMinute, parseTime, hourToIndex, stringifyHour, getNeedleRotationDeg, getShortestCssDeg, stringifyTime } from "./utils.js";
|
|
9
|
-
const templateHTML = '<style
|
|
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-button id="submit" size="s" aria-label="Submit"><sinch-icon icons-version="2" name="fa-check" id="icon-submit" slot="icon"></sinch-icon></sinch-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
10
|
const template = document.createElement("template");
|
|
11
11
|
template.innerHTML = templateHTML;
|
|
12
12
|
const PICKER_RADIUS = 216 / 2;
|
|
@@ -325,6 +325,7 @@ class TimePicker extends NectaryElement {
|
|
|
325
325
|
};
|
|
326
326
|
#onChangeReactHandler = (e) => {
|
|
327
327
|
getReactEventHandler(this, "on-change")?.(e);
|
|
328
|
+
getReactEventHandler(this, "onChange")?.(e);
|
|
328
329
|
};
|
|
329
330
|
}
|
|
330
331
|
defineCustomElement("sinch-time-picker", TimePicker);
|
package/title/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isAttrEqual, updateBooleanAttribute, isAttrTrue, updateAttribute, getAttribute, updateLiteralAttribute, getLiteralAttribute, getBooleanAttribute } from "../utils/dom.js";
|
|
2
2
|
import { defineCustomElement, NectaryElement } from "../utils/element.js";
|
|
3
3
|
import { typeValues } from "./utils.js";
|
|
4
|
-
const templateHTML = '<style
|
|
4
|
+
const templateHTML = '<style>:host{display:block;--sinch-comp-title-font:var(--sinch-sys-font-desktop-title-m)}:host([type=xl]){--sinch-comp-title-font:var(--sinch-sys-font-desktop-title-xl)}:host([type="l"]){--sinch-comp-title-font:var(--sinch-sys-font-desktop-title-l)}:host([type="m"]){--sinch-comp-title-font:var(--sinch-sys-font-desktop-title-m)}:host([type="s"]){--sinch-comp-title-font:var(--sinch-sys-font-desktop-title-s)}:host([type=xs]){--sinch-comp-title-font:var(--sinch-sys-font-desktop-title-xs)}#text{letter-spacing:-2%;color:var(--sinch-global-color-text,var(--sinch-sys-color-text-default));font:var(--sinch-comp-title-font)}:host([ellipsis]) #text{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}</style><span id="text"></span>';
|
|
5
5
|
const template = document.createElement("template");
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
7
7
|
class Title extends NectaryElement {
|
package/toast/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { updateAttribute, getLiteralAttribute, updateLiteralAttribute, getAttrib
|
|
|
4
4
|
import { defineCustomElement, NectaryElement } from "../utils/element.js";
|
|
5
5
|
import { getReactEventHandler } from "../utils/get-react-event-handler.js";
|
|
6
6
|
import { typeValues } from "./utils.js";
|
|
7
|
-
const templateHTML = '<style
|
|
7
|
+
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:row;align-items:center;gap:8px;width:328px;max-width:90vw;padding:16px;box-sizing:border-box;border-radius:var(--sinch-comp-toast-shape-radius);box-shadow:var(--sinch-comp-toast-shadow)}:host([type=success]) #wrapper{background-color:var(--sinch-comp-toast-color-success-default-background)}:host([type=warn]) #wrapper{background-color:var(--sinch-comp-toast-color-warning-default-background)}:host([type=error]) #wrapper{background-color:var(--sinch-comp-toast-color-error-default-background)}:host([type=info]) #wrapper{background-color:var(--sinch-comp-toast-color-info-default-background)}#text{padding:4px 0 4px 4px;flex:1;min-width:0;word-wrap:break-word;--sinch-comp-text-font:var(--sinch-comp-toast-font-body)}:host([type=success]) #text{--sinch-global-color-text:var(--sinch-comp-toast-color-success-default-text)}:host([type=warn]) #text{--sinch-global-color-text:var(--sinch-comp-toast-color-warning-default-text)}:host([type=error]) #text{--sinch-global-color-text:var(--sinch-comp-toast-color-error-default-text)}:host([type=info]) #text{--sinch-global-color-text:var(--sinch-comp-toast-color-info-default-text)}#icon{align-self:flex-start;margin:4px 0}#icon-error,#icon-info,#icon-success,#icon-warn{display:none}#icon-success{--sinch-global-color-icon:var(--sinch-comp-toast-color-success-default-icon)}#icon-warn{--sinch-global-color-icon:var(--sinch-comp-toast-color-warning-default-icon)}#icon-error{--sinch-global-color-icon:var(--sinch-comp-toast-color-error-default-icon)}#icon-info{--sinch-global-color-icon:var(--sinch-comp-toast-color-info-default-icon)}:host([type=error]) #icon-error,:host([type=info]) #icon-info,:host([type=success]) #icon-success,:host([type=warn]) #icon-warn{display:block}</style><div id="wrapper"><sinch-icon icons-version="2" name="circle-info" id="icon-info"></sinch-icon><sinch-icon icons-version="2" name="circle-check" id="icon-success"></sinch-icon><sinch-icon icons-version="2" name="triangle-exclamation" id="icon-warn"></sinch-icon><sinch-icon icons-version="2" name="octagon-exclamation" id="icon-error"></sinch-icon><sinch-rich-text id="text" size="m"></sinch-rich-text><slot name="action"></slot><slot name="close"></slot></div>';
|
|
8
8
|
const TIMEOUT = 5e3;
|
|
9
9
|
const template = document.createElement("template");
|
|
10
10
|
template.innerHTML = templateHTML;
|
|
@@ -82,6 +82,7 @@ class Toast extends NectaryElement {
|
|
|
82
82
|
}
|
|
83
83
|
#onTimeoutReactHandler = (e) => {
|
|
84
84
|
getReactEventHandler(this, "on-timeout")?.(e);
|
|
85
|
+
getReactEventHandler(this, "onTimeout")?.(e);
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
88
|
defineCustomElement("sinch-toast", Toast);
|
package/toast-manager/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { shouldReduceMotion, getLiteralAttribute, updateLiteralAttribute, cloneN
|
|
|
4
4
|
import { defineCustomElement, NectaryElement } from "../utils/element.js";
|
|
5
5
|
import { getRect } from "../utils/rect.js";
|
|
6
6
|
import { originValues } from "./utils.js";
|
|
7
|
-
const templateHTML = '<style
|
|
7
|
+
const templateHTML = '<style>:host{display:block}#items{display:block;width:0;height:0;visibility:hidden;overflow:hidden}#list{display:flex;flex-direction:column;position:fixed;z-index:1;bottom:0;right:16px}:host([origin=top-right]) #list{flex-direction:column-reverse;bottom:unset;top:16px}.item-wrapper{height:0;opacity:0;position:relative}.item-wrapper[data-deleting]::after{content:"";position:absolute;top:0;left:0;bottom:0;right:0}</style><slot id="items"></slot><div id="list"></div>';
|
|
8
8
|
const DURATION_ADD = 250;
|
|
9
9
|
const DURATION_REMOVE = 250;
|
|
10
10
|
const ITEMS_GAP = 16;
|
package/toggle/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isAttrEqual, updateBooleanAttribute, isAttrTrue, updateExplicitBooleanAttribute, getBooleanAttribute, updateAttribute, getAttribute } from "../utils/dom.js";
|
|
2
2
|
import { defineCustomElement, NectaryElement } from "../utils/element.js";
|
|
3
3
|
import { getReactEventHandler } from "../utils/get-react-event-handler.js";
|
|
4
|
-
const templateHTML = '<style
|
|
4
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;display:flex;flex-direction:row;gap:8px;width:100%;height:var(--sinch-local-size);cursor:pointer;user-select:none;--sinch-local-size:20px}:host([small]) #wrapper{--sinch-local-size:16px}:host([disabled]) #wrapper{cursor:initial}#knob-container{position:relative;width:40px;height:var(--sinch-local-size);border-radius:calc(var(--sinch-local-size) * .5);background-color:var(--sinch-comp-toggle-color-default-background-initial);pointer-events:none;transition:background-color .15s ease-in-out}:host([small]) #knob-container{width:32px;height:var(--sinch-local-size)}:host([checked]) #knob-container{background-color:var(--sinch-comp-toggle-color-checked-background-initial)}:host([disabled]) #knob-container{background-color:var(--sinch-comp-toggle-color-disabled-background-initial)}:host([checked][disabled]) #knob-container{background-color:var(--sinch-comp-toggle-color-checked-disabled-background-initial)}#knob{position:relative;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background-color:var(--sinch-comp-toggle-color-default-knob-background-initial);box-shadow:var(--sinch-comp-toggle-shadow-knob-default);transform:translateX(0);transition:transform .15s ease-in-out;will-change:transform}:host([small]) #knob{width:12px;height:12px}:host([disabled]) #knob-container>#knob{box-shadow:var(--sinch-comp-toggle-shadow-knob-disabled)}:host([checked]) #knob-container>#knob{transform:translateX(20px)}:host([small][checked]) #knob-container>#knob{transform:translateX(16px)}#knob::after,#knob::before{font:var(--sinch-comp-toggle-font-size-m-inside-text);color:var(--sinch-comp-toggle-color-default-text-inside-initial);text-transform:uppercase;position:absolute;top:0;padding:0 1px;opacity:0;transition:opacity .15s ease-in-out;user-select:none}#knob::before{content:"on";right:100%}#knob::after{content:"off";left:100%}:host([labeled]:not([small]):not([checked])) #knob::after{opacity:1}:host([labeled]:not([small])[checked]) #knob::before{opacity:1}@media (prefers-reduced-motion){#knob,#knob-container,#knob::after,#knob::before{transition:none}}#outline{display:none;position:absolute;left:-3px;top:-3px;right:-3px;bottom:-3px;border:2px solid var(--sinch-comp-toggle-color-default-outline-focus);border-radius:17px;pointer-events:none}:host(:focus-visible) #outline{display:block}#label{flex:1;min-width:0;align-self:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font:var(--sinch-comp-toggle-font-size-m-label);color:var(--sinch-comp-toggle-color-default-label-initial)}#label:empty{display:none}:host([small]) #label{font:var(--sinch-comp-toggle-font-size-s-label)}:host([disabled]) #label{color:var(--sinch-comp-toggle-color-disabled-label-initial)}</style><div id="wrapper"><div id="knob-container"><div id="outline"></div><div id="knob"></div></div><span id="label"></span></div>';
|
|
5
5
|
const template = document.createElement("template");
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
7
7
|
class Toggle extends NectaryElement {
|
|
@@ -134,6 +134,7 @@ class Toggle extends NectaryElement {
|
|
|
134
134
|
};
|
|
135
135
|
#onChangeReactHandler = (e) => {
|
|
136
136
|
getReactEventHandler(this, "on-change")?.(e);
|
|
137
|
+
getReactEventHandler(this, "onChange")?.(e);
|
|
137
138
|
};
|
|
138
139
|
#onFocusReactHandler = (e) => {
|
|
139
140
|
getReactEventHandler(this, "on-focus")?.(e);
|
package/tooltip/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { rectOverlap } from "../utils/rect.js";
|
|
|
6
6
|
import { getReactEventHandler } from "../utils/get-react-event-handler.js";
|
|
7
7
|
import { TooltipState } from "./tooltip-state.js";
|
|
8
8
|
import { getPopOrientation, orientationValues, textAlignValues, typeValues } from "./utils.js";
|
|
9
|
-
const templateHTML = '<style
|
|
9
|
+
const templateHTML = '<style>:host{display:contents}#content-wrapper{padding-bottom:8px;filter:drop-shadow(var(--sinch-comp-tooltip-shadow))}:host([orientation=left]) #content-wrapper{padding-bottom:0;padding-right:8px}:host([orientation=right]) #content-wrapper{padding-bottom:0;padding-left:8px}:host([orientation^=bottom]) #content-wrapper{padding-bottom:0;padding-top:8px}#content{position:relative;display:block;max-width:300px;padding:2px 6px;box-sizing:border-box;background-color:var(--sinch-local-color-background);border-radius:var(--sinch-comp-tooltip-shape-radius);pointer-events:none;opacity:0;--sinch-local-color-background:var(--sinch-comp-tooltip-color-background);--sinch-global-color-text:var(--sinch-comp-tooltip-color-text)}#text{word-break:break-word;pointer-events:none;--sinch-comp-text-font:var(--sinch-comp-tooltip-font-body)}#tip{position:absolute;left:50%;top:100%;transform:translateX(-50%) rotate(0);transform-origin:top center;fill:var(--sinch-local-color-background);pointer-events:none}#tip.hidden{display:none}:host([orientation=left]) #tip{transform:translateX(-50%) rotate(270deg);top:50%;left:100%}:host([orientation=right]) #tip{transform:translateX(-50%) rotate(90deg);top:50%;left:0}:host([orientation^=bottom]) #tip{transform:translateX(-50%) rotate(180deg);top:0}:host([text-align=right]) #text{--sinch-comp-text-align:right}:host([text-align=center]) #text{--sinch-comp-text-align:center}:host([text-align=left]) #text{--sinch-comp-text-align:left}</style><sinch-pop id="pop"><slot id="target" slot="target"></slot><div id="content-wrapper" slot="content"><div id="content"><sinch-text id="text" type="s"></sinch-text><svg id="tip" width="8" height="4" aria-hidden="true"><path d="m4 4 4-4h-8l4 4Z"/></svg></div></div></sinch-pop>';
|
|
10
10
|
const TIP_SIZE = 8;
|
|
11
11
|
const SHOW_DELAY_SLOW = 1e3;
|
|
12
12
|
const SHOW_DELAY_FAST = 250;
|
|
@@ -277,9 +277,11 @@ class Tooltip extends NectaryElement {
|
|
|
277
277
|
}
|
|
278
278
|
#onShowReactHandler = () => {
|
|
279
279
|
getReactEventHandler(this, "on-show")?.();
|
|
280
|
+
getReactEventHandler(this, "onShow")?.();
|
|
280
281
|
};
|
|
281
282
|
#onHideReactHandler = () => {
|
|
282
283
|
getReactEventHandler(this, "on-hide")?.();
|
|
284
|
+
getReactEventHandler(this, "onHide")?.();
|
|
283
285
|
};
|
|
284
286
|
}
|
|
285
287
|
defineCustomElement("sinch-tooltip", Tooltip);
|
package/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactifyEvents, WebComponentReactBaseProp, SafeSelect, CamelCaseify, RemoveReadonly, SetAttributes, ExtendEventListeners } from './utils/adapters';
|
|
1
|
+
import type { ReactifyEvents, WebComponentReactBaseProp, SafeSelect, CamelCaseify, RemoveReadonly, SetAttributes, ExtendEventListeners, PatchReactEvents } from './utils/adapters';
|
|
2
2
|
import type { CSSProperties } from 'react';
|
|
3
3
|
export type TRect = {
|
|
4
4
|
x: number;
|
|
@@ -7,7 +7,7 @@ export type TRect = {
|
|
|
7
7
|
height: number;
|
|
8
8
|
};
|
|
9
9
|
export type NectaryComponentVanillaByType<T extends NectaryComponentMap[keyof NectaryComponentMap]> = Omit<HTMLElement, 'addEventListener' | 'removeEventListener'> & ExtendEventListeners<Required<SafeSelect<T, 'events'>>> & SetAttributes<Required<RemoveReadonly<SafeSelect<T, 'props'>>>> & Required<CamelCaseify<SafeSelect<T, 'props'>>> & Required<SafeSelect<T, 'methods'>>;
|
|
10
|
-
export type NectaryComponentReactByType<T extends NectaryComponentMap[keyof NectaryComponentMap]> = WebComponentReactBaseProp<NectaryComponentVanillaByType<T
|
|
10
|
+
export type NectaryComponentReactByType<T extends NectaryComponentMap[keyof NectaryComponentMap]> = PatchReactEvents<WebComponentReactBaseProp<NectaryComponentVanillaByType<T>>, ReactifyEvents<SafeSelect<T, 'events'>>> & RemoveReadonly<SafeSelect<T, 'props'>> & {
|
|
11
11
|
style?: Partial<SafeSelect<T, 'style'>> & CSSProperties;
|
|
12
12
|
};
|
|
13
13
|
export type NectaryComponentVanilla<K extends keyof NectaryComponentMap> = NectaryComponentVanillaByType<NectaryComponentMap[K]>;
|
package/utils/adapters.d.ts
CHANGED
|
@@ -27,4 +27,5 @@ export type ReactifyEvents<T> = {
|
|
|
27
27
|
export type WebComponentReactBaseProp<T = HTMLElement> = Omit<DetailedHTMLProps<HTMLAttributes<T>, T>, 'className' | 'style'> & {
|
|
28
28
|
class?: string;
|
|
29
29
|
};
|
|
30
|
+
export type PatchReactEvents<T, Events> = Omit<T, keyof CamelCaseify<Events>> & Partial<CamelCaseify<Events>> & Partial<Events>;
|
|
30
31
|
export {};
|