xmlui 0.9.77 → 0.9.79

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.
Files changed (33) hide show
  1. package/dist/lib/{index-BxVOvur-.mjs → index-Tct7bB50.mjs} +10622 -10398
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-D2cc9C81.mjs → initMock-CXDXFOVS.mjs} +1 -1
  4. package/dist/lib/xmlui.d.ts +23 -0
  5. package/dist/lib/xmlui.mjs +1 -1
  6. package/dist/metadata/{collectedComponentMetadata-DuCra6F5.mjs → collectedComponentMetadata-CJAnOboV.mjs} +10593 -10369
  7. package/dist/metadata/{initMock-DGSUjti0.mjs → initMock-D7yOIx8z.mjs} +1 -1
  8. package/dist/metadata/style.css +1 -1
  9. package/dist/metadata/xmlui-metadata.mjs +1 -1
  10. package/dist/metadata/xmlui-metadata.umd.js +104 -104
  11. package/dist/scripts/bin/build.js +6 -1
  12. package/dist/scripts/bin/index.js +4 -4
  13. package/dist/scripts/package.json +1 -1
  14. package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +63 -19
  15. package/dist/scripts/src/components/ComponentProvider.js +8 -2
  16. package/dist/scripts/src/components/EmojiSelector/DefaultProps.js +9 -0
  17. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +2 -1
  18. package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +5 -8
  19. package/dist/scripts/src/components/IconProvider.js +6 -4
  20. package/dist/scripts/src/components/Input/InputAdornment.js +4 -2
  21. package/dist/scripts/src/components/Link/LinkNative.js +2 -47
  22. package/dist/scripts/src/components/Markdown/MarkdownNative.js +89 -42
  23. package/dist/scripts/src/components/NestedApp/NestedApp.js +1 -0
  24. package/dist/scripts/src/components/TableEditor/TableEditor.js +2 -132
  25. package/dist/scripts/src/components/TableEditor/TableEditorNative.js +133 -5
  26. package/dist/scripts/src/components/TextBox/TextBox.js +16 -1
  27. package/dist/scripts/src/components/TextBox/TextBoxNative.js +12 -2
  28. package/dist/scripts/src/components/ToneSwitch/ToneSwitch.js +51 -0
  29. package/dist/scripts/src/components/ToneSwitch/ToneSwitchNative.js +29 -0
  30. package/dist/scripts/src/components-core/rendering/AppContent.js +65 -5
  31. package/dist/standalone/xmlui-standalone.es.d.ts +26 -0
  32. package/dist/standalone/xmlui-standalone.umd.js +241 -241
  33. package/package.json +1 -1
@@ -1,145 +1,16 @@
1
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
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
4
  };
38
5
  Object.defineProperty(exports, "__esModule", { value: true });
39
6
  exports.editorComponentRenderer = exports.TableEditorMd = void 0;
40
7
  const jsx_runtime_1 = require("react/jsx-runtime");
41
- const react_1 = __importStar(require("react"));
42
- const react_2 = require("@tiptap/react");
43
- const starter_kit_1 = __importDefault(require("@tiptap/starter-kit"));
44
- const extension_table_1 = __importDefault(require("@tiptap/extension-table"));
45
- const extension_table_row_1 = __importDefault(require("@tiptap/extension-table-row"));
46
- const extension_table_cell_1 = __importDefault(require("@tiptap/extension-table-cell"));
47
- const extension_table_header_1 = __importDefault(require("@tiptap/extension-table-header"));
48
- const ButtonNative_1 = require("../Button/ButtonNative");
49
- const StackNative_1 = require("../Stack/StackNative");
50
- const TableEditorNative_1 = require("./TableEditorNative");
51
- const turndown_1 = __importDefault(require("turndown"));
52
8
  const metadata_helpers_1 = require("../metadata-helpers");
53
9
  const renderers_1 = require("../../components-core/renderers");
54
10
  const abstractions_1 = require("../abstractions");
55
- const IconNative_1 = __importDefault(require("../Icon/IconNative"));
56
11
  const TableEditor_module_scss_1 = __importDefault(require("./TableEditor.module.scss"));
57
12
  const themeVars_1 = require("../../components-core/theming/themeVars");
58
- const TableEditor = (0, react_1.forwardRef)(function TableEditor({ registerComponentApi, themeColor = "primary", variant = "solid", size = "sm", onDidChange = () => { }, }, ref) {
59
- const editor = (0, react_2.useEditor)({
60
- extensions: [
61
- starter_kit_1.default,
62
- extension_table_1.default.configure({ resizable: true }),
63
- extension_table_row_1.default,
64
- extension_table_header_1.default,
65
- extension_table_cell_1.default,
66
- ],
67
- content: `
68
- <table>
69
- <thead>
70
- <tr>
71
- <th>Fruit</th>
72
- <th>Color</th>
73
- </tr>
74
- </thead>
75
- <tbody>
76
- <tr>
77
- <td>Apple</td>
78
- <td>Red</td>
79
- </tr>
80
- <tr>
81
- <td>Banana</td>
82
- <td>Yellow</td>
83
- </tr>
84
- </tbody>
85
- </table>
86
- `,
87
- });
88
- const turndownService = new turndown_1.default();
89
- turndownService.addRule("table", {
90
- filter: "table",
91
- replacement: function (content, node) {
92
- let rows = [];
93
- for (let row of node.querySelectorAll("tr")) {
94
- let cells = Array.from(row.children).map((cell) => { var _a, _b; return (_b = (_a = cell.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : ""; });
95
- rows.push("| " + cells.join(" | ") + " |");
96
- }
97
- if (rows.length > 1) {
98
- // Add a separator after the header row
99
- const headerSep = "| " +
100
- rows[0]
101
- .split("|")
102
- .slice(1, -1)
103
- .map(() => "---")
104
- .join(" | ") +
105
- " |";
106
- rows.splice(1, 0, headerSep);
107
- }
108
- return rows.join("\n") + "\n";
109
- },
110
- });
111
- (0, react_1.useImperativeHandle)(ref, () => ({
112
- getMarkdownSource: () => { var _a, _b; return turndownService.turndown((_b = (_a = editor === null || editor === void 0 ? void 0 : editor.getHTML) === null || _a === void 0 ? void 0 : _a.call(editor)) !== null && _b !== void 0 ? _b : ""); },
113
- getHtmlSource: () => { var _a, _b; return (_b = (_a = editor === null || editor === void 0 ? void 0 : editor.getHTML) === null || _a === void 0 ? void 0 : _a.call(editor)) !== null && _b !== void 0 ? _b : ""; },
114
- }), [editor]);
115
- react_1.default.useEffect(() => {
116
- if (registerComponentApi && editor) {
117
- registerComponentApi({
118
- getHtmlSource: () => editor.getHTML(),
119
- getMarkdownSource: () => turndownService.turndown(editor.getHTML()),
120
- });
121
- }
122
- }, [registerComponentApi, editor]);
123
- // Emit onDidChange whenever the editor content changes
124
- react_1.default.useEffect(() => {
125
- if (!editor)
126
- return;
127
- const handler = () => {
128
- const html = editor.getHTML();
129
- const markdown = turndownService.turndown(html);
130
- //console.log("[TableEditor] onDidChange about to fire", { html, markdown, onDidChange });
131
- onDidChange({ html, markdown });
132
- };
133
- editor.on("update", handler);
134
- // Emit once on mount
135
- handler();
136
- return () => {
137
- editor.off("update", handler);
138
- };
139
- }, [editor, onDidChange]);
140
- return ((0, jsx_runtime_1.jsxs)("div", { className: "table-editor-root", children: [(0, jsx_runtime_1.jsx)("div", { className: "button-stack", children: (0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => editor && editor.commands.addRowAfter(), disabled: !editor, themeColor: themeColor, variant: variant, size: size, orientation: "horizontal", icon: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "table-insert-row", "aria-hidden": true }), children: "Insert Row" }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => editor && editor.commands.deleteRow(), disabled: !editor, themeColor: themeColor, variant: variant, size: size, orientation: "horizontal", icon: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "table-delete-row", "aria-hidden": true }), children: "Delete Row" }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => editor && editor.commands.addColumnAfter(), disabled: !editor, themeColor: themeColor, variant: variant, size: size, orientation: "horizontal", icon: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "table-insert-column", "aria-hidden": true }), children: "Insert Column" }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => editor && editor.commands.deleteColumn(), disabled: !editor, themeColor: themeColor, variant: variant, size: size, orientation: "horizontal", icon: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "table-delete-column", "aria-hidden": true }), children: "Delete Column" })] }) }), (0, jsx_runtime_1.jsx)(TableEditorNative_1.TableEditorNative, { editor: editor, className: TableEditor_module_scss_1.default.editor })] }));
141
- });
142
- exports.default = TableEditor;
13
+ const TableEditorNative_1 = require("./TableEditorNative");
143
14
  // Create metadata for TableEditor that defines allowed props
144
15
  exports.TableEditorMd = (0, metadata_helpers_1.createMetadata)({
145
16
  status: "stable",
@@ -178,6 +49,5 @@ exports.TableEditorMd = (0, metadata_helpers_1.createMetadata)({
178
49
  });
179
50
  exports.editorComponentRenderer = (0, renderers_1.createComponentRenderer)("TableEditor", exports.TableEditorMd, ({ node, extractValue, registerComponentApi, lookupEventHandler }) => {
180
51
  const handler = lookupEventHandler === null || lookupEventHandler === void 0 ? void 0 : lookupEventHandler("didChange");
181
- //console.log("[TableEditor renderer] didChange handler:", handler);
182
- return ((0, jsx_runtime_1.jsx)(TableEditor, { themeColor: extractValue.asOptionalString(node.props.themeColor), variant: extractValue.asOptionalString(node.props.variant), size: extractValue.asOptionalString(node.props.size), registerComponentApi: registerComponentApi, onDidChange: handler }));
52
+ return ((0, jsx_runtime_1.jsx)(TableEditorNative_1.TableEditor, { themeColor: extractValue.asOptionalString(node.props.themeColor), variant: extractValue.asOptionalString(node.props.variant), size: extractValue.asOptionalString(node.props.size), registerComponentApi: registerComponentApi, onDidChange: handler }));
183
53
  });
@@ -1,8 +1,136 @@
1
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
+ };
2
38
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TableEditorNative = TableEditorNative;
39
+ exports.TableEditor = void 0;
4
40
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("@tiptap/react");
6
- function TableEditorNative({ editor, className }) {
7
- return ((0, jsx_runtime_1.jsx)("div", { className: className, children: (0, jsx_runtime_1.jsx)(react_1.EditorContent, { editor: editor }) }));
8
- }
41
+ const react_1 = __importStar(require("react"));
42
+ const react_2 = require("@tiptap/react");
43
+ const starter_kit_1 = __importDefault(require("@tiptap/starter-kit"));
44
+ const extension_table_1 = __importDefault(require("@tiptap/extension-table"));
45
+ const extension_table_row_1 = __importDefault(require("@tiptap/extension-table-row"));
46
+ const extension_table_cell_1 = __importDefault(require("@tiptap/extension-table-cell"));
47
+ const extension_table_header_1 = __importDefault(require("@tiptap/extension-table-header"));
48
+ const ButtonNative_1 = require("../Button/ButtonNative");
49
+ const StackNative_1 = require("../Stack/StackNative");
50
+ const turndown_1 = __importDefault(require("turndown"));
51
+ const IconNative_1 = __importDefault(require("../Icon/IconNative"));
52
+ const TableEditor_module_scss_1 = __importDefault(require("./TableEditor.module.scss"));
53
+ exports.TableEditor = (0, react_1.forwardRef)(function TableEditor({ registerComponentApi, themeColor = "primary", variant = "solid", size = "sm", onDidChange = () => { }, }, ref) {
54
+ const editor = (0, react_2.useEditor)({
55
+ extensions: [
56
+ starter_kit_1.default,
57
+ extension_table_1.default.configure({ resizable: true }),
58
+ extension_table_row_1.default,
59
+ extension_table_header_1.default,
60
+ extension_table_cell_1.default,
61
+ ],
62
+ content: `
63
+ <table>
64
+ <thead>
65
+ <tr>
66
+ <th>Fruit</th>
67
+ <th>Color</th>
68
+ </tr>
69
+ </thead>
70
+ <tbody>
71
+ <tr>
72
+ <td>Apple</td>
73
+ <td>Red</td>
74
+ </tr>
75
+ <tr>
76
+ <td>Banana</td>
77
+ <td>Yellow</td>
78
+ </tr>
79
+ </tbody>
80
+ </table>
81
+ `,
82
+ });
83
+ const turndownService = new turndown_1.default();
84
+ turndownService.addRule("table", {
85
+ filter: "table",
86
+ replacement: function (content, node) {
87
+ let rows = [];
88
+ for (let row of node.querySelectorAll("tr")) {
89
+ let cells = Array.from(row.children).map((cell) => { var _a, _b; return (_b = (_a = cell.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : ""; });
90
+ rows.push("| " + cells.join(" | ") + " |");
91
+ }
92
+ if (rows.length > 1) {
93
+ // Add a separator after the header row
94
+ const headerSep = "| " +
95
+ rows[0]
96
+ .split("|")
97
+ .slice(1, -1)
98
+ .map(() => "---")
99
+ .join(" | ") +
100
+ " |";
101
+ rows.splice(1, 0, headerSep);
102
+ }
103
+ return rows.join("\n") + "\n";
104
+ },
105
+ });
106
+ (0, react_1.useImperativeHandle)(ref, () => ({
107
+ getMarkdownSource: () => { var _a, _b; return turndownService.turndown((_b = (_a = editor === null || editor === void 0 ? void 0 : editor.getHTML) === null || _a === void 0 ? void 0 : _a.call(editor)) !== null && _b !== void 0 ? _b : ""); },
108
+ getHtmlSource: () => { var _a, _b; return (_b = (_a = editor === null || editor === void 0 ? void 0 : editor.getHTML) === null || _a === void 0 ? void 0 : _a.call(editor)) !== null && _b !== void 0 ? _b : ""; },
109
+ }), [editor]);
110
+ react_1.default.useEffect(() => {
111
+ if (registerComponentApi && editor) {
112
+ registerComponentApi({
113
+ getHtmlSource: () => editor.getHTML(),
114
+ getMarkdownSource: () => turndownService.turndown(editor.getHTML()),
115
+ });
116
+ }
117
+ }, [registerComponentApi, editor]);
118
+ // Emit onDidChange whenever the editor content changes
119
+ react_1.default.useEffect(() => {
120
+ if (!editor)
121
+ return;
122
+ const handler = () => {
123
+ const html = editor.getHTML();
124
+ const markdown = turndownService.turndown(html);
125
+ //console.log("[TableEditor] onDidChange about to fire", { html, markdown, onDidChange });
126
+ onDidChange({ html, markdown });
127
+ };
128
+ editor.on("update", handler);
129
+ // Emit once on mount
130
+ handler();
131
+ return () => {
132
+ editor.off("update", handler);
133
+ };
134
+ }, [editor, onDidChange]);
135
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "table-editor-root", children: [(0, jsx_runtime_1.jsx)("div", { className: "button-stack", children: (0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => editor && editor.commands.addRowAfter(), disabled: !editor, themeColor: themeColor, variant: variant, size: size, orientation: "horizontal", icon: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "table-insert-row", "aria-hidden": true }), children: "Insert Row" }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => editor && editor.commands.deleteRow(), disabled: !editor, themeColor: themeColor, variant: variant, size: size, orientation: "horizontal", icon: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "table-delete-row", "aria-hidden": true }), children: "Delete Row" }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => editor && editor.commands.addColumnAfter(), disabled: !editor, themeColor: themeColor, variant: variant, size: size, orientation: "horizontal", icon: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "table-insert-column", "aria-hidden": true }), children: "Insert Column" }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => editor && editor.commands.deleteColumn(), disabled: !editor, themeColor: themeColor, variant: variant, size: size, orientation: "horizontal", icon: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "table-delete-column", "aria-hidden": true }), children: "Delete Column" })] }) }), (0, jsx_runtime_1.jsx)("div", { className: TableEditor_module_scss_1.default.editor, children: (0, jsx_runtime_1.jsx)(react_2.EditorContent, { editor: editor }) })] }));
136
+ });
@@ -36,6 +36,20 @@ exports.TextBoxMd = (0, metadata_helpers_1.createMetadata)({
36
36
  description: "This property defines the gap between the adornments and the input area. If not " +
37
37
  "set, the gap declared by the current theme is used.",
38
38
  },
39
+ showPasswordToggle: {
40
+ description: "If `true`, a toggle button is displayed to switch between showing and hiding the password input.",
41
+ defaultValue: false,
42
+ },
43
+ passwordVisibleIcon: {
44
+ description: "The icon to display when the password is visible (when showPasswordToggle is true).",
45
+ valueType: "string",
46
+ defaultValue: "eye",
47
+ },
48
+ passwordHiddenIcon: {
49
+ description: "The icon to display when the password is hidden (when showPasswordToggle is true).",
50
+ valueType: "string",
51
+ defaultValue: "eye-off",
52
+ }
39
53
  },
40
54
  events: {
41
55
  gotFocus: (0, metadata_helpers_1.dGotFocus)(COMP),
@@ -69,6 +83,7 @@ exports.TextBoxMd = (0, metadata_helpers_1.createMetadata)({
69
83
  "outlineWidth-Input--focus": "$outlineWidth--focus",
70
84
  "outlineStyle-Input--focus": "$outlineStyle--focus",
71
85
  "outlineOffset-Input--focus": "$outlineOffset--focus",
86
+ "color-passwordToggle-Input": "$textColor-subtitle",
72
87
  light: {
73
88
  // --- No light-specific theme vars
74
89
  },
@@ -79,7 +94,7 @@ exports.TextBoxMd = (0, metadata_helpers_1.createMetadata)({
79
94
  });
80
95
  function renderTextBox(layoutCss, state, updateState, extractValue, node, lookupEventHandler, registerComponentApi, type = "text") {
81
96
  delete layoutCss.gap;
82
- return ((0, jsx_runtime_1.jsx)(TextBoxNative_1.TextBox, { type: type, style: layoutCss, value: state.value, updateState: updateState, initialValue: extractValue(node.props.initialValue), maxLength: extractValue(node.props.maxLength), 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, startText: extractValue.asOptionalString(node.props.startText), startIcon: extractValue.asOptionalString(node.props.startIcon), endText: extractValue.asOptionalString(node.props.endText), endIcon: extractValue.asOptionalString(node.props.endIcon), gap: extractValue.asOptionalString(node.props.gap), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), label: extractValue.asOptionalString(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue.asOptionalString(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required) }));
97
+ return ((0, jsx_runtime_1.jsx)(TextBoxNative_1.TextBox, { type: type, style: layoutCss, value: state.value, updateState: updateState, initialValue: extractValue(node.props.initialValue), maxLength: extractValue(node.props.maxLength), 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, startText: extractValue.asOptionalString(node.props.startText), startIcon: extractValue.asOptionalString(node.props.startIcon), endText: extractValue.asOptionalString(node.props.endText), endIcon: extractValue.asOptionalString(node.props.endIcon), gap: extractValue.asOptionalString(node.props.gap), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), label: extractValue.asOptionalString(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue.asOptionalString(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required), showPasswordToggle: extractValue.asOptionalBoolean(node.props.showPasswordToggle, false), passwordVisibleIcon: extractValue.asOptionalString(node.props.passwordVisibleIcon), passwordHiddenIcon: extractValue.asOptionalString(node.props.passwordHiddenIcon) }));
83
98
  }
84
99
  exports.textBoxComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TextBoxMd, ({ node, state, updateState, lookupEventHandler, extractValue, layoutCss, registerComponentApi, }) => {
85
100
  return renderTextBox(layoutCss, state, updateState, extractValue, node, lookupEventHandler, registerComponentApi);
@@ -57,11 +57,21 @@ exports.defaultProps = {
57
57
  onBlur: constants_1.noop,
58
58
  onKeyDown: constants_1.noop,
59
59
  updateState: constants_1.noop,
60
+ passwordVisibleIcon: "eye",
61
+ passwordHiddenIcon: "eye-off",
60
62
  };
61
- exports.TextBox = (0, react_1.forwardRef)(function TextBox({ id, type = exports.defaultProps.type, value = exports.defaultProps.value, updateState = exports.defaultProps.updateState, initialValue = exports.defaultProps.initialValue, style, maxLength, enabled = exports.defaultProps.enabled, placeholder, validationStatus = exports.defaultProps.validationStatus, onDidChange = exports.defaultProps.onDidChange, onFocus = exports.defaultProps.onFocus, onBlur = exports.defaultProps.onBlur, onKeyDown = exports.defaultProps.onKeyDown, registerComponentApi, startText, startIcon, endText, endIcon, gap, autoFocus, readOnly, tabIndex, label, labelPosition, labelWidth, labelBreak, required, }, ref) {
63
+ exports.TextBox = (0, react_1.forwardRef)(function TextBox({ id, type = exports.defaultProps.type, value = exports.defaultProps.value, updateState = exports.defaultProps.updateState, initialValue = exports.defaultProps.initialValue, style, maxLength, enabled = exports.defaultProps.enabled, placeholder, validationStatus = exports.defaultProps.validationStatus, onDidChange = exports.defaultProps.onDidChange, onFocus = exports.defaultProps.onFocus, onBlur = exports.defaultProps.onBlur, onKeyDown = exports.defaultProps.onKeyDown, registerComponentApi, startText, startIcon, endText, endIcon, gap, autoFocus, readOnly, tabIndex, label, labelPosition, labelWidth, labelBreak, required, showPasswordToggle, passwordVisibleIcon = exports.defaultProps.passwordVisibleIcon, passwordHiddenIcon = exports.defaultProps.passwordHiddenIcon, }, ref) {
62
64
  const _id = (0, react_1.useId)();
63
65
  id = id || _id;
64
66
  const inputRef = (0, react_2.useRef)(null);
67
+ // State to control password visibility
68
+ const [showPassword, setShowPassword] = (0, react_1.useState)(false);
69
+ // Determine the actual input type based on the password visibility toggle
70
+ const actualType = (type === "password" && showPassword) ? "text" : type;
71
+ // Toggle password visibility
72
+ const togglePasswordVisibility = (0, react_2.useCallback)(() => {
73
+ setShowPassword(prev => !prev);
74
+ }, []);
65
75
  (0, react_2.useEffect)(() => {
66
76
  if (autoFocus) {
67
77
  setTimeout(() => {
@@ -116,5 +126,5 @@ exports.TextBox = (0, react_1.forwardRef)(function TextBox({ id, type = exports.
116
126
  [TextBox_module_scss_1.default.error]: validationStatus === "error",
117
127
  [TextBox_module_scss_1.default.warning]: validationStatus === "warning",
118
128
  [TextBox_module_scss_1.default.valid]: validationStatus === "valid",
119
- }), tabIndex: -1, onFocus: focus, style: { gap }, children: [(0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: startText, iconName: startIcon, className: TextBox_module_scss_1.default.adornment }), (0, jsx_runtime_1.jsx)("input", { id: id, type: type, className: (0, classnames_1.default)(TextBox_module_scss_1.default.input, { [TextBox_module_scss_1.default.readOnly]: readOnly }), disabled: !enabled, value: localValue, maxLength: maxLength, placeholder: placeholder, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, onKeyDown: onKeyDown, ref: inputRef, readOnly: readOnly, autoFocus: autoFocus, tabIndex: enabled ? tabIndex : -1, required: required }), (0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: endText, iconName: endIcon, className: TextBox_module_scss_1.default.adornment })] }) }));
129
+ }), tabIndex: -1, onFocus: focus, style: { gap }, children: [(0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: startText, iconName: startIcon, className: TextBox_module_scss_1.default.adornment }), (0, jsx_runtime_1.jsx)("input", { id: id, type: actualType, className: (0, classnames_1.default)(TextBox_module_scss_1.default.input, { [TextBox_module_scss_1.default.readOnly]: readOnly }), disabled: !enabled, value: localValue, maxLength: maxLength, placeholder: placeholder, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, onKeyDown: onKeyDown, ref: inputRef, readOnly: readOnly, autoFocus: autoFocus, tabIndex: enabled ? tabIndex : -1, required: required }), type === "password" && showPasswordToggle ? ((0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { iconName: showPassword ? passwordVisibleIcon : passwordHiddenIcon, className: (0, classnames_1.default)(TextBox_module_scss_1.default.adornment, TextBox_module_scss_1.default.passwordToggle), onClick: togglePasswordVisibility })) : ((0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: endText, iconName: endIcon, className: TextBox_module_scss_1.default.adornment }))] }) }));
120
130
  });
@@ -0,0 +1,51 @@
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.toneSwitchComponentRenderer = exports.ToneSwitchMd = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const renderers_1 = require("../../components-core/renderers");
9
+ const metadata_helpers_1 = require("../metadata-helpers");
10
+ const themeVars_1 = require("../../components-core/theming/themeVars");
11
+ const ToneSwitch_module_scss_1 = __importDefault(require("./ToneSwitch.module.scss"));
12
+ const ToneSwitchNative_1 = require("./ToneSwitchNative");
13
+ const COMP = "ToneSwitch";
14
+ exports.ToneSwitchMd = (0, metadata_helpers_1.createMetadata)({
15
+ status: "stable",
16
+ description: "`ToneSwitch` enables the user to switch between light and dark modes using a switch control.",
17
+ props: {
18
+ iconLight: {
19
+ type: "string",
20
+ description: "Icon to display for light mode",
21
+ defaultValue: "sun",
22
+ },
23
+ iconDark: {
24
+ type: "string",
25
+ description: "Icon to display for dark mode",
26
+ defaultValue: "moon",
27
+ },
28
+ },
29
+ themeVars: (0, themeVars_1.parseScssVar)(ToneSwitch_module_scss_1.default.themeVars),
30
+ limitThemeVarsToComponent: true,
31
+ defaultThemeVars: {
32
+ [`backgroundColor-${COMP}-light`]: "$color-surface-200",
33
+ [`color-${COMP}-light`]: "$color-text-primary",
34
+ [`backgroundColor-${COMP}-dark`]: "$color-primary-500",
35
+ [`color-${COMP}-dark`]: "$color-surface-0",
36
+ [`borderColor-${COMP}`]: "$color-surface-200",
37
+ [`borderColor-${COMP}--hover`]: "$color-surface-300",
38
+ dark: {
39
+ [`backgroundColor-${COMP}-light`]: "$color-surface-700",
40
+ [`color-${COMP}-light`]: "$color-text-primary",
41
+ [`borderColor-${COMP}`]: "$color-surface-600",
42
+ [`borderColor-${COMP}--hover`]: "$color-surface-500",
43
+ },
44
+ },
45
+ });
46
+ /**
47
+ * Define the renderer for the ToneSwitch component
48
+ */
49
+ exports.toneSwitchComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.ToneSwitchMd, ({ node, extractValue }) => {
50
+ return (0, jsx_runtime_1.jsx)(ToneSwitchNative_1.ToneSwitch, { iconLight: extractValue(node.props.iconLight), iconDark: extractValue(node.props.iconDark) });
51
+ });
@@ -0,0 +1,29 @@
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.ToneSwitch = ToneSwitch;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
9
+ const IconNative_1 = __importDefault(require("../Icon/IconNative"));
10
+ const Toggle_1 = require("../Toggle/Toggle");
11
+ const ToneSwitch_module_scss_1 = __importDefault(require("./ToneSwitch.module.scss"));
12
+ const classnames_1 = __importDefault(require("classnames"));
13
+ // Default icons for light and dark modes
14
+ const DEFAULT_LIGHT_ICON = "sun";
15
+ const DEFAULT_DARK_ICON = "moon";
16
+ function ToneSwitch({ iconLight = DEFAULT_LIGHT_ICON, iconDark = DEFAULT_DARK_ICON }) {
17
+ const { activeThemeTone, setActiveThemeTone } = (0, ThemeContext_1.useThemes)();
18
+ //console.log('ToneSwitch render - activeThemeTone:', activeThemeTone); // Debug log
19
+ const handleChange = (isDark) => {
20
+ setActiveThemeTone(isDark ? "dark" : "light");
21
+ };
22
+ return ((0, jsx_runtime_1.jsx)("div", { style: { width: 'fit-content', display: 'inline-block' }, className: "toneSwitchContainer", children: (0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { value: activeThemeTone === "dark", onDidChange: handleChange, variant: "switch", style: { width: 'fit-content' }, inputRenderer: (contextVars) => {
23
+ //console.log('ToneSwitch contextVars:', contextVars); // Debug log
24
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(ToneSwitch_module_scss_1.default.iconSwitch, {
25
+ [ToneSwitch_module_scss_1.default.light]: !contextVars.$checked,
26
+ [ToneSwitch_module_scss_1.default.dark]: contextVars.$checked
27
+ }), children: (0, jsx_runtime_1.jsx)("div", { className: ToneSwitch_module_scss_1.default.iconThumb, children: !contextVars.$checked ? ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: iconLight, fallback: "sun", className: ToneSwitch_module_scss_1.default.icon })) : ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: iconDark, fallback: "moon", className: ToneSwitch_module_scss_1.default.icon })) }) }));
28
+ } }) }));
29
+ }
@@ -90,7 +90,7 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
90
90
  observer.current.unobserve(root);
91
91
  }
92
92
  if (trackContainerHeight === "auto") {
93
- root.style.setProperty("--containerHeight", 'auto');
93
+ root.style.setProperty("--containerHeight", "auto");
94
94
  }
95
95
  else {
96
96
  observer.current = new ResizeObserver((entries) => {
@@ -191,14 +191,28 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
191
191
  if (lastHash.current !== hash) {
192
192
  lastHash.current = hash;
193
193
  if (!((_a = location.state) === null || _a === void 0 ? void 0 : _a.preventHashScroll)) {
194
+ const rootNode = root === null || root === void 0 ? void 0 : root.getRootNode();
195
+ const scrollBehavior = "instant";
194
196
  requestAnimationFrame(() => {
195
197
  var _a;
196
- (_a = document
197
- .getElementById(lastHash.current)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: "instant", block: "start" });
198
+ if (!rootNode)
199
+ return;
200
+ // --- If element is in shadow DOM
201
+ if (rootNode instanceof ShadowRoot) {
202
+ const el = rootNode.getElementById(lastHash.current);
203
+ if (!el)
204
+ return;
205
+ scrollAncestorsToView(el, scrollBehavior);
206
+ }
207
+ else {
208
+ // --- If element is in light DOM
209
+ (_a = document
210
+ .getElementById(lastHash.current)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: scrollBehavior, block: "start" });
211
+ }
198
212
  });
199
213
  }
200
214
  }
201
- }, [location, scrollForceRefresh]);
215
+ }, [location, scrollForceRefresh, root]);
202
216
  const forceRefreshAnchorScroll = (0, react_1.useCallback)(() => {
203
217
  lastHash.current = "";
204
218
  setScrollForceRefresh((prev) => prev + 1);
@@ -345,7 +359,7 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
345
359
  cleanup: constants_1.noop,
346
360
  memoedVarsRef,
347
361
  });
348
- return ((0, jsx_runtime_1.jsx)(AppContext_1.AppContext.Provider, { value: appContextValue, children: (0, jsx_runtime_1.jsx)(AppStateContext_1.AppStateContext.Provider, { value: appStateContextValue, children: (!!children && (0, react_1.isValidElement)(renderedRoot))
362
+ return ((0, jsx_runtime_1.jsx)(AppContext_1.AppContext.Provider, { value: appContextValue, children: (0, jsx_runtime_1.jsx)(AppStateContext_1.AppStateContext.Provider, { value: appStateContextValue, children: !!children && (0, react_1.isValidElement)(renderedRoot)
349
363
  ? (0, react_1.cloneElement)(renderedRoot, null, children)
350
364
  : renderedRoot }) }));
351
365
  }
@@ -353,3 +367,49 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
353
367
  function signError(error) {
354
368
  react_hot_toast_1.default.error(typeof error === "string" ? error : error.message || "Something went wrong");
355
369
  }
370
+ /**
371
+ * Scrolls all ancestors of the specified element into view up to the first shadow root the element is in.
372
+ * @param target The element to scroll to, can be in the light or shadow DOM
373
+ * @param scrollBehavior The scroll behavior
374
+ */
375
+ function scrollAncestorsToView(target, scrollBehavior) {
376
+ const scrollables = getScrollableAncestors(target);
377
+ // It's important to start from the outermost and work inwards.
378
+ scrollables.reverse().forEach((container) => {
379
+ // Compute the position of target relative to container
380
+ const targetRect = target.getBoundingClientRect();
381
+ const containerRect = container.getBoundingClientRect();
382
+ // Scroll so that the target is visible in this container
383
+ if (targetRect.top < containerRect.top || targetRect.bottom > containerRect.bottom) {
384
+ // Only scroll vertically, add more logic for horizontal if needed
385
+ const offset = targetRect.top - containerRect.top + container.scrollTop;
386
+ container.scrollTo({ top: offset, behavior: scrollBehavior });
387
+ }
388
+ // Optionally handle horizontal scrolling similarly
389
+ });
390
+ function getScrollableAncestors(el) {
391
+ const scrollables = [];
392
+ let current = el;
393
+ while (current) {
394
+ let parent = current.parentElement;
395
+ // If no parentElement, might be in shadow DOM
396
+ if (!parent && current.getRootNode) {
397
+ break;
398
+ // NOTE: Disregard shadow DOM, because we will scroll everything otherwise
399
+ /* const root = current.getRootNode();
400
+ if (root && root instanceof ShadowRoot && root.host) {
401
+ parent = root.host as (HTMLElement | null);
402
+ } */
403
+ }
404
+ if (!parent)
405
+ break;
406
+ // Check if this parent is scrollable
407
+ const style = getComputedStyle(parent);
408
+ if (/(auto|scroll|overlay)/.test(style.overflow + style.overflowY + style.overflowX)) {
409
+ scrollables.push(parent);
410
+ }
411
+ current = parent;
412
+ }
413
+ return scrollables;
414
+ }
415
+ }
@@ -1061,6 +1061,14 @@ declare type Props_3 = {
1061
1061
  distributeEvenly?: boolean;
1062
1062
  };
1063
1063
 
1064
+ /**
1065
+ * TextBox component that supports text input with various configurations.
1066
+ * Features:
1067
+ * - Standard text, password, and search input types
1068
+ * - Input validation states
1069
+ * - Start/end adornments (icons and text)
1070
+ * - Password visibility toggle option
1071
+ */
1064
1072
  declare type Props_4 = {
1065
1073
  id?: string;
1066
1074
  type?: "text" | "password" | "search";
@@ -1090,6 +1098,21 @@ declare type Props_4 = {
1090
1098
  labelWidth?: string;
1091
1099
  labelBreak?: boolean;
1092
1100
  required?: boolean;
1101
+ /**
1102
+ * When true and type is "password", displays a toggle icon to show/hide password text
1103
+ * Default: false
1104
+ */
1105
+ showPasswordToggle?: boolean;
1106
+ /**
1107
+ * The icon to show when the password is visible
1108
+ * Default: "eye"
1109
+ */
1110
+ passwordVisibleIcon?: string;
1111
+ /**
1112
+ * The icon to show when the password is hidden
1113
+ * Default: "eye-off"
1114
+ */
1115
+ passwordHiddenIcon?: string;
1093
1116
  };
1094
1117
 
1095
1118
  declare type REACTIVE_VAR_DECLARATION = typeof T_REACTIVE_VAR_DECLARATION;
@@ -1370,6 +1393,9 @@ declare const standaloneExports: {
1370
1393
  labelWidth?: string;
1371
1394
  labelBreak?: boolean;
1372
1395
  required?: boolean;
1396
+ showPasswordToggle?: boolean;
1397
+ passwordVisibleIcon?: string;
1398
+ passwordHiddenIcon?: string;
1373
1399
  } & default_2.RefAttributes<HTMLDivElement>>;
1374
1400
  NestedApp: typeof xmluiExports.NestedApp;
1375
1401
  VisuallyHidden: ({ children, ...props }: {