xmlui 0.10.8 → 0.10.11
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/{metadata/apiInterceptorWorker-Bb5-fQup.mjs → lib/apiInterceptorWorker-DPgtUtdA.mjs} +5870 -3195
- package/dist/lib/index-BuIblMfO.mjs +50034 -0
- package/dist/lib/index.css +1 -1
- package/dist/lib/initMock-CV-9AUzP.mjs +843 -0
- package/dist/lib/language-server-web-worker.mjs +8 -7
- package/dist/lib/language-server.mjs +6 -6
- package/dist/lib/{metadata-utils-DrEexTX9.mjs → metadata-utils-DzONZF-e.mjs} +161 -111
- package/dist/lib/scss/components-core/theming/_themes.scss +6 -7
- package/dist/lib/{server-common-ddmPKhK6.mjs → server-common-Dsyp3-Ro.mjs} +14949 -10880
- package/dist/lib/syntax-monaco.mjs +14 -11
- package/dist/lib/syntax-textmate.d.ts +2 -2
- package/dist/lib/syntax-textmate.mjs +128 -109
- package/dist/lib/transform-CBz7TQJh.mjs +7375 -0
- package/dist/lib/xmlui-parser.d.ts +3 -3
- package/dist/lib/xmlui-parser.mjs +49 -49
- package/dist/lib/xmlui-serializer-Bf9bdvlV.mjs +667 -0
- package/dist/lib/xmlui.d.ts +16 -11
- package/dist/lib/xmlui.mjs +44 -44
- package/dist/{lib/apiInterceptorWorker-DH8wqOVq.mjs → metadata/apiInterceptorWorker-BmKP8bnq.mjs} +5432 -3502
- package/dist/metadata/collectedComponentMetadata-Cdi6AFD3.mjs +55851 -0
- package/dist/metadata/initMock-B7OlSKKb.mjs +843 -0
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +3 -3
- package/dist/metadata/xmlui-metadata.umd.js +207 -419
- package/dist/scripts/package.json +3 -1
- package/dist/scripts/src/components/APICall/APICall.js +4 -4
- package/dist/scripts/src/components/Accordion/Accordion.js +1 -1
- package/dist/scripts/src/components/Accordion/AccordionItemNative.js +2 -2
- package/dist/scripts/src/components/Animation/AnimationNative.js +259 -0
- package/dist/scripts/src/components/App/App.js +10 -0
- package/dist/scripts/src/components/App/AppNative.js +29 -9
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +1 -1
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +5 -4
- package/dist/scripts/src/components/Breakout/BreakoutNative.js +2 -2
- package/dist/scripts/src/components/Button/Button.js +1 -1
- package/dist/scripts/src/components/Button/ButtonNative.js +4 -0
- package/dist/scripts/src/components/Carousel/Carousel.js +13 -20
- package/dist/scripts/src/components/Carousel/CarouselContext.js +11 -2
- package/dist/scripts/src/components/Carousel/CarouselItemNative.js +2 -2
- package/dist/scripts/src/components/Carousel/CarouselNative.js +2 -2
- package/dist/scripts/src/components/Charts/AreaChart/AreaChart.js +92 -0
- package/dist/scripts/src/components/Charts/AreaChart/AreaChartNative.js +127 -0
- package/dist/scripts/src/components/Charts/BarChart/BarChart.js +4 -4
- package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +90 -82
- package/dist/scripts/src/components/Charts/LineChart/LineChart.js +3 -3
- package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +5 -1
- package/dist/scripts/src/components/Charts/RadarChart/RadarChart.js +92 -0
- package/dist/scripts/src/components/Charts/RadarChart/RadarChartNative.js +125 -0
- package/dist/scripts/src/components/Checkbox/Checkbox.js +2 -1
- package/dist/scripts/src/components/ComponentProvider.js +4 -0
- package/dist/scripts/src/components/DataSource/DataSource.js +124 -0
- package/dist/scripts/src/components/DateInput/DateInput.js +7 -9
- package/dist/scripts/src/components/DateInput/DateInputNative.js +101 -38
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/scripts/src/components/ExpandableItem/ExpandableItemNative.js +18 -12
- package/dist/scripts/src/components/Footer/Footer.js +1 -1
- package/dist/scripts/src/components/FormItem/FormItem.js +1 -1
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +3 -3
- package/dist/scripts/src/components/Heading/Heading.js +83 -28
- package/dist/scripts/src/components/Heading/HeadingNative.js +10 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +1 -1
- package/dist/scripts/src/components/Image/ImageNative.js +13 -0
- package/dist/scripts/src/components/Input/PartialInput.js +28 -3
- package/dist/scripts/src/components/List/ListNative.js +6 -5
- package/dist/scripts/src/components/NavLink/NavLink.js +1 -1
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +3 -8
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +2 -2
- package/dist/scripts/src/components/Option/Option.js +2 -2
- package/dist/scripts/src/components/Option/OptionNative.js +12 -1
- package/dist/scripts/src/components/Pagination/Pagination.js +2 -1
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +7 -3
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +20 -5
- package/dist/scripts/src/components/RadioGroup/RadioItemNative.js +2 -1
- package/dist/scripts/src/components/Select/Select.js +1 -1
- package/dist/scripts/src/components/Select/SelectNative.js +1 -1
- package/dist/scripts/src/components/Slider/Slider.js +10 -8
- package/dist/scripts/src/components/Slider/SliderNative.js +24 -21
- package/dist/scripts/src/components/Switch/Switch.js +2 -1
- package/dist/scripts/src/components/Table/Table.js +1 -1
- package/dist/scripts/src/components/Table/TableNative.js +18 -13
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +1 -1
- package/dist/scripts/src/components/Text/Text.js +32 -14
- package/dist/scripts/src/components/Text/TextNative.js +17 -5
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +3 -3
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +3 -3
- package/dist/scripts/src/components/TimeInput/TimeInput.js +10 -10
- package/dist/scripts/src/components/TimeInput/TimeInputNative.js +87 -38
- package/dist/scripts/src/components/Toggle/Toggle.js +2 -2
- package/dist/scripts/src/components/Tooltip/Tooltip.js +9 -9
- package/dist/scripts/src/components/Tooltip/TooltipNative.js +4 -4
- package/dist/scripts/src/components/abstractions.js +7 -3
- package/dist/scripts/src/components/collectedComponentMetadata.js +316 -0
- package/dist/scripts/src/components-core/RestApiProxy.js +3 -1
- package/dist/scripts/src/components-core/StandaloneApp.js +823 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +4 -1
- package/dist/scripts/src/components-core/interception/Backend.js +13 -7
- package/dist/scripts/src/components-core/markup-check.js +279 -0
- package/dist/scripts/src/components-core/parts.js +0 -4
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +36 -16
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +4 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +4 -1
- package/dist/scripts/src/components-core/theming/themes/root.js +30 -17
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +14 -7
- package/dist/scripts/src/components-core/xmlui-parser.js +60 -43
- package/dist/scripts/src/index.js +120 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +15 -4
- package/dist/standalone/xmlui-standalone.es.d.ts +23 -15
- package/dist/standalone/xmlui-standalone.umd.js +319 -823
- package/package.json +3 -1
- package/src/syntax/textMate/xmlui.tmLanguage.json +2 -2
- package/dist/lib/index-CqzCWOUw.mjs +0 -38579
- package/dist/lib/initMock-C5CXs0-5.mjs +0 -568
- package/dist/lib/transform-SMWeyMoq.mjs +0 -5391
- package/dist/lib/xmlui-serializer-a0O0jFY-.mjs +0 -497
- package/dist/metadata/collectedComponentMetadata-DIT5VbaH.mjs +0 -42985
- package/dist/metadata/initMock-D6Vi9kU_.mjs +0 -568
- package/dist/scripts/src/components-core/ScrollContext.js +0 -11
- package/dist/scripts/src/components-core/utils/audio-utils.js +0 -83
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xmlui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.11",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start-test-bed": "cd src/testing/infrastructure && xmlui start",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"@radix-ui/react-tabs": "1.1.0",
|
|
45
45
|
"@radix-ui/react-tooltip": "^1.2.4",
|
|
46
46
|
"@radix-ui/react-visually-hidden": "1.0.3",
|
|
47
|
+
"@react-spring/web": "^10.0.2",
|
|
47
48
|
"@remix-run/react": "2.12.1",
|
|
48
49
|
"@tanstack/react-query": "^4.36.1",
|
|
49
50
|
"@tanstack/react-query-devtools": "^4.36.1",
|
|
@@ -148,6 +149,7 @@
|
|
|
148
149
|
"rollup-plugin-copy": "^3.5.0",
|
|
149
150
|
"rollup-plugin-visualizer": "5.8.3",
|
|
150
151
|
"serve": "14.2.0",
|
|
152
|
+
"terser": "^5.44.0",
|
|
151
153
|
"typescript": "5.7.3",
|
|
152
154
|
"vite": "5.4.19",
|
|
153
155
|
"vite-plugin-dts": "4.5.0",
|
|
@@ -107,10 +107,10 @@ exports.APICallMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
107
107
|
"`$params[0]`, `$params[1]`, etc.)",
|
|
108
108
|
},
|
|
109
109
|
$result: {
|
|
110
|
-
description: "Response data (available in `completedNotificationMessage`
|
|
110
|
+
description: "Response data (available in `completedNotificationMessage`)",
|
|
111
111
|
},
|
|
112
112
|
$error: {
|
|
113
|
-
description: "Error details (available in `errorNotificationMessage`
|
|
113
|
+
description: "Error details (available in `errorNotificationMessage`)",
|
|
114
114
|
},
|
|
115
115
|
},
|
|
116
116
|
apis: {
|
|
@@ -125,6 +125,6 @@ exports.APICallMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
125
125
|
},
|
|
126
126
|
},
|
|
127
127
|
});
|
|
128
|
-
exports.apiCallRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.APICallMd, ({ node, registerComponentApi, uid
|
|
129
|
-
return (0, jsx_runtime_1.jsx)(APICallNative_1.APICallNative, { registerComponentApi: registerComponentApi, node: node, uid: uid });
|
|
128
|
+
exports.apiCallRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.APICallMd, ({ node, registerComponentApi, uid }) => {
|
|
129
|
+
return ((0, jsx_runtime_1.jsx)(APICallNative_1.APICallNative, { registerComponentApi: registerComponentApi, node: node, uid: uid }));
|
|
130
130
|
});
|
|
@@ -77,7 +77,7 @@ exports.AccordionMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
77
77
|
[`paddingHorizontal-header-${COMP}`]: "$space-3",
|
|
78
78
|
[`paddingVertical-header-${COMP}`]: "$space-3",
|
|
79
79
|
[`verticalAlignment-header-${COMP}`]: "center",
|
|
80
|
-
[`fontSize-header-${COMP}`]: "$fontSize-
|
|
80
|
+
[`fontSize-header-${COMP}`]: "$fontSize-base",
|
|
81
81
|
[`fontWeight-header-${COMP}`]: "$fontWeight-normal",
|
|
82
82
|
[`fontFamily-header-${COMP}`]: "$fontFamily",
|
|
83
83
|
[`border-${COMP}`]: "0px solid $borderColor",
|
|
@@ -86,10 +86,10 @@ exports.AccordionItemComponent = (0, react_1.forwardRef)(function AccordionItemC
|
|
|
86
86
|
unRegister(triggerId);
|
|
87
87
|
};
|
|
88
88
|
}, [triggerId, unRegister]);
|
|
89
|
-
return ((0, jsx_runtime_1.jsxs)(RAccordion.Item, { value: itemId, className: (0, classnames_1.default)(Accordion_module_scss_1.default.item, className), ref: forwardedRef, style: style, children: [(0, jsx_runtime_1.jsx)(RAccordion.Header, { className: Accordion_module_scss_1.default.header, children: (0, jsx_runtime_1.jsxs)(RAccordion.Trigger, Object.assign({}, rest, { id:
|
|
89
|
+
return ((0, jsx_runtime_1.jsxs)(RAccordion.Item, { id: itemId, value: itemId, className: (0, classnames_1.default)(Accordion_module_scss_1.default.item, className), ref: forwardedRef, style: style, children: [(0, jsx_runtime_1.jsx)(RAccordion.Header, { className: Accordion_module_scss_1.default.header, children: (0, jsx_runtime_1.jsxs)(RAccordion.Trigger, Object.assign({}, rest, { id: triggerId, className: (0, classnames_1.default)(Accordion_module_scss_1.default.trigger, {
|
|
90
90
|
[Accordion_module_scss_1.default.triggerStart]: triggerPosition === "start",
|
|
91
91
|
}), children: [headerRenderer(header), !hideIcon && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
92
92
|
transform: expanded && !expandedIcon ? `rotate(${rotateExpanded})` : "rotate(0deg)",
|
|
93
93
|
transition: "transform 300ms cubic-bezier(0.87, 0, 0.13, 1)",
|
|
94
|
-
}, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: !expanded ? collapsedIcon : expandedIcon || collapsedIcon, className: Accordion_module_scss_1.default.chevron }) }))] })) }), (0, jsx_runtime_1.jsx)(RAccordion.Content, { className: Accordion_module_scss_1.default.contentWrapper, children: (0, jsx_runtime_1.jsx)("div", { className: Accordion_module_scss_1.default.content, children: content }) })] }, itemId));
|
|
94
|
+
}, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: !expanded ? collapsedIcon : expandedIcon || collapsedIcon, className: Accordion_module_scss_1.default.chevron, "aria-hidden": "true" }) }))] })) }), (0, jsx_runtime_1.jsx)(RAccordion.Content, { className: Accordion_module_scss_1.default.contentWrapper, children: (0, jsx_runtime_1.jsx)("div", { className: Accordion_module_scss_1.default.content, children: content }) })] }, itemId));
|
|
95
95
|
});
|
|
@@ -0,0 +1,259 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.Animation = exports.parseAnimation = exports.defaultProps = void 0;
|
|
48
|
+
exports.parseAnimationOptions = parseAnimationOptions;
|
|
49
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
50
|
+
const web_1 = require("@react-spring/web");
|
|
51
|
+
const react_1 = __importStar(require("react"));
|
|
52
|
+
const react_2 = require("react");
|
|
53
|
+
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
54
|
+
const lodash_es_1 = require("lodash-es");
|
|
55
|
+
const AnimatedComponent = (0, web_1.animated)((0, react_1.forwardRef)(function InlineComponentDef(props, ref) {
|
|
56
|
+
const { children } = props, rest = __rest(props, ["children"]);
|
|
57
|
+
if (!react_1.default.isValidElement(children)) {
|
|
58
|
+
return children;
|
|
59
|
+
}
|
|
60
|
+
return react_1.default.cloneElement(children, Object.assign(Object.assign({}, rest), { ref }));
|
|
61
|
+
}));
|
|
62
|
+
exports.defaultProps = {
|
|
63
|
+
delay: 0,
|
|
64
|
+
animateWhenInView: false,
|
|
65
|
+
reverse: false,
|
|
66
|
+
loop: false,
|
|
67
|
+
once: false
|
|
68
|
+
};
|
|
69
|
+
const parseAnimation = (animation) => {
|
|
70
|
+
if (typeof animation === 'object') {
|
|
71
|
+
return animation;
|
|
72
|
+
}
|
|
73
|
+
const presetAnimations = {
|
|
74
|
+
fadein: {
|
|
75
|
+
from: { opacity: 0 },
|
|
76
|
+
to: { opacity: 1 }
|
|
77
|
+
},
|
|
78
|
+
fadeout: {
|
|
79
|
+
from: { opacity: 1 },
|
|
80
|
+
to: { opacity: 0 }
|
|
81
|
+
},
|
|
82
|
+
slidein: {
|
|
83
|
+
from: { transform: 'translateX(-100%)' },
|
|
84
|
+
to: { transform: 'translateX(0%)' }
|
|
85
|
+
},
|
|
86
|
+
slideout: {
|
|
87
|
+
from: { transform: 'translateX(0%)' },
|
|
88
|
+
to: { transform: 'translateX(100%)' }
|
|
89
|
+
},
|
|
90
|
+
popin: {
|
|
91
|
+
from: { transform: 'scale(0.8)', opacity: 0 },
|
|
92
|
+
to: { transform: 'scale(1)', opacity: 1 }
|
|
93
|
+
},
|
|
94
|
+
popout: {
|
|
95
|
+
from: { transform: 'scale(1)', opacity: 1 },
|
|
96
|
+
to: { transform: 'scale(0.8)', opacity: 0 }
|
|
97
|
+
},
|
|
98
|
+
flipin: {
|
|
99
|
+
from: { transform: 'rotateY(90deg)', opacity: 0 },
|
|
100
|
+
to: { transform: 'rotateY(0deg)', opacity: 1 }
|
|
101
|
+
},
|
|
102
|
+
flipout: {
|
|
103
|
+
from: { transform: 'rotateY(0deg)', opacity: 1 },
|
|
104
|
+
to: { transform: 'rotateY(90deg)', opacity: 0 }
|
|
105
|
+
},
|
|
106
|
+
rotatein: {
|
|
107
|
+
from: { transform: 'rotate(-180deg)', opacity: 0 },
|
|
108
|
+
to: { transform: 'rotate(0deg)', opacity: 1 }
|
|
109
|
+
},
|
|
110
|
+
rotateout: {
|
|
111
|
+
from: { transform: 'rotate(0deg)', opacity: 1 },
|
|
112
|
+
to: { transform: 'rotate(180deg)', opacity: 0 }
|
|
113
|
+
},
|
|
114
|
+
zoomin: {
|
|
115
|
+
from: { transform: 'scale(0)', opacity: 0 },
|
|
116
|
+
to: { transform: 'scale(1)', opacity: 1 }
|
|
117
|
+
},
|
|
118
|
+
zoomout: {
|
|
119
|
+
from: { transform: 'scale(1)', opacity: 1 },
|
|
120
|
+
to: { transform: 'scale(0)', opacity: 0 }
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return presetAnimations[animation] || { from: {}, to: {} };
|
|
124
|
+
};
|
|
125
|
+
exports.parseAnimation = parseAnimation;
|
|
126
|
+
/**
|
|
127
|
+
* Helper function to parse a single animation-specific option value.
|
|
128
|
+
*/
|
|
129
|
+
function parseAnimationOptionValue(name, value) {
|
|
130
|
+
switch (name) {
|
|
131
|
+
case "duration":
|
|
132
|
+
case "delay":
|
|
133
|
+
const num = parseInt(value, 10);
|
|
134
|
+
return isNaN(num) ? undefined : num;
|
|
135
|
+
case "animateWhenInView":
|
|
136
|
+
case "reverse":
|
|
137
|
+
case "loop":
|
|
138
|
+
case "once":
|
|
139
|
+
const lowerVal = value.toLowerCase();
|
|
140
|
+
if (lowerVal === "true" || lowerVal === "1" || lowerVal === "yes")
|
|
141
|
+
return true;
|
|
142
|
+
if (lowerVal === "false" || lowerVal === "0" || lowerVal === "no")
|
|
143
|
+
return false;
|
|
144
|
+
return undefined;
|
|
145
|
+
default:
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Parses animation options from a string or object.
|
|
151
|
+
*/
|
|
152
|
+
function parseAnimationOptions(input) {
|
|
153
|
+
if ((0, lodash_es_1.isPlainObject)(input)) {
|
|
154
|
+
return input;
|
|
155
|
+
}
|
|
156
|
+
if (typeof input === "string") {
|
|
157
|
+
const options = {};
|
|
158
|
+
const values = input
|
|
159
|
+
.split(";")
|
|
160
|
+
.map((value) => value.trim())
|
|
161
|
+
.filter((value) => value.length > 0);
|
|
162
|
+
for (const value of values) {
|
|
163
|
+
if (value.includes(":")) {
|
|
164
|
+
const [name, val] = value.split(":").map((part) => part.trim());
|
|
165
|
+
if (name && val) {
|
|
166
|
+
const parsedValue = parseAnimationOptionValue(name, val);
|
|
167
|
+
if (parsedValue !== undefined) {
|
|
168
|
+
options[name] = parsedValue;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
const booleanOptions = ["animateWhenInView", "reverse", "loop", "once"];
|
|
174
|
+
if (booleanOptions.includes(value)) {
|
|
175
|
+
options[value] = true;
|
|
176
|
+
}
|
|
177
|
+
else if (value.startsWith("!") && value.length > 1) {
|
|
178
|
+
const optionName = value.substring(1);
|
|
179
|
+
if (booleanOptions.includes(optionName)) {
|
|
180
|
+
options[optionName] = false;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return options;
|
|
186
|
+
}
|
|
187
|
+
return {};
|
|
188
|
+
}
|
|
189
|
+
exports.Animation = (0, react_1.forwardRef)(function Animation(_a, forwardedRef) {
|
|
190
|
+
var { children, registerComponentApi, animation, duration, onStop, onStart, delay = exports.defaultProps.delay, animateWhenInView = exports.defaultProps.animateWhenInView, reverse = exports.defaultProps.reverse, loop = exports.defaultProps.loop, once = exports.defaultProps.once } = _a, rest = __rest(_a, ["children", "registerComponentApi", "animation", "duration", "onStop", "onStart", "delay", "animateWhenInView", "reverse", "loop", "once"]);
|
|
191
|
+
const [_animation] = (0, react_1.useState)(animation);
|
|
192
|
+
const [toggle, setToggle] = (0, react_1.useState)(false);
|
|
193
|
+
const [reset, setReset] = (0, react_1.useState)(false);
|
|
194
|
+
const [count, setCount] = (0, react_1.useState)(0);
|
|
195
|
+
const times = 1;
|
|
196
|
+
const animationSettings = (0, react_1.useMemo)(() => ({
|
|
197
|
+
from: _animation.from,
|
|
198
|
+
to: _animation.to,
|
|
199
|
+
config: Object.assign(Object.assign({}, _animation.config), { duration }),
|
|
200
|
+
delay,
|
|
201
|
+
loop,
|
|
202
|
+
reset,
|
|
203
|
+
reverse: toggle,
|
|
204
|
+
onRest: () => {
|
|
205
|
+
onStop === null || onStop === void 0 ? void 0 : onStop();
|
|
206
|
+
if (loop) {
|
|
207
|
+
if (reverse) {
|
|
208
|
+
setCount(count + 1);
|
|
209
|
+
setToggle(!toggle);
|
|
210
|
+
}
|
|
211
|
+
setReset(true);
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
if (reverse && count < times) {
|
|
215
|
+
setCount(count + 1);
|
|
216
|
+
setToggle(!toggle);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
onStart: () => onStart === null || onStart === void 0 ? void 0 : onStart(),
|
|
221
|
+
}), [
|
|
222
|
+
_animation.config,
|
|
223
|
+
_animation.from,
|
|
224
|
+
_animation.to,
|
|
225
|
+
count,
|
|
226
|
+
delay,
|
|
227
|
+
duration,
|
|
228
|
+
loop,
|
|
229
|
+
onStart,
|
|
230
|
+
onStop,
|
|
231
|
+
reset,
|
|
232
|
+
reverse,
|
|
233
|
+
toggle,
|
|
234
|
+
]);
|
|
235
|
+
const [springs, api] = (0, web_1.useSpring)(() => (Object.assign({}, animationSettings)), [animationSettings]);
|
|
236
|
+
const [ref, animationStyles] = (0, web_1.useInView)(() => animationSettings, {
|
|
237
|
+
once,
|
|
238
|
+
});
|
|
239
|
+
const composedRef = ref ? (0, react_compose_refs_1.composeRefs)(ref, forwardedRef) : forwardedRef;
|
|
240
|
+
const startAnimation = (0, react_2.useCallback)(() => {
|
|
241
|
+
api.start(_animation);
|
|
242
|
+
return () => {
|
|
243
|
+
api.stop();
|
|
244
|
+
};
|
|
245
|
+
}, [_animation, api]);
|
|
246
|
+
const stopAnimation = (0, react_2.useCallback)(() => {
|
|
247
|
+
api.stop();
|
|
248
|
+
}, [api]);
|
|
249
|
+
(0, react_1.useEffect)(() => {
|
|
250
|
+
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
251
|
+
start: startAnimation,
|
|
252
|
+
stop: stopAnimation,
|
|
253
|
+
});
|
|
254
|
+
}, [registerComponentApi, startAnimation, stopAnimation]);
|
|
255
|
+
const content = (0, react_1.useMemo)(() => {
|
|
256
|
+
return react_1.Children.map(children, (child, index) => animateWhenInView ? ((0, jsx_runtime_1.jsx)(AnimatedComponent, Object.assign({}, rest, { style: animationStyles, ref: composedRef, children: child }), index)) : ((0, jsx_runtime_1.jsx)(AnimatedComponent, Object.assign({}, rest, { style: springs, ref: forwardedRef, children: child }), index)));
|
|
257
|
+
}, [animateWhenInView, animationStyles, children, springs, rest]);
|
|
258
|
+
return content;
|
|
259
|
+
});
|
|
@@ -76,6 +76,14 @@ exports.AppMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
76
76
|
valueType: "string",
|
|
77
77
|
defaultValue: AppNative_1.defaultProps.defaultTheme,
|
|
78
78
|
},
|
|
79
|
+
autoDetectTone: {
|
|
80
|
+
description: 'This boolean property enables automatic detection of the system theme preference. ' +
|
|
81
|
+
'When set to true and no defaultTone is specified, the app will automatically use ' +
|
|
82
|
+
'"light" or "dark" tone based on the user\'s system theme setting. The app will ' +
|
|
83
|
+
'also respond to changes in the system theme preference.',
|
|
84
|
+
valueType: "boolean",
|
|
85
|
+
defaultValue: AppNative_1.defaultProps.autoDetectTone,
|
|
86
|
+
},
|
|
79
87
|
},
|
|
80
88
|
events: {
|
|
81
89
|
ready: {
|
|
@@ -298,6 +306,7 @@ function AppNode({ node, extractValue, renderChild, className, lookupEventHandle
|
|
|
298
306
|
logoLight: extractValue(node.props["logo-light"]),
|
|
299
307
|
defaultTone: extractValue(node.props.defaultTone),
|
|
300
308
|
defaultTheme: extractValue(node.props.defaultTheme),
|
|
309
|
+
autoDetectTone: extractValue.asOptionalBoolean(node.props.autoDetectTone, false),
|
|
301
310
|
applyDefaultContentPadding
|
|
302
311
|
}), [
|
|
303
312
|
extractValue,
|
|
@@ -312,6 +321,7 @@ function AppNode({ node, extractValue, renderChild, className, lookupEventHandle
|
|
|
312
321
|
node.props["logo-light"],
|
|
313
322
|
node.props.defaultTone,
|
|
314
323
|
node.props.defaultTheme,
|
|
324
|
+
node.props.autoDetectTone,
|
|
315
325
|
className,
|
|
316
326
|
applyDefaultContentPadding
|
|
317
327
|
]);
|
|
@@ -25,7 +25,6 @@ const lodash_es_1 = require("lodash-es");
|
|
|
25
25
|
const classnames_1 = __importDefault(require("classnames"));
|
|
26
26
|
const App_module_scss_1 = __importDefault(require("./App.module.scss"));
|
|
27
27
|
const AppContext_1 = require("../../components-core/AppContext");
|
|
28
|
-
const ScrollContext_1 = require("../../components-core/ScrollContext");
|
|
29
28
|
const hooks_1 = require("../../components-core/utils/hooks");
|
|
30
29
|
const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
|
|
31
30
|
const css_utils_1 = require("../../components-core/utils/css-utils");
|
|
@@ -40,11 +39,12 @@ exports.defaultProps = {
|
|
|
40
39
|
noScrollbarGutters: false,
|
|
41
40
|
defaultTone: undefined,
|
|
42
41
|
defaultTheme: undefined,
|
|
42
|
+
autoDetectTone: false,
|
|
43
43
|
onReady: lodash_es_1.noop,
|
|
44
44
|
onMessageReceived: lodash_es_1.noop,
|
|
45
45
|
};
|
|
46
46
|
function App(_a) {
|
|
47
|
-
var { children, style = constants_1.EMPTY_OBJECT, layout, loggedInUser, scrollWholePage = exports.defaultProps.scrollWholePage, noScrollbarGutters = exports.defaultProps.noScrollbarGutters, onReady = exports.defaultProps.onReady, onMessageReceived = exports.defaultProps.onMessageReceived, header, navPanel, footer, navPanelDef, logoContentDef, logo, logoDark, logoLight, defaultTone, defaultTheme, renderChild, name, className, applyDefaultContentPadding } = _a, rest = __rest(_a, ["children", "style", "layout", "loggedInUser", "scrollWholePage", "noScrollbarGutters", "onReady", "onMessageReceived", "header", "navPanel", "footer", "navPanelDef", "logoContentDef", "logo", "logoDark", "logoLight", "defaultTone", "defaultTheme", "renderChild", "name", "className", "applyDefaultContentPadding"]);
|
|
47
|
+
var { children, style = constants_1.EMPTY_OBJECT, layout, loggedInUser, scrollWholePage = exports.defaultProps.scrollWholePage, noScrollbarGutters = exports.defaultProps.noScrollbarGutters, onReady = exports.defaultProps.onReady, onMessageReceived = exports.defaultProps.onMessageReceived, header, navPanel, footer, navPanelDef, logoContentDef, logo, logoDark, logoLight, defaultTone, defaultTheme, autoDetectTone = exports.defaultProps.autoDetectTone, renderChild, name, className, applyDefaultContentPadding } = _a, rest = __rest(_a, ["children", "style", "layout", "loggedInUser", "scrollWholePage", "noScrollbarGutters", "onReady", "onMessageReceived", "header", "navPanel", "footer", "navPanelDef", "logoContentDef", "logo", "logoDark", "logoLight", "defaultTone", "defaultTheme", "autoDetectTone", "renderChild", "name", "className", "applyDefaultContentPadding"]);
|
|
48
48
|
const { getThemeVar } = (0, ThemeContext_1.useTheme)();
|
|
49
49
|
const { setActiveThemeTone, setActiveThemeId, themes } = (0, ThemeContext_1.useThemes)();
|
|
50
50
|
const mounted = (0, react_1.useRef)(false);
|
|
@@ -63,13 +63,19 @@ function App(_a) {
|
|
|
63
63
|
if (defaultTone === "dark" || defaultTone === "light") {
|
|
64
64
|
setActiveThemeTone(defaultTone);
|
|
65
65
|
}
|
|
66
|
+
else if (autoDetectTone) {
|
|
67
|
+
// Auto-detect system theme preference when no defaultTone is set
|
|
68
|
+
const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
69
|
+
const detectedTone = systemPrefersDark ? "dark" : "light";
|
|
70
|
+
setActiveThemeTone(detectedTone);
|
|
71
|
+
}
|
|
66
72
|
if (defaultTheme) {
|
|
67
73
|
setActiveThemeId(defaultTheme);
|
|
68
74
|
}
|
|
69
75
|
return () => {
|
|
70
76
|
mounted.current = false;
|
|
71
77
|
};
|
|
72
|
-
}, [defaultTone, defaultTheme, setActiveThemeTone, setActiveThemeId, themes]);
|
|
78
|
+
}, [defaultTone, defaultTheme, autoDetectTone, setActiveThemeTone, setActiveThemeId, themes]);
|
|
73
79
|
(0, react_1.useEffect)(() => {
|
|
74
80
|
onReady();
|
|
75
81
|
}, [onReady]);
|
|
@@ -82,6 +88,20 @@ function App(_a) {
|
|
|
82
88
|
window.removeEventListener("message", handleMessage);
|
|
83
89
|
};
|
|
84
90
|
}, [onMessageReceived]);
|
|
91
|
+
// Listen for system theme changes when autoDetectTone is enabled
|
|
92
|
+
(0, react_1.useEffect)(() => {
|
|
93
|
+
if (!autoDetectTone || defaultTone)
|
|
94
|
+
return;
|
|
95
|
+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
96
|
+
const handleThemeChange = (e) => {
|
|
97
|
+
const detectedTone = e.matches ? "dark" : "light";
|
|
98
|
+
setActiveThemeTone(detectedTone);
|
|
99
|
+
};
|
|
100
|
+
mediaQuery.addEventListener('change', handleThemeChange);
|
|
101
|
+
return () => {
|
|
102
|
+
mediaQuery.removeEventListener('change', handleThemeChange);
|
|
103
|
+
};
|
|
104
|
+
}, [autoDetectTone, defaultTone, setActiveThemeTone]);
|
|
85
105
|
// --- We don't hide the nav panel if there's no header; in that case, we don't have a show drawer
|
|
86
106
|
// --- button. The exception is the condensed layout because we render a header in that case (otherwise,
|
|
87
107
|
// --- we couldn't show the NavPanel)
|
|
@@ -229,13 +249,13 @@ function App(_a) {
|
|
|
229
249
|
});
|
|
230
250
|
switch (safeLayout) {
|
|
231
251
|
case "vertical":
|
|
232
|
-
content = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.vertical), style: styleWithHelpers, children: [navPanelVisible && (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(App_module_scss_1.default.navPanelWrapper), children: navPanel }), (0, jsx_runtime_1.jsxs)("div", { className: App_module_scss_1.default.contentWrapper, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsx)("header", { ref: headerRefCallback, className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper), children: header }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)(
|
|
252
|
+
content = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.vertical), style: styleWithHelpers, children: [navPanelVisible && (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(App_module_scss_1.default.navPanelWrapper), children: navPanel }), (0, jsx_runtime_1.jsxs)("div", { className: App_module_scss_1.default.contentWrapper, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsx)("header", { ref: headerRefCallback, className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper), children: header }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)("div", { className: pagesWrapperClasses, children: children }) }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.footerWrapper, ref: footerRefCallback, children: footer })] })] })));
|
|
233
253
|
break;
|
|
234
254
|
case "vertical-sticky":
|
|
235
|
-
content = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.vertical, App_module_scss_1.default.sticky), style: styleWithHelpers, children: [navPanelVisible && (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(App_module_scss_1.default.navPanelWrapper), children: navPanel }), (0, jsx_runtime_1.jsxs)("div", { className: App_module_scss_1.default.contentWrapper, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsx)("header", { ref: headerRefCallback, className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper, App_module_scss_1.default.sticky), children: header }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)(
|
|
255
|
+
content = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.vertical, App_module_scss_1.default.sticky), style: styleWithHelpers, children: [navPanelVisible && (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(App_module_scss_1.default.navPanelWrapper), children: navPanel }), (0, jsx_runtime_1.jsxs)("div", { className: App_module_scss_1.default.contentWrapper, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsx)("header", { ref: headerRefCallback, className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper, App_module_scss_1.default.sticky), children: header }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)("div", { className: pagesWrapperClasses, children: children }) }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.footerWrapper, ref: footerRefCallback, children: footer })] })] })));
|
|
236
256
|
break;
|
|
237
257
|
case "vertical-full-header":
|
|
238
|
-
content = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.verticalFullHeader), style: styleWithHelpers, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsx)("header", { className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper, App_module_scss_1.default.sticky), ref: headerRefCallback, children: header }), (0, jsx_runtime_1.jsxs)("div", { className: App_module_scss_1.default.content, children: [navPanelVisible && (0, jsx_runtime_1.jsx)("aside", { className: App_module_scss_1.default.navPanelWrapper, children: navPanel }), (0, jsx_runtime_1.jsx)("main", { className: App_module_scss_1.default.contentWrapper, children: (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)(
|
|
258
|
+
content = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.verticalFullHeader), style: styleWithHelpers, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsx)("header", { className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper, App_module_scss_1.default.sticky), ref: headerRefCallback, children: header }), (0, jsx_runtime_1.jsxs)("div", { className: App_module_scss_1.default.content, children: [navPanelVisible && (0, jsx_runtime_1.jsx)("aside", { className: App_module_scss_1.default.navPanelWrapper, children: navPanel }), (0, jsx_runtime_1.jsx)("main", { className: App_module_scss_1.default.contentWrapper, children: (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)("div", { className: pagesWrapperClasses, children: children }) }) })] }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.footerWrapper, ref: footerRefCallback, children: footer })] })));
|
|
239
259
|
break;
|
|
240
260
|
case "condensed":
|
|
241
261
|
case "condensed-sticky":
|
|
@@ -243,14 +263,14 @@ function App(_a) {
|
|
|
243
263
|
[App_module_scss_1.default.sticky]: safeLayout === "condensed-sticky",
|
|
244
264
|
}), style: styleWithHelpers, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsxs)("header", { className: (0, classnames_1.default)("app-layout-condensed", App_module_scss_1.default.headerWrapper, {
|
|
245
265
|
[App_module_scss_1.default.sticky]: safeLayout === "condensed-sticky",
|
|
246
|
-
}), ref: headerRefCallback, children: [!hasRegisteredHeader && hasRegisteredNavPanel && ((0, jsx_runtime_1.jsx)(AppHeaderNative_1.AppContextAwareAppHeader, { renderChild: renderChild })), header] }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)(
|
|
266
|
+
}), ref: headerRefCallback, children: [!hasRegisteredHeader && hasRegisteredNavPanel && ((0, jsx_runtime_1.jsx)(AppHeaderNative_1.AppContextAwareAppHeader, { renderChild: renderChild })), header] }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)("div", { className: pagesWrapperClasses, children: children }) }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.footerWrapper, ref: footerRefCallback, children: footer })] })));
|
|
247
267
|
break;
|
|
248
268
|
case "horizontal": {
|
|
249
|
-
content = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.horizontal), style: styleWithHelpers, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsxs)("header", { className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper), ref: headerRefCallback, children: [header, navPanelVisible && (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.navPanelWrapper, children: navPanel })] }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)(
|
|
269
|
+
content = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.horizontal), style: styleWithHelpers, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsxs)("header", { className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper), ref: headerRefCallback, children: [header, navPanelVisible && (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.navPanelWrapper, children: navPanel })] }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)("div", { className: pagesWrapperClasses, children: children }) }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.footerWrapper, ref: footerRefCallback, children: footer })] })));
|
|
250
270
|
break;
|
|
251
271
|
}
|
|
252
272
|
case "horizontal-sticky":
|
|
253
|
-
content = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.horizontal, App_module_scss_1.default.sticky), style: styleWithHelpers, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsxs)("header", { className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper, App_module_scss_1.default.sticky), ref: headerRefCallback, children: [header, navPanelVisible && (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.navPanelWrapper, children: navPanel })] }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)(
|
|
273
|
+
content = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.horizontal, App_module_scss_1.default.sticky), style: styleWithHelpers, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsxs)("header", { className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper, App_module_scss_1.default.sticky), ref: headerRefCallback, children: [header, navPanelVisible && (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.navPanelWrapper, children: navPanel })] }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)("div", { className: pagesWrapperClasses, children: children }) }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.footerWrapper, ref: footerRefCallback, children: footer })] })));
|
|
254
274
|
break;
|
|
255
275
|
default:
|
|
256
276
|
throw new Error("layout type not supported: " + safeLayout);
|
|
@@ -80,7 +80,7 @@ exports.AutoCompleteMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
80
80
|
[`backgroundColor-item-${COMP}--active`]: "$backgroundColor-dropdown-item--active",
|
|
81
81
|
[`minHeight-Input`]: "39px",
|
|
82
82
|
[`backgroundColor-${COMP}-badge`]: "$color-primary-500",
|
|
83
|
-
[`fontSize-${COMP}-badge`]: "$fontSize-
|
|
83
|
+
[`fontSize-${COMP}-badge`]: "$fontSize-sm",
|
|
84
84
|
[`borderRadius-${COMP}-badge`]: "$borderRadius",
|
|
85
85
|
[`paddingHorizontal-${COMP}-badge`]: "$space-2",
|
|
86
86
|
[`paddingVertical-${COMP}-badge`]: "$space-1",
|
|
@@ -30,6 +30,7 @@ const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
|
|
|
30
30
|
const react_popover_1 = require("@radix-ui/react-popover");
|
|
31
31
|
const ItemWithLabel_1 = require("../FormItem/ItemWithLabel");
|
|
32
32
|
const HiddenOption_1 = require("../Select/HiddenOption");
|
|
33
|
+
const parts_1 = require("../../components-core/parts");
|
|
33
34
|
function isOptionsExist(options, newOptions) {
|
|
34
35
|
return newOptions.some((option) => Array.from(options).some((o) => o.value === option.value || o.label === option.label));
|
|
35
36
|
}
|
|
@@ -114,7 +115,7 @@ exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete(_a, forward
|
|
|
114
115
|
updateState({ value: newSelectedValue });
|
|
115
116
|
onDidChange(newSelectedValue);
|
|
116
117
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
117
|
-
}, [multi, value, updateState, onDidChange
|
|
118
|
+
}, [multi, value, updateState, onDidChange]);
|
|
118
119
|
(0, react_1.useEffect)(() => {
|
|
119
120
|
if (!Array.isArray(selectedValue)) {
|
|
120
121
|
setInputValue((selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.label) || "");
|
|
@@ -144,7 +145,7 @@ exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete(_a, forward
|
|
|
144
145
|
const focus = (0, react_1.useCallback)(() => {
|
|
145
146
|
var _a;
|
|
146
147
|
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
147
|
-
}, [inputRef
|
|
148
|
+
}, [inputRef]);
|
|
148
149
|
const setValue = (0, misc_1.useEvent)((newValue) => {
|
|
149
150
|
updateState({ value: newValue });
|
|
150
151
|
});
|
|
@@ -183,7 +184,7 @@ exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete(_a, forward
|
|
|
183
184
|
if (extendedValue.toLowerCase().includes(search.toLowerCase()))
|
|
184
185
|
return 1;
|
|
185
186
|
return 0;
|
|
186
|
-
}, children: [(0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, Object.assign({}, rest, { id: inputId, ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, className: className, children: (0, jsx_runtime_1.jsx)(react_popover_1.PopoverTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)("div", {
|
|
187
|
+
}, children: [(0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, Object.assign({}, rest, { id: inputId, ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, className: className, children: (0, jsx_runtime_1.jsx)(react_popover_1.PopoverTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)("div", { ref: setReferenceElement, style: Object.assign({ width: "100%" }, style), className: (0, classnames_1.default)(className, AutoComplete_module_scss_1.default.badgeListWrapper, AutoComplete_module_scss_1.default[validationStatus], {
|
|
187
188
|
[AutoComplete_module_scss_1.default.disabled]: !enabled,
|
|
188
189
|
[AutoComplete_module_scss_1.default.focused]: isFocused,
|
|
189
190
|
}), children: [Array.isArray(selectedValue) && ((0, jsx_runtime_1.jsx)("div", { className: AutoComplete_module_scss_1.default.badgeList, children: selectedValue.map((v, index) => ((0, jsx_runtime_1.jsxs)("span", { className: AutoComplete_module_scss_1.default.badge, children: [v === null || v === void 0 ? void 0 : v.label, !readOnly && ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "close", size: "sm", onClick: (event) => {
|
|
@@ -215,7 +216,7 @@ exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete(_a, forward
|
|
|
215
216
|
if (event.key === "Enter") {
|
|
216
217
|
setOpen((prev) => !prev);
|
|
217
218
|
}
|
|
218
|
-
}, id: id, readOnly: readOnly, autoFocus: autoFocus, ref: inputRef, value: inputValue, disabled: !enabled, onValueChange: (value) => {
|
|
219
|
+
}, id: inputId, "data-part-id": parts_1.PART_INPUT, readOnly: readOnly, autoFocus: autoFocus, "aria-expanded": open, ref: inputRef, value: inputValue, disabled: !enabled, onValueChange: (value) => {
|
|
219
220
|
setOpen(true);
|
|
220
221
|
setInputValue(value);
|
|
221
222
|
setSearchTerm(value);
|
|
@@ -18,7 +18,7 @@ exports.Breakout = void 0;
|
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const Breakout_module_scss_1 = __importDefault(require("./Breakout.module.scss"));
|
|
20
20
|
const Breakout = (_a) => {
|
|
21
|
-
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, rest, { className: Breakout_module_scss_1.default.breakout, children: children })));
|
|
21
|
+
var { children, style } = _a, rest = __rest(_a, ["children", "style"]);
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, rest, { style: style, className: Breakout_module_scss_1.default.breakout, children: children })));
|
|
23
23
|
};
|
|
24
24
|
exports.Breakout = Breakout;
|
|
@@ -101,7 +101,7 @@ exports.ButtonMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
101
101
|
[`width-${COMP}`]: "fit-content",
|
|
102
102
|
[`height-${COMP}`]: "fit-content",
|
|
103
103
|
[`borderRadius-${COMP}`]: "$borderRadius",
|
|
104
|
-
[`fontSize-${COMP}`]: "$fontSize-
|
|
104
|
+
[`fontSize-${COMP}`]: "$fontSize-sm",
|
|
105
105
|
[`fontWeight-${COMP}`]: "$fontWeight-medium",
|
|
106
106
|
[`backgroundColor-${COMP}-primary`]: "$color-primary-500",
|
|
107
107
|
[`backgroundColor-${COMP}-attention`]: "$backgroundColor-attention",
|
|
@@ -52,6 +52,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
52
52
|
const react_1 = __importStar(require("react"));
|
|
53
53
|
const classnames_1 = __importDefault(require("classnames"));
|
|
54
54
|
const Button_module_scss_1 = __importDefault(require("./Button.module.scss"));
|
|
55
|
+
const abstractions_1 = require("../abstractions");
|
|
55
56
|
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
56
57
|
const VisuallyHidden_1 = require("../VisuallyHidden");
|
|
57
58
|
exports.defaultProps = {
|
|
@@ -77,6 +78,9 @@ exports.Button = react_1.default.forwardRef(function Button(_a, ref) {
|
|
|
77
78
|
}
|
|
78
79
|
}, [autoFocus]);
|
|
79
80
|
const iconToLeft = iconPosition === "start";
|
|
81
|
+
if (!(0, abstractions_1.isSizeType)(size)) {
|
|
82
|
+
size = exports.defaultProps.size;
|
|
83
|
+
}
|
|
80
84
|
return ((0, jsx_runtime_1.jsxs)("button", Object.assign({}, rest, { id: id, type: type, ref: composedRef, className: (0, classnames_1.default)(Button_module_scss_1.default.button, {
|
|
81
85
|
[Button_module_scss_1.default.buttonHorizontal]: orientation === "horizontal",
|
|
82
86
|
[Button_module_scss_1.default.buttonVertical]: orientation === "vertical",
|