@dynamic-framework/ui-react 1.27.0 → 1.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import type { Locale } from 'date-fns';
2
2
  import type { ReactDatePickerProps } from 'react-datepicker';
3
- import type { BaseProps, ButtonVariant, ComponentSize, FamilyIconProps } from '../interface';
4
- type Props<CustomModifierNames extends string = never, WithRange extends boolean | undefined = undefined> = BaseProps & FamilyIconProps & Pick<ReactDatePickerProps<CustomModifierNames, WithRange>, 'formatWeekDay' | 'onChange' | 'autoFocus' | 'inline' | 'withPortal' | 'minDate' | 'showTimeInput' | 'calendarStartDay' | 'dateFormat' | 'selectsStart' | 'selectsEnd' | 'startDate' | 'endDate' | 'fixedHeight'> & {
3
+ import type { BaseProps, ButtonVariant, ComponentSize, FamilyIconProps, StateIcons } from '../interface';
4
+ type Props<CustomModifierNames extends string = never, WithRange extends boolean | undefined = undefined> = BaseProps & FamilyIconProps & StateIcons & Pick<ReactDatePickerProps<CustomModifierNames, WithRange>, 'formatWeekDay' | 'onChange' | 'autoFocus' | 'inline' | 'withPortal' | 'minDate' | 'showTimeInput' | 'calendarStartDay' | 'dateFormat' | 'selectsStart' | 'selectsEnd' | 'startDate' | 'endDate' | 'fixedHeight' | 'renderCustomHeader'> & {
5
5
  date?: string | null;
6
6
  selectsRange?: boolean;
7
7
  inputLabel?: string;
@@ -25,5 +25,5 @@ type Props<CustomModifierNames extends string = never, WithRange extends boolean
25
25
  invalid?: boolean;
26
26
  valid?: boolean;
27
27
  };
28
- export default function DDatePicker<CustomModifierNames extends string = never, WithRange extends boolean | undefined = undefined>({ date, selectsRange, inputLabel, inputHint, inputAriaLabel, inputActionAriaLabel, inputId, timeId, timeLabel, iconInput: iconInputProp, iconHeaderPrevMonth: iconHeaderPrevMonthProp, iconHeaderNextMonth: iconHeaderNextMonthProp, iconMaterialStyle: iconMaterialStyleProp, iconFamilyClass, iconFamilyPrefix, minYearSelect, maxYearSelect, iconHeaderSize, headerPrevMonthAriaLabel, headerNextMonthAriaLabel, headerButtonVariant, headerButtonTheme, invalid, valid, locale, className, formatWeekDay: formatWeekDayProp, style, ...props }: Props<CustomModifierNames, WithRange>): import("react/jsx-runtime").JSX.Element;
28
+ export default function DDatePicker<CustomModifierNames extends string = never, WithRange extends boolean | undefined = undefined>({ date, selectsRange, inputLabel, inputHint, inputAriaLabel, inputActionAriaLabel, inputId, timeId, timeLabel, iconInput: iconInputProp, iconHeaderPrevMonth: iconHeaderPrevMonthProp, iconHeaderNextMonth: iconHeaderNextMonthProp, iconMaterialStyle: iconMaterialStyleProp, iconFamilyClass, iconFamilyPrefix, minYearSelect, maxYearSelect, iconHeaderSize, headerPrevMonthAriaLabel, headerNextMonthAriaLabel, headerButtonVariant, headerButtonTheme, invalid, valid, renderCustomHeader: renderCustomHeaderProp, validIcon, invalidIcon, locale, className, formatWeekDay: formatWeekDayProp, style, ...props }: Props<CustomModifierNames, WithRange>): import("react/jsx-runtime").JSX.Element;
29
29
  export {};
@@ -5,6 +5,8 @@ type Props = BaseProps & {
5
5
  value?: string;
6
6
  onClick?: () => void;
7
7
  inputLabel?: string;
8
+ validIcon?: string;
9
+ invalidIcon?: string;
8
10
  } & Omit<ComponentProps<typeof DInput>, 'type' | 'onIconEndClick' | 'value'>;
9
11
  declare const ForwardedDDatePickerInput: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
10
12
  export default ForwardedDDatePickerInput;
@@ -10,6 +10,6 @@ type ToastData = {
10
10
  };
11
11
  type Props = Partial<Pick<Toast, 'id' | 'duration' | 'position'>>;
12
12
  export default function useDToast(): {
13
- toast: (data: ToastData | ValueFunction<Renderable, Toast>, toastProps: Props) => string;
13
+ toast: (data: ToastData | ValueFunction<Renderable, Toast>, toastProps?: Props) => string;
14
14
  };
15
15
  export {};
@@ -0,0 +1 @@
1
+ module.exports = 'test-file-stub';
@@ -0,0 +1 @@
1
+ module.exports = {};
package/jest/setup.js ADDED
@@ -0,0 +1,16 @@
1
+ jest.mock('react-content-loader', () => jest.fn());
2
+
3
+ jest.mock('react-responsive-pagination', () => jest.fn());
4
+
5
+ jest.mock('@react-input/mask', () => ({
6
+ InputMask: jest.fn(),
7
+ }));
8
+
9
+ jest.mock('react-i18next', () => ({
10
+ useTranslation: () => ({
11
+ t: (text) => text,
12
+ i18n: {
13
+ changeLanguage: () => new Promise(() => {}),
14
+ },
15
+ }),
16
+ }));
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sideEffects": [
4
4
  "*.css"
5
5
  ],
6
- "version": "1.27.0",
6
+ "version": "1.28.1",
7
7
  "description": "React Dynamic Framework",
8
8
  "license": "https://github.com/dynamic-framework/dynamic-ui/blob/master/libraries/dynamic-ui-react/LICENSE.md",
9
9
  "repository": {
@@ -65,7 +65,8 @@
65
65
  "types": "./dist/types/index.d.ts",
66
66
  "files": [
67
67
  "dist/",
68
- "src/style"
68
+ "src/style",
69
+ "jest/"
69
70
  ],
70
71
  "dependencies": {
71
72
  "@floating-ui/react": "^0.26.1",
@@ -81,7 +82,6 @@
81
82
  "react-content-loader": "^6.2.1",
82
83
  "react-datepicker": "^4.21.0",
83
84
  "react-dropzone": "^14.2.3",
84
- "react-hot-toast": "^2.4.1",
85
85
  "react-responsive-pagination": "^2.4.1",
86
86
  "react-select": "^5.8.0"
87
87
  },
@@ -106,7 +106,7 @@
106
106
  "@storybook/theming": "^7.5.1",
107
107
  "@testing-library/jest-dom": "^6.1.4",
108
108
  "@testing-library/react": "^14.0.0",
109
- "@types/jest": "^29.5.6",
109
+ "@types/jest": "^29.5.12",
110
110
  "@types/node": "^18.15.3",
111
111
  "@types/react": "^18.2.31",
112
112
  "@types/react-datepicker": "^4.19.1",
@@ -132,6 +132,7 @@
132
132
  "postcss-cli": "^10.1.0",
133
133
  "react": "^18.2.0",
134
134
  "react-dom": "^18.2.0",
135
+ "react-hot-toast": "^2.4.1",
135
136
  "react-i18next": "^13.3.1",
136
137
  "recharts": "^2.12.7",
137
138
  "rimraf": "^5.0.5",
@@ -140,13 +141,14 @@
140
141
  "storybook": "^7.5.1",
141
142
  "stylelint": "^15.11.0",
142
143
  "stylelint-config-twbs-bootstrap": "^11.0.1",
143
- "ts-jest": "^29.1.1",
144
+ "ts-jest": "^29.2.3",
144
145
  "tslib": "^2.6.2",
145
146
  "typescript": "^5.2.2"
146
147
  },
147
148
  "peerDependencies": {
148
149
  "react": "^18.2.0",
149
150
  "react-dom": "^18.2.0",
151
+ "react-hot-toast": "^2.4.1",
150
152
  "react-i18next": "^13.3.1",
151
153
  "recharts": "^2.12.7"
152
154
  },
@@ -155,5 +157,5 @@
155
157
  "optional": true
156
158
  }
157
159
  },
158
- "gitHead": "6d8d838d164ddfddbb407e5bac99965970656a64"
160
+ "gitHead": "a3946a6a0d9769690a19880242ccadcec5dc7960"
159
161
  }
@@ -80,6 +80,7 @@ $input-btn-border-width: var(--#{$prefix}border-width) !default;
80
80
  @import "alerts";
81
81
  @import "progress";
82
82
  @import "list-group";
83
+ @import "toast";
83
84
  @import "carousel";
84
85
  @import "close";
85
86
  @import "offcanvas";
@@ -12,7 +12,7 @@ $enable-reduced-motion: true !default;
12
12
  $enable-smooth-scroll: true !default;
13
13
  $enable-grid-classes: true !default;
14
14
  $enable-container-classes: true !default;
15
- $enable-cssgrid: false !default;
15
+ $enable-cssgrid: true !default;
16
16
  $enable-button-pointers: true !default;
17
17
  $enable-rfs: true !default;
18
18
  $enable-validation-icons: false !default;
@@ -0,0 +1,5 @@
1
+ $toast-background-color: var(--#{$prefix}white) !default;
2
+ $toast-header-color: var(--#{$prefix}body-color) !default;
3
+ $toast-header-background-color: var(--#{$prefix}white) !default;
4
+ $toast-border-color: var(--#{$prefix}border-color) !default;
5
+ $toast-box-shadow: var(--#{$prefix}box-shadow-sm) !default;
@@ -54,4 +54,5 @@
54
54
  @import "label";
55
55
  @import "avatar";
56
56
  @import "backdrop";
57
+ @import "toast";
57
58
  @import "tooltip";
@@ -0,0 +1,56 @@
1
+ .toast {
2
+ --#{$prefix}toast-header-gap: var(--#{$prefix}ref-spacer-2);
3
+ --#{$prefix}toast-color: var(--#{$prefix}gray-900);
4
+ --#{$prefix}toast-close-color: var(--#{$prefix}gray-900);
5
+ --#{$prefix}toast-header-color: var(--#{$prefix}gray-900);
6
+
7
+ .toast-title {
8
+ margin-right: auto;
9
+ margin-bottom: 0;
10
+ }
11
+
12
+ .toast-header {
13
+ gap: var(--#{$prefix}toast-header-gap);
14
+ }
15
+
16
+ .toast-body {
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: space-between;
20
+ }
21
+
22
+ .toast-icon.d-icon {
23
+ --#{$prefix}icon-color: var(--#{$prefix}toast-icon-color);
24
+ }
25
+
26
+ @each $theme, $value in map-remove($theme-colors, "light", "dark") {
27
+ $color: color-contrast-var($value);
28
+ &.toast-#{$theme} {
29
+ --#{$prefix}toast-border-color: var(--#{$prefix}#{$theme});
30
+ --#{$prefix}toast-color: #{$color};
31
+ --#{$prefix}toast-close-color: #{$color};
32
+ --#{$prefix}toast-header-color: #{$color};
33
+ --#{$prefix}toast-bg: var(--#{$prefix}#{$theme});
34
+ --#{$prefix}toast-header-bg: var(--#{$prefix}#{$theme});
35
+
36
+ .d-close {
37
+ color: var(--#{$prefix}toast-close-color);
38
+ }
39
+ }
40
+ }
41
+
42
+ &.toast-soft {
43
+ --#{$prefix}toast-color: var(--#{$prefix}gray-900);
44
+ --#{$prefix}toast-close-color: var(--#{$prefix}gray-900);
45
+ --#{$prefix}toast-header-color: var(--#{$prefix}gray-900);
46
+
47
+ @each $theme, $value in map-remove($theme-colors, "light", "dark") {
48
+ &.toast-#{$theme} {
49
+ --#{$prefix}toast-icon-color: var(--#{$prefix}#{$theme}-500);
50
+ --#{$prefix}toast-border-color: var(--#{$prefix}#{$theme}-100);
51
+ --#{$prefix}toast-bg: var(--#{$prefix}#{$theme}-100);
52
+ --#{$prefix}toast-header-bg: var(--#{$prefix}#{$theme}-100);
53
+ }
54
+ }
55
+ }
56
+ }