@dashadmin/dash-info 1.3.16 → 1.3.19

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.
@@ -0,0 +1 @@
1
+ import{Fragment as e,jsx as a,jsxs as n}from"react/jsx-runtime";import{Box as T,Button as f,DialogActions as w,DialogContent as $,DialogTitle as y,Paper as P}from"@mui/material";import{useState as b}from"react";import E from"@mui/icons-material/Info";import M from"@mui/icons-material/CheckCircle";import O from"@mui/icons-material/Dangerous";import{useTranslate as R}from"react-admin";import"./styles/info.less";const k=i=>{const{children:o,variant:t}=i;switch(t){case"success":return n(e,{children:[a("div",{className:`dash-modal-img dash-modal-img-${t}`,children:a(M,{})}),o&&a("div",{className:"dash-modal-title",children:o})]});case"danger":return n(e,{children:[a("div",{className:`dash-modal-img dash-modal-img-${t}`,children:a(O,{})}),o&&a("div",{className:"dash-modal-title",children:o})]});case"info":case"default":return n(e,{children:[a("div",{className:`dash-modal-img dash-modal-img-${t}`,children:a(E,{})}),o&&a("div",{className:"dash-modal-title",children:o})]});default:return o?a("div",{className:"dash-modal-title",children:o}):a(e,{})}},A=i=>{const o=R(),{variant:t="default",onCancel:s,onConfirm:l,cancelText:c=o("dash.action.cancel"),confirmText:h=o("dash.action.continue"),closeText:F=null,title:u,content:v=null,className:d,showCancelButton:r=!1,showConfirmButton:p=!1,dialogActions:C,fullscreen:m=!1,children:g,...I}=i,N=typeof r=="boolean"?r:!!c,[H,S]=b(open),x=D=>{s&&s()},B=D=>{l&&l()};return n(T,{component:m?"div":P,...I,className:`dash-modal ${d?d+" ":""}${m?"fullscreen ":""}dash-modal-${t}`,children:[a(y,{id:"alert-dialog-title",children:a(k,{variant:t})}),n($,{children:[a("div",{className:"dash-modal-title",children:a("h3",{children:u})}),g||v]}),n(w,{children:[C||a(e,{}),N?a(f,{variant:"contained",className:"btn-width-md",color:"primary",onClick:x,children:c}):a(e,{}),p===!0?a(f,{variant:"contained",className:"btn-width-md",color:"primary",onClick:B,autoFocus:!0,children:h}):a(e,{})]})]})};var Y=A;export{Y as default};
File without changes
@@ -0,0 +1,194 @@
1
+
2
+
3
+ .dash-modal {
4
+ // Shared defaults if needed
5
+ font-family: 'Montserrat';
6
+
7
+ &-default {
8
+ background: var(--module-bg);
9
+ box-shadow: var(--component-shadow);
10
+
11
+ &.MuiPaper-root {
12
+ background: var(--module-bg);
13
+ }
14
+
15
+ > .MuiTypography-root.MuiDialogTitle-root {
16
+ font-family: 'Montserrat';
17
+ font-style: normal;
18
+ font-weight: 700;
19
+ font-size: 16px;
20
+ line-height: 24px;
21
+ color: var(--heading-color);
22
+ padding: 16px 24px;
23
+
24
+ .dash-modal-img {
25
+ display: flex;
26
+ align-items: center;
27
+ margin-right: 8px;
28
+ svg {
29
+ font-size: 20px;
30
+ }
31
+ }
32
+ }
33
+
34
+ > .MuiDialogContent-root {
35
+ padding: 24px;
36
+ border: 1px solid var(--component-border-split);
37
+ border-left: unset;
38
+ border-right: unset;
39
+
40
+ font-family: 'Montserrat';
41
+ font-style: normal;
42
+ font-weight: 400;
43
+ font-size: 14px;
44
+ line-height: 22px;
45
+ color: var(--text-color);
46
+ }
47
+
48
+ > .MuiDialogActions-root {
49
+ padding: 10px 16px;
50
+ }
51
+
52
+ // Fullscreen Override
53
+ &.fullscreen {
54
+ background: none;
55
+ box-shadow: none;
56
+
57
+ &.MuiPaper-root {
58
+ background: none;
59
+ }
60
+
61
+ > .MuiDialogContent-root {
62
+ border: none;
63
+ }
64
+ }
65
+ }
66
+
67
+ &-info, &-success, &-danger {
68
+ padding-top: 39px !important;
69
+ background: transparent !important;
70
+ box-shadow: unset !important;
71
+ overflow: visible !important;
72
+
73
+ &.MuiPaper-root {
74
+ background: transparent !important;
75
+ box-shadow: none !important;
76
+ overflow: visible !important;
77
+ }
78
+
79
+ > .MuiTypography-root.MuiDialogTitle-root {
80
+ //height: 115px;
81
+ border-radius: 8px;
82
+ padding: 0 0 30px;
83
+ overflow: visible;
84
+
85
+ .dash-modal-img {
86
+ position: relative;
87
+ width: 140px;
88
+ height: 120px;
89
+ margin: -40px auto 0;
90
+ display: flex;
91
+ justify-content: center;
92
+ align-items: center;
93
+
94
+ svg {
95
+ width: 100%;
96
+ height: 100%;
97
+ object-fit: contain;
98
+ * {
99
+ pointer-events: none;
100
+ }
101
+ }
102
+ }
103
+ }
104
+
105
+ > .MuiDialogContent-root {
106
+ margin-top: -20px;
107
+ padding: 42px 32px 0; // Increased top padding to push content down from title area
108
+ border: unset;
109
+ background: var(--component-bg);
110
+ border-top-left-radius: 8px;
111
+ border-top-right-radius: 8px;
112
+ position: relative;
113
+ z-index: 1;
114
+
115
+ .dash-modal-title {
116
+ margin-bottom: 16px;
117
+ h3 {
118
+ font-family: 'Montserrat';
119
+ font-style: normal;
120
+ font-weight: 700;
121
+ font-size: 20px;
122
+ line-height: 24px;
123
+ text-align: center;
124
+ color: var(--heading-color);
125
+ margin: 0;
126
+ }
127
+ }
128
+
129
+ font-family: 'Montserrat';
130
+ font-style: normal;
131
+ font-weight: 400;
132
+ font-size: 16px;
133
+ line-height: 24px;
134
+ text-align: center;
135
+ color: var(--text-color);
136
+ }
137
+
138
+ > .MuiDialogActions-root {
139
+ padding: 16px;
140
+ background: var(--component-bg);
141
+ border-bottom-left-radius: 8px;
142
+ border-bottom-right-radius: 8px;
143
+ justify-content: center;
144
+ }
145
+
146
+ // Shared Fullscreen Overrides
147
+ &.fullscreen {
148
+ &.MuiPaper-root {
149
+ background: none !important;
150
+ }
151
+ > .MuiTypography-root.MuiDialogTitle-root {
152
+ background: none !important; // Override the gradient/color set in specific variants
153
+ }
154
+ > .MuiDialogContent-root {
155
+ background: none;
156
+ border: none;
157
+ }
158
+ > .MuiDialogActions-root {
159
+ background: none;
160
+ }
161
+ }
162
+ }
163
+
164
+ &-info {
165
+ > .MuiTypography-root.MuiDialogTitle-root {
166
+ background: linear-gradient(93.81deg, var(--primary-color) 2.98%, var(--primary-contrast) 102.49%);
167
+ .dash-modal-img svg {
168
+ fill: var(--alert-info-bg);
169
+ }
170
+ }
171
+ }
172
+
173
+ &-success {
174
+ > .MuiTypography-root.MuiDialogTitle-root {
175
+ background: var(--btn-success-bg);
176
+ .dash-modal-img svg {
177
+ fill: var(--alert-success-bg);
178
+ }
179
+ }
180
+ }
181
+
182
+ &-danger {
183
+ > .MuiTypography-root.MuiDialogTitle-root {
184
+ background: var(--btn-danger-bg);
185
+ .dash-modal-img svg {
186
+ fill: var(--alert-error-bg); // or var(--highlight-color) if needed
187
+ path {
188
+ fill: var(--alert-error-bg);
189
+ }
190
+ }
191
+ }
192
+ }
193
+ }
194
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashadmin/dash-info",
3
- "version": "1.3.16",
3
+ "version": "1.3.19",
4
4
  "private": false,
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -11,7 +11,7 @@
11
11
  "lint:fix": "pnpm prettier --write .",
12
12
  "check-updates": "pnpm npm-check-updates",
13
13
  "updates-packages": "pnpm npm-check-updates -u",
14
- "build": "vite build"
14
+ "build": "rm -rf dist && node ../dash-build/compile.mjs && vite build"
15
15
  },
16
16
  "browserslist": {
17
17
  "production": [
@@ -112,10 +112,21 @@
112
112
  "exports": {
113
113
  ".": {
114
114
  "import": "./dist/index.js"
115
+ },
116
+ "./src/*": {
117
+ "import": "./dist/*.js"
115
118
  }
116
119
  }
117
120
  },
118
121
  "files": [
119
122
  "dist"
120
- ]
123
+ ],
124
+ "exports": {
125
+ ".": {
126
+ "import": "./src/index.ts"
127
+ },
128
+ "./src/*": {
129
+ "import": "./src/*"
130
+ }
131
+ }
121
132
  }