@qfei-design/make-app-approval 0.2.16 → 0.2.17
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.
- package/PUBLIC_API.md +47 -0
- package/README.md +2 -0
- package/dist/detail/instance-types.d.ts +4 -1
- package/dist/detail/types.d.ts +4 -1
- package/dist/detail.cjs +1 -1
- package/dist/detail.mjs +308 -298
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +37 -14
- package/dist/list/approval-canvas-theme.d.ts +7 -0
- package/dist/list/approval-columns.d.ts +1 -1
- package/dist/list/approval-header-icons.d.ts +2 -0
- package/dist/list/types.d.ts +2 -0
- package/dist/list.cjs +1 -1
- package/dist/list.mjs +364 -335
- package/dist/react/index.d.ts +6 -1
- package/dist/react/theme.d.ts +59 -0
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +12 -6
- package/dist/styles.css +142 -0
- package/dist/theme-pzn9q1zq.cjs +1 -0
- package/dist/theme-qxOS-jIA.js +15 -0
- package/dist/theme.d.ts +52 -0
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
|
+
import type { MakeApprovalPresentation } from "../theme.js";
|
|
2
3
|
export type ApprovalStatusProps = {
|
|
3
4
|
value: unknown;
|
|
4
5
|
className?: string;
|
|
5
6
|
style?: CSSProperties;
|
|
7
|
+
presentation?: MakeApprovalPresentation;
|
|
6
8
|
};
|
|
7
|
-
export declare const ApprovalStatus: ({ value, className, style }: ApprovalStatusProps) => import("react").JSX.Element;
|
|
9
|
+
export declare const ApprovalStatus: ({ value, className, style, presentation }: ApprovalStatusProps) => import("react").JSX.Element;
|
|
10
|
+
export { MakeApprovalThemeProvider, useMakeApprovalThemeStyle } from "./theme.js";
|
|
11
|
+
export type { MakeApprovalThemeProviderProps } from "./theme.js";
|
|
12
|
+
export type { MakeApprovalTheme, MakeApprovalThemeStyle, MakeApprovalPresentation } from "../theme.js";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import { type MakeApprovalTheme, type MakeApprovalPresentation } from "../theme.js";
|
|
3
|
+
export type MakeApprovalThemeProviderProps = Readonly<{
|
|
4
|
+
theme?: MakeApprovalTheme;
|
|
5
|
+
presentation?: MakeApprovalPresentation;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
/** Context only. It never adds a DOM wrapper, mutates global CSS, or keys business controllers. */
|
|
9
|
+
export declare const MakeApprovalThemeProvider: ({ theme, presentation, children }: MakeApprovalThemeProviderProps) => import("react").JSX.Element;
|
|
10
|
+
export declare const useApprovalThemeState: (presentation?: MakeApprovalPresentation) => {
|
|
11
|
+
theme: Readonly<{
|
|
12
|
+
colors?: Readonly<Partial<Record<import("../theme.js").MakeApprovalColor, string>>>;
|
|
13
|
+
typography?: Readonly<{
|
|
14
|
+
fontFamily?: string;
|
|
15
|
+
headingFontFamily?: string;
|
|
16
|
+
roles?: Readonly<Partial<Record<import("../theme.js").MakeApprovalTypographyRole, number>>>;
|
|
17
|
+
lineHeight?: number;
|
|
18
|
+
weights?: Readonly<{
|
|
19
|
+
body?: number;
|
|
20
|
+
heading?: number;
|
|
21
|
+
}>;
|
|
22
|
+
tracking?: Readonly<{
|
|
23
|
+
body?: number;
|
|
24
|
+
heading?: number;
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
density?: Readonly<{
|
|
28
|
+
controlHeight?: number;
|
|
29
|
+
rowHeight?: number;
|
|
30
|
+
headerHeight?: number;
|
|
31
|
+
}>;
|
|
32
|
+
spacing?: Readonly<{
|
|
33
|
+
controlInline?: number;
|
|
34
|
+
controlBlock?: number;
|
|
35
|
+
field?: number;
|
|
36
|
+
section?: number;
|
|
37
|
+
tableCell?: number;
|
|
38
|
+
tableHeader?: number;
|
|
39
|
+
}>;
|
|
40
|
+
radius?: Readonly<{
|
|
41
|
+
control?: number;
|
|
42
|
+
panel?: number;
|
|
43
|
+
popup?: number;
|
|
44
|
+
}>;
|
|
45
|
+
border?: Readonly<{
|
|
46
|
+
width?: number;
|
|
47
|
+
color?: string;
|
|
48
|
+
subtleColor?: string;
|
|
49
|
+
}>;
|
|
50
|
+
shadow?: Readonly<{
|
|
51
|
+
panel?: string;
|
|
52
|
+
popup?: string;
|
|
53
|
+
}>;
|
|
54
|
+
}> | undefined;
|
|
55
|
+
presentation: MakeApprovalPresentation;
|
|
56
|
+
style: CSSProperties | undefined;
|
|
57
|
+
};
|
|
58
|
+
/** Apply to a host-owned portal surface when renderLayout moves package slots outside their DOM ancestor. */
|
|
59
|
+
export declare const useMakeApprovalThemeStyle: (presentation?: MakeApprovalPresentation) => CSSProperties;
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),t=require("./theme-pzn9q1zq.cjs"),n=require("./index.cjs"),i=({value:r,className:p,style:a,presentation:s})=>{const o=n.getApprovalStatusDisplay(r),e=t.useApprovalThemeState(s);return l.jsx("span",{className:["make-app-approval-status",p].filter(Boolean).join(" "),"data-tone":o.tone,"data-make-approval-theme":e.style?e.presentation:void 0,"data-make-approval-presentation":e.presentation==="mobile"?"mobile":void 0,style:e.style?{...e.style,...a}:a,children:o.label})};exports.MakeApprovalThemeProvider=t.MakeApprovalThemeProvider;exports.useMakeApprovalThemeStyle=t.useMakeApprovalThemeStyle;exports.ApprovalStatus=i;
|
package/dist/react.mjs
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { u as l } from "./theme-qxOS-jIA.js";
|
|
3
|
+
import { M as c, a as f } from "./theme-qxOS-jIA.js";
|
|
4
|
+
import { getApprovalStatusDisplay as m } from "./index.mjs";
|
|
5
|
+
const u = ({ value: o, className: p, style: a, presentation: r }) => {
|
|
6
|
+
const t = m(o), e = l(r);
|
|
5
7
|
return /* @__PURE__ */ s(
|
|
6
8
|
"span",
|
|
7
9
|
{
|
|
8
|
-
className: ["make-app-approval-status",
|
|
10
|
+
className: ["make-app-approval-status", p].filter(Boolean).join(" "),
|
|
9
11
|
"data-tone": t.tone,
|
|
10
|
-
style:
|
|
12
|
+
"data-make-approval-theme": e.style ? e.presentation : void 0,
|
|
13
|
+
"data-make-approval-presentation": e.presentation === "mobile" ? "mobile" : void 0,
|
|
14
|
+
style: e.style ? { ...e.style, ...a } : a,
|
|
11
15
|
children: t.label
|
|
12
16
|
}
|
|
13
17
|
);
|
|
14
18
|
};
|
|
15
19
|
export {
|
|
16
|
-
|
|
20
|
+
u as ApprovalStatus,
|
|
21
|
+
c as MakeApprovalThemeProvider,
|
|
22
|
+
f as useMakeApprovalThemeStyle
|
|
17
23
|
};
|
package/dist/styles.css
CHANGED
|
@@ -167,3 +167,145 @@
|
|
|
167
167
|
.make-app-approval-mobile-person { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
|
|
168
168
|
.make-app-approval-mobile-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; font-size: 9px; border-radius: 50%; background: var(--make-approval-primary); color: var(--make-approval-primary-foreground); }
|
|
169
169
|
.make-app-approval-mobile-feedback { flex: none; text-align: center; color: var(--make-approval-muted); padding: 12px 0; margin: 0; }
|
|
170
|
+
|
|
171
|
+
/* 可选语义主题:仅包自有节点消费。旧公开变量和省略 Provider 的发布基线不变。 */
|
|
172
|
+
.make-app-approval[data-make-approval-theme="desktop"],
|
|
173
|
+
.make-app-approval-detail[data-make-approval-theme="desktop"] {
|
|
174
|
+
color: var(--make-approval-theme-text, var(--make-approval-foreground, #1f2937));
|
|
175
|
+
background: var(--make-approval-theme-surface, var(--make-approval-bg, #fff));
|
|
176
|
+
border-radius: var(--make-approval-theme-radius-panel, 0);
|
|
177
|
+
box-shadow: var(--make-approval-theme-shadow-panel, none);
|
|
178
|
+
}
|
|
179
|
+
[data-make-approval-theme="desktop"] :where(.make-app-approval-detail-content, .make-app-approval-detail-section, .make-app-approval-detail-header, .make-app-approval-detail-footer, .make-app-approval-overlay, .make-app-approval-table-feedback, .make-app-approval-table-loading):not([data-make-approval-presentation="mobile"], [data-make-approval-presentation="mobile"] *) {
|
|
180
|
+
color: var(--make-approval-theme-text, #1f2937);
|
|
181
|
+
background: var(--make-approval-theme-surface, #fff);
|
|
182
|
+
border-color: var(--make-approval-theme-border-color, #f0f0f0);
|
|
183
|
+
}
|
|
184
|
+
.make-app-approval-detail-section[data-make-approval-theme="desktop"] {
|
|
185
|
+
padding: var(--make-approval-theme-spacing-section, 16px) var(--make-approval-theme-spacing-section, 24px);
|
|
186
|
+
color: var(--make-approval-theme-text, #1f2937);
|
|
187
|
+
background: var(--make-approval-theme-surface, #fff);
|
|
188
|
+
border-color: var(--make-approval-theme-border-color, #f0f0f0);
|
|
189
|
+
}
|
|
190
|
+
@media (max-width: 680px) {
|
|
191
|
+
.make-app-approval-detail-section[data-make-approval-theme="desktop"] { padding: var(--make-approval-theme-spacing-section, 16px); }
|
|
192
|
+
}
|
|
193
|
+
[data-make-approval-theme="desktop"] :where(.make-app-approval-detail-field, .make-app-approval-detail-fields):not([data-make-approval-presentation="mobile"] *) { border-color: var(--make-approval-theme-border-subtle-color, #f0f0f0); }
|
|
194
|
+
[data-make-approval-theme="desktop"] .make-app-approval-detail-fields:not([data-make-approval-presentation="mobile"] *) { column-gap: var(--make-approval-theme-spacing-field, 28px); }
|
|
195
|
+
[data-make-approval-theme="desktop"] .make-app-approval-detail-field:not([data-make-approval-presentation="mobile"] *) { column-gap: var(--make-approval-theme-spacing-field, 14px); }
|
|
196
|
+
[data-make-approval-theme="desktop"] :where(.make-app-approval-detail-value, .make-app-approval-detail-field > label, .make-app-approval-detail-opinion > label, .make-app-approval-detail-title h2, .make-app-approval-detail-section h3, .make-app-approval-detail-loading, .make-app-approval-table-loading, .make-app-approval-table-feedback, .make-app-approval-filter-field, .make-app-approval-filter-actions):not([data-make-approval-presentation="mobile"] *) {
|
|
197
|
+
font-family: var(--make-approval-theme-font-family, inherit);
|
|
198
|
+
font-size: var(--make-approval-theme-font-size-body, 14px);
|
|
199
|
+
font-weight: var(--make-approval-theme-font-weight-body, 400);
|
|
200
|
+
line-height: var(--make-approval-theme-line-height, 20px);
|
|
201
|
+
letter-spacing: var(--make-approval-theme-tracking-body, normal);
|
|
202
|
+
color: var(--make-approval-theme-text, #1f2937);
|
|
203
|
+
}
|
|
204
|
+
/* 部分主题保留节点原有排版;意见分段独立移入Portal时也命中,手机继续隔离PC值。 */
|
|
205
|
+
[data-make-approval-theme="desktop"] :where(.make-app-approval-detail-opinion > label):not([data-make-approval-presentation="mobile"] *) { font-weight: var(--make-approval-theme-font-weight-body, 600); }
|
|
206
|
+
[data-make-approval-theme="desktop"] .make-app-approval-table-loading:not([data-make-approval-presentation="mobile"] *) { font-size: var(--make-approval-theme-font-size-meta, 12px); }
|
|
207
|
+
[data-make-approval-theme="desktop"] :where(.make-app-approval-detail-title h2, .make-app-approval-detail-section h3):not([data-make-approval-presentation="mobile"] *) { color: var(--make-approval-theme-heading-text, var(--make-approval-theme-text, #1f2937)); font-family: var(--make-approval-theme-heading-font-family, var(--make-approval-theme-font-family, inherit)); font-weight: var(--make-approval-theme-font-weight-heading, 600); }
|
|
208
|
+
[data-make-approval-theme="desktop"] :where(.make-app-approval-overlay, .make-app-approval-table-feedback, .make-app-approval-table-loading):not([data-make-approval-presentation="mobile"] *) {
|
|
209
|
+
color: var(--make-approval-theme-secondary-text, var(--make-approval-muted));
|
|
210
|
+
background: var(--make-approval-theme-surface, var(--make-approval-bg));
|
|
211
|
+
border-color: var(--make-approval-theme-border-color, var(--make-approval-border));
|
|
212
|
+
}
|
|
213
|
+
[data-make-approval-theme="desktop"] .make-app-approval-detail-title h2:not([data-make-approval-presentation="mobile"] *) { font-size: var(--make-approval-theme-font-size-record-title, 16px); }
|
|
214
|
+
[data-make-approval-theme="desktop"] .make-app-approval-detail-section h3:not([data-make-approval-presentation="mobile"] *) { font-size: var(--make-approval-theme-font-size-section-title, 14px); }
|
|
215
|
+
[data-make-approval-theme="desktop"] .make-app-approval-detail-field > label:not([data-make-approval-presentation="mobile"] *) { color: var(--make-approval-theme-secondary-text, #64748b); font-size: var(--make-approval-theme-font-size-field-label, 14px); }
|
|
216
|
+
[data-make-approval-theme="desktop"] .make-app-approval-detail-field[data-invalid="true"] > label:not([data-make-approval-presentation="mobile"] *) { color: var(--make-approval-theme-danger, var(--make-approval-error, var(--make-mobile-error, #dc2626))); }
|
|
217
|
+
[data-make-approval-theme="desktop"] .make-app-approval-inline-editor:not([data-disabled="true"]):is(:hover,:focus-within):not([data-make-approval-presentation="mobile"] *) { background: var(--make-approval-theme-hover-surface, #f2f4f7); }
|
|
218
|
+
.make-app-approval-status[data-make-approval-theme="desktop"] { background: var(--make-approval-theme-subtle-surface, var(--make-approval-surface, hsl(var(--muted, 150 22% 94%)))); color: var(--make-approval-theme-secondary-text, var(--make-approval-text, hsl(var(--muted-foreground, 160 8% 42%)))); font-family: var(--make-approval-theme-font-family, inherit); font-size: var(--make-approval-theme-font-size-meta, 12px); border-radius: var(--make-approval-theme-radius-control, 4px); }
|
|
219
|
+
.make-app-approval-status[data-make-approval-theme="desktop"][data-tone="success"] { color: var(--make-approval-theme-success, var(--make-approval-theme-primary, var(--make-approval-primary, hsl(var(--primary, 176 77% 26%))))); }
|
|
220
|
+
.make-app-approval-status[data-make-approval-theme][data-tone="processing"] { color: var(--make-approval-theme-primary, var(--make-approval-primary, hsl(var(--primary, 176 77% 26%)))); }
|
|
221
|
+
.make-app-approval-status[data-make-approval-theme="desktop"]:is([data-tone="danger"],[data-tone="unknown"]) { color: var(--make-approval-theme-danger, var(--make-approval-error, var(--make-mobile-error, #dc2626))); }
|
|
222
|
+
[data-make-approval-theme="desktop"] :where(.make-app-approval-detail-error,.make-app-approval-error):not([data-make-approval-presentation="mobile"] *) { color: var(--make-approval-theme-danger, var(--make-approval-error, var(--make-mobile-error, #dc2626))); }
|
|
223
|
+
[data-make-approval-theme] .make-app-approval-loading-spinner { border-top-color: var(--make-approval-theme-primary, var(--make-approval-primary, hsl(var(--primary, 176 77% 26%)))); }
|
|
224
|
+
[data-make-approval-theme="mobile"] :where(.make-app-approval-mobile-card,.make-app-approval-mobile-input,.make-app-approval-mobile-search-button):focus-visible { outline-color: var(--make-approval-theme-focus-ring, var(--make-approval-theme-primary, var(--make-approval-primary))); }
|
|
225
|
+
[data-make-approval-theme="mobile"] .make-app-approval-mobile-avatar { color: var(--make-approval-theme-on-primary, var(--make-approval-primary-foreground)); background: var(--make-approval-theme-primary, var(--make-approval-primary)); }
|
|
226
|
+
|
|
227
|
+
/* 手机边界只隔离本次新增PC变量;旧--make-approval-*主题仍原样继承。 */
|
|
228
|
+
[data-make-approval-presentation="mobile"] {
|
|
229
|
+
--make-approval-theme-active-surface: initial;
|
|
230
|
+
--make-approval-theme-border-color: initial;
|
|
231
|
+
--make-approval-theme-border-subtle-color: initial;
|
|
232
|
+
--make-approval-theme-border-width: initial;
|
|
233
|
+
--make-approval-theme-control-height: initial;
|
|
234
|
+
--make-approval-theme-danger: initial;
|
|
235
|
+
--make-approval-theme-elevated-surface: initial;
|
|
236
|
+
--make-approval-theme-font-family: initial;
|
|
237
|
+
--make-approval-theme-font-size-body: initial;
|
|
238
|
+
--make-approval-theme-font-size-control-text: initial;
|
|
239
|
+
--make-approval-theme-font-size-field-label: initial;
|
|
240
|
+
--make-approval-theme-font-size-meta: initial;
|
|
241
|
+
--make-approval-theme-font-size-record-title: initial;
|
|
242
|
+
--make-approval-theme-font-size-section-title: initial;
|
|
243
|
+
--make-approval-theme-font-weight-body: initial;
|
|
244
|
+
--make-approval-theme-font-weight-heading: initial;
|
|
245
|
+
--make-approval-theme-header-height: initial;
|
|
246
|
+
--make-approval-theme-heading-font-family: initial;
|
|
247
|
+
--make-approval-theme-heading-text: initial;
|
|
248
|
+
--make-approval-theme-hover-surface: initial;
|
|
249
|
+
--make-approval-theme-line-height: initial;
|
|
250
|
+
--make-approval-theme-mask: initial;
|
|
251
|
+
--make-approval-theme-page: initial;
|
|
252
|
+
--make-approval-theme-placeholder-text: initial;
|
|
253
|
+
--make-approval-theme-radius-control: initial;
|
|
254
|
+
--make-approval-theme-radius-panel: initial;
|
|
255
|
+
--make-approval-theme-radius-popup: initial;
|
|
256
|
+
--make-approval-theme-row-height: initial;
|
|
257
|
+
--make-approval-theme-secondary-text: initial;
|
|
258
|
+
--make-approval-theme-selected-surface: initial;
|
|
259
|
+
--make-approval-theme-shadow-panel: initial;
|
|
260
|
+
--make-approval-theme-shadow-popup: initial;
|
|
261
|
+
--make-approval-theme-spacing-control-block: initial;
|
|
262
|
+
--make-approval-theme-spacing-control-inline: initial;
|
|
263
|
+
--make-approval-theme-spacing-field: initial;
|
|
264
|
+
--make-approval-theme-spacing-section: initial;
|
|
265
|
+
--make-approval-theme-spacing-table-cell: initial;
|
|
266
|
+
--make-approval-theme-spacing-table-header: initial;
|
|
267
|
+
--make-approval-theme-subtle-surface: initial;
|
|
268
|
+
--make-approval-theme-success: initial;
|
|
269
|
+
--make-approval-theme-surface: initial;
|
|
270
|
+
--make-approval-theme-tertiary-text: initial;
|
|
271
|
+
--make-approval-theme-text: initial;
|
|
272
|
+
--make-approval-theme-tracking-body: initial;
|
|
273
|
+
--make-approval-theme-tracking-heading: initial;
|
|
274
|
+
--make-approval-theme-warning: initial;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
[data-make-approval-theme="desktop"] :where(.make-app-approval-detail-title h2,.make-app-approval-detail-section h3):not([data-make-approval-presentation="mobile"] *) { letter-spacing: var(--make-approval-theme-tracking-heading, normal); }
|
|
278
|
+
|
|
279
|
+
/* 移入Portal的标题/分段仍由其自有边界消费,不要求宿主复制包CSS或再加Controller。 */
|
|
280
|
+
.make-app-approval-detail-title[data-make-approval-theme="desktop"] > h2,
|
|
281
|
+
.make-app-approval-detail-section[data-make-approval-theme="desktop"] > h3 {
|
|
282
|
+
color: var(--make-approval-theme-heading-text, var(--make-approval-theme-text, #1f2937));
|
|
283
|
+
font-family: var(--make-approval-theme-heading-font-family, var(--make-approval-theme-font-family, inherit));
|
|
284
|
+
font-weight: var(--make-approval-theme-font-weight-heading, 600);
|
|
285
|
+
line-height: var(--make-approval-theme-line-height, 20px);
|
|
286
|
+
letter-spacing: var(--make-approval-theme-tracking-heading, normal);
|
|
287
|
+
}
|
|
288
|
+
.make-app-approval-detail-title[data-make-approval-theme="desktop"] > h2 { font-size: var(--make-approval-theme-font-size-record-title, 16px); }
|
|
289
|
+
.make-app-approval-detail-section[data-make-approval-theme="desktop"] > h3 { font-size: var(--make-approval-theme-font-size-section-title, 14px); }
|
|
290
|
+
|
|
291
|
+
.make-app-approval-detail-loading[data-make-approval-theme="desktop"] { color: var(--make-approval-theme-secondary-text, #64748b); font-family: var(--make-approval-theme-font-family, inherit); font-size: var(--make-approval-theme-font-size-body, 14px); line-height: var(--make-approval-theme-line-height, 20px); }
|
|
292
|
+
|
|
293
|
+
/* 每个公开可移动槽自身拥有表面;宿主只传slots.themeStyle即可,不复制私有标记。 */
|
|
294
|
+
.make-app-approval-detail-content[data-make-approval-theme="desktop"],
|
|
295
|
+
.make-app-approval-detail-actions[data-make-approval-theme="desktop"],
|
|
296
|
+
.make-app-approval-detail-message[data-make-approval-theme="desktop"],
|
|
297
|
+
.make-app-approval-detail-request-state[data-make-approval-theme="desktop"] {
|
|
298
|
+
color: var(--make-approval-theme-text, #1f2937);
|
|
299
|
+
background: var(--make-approval-theme-surface, #fff);
|
|
300
|
+
}
|
|
301
|
+
.make-app-approval-detail-message[data-make-approval-theme="desktop"],
|
|
302
|
+
.make-app-approval-detail-request-state[data-make-approval-theme="desktop"] {
|
|
303
|
+
font-family: var(--make-approval-theme-font-family, inherit);
|
|
304
|
+
font-size: var(--make-approval-theme-font-size-body, 14px);
|
|
305
|
+
line-height: var(--make-approval-theme-line-height, 20px);
|
|
306
|
+
letter-spacing: var(--make-approval-theme-tracking-body, normal);
|
|
307
|
+
}
|
|
308
|
+
.make-app-approval-detail-error[data-make-approval-theme="desktop"],
|
|
309
|
+
.make-app-approval-detail-request-state[data-make-approval-theme="desktop"] > [role="alert"] { color: var(--make-approval-theme-danger, var(--make-approval-error, var(--make-mobile-error, #dc2626))); }
|
|
310
|
+
.make-app-approval-status[data-make-approval-theme="mobile"][data-tone="success"] { color: var(--make-approval-theme-primary, var(--make-approval-primary, hsl(var(--primary, 176 77% 26%)))); }
|
|
311
|
+
.make-app-approval-detail-loading[data-make-approval-theme="desktop"] { background: var(--make-approval-theme-surface, #fff); }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const h=require("react/jsx-runtime"),o=require("react"),y=require("./index.cjs"),i=o.createContext({presentation:"desktop"}),u=(t,e)=>t?e?{...t,...e,colors:{...t.colors,...e.colors},typography:{...t.typography,...e.typography,roles:{...t.typography?.roles,...e.typography?.roles},tracking:{...t.typography?.tracking,...e.typography?.tracking},weights:{...t.typography?.weights,...e.typography?.weights}},density:{...t.density,...e.density},spacing:{...t.spacing,...e.spacing},radius:{...t.radius,...e.radius},border:{...t.border,...e.border},shadow:{...t.shadow,...e.shadow}}:t:e,d=({theme:t,presentation:e,children:s})=>{const r=o.useContext(i),p=o.useMemo(()=>({theme:u(r.theme,t),presentation:e??r.presentation}),[r,t,e]);return h.jsx(i.Provider,{value:p,children:s})},n=t=>{const e=o.useContext(i),s=t??e.presentation,r=o.useMemo(()=>y.toMakeApprovalThemeStyle(e.theme,s),[e.theme,s]);return{theme:e.theme,presentation:s,style:Object.keys(r).length?r:void 0}},g=t=>n(t).style??{};exports.MakeApprovalThemeProvider=d;exports.useApprovalThemeState=n;exports.useMakeApprovalThemeStyle=g;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as p, useMemo as i, createContext as n } from "react";
|
|
3
|
+
import { toMakeApprovalThemeStyle as g } from "./index.mjs";
|
|
4
|
+
const s = n({ presentation: "desktop" }), m = (t, e) => t ? e ? { ...t, ...e, colors: { ...t.colors, ...e.colors }, typography: { ...t.typography, ...e.typography, roles: { ...t.typography?.roles, ...e.typography?.roles }, tracking: { ...t.typography?.tracking, ...e.typography?.tracking }, weights: { ...t.typography?.weights, ...e.typography?.weights } }, density: { ...t.density, ...e.density }, spacing: { ...t.spacing, ...e.spacing }, radius: { ...t.radius, ...e.radius }, border: { ...t.border, ...e.border }, shadow: { ...t.shadow, ...e.shadow } } : t : e, k = ({ theme: t, presentation: e, children: r }) => {
|
|
5
|
+
const o = p(s), h = i(() => ({ theme: m(o.theme, t), presentation: e ?? o.presentation }), [o, t, e]);
|
|
6
|
+
return /* @__PURE__ */ y(s.Provider, { value: h, children: r });
|
|
7
|
+
}, d = (t) => {
|
|
8
|
+
const e = p(s), r = t ?? e.presentation, o = i(() => g(e.theme, r), [e.theme, r]);
|
|
9
|
+
return { theme: e.theme, presentation: r, style: Object.keys(o).length ? o : void 0 };
|
|
10
|
+
}, v = (t) => d(t).style ?? {};
|
|
11
|
+
export {
|
|
12
|
+
k as M,
|
|
13
|
+
v as a,
|
|
14
|
+
d as u
|
|
15
|
+
};
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Optional semantic presentation only; never carries MakeDesign IDs or business state. */
|
|
2
|
+
export declare const MAKE_APPROVAL_THEME_CONTRACT: "make-app-approval/semantic-theme/v1";
|
|
3
|
+
export type MakeApprovalPresentation = "desktop" | "mobile";
|
|
4
|
+
export type MakeApprovalColor = "primary" | "onPrimary" | "primarySoft" | "link" | "focusRing" | "text" | "headingText" | "secondaryText" | "tertiaryText" | "placeholderText" | "page" | "surface" | "elevatedSurface" | "subtleSurface" | "hoverSurface" | "selectedSurface" | "activeSurface" | "mask" | "success" | "warning" | "danger";
|
|
5
|
+
export type MakeApprovalTypographyRole = "recordTitle" | "sectionTitle" | "body" | "fieldLabel" | "controlText" | "meta";
|
|
6
|
+
export type MakeApprovalTheme = Readonly<{
|
|
7
|
+
colors?: Readonly<Partial<Record<MakeApprovalColor, string>>>;
|
|
8
|
+
typography?: Readonly<{
|
|
9
|
+
fontFamily?: string;
|
|
10
|
+
headingFontFamily?: string;
|
|
11
|
+
roles?: Readonly<Partial<Record<MakeApprovalTypographyRole, number>>>; /** Unitless multiplier. */
|
|
12
|
+
lineHeight?: number;
|
|
13
|
+
weights?: Readonly<{
|
|
14
|
+
body?: number;
|
|
15
|
+
heading?: number;
|
|
16
|
+
}>; /** em, not pixels. */
|
|
17
|
+
tracking?: Readonly<{
|
|
18
|
+
body?: number;
|
|
19
|
+
heading?: number;
|
|
20
|
+
}>;
|
|
21
|
+
}>;
|
|
22
|
+
density?: Readonly<{
|
|
23
|
+
controlHeight?: number;
|
|
24
|
+
rowHeight?: number;
|
|
25
|
+
headerHeight?: number;
|
|
26
|
+
}>;
|
|
27
|
+
spacing?: Readonly<{
|
|
28
|
+
controlInline?: number;
|
|
29
|
+
controlBlock?: number;
|
|
30
|
+
field?: number;
|
|
31
|
+
section?: number;
|
|
32
|
+
tableCell?: number;
|
|
33
|
+
tableHeader?: number;
|
|
34
|
+
}>;
|
|
35
|
+
radius?: Readonly<{
|
|
36
|
+
control?: number;
|
|
37
|
+
panel?: number;
|
|
38
|
+
popup?: number;
|
|
39
|
+
}>;
|
|
40
|
+
border?: Readonly<{
|
|
41
|
+
width?: number;
|
|
42
|
+
color?: string;
|
|
43
|
+
subtleColor?: string;
|
|
44
|
+
}>;
|
|
45
|
+
shadow?: Readonly<{
|
|
46
|
+
panel?: string;
|
|
47
|
+
popup?: string;
|
|
48
|
+
}>;
|
|
49
|
+
}>;
|
|
50
|
+
export type MakeApprovalThemeStyle = Readonly<Partial<Record<`--make-approval-theme-${string}`, string>>>;
|
|
51
|
+
/** Missing values emit nothing, so all 0.2.16 defaults and legacy public variables remain intact. */
|
|
52
|
+
export declare const toMakeApprovalThemeStyle: (theme?: MakeApprovalTheme, presentation?: MakeApprovalPresentation) => MakeApprovalThemeStyle;
|