@dynamic-framework/ui-react 1.34.0 → 1.35.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.
Files changed (63) hide show
  1. package/README.md +1 -1
  2. package/dist/css/bootstrap-icons.css +3 -3
  3. package/dist/css/bootstrap-icons.min.css +2 -2
  4. package/dist/css/bootstrap-icons.scss +1 -1
  5. package/dist/css/dynamic-ui-non-root.css +722 -962
  6. package/dist/css/dynamic-ui-non-root.min.css +2 -2
  7. package/dist/css/dynamic-ui-root.css +1 -1
  8. package/dist/css/dynamic-ui-root.min.css +1 -1
  9. package/dist/css/dynamic-ui.css +722 -962
  10. package/dist/css/dynamic-ui.min.css +2 -2
  11. package/dist/css/fonts/bootstrap-icons.woff +0 -0
  12. package/dist/css/fonts/bootstrap-icons.woff2 +0 -0
  13. package/dist/index.esm.js +576 -146
  14. package/dist/index.esm.js.map +1 -1
  15. package/dist/index.js +573 -143
  16. package/dist/index.js.map +1 -1
  17. package/dist/js/bootstrap.bundle.js +19 -18
  18. package/dist/js/bootstrap.bundle.min.js +3 -3
  19. package/dist/js/bootstrap.esm.js +19 -16
  20. package/dist/js/bootstrap.esm.min.js +3 -3
  21. package/dist/js/bootstrap.js +19 -16
  22. package/dist/js/bootstrap.min.js +3 -3
  23. package/dist/types/components/DBoxFile/DBoxFile.d.ts +6 -5
  24. package/dist/types/components/DBoxFile/useDBoxFile.d.ts +37 -0
  25. package/dist/types/components/DBoxFile/utils.d.ts +39 -0
  26. package/dist/types/components/DDatePicker/DDatePicker.d.ts +6 -12
  27. package/dist/types/components/DDatePicker/components/DDatePickerHeaderSelector.d.ts +38 -0
  28. package/dist/types/components/{DDatePickerInput → DDatePicker/components}/DDatePickerInput.d.ts +2 -2
  29. package/dist/types/components/{DDatePickerTime → DDatePicker/components}/DDatePickerTime.d.ts +2 -2
  30. package/dist/types/components/DInput/DInput.d.ts +1 -1
  31. package/dist/types/components/DInputCounter/DInputCounter.d.ts +2 -2
  32. package/dist/types/components/DInputCurrency/DInputCurrency.d.ts +2 -2
  33. package/dist/types/components/DInputCurrencyBase/DInputCurrencyBase.d.ts +2 -2
  34. package/dist/types/components/DInputMask/DInputMask.d.ts +1 -1
  35. package/dist/types/components/DInputRange/DInputRange.d.ts +1 -1
  36. package/dist/types/components/DInputSearch/DInputSearch.d.ts +1 -1
  37. package/dist/types/components/DPopover/DPopover.d.ts +0 -3
  38. package/dist/types/utils/attr-accept.d.ts +11 -0
  39. package/dist/types/utils/getKeyboardFocusableElements.d.ts +1 -0
  40. package/jest/setup.js +14 -0
  41. package/package.json +13 -14
  42. package/src/style/abstracts/variables/_+import.scss +1 -0
  43. package/src/style/abstracts/variables/_box-file.scss +14 -7
  44. package/src/style/abstracts/variables/_cards.scss +1 -1
  45. package/src/style/abstracts/variables/_datepicker.scss +50 -0
  46. package/src/style/abstracts/variables/_forms.scss +6 -3
  47. package/src/style/base/_form-switch.scss +23 -2
  48. package/src/style/base/_input-group.scss +18 -1
  49. package/src/style/base/_nav.scss +0 -1
  50. package/src/style/base/_toast.scss +2 -0
  51. package/src/style/components/_d-box-file.scss +31 -15
  52. package/src/style/components/_d-button-icon.scss +17 -16
  53. package/src/style/components/_d-datepicker.scss +582 -243
  54. package/src/style/components/_d-input-pin.scss +8 -5
  55. package/src/style/components/_d-quick-action-button.scss +1 -1
  56. package/src/style/components/_d-quick-action-check.scss +1 -1
  57. package/src/style/components/_d-select.scss +35 -6
  58. package/src/style/components/_d-stepper-desktop.scss +1 -1
  59. package/src/style/helpers/_text-truncate.scss +2 -2
  60. package/dist/types/components/DDatePickerHeader/DDatePickerHeader.d.ts +0 -24
  61. package/dist/types/components/DDatePickerHeader/index.d.ts +0 -2
  62. package/dist/types/components/DDatePickerInput/index.d.ts +0 -2
  63. package/dist/types/components/DDatePickerTime/index.d.ts +0 -2
@@ -0,0 +1,38 @@
1
+ import type { ComponentProps } from 'react';
2
+ import type { ReactDatePickerCustomHeaderProps } from 'react-datepicker';
3
+ import DButton from '../../DButton';
4
+ import type { BaseProps, ButtonVariant, ComponentSize, FamilyIconProps } from '../../interface';
5
+ export declare enum PickerType {
6
+ Default = "default",
7
+ Quarter = "quarter",
8
+ Month = "month",
9
+ Year = "year"
10
+ }
11
+ type Props = BaseProps & FamilyIconProps & ReactDatePickerCustomHeaderProps & {
12
+ changeMonth: (monthNumber: number) => void;
13
+ changeYear: (yearNumber: number) => void;
14
+ decreaseMonth: () => void;
15
+ increaseMonth: () => void;
16
+ decreaseYear: () => void;
17
+ increaseYear: () => void;
18
+ pickerType?: PickerType;
19
+ prevMonthButtonDisabled: boolean;
20
+ nextMonthButtonDisabled: boolean;
21
+ prevYearButtonDisabled: boolean;
22
+ nextYearButtonDisabled: boolean;
23
+ iconPrev?: string;
24
+ iconNext?: string;
25
+ prevMonthAriaLabel?: string;
26
+ nextMonthAriaLabel?: string;
27
+ prevYearAriaLabel?: string;
28
+ nextYearAriaLabel?: string;
29
+ iconSize?: ComponentSize;
30
+ buttonVariant?: ButtonVariant;
31
+ buttonTheme?: string;
32
+ minYearSelect?: number;
33
+ maxYearSelect?: number;
34
+ showHeaderSelectors?: boolean;
35
+ monthsShown?: number;
36
+ } & Omit<ComponentProps<typeof DButton>, 'iconStart' | 'onClick' | 'disabled'>;
37
+ export default function DDatePickerHeaderSelector({ date, changeYear, changeMonth, decreaseMonth, increaseMonth, decreaseYear, increaseYear, monthDate, pickerType, prevMonthButtonDisabled, nextMonthButtonDisabled, monthsShown, iconPrev, iconNext, prevYearButtonDisabled, nextYearButtonDisabled, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, prevMonthAriaLabel, nextMonthAriaLabel, prevYearAriaLabel, nextYearAriaLabel, iconSize, buttonVariant, buttonTheme, style, className, minYearSelect, maxYearSelect, showHeaderSelectors, customHeaderCount, }: Props): import("react/jsx-runtime").JSX.Element;
38
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps } from 'react';
2
- import DInput from '../DInput';
3
- import type { BaseProps } from '../interface';
2
+ import { BaseProps } from '../../interface';
3
+ import DInput from '../../DInput';
4
4
  type Props = BaseProps & {
5
5
  value?: string;
6
6
  onClick?: () => void;
@@ -1,6 +1,6 @@
1
1
  import type { ComponentProps } from 'react';
2
- import DInput from '../DInput';
3
- import type { BaseProps } from '../interface';
2
+ import { BaseProps } from '../../interface';
3
+ import DInput from '../../DInput';
4
4
  type Props = BaseProps & {
5
5
  value?: string;
6
6
  onChange?: (value?: string) => void;
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { BaseProps, ComponentSize, EndIconProps, FamilyIconProps, LabelIconProps, StartIconProps } from '../interface';
3
- declare const ForwardedDInput: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "value" | "loading" | "label" | "invalid" | "size" | "onChange" | keyof BaseProps | keyof FamilyIconProps | keyof LabelIconProps | keyof StartIconProps | keyof EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & BaseProps & FamilyIconProps & LabelIconProps & StartIconProps & EndIconProps & {
3
+ declare const ForwardedDInput: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "size" | "loading" | "label" | "value" | "invalid" | "onChange" | keyof BaseProps | keyof FamilyIconProps | keyof LabelIconProps | keyof StartIconProps | keyof EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & BaseProps & FamilyIconProps & LabelIconProps & StartIconProps & EndIconProps & {
4
4
  value?: string | undefined;
5
5
  label?: string | undefined;
6
6
  loading?: boolean | undefined;
@@ -5,7 +5,7 @@ type NonDInputProps = {
5
5
  maxValue: number;
6
6
  onChange?: (value?: number) => void;
7
7
  };
8
- declare const ForwardedDInputCounter: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "value" | "loading" | "label" | "invalid" | "size" | "onChange" | keyof import("../interface").BaseProps | keyof import("../interface").FamilyIconProps | keyof import("../interface").LabelIconProps | keyof import("../interface").StartIconProps | keyof import("../interface").EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & import("../interface").BaseProps & import("../interface").FamilyIconProps & import("../interface").LabelIconProps & import("../interface").StartIconProps & import("../interface").EndIconProps & {
8
+ declare const ForwardedDInputCounter: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "size" | "loading" | "label" | "value" | "invalid" | "onChange" | keyof import("../interface").BaseProps | keyof import("../interface").FamilyIconProps | keyof import("../interface").LabelIconProps | keyof import("../interface").StartIconProps | keyof import("../interface").EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & import("../interface").BaseProps & import("../interface").FamilyIconProps & import("../interface").LabelIconProps & import("../interface").StartIconProps & import("../interface").EndIconProps & {
9
9
  value?: string | undefined;
10
10
  label?: string | undefined;
11
11
  loading?: boolean | undefined;
@@ -19,5 +19,5 @@ declare const ForwardedDInputCounter: import("react").ForwardRefExoticComponent<
19
19
  onChange?: ((value: string) => void) | undefined;
20
20
  onIconStartClick?: ((value?: string | undefined) => void) | undefined;
21
21
  onIconEndClick?: ((value?: string | undefined) => void) | undefined;
22
- } & import("react").RefAttributes<HTMLInputElement>, "ref">, "type" | "value" | "onChange" | "validIcon" | "invalidIcon">, keyof NonDInputProps> & NonDInputProps & import("react").RefAttributes<HTMLInputElement>>;
22
+ } & import("react").RefAttributes<HTMLInputElement>, "ref">, "value" | "type" | "onChange" | "validIcon" | "invalidIcon">, keyof NonDInputProps> & NonDInputProps & import("react").RefAttributes<HTMLInputElement>>;
23
23
  export default ForwardedDInputCounter;
@@ -6,7 +6,7 @@ type NonDInputProps = {
6
6
  currencyCode?: string;
7
7
  onChange?: (value?: number) => void;
8
8
  };
9
- declare const ForwardedDInputCurrencyBase: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "value" | "loading" | "label" | "invalid" | "size" | "onChange" | keyof import("../interface").BaseProps | keyof import("../interface").FamilyIconProps | keyof import("../interface").LabelIconProps | keyof import("../interface").StartIconProps | keyof import("../interface").EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & import("../interface").BaseProps & import("../interface").FamilyIconProps & import("../interface").LabelIconProps & import("../interface").StartIconProps & import("../interface").EndIconProps & {
9
+ declare const ForwardedDInputCurrencyBase: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "size" | "loading" | "label" | "value" | "invalid" | "onChange" | keyof import("../interface").BaseProps | keyof import("../interface").FamilyIconProps | keyof import("../interface").LabelIconProps | keyof import("../interface").StartIconProps | keyof import("../interface").EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & import("../interface").BaseProps & import("../interface").FamilyIconProps & import("../interface").LabelIconProps & import("../interface").StartIconProps & import("../interface").EndIconProps & {
10
10
  value?: string | undefined;
11
11
  label?: string | undefined;
12
12
  loading?: boolean | undefined;
@@ -20,5 +20,5 @@ declare const ForwardedDInputCurrencyBase: import("react").ForwardRefExoticCompo
20
20
  onChange?: ((value: string) => void) | undefined;
21
21
  onIconStartClick?: ((value?: string | undefined) => void) | undefined;
22
22
  onIconEndClick?: ((value?: string | undefined) => void) | undefined;
23
- } & import("react").RefAttributes<HTMLInputElement>, "ref">, "type" | "value" | "onChange">, keyof NonDInputProps> & NonDInputProps & import("react").RefAttributes<HTMLInputElement>>;
23
+ } & import("react").RefAttributes<HTMLInputElement>, "ref">, "value" | "type" | "onChange">, keyof NonDInputProps> & NonDInputProps & import("react").RefAttributes<HTMLInputElement>>;
24
24
  export default ForwardedDInputCurrencyBase;
@@ -8,7 +8,7 @@ type NonDInputProps = {
8
8
  currencyCode?: string;
9
9
  onChange?: (value?: number) => void;
10
10
  };
11
- declare const ForwardedDInputCurrencyBase: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "value" | "loading" | "label" | "invalid" | "size" | "onChange" | keyof import("../interface").BaseProps | keyof import("../interface").FamilyIconProps | keyof import("../interface").LabelIconProps | keyof import("../interface").StartIconProps | keyof import("../interface").EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & import("../interface").BaseProps & import("../interface").FamilyIconProps & import("../interface").LabelIconProps & import("../interface").StartIconProps & import("../interface").EndIconProps & {
11
+ declare const ForwardedDInputCurrencyBase: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "size" | "loading" | "label" | "value" | "invalid" | "onChange" | keyof import("../interface").BaseProps | keyof import("../interface").FamilyIconProps | keyof import("../interface").LabelIconProps | keyof import("../interface").StartIconProps | keyof import("../interface").EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & import("../interface").BaseProps & import("../interface").FamilyIconProps & import("../interface").LabelIconProps & import("../interface").StartIconProps & import("../interface").EndIconProps & {
12
12
  value?: string | undefined;
13
13
  label?: string | undefined;
14
14
  loading?: boolean | undefined;
@@ -22,5 +22,5 @@ declare const ForwardedDInputCurrencyBase: import("react").ForwardRefExoticCompo
22
22
  onChange?: ((value: string) => void) | undefined;
23
23
  onIconStartClick?: ((value?: string | undefined) => void) | undefined;
24
24
  onIconEndClick?: ((value?: string | undefined) => void) | undefined;
25
- } & import("react").RefAttributes<HTMLInputElement>, "ref">, "type" | "value" | "onChange">, keyof NonDInputProps> & NonDInputProps & import("react").RefAttributes<HTMLInputElement>>;
25
+ } & import("react").RefAttributes<HTMLInputElement>, "ref">, "value" | "type" | "onChange">, keyof NonDInputProps> & NonDInputProps & import("react").RefAttributes<HTMLInputElement>>;
26
26
  export default ForwardedDInputCurrencyBase;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { MaskProps } from '@react-input/mask';
3
- declare const ForwardedDInputMask: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "value" | "loading" | "label" | "invalid" | "size" | "onChange" | keyof import("../interface").BaseProps | keyof import("../interface").FamilyIconProps | keyof import("../interface").LabelIconProps | keyof import("../interface").StartIconProps | keyof import("../interface").EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & import("../interface").BaseProps & import("../interface").FamilyIconProps & import("../interface").LabelIconProps & import("../interface").StartIconProps & import("../interface").EndIconProps & {
3
+ declare const ForwardedDInputMask: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "size" | "loading" | "label" | "value" | "invalid" | "onChange" | keyof import("../interface").BaseProps | keyof import("../interface").FamilyIconProps | keyof import("../interface").LabelIconProps | keyof import("../interface").StartIconProps | keyof import("../interface").EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & import("../interface").BaseProps & import("../interface").FamilyIconProps & import("../interface").LabelIconProps & import("../interface").StartIconProps & import("../interface").EndIconProps & {
4
4
  value?: string | undefined;
5
5
  label?: string | undefined;
6
6
  loading?: boolean | undefined;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { BaseProps, LabelIconProps } from '../interface';
3
- declare const ForwardedDInputRange: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type">, "label" | "ariaLabel" | keyof BaseProps | keyof LabelIconProps | "filledValue"> & BaseProps & LabelIconProps & {
3
+ declare const ForwardedDInputRange: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type">, "label" | keyof BaseProps | keyof LabelIconProps | "ariaLabel" | "filledValue"> & BaseProps & LabelIconProps & {
4
4
  label?: string | undefined;
5
5
  ariaLabel?: string | undefined;
6
6
  filledValue?: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare const ForwardedDInputSearch: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "value" | "loading" | "label" | "invalid" | "size" | "onChange" | keyof import("../interface").BaseProps | keyof import("../interface").FamilyIconProps | keyof import("../interface").LabelIconProps | keyof import("../interface").StartIconProps | keyof import("../interface").EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & import("../interface").BaseProps & import("../interface").FamilyIconProps & import("../interface").LabelIconProps & import("../interface").StartIconProps & import("../interface").EndIconProps & {
2
+ declare const ForwardedDInputSearch: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "onChange">, "size" | "loading" | "label" | "value" | "invalid" | "onChange" | keyof import("../interface").BaseProps | keyof import("../interface").FamilyIconProps | keyof import("../interface").LabelIconProps | keyof import("../interface").StartIconProps | keyof import("../interface").EndIconProps | "hint" | "valid" | "floatingLabel" | "inputStart" | "inputEnd" | "onIconStartClick" | "onIconEndClick"> & import("../interface").BaseProps & import("../interface").FamilyIconProps & import("../interface").LabelIconProps & import("../interface").StartIconProps & import("../interface").EndIconProps & {
3
3
  value?: string | undefined;
4
4
  label?: string | undefined;
5
5
  loading?: boolean | undefined;
@@ -11,8 +11,5 @@ type Props = BaseProps & PropsWithChildren<{
11
11
  setOpen?: (open: boolean) => void;
12
12
  adjustContentToRender?: boolean;
13
13
  }>;
14
- /**
15
- * @deprecated
16
- */
17
14
  export default function DPopover({ children, renderComponent, open, setOpen, adjustContentToRender, className, style, dataAttributes, }: Props): import("react/jsx-runtime").JSX.Element;
18
15
  export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Check if the provided file type should be accepted by the input with accept attribute.
3
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#attr-accept
4
+ *
5
+ * Inspired by https://github.com/enyo/dropzone
6
+ *
7
+ * @param file {File} https://developer.mozilla.org/en-US/docs/Web/API/File
8
+ * @param acceptedFiles {string|string[]}
9
+ * @returns {boolean}
10
+ */
11
+ export default function attrAccept(file: File, acceptedFiles: string | Array<string>): boolean;
@@ -0,0 +1 @@
1
+ export default function getKeyboardFocusableElements(container?: HTMLElement): HTMLElement[];
package/jest/setup.js CHANGED
@@ -14,3 +14,17 @@ jest.mock('react-i18next', () => ({
14
14
  },
15
15
  }),
16
16
  }));
17
+
18
+ global.window = {};
19
+ Object.defineProperty(global.window, 'matchMedia', {
20
+ writable: true,
21
+ value: jest.fn(() => ({
22
+ matches: false,
23
+ onchange: null,
24
+ addListener: jest.fn(),
25
+ removeListener: jest.fn(),
26
+ addEventListener: jest.fn(),
27
+ removeEventListener: jest.fn(),
28
+ dispatchEvent: jest.fn(),
29
+ })),
30
+ });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sideEffects": [
4
4
  "*.css"
5
5
  ],
6
- "version": "1.34.0",
6
+ "version": "1.35.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": {
@@ -47,6 +47,7 @@
47
47
  "build:react": "tsc -p ./tsconfig.build.json && rollup -c rollup.config.mjs",
48
48
  "build:react:watch": "tsc -p ./tsconfig.build.json && rollup -c rollup.config.mjs",
49
49
  "build:scss": "node scripts/build-scss.js",
50
+ "build:scss:watch": "npx nodemon --watch src --ext scss --exec 'npm run build:scss'",
50
51
  "cp": "npm run cp:bootstrap && npm run cp:popper && npm run cp:bootstrap-icons",
51
52
  "cp:bootstrap": "scripts/cp-boostrap.sh",
52
53
  "cp:bootstrap-icons": "scripts/cp-boostrap-icons.sh",
@@ -56,10 +57,10 @@
56
57
  "storybook": "storybook dev -p 6006",
57
58
  "build:storybook": "storybook build --docs -o docs",
58
59
  "eslint": "npm run eslint:src && npm run eslint:stories && npm run eslint:test",
59
- "eslint:src": "eslint src/**/*{.ts,.tsx} --ignore-pattern '**/*.spec.tsx'",
60
+ "eslint:src": "eslint 'src/**/*.ts' 'src/**/*.tsx' --ignore-pattern '**/*.spec.tsx'",
60
61
  "eslint:stories": "eslint stories/**/*.stories.tsx",
61
62
  "eslint:test": "eslint src/**/*.spec.tsx",
62
- "stylelint": "stylelint \"**/*.{css,scss}\" --rd",
63
+ "stylelint": "stylelint '**/*.css' '**/*.scss' --rd",
63
64
  "postversion": "npm run build:scss",
64
65
  "publish:cdn": "npm run publish:cdn-version && npm run publish:cdn-latest",
65
66
  "publish:cdn-version": "node scripts/publish-cdn.js",
@@ -85,15 +86,14 @@
85
86
  "@react-input/mask": "~1.0.20",
86
87
  "@splidejs/react-splide": "~0.7.12",
87
88
  "@splidejs/splide": "~4.1.4",
88
- "@types/react-datepicker": "~4.19.1",
89
89
  "bootstrap": "~5.3.3",
90
90
  "classnames": "~2.3.2",
91
91
  "currency.js": "~2.0.4",
92
92
  "date-fns": "~2.30.0",
93
+ "file-selector": "^2.1.2",
93
94
  "i18next": "~23.6.0",
94
95
  "react-content-loader": "~6.2.1",
95
- "react-datepicker": "~4.21.0",
96
- "react-dropzone": "~14.2.3",
96
+ "react-datepicker": "~8.3.0",
97
97
  "react-responsive-pagination": "^2.9.0",
98
98
  "react-select": "^5.8.3"
99
99
  },
@@ -123,7 +123,6 @@
123
123
  "@types/jest": "~29.5.12",
124
124
  "@types/node": "~18.15.3",
125
125
  "@types/react": "~18.2.31",
126
- "@types/react-datepicker": "~4.19.1",
127
126
  "@types/react-dom": "~18.2.14",
128
127
  "@typescript-eslint/eslint-plugin": "~6.9.0",
129
128
  "@typescript-eslint/parser": "~6.9.0",
@@ -147,25 +146,25 @@
147
146
  "jest-environment-jsdom": "~29.7.0",
148
147
  "lint-staged": "^15.2.10",
149
148
  "postcss-cli": "~10.1.0",
150
- "react": "~18.2.0",
149
+ "react": "~18.3.1",
151
150
  "react-dom": "~18.2.0",
152
- "react-hot-toast": "~2.4.1",
151
+ "react-hot-toast": "~2.5.2",
153
152
  "react-i18next": "~13.3.1",
154
153
  "recharts": "~2.12.7",
155
154
  "rimraf": "~5.0.5",
156
155
  "rollup": "^4.27.4",
157
156
  "sass": "~1.69.4",
158
157
  "storybook": "~8.2.9",
159
- "stylelint": "~15.11.0",
160
- "stylelint-config-twbs-bootstrap": "~11.0.1",
158
+ "stylelint": "^16.16.0",
159
+ "stylelint-config-twbs-bootstrap": "^16.0.0",
161
160
  "ts-jest": "~29.2.3",
162
161
  "tslib": "~2.6.2",
163
162
  "typescript": "~5.2.2"
164
163
  },
165
164
  "peerDependencies": {
166
- "react": "~18.2.0",
165
+ "react": "~18.3.1",
167
166
  "react-dom": "~18.2.0",
168
- "react-hot-toast": "~2.4.1",
167
+ "react-hot-toast": "~2.5.2",
169
168
  "react-i18next": "~13.3.1",
170
169
  "recharts": "~2.12.7"
171
170
  },
@@ -174,4 +173,4 @@
174
173
  "optional": true
175
174
  }
176
175
  }
177
- }
176
+ }
@@ -95,4 +95,5 @@ $input-btn-border-width: var(--#{$prefix}border-width) !default;
95
95
  @import "chips";
96
96
  @import "collapse-icon-text";
97
97
  @import "box-file";
98
+ @import "datepicker"
98
99
  // end custom
@@ -1,16 +1,23 @@
1
1
  $box-file-gap: var(--#{$prefix}ref-spacer-4) !default;
2
+ $box-file-list-gap: var(--#{$prefix}ref-spacer-4) !default;
2
3
  $box-file-background: unset !default;
3
- $box-file-border: 1px dashed var(--#{$prefix}gray-700) !default;
4
- $box-file-border-radius: var(--#{$prefix}border-radius) !default;
4
+ $box-file-border: 1px dashed var(--#{$prefix}gray-100) !default;
5
+ $box-file-border-radius: var(--#{$prefix}ref-spacer-1) !default;
5
6
  $box-file-padding: var(--#{$prefix}ref-spacer-8) !default;
6
7
  $box-file-content-max-width: 220px !default;
7
8
  $box-file-icon-size: var(--#{$prefix}ref-spacer-14) !default;
8
- $box-file-icon-color: var(--#{$prefix}secondary-300) !default;
9
+ $box-file-icon-color: var(--#{$prefix}primary) !default;
10
+ $box-file-list-padding: var(--#{$prefix}ref-spacer-0) !default;
11
+ $box-file-hover-border: 1px dashed var(--#{$prefix}primary-700) !default;
12
+ $box-file-hover-background: var(--#{$prefix}primary-25) !default;
9
13
 
10
- $box-file-hover-border: 1px dashed var(--#{$prefix}secondary-700) !default;
11
- $box-file-hover-background: var(--#{$prefix}secondary-100) !default;
12
-
13
- $box-file-selected-border: 1px dashed var(--#{$prefix}secondary-700) !default;
14
+ $box-file-selected-border: 1px dashed var(--#{$prefix}primary-700) !default;
14
15
  $box-file-selected-background: var(--#{$prefix}white) !default;
15
16
 
16
17
  $box-file-files-color: var(--#{$prefix}gray-500) !default;
18
+
19
+ $box-file-disabled-border: 1px dashed var(--#{$prefix}gray-300) !default;
20
+ $box-file-disabled-background: var(--#{$prefix}gray-100) !default;
21
+
22
+ $box-file-valid-border: 1px dashed var(--#{$prefix}success) !default;
23
+ $box-file-invalid-border: 1px dashed var(--#{$prefix}danger) !default;
@@ -1,7 +1,7 @@
1
1
  // Cards
2
2
 
3
3
  // scss-docs-start card-variables
4
- $card-border-width: 0px !default; // stylelint-disable-line length-zero-no-unit
4
+ $card-border-width: 0px !default;
5
5
  $card-box-shadow: var(--#{$prefix}box-shadow-sm) !default;
6
6
  $card-bg: var(--#{$prefix}white) !default;
7
7
  $card-spacer-y: $spacer-6 !default;
@@ -0,0 +1,50 @@
1
+ // Datepicker
2
+ // scss-docs-start datepicker-variables
3
+ $datepicker-bg: var(--#{$prefix}white) !default;
4
+ $datepicker-border-color: var(--#{$prefix}gray-400) !default;
5
+ $datepicker-border-radius: var(--#{$prefix}border-radius-sm) !default;
6
+ $datepicker-day-border-radius: .25rem !default;
7
+ // Header
8
+ $datepicker-header-bg: var(--#{$prefix}gray-100) !default;
9
+ $datepicker-header-padding: var(--#{$prefix}ref-spacer-2) 0 !default;
10
+ $datepicker-header-font-weight: var(--#{$prefix}fw-bold) !default;
11
+ $datepicker-day-names-color: var(--#{$prefix}body-color) !default;
12
+ $datepicker-day-names-font-size: var(--#{$prefix}fs-small) !default;
13
+
14
+ // Body
15
+ $datepicker-body-margin: var(--#{$prefix}ref-spacer-2) !default;
16
+ $datepicker-body-gap: var(--#{$prefix}ref-spacer-2) !default;
17
+
18
+ // Day
19
+ $datepicker-day-outside-month-color: var(--#{$prefix}gray-700) !default;
20
+ $datepicker-day-bg: var(--#{$prefix}secondary) !default;
21
+ $datepicker-day-hover-bg: var(--#{$prefix}gray-100) !default;
22
+ $datepicker-day-width: var(--#{$prefix}ref-spacer-7) !default;
23
+
24
+ // Day selected
25
+ $datepicker-day-selected-color: var(--#{$prefix}white) !default;
26
+ $datepicker-day-selected-bg: var(--#{$prefix}secondary) !default;
27
+
28
+ // Day Disabled
29
+ $datepicker-day-disabled-color: var(--#{$prefix}gray-400) !default;
30
+
31
+ // Week
32
+ $datepicker-week-number-bg: var(--#{$prefix}white) !default;
33
+ $datepicker-week-number-hover-bg: $datepicker-day-hover-bg !default;
34
+ $datepicker-week-number-hover-color: var(--#{$prefix}body-color) !default;
35
+ $datepicker-week-number-border-radius: .25rem !default;
36
+
37
+ // Range
38
+ $datepicker-range-start-color: var(--#{$prefix}white) !default;
39
+ $datepicker-range-start-bg: var(--#{$prefix}secondary-600) !default;
40
+ $datepicker-range-end-color: var(--#{$prefix}white) !default;
41
+ $datepicker-range-end-bg: var(--#{$prefix}secondary-600) !default;
42
+ $datepicker-in-range-bg: var(--#{$prefix}secondary-200) !default;
43
+ $datepicker-range-color: var(--#{$prefix}body-color) !default;
44
+ $datepicker-in-range-hover-bg: var(--#{$prefix}secondary-400) !default;
45
+ $datepicker-in-range-disabled-color: var(--#{$prefix}secondary-300) !default;
46
+ $datepicker-in-range-disabled-bg: var(--#{$prefix}gray-300) !default;
47
+
48
+ // Portal
49
+ $datepicker-portal-bg: rgba(var(--#{$prefix}black-rgb), .3) !default;
50
+ // scss-docs-start breadcrumb-variables
@@ -61,12 +61,13 @@ $form-switch-width: 2em !default;
61
61
  $form-switch-padding-start: $form-switch-width !default;
62
62
  $form-switch-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='#{$gray-300}'/></svg>") !default;
63
63
  $form-switch-focus-color: $component-focus-border-color !default;
64
+ $form-switch-border-radius: $form-switch-width !default;
64
65
  $form-switch-focus-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='#{$secondary-300}'/></svg>") !default;
65
66
 
66
- // custom
67
+ // custom form-switch-variables
67
68
  $form-switch-valid-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='#{$success}'/></svg>") !default;
68
69
  $form-switch-invalid-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='#{$danger}'/></svg>") !default;
69
- // end custom
70
+ // end custom form-switch-variables
70
71
 
71
72
  $form-switch-checked-color: var(--#{$prefix}white) !default;
72
73
  $form-switch-checked-bg-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='#{$white}'/></svg>") !default;
@@ -78,13 +79,15 @@ $input-group-addon-border-color: transparent !default;
78
79
  // scss-docs-end input-group-variables
79
80
 
80
81
  // custom
82
+ $input-group-sm-icon-size: $spacer-4 !default;
83
+ $input-group-lg-icon-size: $spacer-7 !default;
81
84
  $form-text-padding-y: 0 !default;
82
85
  $form-text-padding-x: 0 !default;
83
86
  // end custom
84
87
 
85
88
  // scss-docs-start form-select-variables
86
89
  $form-select-disabled-color: $input-disabled-color !default;
87
- $form-select-bg-size: 24px !default; // In pixels because image dimensions
90
+ $form-select-bg-size: 16px !default; // In pixels because image dimensions
88
91
  $form-select-bg-opacity: 0 !default;
89
92
  $form-select-indicator-color: var(--#{$prefix}gray-500) !default;
90
93
  $form-select-indicator: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='#{$gray-500}' stroke-linecap='round' stroke-linejoin='round' stroke-width='1' d='m2 5 6 6 6-6'/></svg>") !default;
@@ -1,9 +1,30 @@
1
1
  .form-switch {
2
+ --#{$prefix}form-switch-width: #{$form-switch-width};
3
+ --#{$prefix}form-switch-padding-start: #{$form-switch-padding-start} * -1;
4
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image)};
5
+ --#{$prefix}form-switch-border-radius: #{$form-switch-border-radius};
6
+ --#{$prefix}form-switch-focus-bg-image: #{escape-svg($form-switch-focus-bg-image)};
7
+ --#{$prefix}form-switch-checked-bg-image: #{escape-svg($form-switch-checked-bg-image)};
8
+
9
+ .form-check-input {
10
+ width: var(--#{$prefix}form-switch-width);
11
+ margin-left: var(--#{$prefix}form-switch-padding-start);
12
+ border-radius: var(--#{$prefix}form-switch-border-radius);
13
+
14
+ &:focus {
15
+ --#{$prefix}form-switch-bg: var(--#{$prefix}form-switch-focus-bg-image);
16
+ }
17
+
18
+ &:checked {
19
+ --#{$prefix}form-switch-bg: var(--#{$prefix}form-switch-checked-bg-image);
20
+ }
21
+ }
22
+
2
23
  .form-check-input.is-valid:not(:checked) {
3
- --bs-form-switch-bg: #{escape-svg($form-switch-valid-bg-image)};
24
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-valid-bg-image)};
4
25
  }
5
26
 
6
27
  .form-check-input.is-invalid:not(:checked) {
7
- --bs-form-switch-bg: #{escape-svg($form-switch-invalid-bg-image)};
28
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-invalid-bg-image)};
8
29
  }
9
30
  }
@@ -35,6 +35,10 @@
35
35
  .input-group > .form-floating:not(:first-child) .form-select,
36
36
  .input-group > .form-floating:not(:first-child) .form-control {
37
37
  padding-left: 0;
38
+
39
+ ~label {
40
+ padding-left: 0;
41
+ }
38
42
  }
39
43
 
40
44
  .input-group > .form-floating:not(:last-child) .form-select {
@@ -62,6 +66,18 @@
62
66
  --#{$prefix}input-disabled-bg: #{$input-disabled-bg};
63
67
  --#{$prefix}input-disabled-color: #{$input-disabled-color};
64
68
 
69
+ // input group icon sizes
70
+ --#{$prefix}input-group-sm-icon-size: #{$input-group-sm-icon-size};
71
+ --#{$prefix}input-group-lg-icon-size: #{$input-group-lg-icon-size};
72
+
73
+ &.input-group-sm .d-icon {
74
+ --#{$prefix}icon-component-size: var(--#{$prefix}input-group-sm-icon-size);
75
+ }
76
+
77
+ &.input-group-lg .d-icon {
78
+ --#{$prefix}icon-component-size: var(--#{$prefix}input-group-lg-icon-size);
79
+ }
80
+
65
81
  border: var(--#{$prefix}input-border-width) solid var(--#{$prefix}input-border-color);
66
82
  @include border-radius(var(--#{$prefix}input-border-radius), 0);
67
83
 
@@ -73,6 +89,7 @@
73
89
  // validation states
74
90
  @each $state, $data in $form-validation-states {
75
91
  $border-color: map-get($data, "border-color");
92
+ $color: map-get($data, "color");
76
93
  $tooltip-bg-color: map-get($data, "tooltip-bg-color");
77
94
  $box-shadow: map-get($data, "focus-box-shadow");
78
95
 
@@ -84,7 +101,7 @@
84
101
  }
85
102
 
86
103
  ~ .form-text {
87
- color: $border-color;
104
+ color: $color;
88
105
  }
89
106
 
90
107
  .input-group-validation-icon {
@@ -19,7 +19,6 @@
19
19
  .nav-pills,
20
20
  .nav-underline {
21
21
  gap: var(--#{$prefix}nav-tabs-nav-gap);
22
- padding: var(--#{$prefix}nav-link-padding-y) var(--#{$prefix}nav-link-padding-x);
23
22
 
24
23
  &.flex-column {
25
24
  flex: 1 0 auto;
@@ -1,5 +1,6 @@
1
1
  .toast {
2
2
  --#{$prefix}toast-header-gap: var(--#{$prefix}ref-spacer-2);
3
+ --#{$prefix}toast-body-gap: var(--#{$prefix}ref-spacer-2);
3
4
  --#{$prefix}toast-color: var(--#{$prefix}gray-900);
4
5
  --#{$prefix}toast-close-color: var(--#{$prefix}gray-900);
5
6
  --#{$prefix}toast-header-color: var(--#{$prefix}gray-900);
@@ -15,6 +16,7 @@
15
16
 
16
17
  .toast-body {
17
18
  display: flex;
19
+ gap: var(--#{$prefix}toast-body-gap);
18
20
  align-items: center;
19
21
  justify-content: space-between;
20
22
  }
@@ -14,9 +14,12 @@
14
14
  --#{$prefix}box-file-selected-border: #{$box-file-selected-border};
15
15
  --#{$prefix}box-file-selected-bg: #{$box-file-selected-background};
16
16
 
17
- display: flex;
18
- flex-direction: column;
19
- gap: var(--#{$prefix}box-file-gap);
17
+ --#{$prefix}box-file-disabled-border: #{$box-file-disabled-border};
18
+ --#{$prefix}box-file-disabled-bg: #{$box-file-disabled-background};
19
+
20
+ --#{$prefix}box-file-valid-border: #{$box-file-valid-border};
21
+ --#{$prefix}box-file-invalid-border: #{$box-file-invalid-border};
22
+
20
23
  width: 100%;
21
24
  cursor: pointer;
22
25
  background: var(--#{$prefix}box-file-bg);
@@ -33,6 +36,20 @@
33
36
  border: var(--#{$prefix}box-file-selected-border);
34
37
  }
35
38
 
39
+ &.d-box-file-valid {
40
+ border: var(--#{$prefix}box-file-valid-border);
41
+ }
42
+
43
+ &.d-box-file-invalid {
44
+ border: var(--#{$prefix}box-file-invalid-border);
45
+ }
46
+
47
+ &.d-box-file-disabled {
48
+ cursor: default;
49
+ background: var(--#{$prefix}box-file-disabled-bg);
50
+ border: var(--#{$prefix}box-file-disabled-border);
51
+ }
52
+
36
53
  .d-icon {
37
54
  --#{$prefix}icon-size: var(--#{$prefix}box-file-icon-size);
38
55
  --#{$prefix}icon-color: var(--#{$prefix}box-file-icon-color);
@@ -45,24 +62,23 @@
45
62
  align-items: center;
46
63
  width: 100%;
47
64
  padding: var(--#{$prefix}box-file-padding);
48
-
49
- &:not(:last-child) {
50
- padding-bottom: 0;
51
- }
52
65
  }
53
66
 
54
67
  .d-box-content {
55
68
  max-width: var(--#{$prefix}box-file-content-max-width);
56
69
  }
70
+ }
57
71
 
58
- .d-box-files {
59
- display: flex;
60
- flex-direction: column;
61
- gap: var(--#{$prefix}box-file-gap);
62
- padding: 0 var(--#{$prefix}box-file-padding) var(--#{$prefix}box-file-padding);
63
- }
72
+ .d-box-files {
73
+ --#{$prefix}box-file-list-gap: #{$box-file-list-gap};
74
+ --#{$prefix}box-file-list-padding: #{$box-file-list-padding};
75
+ display: flex;
76
+ flex-direction: column;
77
+ gap: var(--#{$prefix}box-file-list-gap);
78
+ padding: var(--#{$prefix}box-file-list-padding);
64
79
 
65
- .d-box-files-text {
66
- word-break: break-word;
80
+ .input-group:focus-within {
81
+ --#{$prefix}input-focus-border-color: var(--#{$prefix}gray-100);
82
+ --#{$prefix}input-focus-box-shadow: none;
67
83
  }
68
84
  }