@dynamic-framework/ui-react 1.28.1 → 1.29.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.
@@ -1,20 +1,18 @@
1
1
  import type { PropsWithChildren } from 'react';
2
- import type { AlertType, BaseProps } from '../interface';
2
+ import type { AlertTheme, BaseProps } from '../interface';
3
3
  type Props = BaseProps & PropsWithChildren<{
4
4
  id?: string;
5
- type?: AlertType;
5
+ theme?: AlertTheme;
6
6
  icon?: string;
7
7
  iconFamilyClass?: string;
8
8
  iconFamilyPrefix?: string;
9
9
  iconMaterialStyle?: boolean;
10
- showIcon?: boolean;
11
10
  showClose?: boolean;
12
11
  iconClose?: string;
13
12
  iconCloseFamilyClass?: string;
14
13
  iconCloseFamilyPrefix?: string;
15
14
  iconCloseMaterialStyle?: boolean;
16
- soft?: boolean;
17
15
  onClose?: () => void;
18
16
  }>;
19
- export default function DAlert({ type, icon: iconProp, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, iconClose: iconCloseProp, iconCloseFamilyClass, iconCloseFamilyPrefix, iconCloseMaterialStyle, showIcon, soft, showClose, onClose, children, id, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
17
+ export default function DAlert({ theme, icon: iconProp, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, iconClose: iconCloseProp, iconCloseFamilyClass, iconCloseFamilyPrefix, iconCloseMaterialStyle, showClose, onClose, children, id, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
20
18
  export {};
@@ -1,10 +1,15 @@
1
1
  import type { BaseProps } from '../interface';
2
2
  type Props = BaseProps & {
3
3
  text?: string;
4
- dot?: boolean;
5
4
  soft?: boolean;
5
+ rounded?: boolean;
6
6
  theme?: string;
7
7
  id?: string;
8
+ iconStart?: string;
9
+ iconEnd?: string;
10
+ iconMaterialStyle?: boolean;
11
+ iconFamilyClass?: string;
12
+ iconFamilyPrefix?: string;
8
13
  };
9
- export default function DBadge({ text, dot, soft, theme, id, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
14
+ export default function DBadge({ text, soft, theme, id, rounded, className, style, iconStart, iconEnd, iconMaterialStyle, iconFamilyClass, iconFamilyPrefix, }: Props): import("react/jsx-runtime").JSX.Element;
10
15
  export {};
@@ -50,9 +50,9 @@ export type StateIcons = {
50
50
  invalidIcon?: string;
51
51
  validIcon?: string;
52
52
  };
53
- export type AlertType = 'success' | 'info' | 'warning' | 'danger' | 'light' | 'dark' | 'primary' | 'secondary';
54
- export type AlertTypeIconMap = {
55
- [state in AlertType]: string;
53
+ export type AlertTheme = 'success' | 'info' | 'warning' | 'danger' | 'primary' | 'secondary';
54
+ export type AlertThemeIconMap = {
55
+ [state in AlertTheme]: string;
56
56
  };
57
57
  export type ButtonVariant = 'outline' | 'link';
58
58
  export type ButtonType = 'submit' | 'reset' | 'button';
@@ -1,6 +1,6 @@
1
1
  import type { PropsWithChildren } from 'react';
2
2
  import { PortalContextProps } from './DPortalContext';
3
- import type { AlertTypeIconMap } from '../components/interface';
3
+ import type { AlertThemeIconMap } from '../components/interface';
4
4
  export type CurrencyProps = {
5
5
  symbol: string;
6
6
  precision: number;
@@ -19,7 +19,7 @@ type IconMapProps = {
19
19
  chevronUp: string;
20
20
  chevronLeft: string;
21
21
  chevronRight: string;
22
- alert: AlertTypeIconMap;
22
+ alert: AlertThemeIconMap;
23
23
  upload: string;
24
24
  calendar: string;
25
25
  check: string;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sideEffects": [
4
4
  "*.css"
5
5
  ],
6
- "version": "1.28.1",
6
+ "version": "1.29.0",
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": {
@@ -157,5 +157,5 @@
157
157
  "optional": true
158
158
  }
159
159
  },
160
- "gitHead": "a3946a6a0d9769690a19880242ccadcec5dc7960"
160
+ "gitHead": "cf832f6d5da30a387a87354ffb60c2173e3804ea"
161
161
  }
@@ -1,9 +1,5 @@
1
1
  // Alerts
2
- //
3
- // Define alert colors, border radius, and padding.
4
-
5
2
  // scss-docs-start alert-variables
6
- $alert-padding-x: $spacer-6 !default;
7
3
  $alert-border-radius: var(--#{$prefix}border-radius-sm) !default;
8
4
  $alert-link-font-weight: var(--#{$prefix}fw-bold) !default;
9
5
  // scss-docs-end alert-variables
@@ -16,7 +12,6 @@ $alert-color-scale: 100% !default;
16
12
 
17
13
  // custom
18
14
  $alert-gap: var(--#{$prefix}ref-spacer-4) !default;
19
- $alert-box-shadow: var(--#{$prefix}box-shadow-sm) !default;
20
- $alert-close-icon-size: var(--#{$prefix}ref-spacer-3) !default;
15
+ $alert-close-icon-size: var(--#{$prefix}ref-spacer-4) !default;
21
16
  // end custom
22
17
  // scss-docs-end alert-variables
@@ -10,6 +10,6 @@ $badge-border-radius: var(--#{$prefix}border-radius-sm) !default;
10
10
 
11
11
  // custom
12
12
  $badge-bg: var(--#{$prefix}white) !default;
13
- $badge-dot-height: var(--#{$prefix}ref-spacer-4) !default;
13
+ $badge-gap: var(--#{$prefix}ref-spacer-2) !default;
14
14
  // end custom
15
15
  // scss-docs-end badge-variables
@@ -3,7 +3,7 @@
3
3
  // Define common padding and border radius sizes and more.
4
4
 
5
5
  // scss-docs-start border-variables
6
- $border-color: var(--#{$prefix}gray-300) !default;
6
+ $border-color: var(--#{$prefix}gray-100) !default;
7
7
  $border-color-translucent: rgba(var(--#{$prefix}black-rgb), .175) !default;
8
8
  // scss-docs-end border-variables
9
9
 
@@ -20,6 +20,22 @@ $spacer-11: $spacer * 2.75 !default; // 44px
20
20
  $spacer-12: $spacer * 3 !default; // 48px
21
21
  $spacer-13: $spacer * 3.25 !default; // 52px
22
22
  $spacer-14: $spacer * 3.5 !default; // 56px
23
+ $spacer-15: $spacer * 3.75 !default; // 60px
24
+ $spacer-16: $spacer * 4 !default; // 64px
25
+ $spacer-17: $spacer * 4.25 !default; // 68px
26
+ $spacer-18: $spacer * 4.5 !default; // 72px
27
+ $spacer-19: $spacer * 4.75 !default; // 76px
28
+ $spacer-20: $spacer * 5 !default; // 80px
29
+ $spacer-21: $spacer * 5.25 !default; // 84px
30
+ $spacer-22: $spacer * 5.5 !default; // 88px
31
+ $spacer-23: $spacer * 5.75 !default; // 92px
32
+ $spacer-24: $spacer * 6 !default; // 96px
33
+ $spacer-25: $spacer * 6.25 !default; // 100px
34
+ $spacer-26: $spacer * 6.5 !default; // 104px
35
+ $spacer-27: $spacer * 6.75 !default; // 108px
36
+ $spacer-28: $spacer * 7 !default; // 112px
37
+ $spacer-29: $spacer * 7.25 !default; // 116px
38
+ $spacer-30: $spacer * 7.5 !default; // 120px
23
39
  $spacers: (
24
40
  0: 0,
25
41
  1: $spacer-1,
@@ -36,5 +52,21 @@ $spacers: (
36
52
  12: $spacer-12,
37
53
  13: $spacer-13,
38
54
  14: $spacer-14,
55
+ 15: $spacer-15,
56
+ 16: $spacer-16,
57
+ 17: $spacer-17,
58
+ 18: $spacer-18,
59
+ 19: $spacer-19,
60
+ 20: $spacer-20,
61
+ 21: $spacer-21,
62
+ 22: $spacer-22,
63
+ 23: $spacer-23,
64
+ 24: $spacer-24,
65
+ 25: $spacer-25,
66
+ 26: $spacer-26,
67
+ 27: $spacer-27,
68
+ 28: $spacer-28,
69
+ 29: $spacer-29,
70
+ 30: $spacer-30,
39
71
  ) !default;
40
72
  // scss-docs-end spacer-variables-maps
@@ -36,6 +36,7 @@
36
36
 
37
37
  @import "type";
38
38
  @import "body";
39
+ @import "badge";
39
40
  @import "accordion";
40
41
  @import "form-switch";
41
42
  @import "form-check";
@@ -1,66 +1,31 @@
1
1
  .alert {
2
2
  --#{$prefix}alert-gap: #{$alert-gap};
3
- --#{$prefix}alert-box-shadow: #{$alert-box-shadow};
4
- --#{$prefix}alert-icon-color: var(--#{$prefix}alert-color);
5
- --#{$prefix}alert-separator-opacity: var(--#{$prefix}alert-component-separator-opacity);
6
3
  --#{$prefix}alert-close-icon-size: #{$alert-close-icon-size};
4
+ --#{$prefix}alert-icon-size: var(--#{$prefix}ref-spacer-5);
7
5
 
8
6
  display: flex;
9
7
  flex-direction: row;
10
8
  gap: var(--#{$prefix}alert-gap);
11
- align-items: center;
12
- box-shadow: var(--#{$prefix}alert-box-shadow);
9
+ align-items: flex-start;
13
10
 
14
11
  .alert-text {
15
12
  flex-grow: 1;
16
13
  }
17
14
 
18
- .alert-separator {
19
- align-self: stretch;
20
- width: 1px;
21
- background-color: var(--#{$prefix}alert-icon-color);
22
- opacity: var(--#{$prefix}alert-separator-opacity);
23
- }
24
-
25
- .btn-close {
26
- --#{$prefix}btn-close-bg: transparent;
27
- }
28
-
29
- .alert-icon.d-icon {
15
+ .alert-icon {
16
+ --#{$prefix}icon-size: var(--#{$prefix}alert-icon-size);
30
17
  --#{$prefix}icon-color: var(--#{$prefix}alert-icon-color);
31
18
  }
32
19
 
33
- .alert-close-icon {
34
- --#{$prefix}icon-color: var(--#{$prefix}alert-icon-color);
35
- --#{$prefix}icon-size: var(--#{$prefix}alert-close-icon-size);
36
- }
37
-
38
- @each $theme, $value in $theme-colors {
20
+ @each $theme, $value in map-remove($theme-colors, "light", "dark") {
39
21
  $color: color-contrast-var($value);
40
22
  &.alert-#{$theme} {
41
- --#{$prefix}alert-color: #{$color};
42
- --#{$prefix}alert-bg: var(--#{$prefix}#{$theme});
43
- --#{$prefix}alert-border-color: var(--#{$prefix}#{$theme});
44
- --#{$prefix}alert-link-color: #{$color};
45
- }
46
- }
47
-
48
- &.alert-soft {
49
- --#{$prefix}alert-color: var(--#{$prefix}gray-900);
50
- --#{$prefix}alert-border: 0;
51
-
52
- @each $theme, $value in map-remove($theme-colors, "light", "dark") {
53
- &.alert-#{$theme} {
54
- --#{$prefix}alert-icon-color: var(--#{$prefix}#{$theme}-500);
23
+ --#{$prefix}alert-icon-color: var(--#{$prefix}#{$theme}-500);
24
+ --#{$prefix}alert-color: var(--#{$prefix}body-color);
55
25
 
56
- --#{$prefix}alert-bg: var(--#{$prefix}#{$theme}-100);
57
- }
58
- }
59
-
60
- &.alert-light {
61
- --#{$prefix}alert-icon-color: var(--#{$prefix}secondary-500);
62
- --#{$prefix}alert-border-color: var(--#{$prefix}secondary-500);
63
- --#{$prefix}alert-bg: var(--#{$prefix}white);
26
+ --#{$prefix}alert-bg: var(--#{$prefix}surface-#{$theme});
27
+ --#{$prefix}alert-border-color: var(--#{$prefix}surface-#{$theme});
28
+ --#{$prefix}alert-link-color: #{$color};
64
29
  }
65
30
  }
66
31
  }
@@ -0,0 +1,49 @@
1
+ .badge {
2
+ --#{$prefix}badge-gap: #{$badge-gap};
3
+ --#{$prefix}badge-icon-size: #{$badge-font-size};
4
+ --#{$prefix}badge-bg: #{$badge-bg};
5
+ --#{$prefix}badge-color: #{$badge-color};
6
+
7
+ display: flex;
8
+ gap: var(--#{$prefix}badge-gap);
9
+ color: var(--#{$prefix}badge-color);
10
+
11
+ background-color: var(--#{$prefix}badge-bg);
12
+
13
+ .d-icon {
14
+ --#{$prefix}icon-size: var(--#{$prefix}badge-icon-size);
15
+ }
16
+
17
+ @each $theme, $value in map-remove($theme-colors, "light") {
18
+ $color: color-contrast-var($value);
19
+
20
+ &.badge-#{$theme} {
21
+ --#{$prefix}badge-bg: var(--#{$prefix}#{$theme});
22
+ --#{$prefix}badge-color: #{$color};
23
+ }
24
+ }
25
+
26
+ &.badge-light {
27
+ --#{$prefix}badge-bg: var(--#{$prefix}gray-200);
28
+ --#{$prefix}badge-color: var(--#{$prefix}gray-900);
29
+ }
30
+
31
+ @each $theme, $value in map-remove($theme-colors, "light", "dark") {
32
+ $color: color-contrast-var($value);
33
+
34
+ &.badge-soft-#{$theme} {
35
+ --#{$prefix}badge-bg: var(--#{$prefix}surface-#{$theme});
36
+ --#{$prefix}badge-color: var(--#{$prefix}body-color);
37
+ }
38
+ }
39
+
40
+ &.badge-soft-light {
41
+ --#{$prefix}badge-bg: var(--#{$prefix}gray-700);
42
+ --#{$prefix}badge-color: var(--#{$prefix}white);
43
+ }
44
+
45
+ &.badge-soft-dark {
46
+ --#{$prefix}badge-bg: var(--#{$prefix}gray-100);
47
+ --#{$prefix}badge-color: var(--#{$prefix}body-color);
48
+ }
49
+ }
@@ -37,20 +37,15 @@
37
37
  color: var(--#{$prefix}toast-close-color);
38
38
  }
39
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
40
 
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
- }
41
+ &.toast-soft-#{$theme} {
42
+ --#{$prefix}toast-color: var(--#{$prefix}gray-900);
43
+ --#{$prefix}toast-close-color: var(--#{$prefix}gray-900);
44
+ --#{$prefix}toast-header-color: var(--#{$prefix}gray-900);
45
+ --#{$prefix}toast-icon-color: var(--#{$prefix}#{$theme}-500);
46
+ --#{$prefix}toast-border-color: var(--#{$prefix}#{$theme}-100);
47
+ --#{$prefix}toast-bg: var(--#{$prefix}#{$theme}-100);
48
+ --#{$prefix}toast-header-bg: var(--#{$prefix}#{$theme}-100);
54
49
  }
55
50
  }
56
51
  }
@@ -1,6 +1,5 @@
1
1
  .d-close {
2
2
  display: flex;
3
- align-self: center;
4
3
  padding: 0;
5
4
  background: transparent;
6
5
  border: 0;