@plasmicpkgs/antd5 0.0.4
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/LICENSE.md +21 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/antd.esm.js +908 -0
- package/dist/antd.esm.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +910 -0
- package/dist/index.js.map +1 -0
- package/dist/registerConfigProvider.d.ts +33 -0
- package/dist/registerSelect.d.ts +10 -0
- package/dist/registerTable.d.ts +14 -0
- package/dist/utils.d.ts +24 -0
- package/package.json +52 -0
- package/skinny/package.json +3 -0
- package/skinny/registerConfigProvider.d.ts +33 -0
- package/skinny/registerConfigProvider.js +446 -0
- package/skinny/registerConfigProvider.js.map +1 -0
- package/skinny/registerSelect.d.ts +10 -0
- package/skinny/registerSelect.js +234 -0
- package/skinny/registerSelect.js.map +1 -0
- package/skinny/registerTable.d.ts +14 -0
- package/skinny/registerTable.js +193 -0
- package/skinny/registerTable.js.map +1 -0
- package/skinny/utils-04cd07f6.js +48 -0
- package/skinny/utils-04cd07f6.js.map +1 -0
- package/skinny/utils.d.ts +24 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Registerable } from "./utils";
|
|
3
|
+
export interface ThemeOpts {
|
|
4
|
+
fontFamily?: string;
|
|
5
|
+
fontSize?: number;
|
|
6
|
+
lineHeight?: number;
|
|
7
|
+
colorTextBase?: string;
|
|
8
|
+
colorPrimary?: string;
|
|
9
|
+
colorSuccess?: string;
|
|
10
|
+
colorWarning?: string;
|
|
11
|
+
colorInfo?: string;
|
|
12
|
+
lineWidth?: number;
|
|
13
|
+
borderRadius?: number;
|
|
14
|
+
controlHeight?: number;
|
|
15
|
+
sizeUnit?: number;
|
|
16
|
+
sizeStep?: number;
|
|
17
|
+
wireframe?: boolean;
|
|
18
|
+
spacing?: "small" | "middle" | "large";
|
|
19
|
+
}
|
|
20
|
+
export declare function themeToAntdConfig(opts: ThemeOpts): {
|
|
21
|
+
theme: {
|
|
22
|
+
token: {
|
|
23
|
+
[k: string]: string | number | boolean | undefined;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
size?: "small" | "large" | "middle" | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare function AntdConfigProvider(props: Omit<ThemeOpts, "fontFamily" | "fontSize" | "lineWidth"> & {
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
themeStyles: Record<string, string>;
|
|
31
|
+
}): JSX.Element;
|
|
32
|
+
export declare function registerTokens(loader?: Registerable): void;
|
|
33
|
+
export declare const registerConfigProvider: (loader?: Registerable | undefined) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Select from "antd/es/select";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import { Registerable } from "./utils";
|
|
4
|
+
export declare const AntdOption: import("rc-select/lib/Option").OptionFC;
|
|
5
|
+
export declare function AntdSelect(props: ComponentProps<typeof Select> & {
|
|
6
|
+
popupScopeClassName?: string;
|
|
7
|
+
popupClassName?: string;
|
|
8
|
+
defaultStylesClassName?: string;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
export declare function registerSelect(loader?: Registerable): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Table from "antd/es/table";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Registerable } from "./utils";
|
|
4
|
+
export declare function AntdTable(props: React.ComponentProps<typeof Table> & {
|
|
5
|
+
data: any;
|
|
6
|
+
rowKey?: string;
|
|
7
|
+
isSelectable?: undefined | "single" | "multiple";
|
|
8
|
+
selectedRowKeys?: string[];
|
|
9
|
+
onSelectionChange?: (keys: React.Key[], rows: any[]) => void;
|
|
10
|
+
setControlContextData?: (ctx: any) => void;
|
|
11
|
+
}): JSX.Element;
|
|
12
|
+
export declare const AntdColumnGroup: typeof import("antd/es/table/ColumnGroup").default;
|
|
13
|
+
export declare const AntdColumn: typeof import("antd/es/table/Column").default;
|
|
14
|
+
export declare function registerTable(loader?: Registerable): void;
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentMeta, default as registerComponent } from "@plasmicapp/host/registerComponent";
|
|
2
|
+
import { default as registerGlobalContext, GlobalContextMeta } from "@plasmicapp/host/registerGlobalContext";
|
|
3
|
+
import { default as registerToken } from "@plasmicapp/host/registerToken";
|
|
4
|
+
import React from "react";
|
|
5
|
+
export type Registerable = {
|
|
6
|
+
registerComponent: typeof registerComponent;
|
|
7
|
+
registerGlobalContext: typeof registerGlobalContext;
|
|
8
|
+
registerToken: typeof registerToken;
|
|
9
|
+
};
|
|
10
|
+
export declare function makeRegisterComponent<T extends React.ComponentType<any>>(component: T, meta: ComponentMeta<React.ComponentProps<T>>): (loader?: Registerable) => void;
|
|
11
|
+
export declare function makeRegisterGlobalContext<T extends React.ComponentType<any>>(component: T, meta: GlobalContextMeta<React.ComponentProps<T>>): (loader?: Registerable) => void;
|
|
12
|
+
export declare function registerComponentHelper<T extends React.ComponentType<any>>(loader: Registerable | undefined, component: T, meta: ComponentMeta<React.ComponentProps<T>>): void;
|
|
13
|
+
type ReactElt = {
|
|
14
|
+
children: ReactElt | ReactElt[];
|
|
15
|
+
props: {
|
|
16
|
+
children: ReactElt | ReactElt[];
|
|
17
|
+
[prop: string]: any;
|
|
18
|
+
} | null;
|
|
19
|
+
type: React.ComponentType<any> | null;
|
|
20
|
+
key: string | null;
|
|
21
|
+
} | null;
|
|
22
|
+
export declare function traverseReactEltTree(children: React.ReactNode, callback: (elt: ReactElt) => void): void;
|
|
23
|
+
export declare function asArray<T>(x: T[] | T | undefined | null): T[];
|
|
24
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@plasmicpkgs/antd5",
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "Plasmic registration calls for antd components",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"module": "dist/antd.esm.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"skinny"
|
|
11
|
+
],
|
|
12
|
+
"size-limit": [
|
|
13
|
+
{
|
|
14
|
+
"path": "dist/index.js",
|
|
15
|
+
"limit": "10 KB"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"path": "dist/antd.esm.js",
|
|
19
|
+
"limit": "10 KB"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "rollup -c rollup.config.mjs && ./node_modules/.bin/tsc --emitDeclarationOnly --declaration src/index.ts --incremental --tsBuildInfoFile ./dist/.tsbuildinfo --skipLibCheck --jsx react --esModuleInterop --strict --outDir ./dist/ && cp ./dist/*.d.ts skinny/ && rm skinny/index.d.ts",
|
|
24
|
+
"prepare": "if-env PREPARE_NO_BUILD=true || yarn build"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@plasmicapp/host": "1.0.103",
|
|
28
|
+
"@plasmicapp/query": "0.1.61",
|
|
29
|
+
"@types/node": "^14.0.26",
|
|
30
|
+
"@types/react": "^18.0.27",
|
|
31
|
+
"@types/react-dom": "^18.0.10",
|
|
32
|
+
"antd": "^5.1.6",
|
|
33
|
+
"glob": "^8.1.0",
|
|
34
|
+
"react": "^18.2.0",
|
|
35
|
+
"react-dom": "^18.2.0",
|
|
36
|
+
"rollup": "^3.10.1",
|
|
37
|
+
"rollup-plugin-dts": "^5.0.0",
|
|
38
|
+
"rollup-plugin-esbuild": "^5.0.0",
|
|
39
|
+
"rollup-plugin-replace-imports": "^1.0.0",
|
|
40
|
+
"typescript": "^4.6.4"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@plasmicapp/host": "1.0.103",
|
|
44
|
+
"@plasmicapp/query": "0.1.61",
|
|
45
|
+
"antd": ">=5.1.0",
|
|
46
|
+
"react": ">=16.8.0"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"gitHead": "2badf5ec47566e84eb4ef8c27b2a48524516edc9"
|
|
52
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Registerable } from "./utils";
|
|
3
|
+
export interface ThemeOpts {
|
|
4
|
+
fontFamily?: string;
|
|
5
|
+
fontSize?: number;
|
|
6
|
+
lineHeight?: number;
|
|
7
|
+
colorTextBase?: string;
|
|
8
|
+
colorPrimary?: string;
|
|
9
|
+
colorSuccess?: string;
|
|
10
|
+
colorWarning?: string;
|
|
11
|
+
colorInfo?: string;
|
|
12
|
+
lineWidth?: number;
|
|
13
|
+
borderRadius?: number;
|
|
14
|
+
controlHeight?: number;
|
|
15
|
+
sizeUnit?: number;
|
|
16
|
+
sizeStep?: number;
|
|
17
|
+
wireframe?: boolean;
|
|
18
|
+
spacing?: "small" | "middle" | "large";
|
|
19
|
+
}
|
|
20
|
+
export declare function themeToAntdConfig(opts: ThemeOpts): {
|
|
21
|
+
theme: {
|
|
22
|
+
token: {
|
|
23
|
+
[k: string]: string | number | boolean | undefined;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
size?: "small" | "large" | "middle" | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare function AntdConfigProvider(props: Omit<ThemeOpts, "fontFamily" | "fontSize" | "lineWidth"> & {
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
themeStyles: Record<string, string>;
|
|
31
|
+
}): JSX.Element;
|
|
32
|
+
export declare function registerTokens(loader?: Registerable): void;
|
|
33
|
+
export declare const registerConfigProvider: (loader?: Registerable | undefined) => void;
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import { GlobalActionsProvider } from '@plasmicapp/host';
|
|
2
|
+
import registerToken from '@plasmicapp/host/registerToken';
|
|
3
|
+
import { addLoadingStateListener } from '@plasmicapp/query';
|
|
4
|
+
import App from 'antd/es/app';
|
|
5
|
+
import ConfigProvider from 'antd/es/config-provider';
|
|
6
|
+
import theme from 'antd/es/theme';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { m as makeRegisterGlobalContext } from './utils-04cd07f6.js';
|
|
9
|
+
import '@plasmicapp/host/registerComponent';
|
|
10
|
+
import '@plasmicapp/host/registerGlobalContext';
|
|
11
|
+
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __defProps = Object.defineProperties;
|
|
14
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
15
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
16
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
17
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
18
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19
|
+
var __spreadValues = (a, b) => {
|
|
20
|
+
for (var prop in b || (b = {}))
|
|
21
|
+
if (__hasOwnProp.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
if (__getOwnPropSymbols)
|
|
24
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
25
|
+
if (__propIsEnum.call(b, prop))
|
|
26
|
+
__defNormalProp(a, prop, b[prop]);
|
|
27
|
+
}
|
|
28
|
+
return a;
|
|
29
|
+
};
|
|
30
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
31
|
+
var __objRest = (source, exclude) => {
|
|
32
|
+
var target = {};
|
|
33
|
+
for (var prop in source)
|
|
34
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
35
|
+
target[prop] = source[prop];
|
|
36
|
+
if (source != null && __getOwnPropSymbols)
|
|
37
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
38
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
39
|
+
target[prop] = source[prop];
|
|
40
|
+
}
|
|
41
|
+
return target;
|
|
42
|
+
};
|
|
43
|
+
function themeToAntdConfig(opts) {
|
|
44
|
+
const {
|
|
45
|
+
colorTextBase,
|
|
46
|
+
colorPrimary,
|
|
47
|
+
colorSuccess,
|
|
48
|
+
colorWarning,
|
|
49
|
+
colorInfo,
|
|
50
|
+
fontFamily,
|
|
51
|
+
fontSize,
|
|
52
|
+
lineWidth,
|
|
53
|
+
borderRadius,
|
|
54
|
+
controlHeight,
|
|
55
|
+
sizeUnit,
|
|
56
|
+
sizeStep,
|
|
57
|
+
wireframe,
|
|
58
|
+
spacing
|
|
59
|
+
} = opts;
|
|
60
|
+
return __spreadProps(__spreadValues({}, spacing && { size: spacing }), {
|
|
61
|
+
theme: {
|
|
62
|
+
token: Object.fromEntries(Object.entries({
|
|
63
|
+
colorTextBase,
|
|
64
|
+
colorPrimary,
|
|
65
|
+
colorSuccess,
|
|
66
|
+
colorWarning,
|
|
67
|
+
colorInfo,
|
|
68
|
+
fontFamily,
|
|
69
|
+
fontSize,
|
|
70
|
+
lineWidth,
|
|
71
|
+
borderRadius,
|
|
72
|
+
controlHeight,
|
|
73
|
+
sizeUnit,
|
|
74
|
+
sizeStep,
|
|
75
|
+
wireframe
|
|
76
|
+
}).filter(([key, val]) => !!val))
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function AntdConfigProvider(props) {
|
|
81
|
+
const _a = props, { children, themeStyles } = _a, rest = __objRest(_a, ["children", "themeStyles"]);
|
|
82
|
+
return /* @__PURE__ */ React.createElement(ConfigProvider, __spreadValues({}, themeToAntdConfig(__spreadProps(__spreadValues({}, rest), {
|
|
83
|
+
fontFamily: themeStyles.fontFamily,
|
|
84
|
+
fontSize: themeStyles.fontSize ? parseInt(themeStyles.fontSize) : void 0,
|
|
85
|
+
lineHeight: themeStyles.lineHeight ? parseInt(themeStyles.lineHeight) : void 0,
|
|
86
|
+
colorTextBase: themeStyles.color
|
|
87
|
+
}))), /* @__PURE__ */ React.createElement(App, null, /* @__PURE__ */ React.createElement(InnerConfigProvider, null, children)));
|
|
88
|
+
}
|
|
89
|
+
function InnerConfigProvider(props) {
|
|
90
|
+
const { children } = props;
|
|
91
|
+
const { token } = theme.useToken();
|
|
92
|
+
const makeVarName = (name) => `--antd-${name}`;
|
|
93
|
+
const cssStyles = React.useMemo(() => `
|
|
94
|
+
:root {
|
|
95
|
+
${Object.entries(token).map(([key, val]) => `${makeVarName(key)}:${typeof val === "string" ? val.trim() : val};`).join("\n")}
|
|
96
|
+
}
|
|
97
|
+
`, [token]);
|
|
98
|
+
const app = App.useApp();
|
|
99
|
+
const actions = React.useMemo(() => ({
|
|
100
|
+
showNotification: (opts) => {
|
|
101
|
+
var _b;
|
|
102
|
+
const _a = opts, rest = __objRest(_a, ["type"]);
|
|
103
|
+
app.notification[(_b = opts.type) != null ? _b : "info"](__spreadValues({}, rest));
|
|
104
|
+
},
|
|
105
|
+
hideNotifications: () => {
|
|
106
|
+
app.notification.destroy();
|
|
107
|
+
}
|
|
108
|
+
}), [app]);
|
|
109
|
+
if (!GlobalActionsProvider) {
|
|
110
|
+
warnOutdatedDeps();
|
|
111
|
+
}
|
|
112
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("style", null, cssStyles), GlobalActionsProvider && /* @__PURE__ */ React.createElement(GlobalActionsProvider, {
|
|
113
|
+
contextName: "plasmic-antd5-config-provider",
|
|
114
|
+
actions
|
|
115
|
+
}, children), /* @__PURE__ */ React.createElement(GlobalLoadingIndicator, null));
|
|
116
|
+
}
|
|
117
|
+
let warned = false;
|
|
118
|
+
function warnOutdatedDeps() {
|
|
119
|
+
if (!warned) {
|
|
120
|
+
console.log(`You are using a version of @plasmicapp/* that is too old. Please upgrade to the latest version.`);
|
|
121
|
+
warned = true;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function GlobalLoadingIndicator() {
|
|
125
|
+
const app = App.useApp();
|
|
126
|
+
React.useEffect(() => {
|
|
127
|
+
if (addLoadingStateListener) {
|
|
128
|
+
return addLoadingStateListener((isLoading) => {
|
|
129
|
+
if (isLoading) {
|
|
130
|
+
app.message.open({
|
|
131
|
+
content: "Loading...",
|
|
132
|
+
duration: 0,
|
|
133
|
+
key: `plasmic-antd5-global-loading-indicator`
|
|
134
|
+
});
|
|
135
|
+
} else {
|
|
136
|
+
app.message.destroy(`plasmic-antd5-global-loading-indicator`);
|
|
137
|
+
}
|
|
138
|
+
}, { immediate: true });
|
|
139
|
+
} else {
|
|
140
|
+
warnOutdatedDeps();
|
|
141
|
+
return () => {
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}, [app]);
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
function registerTokens(loader) {
|
|
148
|
+
const regs = [];
|
|
149
|
+
const makeColorToken = (name) => {
|
|
150
|
+
const colorIndex = name.indexOf("color");
|
|
151
|
+
const humanName = makeNiceName(colorIndex >= 0 ? name.substring(name.indexOf("color") + "color".length) : name);
|
|
152
|
+
return {
|
|
153
|
+
name: `Sys: ${humanName}`,
|
|
154
|
+
value: `var(--antd-${name})`,
|
|
155
|
+
type: "color"
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
function makeNiceName(name) {
|
|
159
|
+
name = name[0].toUpperCase() + name.substring(1);
|
|
160
|
+
return name.replace(/([a-z])([A-Z])/g, "$1 $2");
|
|
161
|
+
}
|
|
162
|
+
const colorTokens = [
|
|
163
|
+
"colorPrimary",
|
|
164
|
+
"colorSuccess",
|
|
165
|
+
"colorWarning",
|
|
166
|
+
"colorError",
|
|
167
|
+
"colorInfo",
|
|
168
|
+
"colorText",
|
|
169
|
+
"colorTextSecondary",
|
|
170
|
+
"colorTextTertiary",
|
|
171
|
+
"colorTextQuaternary",
|
|
172
|
+
"colorBorder",
|
|
173
|
+
"colorBorderSecondary",
|
|
174
|
+
"colorFill",
|
|
175
|
+
"colorFillSecondary",
|
|
176
|
+
"colorFillTertiary",
|
|
177
|
+
"colorFillQuaternary",
|
|
178
|
+
"colorBgLayout",
|
|
179
|
+
"colorBgContainer",
|
|
180
|
+
"colorBgElevated",
|
|
181
|
+
"colorBgSpotlight",
|
|
182
|
+
"colorPrimaryBg",
|
|
183
|
+
"colorPrimaryBgHover",
|
|
184
|
+
"colorPrimaryBorder",
|
|
185
|
+
"colorPrimaryBorderHover",
|
|
186
|
+
"colorPrimaryHover",
|
|
187
|
+
"colorPrimaryActive",
|
|
188
|
+
"colorPrimaryTextHover",
|
|
189
|
+
"colorPrimaryText",
|
|
190
|
+
"colorPrimaryTextActive",
|
|
191
|
+
"colorSuccessBg",
|
|
192
|
+
"colorSuccessBgHover",
|
|
193
|
+
"colorSuccessBorder",
|
|
194
|
+
"colorSuccessBorderHover",
|
|
195
|
+
"colorSuccessHover",
|
|
196
|
+
"colorSuccessActive",
|
|
197
|
+
"colorSuccessTextHover",
|
|
198
|
+
"colorSuccessText",
|
|
199
|
+
"colorSuccessTextActive",
|
|
200
|
+
"colorWarningBg",
|
|
201
|
+
"colorWarningBgHover",
|
|
202
|
+
"colorWarningBorder",
|
|
203
|
+
"colorWarningBorderHover",
|
|
204
|
+
"colorWarningHover",
|
|
205
|
+
"colorWarningActive",
|
|
206
|
+
"colorWarningTextHover",
|
|
207
|
+
"colorWarningText",
|
|
208
|
+
"colorWarningTextActive",
|
|
209
|
+
"colorInfoBg",
|
|
210
|
+
"colorInfoBgHover",
|
|
211
|
+
"colorInfoBorder",
|
|
212
|
+
"colorInfoBorderHover",
|
|
213
|
+
"colorInfoHover",
|
|
214
|
+
"colorInfoActive",
|
|
215
|
+
"colorInfoTextHover",
|
|
216
|
+
"colorInfoText",
|
|
217
|
+
"colorInfoTextActive",
|
|
218
|
+
"colorErrorBg",
|
|
219
|
+
"colorErrorBgHover",
|
|
220
|
+
"colorErrorBorder",
|
|
221
|
+
"colorErrorBorderHover",
|
|
222
|
+
"colorErrorHover",
|
|
223
|
+
"colorErrorActive",
|
|
224
|
+
"colorErrorTextHover",
|
|
225
|
+
"colorErrorText",
|
|
226
|
+
"colorErrorTextActive",
|
|
227
|
+
"colorWhite",
|
|
228
|
+
"colorBgMask",
|
|
229
|
+
"colorFillContentHover",
|
|
230
|
+
"colorFillAlter",
|
|
231
|
+
"colorFillContent",
|
|
232
|
+
"colorBgContainerDisabled",
|
|
233
|
+
"colorBgTextHover",
|
|
234
|
+
"colorBgTextActive",
|
|
235
|
+
"colorBorderBg",
|
|
236
|
+
"colorSplit",
|
|
237
|
+
"colorTextPlaceholder",
|
|
238
|
+
"colorTextDisabled",
|
|
239
|
+
"colorTextHeading",
|
|
240
|
+
"colorTextLabel",
|
|
241
|
+
"colorTextDescription",
|
|
242
|
+
"colorTextLightSolid",
|
|
243
|
+
"colorIcon",
|
|
244
|
+
"colorIconHover",
|
|
245
|
+
"colorLink",
|
|
246
|
+
"colorLinkHover",
|
|
247
|
+
"colorLinkActive",
|
|
248
|
+
"colorLinkHighlight",
|
|
249
|
+
"controlOutline",
|
|
250
|
+
"controlWarningOutline",
|
|
251
|
+
"controlErrorOutline",
|
|
252
|
+
"controlItemBgHover",
|
|
253
|
+
"controlItemBgActive",
|
|
254
|
+
"controlItemBgActiveHover",
|
|
255
|
+
"controlItemBgActiveDisabled"
|
|
256
|
+
];
|
|
257
|
+
colorTokens.forEach((name) => regs.push(makeColorToken(name)));
|
|
258
|
+
const makeGenericToken = (name, type) => {
|
|
259
|
+
return {
|
|
260
|
+
name: `Sys: ${makeNiceName(name)}`,
|
|
261
|
+
value: `var(--antd-${name})`,
|
|
262
|
+
type
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
const spacingTokens = [
|
|
266
|
+
"lineWidth",
|
|
267
|
+
"borderRadius",
|
|
268
|
+
"controlHeight",
|
|
269
|
+
"sizeXXL",
|
|
270
|
+
"sizeXL",
|
|
271
|
+
"sizeLG",
|
|
272
|
+
"sizeMD",
|
|
273
|
+
"sizeMS",
|
|
274
|
+
"size",
|
|
275
|
+
"sizeSM",
|
|
276
|
+
"sizeXS",
|
|
277
|
+
"sizeXXS",
|
|
278
|
+
"controlHeightXS",
|
|
279
|
+
"controlHeightSM",
|
|
280
|
+
"controlHeightLG",
|
|
281
|
+
"lineWidthBold",
|
|
282
|
+
"borderRadiusXS",
|
|
283
|
+
"borderRadiusSM",
|
|
284
|
+
"borderRadiusLG",
|
|
285
|
+
"borderRadiusOuter",
|
|
286
|
+
"controlOutlineWidth",
|
|
287
|
+
"controlInteractiveSize",
|
|
288
|
+
"paddingXXS",
|
|
289
|
+
"paddingXS",
|
|
290
|
+
"paddingSM",
|
|
291
|
+
"padding",
|
|
292
|
+
"paddingMD",
|
|
293
|
+
"paddingLG",
|
|
294
|
+
"paddingXL",
|
|
295
|
+
"paddingContentHorizontalLG",
|
|
296
|
+
"paddingContentHorizontal",
|
|
297
|
+
"paddingContentHorizontalSM",
|
|
298
|
+
"paddingContentVerticalLG",
|
|
299
|
+
"paddingContentVertical",
|
|
300
|
+
"paddingContentVerticalSM",
|
|
301
|
+
"marginXXS",
|
|
302
|
+
"marginXS",
|
|
303
|
+
"marginSM",
|
|
304
|
+
"margin",
|
|
305
|
+
"marginMD",
|
|
306
|
+
"marginLG",
|
|
307
|
+
"marginXL",
|
|
308
|
+
"marginXXL",
|
|
309
|
+
"controlPaddingHorizontal",
|
|
310
|
+
"controlPaddingHorizontalSM"
|
|
311
|
+
];
|
|
312
|
+
spacingTokens.forEach((token) => regs.push(makeGenericToken(token, "spacing")));
|
|
313
|
+
const fontSizeTokens = [
|
|
314
|
+
"fontSizeSM",
|
|
315
|
+
"fontSizeLG",
|
|
316
|
+
"fontSizeXL",
|
|
317
|
+
"fontSizeHeading1",
|
|
318
|
+
"fontSizeHeading2",
|
|
319
|
+
"fontSizeHeading3",
|
|
320
|
+
"fontSizeHeading4",
|
|
321
|
+
"fontSizeHeading5"
|
|
322
|
+
];
|
|
323
|
+
fontSizeTokens.forEach((token) => regs.push(makeGenericToken(token, "font-size")));
|
|
324
|
+
const lineHeightTokens = [
|
|
325
|
+
"lineHeightLG",
|
|
326
|
+
"lineHeightSM",
|
|
327
|
+
"lineHeightHeading1",
|
|
328
|
+
"lineHeightHeading2",
|
|
329
|
+
"lineHeightHeading3",
|
|
330
|
+
"lineHeightHeading4",
|
|
331
|
+
"lineHeightHeading5"
|
|
332
|
+
];
|
|
333
|
+
lineHeightTokens.forEach((token) => regs.push(makeGenericToken(token, "line-height")));
|
|
334
|
+
if (loader) {
|
|
335
|
+
regs.forEach((t) => loader.registerToken(t));
|
|
336
|
+
} else {
|
|
337
|
+
regs.forEach((t) => registerToken(t));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
const registerConfigProvider = makeRegisterGlobalContext(AntdConfigProvider, __spreadProps(__spreadValues({
|
|
341
|
+
name: "plasmic-antd5-config-provider",
|
|
342
|
+
displayName: "Ant Design System Settings",
|
|
343
|
+
props: {
|
|
344
|
+
colorPrimary: {
|
|
345
|
+
type: "color",
|
|
346
|
+
defaultValue: "#1677ff"
|
|
347
|
+
},
|
|
348
|
+
colorSuccess: {
|
|
349
|
+
type: "color",
|
|
350
|
+
defaultValue: "#52c41a"
|
|
351
|
+
},
|
|
352
|
+
colorWarning: {
|
|
353
|
+
type: "color",
|
|
354
|
+
defaultValue: "#faad14"
|
|
355
|
+
},
|
|
356
|
+
colorError: {
|
|
357
|
+
type: "color",
|
|
358
|
+
defaultValue: "#ff4d4f"
|
|
359
|
+
},
|
|
360
|
+
colorInfo: {
|
|
361
|
+
type: "color",
|
|
362
|
+
defaultValue: "#1677ff"
|
|
363
|
+
},
|
|
364
|
+
colorBgBase: {
|
|
365
|
+
type: "color",
|
|
366
|
+
defaultValue: "#ffffff"
|
|
367
|
+
},
|
|
368
|
+
lineWidth: {
|
|
369
|
+
type: "number",
|
|
370
|
+
defaultValue: 1
|
|
371
|
+
},
|
|
372
|
+
borderRadius: {
|
|
373
|
+
type: "number",
|
|
374
|
+
defaultValue: 6
|
|
375
|
+
},
|
|
376
|
+
controlHeight: {
|
|
377
|
+
type: "number",
|
|
378
|
+
defaultValue: 32
|
|
379
|
+
},
|
|
380
|
+
sizeUnit: {
|
|
381
|
+
type: "number",
|
|
382
|
+
defaultValue: 4
|
|
383
|
+
},
|
|
384
|
+
sizeStep: {
|
|
385
|
+
type: "number",
|
|
386
|
+
defaultValue: 4
|
|
387
|
+
},
|
|
388
|
+
wireframe: {
|
|
389
|
+
type: "boolean",
|
|
390
|
+
defaultValue: false
|
|
391
|
+
},
|
|
392
|
+
spacing: {
|
|
393
|
+
type: "choice",
|
|
394
|
+
options: ["small", "middle", "large"]
|
|
395
|
+
},
|
|
396
|
+
themeStyles: {
|
|
397
|
+
type: "themeStyles"
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}, {
|
|
401
|
+
unstable__globalActions: {
|
|
402
|
+
showNotification: {
|
|
403
|
+
displayName: "Show notification",
|
|
404
|
+
parameters: {
|
|
405
|
+
type: {
|
|
406
|
+
type: "choice",
|
|
407
|
+
options: ["success", "error", "info", "warning"],
|
|
408
|
+
defaultValue: "info"
|
|
409
|
+
},
|
|
410
|
+
message: {
|
|
411
|
+
type: "string",
|
|
412
|
+
defaultValue: "A message for you!"
|
|
413
|
+
},
|
|
414
|
+
description: {
|
|
415
|
+
type: "string",
|
|
416
|
+
defaultValue: "Would you like to learn more?"
|
|
417
|
+
},
|
|
418
|
+
duration: {
|
|
419
|
+
type: "number",
|
|
420
|
+
defaultValueHint: 5
|
|
421
|
+
},
|
|
422
|
+
placement: {
|
|
423
|
+
type: "choice",
|
|
424
|
+
options: [
|
|
425
|
+
"top",
|
|
426
|
+
"topLeft",
|
|
427
|
+
"topRight",
|
|
428
|
+
"bottom",
|
|
429
|
+
"bottomLeft",
|
|
430
|
+
"bottomRight"
|
|
431
|
+
],
|
|
432
|
+
defaultValueHint: "topRight"
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
hideNotifications: {
|
|
437
|
+
displayName: "Hide notifications"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}), {
|
|
441
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerConfigProvider",
|
|
442
|
+
importName: "AntdConfigProvider"
|
|
443
|
+
}));
|
|
444
|
+
|
|
445
|
+
export { AntdConfigProvider, registerConfigProvider, registerTokens, themeToAntdConfig };
|
|
446
|
+
//# sourceMappingURL=registerConfigProvider.js.map
|