@am92/react-design-system 2.9.6 → 2.9.8

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.
@@ -6,6 +6,10 @@ export declare const DsLinkOverrides: {
6
6
  cursor: string;
7
7
  textDecorationColor: string;
8
8
  textUnderlinePosition: string;
9
+ fontWeight: string;
10
+ fontSize: string;
11
+ lineHeight: string;
12
+ letterSpacing: string;
9
13
  '&:visited': {
10
14
  color: string;
11
15
  textDecorationColor: string;
@@ -25,6 +29,7 @@ export declare const DsLinkOverrides: {
25
29
  };
26
30
  '&:focus': {
27
31
  textDecoration: string;
32
+ textDecorationThickness: string;
28
33
  };
29
34
  };
30
35
  };
@@ -7,6 +7,10 @@ export const DsLinkOverrides = {
7
7
  cursor: 'pointer',
8
8
  textDecorationColor: 'var(--ds-colour-actionSecondary)',
9
9
  textUnderlinePosition: 'under',
10
+ fontWeight: 'var(--ds-typo-bodyRegularSmall-fontWeight)',
11
+ fontSize: 'var(--ds-typo-bodyRegularSmall-fontSize)',
12
+ lineHeight: 'var(--ds-typo-bodyRegularSmall-lineHeight)',
13
+ letterSpacing: 'var(--ds-typo-bodyRegularSmall-letterSpacing)',
10
14
  '&:visited': {
11
15
  color: 'var(--ds-colour-stateSelectedVisitedTextLink)',
12
16
  textDecorationColor: 'var(--ds-colour-stateSelectedVisitedTextLink)'
@@ -25,7 +29,8 @@ export const DsLinkOverrides = {
25
29
  textDecorationColor: 'var(--ds-colour-typoDisabled)'
26
30
  },
27
31
  '&:focus': {
28
- textDecoration: 'underline'
32
+ textDecoration: 'underline',
33
+ textDecorationThickness: '2px',
29
34
  }
30
35
  }
31
36
  }
@@ -8,9 +8,14 @@ export const DsProgressStepper = inProps => {
8
8
  const props = { ...DsProgressStepperDefaultProps, ...inProps };
9
9
  const renderStepIcon = (stepProps) => {
10
10
  const { active, error, completed, icon } = stepProps;
11
- if (error) {
11
+ const isWarning = typeof icon === 'string' && icon === 'warning';
12
+ const isError = error || (typeof icon === 'string' && icon === 'error');
13
+ if (isError) {
12
14
  return (_jsx(DsRemixIcon, { className: 'ri-close-circle-fill', sx: { color: 'var(--ds-colour-iconNegative)' } }));
13
15
  }
16
+ if (isWarning) {
17
+ return (_jsx(DsRemixIcon, { className: 'ri-error-warning-fill', sx: { color: 'var(--ds-colour-supportWarning)' } }));
18
+ }
14
19
  if (completed) {
15
20
  return (_jsx(DsRemixIcon, { className: 'ri-checkbox-circle-fill', sx: { color: 'var(--ds-colour-iconPositive)' } }));
16
21
  }
@@ -5,7 +5,7 @@ import { DsRemixIcon } from '../../DsRemixIcon';
5
5
  import { DsStack } from '../../DsStack';
6
6
  import { DsTypography } from '../../DsTypography';
7
7
  export const DsProgressTrackerHeader = (props) => {
8
- const { activeStep, steps, nextStepLabelPrefix, dense, onClick, StepperProps, ...wrapperProps } = props;
8
+ const { activeStep, steps, nextStepLabelPrefix, dense, onClick, StepperProps, stepLabelVisible, lastStepLabelText, ...wrapperProps } = props;
9
9
  const currentStep = steps[activeStep] || {};
10
10
  const nextStepIndex = activeStep + 1;
11
11
  const nextStep = steps[nextStepIndex];
@@ -14,13 +14,13 @@ export const DsProgressTrackerHeader = (props) => {
14
14
  const fillPercentage = Math.round((nextStepIndex / steps.length) * 100);
15
15
  const renderStepsLabel = () => {
16
16
  return (_jsx(DsTypography, { component: 'div', textAlign: 'right', color: 'var(--ds-colour-typoTertiary)', variant: 'subheadingSemiboldDefault', children: isNextStepLastStep
17
- ? 'Yay! you are almost done'
17
+ ? lastStepLabelText
18
18
  : `${nextStepLabelPrefix} ${nextStep.stepName}` }));
19
19
  };
20
20
  return (_jsx(_Fragment, { children: dense ? (_jsxs(DsStack, { sx: {
21
21
  backgroundColor: 'var(--ds-colour-surfaceSecondary)',
22
22
  ...wrapperProps?.sx
23
- }, ...wrapperProps, children: [_jsxs(DsStack, { direction: 'row', justifyContent: 'space-between', px: 'var(--ds-spacing-bitterCold)', pt: 'var(--ds-spacing-frostbite)', pb: 'calc(var(--ds-spacing-frostbite) - var(--ds-spacing-deepFreeze))', onClick: onClick, children: [_jsx(DsTypography, { variant: 'subheadingSemiboldDefault', children: `STEP ${activeStep + 1} OF ${steps.length}` }), _jsxs(DsStack, { direction: 'row', spacing: 'var(--ds-spacing-frostbite)', children: [haveNextStep && renderStepsLabel(), props['ds-variant'] !== 'header' && (_jsx(DsRemixIcon, { fontSize: 'bitterCold', className: 'ri-arrow-right-s-line' }))] })] }), _jsx(DsLinearProgress, { color: 'secondary', value: fillPercentage, variant: 'determinate', sx: {
23
+ }, ...wrapperProps, children: [_jsxs(DsStack, { direction: 'row', justifyContent: 'space-between', px: 'var(--ds-spacing-bitterCold)', pt: 'var(--ds-spacing-frostbite)', pb: 'calc(var(--ds-spacing-frostbite) - var(--ds-spacing-deepFreeze))', onClick: onClick, children: [_jsx(DsTypography, { variant: 'subheadingSemiboldDefault', children: `STEP ${activeStep + 1} OF ${steps.length}` }), _jsxs(DsStack, { direction: 'row', spacing: 'var(--ds-spacing-frostbite)', children: [haveNextStep && stepLabelVisible && renderStepsLabel(), props['ds-variant'] !== 'header' && (_jsx(DsRemixIcon, { fontSize: 'bitterCold', className: 'ri-arrow-right-s-line' }))] })] }), _jsx(DsLinearProgress, { color: 'secondary', value: fillPercentage, variant: 'determinate', sx: {
24
24
  backgroundColor: 'transparent',
25
25
  height: '2px',
26
26
  '.MuiLinearProgress-bar1Determinate ': {
@@ -33,5 +33,5 @@ export const DsProgressTrackerHeader = (props) => {
33
33
  backgroundColor: 'var(--ds-colour-surfaceBackground)',
34
34
  cursor: props['ds-variant'] === 'default' ? 'pointer' : 'unset',
35
35
  ...wrapperProps?.sx
36
- }, spacing: 'var(--ds-spacing-bitterCold)', direction: 'row', onClick: onClick, ...wrapperProps, children: [_jsx(DsProgressIndicator, { activeStep: activeStep + 1, steps: steps.length }), _jsxs(DsStack, { flexGrow: 1, spacing: 'var(--ds-spacing-quickFreeze)', children: [_jsx(DsTypography, { component: 'div', textAlign: 'right', color: 'var(--ds-colour-actionSecondary)', variant: 'headingBoldExtraSmall', children: currentStep.stepName }), haveNextStep && renderStepsLabel()] })] })) }));
36
+ }, spacing: 'var(--ds-spacing-bitterCold)', direction: 'row', onClick: onClick, ...wrapperProps, children: [_jsx(DsProgressIndicator, { activeStep: activeStep + 1, steps: steps.length }), _jsxs(DsStack, { flexGrow: 1, spacing: 'var(--ds-spacing-quickFreeze)', children: [_jsx(DsTypography, { component: 'div', textAlign: 'right', color: 'var(--ds-colour-actionSecondary)', variant: 'headingBoldExtraSmall', children: currentStep.stepName }), haveNextStep && stepLabelVisible && renderStepsLabel()] })] })) }));
37
37
  };
@@ -4,7 +4,12 @@ import { DsStepperProps } from '../DsStepper';
4
4
  export interface DsProgressStepperStepProps {
5
5
  stepName?: string;
6
6
  error?: DsStepLabelProps['error'];
7
- icon?: DsStepLabelProps['icon'];
7
+ /**
8
+ * Icon to display for the step. Can be a standard icon or special values:
9
+ * - 'warning': Shows a warning icon with warning color
10
+ * - 'error': Shows an error icon
11
+ */
12
+ icon?: Exclude<DsStepLabelProps['icon'], string> | 'warning' | 'error';
8
13
  optional?: DsStepLabelProps['optional'];
9
14
  completed?: DsStepProps['completed'];
10
15
  disabled?: DsStepProps['disabled'];
@@ -28,6 +28,14 @@ export interface DsProgressTrackerProps extends DsStackProps {
28
28
  * This prop can be used to provide a custom prefix string to the step label.
29
29
  */
30
30
  nextStepLabelPrefix?: React.ReactNode;
31
+ /**
32
+ * This prop can be used to hide/show the label on progress tacker header.
33
+ */
34
+ stepLabelVisible?: boolean;
35
+ /**
36
+ * This prop can be used to show custom label text for last step.
37
+ */
38
+ lastStepLabelText?: string;
31
39
  }
32
40
  export declare const DsProgressTrackerDefaultProps: DsProgressTrackerProps;
33
41
  export interface DsProgressTrackerState {
@@ -4,8 +4,9 @@ export const DsProgressTrackerDefaultProps = {
4
4
  dense: false,
5
5
  steps: [],
6
6
  StepperProps: { orientation: 'vertical' },
7
- sx: {},
8
- nextStepLabelPrefix: 'Next Step : '
7
+ nextStepLabelPrefix: 'Next Step : ',
8
+ stepLabelVisible: true,
9
+ lastStepLabelText: 'Yay! you are almost done'
9
10
  };
10
11
  export const DsProgressTrackerDefaultState = {
11
12
  open: false
@@ -1,3 +1,4 @@
1
- import { FC } from 'react';
1
+ import React from 'react';
2
2
  import { DsTooltipProps } from './DsTooltip.Types';
3
- export declare const DsTooltip: FC<DsTooltipProps>;
3
+ export declare const CustomTooltip: <TWrapper extends React.ElementType = React.ElementType<any, keyof React.JSX.IntrinsicElements>>(InProps: DsTooltipProps<TWrapper>) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const DsTooltip: <TWrapper extends React.ElementType = React.ElementType<any, keyof React.JSX.IntrinsicElements>>(InProps: DsTooltipProps<TWrapper>) => import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,17 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import Tooltip from '@mui/material/Tooltip';
4
+ import { DsTooltipDefaultProps } from './DsTooltip.Types';
4
5
  import { DsTypography } from '../DsTypography';
5
- import { DsLink } from '../DsLink';
6
- export const DsTooltip = (props) => {
6
+ export const CustomTooltip = (InProps) => {
7
+ const props = { ...DsTooltipDefaultProps, ...InProps };
7
8
  const renderTitle = () => {
8
- const { heading, description, buttonGroup } = props;
9
- const tooltipButtonGroup = buttonGroup
10
- ? React.cloneElement(buttonGroup, {
11
- size: 'small',
12
- fullWidth: true,
13
- noPadding: true,
14
- sx: { bgcolor: 'transparent', mt: 'var(--ds-spacing-bitterCold)' }
15
- })
16
- : false;
17
- return (_jsxs(_Fragment, { children: [heading && (_jsx(DsTypography, { component: "div", variant: "bodyBoldMedium", sx: { mb: 'var(--ds-spacing-glacial)' }, children: heading })), description && (_jsx(DsTypography, { component: "div", variant: "bodyRegularMedium", children: description })), tooltipButtonGroup] }));
9
+ const { heading, description } = props;
10
+ return (_jsxs(_Fragment, { children: [heading && (_jsx(DsTypography, { component: 'div', variant: 'bodyBoldMedium', sx: { mb: 'var(--ds-spacing-glacial)' }, children: heading })), description && (_jsx(DsTypography, { component: 'div', variant: 'bodyRegularMedium', children: description }))] }));
18
11
  };
19
- const { heading, description, buttonGroup, children, ...tooltipProps } = props;
20
- return (_jsx(Tooltip, { title: renderTitle(), ...tooltipProps, children: _jsx(DsLink, { component: "span", underline: "always", color: "inherit", variant: "inherit", sx: { textDecorationColor: 'inherit' }, children: children }) }));
12
+ const { heading, description, slots, slotProps, children, ...tooltipProps } = props;
13
+ const WrapperComponent = slots?.wrapper || React.Fragment;
14
+ const wrapperProps = slotProps?.wrapper || {};
15
+ return (_jsx(Tooltip, { title: renderTitle(), ...tooltipProps, children: _jsx(WrapperComponent, { ...wrapperProps, children: children || null }) }));
21
16
  };
17
+ export const DsTooltip = CustomTooltip;
@@ -1,6 +1,6 @@
1
1
  export declare const DsTooltipOverrides: {
2
2
  MuiTooltip: {
3
- defaultProps: import("./DsTooltip.Types").DsTooltipProps;
3
+ defaultProps: import("./DsTooltip.Types").DsTooltipProps<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").LinkTypeMap<{}, "a">>>;
4
4
  styleOverrides: {
5
5
  popper: {
6
6
  '&[data-popper-placement*="bottom"]': {
@@ -1,7 +1,35 @@
1
1
  import { TooltipProps } from '@mui/material';
2
- export interface DsTooltipProps extends Omit<TooltipProps, 'title'> {
2
+ import { DsLink } from '../DsLink';
3
+ type DsTooltipSlots<TWrapper extends React.ElementType = React.ElementType> = TooltipProps['slots'] & {
4
+ /** This is a slot is used to provide custom component to the wrapping parent of the tooltip children */
5
+ wrapper?: TWrapper;
6
+ };
7
+ type DsTooltipSlotProps<TWrapper extends React.ElementType = React.ElementType> = TooltipProps['slotProps'] & {
8
+ /** This is a slot is used to provide props to the custom wrapping parent of the tooltip children */
9
+ wrapper?: React.ComponentProps<TWrapper>;
10
+ };
11
+ export type DsTooltipProps<TWrapper extends React.ElementType = React.ElementType> = Omit<TooltipProps, 'title' | 'slots' | 'slotProps'> & {
12
+ /** This prop can be used to provide a heading to the tooltip */
3
13
  heading?: string;
14
+ /** This prop can be used to provide a description to the tooltip */
4
15
  description?: string;
5
- buttonGroup?: React.ReactElement;
6
- }
7
- export declare const DsTooltipDefaultProps: DsTooltipProps;
16
+ /**
17
+ * The components used for each slot inside.
18
+ *
19
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
20
+ *
21
+ * @default {}
22
+ */
23
+ slots?: DsTooltipSlots<TWrapper>;
24
+ /**
25
+ * The extra props for the slot components.
26
+ * You can override the existing props or add new ones.
27
+ *
28
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
29
+ *
30
+ * @default {}
31
+ */
32
+ slotProps?: DsTooltipSlotProps<TWrapper>;
33
+ };
34
+ export declare const DsTooltipDefaultProps: DsTooltipProps<typeof DsLink>;
35
+ export {};
@@ -1,8 +1,20 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { DsLink } from '../DsLink';
2
3
  export const DsTooltipDefaultProps = {
3
4
  arrow: true,
4
- placement: 'top-start',
5
+ placement: 'top',
5
6
  enterTouchDelay: 0,
6
7
  leaveTouchDelay: 4000,
7
- children: _jsx(_Fragment, {})
8
+ children: _jsx(_Fragment, {}),
9
+ slots: {
10
+ wrapper: DsLink
11
+ },
12
+ slotProps: {
13
+ wrapper: {
14
+ color: 'inherit',
15
+ variant: 'inherit',
16
+ underline: 'always',
17
+ sx: { textDecorationColor: 'inherit' }
18
+ }
19
+ }
8
20
  };
@@ -288,7 +288,7 @@ declare const componentOverrides: {
288
288
  defaultProps: import("../Components").DsTypographyProps;
289
289
  };
290
290
  MuiTooltip: {
291
- defaultProps: import("../Components").DsTooltipProps;
291
+ defaultProps: import("../Components").DsTooltipProps<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").LinkTypeMap<{}, "a">>>;
292
292
  styleOverrides: {
293
293
  popper: {
294
294
  '&[data-popper-placement*="bottom"]': {
@@ -769,6 +769,10 @@ declare const componentOverrides: {
769
769
  cursor: string;
770
770
  textDecorationColor: string;
771
771
  textUnderlinePosition: string;
772
+ fontWeight: string;
773
+ fontSize: string;
774
+ lineHeight: string;
775
+ letterSpacing: string;
772
776
  '&:visited': {
773
777
  color: string;
774
778
  textDecorationColor: string;
@@ -788,6 +792,7 @@ declare const componentOverrides: {
788
792
  };
789
793
  '&:focus': {
790
794
  textDecoration: string;
795
+ textDecorationThickness: string;
791
796
  };
792
797
  };
793
798
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@am92/react-design-system",
3
- "version": "2.9.6",
3
+ "version": "2.9.8",
4
4
  "description": "ReactJS Design System using Material UI",
5
5
  "sideEffects": false,
6
6
  "types": "dist/index.d.ts",