@kaizen/components 1.35.1 → 1.36.0
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/dist/cjs/Button/GenericButton/GenericButton.cjs +1 -1
- package/dist/cjs/Button/GenericButton/GenericButton.cjs.map +1 -1
- package/dist/cjs/KaizenProvider/KaizenProvider.cjs +6 -1
- package/dist/cjs/KaizenProvider/KaizenProvider.cjs.map +1 -1
- package/dist/cjs/Modal/ContextModal/ContextModal.cjs +9 -6
- package/dist/cjs/Modal/ContextModal/ContextModal.cjs.map +1 -1
- package/dist/cjs/MultiSelect/subcomponents/Popover/Popover.cjs +1 -1
- package/dist/cjs/MultiSelect/subcomponents/Popover/Popover.cjs.map +1 -1
- package/dist/cjs/Notification/ToastNotification/ToastNotification/ToastNotification.cjs +33 -0
- package/dist/cjs/Notification/ToastNotification/ToastNotification/ToastNotification.cjs.map +1 -0
- package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.cjs +36 -0
- package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.cjs.map +1 -0
- package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.module.scss.cjs +7 -0
- package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.module.scss.cjs.map +1 -0
- package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.cjs +42 -0
- package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.cjs.map +1 -0
- package/dist/cjs/Notification/ToastNotification/context/ToastNotificationContext.cjs +72 -0
- package/dist/cjs/Notification/ToastNotification/context/ToastNotificationContext.cjs.map +1 -0
- package/dist/cjs/Notification/ToastNotification/hooks/useToastNotification.cjs +9 -0
- package/dist/cjs/Notification/ToastNotification/hooks/useToastNotification.cjs.map +1 -0
- package/dist/cjs/RichTextEditor/RichTextEditor/RichTextEditor.cjs +6 -2
- package/dist/cjs/RichTextEditor/RichTextEditor/RichTextEditor.cjs.map +1 -1
- package/dist/cjs/__future__/Select/Select.cjs +24 -2
- package/dist/cjs/__future__/Select/Select.cjs.map +1 -1
- package/dist/cjs/dts/Modal/ContextModal/ContextModal.d.ts +2 -1
- package/dist/cjs/dts/MultiSelect/MultiSelect.d.ts +4 -2
- package/dist/cjs/dts/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.d.ts +3 -0
- package/dist/cjs/dts/MultiSelect/types.d.ts +6 -0
- package/dist/cjs/dts/Notification/ToastNotification/ToastNotification/ToastNotification.d.ts +16 -0
- package/dist/cjs/dts/Notification/ToastNotification/ToastNotification/index.d.ts +1 -0
- package/dist/cjs/dts/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.d.ts +4 -0
- package/dist/cjs/dts/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.d.ts +12 -0
- package/dist/cjs/dts/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/index.d.ts +1 -0
- package/dist/cjs/dts/Notification/ToastNotification/context/ToastNotificationContext.d.ts +21 -0
- package/dist/cjs/dts/Notification/ToastNotification/hooks/useToastNotification.d.ts +2 -0
- package/dist/cjs/dts/Notification/ToastNotification/index.d.ts +3 -2
- package/dist/cjs/dts/Notification/ToastNotification/types.d.ts +1 -9
- package/dist/cjs/dts/Notification/index.d.ts +1 -0
- package/dist/cjs/dts/RichTextEditor/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/dist/cjs/dts/__future__/Select/Select.d.ts +5 -1
- package/dist/cjs/index.cjs +6 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.css +4 -3
- package/dist/esm/Button/GenericButton/GenericButton.mjs +1 -1
- package/dist/esm/Button/GenericButton/GenericButton.mjs.map +1 -1
- package/dist/esm/KaizenProvider/KaizenProvider.mjs +6 -1
- package/dist/esm/KaizenProvider/KaizenProvider.mjs.map +1 -1
- package/dist/esm/Modal/ContextModal/ContextModal.mjs +9 -6
- package/dist/esm/Modal/ContextModal/ContextModal.mjs.map +1 -1
- package/dist/esm/MultiSelect/subcomponents/Popover/Popover.mjs +1 -1
- package/dist/esm/MultiSelect/subcomponents/Popover/Popover.mjs.map +1 -1
- package/dist/esm/Notification/ToastNotification/ToastNotification/ToastNotification.mjs +31 -0
- package/dist/esm/Notification/ToastNotification/ToastNotification/ToastNotification.mjs.map +1 -0
- package/dist/esm/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.mjs +34 -0
- package/dist/esm/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.mjs.map +1 -0
- package/dist/esm/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.module.scss.mjs +5 -0
- package/dist/esm/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.module.scss.mjs.map +1 -0
- package/dist/esm/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.mjs +40 -0
- package/dist/esm/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.mjs.map +1 -0
- package/dist/esm/Notification/ToastNotification/context/ToastNotificationContext.mjs +69 -0
- package/dist/esm/Notification/ToastNotification/context/ToastNotificationContext.mjs.map +1 -0
- package/dist/esm/Notification/ToastNotification/hooks/useToastNotification.mjs +7 -0
- package/dist/esm/Notification/ToastNotification/hooks/useToastNotification.mjs.map +1 -0
- package/dist/esm/RichTextEditor/RichTextEditor/RichTextEditor.mjs +6 -2
- package/dist/esm/RichTextEditor/RichTextEditor/RichTextEditor.mjs.map +1 -1
- package/dist/esm/__future__/Select/Select.mjs +25 -3
- package/dist/esm/__future__/Select/Select.mjs.map +1 -1
- package/dist/esm/dts/Modal/ContextModal/ContextModal.d.ts +2 -1
- package/dist/esm/dts/MultiSelect/MultiSelect.d.ts +4 -2
- package/dist/esm/dts/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.d.ts +3 -0
- package/dist/esm/dts/MultiSelect/types.d.ts +6 -0
- package/dist/esm/dts/Notification/ToastNotification/ToastNotification/ToastNotification.d.ts +16 -0
- package/dist/esm/dts/Notification/ToastNotification/ToastNotification/index.d.ts +1 -0
- package/dist/esm/dts/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.d.ts +4 -0
- package/dist/esm/dts/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.d.ts +12 -0
- package/dist/esm/dts/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/index.d.ts +1 -0
- package/dist/esm/dts/Notification/ToastNotification/context/ToastNotificationContext.d.ts +21 -0
- package/dist/esm/dts/Notification/ToastNotification/hooks/useToastNotification.d.ts +2 -0
- package/dist/esm/dts/Notification/ToastNotification/index.d.ts +3 -2
- package/dist/esm/dts/Notification/ToastNotification/types.d.ts +1 -9
- package/dist/esm/dts/Notification/index.d.ts +1 -0
- package/dist/esm/dts/RichTextEditor/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/dist/esm/dts/__future__/Select/Select.d.ts +5 -1
- package/dist/esm/index.css +5 -4
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +50 -3
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/src/Button/Button/_docs/Button.mdx +5 -0
- package/src/Button/Button/_docs/Button.stories.tsx +27 -1
- package/src/Button/GenericButton/GenericButton.spec.tsx +69 -0
- package/src/Button/GenericButton/GenericButton.tsx +1 -1
- package/src/DatePicker/DatePicker.spec.tsx +1 -1
- package/src/KaizenProvider/KaizenProvider.tsx +6 -1
- package/src/Modal/ContextModal/ContextModal.spec.tsx +3 -3
- package/src/Modal/ContextModal/ContextModal.tsx +9 -5
- package/src/MultiSelect/MultiSelect.spec.tsx +56 -1
- package/src/MultiSelect/MultiSelect.tsx +10 -3
- package/src/MultiSelect/_docs/MultiSelect.mdx +10 -0
- package/src/MultiSelect/_docs/MultiSelect.stickersheet.stories.tsx +81 -43
- package/src/MultiSelect/_docs/MultiSelect.stories.tsx +21 -0
- package/src/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.module.scss +9 -0
- package/src/MultiSelect/subcomponents/MultiSelectToggle/MultiSelectToggle.tsx +8 -1
- package/src/MultiSelect/subcomponents/MultiSelectToggle/_docs/MultiSelectToggle.stickersheet.stories.tsx +17 -0
- package/src/MultiSelect/subcomponents/Popover/Popover.tsx +1 -1
- package/src/MultiSelect/types.ts +7 -0
- package/src/Notification/ToastNotification/ToastNotification/ToastNotification.spec.tsx +33 -0
- package/src/Notification/ToastNotification/ToastNotification/ToastNotification.tsx +48 -0
- package/src/Notification/ToastNotification/ToastNotification/index.ts +1 -0
- package/src/Notification/ToastNotification/{subcomponents/ToastNotificationsList → ToastNotificationsList}/ToastNotificationsList.module.scss +1 -1
- package/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.tsx +40 -0
- package/src/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.tsx +49 -0
- package/src/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/index.ts +1 -0
- package/src/Notification/ToastNotification/_docs/ToastNotification.mdx +19 -14
- package/src/Notification/ToastNotification/_docs/ToastNotification.stickersheet.stories.tsx +33 -70
- package/src/Notification/ToastNotification/_docs/ToastNotification.stories.tsx +123 -93
- package/src/Notification/ToastNotification/context/ToastNotificationContext.tsx +96 -0
- package/src/Notification/ToastNotification/hooks/useToastNotification.ts +9 -0
- package/src/Notification/ToastNotification/index.ts +3 -2
- package/src/Notification/ToastNotification/types.ts +1 -18
- package/src/Notification/index.ts +1 -0
- package/src/RichTextEditor/RichTextEditor/RichTextEditor.tsx +6 -1
- package/src/RichTextEditor/utils/commands/addMark.spec.ts +0 -1
- package/src/Tooltip/Tooltip.spec.tsx +6 -1
- package/src/__future__/Select/Select.spec.tsx +109 -14
- package/src/__future__/Select/Select.tsx +32 -3
- package/src/__future__/Select/_docs/Select.mdx +8 -0
- package/src/__future__/Select/_docs/Select.stories.tsx +29 -0
- package/dist/cjs/dts/Notification/ToastNotification/ToastNotification.d.ts +0 -14
- package/dist/cjs/dts/Notification/ToastNotification/subcomponents/ToastNotificationManager/ToastNotificationManager.d.ts +0 -7
- package/dist/cjs/dts/Notification/ToastNotification/subcomponents/ToastNotificationManager/index.d.ts +0 -1
- package/dist/cjs/dts/Notification/ToastNotification/subcomponents/ToastNotificationsList/ToastNotificationsList.d.ts +0 -11
- package/dist/cjs/dts/Notification/ToastNotification/subcomponents/ToastNotificationsListContainer/ToastNotificationsListContainer.d.ts +0 -7
- package/dist/cjs/dts/Notification/ToastNotification/subcomponents/ToastNotificationsListContainer/index.d.ts +0 -1
- package/dist/esm/dts/Notification/ToastNotification/ToastNotification.d.ts +0 -14
- package/dist/esm/dts/Notification/ToastNotification/subcomponents/ToastNotificationManager/ToastNotificationManager.d.ts +0 -7
- package/dist/esm/dts/Notification/ToastNotification/subcomponents/ToastNotificationManager/index.d.ts +0 -1
- package/dist/esm/dts/Notification/ToastNotification/subcomponents/ToastNotificationsList/ToastNotificationsList.d.ts +0 -11
- package/dist/esm/dts/Notification/ToastNotification/subcomponents/ToastNotificationsListContainer/ToastNotificationsListContainer.d.ts +0 -7
- package/dist/esm/dts/Notification/ToastNotification/subcomponents/ToastNotificationsListContainer/index.d.ts +0 -1
- package/src/Notification/ToastNotification/ToastNotification.spec.tsx +0 -31
- package/src/Notification/ToastNotification/ToastNotification.tsx +0 -43
- package/src/Notification/ToastNotification/subcomponents/ToastNotificationManager/ToastNotificationManager.spec.tsx +0 -144
- package/src/Notification/ToastNotification/subcomponents/ToastNotificationManager/ToastNotificationManager.tsx +0 -135
- package/src/Notification/ToastNotification/subcomponents/ToastNotificationManager/index.ts +0 -1
- package/src/Notification/ToastNotification/subcomponents/ToastNotificationsList/ToastNotificationsList.tsx +0 -40
- package/src/Notification/ToastNotification/subcomponents/ToastNotificationsListContainer/ToastNotificationsListContainer.spec.tsx +0 -73
- package/src/Notification/ToastNotification/subcomponents/ToastNotificationsListContainer/ToastNotificationsListContainer.tsx +0 -31
- package/src/Notification/ToastNotification/subcomponents/ToastNotificationsListContainer/index.ts +0 -1
- /package/dist/cjs/dts/Notification/ToastNotification/{subcomponents/ToastNotificationsList → ToastNotificationsList}/index.d.ts +0 -0
- /package/dist/esm/dts/Notification/ToastNotification/{subcomponents/ToastNotificationsList → ToastNotificationsList}/index.d.ts +0 -0
- /package/src/Notification/ToastNotification/{subcomponents/ToastNotificationsList → ToastNotificationsList}/index.ts +0 -0
|
@@ -44,7 +44,7 @@ const GenericButton = /*#__PURE__*/function () {
|
|
|
44
44
|
};
|
|
45
45
|
return React.createElement("span", {
|
|
46
46
|
className: classnames(GenericButton_module.container, props.fullWidth && GenericButton_module.fullWidth),
|
|
47
|
-
"aria-live": "polite"
|
|
47
|
+
"aria-live": "workingLabel" in props ? "polite" : undefined
|
|
48
48
|
}, determineButtonRenderer());
|
|
49
49
|
});
|
|
50
50
|
GenericButton.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericButton.cjs","sources":["../../../../src/Button/GenericButton/GenericButton.tsx"],"sourcesContent":["import React, {\n ComponentType,\n forwardRef,\n Ref,\n useImperativeHandle,\n useRef,\n MouseEvent,\n FocusEvent,\n} from \"react\"\nimport classnames from \"classnames\"\nimport { Badge, BadgeAnimated } from \"~components/Badge\"\nimport { LoadingSpinner } from \"~components/Loading\"\nimport styles from \"./GenericButton.module.scss\"\n\nexport type CustomButtonProps = {\n id?: string\n className: string\n href?: string\n disabled?: boolean\n onClick?: (e: MouseEvent<any>) => void\n onFocus?: (e: FocusEvent<HTMLElement>) => void\n onBlur?: (e: FocusEvent<HTMLElement>) => void\n children?: React.ReactNode\n \"data-testid\"?: string\n}\n\nexport type ButtonFormAttributes = Pick<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n | \"form\"\n | \"formAction\"\n | \"formMethod\"\n | \"formEncType\"\n | \"formTarget\"\n | \"formNoValidate\"\n>\n\nexport type GenericProps = {\n id?: string\n reversed?: boolean\n onClick?: (e: MouseEvent) => void\n onMouseDown?: (e: MouseEvent) => void\n href?: string\n newTabAndIUnderstandTheAccessibilityImplications?: boolean\n disableTabFocusAndIUnderstandTheAccessibilityImplications?: boolean\n onFocus?: (e: FocusEvent<HTMLElement>) => void\n onBlur?: (e: FocusEvent<HTMLElement>) => void\n component?: ComponentType<CustomButtonProps>\n classNameOverride?: string\n}\n\nexport type WorkingProps = {\n working: true\n workingLabel: string\n workingLabelHidden?: boolean\n}\n\nexport type WorkingUndefinedProps = {\n working?: false\n}\n\nexport type ButtonBadgeProps = {\n text: string\n animateChange?: boolean\n variant?: \"default\" | \"dark\" | \"active\"\n reversed?: boolean\n}\n\nexport type RenderProps = GenericButtonProps & {\n additionalContent?: React.ReactNode\n iconButton?: boolean\n directionalLink?: boolean\n paginationLink?: boolean\n isActive?: boolean\n}\n\nexport type ButtonRef = { focus: () => void }\n\nexport type GenericButtonProps = GenericProps &\n ButtonFormAttributes &\n (WorkingProps | WorkingUndefinedProps) & {\n label: string\n primary?: boolean\n destructive?: boolean\n secondary?: boolean\n /** @default \"regular\" */\n size?: \"small\" | \"regular\"\n badge?: ButtonBadgeProps\n type?: \"submit\" | \"reset\" | \"button\"\n fullWidth?: boolean\n iconPosition?: \"start\" | \"end\"\n icon?: JSX.Element\n disabled?: boolean\n }\n\n// We're treating custom props as anything that is kebab cased.\n// This is so we can support properties like aria-* or data-*\nconst getCustomProps = (props: Record<string, any>): Record<string, string> => {\n const keys = Object.keys(props).filter(k => k.indexOf(\"-\") !== -1)\n return keys.reduce<Record<string, any>>((acc, val) => {\n acc[val] = props[val]\n return acc\n }, {})\n}\n\nexport const GenericButton = forwardRef(\n (props: RenderProps, ref: Ref<ButtonRef | undefined>) => {\n const buttonRef = useRef<HTMLButtonElement | HTMLAnchorElement>()\n useImperativeHandle(ref, () => ({\n focus: (): void => {\n buttonRef.current?.focus()\n },\n }))\n\n const determineButtonRenderer = (): JSX.Element => {\n if (props.component) {\n return renderCustomComponent(props.component, props)\n }\n\n if (props.href && !props.disabled && !props.working) {\n return renderLink(props, buttonRef as Ref<HTMLAnchorElement>)\n }\n\n return renderButton(props, buttonRef as Ref<HTMLButtonElement>)\n }\n\n return (\n <span\n className={classnames(\n styles.container,\n props.fullWidth && styles.fullWidth\n )}\n aria-live=\"polite\"\n >\n {determineButtonRenderer()}\n </span>\n )\n }\n)\n\nGenericButton.defaultProps = {\n iconPosition: \"start\",\n iconButton: false,\n primary: false,\n secondary: false,\n newTabAndIUnderstandTheAccessibilityImplications: false,\n disableTabFocusAndIUnderstandTheAccessibilityImplications: false,\n type: \"button\",\n}\n\nGenericButton.displayName = \"GenericButton\"\n\nconst renderCustomComponent = (\n CustomComponent: ComponentType<CustomButtonProps>,\n props: RenderProps\n): JSX.Element => {\n const { id, disabled, href, onClick, onFocus, onBlur, ...rest } = props\n const customProps = getCustomProps(rest)\n return (\n <CustomComponent\n id={id}\n className={buttonClass(props)}\n disabled={disabled}\n href={href}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n aria-label={generateAriaLabel(props)}\n {...customProps}\n >\n {renderContent(props)}\n </CustomComponent>\n )\n}\n\nconst renderButton = (\n props: RenderProps,\n ref: Ref<HTMLButtonElement>\n): JSX.Element => {\n const {\n id,\n disabled,\n onClick,\n onMouseDown,\n type,\n disableTabFocusAndIUnderstandTheAccessibilityImplications,\n onFocus,\n onBlur,\n form,\n formAction,\n formMethod,\n formEncType,\n formTarget,\n formNoValidate,\n ...rest\n } = props\n const customProps = getCustomProps(rest)\n\n return (\n <button\n // eslint-disable-next-line react/button-has-type\n type={type}\n id={id}\n disabled={disabled}\n className={buttonClass(props)}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n onMouseDown={(e): void => onMouseDown && onMouseDown(e)}\n aria-label={generateAriaLabel(props)}\n aria-disabled={disabled || props.working ? true : undefined}\n form={form}\n formAction={formAction}\n formMethod={formMethod}\n formEncType={formEncType}\n formTarget={formTarget}\n formNoValidate={formNoValidate}\n tabIndex={\n disableTabFocusAndIUnderstandTheAccessibilityImplications\n ? -1\n : undefined\n }\n ref={ref}\n {...customProps}\n >\n {renderContent(props)}\n </button>\n )\n}\n\nconst renderLink = (\n props: RenderProps,\n ref: Ref<HTMLAnchorElement>\n): JSX.Element => {\n const {\n id,\n href,\n onClick,\n newTabAndIUnderstandTheAccessibilityImplications,\n onFocus,\n onBlur,\n ...rest\n } = props\n const customProps = getCustomProps(rest)\n\n const target = newTabAndIUnderstandTheAccessibilityImplications\n ? \"_blank\"\n : \"_self\"\n\n return (\n <a\n id={id}\n href={href}\n target={target}\n rel={target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n className={buttonClass(props)}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n ref={ref}\n aria-label={generateAriaLabel(props)}\n {...customProps}\n >\n {renderContent(props)}\n </a>\n )\n}\n\nconst buttonClass = (props: RenderProps): string => {\n const isDefault = !props.primary && !props.destructive && !props.secondary\n return classnames(\n styles.button,\n isDefault && styles.default,\n props.primary && styles.primary,\n props.destructive && styles.destructive,\n props.secondary && styles.secondary,\n props.size && styles[props.size],\n props.reversed && styles.reversed,\n props.iconButton && styles.iconButton,\n props.working && styles.working,\n (props.directionalLink || props.paginationLink) && styles.circleButton,\n props.directionalLink && styles.directionalLink,\n props.paginationLink && styles.paginationLink,\n props.isActive && styles.isPaginationLinkActive,\n props.classNameOverride\n )\n}\n\nconst renderLoadingSpinner = (): JSX.Element => (\n <div className={styles.loadingSpinner}>\n <LoadingSpinner accessibilityLabel=\"\" size=\"sm\" />\n </div>\n)\n\nconst renderWorkingContent = (\n props: Extract<RenderProps, { working: true }>\n): JSX.Element => {\n if (props.workingLabelHidden) {\n return (\n <>\n {/* This is to ensure the button stays at the correct width */}\n <span className={styles.hidden} aria-hidden=\"true\">\n {renderDefaultContent(props)}\n </span>\n <span className={styles.centeredLoadingSpinner}>\n {renderLoadingSpinner()}\n </span>\n </>\n )\n }\n\n return (\n <>\n {props.iconPosition !== \"end\" && renderLoadingSpinner()}\n <span className={styles.label}>{props.workingLabel}</span>\n {props.additionalContent && (\n <span className={styles.additionalContentWrapper}>\n {props.additionalContent}\n </span>\n )}\n {props.iconPosition === \"end\" && renderLoadingSpinner()}\n </>\n )\n}\n\nconst renderDefaultContent = (props: RenderProps): JSX.Element => (\n <>\n {props.icon && props.iconPosition !== \"end\" && renderIcon(props.icon)}\n {(!props.icon || !props.iconButton) && (\n <span className={styles.label}>{props.label}</span>\n )}\n {props.additionalContent && (\n <span className={styles.additionalContentWrapper}>\n {props.additionalContent}\n </span>\n )}\n {renderBadge(props)}\n {props.icon && props.iconPosition === \"end\" && renderIcon(props.icon)}\n </>\n)\n\nconst renderBadge = (props: RenderProps): JSX.Element | null => {\n if (!props.badge) return null\n\n const { text, animateChange, reversed, variant } = props.badge\n\n if (animateChange) {\n return (\n <BadgeAnimated variant={variant} reversed={reversed}>\n {text}\n </BadgeAnimated>\n )\n }\n return (\n <Badge variant={variant} reversed={reversed}>\n {text}\n </Badge>\n )\n}\n\nconst renderContent = (props: RenderProps): JSX.Element => (\n <span className={styles.content}>\n {props.working ? renderWorkingContent(props) : renderDefaultContent(props)}\n </span>\n)\n\nconst renderIcon = (icon: JSX.Element): JSX.Element => (\n <span className={styles.iconWrapper}>{icon}</span>\n)\n\n// We only want an aria-label in the case that the button has just an icon and no text\n// This can happen when the button is working and workingLabelHidden is true,\n// or when this is an IconButton\nconst generateAriaLabel = (props: RenderProps): string | undefined => {\n if (props.working && props.workingLabelHidden) {\n return props.workingLabel\n }\n\n if (props.iconButton) {\n return props.label\n }\n\n return undefined\n}\n"],"names":["getCustomProps","props","keys","Object","filter","k","indexOf","reduce","acc","val","GenericButton","forwardRef","ref","buttonRef","useRef","useImperativeHandle","focus","_a","current","determineButtonRenderer","component","renderCustomComponent","href","disabled","working","renderLink","renderButton","React","createElement","className","classnames","styles","container","fullWidth","defaultProps","iconPosition","iconButton","primary","secondary","newTabAndIUnderstandTheAccessibilityImplications","disableTabFocusAndIUnderstandTheAccessibilityImplications","type","displayName","CustomComponent","id","onClick","onFocus","onBlur","rest","__rest","customProps","__assign","buttonClass","generateAriaLabel","renderContent","onMouseDown","form","formAction","formMethod","formEncType","formTarget","formNoValidate","e","undefined","tabIndex","target","rel","isDefault","destructive","button","size","reversed","directionalLink","paginationLink","circleButton","isActive","isPaginationLinkActive","classNameOverride","renderLoadingSpinner","loadingSpinner","LoadingSpinner","accessibilityLabel","renderWorkingContent","workingLabelHidden","Fragment","hidden","renderDefaultContent","centeredLoadingSpinner","label","workingLabel","additionalContent","additionalContentWrapper","icon","renderIcon","renderBadge","badge","text","animateChange","variant","BadgeAnimated","Badge","content","iconWrapper"],"mappings":";;;;;;;;;;;;;AA8FA;AACA;AACA,IAAMA,cAAc,GAAG,SAAAA,CAACC,KAA0B,EAAA;EAChD,IAAMC,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACD,KAAK,CAAC,CAACG,MAAM,CAAC,UAAAC,CAAC,EAAI;IAAA,OAAAA,CAAC,CAACC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;EAAA,CAAA,CAAC;EAClE,OAAOJ,IAAI,CAACK,MAAM,CAAsB,UAACC,GAAG,EAAEC,GAAG,EAAA;IAC/CD,GAAG,CAACC,GAAG,CAAC,GAAGR,KAAK,CAACQ,GAAG,CAAC;IACrB,OAAOD,GAAG;EACX,CAAA,EAAE,CAAE,CAAA,CAAC;AACR,CAAC;AAAA,MAEYE,aAAa;EAAA,MAAbA,aAAa,GAAGC,KAAU,CAAAA,UAAA,CACrC,UAACV,KAAkB,EAAEW,GAA+B,EAAA;IAClD,IAAMC,SAAS,GAAGC,KAAAA,CAAAA,MAAM,EAAyC;IACjEC,yBAAmB,CAACH,GAAG,EAAE,YAAA;MAAM,OAAC;QAC9BI,KAAK,EAAE,SA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AK,CAACuB,OAAO,GAAG0D,oBAAoB,CAACjF,KAAK,CAAC,GAAGqF,oBAAoB,CAACrF,KAAK,CAAC,CACrE;CACR;AAED,IAAM4F,UAAU,GAAG,SAAAA,CAACD,IAAiB,EAAkB;EAAA,OACrDjE,KAAM,CAAAC,aAAA,CAAA,MAAA,EAAA;IAAAC,SAAS,EAAEE,oBAAM,CAACuE;EAAc,CAAA,EAAAV,IAAI,CAAQ;AACnD,CAAA;AAED;AACA;AACA;AACA,IAAMvC,iBAAiB,GAAG,SAAAA,CAACpD,KAAkB,EAAA;EAC3C,IAAIA,KAAK,CAACuB,OAAO,IAAIvB,KAAK,CAACkF,kBAAkB,EAAE;IAC7C,OAAOlF,KAAK,CAACwF,YAAY;EAC1B;EAED,IAAIxF,KAAK,CAACmC,UAAU,EAAE;IACpB,OAAOnC,KAAK,CAACuF,KAAK;EACnB;EAED,OAAOzB,SAAS;AAClB,CAAC;"}
|
|
1
|
+
{"version":3,"file":"GenericButton.cjs","sources":["../../../../src/Button/GenericButton/GenericButton.tsx"],"sourcesContent":["import React, {\n ComponentType,\n forwardRef,\n Ref,\n useImperativeHandle,\n useRef,\n MouseEvent,\n FocusEvent,\n} from \"react\"\nimport classnames from \"classnames\"\nimport { Badge, BadgeAnimated } from \"~components/Badge\"\nimport { LoadingSpinner } from \"~components/Loading\"\nimport styles from \"./GenericButton.module.scss\"\n\nexport type CustomButtonProps = {\n id?: string\n className: string\n href?: string\n disabled?: boolean\n onClick?: (e: MouseEvent<any>) => void\n onFocus?: (e: FocusEvent<HTMLElement>) => void\n onBlur?: (e: FocusEvent<HTMLElement>) => void\n children?: React.ReactNode\n \"data-testid\"?: string\n}\n\nexport type ButtonFormAttributes = Pick<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n | \"form\"\n | \"formAction\"\n | \"formMethod\"\n | \"formEncType\"\n | \"formTarget\"\n | \"formNoValidate\"\n>\n\nexport type GenericProps = {\n id?: string\n reversed?: boolean\n onClick?: (e: MouseEvent) => void\n onMouseDown?: (e: MouseEvent) => void\n href?: string\n newTabAndIUnderstandTheAccessibilityImplications?: boolean\n disableTabFocusAndIUnderstandTheAccessibilityImplications?: boolean\n onFocus?: (e: FocusEvent<HTMLElement>) => void\n onBlur?: (e: FocusEvent<HTMLElement>) => void\n component?: ComponentType<CustomButtonProps>\n classNameOverride?: string\n}\n\nexport type WorkingProps = {\n working: true\n workingLabel: string\n workingLabelHidden?: boolean\n}\n\nexport type WorkingUndefinedProps = {\n working?: false\n}\n\nexport type ButtonBadgeProps = {\n text: string\n animateChange?: boolean\n variant?: \"default\" | \"dark\" | \"active\"\n reversed?: boolean\n}\n\nexport type RenderProps = GenericButtonProps & {\n additionalContent?: React.ReactNode\n iconButton?: boolean\n directionalLink?: boolean\n paginationLink?: boolean\n isActive?: boolean\n}\n\nexport type ButtonRef = { focus: () => void }\n\nexport type GenericButtonProps = GenericProps &\n ButtonFormAttributes &\n (WorkingProps | WorkingUndefinedProps) & {\n label: string\n primary?: boolean\n destructive?: boolean\n secondary?: boolean\n /** @default \"regular\" */\n size?: \"small\" | \"regular\"\n badge?: ButtonBadgeProps\n type?: \"submit\" | \"reset\" | \"button\"\n fullWidth?: boolean\n iconPosition?: \"start\" | \"end\"\n icon?: JSX.Element\n disabled?: boolean\n }\n\n// We're treating custom props as anything that is kebab cased.\n// This is so we can support properties like aria-* or data-*\nconst getCustomProps = (props: Record<string, any>): Record<string, string> => {\n const keys = Object.keys(props).filter(k => k.indexOf(\"-\") !== -1)\n return keys.reduce<Record<string, any>>((acc, val) => {\n acc[val] = props[val]\n return acc\n }, {})\n}\n\nexport const GenericButton = forwardRef(\n (props: RenderProps, ref: Ref<ButtonRef | undefined>) => {\n const buttonRef = useRef<HTMLButtonElement | HTMLAnchorElement>()\n useImperativeHandle(ref, () => ({\n focus: (): void => {\n buttonRef.current?.focus()\n },\n }))\n\n const determineButtonRenderer = (): JSX.Element => {\n if (props.component) {\n return renderCustomComponent(props.component, props)\n }\n\n if (props.href && !props.disabled && !props.working) {\n return renderLink(props, buttonRef as Ref<HTMLAnchorElement>)\n }\n\n return renderButton(props, buttonRef as Ref<HTMLButtonElement>)\n }\n\n return (\n <span\n className={classnames(\n styles.container,\n props.fullWidth && styles.fullWidth\n )}\n aria-live={\"workingLabel\" in props ? \"polite\" : undefined}\n >\n {determineButtonRenderer()}\n </span>\n )\n }\n)\n\nGenericButton.defaultProps = {\n iconPosition: \"start\",\n iconButton: false,\n primary: false,\n secondary: false,\n newTabAndIUnderstandTheAccessibilityImplications: false,\n disableTabFocusAndIUnderstandTheAccessibilityImplications: false,\n type: \"button\",\n}\n\nGenericButton.displayName = \"GenericButton\"\n\nconst renderCustomComponent = (\n CustomComponent: ComponentType<CustomButtonProps>,\n props: RenderProps\n): JSX.Element => {\n const { id, disabled, href, onClick, onFocus, onBlur, ...rest } = props\n const customProps = getCustomProps(rest)\n return (\n <CustomComponent\n id={id}\n className={buttonClass(props)}\n disabled={disabled}\n href={href}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n aria-label={generateAriaLabel(props)}\n {...customProps}\n >\n {renderContent(props)}\n </CustomComponent>\n )\n}\n\nconst renderButton = (\n props: RenderProps,\n ref: Ref<HTMLButtonElement>\n): JSX.Element => {\n const {\n id,\n disabled,\n onClick,\n onMouseDown,\n type,\n disableTabFocusAndIUnderstandTheAccessibilityImplications,\n onFocus,\n onBlur,\n form,\n formAction,\n formMethod,\n formEncType,\n formTarget,\n formNoValidate,\n ...rest\n } = props\n const customProps = getCustomProps(rest)\n\n return (\n <button\n // eslint-disable-next-line react/button-has-type\n type={type}\n id={id}\n disabled={disabled}\n className={buttonClass(props)}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n onMouseDown={(e): void => onMouseDown && onMouseDown(e)}\n aria-label={generateAriaLabel(props)}\n aria-disabled={disabled || props.working ? true : undefined}\n form={form}\n formAction={formAction}\n formMethod={formMethod}\n formEncType={formEncType}\n formTarget={formTarget}\n formNoValidate={formNoValidate}\n tabIndex={\n disableTabFocusAndIUnderstandTheAccessibilityImplications\n ? -1\n : undefined\n }\n ref={ref}\n {...customProps}\n >\n {renderContent(props)}\n </button>\n )\n}\n\nconst renderLink = (\n props: RenderProps,\n ref: Ref<HTMLAnchorElement>\n): JSX.Element => {\n const {\n id,\n href,\n onClick,\n newTabAndIUnderstandTheAccessibilityImplications,\n onFocus,\n onBlur,\n ...rest\n } = props\n const customProps = getCustomProps(rest)\n\n const target = newTabAndIUnderstandTheAccessibilityImplications\n ? \"_blank\"\n : \"_self\"\n\n return (\n <a\n id={id}\n href={href}\n target={target}\n rel={target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n className={buttonClass(props)}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n ref={ref}\n aria-label={generateAriaLabel(props)}\n {...customProps}\n >\n {renderContent(props)}\n </a>\n )\n}\n\nconst buttonClass = (props: RenderProps): string => {\n const isDefault = !props.primary && !props.destructive && !props.secondary\n return classnames(\n styles.button,\n isDefault && styles.default,\n props.primary && styles.primary,\n props.destructive && styles.destructive,\n props.secondary && styles.secondary,\n props.size && styles[props.size],\n props.reversed && styles.reversed,\n props.iconButton && styles.iconButton,\n props.working && styles.working,\n (props.directionalLink || props.paginationLink) && styles.circleButton,\n props.directionalLink && styles.directionalLink,\n props.paginationLink && styles.paginationLink,\n props.isActive && styles.isPaginationLinkActive,\n props.classNameOverride\n )\n}\n\nconst renderLoadingSpinner = (): JSX.Element => (\n <div className={styles.loadingSpinner}>\n <LoadingSpinner accessibilityLabel=\"\" size=\"sm\" />\n </div>\n)\n\nconst renderWorkingContent = (\n props: Extract<RenderProps, { working: true }>\n): JSX.Element => {\n if (props.workingLabelHidden) {\n return (\n <>\n {/* This is to ensure the button stays at the correct width */}\n <span className={styles.hidden} aria-hidden=\"true\">\n {renderDefaultContent(props)}\n </span>\n <span className={styles.centeredLoadingSpinner}>\n {renderLoadingSpinner()}\n </span>\n </>\n )\n }\n\n return (\n <>\n {props.iconPosition !== \"end\" && renderLoadingSpinner()}\n <span className={styles.label}>{props.workingLabel}</span>\n {props.additionalContent && (\n <span className={styles.additionalContentWrapper}>\n {props.additionalContent}\n </span>\n )}\n {props.iconPosition === \"end\" && renderLoadingSpinner()}\n </>\n )\n}\n\nconst renderDefaultContent = (props: RenderProps): JSX.Element => (\n <>\n {props.icon && props.iconPosition !== \"end\" && renderIcon(props.icon)}\n {(!props.icon || !props.iconButton) && (\n <span className={styles.label}>{props.label}</span>\n )}\n {props.additionalContent && (\n <span className={styles.additionalContentWrapper}>\n {props.additionalContent}\n </span>\n )}\n {renderBadge(props)}\n {props.icon && props.iconPosition === \"end\" && renderIcon(props.icon)}\n </>\n)\n\nconst renderBadge = (props: RenderProps): JSX.Element | null => {\n if (!props.badge) return null\n\n const { text, animateChange, reversed, variant } = props.badge\n\n if (animateChange) {\n return (\n <BadgeAnimated variant={variant} reversed={reversed}>\n {text}\n </BadgeAnimated>\n )\n }\n return (\n <Badge variant={variant} reversed={reversed}>\n {text}\n </Badge>\n )\n}\n\nconst renderContent = (props: RenderProps): JSX.Element => (\n <span className={styles.content}>\n {props.working ? renderWorkingContent(props) : renderDefaultContent(props)}\n </span>\n)\n\nconst renderIcon = (icon: JSX.Element): JSX.Element => (\n <span className={styles.iconWrapper}>{icon}</span>\n)\n\n// We only want an aria-label in the case that the button has just an icon and no text\n// This can happen when the button is working and workingLabelHidden is true,\n// or when this is an IconButton\nconst generateAriaLabel = (props: RenderProps): string | undefined => {\n if (props.working && props.workingLabelHidden) {\n return props.workingLabel\n }\n\n if (props.iconButton) {\n return props.label\n }\n\n return undefined\n}\n"],"names":["getCustomProps","props","keys","Object","filter","k","indexOf","reduce","acc","val","GenericButton","forwardRef","ref","buttonRef","useRef","useImperativeHandle","focus","_a","current","determineButtonRenderer","component","renderCustomComponent","href","disabled","working","renderLink","renderButton","React","createElement","className","classnames","styles","container","fullWidth","undefined","defaultProps","iconPosition","iconButton","primary","secondary","newTabAndIUnderstandTheAccessibilityImplications","disableTabFocusAndIUnderstandTheAccessibilityImplications","type","displayName","CustomComponent","id","onClick","onFocus","onBlur","rest","__rest","customProps","__assign","buttonClass","generateAriaLabel","renderContent","onMouseDown","form","formAction","formMethod","formEncType","formTarget","formNoValidate","e","tabIndex","target","rel","isDefault","destructive","button","size","reversed","directionalLink","paginationLink","circleButton","isActive","isPaginationLinkActive","classNameOverride","renderLoadingSpinner","loadingSpinner","LoadingSpinner","accessibilityLabel","renderWorkingContent","workingLabelHidden","Fragment","hidden","renderDefaultContent","centeredLoadingSpinner","label","workingLabel","additionalContent","additionalContentWrapper","icon","renderIcon","renderBadge","badge","text","animateChange","variant","BadgeAnimated","Badge","content","iconWrapper"],"mappings":";;;;;;;;;;;;;AA8FA;AACA;AACA,IAAMA,cAAc,GAAG,SAAAA,CAACC,KAA0B,EAAA;EAChD,IAAMC,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACD,KAAK,CAAC,CAACG,MAAM,CAAC,UAAAC,CAAC,EAAI;IAAA,OAAAA,CAAC,CAACC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;EAAA,CAAA,CAAC;EAClE,OAAOJ,IAAI,CAACK,MAAM,CAAsB,UAACC,GAAG,EAAEC,GAAG,EAAA;IAC/CD,GAAG,CAACC,GAAG,CAAC,GAAGR,KAAK,CAACQ,GAAG,CAAC;IACrB,OAAOD,GAAG;EACX,CAAA,EAAE,CAAE,CAAA,CAAC;AACR,CAAC;AAAA,MAEYE,aAAa;EAAA,MAAbA,aAAa,GAAGC,KAAU,CAAAA,UAAA,CACrC,UAACV,KAAkB,EAAEW,GAA+B,EAAA;IAClD,IAAMC,SAAS,GAAGC,KAAAA,CAAAA,MAAM,EAAyC;IACjEC,yBAAmB,CAACH,GAAG,EAAE,YAAA;MAAM,OAAC;QAC9BI,KAAK,EAAE,SAAAA,CAAA,EAAA;;UACL,CAAAC,EAAA,GAAAJ,SAAS,CAACK,OAAO,MAAE,IAAA,IAAAD,EAAA,KAAA,KAAA,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GqF,oBAAoB,CAACrF,KAAK,CAAC,CACrE;CACR;AAED,IAAM4F,UAAU,GAAG,SAAAA,CAACD,IAAiB,EAAkB;EAAA,OACrDjE,KAAM,CAAAC,aAAA,CAAA,MAAA,EAAA;IAAAC,SAAS,EAAEE,oBAAM,CAACuE;EAAc,CAAA,EAAAV,IAAI,CAAQ;AACnD,CAAA;AAED;AACA;AACA;AACA,IAAMtC,iBAAiB,GAAG,SAAAA,CAACrD,KAAkB,EAAA;EAC3C,IAAIA,KAAK,CAACuB,OAAO,IAAIvB,KAAK,CAACkF,kBAAkB,EAAE;IAC7C,OAAOlF,KAAK,CAACwF,YAAY;EAC1B;EAED,IAAIxF,KAAK,CAACoC,UAAU,EAAE;IACpB,OAAOpC,KAAK,CAACuF,KAAK;EACnB;EAED,OAAOtD,SAAS;AAClB,CAAC;"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
+
require('../Notification/InlineNotification/InlineNotification.cjs');
|
|
5
|
+
require('../Notification/GlobalNotification/GlobalNotification.cjs');
|
|
6
|
+
require('../Notification/ToastNotification/ToastNotification/ToastNotification.cjs');
|
|
7
|
+
var ToastNotificationsList = require('../Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.cjs');
|
|
8
|
+
var ToastNotificationContext = require('../Notification/ToastNotification/context/ToastNotificationContext.cjs');
|
|
4
9
|
var FontDefinitions = require('./subcomponents/FontDefinitions/FontDefinitions.cjs');
|
|
5
10
|
var OptionalIntlProvider = require('./subcomponents/OptionalIntlProvider/OptionalIntlProvider.cjs');
|
|
6
11
|
const KaizenProvider = /*#__PURE__*/function () {
|
|
@@ -10,7 +15,7 @@ const KaizenProvider = /*#__PURE__*/function () {
|
|
|
10
15
|
locale = _b === void 0 ? "en" : _b;
|
|
11
16
|
return React.createElement(OptionalIntlProvider.OptionalIntlProvider, {
|
|
12
17
|
locale: locale
|
|
13
|
-
}, React.createElement(React.Fragment, null, children, React.createElement(FontDefinitions.FontDefinitions, null)));
|
|
18
|
+
}, React.createElement(React.Fragment, null, React.createElement(ToastNotificationContext.ToastNotificationProvider, null, React.createElement(ToastNotificationsList.ToastNotificationsList, null), children), React.createElement(FontDefinitions.FontDefinitions, null)));
|
|
14
19
|
};
|
|
15
20
|
KaizenProvider.displayName = "KaizenProvider";
|
|
16
21
|
return KaizenProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KaizenProvider.cjs","sources":["../../../src/KaizenProvider/KaizenProvider.tsx"],"sourcesContent":["import React from \"react\"\nimport { FontDefinitions } from \"./subcomponents/FontDefinitions\"\nimport { OptionalIntlProvider } from \"./subcomponents/OptionalIntlProvider\"\n\nexport type KaizenProviderProps = {\n children: React.ReactNode\n locale?: string\n}\n\nexport const KaizenProvider = ({\n children,\n locale = \"en\",\n}: KaizenProviderProps): JSX.Element => (\n <OptionalIntlProvider locale={locale}>\n <>\n {children}\n <FontDefinitions />\n </>\n </OptionalIntlProvider>\n)\n\nKaizenProvider.displayName = \"KaizenProvider\"\n"],"names":["KaizenProvider","_a","children","_b","locale","React","createElement","OptionalIntlProvider","Fragment","FontDefinitions","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"KaizenProvider.cjs","sources":["../../../src/KaizenProvider/KaizenProvider.tsx"],"sourcesContent":["import React from \"react\"\nimport { ToastNotificationsList } from \"~components/Notification\"\nimport { ToastNotificationProvider } from \"~components/Notification/ToastNotification/context/ToastNotificationContext\"\nimport { FontDefinitions } from \"./subcomponents/FontDefinitions\"\nimport { OptionalIntlProvider } from \"./subcomponents/OptionalIntlProvider\"\n\nexport type KaizenProviderProps = {\n children: React.ReactNode\n locale?: string\n}\n\nexport const KaizenProvider = ({\n children,\n locale = \"en\",\n}: KaizenProviderProps): JSX.Element => (\n <OptionalIntlProvider locale={locale}>\n <>\n <ToastNotificationProvider>\n <ToastNotificationsList />\n {children}\n </ToastNotificationProvider>\n <FontDefinitions />\n </>\n </OptionalIntlProvider>\n)\n\nKaizenProvider.displayName = \"KaizenProvider\"\n"],"names":["KaizenProvider","_a","children","_b","locale","React","createElement","OptionalIntlProvider","Fragment","ToastNotificationProvider","ToastNotificationsList","FontDefinitions","displayName"],"mappings":";;;;;;;;;;MAWaA,cAAc;EAAA,MAAdA,cAAc,GAAG,SAAAA,CAACC,EAGT,EAAA;IAFpB,IAAAC,QAAQ,cAAA;MACRC,EAAA,GAAAF,EAAA,CAAAG,MAAa;MAAbA,MAAM,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,IAAI,GAAAA,EAAA;IACyB,OACtCE,KAAC,CAAAC,aAAA,CAAAC,oBAAoB,CAAAA,oBAAA,EAAC;MAAAH,MAAM,EAAEA;IAAM,CAAA,EAClCC,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAG,QAAA,EAAA,IAAA,EACEH,KAAA,CAAAC,aAAA,CAACG,wBAAAA,CAAAA,yBAAyB,EAAA,IAAA,EACxBJ,KAAA,CAAAC,aAAA,CAACI,sBAAsB,CAAAA,sBAAA,EAAG,IAAA,CAAA,EACzBR,QAAQ,CACiB,EAC5BG,KAAA,CAAAC,aAAA,CAACK,eAAAA,CAAAA,eAAe,EAAA,IAAA,CAAG,CAClB,CACkB;EATe,CAUvC;EAEDX,cAAc,CAACY,WAAW,GAAG,gBAAgB;EAAA,OAfhCZ,cAAc;AAAA;"}
|
|
@@ -26,6 +26,7 @@ const ContextModal = /*#__PURE__*/function () {
|
|
|
26
26
|
layout = _c === void 0 ? "portrait" : _c,
|
|
27
27
|
title = _a.title,
|
|
28
28
|
onConfirm = _a.onConfirm,
|
|
29
|
+
propsOnDismiss = _a.onDismiss,
|
|
29
30
|
onAfterLeave = _a.onAfterLeave,
|
|
30
31
|
_d = _a.confirmLabel,
|
|
31
32
|
confirmLabel = _d === void 0 ? "Confirm" : _d,
|
|
@@ -34,8 +35,10 @@ const ContextModal = /*#__PURE__*/function () {
|
|
|
34
35
|
children = _a.children,
|
|
35
36
|
contentHeader = _a.contentHeader,
|
|
36
37
|
image = _a.image,
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
secondaryLabel = _a.secondaryLabel,
|
|
39
|
+
onSecondaryAction = _a.onSecondaryAction,
|
|
40
|
+
props = tslib.__rest(_a, ["isOpen", "unpadded", "layout", "title", "onConfirm", "onDismiss", "onAfterLeave", "confirmLabel", "confirmWorking", "renderBackground", "children", "contentHeader", "image", "secondaryLabel", "onSecondaryAction"]);
|
|
41
|
+
var onDismiss = confirmWorking ? undefined : propsOnDismiss;
|
|
39
42
|
var footerActions = [];
|
|
40
43
|
var workingProps = confirmWorking ? {
|
|
41
44
|
working: true,
|
|
@@ -49,10 +52,10 @@ const ContextModal = /*#__PURE__*/function () {
|
|
|
49
52
|
};
|
|
50
53
|
footerActions.push(tslib.__assign(tslib.__assign({}, confirmAction), workingProps));
|
|
51
54
|
}
|
|
52
|
-
if (
|
|
55
|
+
if (secondaryLabel) {
|
|
53
56
|
footerActions.push({
|
|
54
|
-
label:
|
|
55
|
-
onClick:
|
|
57
|
+
label: secondaryLabel,
|
|
58
|
+
onClick: onSecondaryAction,
|
|
56
59
|
disabled: !!confirmWorking
|
|
57
60
|
});
|
|
58
61
|
}
|
|
@@ -80,7 +83,7 @@ const ContextModal = /*#__PURE__*/function () {
|
|
|
80
83
|
}, image), React.createElement("div", {
|
|
81
84
|
className: ContextModal_module.content
|
|
82
85
|
}, children, onConfirm != null && React.createElement("div", {
|
|
83
|
-
className:
|
|
86
|
+
className: secondaryLabel ? ContextModal_module.footerWithSecondaryAction : ContextModal_module.footer
|
|
84
87
|
})))), React.createElement(ModalFooter.ModalFooter, {
|
|
85
88
|
variant: image ? "context" : undefined,
|
|
86
89
|
actions: footerActions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextModal.cjs","sources":["../../../../src/Modal/ContextModal/ContextModal.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport classnames from \"classnames\"\nimport { ButtonProps } from \"~components/Button\"\nimport { Heading } from \"~components/Heading\"\nimport {\n GenericModal,\n ModalFooter,\n ModalHeader,\n ModalAccessibleLabel,\n ModalBody,\n} from \"~components/Modal/GenericModal\"\nimport styles from \"./ContextModal.module.scss\"\n\nexport type ContextModalSecondaryActionProps =\n | {\n secondaryLabel: string\n onSecondaryAction: () => void\n }\n | {\n secondaryLabel?: undefined\n }\n\nexport type ContextModalProps = Readonly<\n {\n isOpen: boolean\n unpadded?: boolean\n /**\n * Defines the orientation layout of the image and content\n */\n layout?: \"portrait\" | \"landscape\"\n title: string\n onConfirm?: () => void\n onDismiss: () => void\n onAfterLeave?: () => void\n confirmLabel?: string\n confirmWorking?: { label: string; labelHidden?: boolean }\n /**\n * @deprecated use data-testid instead\n */\n automationId?: string\n renderBackground?: () => React.ReactNode\n image?: React.ReactNode\n children: React.ReactNode\n contentHeader?: React.ReactNode\n } & ContextModalSecondaryActionProps &\n HTMLAttributes<HTMLDivElement>\n>\n\n/**\n * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082093114/Modal Guidance} |\n * {@link https://cultureamp.design/?path=/docs/components-modals--contextmodal--docs Storybook}\n */\nexport const ContextModal = ({\n isOpen,\n unpadded = false,\n layout = \"portrait\",\n title,\n onConfirm,\n onAfterLeave,\n confirmLabel = \"Confirm\",\n confirmWorking,\n renderBackground,\n children,\n contentHeader,\n image,\n ...props\n}: ContextModalProps): JSX.Element => {\n const onDismiss = confirmWorking ? undefined :
|
|
1
|
+
{"version":3,"file":"ContextModal.cjs","sources":["../../../../src/Modal/ContextModal/ContextModal.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport classnames from \"classnames\"\nimport { ButtonProps } from \"~components/Button\"\nimport { Heading } from \"~components/Heading\"\nimport {\n GenericModal,\n ModalFooter,\n ModalHeader,\n ModalAccessibleLabel,\n ModalBody,\n} from \"~components/Modal/GenericModal\"\nimport styles from \"./ContextModal.module.scss\"\n\nexport type ContextModalSecondaryActionProps =\n | {\n secondaryLabel: string\n onSecondaryAction: () => void\n }\n | {\n secondaryLabel?: undefined\n onSecondaryAction?: never\n }\n\nexport type ContextModalProps = Readonly<\n {\n isOpen: boolean\n unpadded?: boolean\n /**\n * Defines the orientation layout of the image and content\n */\n layout?: \"portrait\" | \"landscape\"\n title: string\n onConfirm?: () => void\n onDismiss: () => void\n onAfterLeave?: () => void\n confirmLabel?: string\n confirmWorking?: { label: string; labelHidden?: boolean }\n /**\n * @deprecated use data-testid instead\n */\n automationId?: string\n renderBackground?: () => React.ReactNode\n image?: React.ReactNode\n children: React.ReactNode\n contentHeader?: React.ReactNode\n } & ContextModalSecondaryActionProps &\n HTMLAttributes<HTMLDivElement>\n>\n\n/**\n * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082093114/Modal Guidance} |\n * {@link https://cultureamp.design/?path=/docs/components-modals--contextmodal--docs Storybook}\n */\nexport const ContextModal = ({\n isOpen,\n unpadded = false,\n layout = \"portrait\",\n title,\n onConfirm,\n onDismiss: propsOnDismiss,\n onAfterLeave,\n confirmLabel = \"Confirm\",\n confirmWorking,\n renderBackground,\n children,\n contentHeader,\n image,\n secondaryLabel,\n onSecondaryAction,\n ...props\n}: ContextModalProps): JSX.Element => {\n const onDismiss = confirmWorking ? undefined : propsOnDismiss\n\n const footerActions: ButtonProps[] = []\n\n const workingProps = confirmWorking\n ? {\n working: true,\n workingLabel: confirmWorking.label,\n workingLabelHidden: confirmWorking.labelHidden,\n }\n : {}\n\n if (onConfirm) {\n const confirmAction = { label: confirmLabel, onClick: onConfirm }\n footerActions.push({ ...confirmAction, ...workingProps })\n }\n\n if (secondaryLabel) {\n footerActions.push({\n label: secondaryLabel,\n onClick: onSecondaryAction,\n disabled: !!confirmWorking,\n })\n }\n\n return (\n <GenericModal\n isOpen={isOpen}\n onEscapeKeyup={onDismiss}\n onOutsideModalClick={onDismiss}\n onAfterLeave={onAfterLeave}\n >\n <div className={styles.modal} data-modal {...props}>\n {renderBackground && renderBackground()}\n <ModalHeader onDismiss={onDismiss}>\n <div\n className={classnames(styles.header, !unpadded && styles.padded)}\n >\n <ModalAccessibleLabel>\n <Heading variant=\"heading-2\" tag=\"h2\">\n {title}\n </Heading>\n </ModalAccessibleLabel>\n </div>\n </ModalHeader>\n {contentHeader && (\n <div className={styles.contentHeader}>{contentHeader}</div>\n )}\n <ModalBody>\n <div\n className={classnames(\n styles.contentLayout,\n styles[`${layout}Contentlayout`]\n )}\n >\n {image && <div className={styles.image}>{image}</div>}\n <div className={styles.content}>\n {children}\n {onConfirm != null && (\n <div\n className={\n secondaryLabel\n ? styles.footerWithSecondaryAction\n : styles.footer\n }\n ></div>\n )}\n </div>\n </div>\n </ModalBody>\n <ModalFooter\n variant={image ? \"context\" : undefined}\n actions={footerActions}\n appearance=\"primary\"\n unpadded={unpadded}\n />\n </div>\n </GenericModal>\n )\n}\n\nContextModal.displayName = \"ContextModal\"\n"],"names":["ContextModal","_a","isOpen","_b","unpadded","_c","layout","title","onConfirm","propsOnDismiss","onDismiss","onAfterLeave","_d","confirmLabel","confirmWorking","renderBackground","children","contentHeader","image","secondaryLabel","onSecondaryAction","props","__rest","undefined","footerActions","workingProps","working","workingLabel","label","workingLabelHidden","labelHidden","confirmAction","onClick","push","__assign","disabled","React","createElement","GenericModal","onEscapeKeyup","onOutsideModalClick","className","styles","modal","ModalHeader","classnames","header","padded","ModalAccessibleLabel","Heading","variant","tag","ModalBody","contentLayout","concat","content","footerWithSecondaryAction","footer","ModalFooter","actions","appearance","displayName"],"mappings":";;;;;;;;;;;;;;;AAiDA;;;AAGG;AAHH,MAIaA,YAAY;EAAA,MAAZA,YAAY,GAAG,SAAAA,CAACC,EAiBT,EAAA;IAhBlB,IAAAC,MAAM,GAAAD,EAAA,CAAAC,MAAA;MACNC,EAAA,GAAAF,EAAA,CAAAG,QAAgB;MAAhBA,QAAQ,GAAGD,EAAA,KAAA,KAAA,CAAA,GAAA,KAAK,GAAAA,EAAA;MAChBE,EAAmB,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AAKI,SAAS,EAAEC,mBAAM,CAACzB;KAAa,EAAGA,aAAa,CACrD,EACDmB,KAAA,CAAAC,aAAA,CAACe,SAAAA,CAAAA,SAAS,EAAA,IAAA,EACRhB,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;MACEI,SAAS,EAAEI,UAAU,CACnBH,mBAAM,CAACW,aAAa,EACpBX,mBAAM,CAAC,EAAA,CAAAY,MAAA,CAAGhD,MAAM,EAAA,eAAA,CAAe,CAAC;IACjC,CAAA,EAEAY,KAAK,IAAIkB;MAAKK,SAAS,EAAEC,mBAAM,CAACxB;IAAQ,CAAA,EAAAA,KAAK,CAAO,EACrDkB,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;MAAKI,SAAS,EAAEC,mBAAM,CAACa;IAAO,CAAA,EAC3BvC,QAAQ,EACRR,SAAS,IAAI,IAAI,IAChB4B,KACE,CAAAC,aAAA,CAAA,KAAA,EAAA;MAAAI,SAAS,EACPtB,cAAc,GACVuB,mBAAM,CAACc,yBAAyB,GAChCd,mBAAM,CAACe;IAAM,EAGtB,CACG,CACF,CACI,EACZrB,KAAA,CAAAC,aAAA,CAACqB,WAAW,CAAAA,WAAA,EAAA;MACVR,OAAO,EAAEhC,KAAK,GAAG,SAAS,GAAGK,SAAS;MACtCoC,OAAO,EAAEnC,aAAa;MACtBoC,UAAU,EAAC,SAAS;MACpBxD,QAAQ,EAAEA;IAAQ,CAAA,CAClB,CACE,CACO;EAEnB,CAAC;EAEDJ,YAAY,CAAC6D,WAAW,GAAG,cAAc;EAAA,OAnG5B7D,YAAY;AAAA;"}
|
|
@@ -22,7 +22,7 @@ const Popover = /*#__PURE__*/function () {
|
|
|
22
22
|
floating: refs.floating.current
|
|
23
23
|
},
|
|
24
24
|
placement: "bottom-start",
|
|
25
|
-
middleware: [reactDom.offset(
|
|
25
|
+
middleware: [reactDom.offset(6), reactDom.flip(), reactDom.size({
|
|
26
26
|
apply: function (_a) {
|
|
27
27
|
var availableWidth = _a.availableWidth,
|
|
28
28
|
availableHeight = _a.availableHeight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.cjs","sources":["../../../../../src/MultiSelect/subcomponents/Popover/Popover.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport { createPortal } from \"react-dom\"\nimport {\n autoUpdate,\n flip,\n offset,\n ReferenceType,\n useFloating,\n UseFloatingReturn,\n UseFloatingOptions,\n size,\n} from \"@floating-ui/react-dom\"\nimport classnames from \"classnames\"\nimport { FocusOn } from \"react-focus-on\"\nimport { ReactFocusOnProps } from \"react-focus-on/dist/es5/types\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport styles from \"./Popover.module.scss\"\n\nexport type PopoverProps<RT extends ReferenceType = ReferenceType> = {\n children: React.ReactNode\n refs: UseFloatingReturn<RT>[\"refs\"]\n /**\n * passes in additional options / override for https://floating-ui.com/docs/tooltip#usefloating-hook\n */\n floatingOptions?: Omit<UseFloatingOptions, \"elements\">\n focusOnProps?: Omit<ReactFocusOnProps, \"children\">\n portalContainer?: Element | DocumentFragment\n} & OverrideClassName<HTMLAttributes<HTMLDivElement>>\n\nexport const Popover = <RT extends ReferenceType>({\n children,\n refs,\n floatingOptions,\n focusOnProps,\n portalContainer,\n classNameOverride,\n ...restProps\n}: PopoverProps<RT>): JSX.Element => {\n const { floatingStyles } = useFloating({\n elements: {\n reference: refs.reference.current,\n floating: refs.floating.current,\n },\n placement: \"bottom-start\",\n middleware: [\n offset(
|
|
1
|
+
{"version":3,"file":"Popover.cjs","sources":["../../../../../src/MultiSelect/subcomponents/Popover/Popover.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport { createPortal } from \"react-dom\"\nimport {\n autoUpdate,\n flip,\n offset,\n ReferenceType,\n useFloating,\n UseFloatingReturn,\n UseFloatingOptions,\n size,\n} from \"@floating-ui/react-dom\"\nimport classnames from \"classnames\"\nimport { FocusOn } from \"react-focus-on\"\nimport { ReactFocusOnProps } from \"react-focus-on/dist/es5/types\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport styles from \"./Popover.module.scss\"\n\nexport type PopoverProps<RT extends ReferenceType = ReferenceType> = {\n children: React.ReactNode\n refs: UseFloatingReturn<RT>[\"refs\"]\n /**\n * passes in additional options / override for https://floating-ui.com/docs/tooltip#usefloating-hook\n */\n floatingOptions?: Omit<UseFloatingOptions, \"elements\">\n focusOnProps?: Omit<ReactFocusOnProps, \"children\">\n portalContainer?: Element | DocumentFragment\n} & OverrideClassName<HTMLAttributes<HTMLDivElement>>\n\nexport const Popover = <RT extends ReferenceType>({\n children,\n refs,\n floatingOptions,\n focusOnProps,\n portalContainer,\n classNameOverride,\n ...restProps\n}: PopoverProps<RT>): JSX.Element => {\n const { floatingStyles } = useFloating({\n elements: {\n reference: refs.reference.current,\n floating: refs.floating.current,\n },\n placement: \"bottom-start\",\n middleware: [\n offset(6),\n flip(),\n size({\n apply({ availableWidth, availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n maxWidth: `${Math.min(availableWidth, 400)}px`,\n minWidth: `${Math.min(availableWidth, 196)}px`,\n maxHeight: `${Math.min(availableHeight, 352)}px`,\n })\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n ...floatingOptions,\n })\n\n return createPortal(\n <FocusOn scrollLock={false} {...focusOnProps}>\n <div\n ref={refs.setFloating}\n style={floatingStyles}\n className={classnames(styles.popover, classNameOverride)}\n role=\"dialog\"\n aria-modal=\"true\"\n {...restProps}\n >\n {children}\n </div>\n </FocusOn>,\n portalContainer ?? document.body\n )\n}\n\nPopover.displayName = \"Popover\"\n"],"names":["Popover","_a","children","refs","floatingOptions","focusOnProps","portalContainer","classNameOverride","restProps","__rest","floatingStyles","useFloating","__assign","elements","reference","current","floating","placement","middleware","offset","flip","size","apply","availableWidth","availableHeight","Object","assign","style","maxWidth","concat","Math","min","minWidth","maxHeight","whileElementsMounted","autoUpdate","createPortal","React","createElement","FocusOn","scrollLock","ref","setFloating","className","classnames","styles","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AAe,EAAE,GAAG,CAAC,EAAI,IAAA;UACjD,CAAA,CAAC;QACH;OACF,CAAC,CACH;MACDU,oBAAoB,EAAEC,QAAU,CAAAA;IAAA,GAC7B/B,eAAe,CAAA,CAClB,eArBoB;IAuBtB,OAAOgC,QAAY,CAAAA,YAAA,CACjBC,KAAC,CAAAC,aAAA,CAAAC,YAAO,CAAAA,OAAA;MAACC,UAAU,EAAE;IAAK,CAAA,EAAMnC,YAAY,CAAA,EAC1CgC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA1B,KAAA,CAAAA,QAAA,CAAA;MACE6B,GAAG,EAAEtC,IAAI,CAACuC,WAAW;MACrBf,KAAK,EAAEjB,cAAc;MACrBiC,SAAS,EAAEC,UAAU,CAACC,cAAM,CAACC,OAAO,EAAEvC,iBAAiB,CAAC;MACxDwC,IAAI,EAAC,QAAQ;oBACF;IAAM,CAAA,EACbvC,SAAS,CAEZ,EAAAN,QAAQ,CACL,CACE,EACVI,eAAe,KAAf,IAAA,IAAAA,eAAe,cAAfA,eAAe,GAAI0C,QAAQ,CAACC,IAAI,CACjC;EACH,CAAC;EAEDjD,OAAO,CAACkD,WAAW,GAAG,SAAS;EAAA,OAjDlBlD,OAAO;AAAA;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var ToastNotificationContext = require('../context/ToastNotificationContext.cjs');
|
|
6
|
+
var ToastNotification = function (_a) {
|
|
7
|
+
var propsId = _a.id,
|
|
8
|
+
_b = _a.hideCloseIcon,
|
|
9
|
+
hideCloseIcon = _b === void 0 ? false : _b,
|
|
10
|
+
type = _a.type,
|
|
11
|
+
title = _a.title,
|
|
12
|
+
onHide = _a.onHide,
|
|
13
|
+
children = _a.children,
|
|
14
|
+
restProps = tslib.__rest(_a, ["id", "hideCloseIcon", "type", "title", "onHide", "children"]);
|
|
15
|
+
var reactId = React.useId();
|
|
16
|
+
var id = propsId || reactId;
|
|
17
|
+
var addToastNotification = ToastNotificationContext.useToastNotificationContext().addToastNotification;
|
|
18
|
+
var persistent = hideCloseIcon;
|
|
19
|
+
React.useEffect(function () {
|
|
20
|
+
addToastNotification(tslib.__assign({
|
|
21
|
+
id: id,
|
|
22
|
+
type: type,
|
|
23
|
+
title: title,
|
|
24
|
+
message: children,
|
|
25
|
+
persistent: persistent,
|
|
26
|
+
onHide: onHide
|
|
27
|
+
}, restProps));
|
|
28
|
+
}, []);
|
|
29
|
+
return null;
|
|
30
|
+
};
|
|
31
|
+
ToastNotification.displayName = "ToastNotification";
|
|
32
|
+
exports.ToastNotification = ToastNotification;
|
|
33
|
+
//# sourceMappingURL=ToastNotification.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastNotification.cjs","sources":["../../../../../src/Notification/ToastNotification/ToastNotification/ToastNotification.tsx"],"sourcesContent":["import React, { useEffect, useId } from \"react\"\nimport { useToastNotificationContext } from \"../context/ToastNotificationContext\"\nimport { ToastNotificationObj } from \"../types\"\n\nexport type ToastNotificationProps = Omit<\n ToastNotificationObj,\n \"id\" | \"message\" | \"persistent\"\n> & {\n children: React.ReactNode\n id?: string\n /**\n * Removes the dismiss trigger. Functions the same as `persistent` in `addToastNotification`.\n * If this is true you will need to manage the removal of notifications manually.\n * @default false\n */\n hideCloseIcon?: boolean\n}\n\nexport const ToastNotification = ({\n id: propsId,\n hideCloseIcon = false,\n type,\n title,\n onHide,\n children,\n ...restProps\n}: ToastNotificationProps): null => {\n const reactId = useId()\n const id = propsId || reactId\n const { addToastNotification } = useToastNotificationContext()\n const persistent = hideCloseIcon\n\n useEffect(() => {\n addToastNotification({\n id,\n type,\n title,\n message: children,\n persistent,\n onHide,\n ...restProps,\n })\n }, [])\n\n return null\n}\n\nToastNotification.displayName = \"ToastNotification\"\n"],"names":["ToastNotification","_a","propsId","id","_b","hideCloseIcon","type","title","onHide","children","restProps","__rest","reactId","useId","addToastNotification","useToastNotificationContext","persistent","useEffect","__assign","message","displayName"],"mappings":";;;;;AAkBO,IAAMA,iBAAiB,GAAG,SAAAA,CAACC,EAQT,EAAA;EAPvB,IAAIC,OAAO,GAAAD,EAAA,CAAAE,EAAA;IACXC,EAAqB,GAAAH,EAAA,CAAAI,aAAA;IAArBA,aAAa,GAAGD,EAAA,KAAA,KAAA,CAAA,GAAA,KAAK,GAAAA,EAAA;IACrBE,IAAI,GAAAL,EAAA,CAAAK,IAAA;IACJC,KAAK,GAAAN,EAAA,CAAAM,KAAA;IACLC,MAAM,GAAAP,EAAA,CAAAO,MAAA;IACNC,QAAQ,GAAAR,EAAA,CAAAQ,QAAA;IACLC,SAAS,GAPoBC,KAAA,CAAAA,MAAA,CAAAV,EAAA,EAAA,CAAA,IAAA,EAAA,eAAA,EAAA,MAAA,EAAA,OAAA,EAAA,QAAA,EAAA,UAAA,CAQjC,CADa;EAEZ,IAAMW,OAAO,GAAGC,KAAAA,CAAAA,KAAK,EAAE;EACvB,IAAMV,EAAE,GAAGD,OAAO,IAAIU,OAAO;EACrB,IAAAE,oBAAoB,GAAKC,oDAA2B,CAAE,CAAA,qBAAlC;EAC5B,IAAMC,UAAU,GAAGX,aAAa;EAEhCY,KAAAA,CAAAA,SAAS,CAAC,YAAA;IACRH,oBAAoB,CAAAI,KAAA,CAAAA,QAAA,CAAA;MAClBf,EAAE,EAAAA,EAAA;MACFG,IAAI,EAAAA,IAAA;MACJC,KAAK,EAAAA,KAAA;MACLY,OAAO,EAAEV,QAAQ;MACjBO,UAAU,EAAAA,UAAA;MACVR,MAAM,EAAAA;IAAA,CAAA,EACHE,SAAS,CAAA,CACZ;EACH,CAAA,EAAE,EAAE,CAAC;EAEN,OAAO,IAAI;AACb,CAAC;AAEDV,iBAAiB,CAACoB,WAAW,GAAG,mBAAmB;"}
|
package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.cjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var ReactDOM = require('react-dom');
|
|
5
|
+
var ToastNotificationContext = require('../context/ToastNotificationContext.cjs');
|
|
6
|
+
var ToastNotificationsMap = require('./subcomponents/ToastNotificationsMap/ToastNotificationsMap.cjs');
|
|
7
|
+
var ToastNotificationsList_module = require('./ToastNotificationsList.module.scss.cjs');
|
|
8
|
+
const ToastNotificationsList = /*#__PURE__*/function () {
|
|
9
|
+
const ToastNotificationsList = function () {
|
|
10
|
+
var _a = ToastNotificationContext.useToastNotificationContext(),
|
|
11
|
+
notifications = _a.notifications,
|
|
12
|
+
removeToastNotification = _a.removeToastNotification;
|
|
13
|
+
var containers = document.querySelectorAll('[data-testid="toast-notifications-list"');
|
|
14
|
+
if (containers) {
|
|
15
|
+
// Remove any duplicate instances
|
|
16
|
+
// (eg. Storybook docs page has multiple stories each with their own context)
|
|
17
|
+
containers.forEach(function (c, i) {
|
|
18
|
+
if (i === 0) return;
|
|
19
|
+
c.remove();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return ReactDOM.createPortal(React.createElement("div", {
|
|
23
|
+
"data-testid": "toast-notifications-list",
|
|
24
|
+
role: "status",
|
|
25
|
+
className: ToastNotificationsList_module.toastNotificationsList
|
|
26
|
+
}, React.createElement(ToastNotificationsMap.ToastNotificationsMap, {
|
|
27
|
+
notifications: notifications,
|
|
28
|
+
onHide: removeToastNotification,
|
|
29
|
+
container: containers[0]
|
|
30
|
+
})), document.body);
|
|
31
|
+
};
|
|
32
|
+
ToastNotificationsList.displayName = "ToastNotificationsList";
|
|
33
|
+
return ToastNotificationsList;
|
|
34
|
+
}();
|
|
35
|
+
exports.ToastNotificationsList = ToastNotificationsList;
|
|
36
|
+
//# sourceMappingURL=ToastNotificationsList.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastNotificationsList.cjs","sources":["../../../../../src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.tsx"],"sourcesContent":["import React from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { useToastNotificationContext } from \"../context/ToastNotificationContext\"\nimport { ToastNotificationsMap } from \"./subcomponents/ToastNotificationsMap\"\nimport styles from \"./ToastNotificationsList.module.scss\"\n\nexport const ToastNotificationsList = (): JSX.Element => {\n const { notifications, removeToastNotification } =\n useToastNotificationContext()\n\n const containers = document.querySelectorAll(\n '[data-testid=\"toast-notifications-list\"'\n )\n\n if (containers) {\n // Remove any duplicate instances\n // (eg. Storybook docs page has multiple stories each with their own context)\n containers.forEach((c, i) => {\n if (i === 0) return\n c.remove()\n })\n }\n\n return createPortal(\n <div\n data-testid=\"toast-notifications-list\"\n role=\"status\"\n className={styles.toastNotificationsList}\n >\n <ToastNotificationsMap\n notifications={notifications}\n onHide={removeToastNotification}\n container={containers[0]}\n />\n </div>,\n document.body\n )\n}\n\nToastNotificationsList.displayName = \"ToastNotificationsList\"\n"],"names":["ToastNotificationsList","_a","useToastNotificationContext","notifications","removeToastNotification","containers","document","querySelectorAll","forEach","c","i","remove","createPortal","React","createElement","role","className","styles","toastNotificationsList","ToastNotificationsMap","onHide","container","body","displayName"],"mappings":";;;;;;;MAMaA,sBAAsB;EAAA,MAAtBA,sBAAsB,GAAG,SAAAA,CAAA,EAAA;IAC9B,IAAAC,EAAA,GACJC,wBAA2B,CAAAA,2BAAA,CAAA,CAAE;MADvBC,aAAa,GAAAF,EAAA,CAAAE,aAAA;MAAEC,uBAAuB,GAAAH,EAAA,CAAAG,uBACf;IAE/B,IAAMC,UAAU,GAAGC,QAAQ,CAACC,gBAAgB,CAC1C,yCAAyC,CAC1C;IAED,IAAIF,UAAU,EAAE;;;MAGdA,UAAU,CAACG,OAAO,CAAC,UAACC,CAAC,EAAEC,CAAC,EAAA;QACtB,IAAIA,CAAC,KAAK,CAAC,EAAE;QACbD,CAAC,CAACE,MAAM,CAAA,CAAE;MACZ,CAAC,CAAC;IACH;IAED,OAAOC,qBAAY,CACjBC,KACc,CAAAC,aAAA,CAAA,KAAA,EAAA;MAAA,aAAA,EAAA,0BAA0B;MACtCC,IAAI,EAAC,QAAQ;MACbC,SAAS,EAAEC,6BAAM,CAACC;IAAsB,CAAA,EAExCL,KAAC,CAAAC,aAAA,CAAAK,qBAAqB,CAAAA,qBAAA;MACpBhB,aAAa,EAAEA,aAAa;MAC5BiB,MAAM,EAAEhB,uBAAuB;MAC/BiB,SAAS,EAAEhB,UAAU,CAAC,CAAC;IAAC,CACxB,CAAA,CACE,EACNC,QAAQ,CAACgB,IAAI,CACd;EACH,CAAC;EAEDtB,sBAAsB,CAACuB,WAAW,GAAG,wBAAwB;EAAA,OAjChDvB,sBAAsB;AAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastNotificationsList.module.scss.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var ReactDOM = require('react-dom');
|
|
6
|
+
var GenericNotification = require('../../../../subcomponents/GenericNotification/GenericNotification.cjs');
|
|
7
|
+
const ToastNotificationsMap = /*#__PURE__*/function () {
|
|
8
|
+
const ToastNotificationsMap = function (_a) {
|
|
9
|
+
var notifications = _a.notifications,
|
|
10
|
+
defaultOnHide = _a.onHide,
|
|
11
|
+
container = _a.container;
|
|
12
|
+
if (!container) return null;
|
|
13
|
+
// To consolidate all notifications into a single list when there are multiple contexts,
|
|
14
|
+
// this list cannot render with a container (must be portalled into one).
|
|
15
|
+
return ReactDOM.createPortal(React.createElement(React.Fragment, null, notifications.map(function (_a) {
|
|
16
|
+
var id = _a.id,
|
|
17
|
+
type = _a.type,
|
|
18
|
+
title = _a.title,
|
|
19
|
+
persistent = _a.persistent,
|
|
20
|
+
onHide = _a.onHide,
|
|
21
|
+
message = _a.message,
|
|
22
|
+
restProps = tslib.__rest(_a, ["id", "type", "title", "persistent", "onHide", "message"]);
|
|
23
|
+
return React.createElement(GenericNotification.GenericNotification, tslib.__assign({
|
|
24
|
+
key: id,
|
|
25
|
+
style: "toast",
|
|
26
|
+
type: type,
|
|
27
|
+
title: title,
|
|
28
|
+
persistent: persistent,
|
|
29
|
+
onHide: function () {
|
|
30
|
+
if (typeof onHide !== "undefined") {
|
|
31
|
+
onHide();
|
|
32
|
+
}
|
|
33
|
+
defaultOnHide(id);
|
|
34
|
+
}
|
|
35
|
+
}, restProps), message);
|
|
36
|
+
})), container);
|
|
37
|
+
};
|
|
38
|
+
ToastNotificationsMap.displayName = "ToastNotificationsMap";
|
|
39
|
+
return ToastNotificationsMap;
|
|
40
|
+
}();
|
|
41
|
+
exports.ToastNotificationsMap = ToastNotificationsMap;
|
|
42
|
+
//# sourceMappingURL=ToastNotificationsMap.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastNotificationsMap.cjs","sources":["../../../../../../../src/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { GenericNotification } from \"~components/Notification/subcomponents/GenericNotification\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport { ToastNotificationObj } from \"../../../types\"\n\nexport type ToastNotificationsMapProps = {\n notifications: ToastNotificationObj[]\n onHide: (notificationId: string) => void\n container: Element | null\n} & OverrideClassName<HTMLAttributes<HTMLDivElement>>\n\nexport const ToastNotificationsMap = ({\n notifications,\n onHide: defaultOnHide,\n container,\n}: ToastNotificationsMapProps): JSX.Element | null => {\n if (!container) return null\n\n // To consolidate all notifications into a single list when there are multiple contexts,\n // this list cannot render with a container (must be portalled into one).\n return createPortal(\n <>\n {notifications.map(\n ({ id, type, title, persistent, onHide, message, ...restProps }) => (\n <GenericNotification\n key={id}\n style=\"toast\"\n type={type}\n title={title}\n persistent={persistent}\n onHide={(): void => {\n if (typeof onHide !== \"undefined\") {\n onHide()\n }\n defaultOnHide(id)\n }}\n {...restProps}\n >\n {message}\n </GenericNotification>\n )\n )}\n </>,\n container\n )\n}\n\nToastNotificationsMap.displayName = \"ToastNotificationsMap\"\n"],"names":["ToastNotificationsMap","_a","notifications","defaultOnHide","onHide","container","createPortal","React","createElement","Fragment","map","id","type","title","persistent","message","restProps","__rest","GenericNotification","__assign","key","style","displayName"],"mappings":";;;;;;MAYaA,qBAAqB;EAAA,MAArBA,qBAAqB,GAAG,SAAAA,CAACC,EAIT,EAAA;IAH3B,IAAAC,aAAa,mBAAA;MACLC,aAAa,GAAAF,EAAA,CAAAG,MAAA;MACrBC,SAAS,GAAAJ,EAAA,CAAAI,SAAA;IAET,IAAI,CAACA,SAAS,EAAE,OAAO,IAAI;;;IAI3B,OAAOC,QAAY,CAAAA,YAAA,CACjBC,KACG,CAAAC,aAAA,CAAAD,KAAA,CAAAE,QAAA,EAAA,IAAA,EAAAP,aAAa,CAACQ,GAAG,CAChB,UAACT,EAA8D,EAAA;MAA5D,IAAAU,EAAE,QAAA;QAAEC,IAAI,UAAA;QAAEC,KAAK,WAAA;QAAEC,UAAU,gBAAA;QAAEV,MAAM,YAAA;QAAEW,OAAO,aAAA;QAAKC,SAAS,GAA5DC,KAAA,CAAAA,MAAA,CAAAhB,EAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,OAAA,EAAA,YAAA,EAAA,QAAA,EAAA,SAAA,CAA8D,CAAF;MAAO,OAClEM,KAAC,CAAAC,aAAA,CAAAU,mBAAmB,CAAAA,mBAAA,EAClBC,KAAA,CAAAA,QAAA,CAAA;QAAAC,GAAG,EAAET,EAAE;QACPU,KAAK,EAAC,OAAO;QACbT,IAAI,EAAEA,IAAI;QACVC,KAAK,EAAEA,KAAK;QACZC,UAAU,EAAEA,UAAU;QACtBV,MAAM,EAAE,SAAAA,CAAA,EAAA;UACN,IAAI,OAAOA,MAAM,KAAK,WAAW,EAAE;YACjCA,MAAM,EAAE;UACT;UACDD,aAAa,CAACQ,EAAE,CAAC;QACnB;SACIK,SAAS,CAAA,EAEZD,OAAO,CACY;IACvB,CAAA,CACF,CACA,EACHV,SAAS,CACV;EACH,CAAC;EAEDL,qBAAqB,CAACsB,WAAW,GAAG,uBAAuB;EAAA,OApC9CtB,qBAAqB;AAAA;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var uuid = require('uuid');
|
|
6
|
+
var ToastNotificationContext = React.createContext(null);
|
|
7
|
+
var useToastNotificationContext = function () {
|
|
8
|
+
var context = React.useContext(ToastNotificationContext);
|
|
9
|
+
if (!context) {
|
|
10
|
+
throw new Error("useToastNotificationContext must be used within the ToastNotificationContext.Provider");
|
|
11
|
+
}
|
|
12
|
+
return context;
|
|
13
|
+
};
|
|
14
|
+
const ToastNotificationProvider = /*#__PURE__*/function () {
|
|
15
|
+
const ToastNotificationProvider = function (_a) {
|
|
16
|
+
var children = _a.children;
|
|
17
|
+
var _b = React.useState([]),
|
|
18
|
+
notifications = _b[0],
|
|
19
|
+
setNotifications = _b[1];
|
|
20
|
+
var addToastNotification = function (notification) {
|
|
21
|
+
var uuid$1 = uuid.v4();
|
|
22
|
+
var notificationWithId = tslib.__assign({
|
|
23
|
+
id: uuid$1
|
|
24
|
+
}, notification);
|
|
25
|
+
var notificationExists = notifications.find(function (_a) {
|
|
26
|
+
var id = _a.id;
|
|
27
|
+
return id === notification.id;
|
|
28
|
+
});
|
|
29
|
+
if (!notificationExists) {
|
|
30
|
+
setNotifications(function (existing) {
|
|
31
|
+
return tslib.__spreadArray(tslib.__spreadArray([], existing, true), [notificationWithId], false);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var updateToastNotification = function (notification) {
|
|
36
|
+
var notificationIndex = notifications.findIndex(function (_a) {
|
|
37
|
+
var id = _a.id;
|
|
38
|
+
return id === notification.id;
|
|
39
|
+
});
|
|
40
|
+
var copy = notifications.slice();
|
|
41
|
+
copy.splice(notificationIndex, 1, notification); // Mutation to insert notification over itself
|
|
42
|
+
setNotifications(copy);
|
|
43
|
+
};
|
|
44
|
+
var removeToastNotification = function (notificationID) {
|
|
45
|
+
var notificationIndex = notifications.findIndex(function (_a) {
|
|
46
|
+
var id = _a.id;
|
|
47
|
+
return id === notificationID;
|
|
48
|
+
});
|
|
49
|
+
var copy = notifications.slice();
|
|
50
|
+
copy.splice(notificationIndex, 1); // Mutation
|
|
51
|
+
setNotifications(copy);
|
|
52
|
+
};
|
|
53
|
+
var clearToastNotifications = function () {
|
|
54
|
+
setNotifications([]);
|
|
55
|
+
};
|
|
56
|
+
var value = {
|
|
57
|
+
notifications: notifications,
|
|
58
|
+
addToastNotification: addToastNotification,
|
|
59
|
+
updateToastNotification: updateToastNotification,
|
|
60
|
+
removeToastNotification: removeToastNotification,
|
|
61
|
+
clearToastNotifications: clearToastNotifications
|
|
62
|
+
};
|
|
63
|
+
return React.createElement(ToastNotificationContext.Provider, {
|
|
64
|
+
value: value
|
|
65
|
+
}, children);
|
|
66
|
+
};
|
|
67
|
+
ToastNotificationProvider.displayName = "ToastNotificationProvider";
|
|
68
|
+
return ToastNotificationProvider;
|
|
69
|
+
}();
|
|
70
|
+
exports.ToastNotificationProvider = ToastNotificationProvider;
|
|
71
|
+
exports.useToastNotificationContext = useToastNotificationContext;
|
|
72
|
+
//# sourceMappingURL=ToastNotificationContext.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastNotificationContext.cjs","sources":["../../../../../src/Notification/ToastNotification/context/ToastNotificationContext.tsx"],"sourcesContent":["import React, { useContext, useState } from \"react\"\nimport { v4 as uuidv4 } from \"uuid\"\nimport { ToastNotificationObj } from \"../types\"\n\ntype ToastNotificationObjOptionalId = Omit<ToastNotificationObj, \"id\"> & {\n id?: string\n}\n\nexport type ToastNotificationContextValue = {\n notifications: ToastNotificationObj[]\n addToastNotification: (notification: ToastNotificationObjOptionalId) => void\n updateToastNotification: (notification: ToastNotificationObj) => void\n removeToastNotification: (notificationId: string) => void\n clearToastNotifications: () => void\n}\n\nconst ToastNotificationContext =\n React.createContext<ToastNotificationContextValue | null>(null)\n\nexport const useToastNotificationContext =\n (): ToastNotificationContextValue => {\n const context = useContext(ToastNotificationContext)\n\n if (!context) {\n throw new Error(\n \"useToastNotificationContext must be used within the ToastNotificationContext.Provider\"\n )\n }\n\n return context\n }\n\ntype ToastNotificationProviderProps = {\n children: React.ReactNode\n}\n\nexport const ToastNotificationProvider = ({\n children,\n}: ToastNotificationProviderProps): JSX.Element | null => {\n const [notifications, setNotifications] = useState<ToastNotificationObj[]>([])\n\n const addToastNotification: ToastNotificationContextValue[\"addToastNotification\"] =\n notification => {\n const uuid = uuidv4()\n const notificationWithId = { id: uuid, ...notification }\n\n const notificationExists = notifications.find(\n ({ id }) => id === notification.id\n )\n\n if (!notificationExists) {\n setNotifications(existing => [...existing, notificationWithId])\n }\n }\n\n const updateToastNotification = (\n notification: ToastNotificationObj\n ): void => {\n const notificationIndex = notifications.findIndex(\n ({ id }) => id === notification.id\n )\n\n const copy = notifications.slice()\n copy.splice(notificationIndex, 1, notification) // Mutation to insert notification over itself\n setNotifications(copy)\n }\n\n const removeToastNotification = (notificationID: string): void => {\n const notificationIndex = notifications.findIndex(\n ({ id }) => id === notificationID\n )\n const copy = notifications.slice()\n copy.splice(notificationIndex, 1) // Mutation\n setNotifications(copy)\n }\n\n const clearToastNotifications = (): void => {\n setNotifications([])\n }\n\n const value = {\n notifications,\n addToastNotification,\n updateToastNotification,\n removeToastNotification,\n clearToastNotifications,\n } satisfies ToastNotificationContextValue\n\n return (\n <ToastNotificationContext.Provider value={value}>\n {children}\n </ToastNotificationContext.Provider>\n )\n}\n\nToastNotificationProvider.displayName = \"ToastNotificationProvider\"\n"],"names":["ToastNotificationContext","React","createContext","useToastNotificationContext","context","useContext","Error","ToastNotificationProvider","_a","children","_b","useState","notifications","setNotifications","addToastNotification","notification","uuid","uuidv4","notificationWithId","id","notificationExists","find","existing","__spreadArray","updateToastNotification","notificationIndex","findIndex","copy","slice","splice","removeToastNotification","notificationID","clearToastNotifications","value","createElement","Provider","displayName"],"mappings":";;;;;AAgBA,IAAMA,wBAAwB,GAC5BC,KAAK,CAACC,aAAa,CAAuC,IAAI,CAAC;AAEpD,IAAAC,2BAA2B,GACtC,SAAAA,CAAA,EAAA;EACE,IAAMC,OAAO,GAAGC,gBAAU,CAACL,wBAAwB,CAAC;EAEpD,IAAI,CAACI,OAAO,EAAE;IACZ,MAAM,IAAIE,KAAK,CACb,uFAAuF,CACxF;EACF;EAED,OAAOF,OAAO;AAChB,CAAC;AAAA,MAMUG,yBAAyB;EAAA,MAAzBA,yBAAyB,GAAG,SAAAA,CAACC,EAET,EAAA;IAD/B,IAAAC,QAAQ,GAAAD,EAAA,CAAAC,QAAA;IAEF,IAAAC,EAAA,GAAoCC,KAAAA,CAAAA,QAAQ,CAAyB,EAAE,CAAC;MAAvEC,aAAa,GAAAF,EAAA,CAAA,CAAA,CAAA;MAAEG,gBAAgB,GAAAH,EAAA,CAAA,CAAA,CAAwC;IAE9E,IAAMI,oBAAoB,GACxB,SAAAA,CAAAC,YAAY,EAAA;MACV,IAAMC,MAAI,GAAGC,IAAAA,CAAAA,EAAM,EAAE;MACrB,IAAMC,kBAAkB;QAAKC,EAAE,EAAEH;MAAI,CAAK,EAAAD,YAAY,CAAE;MAExD,IAAMK,kBAAkB,GAAGR,aAAa,CAACS,IAAI,CAC3C,UAACb,EAAM,EAAA;QAAJ,IAAAW,EAAE,GAAAX,EAAA,CAAAW,EAAA;QAAO,OAAAA,EAAE,KAAKJ,YAAY,CAACI,EAAE;MAAtB,CAAsB,CACnC;MAED,IAAI,CAACC,kBAAkB,EAAE;QACvBP,gBAAgB,CAAC,UAAAS,QAAQ,EAAI;UAAA,OAAAC,KAAA,CAAAA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AAA;KACgB;IAEzC,OACE/B,KAAA,CAAAiC,aAAA,CAAClC,wBAAwB,CAACmC,QAAQ,EAAA;MAACF,KAAK,EAAEA;KAAK,EAC5CxB,QAAQ,CACyB;EAExC,CAAC;EAEDF,yBAAyB,CAAC6B,WAAW,GAAG,2BAA2B;EAAA,OA3DtD7B,yBAAyB;AAAA;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ToastNotificationContext = require('../context/ToastNotificationContext.cjs');
|
|
4
|
+
var useToastNotification = function () {
|
|
5
|
+
var context = ToastNotificationContext.useToastNotificationContext();
|
|
6
|
+
return context;
|
|
7
|
+
};
|
|
8
|
+
exports.useToastNotification = useToastNotification;
|
|
9
|
+
//# sourceMappingURL=useToastNotification.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToastNotification.cjs","sources":["../../../../../src/Notification/ToastNotification/hooks/useToastNotification.ts"],"sourcesContent":["import {\n ToastNotificationContextValue,\n useToastNotificationContext,\n} from \"../context/ToastNotificationContext\"\n\nexport const useToastNotification = (): ToastNotificationContextValue => {\n const context = useToastNotificationContext()\n return context\n}\n"],"names":["useToastNotification","context","useToastNotificationContext"],"mappings":";;;AAKa,IAAAA,oBAAoB,GAAG,SAAAA,CAAA,EAAA;EAClC,IAAMC,OAAO,GAAGC,wBAAAA,CAAAA,2BAA2B,EAAE;EAC7C,OAAOD,OAAO;AAChB,CAAA;"}
|
|
@@ -7,6 +7,9 @@ var FieldMessage = require('../../FieldMessage/FieldMessage.cjs');
|
|
|
7
7
|
var Label = require('../../Label/Label.cjs');
|
|
8
8
|
var InlineNotification = require('../../Notification/InlineNotification/InlineNotification.cjs');
|
|
9
9
|
require('../../Notification/GlobalNotification/GlobalNotification.cjs');
|
|
10
|
+
require('../../Notification/ToastNotification/ToastNotification/ToastNotification.cjs');
|
|
11
|
+
require('../../Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.cjs');
|
|
12
|
+
require('../../Notification/ToastNotification/context/ToastNotificationContext.cjs');
|
|
10
13
|
var ProseMirrorState = require('prosemirror-state');
|
|
11
14
|
require('prosemirror-view');
|
|
12
15
|
var useRichTextEditor = require('../utils/core/hooks/useRichTextEditor.cjs');
|
|
@@ -62,6 +65,7 @@ const RichTextEditor = /*#__PURE__*/function () {
|
|
|
62
65
|
defaultValue = _a.defaultValue,
|
|
63
66
|
labelText = _a.labelText,
|
|
64
67
|
labelledBy = _a["aria-labelledby"],
|
|
68
|
+
describedBy = _a["aria-describedby"],
|
|
65
69
|
classNameOverride = _a.classNameOverride,
|
|
66
70
|
controls = _a.controls,
|
|
67
71
|
_b = _a.rows,
|
|
@@ -72,7 +76,7 @@ const RichTextEditor = /*#__PURE__*/function () {
|
|
|
72
76
|
description = _a.description,
|
|
73
77
|
_c = _a.status,
|
|
74
78
|
status = _c === void 0 ? "default" : _c,
|
|
75
|
-
restProps = tslib.__rest(_a, ["onChange", "defaultValue", "labelText", "aria-labelledby", "classNameOverride", "controls", "rows", "dataError", "onDataError", "validationMessage", "description", "status"]);
|
|
79
|
+
restProps = tslib.__rest(_a, ["onChange", "defaultValue", "labelText", "aria-labelledby", "aria-describedby", "classNameOverride", "controls", "rows", "dataError", "onDataError", "validationMessage", "description", "status"]);
|
|
76
80
|
var reactId = React.useId();
|
|
77
81
|
var schema$1 = React.useState(schema.createSchemaFromControls(controls))[0];
|
|
78
82
|
var labelId = React.useState(labelledBy || reactId)[0];
|
|
@@ -119,7 +123,7 @@ const RichTextEditor = /*#__PURE__*/function () {
|
|
|
119
123
|
}, [editorState]);
|
|
120
124
|
var validationMessageAria = validationMessage ? "".concat(editorId, "-rte-validation-message") : "";
|
|
121
125
|
var descriptionAria = description ? "".concat(editorId, "-rte-description") : "";
|
|
122
|
-
var ariaDescribedBy =
|
|
126
|
+
var ariaDescribedBy = classnames(validationMessageAria, descriptionAria, describedBy);
|
|
123
127
|
return React.createElement(React.Fragment, null, !labelledBy && labelText && React.createElement(Label.Label, {
|
|
124
128
|
id: labelId,
|
|
125
129
|
labelText: labelText
|