carbon-react 155.3.1 → 155.4.1
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/esm/__internal__/focus-trap/focus-trap-utils.d.ts +1 -1
- package/esm/__internal__/i18n-context/index.d.ts +1 -2
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +1 -2
- package/esm/__internal__/utils/helpers/events/events.d.ts +1 -1
- package/esm/__spec_helper__/mock-match-media.d.ts +0 -1
- package/esm/components/accordion/accordion.style.d.ts +0 -1
- package/esm/components/action-popover/__internal__/action-popover.context.d.ts +0 -1
- package/esm/components/action-popover/action-popover.style.d.ts +0 -1
- package/esm/components/adaptive-sidebar/adaptive-sidebar.style.d.ts +3 -3
- package/esm/components/advanced-color-picker/advanced-color-picker.style.d.ts +0 -1
- package/esm/components/badge/badge.style.d.ts +0 -1
- package/esm/components/box/box.style.d.ts +5 -5
- package/esm/components/breadcrumbs/__internal__/breadcrumbs.context.d.ts +0 -1
- package/esm/components/breadcrumbs/crumb/crumb.style.d.ts +0 -1
- package/esm/components/button/button.style.d.ts +1 -1
- package/esm/components/button-minor/button-minor.style.d.ts +0 -1
- package/esm/components/button-toggle/button-toggle-group/__internal__/button-toggle-group.context.d.ts +0 -1
- package/esm/components/card/__internal__/card.context.d.ts +0 -1
- package/esm/components/card/card-footer/card-footer.style.d.ts +1 -1
- package/esm/components/checkbox/checkbox-group/checkbox-group.style.d.ts +2 -2
- package/esm/components/date/date.component.js +1 -1
- package/esm/components/definition-list/__internal__/dl.context.d.ts +0 -1
- package/esm/components/detail/detail.style.d.ts +0 -1
- package/esm/components/dialog/dialog.style.d.ts +2 -2
- package/esm/components/dialog-full-screen/dialog-full-screen.style.d.ts +1 -1
- package/esm/components/dismissible-box/dismissible-box.style.d.ts +0 -1
- package/esm/components/drawer/drawer.style.d.ts +1 -2
- package/esm/components/duelling-picklist/duelling-picklist.style.d.ts +1 -1
- package/esm/components/duelling-picklist/picklist/picklist.style.d.ts +5 -5
- package/esm/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +0 -1
- package/esm/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +1 -2
- package/esm/components/flat-table/__internal__/flat-table.context.d.ts +0 -1
- package/esm/components/flat-table/__internal__/strict-flat-table.context.d.ts +0 -1
- package/esm/components/flat-table/__internal__/use-table-cell.d.ts +2 -3
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.style.d.ts +1 -1
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.d.ts +4 -4
- package/esm/components/flat-table/flat-table.style.d.ts +5 -5
- package/esm/components/flat-table/sort/sort.style.d.ts +0 -1
- package/esm/components/form/form.component.d.ts +5 -1
- package/esm/components/form/form.component.js +1 -1
- package/esm/components/form/form.style.d.ts +4 -2
- package/esm/components/form/form.style.js +1 -1
- package/esm/components/heading/heading.component.js +1 -1
- package/esm/components/heading/heading.style.d.ts +0 -1
- package/esm/components/image/image.style.d.ts +1 -2
- package/esm/components/link-preview/link-preview.style.d.ts +1 -1
- package/esm/components/loader-spinner/loader-spinner.style.d.ts +0 -1
- package/esm/components/loader-star/loader-star.style.d.ts +0 -1
- package/esm/components/menu/__internal__/menu.context.d.ts +0 -1
- package/esm/components/menu/__internal__/strict-menu.context.d.ts +0 -1
- package/esm/components/menu/menu-item/menu-item.style.d.ts +0 -1
- package/esm/components/menu/menu-segment-title/menu-segment-title.style.d.ts +1 -1
- package/esm/components/menu/menu.types.d.ts +0 -1
- package/esm/components/modal/modal.style.d.ts +1 -1
- package/esm/components/navigation-bar/navigation-bar.style.d.ts +5 -5
- package/esm/components/note/note.style.d.ts +1 -1
- package/esm/components/number/number.component.js +1 -1
- package/esm/components/numeral-date/numeral-date.style.d.ts +1 -2
- package/esm/components/pager/pager.style.d.ts +0 -1
- package/esm/components/password/password.style.d.ts +0 -1
- package/esm/components/pill/pill.style.d.ts +1 -1
- package/esm/components/pod/pod.style.d.ts +0 -1
- package/esm/components/popover-container/popover-container.component.js +1 -1
- package/esm/components/popover-container/popover-container.style.d.ts +0 -1
- package/esm/components/portrait/__internal__/get-colors.d.ts +7 -1
- package/esm/components/profile/profile.style.d.ts +0 -1
- package/esm/components/radio-button/radio-button-group/radio-button-group.style.d.ts +2 -2
- package/esm/components/radio-button/radio-button.style.d.ts +1 -1
- package/esm/components/select/__internal__/utils/is-expected-option.d.ts +0 -1
- package/esm/components/sidebar/__internal__/sidebar-header/index.d.ts +1 -0
- package/esm/components/sidebar/__internal__/sidebar-header/index.js +1 -1
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +14 -1
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +1 -1
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.d.ts +6 -1
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
- package/esm/components/sidebar/sidebar.component.d.ts +6 -0
- package/esm/components/sidebar/sidebar.component.js +1 -1
- package/esm/components/simple-color-picker/simple-color/simple-color.style.d.ts +0 -1
- package/esm/components/split-button/split-button-toggle.style.d.ts +2 -2
- package/esm/components/step-flow/__internal__/step-flow.context.d.ts +0 -1
- package/esm/components/step-sequence/__internal__/step-sequence.context.d.ts +0 -1
- package/esm/components/tabs/__internal__/tab-title/tab-title.style.d.ts +6 -5
- package/esm/components/tabs/tab/tab.style.d.ts +1 -1
- package/esm/components/text-editor/__internal__/helpers.js +1 -1
- package/esm/components/text-editor/__internal__/plugins/LinkPreviewer/link-previewer.component.d.ts +1 -1
- package/esm/components/text-editor/__internal__/plugins/Toolbar/toolbar.style.d.ts +1 -2
- package/esm/components/text-editor/__internal__/read-only-rte.component.js +1 -1
- package/esm/components/text-editor/text-editor.component.js +1 -1
- package/esm/components/text-editor/text-editor.context.d.ts +1 -1
- package/esm/components/tile/__internal__/compute-content-padding.js +1 -1
- package/esm/components/tile/__internal__/tile.context.d.ts +0 -1
- package/esm/components/tile/tile.style.d.ts +1 -1
- package/esm/components/tile-select/tile-select.style.d.ts +7 -8
- package/esm/components/time/time.style.d.ts +0 -1
- package/esm/components/toast/toast.style.d.ts +7 -8
- package/esm/components/tooltip/tooltip.component.js +1 -1
- package/esm/components/vertical-menu/__internal__/vertical-menu.context.d.ts +0 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/__internal__/depth.context.d.ts +1 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/__internal__/focus.context.js +1 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.component.js +1 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.d.ts +5 -6
- package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.context.js +1 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.d.ts +0 -1
- package/esm/components/vertical-menu/vertical-menu-item/vertical-menu-item.component.d.ts +1 -1
- package/esm/components/vertical-menu/vertical-menu.style.d.ts +10 -11
- package/esm/hooks/__internal__/useChildButtons/useChildButtons.d.ts +1 -2
- package/esm/hooks/__internal__/useFocusPortalContent/useFocusPortalContent.d.ts +1 -1
- package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +0 -1
- package/esm/hooks/__internal__/useLocale/useLocale.d.ts +1 -1
- package/esm/hooks/__internal__/useModalAria/useModalAria.d.ts +0 -1
- package/esm/style/utils/add-focus-styling.js +1 -1
- package/lib/__internal__/focus-trap/focus-trap-utils.d.ts +1 -1
- package/lib/__internal__/i18n-context/index.d.ts +1 -2
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +1 -2
- package/lib/__internal__/utils/helpers/events/events.d.ts +1 -1
- package/lib/__spec_helper__/mock-match-media.d.ts +0 -1
- package/lib/components/accordion/accordion.style.d.ts +0 -1
- package/lib/components/action-popover/__internal__/action-popover.context.d.ts +0 -1
- package/lib/components/action-popover/action-popover.style.d.ts +0 -1
- package/lib/components/adaptive-sidebar/adaptive-sidebar.style.d.ts +3 -3
- package/lib/components/advanced-color-picker/advanced-color-picker.style.d.ts +0 -1
- package/lib/components/badge/badge.style.d.ts +0 -1
- package/lib/components/box/box.style.d.ts +5 -5
- package/lib/components/breadcrumbs/__internal__/breadcrumbs.context.d.ts +0 -1
- package/lib/components/breadcrumbs/crumb/crumb.style.d.ts +0 -1
- package/lib/components/button/button.style.d.ts +1 -1
- package/lib/components/button-minor/button-minor.style.d.ts +0 -1
- package/lib/components/button-toggle/button-toggle-group/__internal__/button-toggle-group.context.d.ts +0 -1
- package/lib/components/card/__internal__/card.context.d.ts +0 -1
- package/lib/components/card/card-footer/card-footer.style.d.ts +1 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group.style.d.ts +2 -2
- package/lib/components/definition-list/__internal__/dl.context.d.ts +0 -1
- package/lib/components/detail/detail.style.d.ts +0 -1
- package/lib/components/dialog/dialog.style.d.ts +2 -2
- package/lib/components/dialog-full-screen/dialog-full-screen.style.d.ts +1 -1
- package/lib/components/dismissible-box/dismissible-box.style.d.ts +0 -1
- package/lib/components/drawer/drawer.style.d.ts +1 -2
- package/lib/components/duelling-picklist/duelling-picklist.style.d.ts +1 -1
- package/lib/components/duelling-picklist/picklist/picklist.style.d.ts +5 -5
- package/lib/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +0 -1
- package/lib/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +1 -2
- package/lib/components/flat-table/__internal__/flat-table.context.d.ts +0 -1
- package/lib/components/flat-table/__internal__/strict-flat-table.context.d.ts +0 -1
- package/lib/components/flat-table/__internal__/use-table-cell.d.ts +2 -3
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.style.d.ts +1 -1
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.d.ts +4 -4
- package/lib/components/flat-table/flat-table.style.d.ts +5 -5
- package/lib/components/flat-table/sort/sort.style.d.ts +0 -1
- package/lib/components/form/form.component.d.ts +5 -1
- package/lib/components/form/form.component.js +1 -1
- package/lib/components/form/form.style.d.ts +4 -2
- package/lib/components/form/form.style.js +1 -1
- package/lib/components/heading/heading.style.d.ts +0 -1
- package/lib/components/image/image.style.d.ts +1 -2
- package/lib/components/link-preview/link-preview.style.d.ts +1 -1
- package/lib/components/loader-spinner/loader-spinner.style.d.ts +0 -1
- package/lib/components/loader-star/loader-star.style.d.ts +0 -1
- package/lib/components/menu/__internal__/menu.context.d.ts +0 -1
- package/lib/components/menu/__internal__/strict-menu.context.d.ts +0 -1
- package/lib/components/menu/menu-item/menu-item.style.d.ts +0 -1
- package/lib/components/menu/menu-segment-title/menu-segment-title.style.d.ts +1 -1
- package/lib/components/menu/menu.types.d.ts +0 -1
- package/lib/components/modal/modal.style.d.ts +1 -1
- package/lib/components/navigation-bar/navigation-bar.style.d.ts +5 -5
- package/lib/components/note/note.style.d.ts +1 -1
- package/lib/components/numeral-date/numeral-date.style.d.ts +1 -2
- package/lib/components/pager/pager.style.d.ts +0 -1
- package/lib/components/password/password.style.d.ts +0 -1
- package/lib/components/pill/pill.style.d.ts +1 -1
- package/lib/components/pod/pod.style.d.ts +0 -1
- package/lib/components/popover-container/popover-container.style.d.ts +0 -1
- package/lib/components/portrait/__internal__/get-colors.d.ts +7 -1
- package/lib/components/profile/profile.style.d.ts +0 -1
- package/lib/components/radio-button/radio-button-group/radio-button-group.style.d.ts +2 -2
- package/lib/components/radio-button/radio-button.style.d.ts +1 -1
- package/lib/components/select/__internal__/utils/is-expected-option.d.ts +0 -1
- package/lib/components/sidebar/__internal__/sidebar-header/index.d.ts +1 -0
- package/lib/components/sidebar/__internal__/sidebar-header/index.js +1 -1
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +14 -1
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +1 -1
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.d.ts +6 -1
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
- package/lib/components/sidebar/sidebar.component.d.ts +6 -0
- package/lib/components/sidebar/sidebar.component.js +1 -1
- package/lib/components/simple-color-picker/simple-color/simple-color.style.d.ts +0 -1
- package/lib/components/split-button/split-button-toggle.style.d.ts +2 -2
- package/lib/components/step-flow/__internal__/step-flow.context.d.ts +0 -1
- package/lib/components/step-sequence/__internal__/step-sequence.context.d.ts +0 -1
- package/lib/components/tabs/__internal__/tab-title/tab-title.style.d.ts +6 -5
- package/lib/components/tabs/tab/tab.style.d.ts +1 -1
- package/lib/components/text-editor/__internal__/plugins/LinkPreviewer/link-previewer.component.d.ts +1 -1
- package/lib/components/text-editor/__internal__/plugins/Toolbar/toolbar.style.d.ts +1 -2
- package/lib/components/text-editor/text-editor.context.d.ts +1 -1
- package/lib/components/tile/__internal__/tile.context.d.ts +0 -1
- package/lib/components/tile/tile.style.d.ts +1 -1
- package/lib/components/tile-select/tile-select.style.d.ts +7 -8
- package/lib/components/time/time.style.d.ts +0 -1
- package/lib/components/toast/toast.style.d.ts +7 -8
- package/lib/components/vertical-menu/__internal__/vertical-menu.context.d.ts +0 -1
- package/lib/components/vertical-menu/responsive-vertical-menu/__internal__/depth.context.d.ts +1 -1
- package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.d.ts +5 -6
- package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.d.ts +0 -1
- package/lib/components/vertical-menu/vertical-menu-item/vertical-menu-item.component.d.ts +1 -1
- package/lib/components/vertical-menu/vertical-menu.style.d.ts +10 -11
- package/lib/hooks/__internal__/useChildButtons/useChildButtons.d.ts +1 -2
- package/lib/hooks/__internal__/useFocusPortalContent/useFocusPortalContent.d.ts +1 -1
- package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +0 -1
- package/lib/hooks/__internal__/useLocale/useLocale.d.ts +1 -1
- package/lib/hooks/__internal__/useModalAria/useModalAria.d.ts +0 -1
- package/lib/style/utils/add-focus-styling.js +1 -1
- package/package.json +13 -4
|
@@ -16,14 +16,14 @@ declare const StyledNavigationBar: import("styled-components").StyledComponent<"
|
|
|
16
16
|
theme: object;
|
|
17
17
|
} & PaddingProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
18
18
|
/** Color scheme of navigation component */
|
|
19
|
-
navigationType?: NavigationType
|
|
19
|
+
navigationType?: NavigationType;
|
|
20
20
|
/** Defines whether the navigation bar should be positioned fixed or sticky */
|
|
21
|
-
position?: Position
|
|
21
|
+
position?: Position;
|
|
22
22
|
/** Defines the offset of navigation bar */
|
|
23
|
-
offset?: string
|
|
23
|
+
offset?: string;
|
|
24
24
|
/** Defines whether the navigation bar should be positioned top or bottom */
|
|
25
|
-
orientation?: Orientation
|
|
25
|
+
orientation?: Orientation;
|
|
26
26
|
/** set to true only when rendering the GlobalHeader component */
|
|
27
|
-
isGlobal?: boolean
|
|
27
|
+
isGlobal?: boolean;
|
|
28
28
|
}, "theme">;
|
|
29
29
|
export default StyledNavigationBar;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const StyledNoteContent: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
-
hasPreview?: boolean
|
|
2
|
+
hasPreview?: boolean;
|
|
3
3
|
}, never>;
|
|
4
4
|
declare const StyledNoteMain: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
declare const StyledInlineControl: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t,{useRef as r}from"react";import{
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import t,{useRef as r}from"react";import{LABEL_VALIDATION_DEFAULT as n,ALIGN_DEFAULT as o,LABEL_WIDTH_DEFAULT as l,SIZE_DEFAULT as a,Textbox as i}from"../textbox/textbox.component.js";import c from"../../__internal__/utils/logger/index.js";import u from"../../__internal__/utils/helpers/tags/tags.js";function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){s(e,t,r[t])}))}return e}let p=!1;const f=t.forwardRef(((t,s)=>{var{onChange:f,onKeyDown:O,value:g,align:y=o,labelWidth:m=l,size:d=a,validationOnLabel:j=n}=t,v=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,["onChange","onKeyDown","value","align","labelWidth","size","validationOnLabel"]);const w=r(null),h=r(null);var P,x,S;return p||f||(p=!0,c.deprecate("Uncontrolled behaviour in `Number` is deprecated and support will soon be removed. Please make sure all your inputs are controlled.")),e(i,b((x=b({},v),S=null!=(S={value:g,onChange:e=>{(function(e){return new RegExp("^[-]?[0-9]*$").test(e)})(e.target.value)&&f?f(e):(e.target.value=g||"",e.target.setSelectionRange(w.current,h.current))},onKeyDown:e=>{w.current=e.target.selectionStart,h.current=e.target.selectionEnd,O&&O(e)},ref:s,align:y,labelWidth:m,size:d,validationOnLabel:j})?S:{},Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(S)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(S)).forEach((function(e){Object.defineProperty(x,e,Object.getOwnPropertyDescriptor(S,e))})),x),u(null!==(P=v["data-component"])&&void 0!==P?P:"number",v)))}));f.displayName="Number";export{f as Number,f as default};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FieldsetProps } from "../../__internal__/fieldset";
|
|
3
2
|
interface StyledDateFieldProps {
|
|
4
3
|
isYearInput?: boolean;
|
|
@@ -6,7 +5,7 @@ interface StyledDateFieldProps {
|
|
|
6
5
|
size?: "small" | "medium" | "large";
|
|
7
6
|
}
|
|
8
7
|
export declare const StyledNumeralDate: import("styled-components").StyledComponent<"div", any, {
|
|
9
|
-
name?: string
|
|
8
|
+
name?: string;
|
|
10
9
|
}, never>;
|
|
11
10
|
export declare const StyledDateField: import("styled-components").StyledComponent<"div", any, StyledDateFieldProps, never>;
|
|
12
11
|
interface StyledFieldsetProps extends FieldsetProps {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PasswordProps } from "./password.component";
|
|
3
2
|
declare const StyledPassword: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../textbox").TextboxProps & import("react").RefAttributes<HTMLInputElement>>, any, PasswordProps, never>;
|
|
4
3
|
declare const HiddenAriaLive: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
@@ -20,6 +20,6 @@ interface AllStyledPillProps extends StyledPillProps {
|
|
|
20
20
|
pillRole: "tag" | "status";
|
|
21
21
|
}
|
|
22
22
|
declare const StyledPill: import("styled-components").StyledComponent<"span", any, {
|
|
23
|
-
theme: object;
|
|
23
|
+
theme: object;
|
|
24
24
|
} & AllStyledPillProps, "theme">;
|
|
25
25
|
export default StyledPill;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{forwardRef as r,useState as o,useRef as i,useContext as a,useCallback as l,useEffect as c,useImperativeHandle as s,useMemo as p}from"react";import{CSSTransition as d}from"react-transition-group";import{offset as u,flip as m}from"@floating-ui/dom";import f from"../../hooks/useMediaQuery/useMediaQuery.js";import{
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{forwardRef as r,useState as o,useRef as i,useContext as a,useCallback as l,useEffect as c,useImperativeHandle as s,useMemo as p}from"react";import{CSSTransition as d}from"react-transition-group";import{offset as u,flip as m}from"@floating-ui/dom";import f from"../../hooks/useMediaQuery/useMediaQuery.js";import{PopoverContainerWrapperStyle as b,PopoverContainerOpenIcon as v,PopoverContainerCloseIcon as h,PopoverContainerContentStyle as y,PopoverContainerHeaderStyle as _,PopoverContainerTitleStyle as O}from"./popover-container.style.js";import g from"../icon/icon.component.js";import j from"../../__internal__/popover/popover.component.js";import x from"../../__internal__/utils/helpers/guid/index.js";import P from"../../style/utils/filter-styled-system-padding-props.js";import C from"../../hooks/__internal__/useClickAwayListener/useClickAwayListener.js";import w from"../../__internal__/utils/helpers/events/events.js";import k from"../../__internal__/focus-trap/focus-trap.component.js";import A from"../modal/__internal__/modal.context.js";import B from"../../hooks/__internal__/useFocusPortalContent/useFocusPortalContent.js";import I from"../../__internal__/utils/helpers/tags/tags.js";import{defaultFocusableSelectors as D}from"../../__internal__/focus-trap/focus-trap-utils.js";import L from"../flat-table/__internal__/flat-table.context.js";import{useGlobalHeader as E}from"../global-header/__internal__/global-header.context.js";function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){S(e,t,n[t])}))}return e}function M(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const W=({tabIndex:t,onClick:n,"data-element":r,ref:o,"aria-label":i,id:a,"aria-expanded":l,"aria-haspopup":c})=>e(v,{tabIndex:t,onClick:n,"data-element":r,ref:o,"aria-label":i,"aria-haspopup":c,"aria-expanded":l,id:a,children:e(g,{type:"settings"})}),R=({"data-element":t,tabIndex:n,onClick:r,ref:o,"aria-label":i,closeButtonDataProps:a})=>e(h,M(F({tabIndex:n,onClick:r,ref:o,"aria-label":i},I("close",F({"data-element":t},a))),{children:e(g,{type:"close"})})),H=r(((r,v)=>{var{children:h,title:g,position:S="right",open:H,onOpen:Q,onClose:T,renderOpenComponent:q=W,renderCloseComponent:z=R,shouldCoverButton:G=!1,ariaDescribedBy:K,openButtonAriaLabel:N,closeButtonAriaLabel:U="close",containerAriaLabel:$,closeButtonDataProps:J,disableAnimation:V=!1,hasFullWidth:X=!1}=r,Y=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,["children","title","position","open","onOpen","onClose","renderOpenComponent","renderCloseComponent","shouldCoverButton","ariaDescribedBy","openButtonAriaLabel","closeButtonAriaLabel","containerAriaLabel","closeButtonDataProps","disableAnimation","hasFullWidth"]);const Z=void 0!==H,[ee,te]=o(!1),ne=i(null),re=i(null),oe=i(null),ie=i(x()),ae=i(null),le=g?`PopoverContainer_${ie.current}`:void 0,ce=Z?H:ee,se=!f("screen and (prefers-reduced-motion: no-preference)"),pe=function(e){return p((()=>[u(e?({rects:e})=>({mainAxis:-e.reference.height}):6),m({fallbackStrategy:"initialPlacement"})]),[e])}(G),{isInFlatTable:de}=a(L),ue=l((e=>{var t;Z||te(!1),null==T||T(e),ce&&(null===(t=re.current)||void 0===t||t.focus())}),[Z,ce,T]),me=l((e=>{!w.composedPath(e).find((e=>e instanceof HTMLElement&&"input"===e.getAttribute("data-element")&&"true"===e.getAttribute("aria-expanded")))&&w.isEscKey(e)&&ue(e)}),[ue]);c((()=>(document.addEventListener("keydown",me),()=>{document.removeEventListener("keydown",me)})),[me]),c((()=>{var e;!G&&ce&&(null===(e=ae.current)||void 0===e||e.focus({preventScroll:!0}))}),[ce,G,ae]),B(G?void 0:ae,G?void 0:re,ue);const fe=l((e=>{const t=Array.from(document.querySelectorAll(D)||[]).filter((e=>e===re.current||-1!==Number(e.tabIndex))),n=t.indexOf(re.current);t[n+1].focus(),ue(e)}),[]),be=(e,t)=>{var n;"next"===e&&fe?fe(t):"prev"===e&&(null===(n=re.current)||void 0===n||n.focus())},ve={tabIndex:0,"aria-expanded":ce,"aria-haspopup":"dialog",isOpen:ce,"data-element":"popover-container-open-component",onClick:e=>{Z||te(!ce),ce?null==T||T(e):null==Q||Q(e)},ref:re,"aria-label":N||g,id:ce?void 0:le},he={"data-element":"popover-container-close-component",tabIndex:0,onClick:e=>{ue(e)},ref:ne,"aria-label":U,closeButtonDataProps:J},ye=C((e=>{Z||te(!1),ce&&(null==T||T(e))}),"mousedown"),[_e,Oe]=o(!1),{isWithinGlobalHeader:ge}=E();s(v,(()=>({focusButton(){var e;null===(e=re.current)||void 0===e||e.focus()}})),[]);const je=()=>t(y,M(F({"data-element":"popover-container-content",role:"dialog","aria-labelledby":le,"aria-label":$,"aria-describedby":K,p:"16px 24px",ref:ae,tabIndex:-1,disableAnimation:V||se,zIndex:ge?1e4:2e3},P(Y)),{children:[t(_,{children:[e(O,{id:le,"data-element":"popover-container-title",children:g}),z(he)]}),h]}));return t(b,M(F({onMouseDown:ye,hasFullWidth:X},I("popover-container",Y)),{children:[e("div",{ref:oe,children:q(ve)}),e(d,{nodeRef:ae,timeout:{exit:V?0:300},in:ce,unmountOnExit:!0,onEntered:G?()=>Oe(!0):void 0,onExiting:G?()=>Oe(!1):void 0,children:e(j,{reference:oe,placement:"right"===S?"bottom-start":"bottom-end",popoverStrategy:V||se?"fixed":"absolute",middleware:pe,childRefOverride:ae,disableBackgroundUI:de,children:G?e(A.Provider,{value:{isAnimationComplete:_e},children:e(k,{wrapperRef:ae,isOpen:ce,children:je()})}):t(n,{children:[e("div",{"data-element":"tab-guard-top",tabIndex:0,onFocus:e=>be("prev",e)}),je(),e("div",{"data-element":"tab-guard-bottom",tabIndex:0,onFocus:e=>be("next",e)})]})})})]}))}));export{H as PopoverContainer,H as default,R as renderClose,W as renderOpen};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
declare const getColoursForPortrait: (backgroundColour: string | undefined, darkBackground?: boolean, largeText?: boolean,
|
|
1
|
+
declare const getColoursForPortrait: (backgroundColour: string | undefined, darkBackground?: boolean, largeText?: boolean,
|
|
2
|
+
/**
|
|
3
|
+
* Whether to use strict contrast (i.e., WCAG AAA). If this is false, it uses WCAG AA contrast
|
|
4
|
+
* ratios (4.5:1 for normal text, 3:1 for large text). If true, it uses 7:1 for normal text and
|
|
5
|
+
* 4.5:1 for large text.
|
|
6
|
+
*/
|
|
7
|
+
strict?: boolean, foregroundColor?: string | undefined) => string;
|
|
2
8
|
export default getColoursForPortrait;
|
|
@@ -2,6 +2,6 @@ import { RadioButtonProps } from "./radio-button.component";
|
|
|
2
2
|
declare const RadioButtonStyle: import("styled-components").StyledComponent<"div", any, {
|
|
3
3
|
theme: object;
|
|
4
4
|
} & import("../checkbox/checkbox.style").StyledCheckboxProps & Pick<RadioButtonProps, "disabled" | "reverse" | "size" | "fieldHelpInline"> & {
|
|
5
|
-
inline?: boolean
|
|
5
|
+
inline?: boolean;
|
|
6
6
|
}, "theme">;
|
|
7
7
|
export default RadioButtonStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default}from"./sidebar-header.component.js";
|
|
1
|
+
export{SidebarSubHeader,default}from"./sidebar-header.component.js";
|
|
@@ -7,9 +7,22 @@ export interface SidebarHeaderProps extends PaddingProps {
|
|
|
7
7
|
id: string;
|
|
8
8
|
/** Close icon button to be rendered */
|
|
9
9
|
closeIcon?: React.ReactNode;
|
|
10
|
+
/** Header background variant for the sidebar. */
|
|
11
|
+
headerVariant?: "light" | "dark";
|
|
12
|
+
}
|
|
13
|
+
export interface SidebarSubHeaderProps extends PaddingProps {
|
|
14
|
+
/** This component supports children. */
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
/** A custom id. */
|
|
17
|
+
id: string;
|
|
10
18
|
}
|
|
11
19
|
declare const SidebarHeader: {
|
|
12
|
-
({ children, id, closeIcon, ...rest }: SidebarHeaderProps): React.JSX.Element;
|
|
20
|
+
({ children, id, closeIcon, headerVariant, ...rest }: SidebarHeaderProps): React.JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
declare const SidebarSubHeader: {
|
|
24
|
+
({ children, id, ...rest }: SidebarSubHeaderProps): React.JSX.Element;
|
|
13
25
|
displayName: string;
|
|
14
26
|
};
|
|
15
27
|
export default SidebarHeader;
|
|
28
|
+
export { SidebarSubHeader };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r}from"react/jsx-runtime";import"react";import t from"./sidebar-header.style.js";function
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import"react";import t,{StyledSidebarSubHeader as n}from"./sidebar-header.style.js";function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){i(e,r,t[r])}))}return e}function o(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}function c(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}const d=n=>{var{children:i,id:d,closeIcon:l,headerVariant:b}=n,p=c(n,["children","id","closeIcon","headerVariant"]);return e(t,o(a({hasClose:!!l,"data-component":"sidebar-header","data-role":"sidebar-header",p:"27px 32px 32px",headerVariant:b},p),{children:[r("div",{"data-element":"sidebar-heading",id:d,children:i}),l]}))},l=e=>{var{children:t,id:i}=e,d=c(e,["children","id"]);return r(n,o(a({"data-component":"sidebar-subheader",p:"var(--sizing100) var(--sizing400)",id:i},d),{children:t}))};d.displayName="SidebarHeader",l.displayName="SidebarSubHeader";export{l as SidebarSubHeader,d as default};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
declare const StyledSidebarHeader: import("styled-components").StyledComponent<"div", any, {
|
|
2
2
|
theme: object;
|
|
3
3
|
} & {
|
|
4
|
-
hasClose?: boolean
|
|
4
|
+
hasClose?: boolean;
|
|
5
|
+
headerVariant?: "light" | "dark";
|
|
6
|
+
}, "theme">;
|
|
7
|
+
declare const StyledSidebarSubHeader: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
+
theme: object;
|
|
5
9
|
}, "theme">;
|
|
6
10
|
export default StyledSidebarHeader;
|
|
11
|
+
export { StyledSidebarSubHeader };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o,{css as t}from"styled-components";import{padding as i}from"styled-system";import r from"../../../../style/themes/apply-base-theme.js";import e from"../../../icon-button/icon-button.style.js";import a from"../../../icon/icon.style.js";const s=o.div.attrs(r).withConfig({displayName:"sidebar-header.style__StyledSidebarHeader",componentId:"sc-e19ac77-0"})(["background-color:",";box-shadow:inset 0 -1px 0 0 var(--colorsUtilityMajor100);box-sizing:border-box;width:100%;color:var(--colorsActionMinorYin090);transition:all 0.2s ease;"," ",' div[data-element="sidebar-heading"]{width:100%;}'],(({headerVariant:o})=>"light"===o?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin100)"),i,(({hasClose:o,headerVariant:i})=>o&&t(["display:flex;justify-content:space-between;> ",":first-of-type{"," position:absolute;z-index:1;right:25px;}"],e,"dark"===i&&t(["","{color:var(--colorsUtilityYang080);}"],a)))),l=o.div.attrs(r).withConfig({displayName:"sidebar-header.style__StyledSidebarSubHeader",componentId:"sc-e19ac77-1"})(["box-sizing:border-box;width:100%;color:var(--colorsActionMinorYin090);background-color:var(--colorsUtilityMajor050);border-bottom:1px solid var(--colorsUtilityMajor075);"," transition:all 0.2s ease;"],i);export{l as StyledSidebarSubHeader,s as default};
|
|
@@ -33,6 +33,10 @@ export interface SidebarProps extends PaddingProps, TagProps, WidthProps, Pick<M
|
|
|
33
33
|
bespokeFocusTrap?: (ev: KeyboardEvent, firstElement?: HTMLElement, lastElement?: HTMLElement) => void;
|
|
34
34
|
/** Node that will be used as sidebar header. */
|
|
35
35
|
header?: React.ReactNode;
|
|
36
|
+
/** Node that will be used as sidebar subheader. */
|
|
37
|
+
subHeader?: React.ReactNode;
|
|
38
|
+
/** Header background variant for the sidebar. */
|
|
39
|
+
headerVariant?: "light" | "dark";
|
|
36
40
|
/** A custom close event handler */
|
|
37
41
|
onCancel?: (ev: React.KeyboardEvent<HTMLElement> | KeyboardEvent | React.MouseEvent<HTMLElement>) => void;
|
|
38
42
|
/** Sets the open state of the modal */
|
|
@@ -49,6 +53,8 @@ export interface SidebarProps extends PaddingProps, TagProps, WidthProps, Pick<M
|
|
|
49
53
|
focusableSelectors?: string;
|
|
50
54
|
/** Padding to be set on the Sidebar header */
|
|
51
55
|
headerPadding?: PaddingProps;
|
|
56
|
+
/** Padding to be set on the Sidebar subheader */
|
|
57
|
+
subHeaderPadding?: PaddingProps;
|
|
52
58
|
/**
|
|
53
59
|
* @private
|
|
54
60
|
* @ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r}from"react/jsx-runtime";import o,{useRef as t,useCallback as a}from"react";import n from"../modal/modal.component.js";import{StyledSidebar as i,StyledSidebarContent as l}from"./sidebar.style.js";import s from"../icon-button/icon-button.component.js";import c from"../icon/icon.component.js";import d from"../../__internal__/focus-trap/focus-trap.component.js";import b from"./__internal__/sidebar-header/sidebar-header.component.js";import p from"../../__internal__/utils/helpers/guid/index.js";import
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import o,{useRef as t,useCallback as a}from"react";import n from"../modal/modal.component.js";import{StyledSidebar as i,StyledSidebarContent as l}from"./sidebar.style.js";import s from"../icon-button/icon-button.component.js";import c from"../icon/icon.component.js";import d from"../../__internal__/focus-trap/focus-trap.component.js";import b,{SidebarSubHeader as u}from"./__internal__/sidebar-header/sidebar-header.component.js";import p from"../../__internal__/utils/helpers/guid/index.js";import f from"../../hooks/__internal__/useLocale/useLocale.js";import m from"../../style/utils/filter-styled-system-padding-props.js";import y from"../../hooks/__internal__/useModalAria/useModalAria.js";import O from"./__internal__/sidebar.context.js";function h(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function j(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{},t=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),t.forEach((function(r){h(e,r,o[r])}))}return e}function g(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r}(Object(r)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})),e}const _=o.forwardRef(((o,h)=>{var{"aria-describedby":_,"aria-label":P,"aria-labelledby":w,"data-element":v="sidebar","data-role":k,open:F,bespokeFocusTrap:S,disableAutoFocus:C=!1,disableEscKey:E=!1,enableBackgroundUI:x=!1,header:I,headerVariant:M="light",subHeader:A,position:D="right",size:H="medium",children:N,onCancel:z,role:B="dialog",focusFirstElement:K,focusableContainers:L,focusableSelectors:R,width:T,headerPadding:U={},subHeaderPadding:V={},topModalOverride:W,restoreFocusOnClose:q=!0,className:G}=o,J=function(e,r){if(null==e)return{};var o,t,a=function(e,r){if(null==e)return{};var o,t,a={},n=Object.keys(e);for(t=0;t<n.length;t++)o=n[t],r.indexOf(o)>=0||(a[o]=e[o]);return a}(e,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(t=0;t<n.length;t++)o=n[t],r.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(a[o]=e[o])}return a}(o,["aria-describedby","aria-label","aria-labelledby","data-element","data-role","open","bespokeFocusTrap","disableAutoFocus","disableEscKey","enableBackgroundUI","header","headerVariant","subHeader","position","size","children","onCancel","role","focusFirstElement","focusableContainers","focusableSelectors","width","headerPadding","subHeaderPadding","topModalOverride","restoreFocusOnClose","className"]);const Q=f(),{current:X}=t(p()),{current:Y}=t(p()),Z=t(null),$=a((e=>{Z.current=e,h&&("object"==typeof h&&(h.current=e),"function"==typeof h&&h(e))}),[h]),ee=y(Z),re=()=>z?r(s,{"aria-label":Q.sidebar.ariaLabels.close(),onClick:z,"data-element":"close",children:r(c,{type:"close"})}):null,oe=e(i,{"aria-modal":!x&&ee,"aria-describedby":_||Y,"aria-label":P,"aria-labelledby":w||P?w:X,"data-component":"sidebar","data-element":v,"data-role":k,ref:$,position:D,size:H,onCancel:z,role:B,width:T,className:G,children:[I&&r(b,g(j({headerVariant:M,closeIcon:re()},U),{id:X,children:I})),A&&r(u,g(j({},V),{id:Y,children:A})),!I&&re(),r(l,g(j({"data-element":"sidebar-content","data-role":"sidebar-content"},m(J)),{children:r(O.Provider,{value:{isInSidebar:!0},children:N})}))]});return r(n,{open:F,onCancel:z,disableEscKey:E,enableBackgroundUI:x,topModalOverride:W,restoreFocusOnClose:q,children:x?oe:r(d,{wrapperRef:Z,isOpen:F,additionalWrapperRefs:L,focusableSelectors:R,focusFirstElement:K,autoFocus:!C,bespokeTrap:S,children:oe})})}));_.displayName="Sidebar";export{_ as Sidebar,_ as default};
|
|
@@ -8,7 +8,7 @@ type StyledSplitButtonToggleProps = {
|
|
|
8
8
|
declare const StyledSplitButtonToggle: import("styled-components").StyledComponent<"button", any, {
|
|
9
9
|
theme: object;
|
|
10
10
|
} & import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & Omit<import("../button").ButtonProps, "buttonType"> & {
|
|
11
|
-
iconOnly?: boolean
|
|
12
|
-
buttonType: import("../button
|
|
11
|
+
iconOnly?: boolean;
|
|
12
|
+
buttonType: Required<import("../button").ButtonProps>["buttonType"];
|
|
13
13
|
} & StyledSplitButtonToggleProps, "theme">;
|
|
14
14
|
export default StyledSplitButtonToggle;
|
|
@@ -8,10 +8,10 @@ interface StyledTitleContentProps extends Pick<TabTitleProps, "align" | "borders
|
|
|
8
8
|
}
|
|
9
9
|
declare const StyledTitleContent: import("styled-components").StyledComponent<"span", any, StyledTitleContentProps, never>;
|
|
10
10
|
declare const StyledTabTitleButton: import("styled-components").StyledComponent<"button", any, TabTitleProps & {
|
|
11
|
-
validationRedesignOptIn?: boolean
|
|
11
|
+
validationRedesignOptIn?: boolean;
|
|
12
12
|
}, never>;
|
|
13
13
|
declare const StyledTabTitleLink: import("styled-components").StyledComponent<"a", any, TabTitleProps & {
|
|
14
|
-
validationRedesignOptIn?: boolean
|
|
14
|
+
validationRedesignOptIn?: boolean;
|
|
15
15
|
}, never>;
|
|
16
16
|
interface StyledLayoutWrapperProps extends Pick<TabTitleProps, "titlePosition" | "position"> {
|
|
17
17
|
hasCustomLayout?: boolean;
|
|
@@ -20,7 +20,8 @@ interface StyledLayoutWrapperProps extends Pick<TabTitleProps, "titlePosition" |
|
|
|
20
20
|
}
|
|
21
21
|
declare const StyledLayoutWrapper: import("styled-components").StyledComponent<"div", any, StyledLayoutWrapperProps, never>;
|
|
22
22
|
declare const StyledVerticalIndicator: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
|
-
|
|
24
|
-
validationRedesignOptIn?: boolean
|
|
25
|
-
}
|
|
23
|
+
type StyledSelectedIndicatorProps = Pick<TabTitleProps, "position" | "error" | "warning"> & {
|
|
24
|
+
validationRedesignOptIn?: boolean;
|
|
25
|
+
};
|
|
26
|
+
declare const StyledSelectedIndicator: import("styled-components").StyledComponent<"div", any, StyledSelectedIndicatorProps, never>;
|
|
26
27
|
export { StyledTabTitleButton, StyledTabTitleLink, StyledTitleContent, StyledLayoutWrapper, StyledSelectedIndicator, StyledVerticalIndicator, };
|
|
@@ -6,6 +6,6 @@ export type StyledTabProps = Pick<TabProps, "position" | "isTabSelected"> & {
|
|
|
6
6
|
declare const StyledTab: import("styled-components").StyledComponent<"div", any, {
|
|
7
7
|
theme: object;
|
|
8
8
|
} & Pick<TabProps, "position" | "isTabSelected"> & {
|
|
9
|
-
theme?: ThemeObject
|
|
9
|
+
theme?: ThemeObject;
|
|
10
10
|
}, "theme">;
|
|
11
11
|
export default StyledTab;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHeadlessEditor as t}from"@lexical/headless";import{$
|
|
1
|
+
import{createHeadlessEditor as t}from"@lexical/headless";import{$generateNodesFromDOM as e,$generateHtmlFromNodes as r}from"@lexical/html";import{$getRoot as o,$getSelection as n}from"lexical";import{markdownNodes as s,theme as i}from"./constants.js";import a from"../../../__internal__/utils/logger/index.js";const l=t=>{let e,o;return t.read((()=>{const n=t.getEditorState();o=n.toJSON(),e=r(t,null)})),{htmlString:e,json:o}},m=r=>{const l=t({namespace:"html-to-json",onError:t=>a.error(t.message),theme:i,nodes:s});let m;if(l.update((()=>{const t=(new DOMParser).parseFromString(r,"text/html"),s=e(l,t);o().select();const i=n();if(i)try{i.insertNodes(s)}catch(t){m=t}}),{discrete:!0}),m)throw m;const c=l.getEditorState().toJSON();return JSON.stringify(c)},c=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function p(t){return"https://"===t||c.test(t)}export{m as DeserializeHTML,l as SerializeLexical,p as validateUrl};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ButtonProps } from "../../../../button";
|
|
3
2
|
interface FormattingButtonProps extends ButtonProps {
|
|
4
3
|
tabIndex?: number;
|
|
5
4
|
isActive?: boolean;
|
|
6
5
|
}
|
|
7
6
|
declare const StyledToolbar: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
-
hasHeader?: boolean
|
|
7
|
+
hasHeader?: boolean;
|
|
9
8
|
}, never>;
|
|
10
9
|
declare const FormattingButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
10
|
declare const CommandButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{LexicalComposer as e}from"@lexical/react/LexicalComposer";import{ContentEditable as t}from"@lexical/react/LexicalContentEditable";import{LexicalErrorBoundary as a}from"@lexical/react/LexicalErrorBoundary";import{RichTextPlugin as o}from"@lexical/react/LexicalRichTextPlugin";import{useMemo as i}from"react";import{createFromHTML as n}from"../utils.js";import{
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{LexicalComposer as e}from"@lexical/react/LexicalComposer";import{ContentEditable as t}from"@lexical/react/LexicalContentEditable";import{LexicalErrorBoundary as a}from"@lexical/react/LexicalErrorBoundary";import{RichTextPlugin as o}from"@lexical/react/LexicalRichTextPlugin";import{useMemo as i}from"react";import{createFromHTML as n}from"../utils.js";import{theme as l,markdownNodes as c}from"./constants.js";import m from"../../../__internal__/utils/logger/index.js";const s=r=>{let e;if(!r)return n("<p><br></p>");try{JSON.parse(r)&&(e=!0)}catch(r){e=!1}if(!e){if(/<[a-z][\s\S]*>/i.test(r))return n(r);const e=`<p dir="ltr"><span data-lexical-text="true">${(r=>r.replace(/((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?)/g,"<a href='$1'>$1</a>"))(r)}</span></p>`;return n(e)}return r},p=({namespace:n="carbon-rte-readonly",value:p})=>{const d=i((()=>({namespace:n,nodes:c,onError:r=>m.error(r.message),theme:l,editorState:s(p),editable:!1})),[n,p]);return r(e,{initialConfig:d,children:r(o,{contentEditable:r(t,{"data-role":`${n}-content-editor`,"aria-autocomplete":void 0,"aria-readonly":void 0}),ErrorBoundary:a})})};export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{LexicalComposer as n}from"@lexical/react/LexicalComposer";import{ClickableLinkPlugin as o}from"@lexical/react/LexicalClickableLinkPlugin";import{EditorRefPlugin as i}from"@lexical/react/LexicalEditorRefPlugin";import{LexicalErrorBoundary as a}from"@lexical/react/LexicalErrorBoundary";import{HistoryPlugin as l}from"@lexical/react/LexicalHistoryPlugin";import{MarkdownShortcutPlugin as s}from"@lexical/react/LexicalMarkdownShortcutPlugin";import{RichTextPlugin as c}from"@lexical/react/LexicalRichTextPlugin";import{LinkPlugin as p}from"@lexical/react/LexicalLinkPlugin";import{ListPlugin as d}from"@lexical/react/LexicalListPlugin";import{$getRoot as u}from"lexical";import{forwardRef as m,useRef as f,useState as g,useImperativeHandle as _,useEffect as v,useMemo as h,useCallback as b}from"react";import{SerializeLexical as x,validateUrl as j}from"./__internal__/helpers.js";import y from"../../__internal__/label/label.component.js";import O from"../../hooks/__internal__/useLocale/useLocale.js";import w from"../../__internal__/utils/logger/index.js";import{
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{LexicalComposer as n}from"@lexical/react/LexicalComposer";import{ClickableLinkPlugin as o}from"@lexical/react/LexicalClickableLinkPlugin";import{EditorRefPlugin as i}from"@lexical/react/LexicalEditorRefPlugin";import{LexicalErrorBoundary as a}from"@lexical/react/LexicalErrorBoundary";import{HistoryPlugin as l}from"@lexical/react/LexicalHistoryPlugin";import{MarkdownShortcutPlugin as s}from"@lexical/react/LexicalMarkdownShortcutPlugin";import{RichTextPlugin as c}from"@lexical/react/LexicalRichTextPlugin";import{LinkPlugin as p}from"@lexical/react/LexicalLinkPlugin";import{ListPlugin as d}from"@lexical/react/LexicalListPlugin";import{$getRoot as u}from"lexical";import{forwardRef as m,useRef as f,useState as g,useImperativeHandle as _,useEffect as v,useMemo as h,useCallback as b}from"react";import{SerializeLexical as x,validateUrl as j}from"./__internal__/helpers.js";import y from"../../__internal__/label/label.component.js";import O from"../../hooks/__internal__/useLocale/useLocale.js";import w from"../../__internal__/utils/logger/index.js";import{COMPONENT_PREFIX as P,theme as L,markdownNodes as E}from"./__internal__/constants.js";import k from"./__internal__/plugins/AutoLinker/auto-link.component.js";import C from"./__internal__/plugins/CharacterCounter/character-counter.component.js";import T from"./__internal__/plugins/ContentEditor/content-editor.component.js";import S from"./__internal__/plugins/LinkMonitor/link-monitor.plugin.js";import"./__internal__/plugins/LinkPreviewer/link-previewer.style.js";import $ from"./__internal__/plugins/OnChange/on-change.plugin.js";import M from"./__internal__/plugins/Placeholder/placeholder.component.js";import B from"./__internal__/plugins/Toolbar/toolbar.component.js";import"./__internal__/plugins/useCursorAtEnd/index.js";import q from"./text-editor.context.js";import{StyledTextEditorWrapper as A,StyledWrapper as H,StyledEditorToolbarWrapper as I,StyledHeaderWrapper as D,StyledTextEditor as R,StyledFooterWrapper as F}from"./text-editor.style.js";import{createEmpty as U}from"./utils.js";import{HintText as z}from"../../__internal__/hint-text/hint-text.component.js";import G from"../../__internal__/validation-message/validation-message.component.js";import J from"../textbox/textbox.style.js";import"../../style/utils/filter-styled-system-padding-props.js";import K from"../../style/utils/filter-styled-system-margin-props.js";import N from"../../__internal__/utils/helpers/tags/tags.js";function Q(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function V(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){Q(e,r,t[r])}))}return e}let W=!1;const X=m(((m,Q)=>{var{characterLimit:X=3e3,error:Y,footer:Z,header:ee,inputHint:re,isOptional:te=!1,labelText:ne,namespace:oe=P,onBlur:ie,onCancel:ae,onChange:le,onFocus:se,onLinkAdded:ce,onSave:pe,placeholder:de,previews:ue=[],readOnly:me=!1,required:fe=!1,rows:ge,warning:_e,value:ve,customPlugins:he,validationMessagePositionTop:be=!0}=m,xe=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(m,["characterLimit","error","footer","header","inputHint","isOptional","labelText","namespace","onBlur","onCancel","onChange","onFocus","onLinkAdded","onSave","placeholder","previews","readOnly","required","rows","warning","value","customPlugins","validationMessagePositionTop"]);!W&&te&&(W=!0,w.deprecate("`isOptional` is deprecated in TextEditor and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead."));const je=f(void 0),ye=O(),[Oe,we]=g(void 0),Pe=f(null),[Le,Ee]=g(!1);_(Q,(()=>({focus(){var e;null===(e=Pe.current)||void 0===e||e.focus()}})),[]),v((()=>{const e=null==Pe?void 0:Pe.current,r=()=>{Ee(!0)},t=()=>{Ee(!1)};return null==e||e.addEventListener("focus",r),null==e||e.addEventListener("blur",t),()=>{null==e||e.removeEventListener("focus",r),null==e||e.removeEventListener("blur",t)}}),[Pe]);const[ke,Ce]=g(!1),Te=h((()=>({namespace:oe,nodes:E,onError:e=>w.error(e.message),theme:L,editorState:ve,editable:!me})),[oe,me,ve]),Se=b((e=>{const r=e.read((()=>u().getChildren().map((e=>e.getTextContent())).join("\n\n")));if(le){const e=je.current?x(je.current):{};null==le||le(r,e)}if(X>0){const e=X-r.length;we(e<0?ye.textEditor.characterLimit(Math.abs(e)):void 0)}}),[X,ye.textEditor,le]),$e=b((()=>{var e;(null===(e=je.current)||void 0===e?void 0:e.isEditable())&&ae&&(Ce((e=>!e)),ae())}),[ae]);v((()=>{const e=ve||U();if(je.current){const r=je.current.parseEditorState(e);je.current.setEditorState(r)}}),[ke,ve]);const Me=h((()=>({namespace:oe,onCancel:ae?$e:void 0,onSave:pe})),[$e,oe,ae,pe]),Be=_e||Oe;return e(A,(qe=V({"data-role":`${oe}-editor-wrapper`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||null==ie||ie(e)},onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||null==se||se(e)}},K(xe),N("text-editor",xe)),Ae=null!=(Ae={children:r(q.Provider,{value:{onLinkAdded:ce},children:[e(y,{isRequired:fe,optional:te,labelId:`${oe}-label`,children:ne}),re&&e(z,{id:`${oe}-input-hint`,marginBottom:"var(--spacing100)",children:re}),r(n,{initialConfig:Te,children:[e(i,{editorRef:je}),r(H,{"data-role":`${oe}-wrapper`,children:[be&&r(t,{children:[e(G,{error:Y,warning:Be,validationId:`${oe}-validation-message`,"data-role":`${oe}-validation-message`,validationMessagePositionTop:be}),(Y||Be)&&e(J,{warning:!(Y||!Be)})]}),r(I,{"data-role":`${oe}-editor-toolbar-wrapper`,id:`${oe}-editor-toolbar-wrapper`,focused:Le,error:!!Y,children:[ee&&e(D,{"data-role":`${oe}-header-wrapper`,children:ee}),!me&&e(B,V({hasHeader:Boolean(ee)},Me)),r(R,{"data-role":`${oe}-editor`,children:[e(c,{contentEditable:e(T,{ref:Pe,inputHint:re,namespace:oe,previews:ue,rows:ge,readOnly:me,required:fe,error:!!Y,warning:!!_e||!!Oe,validationMessagePositionTop:be}),placeholder:e(M,{namespace:oe,text:de}),ErrorBoundary:a}),e(d,{}),e(l,{}),e(s,{}),e($,{onChange:Se}),e(p,{validateUrl:j}),e(o,{newTab:!0}),e(k,{}),he]}),Z&&e(F,{"data-role":`${oe}-footer-wrapper`,children:Z}),e(S,{})]}),!be&&r(t,{children:[e(G,{error:Y,warning:Be,validationId:`${oe}-validation-message`,"data-role":`${oe}-validation-message`,validationMessagePositionTop:be}),(Y||Be)&&e(J,{warning:!(Y||!Be)})]}),X>0&&!me&&e(C,{maxChars:X,namespace:oe})]})]})]})})?Ae:{},Object.getOwnPropertyDescriptors?Object.defineProperties(qe,Object.getOwnPropertyDescriptors(Ae)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(Ae)).forEach((function(e){Object.defineProperty(qe,e,Object.getOwnPropertyDescriptor(Ae,e))})),qe));var qe,Ae}));export{X as TextEditor,X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{paddingRightPropertyNames as t,paddingXPropertyNames as r,paddingNames as s,paddingLeftPropertyNames as p,paddingBottomPropertyNames as e,paddingYPropertyNames as n,paddingTopPropertyNames as o}from"../../../style/utils/filter-styled-system-padding-props.js";const l=[...p,...r,...s],d=[...t,...r,...s],i=[...o,...n,...s],a=[...e,...n,...s];var f=(t,r)=>{const s=r=>{const s=r.find((r=>t[r]));return s?t[s]:s};return r?{pr:s(l),pl:s(d)}:{pt:s(i),pb:s(a)}};export{f as default};
|
|
@@ -3,6 +3,6 @@ import { TileProps } from "./tile.component";
|
|
|
3
3
|
declare const StyledTile: import("styled-components").StyledComponent<"div", any, {
|
|
4
4
|
theme: object;
|
|
5
5
|
} & Pick<TileProps, "height" | "width" | "variant" | "highlightVariant" | "roundness" | "borderWidth" | "borderVariant"> & {
|
|
6
|
-
isHorizontal?: boolean
|
|
6
|
+
isHorizontal?: boolean;
|
|
7
7
|
} & SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, "theme">;
|
|
8
8
|
export default StyledTile;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const StyledTitle: import("styled-components").StyledComponent<"h3", any, {}, never>;
|
|
3
2
|
declare const StyledSubtitle: import("styled-components").StyledComponent<"h4", any, {}, never>;
|
|
4
3
|
declare const StyledAdornment: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -6,23 +5,23 @@ declare const StyledAdornment: import("styled-components").StyledComponent<"div"
|
|
|
6
5
|
}, never>;
|
|
7
6
|
declare const StyledDescription: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
8
7
|
declare const StyledTileSelect: import("styled-components").StyledComponent<"div", any, {
|
|
9
|
-
checked?: boolean
|
|
10
|
-
disabled?: boolean
|
|
11
|
-
hasAccordion?: boolean
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
hasAccordion?: boolean;
|
|
12
11
|
}, never>;
|
|
13
12
|
declare const StyledFocusWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
14
|
-
checked?: boolean
|
|
13
|
+
checked?: boolean;
|
|
15
14
|
hasFocus: boolean;
|
|
16
15
|
}, never>;
|
|
17
16
|
declare const StyledTileSelectContainer: import("styled-components").StyledComponent<"div", any, {
|
|
18
17
|
theme: object;
|
|
19
18
|
} & {
|
|
20
|
-
checked?: boolean
|
|
21
|
-
disabled?: boolean
|
|
19
|
+
checked?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
22
21
|
}, "theme">;
|
|
23
22
|
declare const StyledFooterWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
24
23
|
declare const StyledAccordionFooterWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
25
|
-
accordionExpanded?: boolean
|
|
24
|
+
accordionExpanded?: boolean;
|
|
26
25
|
}, never>;
|
|
27
26
|
declare const StyledTileSelectInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../__internal__/input").InputProps & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>, any, {}, never>;
|
|
28
27
|
declare const StyledTitleContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const StyledLabel: import("styled-components").StyledComponent<import("react").MemoExoticComponent<({ align, as, children, disabled, error, help, helpIcon, htmlFor, info, inline, isDarkBackground, isRequired, labelId, optional, pr, pl, tooltipId, useValidationIcon, validationIconId, warning, width, className, "aria-label": ariaLabel, }: import("../../__internal__/label").LabelProps) => import("react").JSX.Element>, any, {}, never>;
|
|
3
2
|
export default StyledLabel;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { MessageVariant } from "../message/message.component";
|
|
3
2
|
declare const StyledPortal: import("styled-components").StyledComponent<({ children, className, id, onReposition, inertOptOut, }: import("../portal/portal").PortalProps) => import("react").JSX.Element, any, {
|
|
4
3
|
theme: object;
|
|
5
4
|
} & {
|
|
6
|
-
align?: "
|
|
7
|
-
alignY?: "
|
|
8
|
-
isNotice?: boolean
|
|
5
|
+
align?: "left" | "center" | "right";
|
|
6
|
+
alignY?: "top" | "center" | "bottom";
|
|
7
|
+
isNotice?: boolean;
|
|
9
8
|
}, "theme">;
|
|
10
9
|
type ToastVariants = Exclude<MessageVariant, "ai">;
|
|
11
10
|
type ToastStyleProps = {
|
|
@@ -18,11 +17,11 @@ type ToastStyleProps = {
|
|
|
18
17
|
};
|
|
19
18
|
declare const StyledToast: import("styled-components").StyledComponent<"div", any, ToastStyleProps, never>;
|
|
20
19
|
declare const StyledToastContent: import("styled-components").StyledComponent<"div", any, {
|
|
21
|
-
isNotice?: boolean
|
|
22
|
-
isDismiss?: boolean
|
|
20
|
+
isNotice?: boolean;
|
|
21
|
+
isDismiss?: boolean;
|
|
23
22
|
}, never>;
|
|
24
23
|
declare const ToastWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
25
|
-
align?: "
|
|
26
|
-
isNotice?: boolean
|
|
24
|
+
align?: "left" | "center" | "right";
|
|
25
|
+
isNotice?: boolean;
|
|
27
26
|
}, never>;
|
|
28
27
|
export { StyledPortal, StyledToast, StyledToastContent, ToastWrapper };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import o,{useRef as n,useState as i,useEffect as l,useCallback as c,useMemo as p}from"react";import s from"invariant";import{offset as a,flip as u,shift as f,
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import o,{useRef as n,useState as i,useEffect as l,useCallback as c,useMemo as p}from"react";import s from"invariant";import{offset as a,flip as u,shift as f,arrow as m,limitShift as b,useFloating as d,autoUpdate as y}from"@floating-ui/react-dom";import O from"./tooltip.style.js";import g from"./tooltip-pointer.style.js";import{TOOLTIP_POSITIONS as j}from"./tooltip.config.js";import h from"../../__internal__/utils/helpers/tags/tags.js";import{Portal as v}from"../portal/portal.js";function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){w(e,t,r[t])}))}return e}function x(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}function E(e,t){e&&("function"==typeof e&&e(t),"object"==typeof e&&"current"in e&&(e.current=t))}const S=o.forwardRef(((w,S)=>{var{children:C,isVisible:T,position:z="top",message:D,type:k,size:A="medium",isPartOfInput:I,inputSize:_="medium",id:L,bgColor:V,fontColor:M,flipOverrides:N,target:R}=w,q=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(w,["children","isVisible","position","message","type","size","isPartOfInput","inputSize","id","bgColor","fontColor","flipOverrides","target"]);const B=n(null),F=void 0!==T,[G,H]=i(!1);let J=G;F&&(J=T);const K=n(void 0),Q=n(void 0);l((()=>()=>{clearTimeout(K.current),clearTimeout(Q.current)}),[]);const U=c((()=>H(!0)),[]),W=c((()=>H(!1)),[]),X=c((()=>{K.current=window.setTimeout(U,100)}),[U]),Y=c((()=>{Q.current=window.setTimeout(W,100)}),[W]);l((()=>{const e={mouseenter:X,mouseleave:Y,focus:U,blur:W},t=R||B.current;return F||Object.entries(e).forEach((([e,r])=>{null==t||t.addEventListener(e,r)})),()=>{F||Object.entries(e).forEach((([e,r])=>{null==t||t.removeEventListener(e,r)}))}}),[C,U,X,W,Y,F,R]);const Z=n(N);Z.current=N;const $=n(null),ee=c((e=>{let t=9;return I&&(t={small:5,medium:["top","bottom"].includes(e)?6:8,large:["top","bottom"].includes(e)?10:12}[_]),t}),[_,I]),te=p((()=>[a((({placement:e})=>({mainAxis:ee(e)}))),u({fallbackPlacements:Z.current}),f({padding:5,limiter:b({offset:({rects:e})=>({mainAxis:e.reference.height})})}),m({element:$})]),[ee,$]),{x:re,y:oe,reference:ne,floating:ie,strategy:le,placement:ce,middlewareData:pe}=d({placement:z,middleware:te,whileElementsMounted:y}),se={position:le,top:null!=oe?oe:0,left:null!=re?re:0},ae=c((e=>{ne(R||e),B.current=e,E(C.ref,e)}),[ne,C,R]),ue=c((e=>{ie(e),E(S,e)}),[ie,S]),fe={top:"bottom",right:"left",bottom:"top",left:"right"}[ce.split("-")[0]],{x:me,y:be}=pe.arrow||{},de={left:me,top:be,[fe]:"-6px"},ye=!N||Array.isArray(N)&&N.every((e=>j.includes(e)));return s(ye,'The flipOverrides prop supplied to Tooltip must be an array containing some or all of ["top", "bottom", "left", "right"].'),e(t,{children:[o.cloneElement(C,{ref:ae}),J?r(v,{children:e(O,x(P({"data-element":"tooltip","data-role":"tooltip",role:"tooltip",tabIndex:-1,type:k,size:A,id:L},h("tooltip",q)),{ref:ue,bgColor:V,fontColor:M,style:se,"data-placement":ce,children:[r(g,{type:k,ref:$,"data-element":"tooltip-pointer","data-role":"tooltip-pointer",bgColor:V,style:de}),D]}))}):null]})}));S.displayName="Tooltip";export{S as Tooltip,S as default};
|
package/esm/components/vertical-menu/responsive-vertical-menu/__internal__/depth.context.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare const DepthContext: React.Context<number>;
|
|
|
8
8
|
export declare const useDepth: () => number;
|
|
9
9
|
export declare const DepthProvider: ({ children, value, }: {
|
|
10
10
|
children: ReactNode;
|
|
11
|
-
value?: number
|
|
11
|
+
value?: number;
|
|
12
12
|
}) => React.JSX.Element;
|
|
13
13
|
export declare const IncreaseDepth: ({ children }: {
|
|
14
14
|
children: ReactNode;
|