xmlui 0.9.23 → 0.9.30
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/dist/lib/apiInterceptorWorker-D8UVXhKa.mjs +818 -0
- package/dist/{index-B8C8yAZL.mjs → lib/index-BF7GNHsi.mjs} +12083 -3320
- package/dist/{style.css → lib/index.css} +7587 -5788
- package/dist/lib/language-server-web-worker.d.ts +655 -0
- package/dist/{language-server-web-worker.mjs → lib/language-server-web-worker.mjs} +1 -1
- package/dist/lib/language-server.d.ts +657 -0
- package/dist/{language-server.mjs → lib/language-server.mjs} +1 -1
- package/dist/lib/lint-CYAUfk0_.mjs +168 -0
- package/dist/lib/metadata-utils-CCIMqe69.mjs +466 -0
- package/dist/{server-common-DW5h7Q34.mjs → lib/server-common-B0FCNpIT.mjs} +4427 -1758
- package/dist/{lint-EcgF-9Wr.mjs → lib/transform-DC0Gy6qw.mjs} +1246 -540
- package/dist/{xmlui-parser.d.ts → lib/xmlui-parser.d.ts} +682 -4
- package/dist/{xmlui-parser.mjs → lib/xmlui-parser.mjs} +49 -48
- package/dist/{xmlui.d.ts → lib/xmlui.d.ts} +641 -1
- package/dist/{xmlui.mjs → lib/xmlui.mjs} +10 -10
- package/dist/{index.css → metadata/style.css} +6657 -6948
- package/dist/{xmlui-metadata.mjs → metadata/xmlui-metadata.mjs} +2703 -2553
- package/dist/{xmlui-metadata.umd.js → metadata/xmlui-metadata.umd.js} +2705 -2555
- package/dist/scripts/package.json +245 -0
- package/dist/scripts/src/components/App/App.js +0 -2
- package/dist/scripts/src/components/App/AppNative.js +22 -12
- package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -1
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +4 -5
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +5 -2
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +13 -10
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +7 -3
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +35 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +101 -0
- package/dist/scripts/src/components/CodeBlock/highlight-code.js +203 -0
- package/dist/scripts/src/components/ComponentProvider.js +5 -0
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +1 -0
- package/dist/scripts/src/components/Footer/FooterNative.js +2 -1
- package/dist/scripts/src/components/Form/FormNative.js +34 -18
- package/dist/scripts/src/components/FormItem/FormItem.js +5 -2
- package/dist/scripts/src/components/FormItem/FormItemNative.js +3 -3
- package/dist/scripts/src/components/Heading/Heading.js +16 -0
- package/dist/scripts/src/components/Heading/HeadingNative.js +2 -2
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +11 -7
- package/dist/scripts/src/components/Icon/DarkToLightIcon.js +10 -0
- package/dist/scripts/src/components/Icon/LightToDark.js +10 -0
- package/dist/scripts/src/components/IconProvider.js +4 -0
- package/dist/scripts/src/components/Image/ImageNative.js +1 -1
- package/dist/scripts/src/components/Link/Link.js +5 -5
- package/dist/scripts/src/components/List/ListNative.js +1 -1
- package/dist/scripts/src/components/Markdown/Markdown.js +56 -16
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +73 -80
- package/dist/scripts/src/components/Markdown/highlight-code.js +160 -0
- package/dist/scripts/src/components/Markdown/parse-binding-expr.js +60 -0
- package/dist/scripts/src/components/Markdown/utils.js +282 -0
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +116 -0
- package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +2 -2
- package/dist/scripts/src/components/NestedApp/NestedApp.js +61 -0
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +125 -0
- package/dist/scripts/src/components/NestedApp/Tooltip.js +46 -0
- package/dist/scripts/src/components/NumberBox/NumberBox.js +4 -1
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +2 -2
- package/dist/scripts/src/components/Option/Option.js +3 -2
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +2 -1
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +17 -1
- package/dist/scripts/src/components/Select/Select.js +5 -3
- package/dist/scripts/src/components/Select/SelectNative.js +53 -42
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +1 -1
- package/dist/scripts/src/components/Spinner/Spinner.js +0 -1
- package/dist/scripts/src/components/Switch/Switch.js +5 -3
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +1 -0
- package/dist/scripts/src/components/Text/Text.js +10 -4
- package/dist/scripts/src/components/Text/TextNative.js +5 -1
- package/dist/scripts/src/components/TextBox/TextBox.js +6 -1
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +2 -2
- package/dist/scripts/src/components/Theme/ThemeNative.js +7 -3
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +1 -3
- package/dist/scripts/src/components-core/RestApiProxy.js +10 -7
- package/dist/scripts/src/components-core/TableOfContentsContext.js +1 -1
- package/dist/scripts/src/components-core/appContext/date-functions.js +23 -0
- package/dist/scripts/src/components-core/appContext/math-function.js +27 -0
- package/dist/scripts/src/components-core/appContext/misc-utils.js +13 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +199 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +94 -0
- package/dist/scripts/src/components-core/interception/Backend.js +128 -0
- package/dist/scripts/src/components-core/interception/Errors.js +129 -0
- package/dist/scripts/src/components-core/interception/InMemoryDb.js +41 -0
- package/dist/scripts/src/components-core/interception/IndexedDb.js +207 -0
- package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +145 -0
- package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +46 -0
- package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
- package/dist/scripts/src/components-core/rendering/AppContent.js +336 -0
- package/dist/scripts/src/components-core/rendering/AppRoot.js +84 -0
- package/dist/scripts/src/components-core/rendering/AppWrapper.js +49 -0
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +17 -7
- package/dist/scripts/src/components-core/rendering/Container.js +2 -1
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +2 -7
- package/dist/scripts/src/components-core/theming/themes/root.js +1 -0
- package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
- package/dist/scripts/src/components-core/utils/hooks.js +26 -0
- package/dist/scripts/src/components-core/utils/misc.js +1 -1
- package/dist/scripts/src/components-core/utils/request-params.js +70 -0
- package/dist/scripts/src/logging/LoggerContext.js +22 -0
- package/dist/scripts/src/logging/LoggerInitializer.js +14 -0
- package/dist/scripts/src/logging/LoggerService.js +60 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +7 -0
- package/dist/standalone/xmlui-standalone.es.d.ts +2812 -0
- package/dist/{xmlui-standalone.umd.js → standalone/xmlui-standalone.umd.js} +34881 -31402
- package/package.json +31 -34
- package/dist/apiInterceptorWorker-DZyEgCvB.mjs +0 -8447
- package/dist/language-server-web-worker.d.ts +0 -22
- package/dist/language-server.d.ts +0 -24
- package/dist/parser-CBXS8ft2.mjs +0 -1196
- /package/dist/{core-XLM8cuFP.mjs → lib/core-XLM8cuFP.mjs} +0 -0
- /package/dist/{grammar.tmLanguage-CiEHpsbo.mjs → lib/grammar.tmLanguage-CiEHpsbo.mjs} +0 -0
- /package/dist/{wasm-DDgzZJey.mjs → lib/wasm-DDgzZJey.mjs} +0 -0
- /package/dist/{xmlui-h2uM9PUY.mjs → lib/xmlui-h2uM9PUY.mjs} +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NestedApp = NestedApp;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const client_1 = __importDefault(require("react-dom/client"));
|
|
10
|
+
const NestedApp_module_scss_1 = __importDefault(require("./NestedApp.module.scss"));
|
|
11
|
+
const AppRoot_1 = require("../../components-core/rendering/AppRoot");
|
|
12
|
+
const lia_1 = require("react-icons/lia");
|
|
13
|
+
const rx_1 = require("react-icons/rx");
|
|
14
|
+
const xmlui_parser_1 = require("../../components-core/xmlui-parser");
|
|
15
|
+
const ApiInterceptorProvider_1 = require("../../components-core/interception/ApiInterceptorProvider");
|
|
16
|
+
const ErrorBoundary_1 = require("../../components-core/rendering/ErrorBoundary");
|
|
17
|
+
const browser_1 = require("msw/browser");
|
|
18
|
+
const Tooltip_1 = require("./Tooltip");
|
|
19
|
+
const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
|
|
20
|
+
const constants_1 = require("../../components-core/constants");
|
|
21
|
+
function NestedApp({ api, app, components = constants_1.EMPTY_ARRAY, config, activeTheme, activeTone, title, height, allowPlaygroundPopup = true, }) {
|
|
22
|
+
const rootRef = (0, react_1.useRef)(null);
|
|
23
|
+
const shadowRef = (0, react_1.useRef)(null);
|
|
24
|
+
const contentRootRef = (0, react_1.useRef)(null);
|
|
25
|
+
const nestedAppId = (0, react_1.useId)();
|
|
26
|
+
const [refreshVersion, setRefreshVersion] = (0, react_1.useState)(0);
|
|
27
|
+
const theme = (0, ThemeContext_1.useTheme)();
|
|
28
|
+
const toneToApply = activeTone || (config === null || config === void 0 ? void 0 : config.defaultTone) || (theme === null || theme === void 0 ? void 0 : theme.activeThemeTone);
|
|
29
|
+
const apiWorker = (0, react_1.useMemo)(() => {
|
|
30
|
+
if (typeof document !== "undefined") {
|
|
31
|
+
return (0, browser_1.setupWorker)();
|
|
32
|
+
}
|
|
33
|
+
}, []);
|
|
34
|
+
(0, react_1.useEffect)(() => {
|
|
35
|
+
apiWorker === null || apiWorker === void 0 ? void 0 : apiWorker.start({
|
|
36
|
+
onUnhandledRequest: "bypass",
|
|
37
|
+
quiet: true,
|
|
38
|
+
});
|
|
39
|
+
return () => apiWorker === null || apiWorker === void 0 ? void 0 : apiWorker.stop();
|
|
40
|
+
}, [apiWorker]);
|
|
41
|
+
// console.log("apiWorker", apiWorker);
|
|
42
|
+
const mock = (0, react_1.useMemo)(() => {
|
|
43
|
+
return api
|
|
44
|
+
? Object.assign(Object.assign({ type: "in-memory" }, api), { apiUrl: "/api" }) : undefined;
|
|
45
|
+
}, [api]);
|
|
46
|
+
//console.log("mock", mock);
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
|
+
var _a;
|
|
49
|
+
if (!shadowRef.current && rootRef.current) {
|
|
50
|
+
// Clone existing style and link tags
|
|
51
|
+
shadowRef.current = rootRef.current.attachShadow({ mode: "open" });
|
|
52
|
+
const styleSheets = document.querySelectorAll('style, link[rel="stylesheet"]');
|
|
53
|
+
styleSheets.forEach((el) => {
|
|
54
|
+
if (el.hasAttribute("data-theme-root")) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
shadowRef.current.appendChild(el.cloneNode(true));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (!contentRootRef.current && shadowRef.current) {
|
|
61
|
+
contentRootRef.current = client_1.default.createRoot(shadowRef.current);
|
|
62
|
+
}
|
|
63
|
+
let { errors, component, erroneousCompoundComponentName } = (0, xmlui_parser_1.xmlUiMarkupToComponent)(`<Fragment xmlns:XMLUIExtensions="component-ns">${app}</Fragment>`);
|
|
64
|
+
if (errors.length > 0) {
|
|
65
|
+
component = (0, xmlui_parser_1.errReportComponent)(errors, "Main.xmlui", erroneousCompoundComponentName);
|
|
66
|
+
}
|
|
67
|
+
const compoundComponents = (components !== null && components !== void 0 ? components : []).map((src) => {
|
|
68
|
+
const isErrorReportComponent = typeof src !== "string";
|
|
69
|
+
if (isErrorReportComponent) {
|
|
70
|
+
return src;
|
|
71
|
+
}
|
|
72
|
+
let { errors, component, erroneousCompoundComponentName } = (0, xmlui_parser_1.xmlUiMarkupToComponent)(src);
|
|
73
|
+
if (errors.length > 0) {
|
|
74
|
+
return (0, xmlui_parser_1.errReportComponent)(errors, `nested xmlui`, erroneousCompoundComponentName);
|
|
75
|
+
}
|
|
76
|
+
return component;
|
|
77
|
+
});
|
|
78
|
+
let globalProps = Object.assign(Object.assign({ name: config === null || config === void 0 ? void 0 : config.name }, ((config === null || config === void 0 ? void 0 : config.appGlobals) || {})), { apiUrl: "" });
|
|
79
|
+
// css variables are leaking into to shadow dom, so we reset them here
|
|
80
|
+
const themeVarReset = {};
|
|
81
|
+
Object.keys(theme.themeStyles).forEach((key) => {
|
|
82
|
+
themeVarReset[key] = "initial";
|
|
83
|
+
});
|
|
84
|
+
(_a = contentRootRef.current) === null || _a === void 0 ? void 0 : _a.render((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { node: component, children: (0, jsx_runtime_1.jsx)(ApiInterceptorProvider_1.ApiInterceptorProvider, { interceptor: mock, apiWorker: apiWorker, children: (0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.nestedAppContainer, children: [(0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.header, children: [(0, jsx_runtime_1.jsx)("span", { className: NestedApp_module_scss_1.default.headerText, children: title }), (0, jsx_runtime_1.jsx)("div", { className: NestedApp_module_scss_1.default.spacer }), allowPlaygroundPopup && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { trigger: (0, jsx_runtime_1.jsx)("button", { className: NestedApp_module_scss_1.default.headerButton, onClick: () => {
|
|
85
|
+
// TODO: Open the app in a new window
|
|
86
|
+
}, children: (0, jsx_runtime_1.jsx)(rx_1.RxOpenInNewWindow, {}) }), label: "Edit code in new window" })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { trigger: (0, jsx_runtime_1.jsx)("button", { className: NestedApp_module_scss_1.default.headerButton, onClick: () => {
|
|
87
|
+
setRefreshVersion(refreshVersion + 1);
|
|
88
|
+
}, children: (0, jsx_runtime_1.jsx)(lia_1.LiaUndoAltSolid, {}) }), label: "Reset the app" })] }), (0, jsx_runtime_1.jsx)("div", { style: Object.assign({ height }, themeVarReset), children: (0, jsx_runtime_1.jsx)(AppRoot_1.AppRoot, { previewMode: true, standalone: true, trackContainerHeight: height ? "fixed" : "auto", node: component, globalProps: globalProps, defaultTheme: activeTheme || (config === null || config === void 0 ? void 0 : config.defaultTheme), defaultTone: toneToApply, contributes: {
|
|
89
|
+
compoundComponents,
|
|
90
|
+
themes: config === null || config === void 0 ? void 0 : config.themes,
|
|
91
|
+
}, resources: config === null || config === void 0 ? void 0 : config.resources }, `app-${nestedAppId}-${refreshVersion}`) })] }) }) }));
|
|
92
|
+
}, [
|
|
93
|
+
activeTheme,
|
|
94
|
+
allowPlaygroundPopup,
|
|
95
|
+
apiWorker,
|
|
96
|
+
app,
|
|
97
|
+
components,
|
|
98
|
+
config === null || config === void 0 ? void 0 : config.appGlobals,
|
|
99
|
+
config === null || config === void 0 ? void 0 : config.defaultTheme,
|
|
100
|
+
config === null || config === void 0 ? void 0 : config.name,
|
|
101
|
+
config === null || config === void 0 ? void 0 : config.resources,
|
|
102
|
+
config === null || config === void 0 ? void 0 : config.themes,
|
|
103
|
+
height,
|
|
104
|
+
mock,
|
|
105
|
+
nestedAppId,
|
|
106
|
+
refreshVersion,
|
|
107
|
+
theme.themeStyles,
|
|
108
|
+
title,
|
|
109
|
+
toneToApply,
|
|
110
|
+
]);
|
|
111
|
+
(0, react_1.useEffect)(() => {
|
|
112
|
+
return () => {
|
|
113
|
+
var _a;
|
|
114
|
+
(_a = contentRootRef.current) === null || _a === void 0 ? void 0 : _a.unmount();
|
|
115
|
+
contentRootRef.current = null;
|
|
116
|
+
};
|
|
117
|
+
}, []);
|
|
118
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: NestedApp_module_scss_1.default.nestedApp, children: (0, jsx_runtime_1.jsx)("div", { ref: rootRef, style: {
|
|
119
|
+
width: "100%",
|
|
120
|
+
height: "100%",
|
|
121
|
+
overflow: "auto",
|
|
122
|
+
position: "relative",
|
|
123
|
+
isolation: "isolate",
|
|
124
|
+
} }) }));
|
|
125
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Tooltip = void 0;
|
|
40
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
+
const RadixTooltip = __importStar(require("@radix-ui/react-tooltip"));
|
|
42
|
+
const Tooltip_module_scss_1 = __importDefault(require("./Tooltip.module.scss"));
|
|
43
|
+
const Tooltip = ({ trigger, label }) => {
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(RadixTooltip.Provider, { children: (0, jsx_runtime_1.jsxs)(RadixTooltip.Root, { children: [(0, jsx_runtime_1.jsx)(RadixTooltip.Trigger, { asChild: true, children: trigger }), (0, jsx_runtime_1.jsx)(RadixTooltip.Portal, { children: (0, jsx_runtime_1.jsx)(RadixTooltip.Content, { side: "bottom", align: "start", className: Tooltip_module_scss_1.default.TooltipContent, children: label }) })] }) }));
|
|
45
|
+
};
|
|
46
|
+
exports.Tooltip = Tooltip;
|
|
@@ -33,6 +33,9 @@ exports.NumberBoxMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
33
33
|
startIcon: (0, metadata_helpers_1.dStartIcon)(),
|
|
34
34
|
endText: (0, metadata_helpers_1.dEndText)(),
|
|
35
35
|
endIcon: (0, metadata_helpers_1.dEndIcon)(),
|
|
36
|
+
gap: {
|
|
37
|
+
description: "This property defines the gap between the adornments and the input area.",
|
|
38
|
+
},
|
|
36
39
|
hasSpinBox: {
|
|
37
40
|
description: `This boolean prop shows (\`true\`) or hides (\`false\`) the spinner buttons for the input field.`,
|
|
38
41
|
valueType: "boolean",
|
|
@@ -73,5 +76,5 @@ exports.NumberBoxMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
73
76
|
themeVars: (0, themeVars_1.parseScssVar)(NumberBox_module_scss_1.default.themeVars),
|
|
74
77
|
});
|
|
75
78
|
exports.numberBoxComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.NumberBoxMd, ({ node, state, updateState, lookupEventHandler, extractValue, layoutCss, registerComponentApi, }) => {
|
|
76
|
-
return ((0, jsx_runtime_1.jsx)(NumberBoxNative_1.NumberBox, { style: layoutCss, value: state === null || state === void 0 ? void 0 : state.value, initialValue: extractValue.asOptionalString(node.props.initialValue), step: extractValue(node.props.step), enabled: extractValue.asOptionalBoolean(node.props.enabled), placeholder: extractValue.asOptionalString(node.props.placeholder), validationStatus: extractValue(node.props.validationStatus), updateState: updateState, onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, hasSpinBox: extractValue.asOptionalBoolean(node.props.hasSpinBox), integersOnly: extractValue.asOptionalBoolean(node.props.integersOnly), zeroOrPositive: extractValue.asOptionalBoolean(node.props.zeroOrPositive), min: extractValue.asOptionalNumber(node.props.minValue), max: extractValue.asOptionalNumber(node.props.maxValue), startText: extractValue.asOptionalString(node.props.startText), startIcon: extractValue.asOptionalString(node.props.startIcon), endText: extractValue.asOptionalString(node.props.endText), endIcon: extractValue.asOptionalString(node.props.endIcon), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), maxLength: extractValue(node.props.maxLength), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required) }));
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)(NumberBoxNative_1.NumberBox, { style: layoutCss, value: state === null || state === void 0 ? void 0 : state.value, initialValue: extractValue.asOptionalString(node.props.initialValue), step: extractValue(node.props.step), enabled: extractValue.asOptionalBoolean(node.props.enabled), placeholder: extractValue.asOptionalString(node.props.placeholder), validationStatus: extractValue(node.props.validationStatus), updateState: updateState, onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, hasSpinBox: extractValue.asOptionalBoolean(node.props.hasSpinBox), integersOnly: extractValue.asOptionalBoolean(node.props.integersOnly), zeroOrPositive: extractValue.asOptionalBoolean(node.props.zeroOrPositive), min: extractValue.asOptionalNumber(node.props.minValue), max: extractValue.asOptionalNumber(node.props.maxValue), startText: extractValue.asOptionalString(node.props.startText), startIcon: extractValue.asOptionalString(node.props.startIcon), endText: extractValue.asOptionalString(node.props.endText), gap: extractValue.asOptionalString(node.props.gap), endIcon: extractValue.asOptionalString(node.props.endIcon), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), maxLength: extractValue(node.props.maxLength), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required) }));
|
|
77
80
|
});
|
|
@@ -48,7 +48,7 @@ const IconNative_1 = require("../Icon/IconNative");
|
|
|
48
48
|
const InputAdornment_1 = require("../Input/InputAdornment");
|
|
49
49
|
const ButtonNative_1 = require("../Button/ButtonNative");
|
|
50
50
|
const ItemWithLabel_1 = require("../FormItem/ItemWithLabel");
|
|
51
|
-
exports.NumberBox = (0, react_1.forwardRef)(function NumberBox({ id, value, initialValue, style, enabled = true, placeholder, validationStatus = "none", hasSpinBox = true, step, integersOnly = false, zeroOrPositive = false, min = zeroOrPositive ? 0 : -numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, max = numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, maxLength, updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, startText, startIcon, endText, endIcon, autoFocus, readOnly, required, label, labelPosition, labelWidth, labelBreak, }, forwardedRef) {
|
|
51
|
+
exports.NumberBox = (0, react_1.forwardRef)(function NumberBox({ id, value, initialValue, style, enabled = true, placeholder, validationStatus = "none", hasSpinBox = true, step, integersOnly = false, zeroOrPositive = false, min = zeroOrPositive ? 0 : -numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, max = numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, maxLength, updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, startText, startIcon, endText, endIcon, gap, autoFocus, readOnly, required, label, labelPosition, labelWidth, labelBreak, }, forwardedRef) {
|
|
52
52
|
var _a;
|
|
53
53
|
// Ensure the provided minimum is not smaller than the 0 if zeroOrPositive is set to true
|
|
54
54
|
min = Math.max(zeroOrPositive ? 0 : -numberbox_abstractions_1.NUMBERBOX_MAX_VALUE, min);
|
|
@@ -288,7 +288,7 @@ exports.NumberBox = (0, react_1.forwardRef)(function NumberBox({ id, value, init
|
|
|
288
288
|
}), tabIndex: -1, onFocus: () => {
|
|
289
289
|
var _a;
|
|
290
290
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
291
|
-
}, children: [(0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: startText, iconName: startIcon, className: NumberBox_module_scss_1.default.adornment }), (0, jsx_runtime_1.jsx)("input", { id: id, type: "text", inputMode: "numeric", className: (0, classnames_1.default)(NumberBox_module_scss_1.default.input, { [NumberBox_module_scss_1.default.readOnly]: readOnly }), disabled: !enabled, value: valueStrRep, step: step, placeholder: placeholder, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, onBeforeInput: handleOnBeforeInput, onKeyDown: handleOnKey, readOnly: readOnly, ref: inputRef, autoFocus: autoFocus, maxLength: maxLength, required: required }), (0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: endText, iconName: endIcon, className: NumberBox_module_scss_1.default.adornment }), hasSpinBox && ((0, jsx_runtime_1.jsxs)("div", { className: NumberBox_module_scss_1.default.spinnerBox, children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { "data-spinner": "up", type: "button", variant: "ghost", themeColor: "secondary", tabIndex: -1, className: NumberBox_module_scss_1.default.spinnerButton, disabled: !enabled || readOnly, ref: upButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "chevronup", size: "sm" }) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { "data-spinner": "down", type: "button", tabIndex: -1, variant: "ghost", themeColor: "secondary", className: NumberBox_module_scss_1.default.spinnerButton, disabled: !enabled || readOnly, ref: downButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "chevrondown", size: "sm" }) })] }))] }) }));
|
|
291
|
+
}, style: { gap }, children: [(0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: startText, iconName: startIcon, className: NumberBox_module_scss_1.default.adornment }), (0, jsx_runtime_1.jsx)("input", { id: id, type: "text", inputMode: "numeric", className: (0, classnames_1.default)(NumberBox_module_scss_1.default.input, { [NumberBox_module_scss_1.default.readOnly]: readOnly }), disabled: !enabled, value: valueStrRep, step: step, placeholder: placeholder, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, onBeforeInput: handleOnBeforeInput, onKeyDown: handleOnKey, readOnly: readOnly, ref: inputRef, autoFocus: autoFocus, maxLength: maxLength, required: required }), (0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: endText, iconName: endIcon, className: NumberBox_module_scss_1.default.adornment }), hasSpinBox && ((0, jsx_runtime_1.jsxs)("div", { className: NumberBox_module_scss_1.default.spinnerBox, children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { "data-spinner": "up", type: "button", variant: "ghost", themeColor: "secondary", tabIndex: -1, className: NumberBox_module_scss_1.default.spinnerButton, disabled: !enabled || readOnly, ref: upButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "chevronup", size: "sm" }) }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { "data-spinner": "down", type: "button", tabIndex: -1, variant: "ghost", themeColor: "secondary", className: NumberBox_module_scss_1.default.spinnerButton, disabled: !enabled || readOnly, ref: downButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "chevrondown", size: "sm" }) })] }))] }) }));
|
|
292
292
|
});
|
|
293
293
|
function applyStep(valueStrRep, step, min, max, integersOnly) {
|
|
294
294
|
const currentValue = (0, numberbox_abstractions_1.toUsableNumber)(valueStrRep, integersOnly);
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
7
7
|
const renderers_1 = require("../../components-core/renderers");
|
|
8
8
|
const metadata_helpers_1 = require("../metadata-helpers");
|
|
9
|
-
const OptionTypeProvider_1 = require("
|
|
9
|
+
const OptionTypeProvider_1 = require("./OptionTypeProvider");
|
|
10
10
|
const container_helpers_1 = require("../container-helpers");
|
|
11
11
|
const COMP = "Option";
|
|
12
12
|
exports.OptionMd = (0, ComponentDefs_1.createMetadata)({
|
|
@@ -21,6 +21,7 @@ exports.OptionMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
21
21
|
enabled: (0, metadata_helpers_1.dEnabled)(),
|
|
22
22
|
optionTemplate: (0, ComponentDefs_1.d)("This property is used to define a custom option template"),
|
|
23
23
|
},
|
|
24
|
+
childrenAsTemplate: "optionTemplate",
|
|
24
25
|
});
|
|
25
26
|
const OptionNative = (0, react_1.memo)((props) => {
|
|
26
27
|
const OptionType = (0, OptionTypeProvider_1.useOptionType)();
|
|
@@ -34,5 +35,5 @@ exports.optionComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP,
|
|
|
34
35
|
const optionTemplate = node.props.optionTemplate;
|
|
35
36
|
return ((0, jsx_runtime_1.jsx)(OptionNative, { optionRenderer: optionTemplate
|
|
36
37
|
? (contextVars) => ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: optionTemplate, renderChild: renderChild, contextVars: contextVars, layoutContext: layoutContext }))
|
|
37
|
-
: undefined, value: extractValue(node.props.value), label: extractValue.asOptionalString(node.props.label) ||
|
|
38
|
+
: undefined, value: extractValue(node.props.value), label: extractValue.asOptionalString(node.props.label) || extractValue(node.props.value), enabled: extractValue.asOptionalBoolean(node.props.enabled), style: layoutCss }));
|
|
38
39
|
});
|
|
@@ -39,7 +39,8 @@ exports.RadioGroupMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
39
39
|
themeVars: (0, themeVars_1.parseScssVar)(RadioGroup_module_scss_1.default.themeVars),
|
|
40
40
|
defaultThemeVars: {
|
|
41
41
|
[`gap-${RGOption}`]: "$space-1_5",
|
|
42
|
-
[`borderWidth-${RGOption}`]: "
|
|
42
|
+
[`borderWidth-${RGOption}`]: "1px",
|
|
43
|
+
[`backgroundColor-checked-${RGOption}-indicator`]: `$backgroundColor-primary`,
|
|
43
44
|
[`backgroundColor-checked-${RGOption}--disabled]`]: `$borderColor-${RGOption}--disabled`,
|
|
44
45
|
[`backgroundColor-checked-${RGOption}-error`]: `$borderColor-${RGOption}-error`,
|
|
45
46
|
[`backgroundColor-checked-${RGOption}-warning`]: `$borderColor-${RGOption}-warning`,
|
|
@@ -37,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.RadioGroupOption = exports.RadioGroup = void 0;
|
|
40
|
+
exports.useRadioGroupValue = useRadioGroupValue;
|
|
40
41
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
42
|
const react_1 = __importStar(require("react"));
|
|
42
43
|
const InnerRadioGroup = __importStar(require("@radix-ui/react-radio-group"));
|
|
@@ -89,16 +90,31 @@ exports.RadioGroup = (0, react_1.forwardRef)(function RadioGroup({ id, value = "
|
|
|
89
90
|
[RadioGroup_module_scss_1.default.disabled]: !enabled,
|
|
90
91
|
}), children: children }) }) }) }));
|
|
91
92
|
});
|
|
93
|
+
function useRadioGroupValue() {
|
|
94
|
+
const context = (0, react_1.useContext)(RadioGroupValidationStatusContext);
|
|
95
|
+
if (!context) {
|
|
96
|
+
throw new Error("useRadioGroupValue must be used within a RadioGroup");
|
|
97
|
+
}
|
|
98
|
+
const { value } = context;
|
|
99
|
+
const isChecked = (0, react_1.useCallback)((optionValue) => value === optionValue, [value]);
|
|
100
|
+
return {
|
|
101
|
+
value,
|
|
102
|
+
isChecked,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
92
105
|
const RadioGroupOption = ({ value, label, enabled = true, optionRenderer, style, }) => {
|
|
93
106
|
const id = (0, react_1.useId)();
|
|
94
107
|
const validationContext = (0, react_1.useContext)(RadioGroupValidationStatusContext);
|
|
108
|
+
const { isChecked } = useRadioGroupValue();
|
|
95
109
|
const statusStyles = (0, react_1.useMemo)(() => ({
|
|
96
110
|
[RadioGroup_module_scss_1.default.disabled]: !enabled,
|
|
97
111
|
[RadioGroup_module_scss_1.default.error]: value === validationContext.value && validationContext.status === "error",
|
|
98
112
|
[RadioGroup_module_scss_1.default.warning]: value === validationContext.value && validationContext.status === "warning",
|
|
99
113
|
[RadioGroup_module_scss_1.default.valid]: value === validationContext.value && validationContext.status === "valid",
|
|
100
114
|
}), [enabled, validationContext.status, validationContext.value, value]);
|
|
101
|
-
const item = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(InnerRadioGroup.Item, { className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.radioOption, statusStyles
|
|
115
|
+
const item = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(InnerRadioGroup.Item, { className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.radioOption, statusStyles, {
|
|
116
|
+
[RadioGroup_module_scss_1.default.checked]: isChecked(value),
|
|
117
|
+
}), value: value, disabled: !enabled, id: id, children: (0, jsx_runtime_1.jsx)(InnerRadioGroup.Indicator, { className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.indicator, statusStyles) }) }), (0, jsx_runtime_1.jsx)("label", { htmlFor: id, className: (0, classnames_1.default)(RadioGroup_module_scss_1.default.label, statusStyles), children: label !== null && label !== void 0 ? label : value })] })), [enabled, id, label, statusStyles, value]);
|
|
102
118
|
return ((0, jsx_runtime_1.jsx)("div", { className: RadioGroup_module_scss_1.default.radioOptionContainer, style: style, children: optionRenderer ? ((0, jsx_runtime_1.jsxs)("label", { className: RadioGroup_module_scss_1.default.optionLabel, children: [(0, jsx_runtime_1.jsx)("div", { className: RadioGroup_module_scss_1.default.itemContainer, children: item }), optionRenderer({
|
|
103
119
|
$checked: value === validationContext.value,
|
|
104
120
|
})] })) : (item) }, id));
|
|
@@ -83,7 +83,9 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
83
83
|
},
|
|
84
84
|
});
|
|
85
85
|
exports.selectComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.SelectMd, ({ node, state, updateState, extractValue, renderChild, lookupEventHandler, layoutCss, registerComponentApi, }) => {
|
|
86
|
-
|
|
86
|
+
const multiSelect = extractValue.asOptionalBoolean(node.props.multiSelect);
|
|
87
|
+
const searchable = extractValue.asOptionalBoolean(node.props.searchable);
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(SelectNative_1.Select, { multiSelect: multiSelect, style: layoutCss, inProgress: extractValue.asOptionalBoolean(node.props.inProgress), inProgressNotificationMessage: extractValue.asOptionalString(node.props.inProgressNotificationMessage), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), updateState: updateState, searchable: searchable, initialValue: extractValue(node.props.initialValue), value: state === null || state === void 0 ? void 0 : state.value, autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), enabled: extractValue.asOptionalBoolean(node.props.enabled), placeholder: extractValue.asOptionalString(node.props.placeholder), validationStatus: extractValue(node.props.validationStatus), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, emptyListTemplate: renderChild(node.props.emptyListTemplate), dropdownHeight: extractValue(node.props.dropdownHeight), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required), optionLabelRenderer: node.props.optionLabelTemplate
|
|
87
89
|
? (item) => {
|
|
88
90
|
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.optionLabelTemplate, item: item, renderChild: renderChild }));
|
|
89
91
|
}
|
|
@@ -91,8 +93,8 @@ exports.selectComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP,
|
|
|
91
93
|
? (item, val, inTrigger) => {
|
|
92
94
|
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.optionTemplate, item: item, contextVars: {
|
|
93
95
|
$selectedValue: val,
|
|
94
|
-
$inTrigger: inTrigger
|
|
95
|
-
}, renderChild: (...args) => ((0, jsx_runtime_1.jsx)(react_select_1.SelectItemText, { children: renderChild(...args) })) }));
|
|
96
|
+
$inTrigger: inTrigger,
|
|
97
|
+
}, renderChild: (...args) => multiSelect || searchable ? (renderChild(...args)) : ((0, jsx_runtime_1.jsx)(react_select_1.SelectItemText, { children: renderChild(...args) })) }));
|
|
96
98
|
}
|
|
97
99
|
: undefined, valueRenderer: node.props.valueTemplate
|
|
98
100
|
? (item, removeItem) => {
|
|
@@ -56,24 +56,28 @@ const OptionTypeProvider_1 = __importDefault(require("../Option/OptionTypeProvid
|
|
|
56
56
|
const OptionContext_1 = require("./OptionContext");
|
|
57
57
|
const ItemWithLabel_1 = require("../FormItem/ItemWithLabel");
|
|
58
58
|
const SimpleSelect = (0, react_1.forwardRef)(function SimpleSelect(props, forwardedRef) {
|
|
59
|
+
var _a;
|
|
59
60
|
const { root } = (0, ThemeContext_1.useTheme)();
|
|
60
|
-
const { enabled, onBlur, autoFocus, onValueChange, validationStatus,
|
|
61
|
+
const { enabled, onBlur, autoFocus, onValueChange, validationStatus, value, height, style, placeholder, id, triggerRef, onFocus, options, children, readOnly, } = props;
|
|
61
62
|
const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(triggerRef, forwardedRef) : triggerRef;
|
|
62
|
-
const stringValue =
|
|
63
|
+
const stringValue = (0, react_1.useMemo)(() => {
|
|
64
|
+
return value != undefined ? value + "" : undefined;
|
|
65
|
+
}, [value]);
|
|
63
66
|
const onValChange = (0, react_1.useCallback)((val) => {
|
|
64
67
|
var _a;
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
if (readOnly) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const match = Array.from(options).find((o) => `${o.value}` === val);
|
|
72
|
+
onValueChange((_a = match === null || match === void 0 ? void 0 : match.value) !== null && _a !== void 0 ? _a : val);
|
|
67
73
|
}, [onValueChange, options]);
|
|
68
|
-
return ((0, jsx_runtime_1.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// position="popper"
|
|
74
|
-
style: { height: height }, children: [(0, jsx_runtime_1.jsx)(react_select_1.ScrollUpButton, { className: Select_module_scss_1.default.selectScrollUpButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevronup" }) }), (0, jsx_runtime_1.jsx)(react_select_1.Viewport, { className: (0, classnames_1.default)(Select_module_scss_1.default.selectViewport), children: children }), (0, jsx_runtime_1.jsx)(react_select_1.ScrollDownButton, { className: Select_module_scss_1.default.selectScrollDownButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" }) })] }) })] }) }));
|
|
74
|
+
return ((0, jsx_runtime_1.jsxs)(react_select_1.Root, { value: stringValue, onValueChange: onValChange, children: [(0, jsx_runtime_1.jsxs)(react_select_1.Trigger, { id: id, "aria-haspopup": "listbox", style: style, onFocus: onFocus, onBlur: onBlur, disabled: !enabled, className: (0, classnames_1.default)(Select_module_scss_1.default.selectTrigger, {
|
|
75
|
+
[Select_module_scss_1.default.error]: validationStatus === "error",
|
|
76
|
+
[Select_module_scss_1.default.warning]: validationStatus === "warning",
|
|
77
|
+
[Select_module_scss_1.default.valid]: validationStatus === "valid",
|
|
78
|
+
}), ref: ref, autoFocus: autoFocus, children: [(0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.selectValue, children: readOnly ? (((_a = Array.from(options).find((o) => `${o.value}` === stringValue)) === null || _a === void 0 ? void 0 : _a.label) || (0, jsx_runtime_1.jsx)("span", { children: placeholder })) : ((0, jsx_runtime_1.jsx)(react_select_1.Value, { placeholder: placeholder })) }), (0, jsx_runtime_1.jsx)(react_select_1.Icon, { asChild: true, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" }) })] }), (0, jsx_runtime_1.jsx)(react_select_1.Portal, { container: root, children: (0, jsx_runtime_1.jsxs)(react_select_1.Content, { className: Select_module_scss_1.default.selectContent, position: "popper", style: { height: height }, children: [(0, jsx_runtime_1.jsx)(react_select_1.ScrollUpButton, { className: Select_module_scss_1.default.selectScrollUpButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevronup" }) }), (0, jsx_runtime_1.jsx)(react_select_1.SelectViewport, { className: Select_module_scss_1.default.selectViewport, role: "listbox", children: children }), (0, jsx_runtime_1.jsx)(react_select_1.ScrollDownButton, { className: Select_module_scss_1.default.selectScrollDownButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" }) })] }) })] }));
|
|
75
79
|
});
|
|
76
|
-
exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, value, enabled = true, placeholder, updateState = constants_1.noop, validationStatus = "none", onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, emptyListTemplate, optionLabelRenderer, optionRenderer, valueRenderer, style, dropdownHeight, children, autoFocus = false, searchable = false, multiSelect = false, label, labelPosition, labelWidth, labelBreak, required = false, inProgress = false, inProgressNotificationMessage = "Loading...", }, ref) {
|
|
80
|
+
exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, value, enabled = true, placeholder, updateState = constants_1.noop, validationStatus = "none", onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, emptyListTemplate, optionLabelRenderer, optionRenderer, valueRenderer, style, dropdownHeight, children, autoFocus = false, searchable = false, multiSelect = false, label, labelPosition, labelWidth, labelBreak = false, required = false, inProgress = false, inProgressNotificationMessage = "Loading...", readOnly = false, }, ref) {
|
|
77
81
|
var _a;
|
|
78
82
|
const [referenceElement, setReferenceElement] = (0, react_1.useState)(null);
|
|
79
83
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
@@ -81,6 +85,8 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
81
85
|
const observer = (0, react_1.useRef)();
|
|
82
86
|
const { root } = (0, ThemeContext_1.useTheme)();
|
|
83
87
|
const [options, setOptions] = (0, react_1.useState)(new Set());
|
|
88
|
+
const generatedId = (0, react_1.useId)();
|
|
89
|
+
const inputId = id || generatedId;
|
|
84
90
|
// Set initial state based on the initialValue prop
|
|
85
91
|
(0, react_1.useEffect)(() => {
|
|
86
92
|
if (initialValue !== undefined) {
|
|
@@ -114,7 +120,9 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
114
120
|
: selectedValue;
|
|
115
121
|
updateState({ value: newSelectedValue });
|
|
116
122
|
onDidChange(newSelectedValue);
|
|
117
|
-
|
|
123
|
+
if (!multiSelect) {
|
|
124
|
+
setOpen(false);
|
|
125
|
+
}
|
|
118
126
|
}, [multiSelect, value, updateState, onDidChange]);
|
|
119
127
|
// Clear selected value
|
|
120
128
|
const clearValue = (0, react_1.useCallback)(() => {
|
|
@@ -167,68 +175,71 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
167
175
|
optionLabelRenderer,
|
|
168
176
|
optionRenderer,
|
|
169
177
|
onChange: toggleOption,
|
|
178
|
+
setOpen,
|
|
170
179
|
}), [multiSelect, toggleOption, value, optionLabelRenderer, optionRenderer]);
|
|
171
|
-
return ((0, jsx_runtime_1.jsx)(SelectContext_1.SelectContext.Provider, { value: selectContextValue, children: (0, jsx_runtime_1.jsx)(OptionContext_1.OptionContext.Provider, { value: optionContextValue, children:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
return ((0, jsx_runtime_1.jsx)(SelectContext_1.SelectContext.Provider, { value: selectContextValue, children: (0, jsx_runtime_1.jsx)(OptionContext_1.OptionContext.Provider, { value: optionContextValue, children: (0, jsx_runtime_1.jsxs)(OptionTypeProvider_1.default, { Component: HiddenOption, children: [(0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: ref, id: inputId, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: searchable || multiSelect ? ((0, jsx_runtime_1.jsxs)(react_popover_1.Popover, { open: open, onOpenChange: setOpen, modal: false, children: [(0, jsx_runtime_1.jsxs)(react_popover_1.PopoverTrigger, { id: inputId, "aria-haspopup": "listbox", style: style, ref: setReferenceElement, onFocus: onFocus, onBlur: onBlur, disabled: !enabled, "aria-expanded": open, onClick: () => setOpen((prev) => !prev), className: (0, classnames_1.default)(Select_module_scss_1.default.selectTrigger, Select_module_scss_1.default[validationStatus], {
|
|
181
|
+
[Select_module_scss_1.default.disabled]: !enabled,
|
|
182
|
+
[Select_module_scss_1.default.multi]: multiSelect,
|
|
183
|
+
}), placeholder: placeholder, autoFocus: autoFocus, children: [multiSelect ? (Array.isArray(value) && value.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.badgeListContainer, children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.badgeList, children: value.map((v) => {
|
|
184
|
+
var _a;
|
|
185
|
+
return valueRenderer ? (valueRenderer(Array.from(options).find((o) => o.value === `${v}`), () => {
|
|
186
|
+
toggleOption(v);
|
|
187
|
+
})) : ((0, jsx_runtime_1.jsxs)("span", { className: Select_module_scss_1.default.badge, children: [(_a = Array.from(options).find((o) => o.value === `${v}`)) === null || _a === void 0 ? void 0 : _a.label, (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "close", size: "sm", onClick: (event) => {
|
|
188
|
+
event.stopPropagation();
|
|
189
|
+
toggleOption(v);
|
|
190
|
+
} })] }, v));
|
|
191
|
+
}) }) })) : ((0, jsx_runtime_1.jsx)("span", { className: Select_module_scss_1.default.placeholder, children: placeholder }))) : value !== undefined && value !== null ? ((0, jsx_runtime_1.jsx)("div", { children: (_a = Array.from(options).find((o) => o.value === value)) === null || _a === void 0 ? void 0 : _a.label })) : ((0, jsx_runtime_1.jsx)("span", { className: Select_module_scss_1.default.placeholder, children: placeholder || "" })), (0, jsx_runtime_1.jsxs)("div", { className: Select_module_scss_1.default.actions, children: [multiSelect && Array.isArray(value) && value.length > 0 && ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "close", onClick: (event) => {
|
|
192
|
+
event.stopPropagation();
|
|
193
|
+
clearValue();
|
|
194
|
+
} })), (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" })] })] }), open && ((0, jsx_runtime_1.jsx)(react_select_1.Portal, { container: root, children: (0, jsx_runtime_1.jsx)(react_focus_scope_1.FocusScope, { asChild: true, loop: true, trapped: true, children: (0, jsx_runtime_1.jsx)(react_popover_1.PopoverContent, { style: { width, height: dropdownHeight }, className: Select_module_scss_1.default.selectContent, children: (0, jsx_runtime_1.jsxs)(cmdk_1.Command, { className: Select_module_scss_1.default.command, shouldFilter: searchable, filter: (value, search, keywords) => {
|
|
186
195
|
const extendedValue = value + " " + keywords.join(" ");
|
|
187
196
|
if (extendedValue.toLowerCase().includes(search.toLowerCase()))
|
|
188
197
|
return 1;
|
|
189
198
|
return 0;
|
|
190
199
|
}, children: [searchable ? ((0, jsx_runtime_1.jsxs)("div", { className: Select_module_scss_1.default.commandInputContainer, children: [(0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "search" }), (0, jsx_runtime_1.jsx)(cmdk_1.CommandInput, { className: (0, classnames_1.default)(Select_module_scss_1.default.commandInput), placeholder: "Search..." })] })) : (
|
|
191
200
|
// https://github.com/pacocoursey/cmdk/issues/322#issuecomment-2444703817
|
|
192
|
-
(0, jsx_runtime_1.jsx)("button", { autoFocus: true, "aria-hidden": "true", className: Select_module_scss_1.default.srOnly })), (0, jsx_runtime_1.jsxs)(cmdk_1.CommandList, { className: Select_module_scss_1.default.commandList, children: [inProgress && ((0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.loading, children: inProgressNotificationMessage })), Array.from(options).map(({ value, label, enabled, keywords }) => ((0, jsx_runtime_1.jsx)(exports.ComboboxOption, { value: value, label: label, enabled: enabled, keywords: keywords }, value))), !inProgress && (0, jsx_runtime_1.jsx)(cmdk_1.CommandEmpty, { children: emptyListNode })] })] }) }) }) }))] })
|
|
201
|
+
(0, jsx_runtime_1.jsx)("button", { autoFocus: true, "aria-hidden": "true", className: Select_module_scss_1.default.srOnly })), (0, jsx_runtime_1.jsxs)(cmdk_1.CommandList, { className: Select_module_scss_1.default.commandList, children: [inProgress && ((0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.loading, children: inProgressNotificationMessage })), Array.from(options).map(({ value, label, enabled, keywords }) => ((0, jsx_runtime_1.jsx)(exports.ComboboxOption, { readOnly: readOnly, value: value, label: label, enabled: enabled, keywords: keywords }, value))), !inProgress && (0, jsx_runtime_1.jsx)(cmdk_1.CommandEmpty, { children: emptyListNode })] })] }) }) }) }))] })) : ((0, jsx_runtime_1.jsx)(SimpleSelect, { readOnly: !!readOnly, ref: ref, value: value, options: options, onValueChange: toggleOption, id: inputId, style: style, onFocus: onFocus, onBlur: onBlur, enabled: enabled, validationStatus: validationStatus, triggerRef: setReferenceElement, autoFocus: autoFocus, placeholder: placeholder, height: dropdownHeight, children: options.size > 0
|
|
202
|
+
? Array.from(options).map((option) => ((0, jsx_runtime_1.jsx)(SelectOption, { value: option.value, label: option.label, enabled: option.enabled }, option.value)))
|
|
203
|
+
: emptyListNode })) }), children] }) }) }));
|
|
193
204
|
});
|
|
194
205
|
exports.ComboboxOption = (0, react_1.forwardRef)(function Combobox(option, forwardedRef) {
|
|
195
206
|
const id = (0, react_1.useId)();
|
|
196
|
-
const { label, value, enabled = true, keywords } = option;
|
|
197
|
-
const { value: selectedValue, onChange, multiSelect, optionLabelRenderer, optionRenderer, } = (0, SelectContext_1.useSelect)();
|
|
207
|
+
const { label, value, enabled = true, keywords, readOnly } = option;
|
|
208
|
+
const { value: selectedValue, onChange, multiSelect, optionLabelRenderer, optionRenderer, setOpen, } = (0, SelectContext_1.useSelect)();
|
|
198
209
|
const selected = (0, react_1.useMemo)(() => {
|
|
199
210
|
return Array.isArray(selectedValue) && multiSelect
|
|
200
211
|
? selectedValue.includes(value)
|
|
201
212
|
: selectedValue === value;
|
|
202
213
|
}, [selectedValue, value, multiSelect]);
|
|
203
|
-
return ((0, jsx_runtime_1.jsx)(cmdk_1.CommandItem, { id: id, ref: forwardedRef, disabled: !enabled, value:
|
|
214
|
+
return ((0, jsx_runtime_1.jsx)(cmdk_1.CommandItem, { id: id, ref: forwardedRef, disabled: !enabled, value: value, className: Select_module_scss_1.default.multiComboboxOption, onSelect: () => {
|
|
215
|
+
if (readOnly) {
|
|
216
|
+
setOpen(false);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
204
219
|
onChange(value);
|
|
205
220
|
}, "data-state": selected ? "checked" : undefined, keywords: keywords, children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.multiComboboxOptionContent, children: optionRenderer ? (optionRenderer({ label, value, enabled, keywords }, selectedValue, false)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [optionLabelRenderer ? optionLabelRenderer({ label, value }) : label, selected && (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" })] })) }) }, id));
|
|
206
221
|
});
|
|
207
222
|
function HiddenOption(option) {
|
|
223
|
+
const { optionRenderer, label } = option;
|
|
208
224
|
const { onOptionRemove, onOptionAdd } = (0, OptionContext_1.useOption)();
|
|
209
225
|
const [node, setNode] = (0, react_1.useState)(null);
|
|
210
226
|
const opt = (0, react_1.useMemo)(() => {
|
|
211
227
|
var _a, _b;
|
|
212
|
-
return Object.assign(Object.assign({}, option), {
|
|
228
|
+
return Object.assign(Object.assign({}, option), { label: (_a = label !== null && label !== void 0 ? label : node === null || node === void 0 ? void 0 : node.textContent) !== null && _a !== void 0 ? _a : "", keywords: [(_b = node === null || node === void 0 ? void 0 : node.textContent) !== null && _b !== void 0 ? _b : ""] });
|
|
213
229
|
}, [option, node]);
|
|
214
230
|
(0, react_1.useEffect)(() => {
|
|
215
231
|
onOptionAdd(opt);
|
|
216
232
|
return () => onOptionRemove(opt);
|
|
217
233
|
}, [opt, onOptionAdd, onOptionRemove]);
|
|
218
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: (el) => setNode(el), style: { display: "none" }, children:
|
|
234
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: (el) => setNode(el), style: { display: "none" }, children: optionRenderer === null || optionRenderer === void 0 ? void 0 : optionRenderer({}) }));
|
|
219
235
|
}
|
|
220
236
|
const SelectOption = react_1.default.forwardRef((option, ref) => {
|
|
221
237
|
const { value, label, enabled = true } = option;
|
|
222
|
-
const {
|
|
223
|
-
|
|
224
|
-
(0, react_1.useLayoutEffect)(() => {
|
|
225
|
-
onOptionAdd(option);
|
|
226
|
-
return () => onOptionRemove(option);
|
|
227
|
-
}, [option, onOptionAdd, onOptionRemove]);
|
|
228
|
-
return ((0, jsx_runtime_1.jsx)(react_select_1.Item, { ref: ref, className: Select_module_scss_1.default.selectItem, value: value + "", disabled: !enabled, children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.selectItemContent, children: optionRenderer ? (optionRenderer({
|
|
238
|
+
const { optionLabelRenderer, optionRenderer, value: selectedValue } = (0, SelectContext_1.useSelect)();
|
|
239
|
+
return ((0, jsx_runtime_1.jsx)(react_select_1.Item, { ref: ref, className: Select_module_scss_1.default.selectItem, value: value + "", disabled: !enabled, "data-state": selectedValue === value && "checked", children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.selectItemContent, children: optionRenderer ? (optionRenderer({
|
|
229
240
|
label,
|
|
230
241
|
value,
|
|
231
242
|
enabled,
|
|
232
|
-
}, selectedValue, false)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_select_1.ItemText, { className: Select_module_scss_1.default.selectItemContent, children: optionLabelRenderer ? optionLabelRenderer({ value, label }) : label }), (0, jsx_runtime_1.jsx)("span", { className: Select_module_scss_1.default.selectItemIndicator, children: (0, jsx_runtime_1.jsx)(react_select_1.ItemIndicator, { children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" }) }) })] })) }) }));
|
|
243
|
+
}, selectedValue, false)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_select_1.ItemText, { className: Select_module_scss_1.default.selectItemContent, children: optionLabelRenderer ? optionLabelRenderer({ value, label }) : label }), selectedValue === value && ((0, jsx_runtime_1.jsx)("span", { className: Select_module_scss_1.default.selectItemIndicator, children: (0, jsx_runtime_1.jsx)(react_select_1.ItemIndicator, { children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" }) }) }))] })) }) }));
|
|
233
244
|
});
|
|
234
245
|
SelectOption.displayName = "SelectOption";
|
|
@@ -7,7 +7,7 @@ const renderers_1 = require("../../components-core/renderers");
|
|
|
7
7
|
const SelectionStoreNative_1 = require("./SelectionStoreNative");
|
|
8
8
|
const COMP = "SelectionStore";
|
|
9
9
|
exports.SelectionStoreMd = (0, ComponentDefs_1.createMetadata)({
|
|
10
|
-
status: "
|
|
10
|
+
status: "deprecated",
|
|
11
11
|
description: `The \`${COMP}\` is a non-visual component that may wrap components (items) and manage ` +
|
|
12
12
|
`their selection state to accommodate the usage of other actions.`,
|
|
13
13
|
props: {
|
|
@@ -25,7 +25,6 @@ exports.SpinnerMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
25
25
|
valueType: "boolean",
|
|
26
26
|
defaultValue: false,
|
|
27
27
|
},
|
|
28
|
-
themeColor: (0, ComponentDefs_1.d)(`(**NOT IMPLEMENTED YET**) The theme color of the component.`),
|
|
29
28
|
},
|
|
30
29
|
themeVars: (0, themeVars_1.parseScssVar)(Spinner_module_scss_1.default.themeVars),
|
|
31
30
|
defaultThemeVars: {
|
|
@@ -48,9 +48,11 @@ exports.SwitchMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
48
48
|
[`backgroundColor-checked-${COMP}-warning`]: `$borderColor-${COMP}-warning`,
|
|
49
49
|
[`borderColor-checked-${COMP}-success`]: `$borderColor-${COMP}-success`,
|
|
50
50
|
[`backgroundColor-checked-${COMP}-success`]: `$borderColor-${COMP}-success`,
|
|
51
|
-
[`backgroundColor-${COMP}`]: "$
|
|
52
|
-
[`borderColor-${COMP}`]: "$color-surface-
|
|
53
|
-
[`
|
|
51
|
+
[`backgroundColor-${COMP}`]: "$backgroundColor-primary",
|
|
52
|
+
[`borderColor-${COMP}`]: "$color-surface-200",
|
|
53
|
+
[`borderWidth-${COMP}`]: "1px",
|
|
54
|
+
[`backgroundColor-indicator-${COMP}`]: "$color-surface-200",
|
|
55
|
+
[`backgroundColor-indicator-checked-${COMP}`]: "$backgroundColor-primary",
|
|
54
56
|
[`borderColor-checked-${COMP}`]: "$color-primary-500",
|
|
55
57
|
[`backgroundColor-checked-${COMP}`]: "$color-primary-500",
|
|
56
58
|
[`backgroundColor-${COMP}--disabled`]: "$color-surface-200",
|
|
@@ -62,6 +62,7 @@ exports.TableOfContentsMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
62
62
|
[`border-width-${COMP}`]: "0",
|
|
63
63
|
[`borderColor-${COMP}`]: "transparent",
|
|
64
64
|
[`border-style-${COMP}`]: "solid",
|
|
65
|
+
[`paddingLeft-${COMP}Item`]: "$space-1",
|
|
65
66
|
[`textTransform-${COMP}Item`]: "none",
|
|
66
67
|
[`verticalAlign-${COMP}Item`]: "baseline",
|
|
67
68
|
[`letterSpacing-${COMP}Item`]: "0",
|
|
@@ -66,7 +66,10 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
66
66
|
[`fontFamily-${COMP}-code`]: "$fontFamily-monospace",
|
|
67
67
|
[`fontSize-${COMP}-code`]: "$fontSize-small",
|
|
68
68
|
[`borderWidth-${COMP}-code`]: "1px",
|
|
69
|
+
[`borderStyle-${COMP}-code`]: "solid",
|
|
70
|
+
[`borderRadius-${COMP}-code`]: "4px",
|
|
69
71
|
[`paddingHorizontal-${COMP}-code`]: "$space-1",
|
|
72
|
+
[`paddingBottom-${COMP}-code`]: "2px",
|
|
70
73
|
[`textDecorationLine-${COMP}-deleted`]: "line-through",
|
|
71
74
|
[`textDecorationLine-${COMP}-inserted`]: "underline",
|
|
72
75
|
[`fontFamily-${COMP}-keyboard`]: "$fontFamily-monospace",
|
|
@@ -81,6 +84,7 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
81
84
|
[`fontSize-${COMP}-sub`]: "$fontSize-smaller",
|
|
82
85
|
[`verticalAlign-${COMP}-sub`]: "sub",
|
|
83
86
|
[`fontStyle-${COMP}-var`]: "italic",
|
|
87
|
+
[`fontStyle-${COMP}-em`]: "italic",
|
|
84
88
|
[`fontFamily-${COMP}-mono`]: "$fontFamily-monospace",
|
|
85
89
|
[`fontSize-${COMP}-title`]: "$fontSize-large",
|
|
86
90
|
[`fontSize-${COMP}-subtitle`]: "$fontSize-medium",
|
|
@@ -100,13 +104,15 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
100
104
|
[`marginBottom-${COMP}-tableheading`]: "$space-4",
|
|
101
105
|
[`paddingHorizontal-${COMP}-tableheading`]: "$space-1",
|
|
102
106
|
[`fontWeight-${COMP}-tableheading`]: "$fontWeight-bold",
|
|
103
|
-
[`
|
|
104
|
-
[`
|
|
105
|
-
[`
|
|
107
|
+
[`marginTop-${COMP}-markdown`]: "$space-3",
|
|
108
|
+
[`marginBottom-${COMP}-markdown`]: "$space-6",
|
|
109
|
+
[`fontSize-${COMP}-markdown`]: "$fontSize-normal",
|
|
110
|
+
[`backgroundColor-${COMP}-code`]: "rgba($color-surface-100-rgb, .4)",
|
|
111
|
+
[`borderColor-${COMP}-code`]: "$color-surface-300",
|
|
112
|
+
[`backgroundColor-${COMP}-keyboard`]: "rgba($color-surface-100-rgb, .4)",
|
|
106
113
|
[`borderColor-${COMP}-keyboard`]: "$color-surface-300",
|
|
107
114
|
[`backgroundColor-${COMP}-marked`]: "yellow",
|
|
108
115
|
[`color-${COMP}-placeholder`]: "$color-surface-500",
|
|
109
|
-
[`backgroundColor-${COMP}-codefence`]: "$color-primary-100",
|
|
110
116
|
[`color-${COMP}-codefence`]: "$color-surface-900",
|
|
111
117
|
[`color-${COMP}-subheading`]: "$textColor-secondary",
|
|
112
118
|
[`color-${COMP}-secondary`]: "$textColor-secondary",
|