@arcanewizards/sigil 0.1.0
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/chunk-4PMRDURG.js +66 -0
- package/dist/chunk-5DRI7C4U.cjs +66 -0
- package/dist/chunk-A5LYYZER.cjs +103 -0
- package/dist/chunk-BIY5HAXP.js +125 -0
- package/dist/chunk-CAYKPJIX.cjs +10 -0
- package/dist/chunk-EJNNLQ2S.js +72 -0
- package/dist/chunk-FHXT3DAL.js +103 -0
- package/dist/chunk-H4U4Z4GM.js +66 -0
- package/dist/chunk-LSHKAVON.js +10 -0
- package/dist/chunk-MXDDIFIO.cjs +767 -0
- package/dist/chunk-PEARNJ5G.cjs +125 -0
- package/dist/chunk-RI33QVOD.cjs +66 -0
- package/dist/chunk-VZ4A6RRT.cjs +72 -0
- package/dist/chunk-XAK7WC3D.js +767 -0
- package/dist/frontend/appearance.cjs +88 -0
- package/dist/frontend/appearance.d.cts +11 -0
- package/dist/frontend/appearance.d.ts +11 -0
- package/dist/frontend/appearance.js +88 -0
- package/dist/frontend/context.cjs +16 -0
- package/dist/frontend/context.d.cts +32 -0
- package/dist/frontend/context.d.ts +32 -0
- package/dist/frontend/context.js +16 -0
- package/dist/frontend/controls/index.cjs +49 -0
- package/dist/frontend/controls/index.d.cts +168 -0
- package/dist/frontend/controls/index.d.ts +168 -0
- package/dist/frontend/controls/index.js +49 -0
- package/dist/frontend/dialogs.cjs +17 -0
- package/dist/frontend/dialogs.d.cts +36 -0
- package/dist/frontend/dialogs.d.ts +36 -0
- package/dist/frontend/dialogs.js +17 -0
- package/dist/frontend/input.cjs +8 -0
- package/dist/frontend/input.d.cts +33 -0
- package/dist/frontend/input.d.ts +33 -0
- package/dist/frontend/input.js +8 -0
- package/dist/frontend/preferences.cjs +54 -0
- package/dist/frontend/preferences.d.cts +14 -0
- package/dist/frontend/preferences.d.ts +14 -0
- package/dist/frontend/preferences.js +54 -0
- package/dist/frontend/styles/base.css +321 -0
- package/dist/frontend/styles/sigil.css +785 -0
- package/dist/frontend/styles/theme.css +625 -0
- package/dist/frontend/styling.cjs +18 -0
- package/dist/frontend/styling.d.cts +32 -0
- package/dist/frontend/styling.d.ts +32 -0
- package/dist/frontend/styling.js +18 -0
- package/dist/frontend/toolbars.cjs +18 -0
- package/dist/frontend/toolbars.d.cts +11 -0
- package/dist/frontend/toolbars.d.ts +11 -0
- package/dist/frontend/toolbars.js +18 -0
- package/dist/frontend/tooltip.cjs +10 -0
- package/dist/frontend/tooltip.d.cts +16 -0
- package/dist/frontend/tooltip.d.ts +16 -0
- package/dist/frontend/tooltip.js +10 -0
- package/dist/frontend.cjs +359 -0
- package/dist/frontend.d.cts +90 -0
- package/dist/frontend.d.ts +90 -0
- package/dist/frontend.js +359 -0
- package/dist/index.cjs +492 -0
- package/dist/index.d.cts +134 -0
- package/dist/index.d.ts +134 -0
- package/dist/index.js +492 -0
- package/dist/proto-B-WcMUOE.d.cts +33 -0
- package/dist/proto-kGDF-yWB.d.ts +33 -0
- package/dist/types-X8O95zmC.d.cts +23 -0
- package/dist/types-X8O95zmC.d.ts +23 -0
- package/package.json +123 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkMXDDIFIOcjs = require('../chunk-MXDDIFIO.cjs');
|
|
5
|
+
require('../chunk-PEARNJ5G.cjs');
|
|
6
|
+
require('../chunk-RI33QVOD.cjs');
|
|
7
|
+
require('../chunk-5DRI7C4U.cjs');
|
|
8
|
+
|
|
9
|
+
// src/frontend/appearance.tsx
|
|
10
|
+
var _core = require('@arcanejs/toolkit-frontend/components/core');
|
|
11
|
+
var _util = require('@arcanejs/toolkit-frontend/util');
|
|
12
|
+
var _react = require('react');
|
|
13
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
14
|
+
var AppearanceSwitcher = ({
|
|
15
|
+
color,
|
|
16
|
+
onColorChange
|
|
17
|
+
}) => {
|
|
18
|
+
const { colorSchemePreference, setColorSchemePreference } = _util.useColorSchemePreferences.call(void 0, );
|
|
19
|
+
const selectDarkMode = _react.useCallback.call(void 0, () => {
|
|
20
|
+
setColorSchemePreference("dark");
|
|
21
|
+
}, [setColorSchemePreference]);
|
|
22
|
+
const selectLightMode = _react.useCallback.call(void 0, () => {
|
|
23
|
+
setColorSchemePreference("light");
|
|
24
|
+
}, [setColorSchemePreference]);
|
|
25
|
+
const selectSystemMode = _react.useCallback.call(void 0, () => {
|
|
26
|
+
setColorSchemePreference("auto");
|
|
27
|
+
}, [setColorSchemePreference]);
|
|
28
|
+
const updateHintColor = _react.useCallback.call(void 0,
|
|
29
|
+
(color2) => {
|
|
30
|
+
if (onColorChange) {
|
|
31
|
+
onColorChange(color2);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
[onColorChange]
|
|
35
|
+
);
|
|
36
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "control-grid-pos-all flex flex-wrap items-stretch gap-2", children: [
|
|
37
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
38
|
+
_chunkMXDDIFIOcjs.ControlButton,
|
|
39
|
+
{
|
|
40
|
+
onClick: selectDarkMode,
|
|
41
|
+
active: colorSchemePreference === "dark",
|
|
42
|
+
title: "Switch to Dark Mode",
|
|
43
|
+
variant: "large",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Icon, { icon: "dark_mode", className: "text-[1.5rem]" }),
|
|
46
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Dark" })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
51
|
+
_chunkMXDDIFIOcjs.ControlButton,
|
|
52
|
+
{
|
|
53
|
+
onClick: selectLightMode,
|
|
54
|
+
active: colorSchemePreference === "light",
|
|
55
|
+
title: "Switch to Light Mode",
|
|
56
|
+
variant: "large",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Icon, { icon: "light_mode", className: "text-[1.5rem]" }),
|
|
59
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Light" })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
64
|
+
_chunkMXDDIFIOcjs.ControlButton,
|
|
65
|
+
{
|
|
66
|
+
onClick: selectSystemMode,
|
|
67
|
+
active: colorSchemePreference === "auto",
|
|
68
|
+
title: "Switch to System Mode",
|
|
69
|
+
variant: "large",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Icon, { icon: "contrast", className: "text-[1.5rem]" }),
|
|
72
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Auto / System" })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
77
|
+
_chunkMXDDIFIOcjs.ControlColorSelect,
|
|
78
|
+
{
|
|
79
|
+
color,
|
|
80
|
+
onChange: updateHintColor,
|
|
81
|
+
variant: "large"
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] });
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
exports.AppearanceSwitcher = AppearanceSwitcher;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SigilColor } from './styling.cjs';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
type AppearanceSwitcherProps = {
|
|
6
|
+
color: SigilColor;
|
|
7
|
+
onColorChange: (color: SigilColor) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const AppearanceSwitcher: FC<AppearanceSwitcherProps>;
|
|
10
|
+
|
|
11
|
+
export { AppearanceSwitcher };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SigilColor } from './styling.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
type AppearanceSwitcherProps = {
|
|
6
|
+
color: SigilColor;
|
|
7
|
+
onColorChange: (color: SigilColor) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const AppearanceSwitcher: FC<AppearanceSwitcherProps>;
|
|
10
|
+
|
|
11
|
+
export { AppearanceSwitcher };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ControlButton,
|
|
3
|
+
ControlColorSelect
|
|
4
|
+
} from "../chunk-XAK7WC3D.js";
|
|
5
|
+
import "../chunk-BIY5HAXP.js";
|
|
6
|
+
import "../chunk-4PMRDURG.js";
|
|
7
|
+
import "../chunk-H4U4Z4GM.js";
|
|
8
|
+
|
|
9
|
+
// src/frontend/appearance.tsx
|
|
10
|
+
import { Icon } from "@arcanejs/toolkit-frontend/components/core";
|
|
11
|
+
import { useColorSchemePreferences } from "@arcanejs/toolkit-frontend/util";
|
|
12
|
+
import { useCallback } from "react";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
var AppearanceSwitcher = ({
|
|
15
|
+
color,
|
|
16
|
+
onColorChange
|
|
17
|
+
}) => {
|
|
18
|
+
const { colorSchemePreference, setColorSchemePreference } = useColorSchemePreferences();
|
|
19
|
+
const selectDarkMode = useCallback(() => {
|
|
20
|
+
setColorSchemePreference("dark");
|
|
21
|
+
}, [setColorSchemePreference]);
|
|
22
|
+
const selectLightMode = useCallback(() => {
|
|
23
|
+
setColorSchemePreference("light");
|
|
24
|
+
}, [setColorSchemePreference]);
|
|
25
|
+
const selectSystemMode = useCallback(() => {
|
|
26
|
+
setColorSchemePreference("auto");
|
|
27
|
+
}, [setColorSchemePreference]);
|
|
28
|
+
const updateHintColor = useCallback(
|
|
29
|
+
(color2) => {
|
|
30
|
+
if (onColorChange) {
|
|
31
|
+
onColorChange(color2);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
[onColorChange]
|
|
35
|
+
);
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", { className: "control-grid-pos-all flex flex-wrap items-stretch gap-2", children: [
|
|
37
|
+
/* @__PURE__ */ jsxs(
|
|
38
|
+
ControlButton,
|
|
39
|
+
{
|
|
40
|
+
onClick: selectDarkMode,
|
|
41
|
+
active: colorSchemePreference === "dark",
|
|
42
|
+
title: "Switch to Dark Mode",
|
|
43
|
+
variant: "large",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx(Icon, { icon: "dark_mode", className: "text-[1.5rem]" }),
|
|
46
|
+
/* @__PURE__ */ jsx("span", { children: "Dark" })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsxs(
|
|
51
|
+
ControlButton,
|
|
52
|
+
{
|
|
53
|
+
onClick: selectLightMode,
|
|
54
|
+
active: colorSchemePreference === "light",
|
|
55
|
+
title: "Switch to Light Mode",
|
|
56
|
+
variant: "large",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(Icon, { icon: "light_mode", className: "text-[1.5rem]" }),
|
|
59
|
+
/* @__PURE__ */ jsx("span", { children: "Light" })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ jsxs(
|
|
64
|
+
ControlButton,
|
|
65
|
+
{
|
|
66
|
+
onClick: selectSystemMode,
|
|
67
|
+
active: colorSchemePreference === "auto",
|
|
68
|
+
title: "Switch to System Mode",
|
|
69
|
+
variant: "large",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx(Icon, { icon: "contrast", className: "text-[1.5rem]" }),
|
|
72
|
+
/* @__PURE__ */ jsx("span", { children: "Auto / System" })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
ControlColorSelect,
|
|
78
|
+
{
|
|
79
|
+
color,
|
|
80
|
+
onChange: updateHintColor,
|
|
81
|
+
variant: "large"
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] });
|
|
85
|
+
};
|
|
86
|
+
export {
|
|
87
|
+
AppearanceSwitcher
|
|
88
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkVZ4A6RRTcjs = require('../chunk-VZ4A6RRT.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.ChangeCommitContext = _chunkVZ4A6RRTcjs.ChangeCommitContext; exports.DebuggerContext = _chunkVZ4A6RRTcjs.DebuggerContext; exports.SystemInformationContext = _chunkVZ4A6RRTcjs.SystemInformationContext; exports.useChangeCommitBoundary = _chunkVZ4A6RRTcjs.useChangeCommitBoundary; exports.useDebuggerContext = _chunkVZ4A6RRTcjs.useDebuggerContext; exports.useSystemInformation = _chunkVZ4A6RRTcjs.useSystemInformation;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { A as AppRootLogEntry, S as SystemInformation } from '../types-X8O95zmC.cjs';
|
|
3
|
+
import '@arcanejs/diff';
|
|
4
|
+
|
|
5
|
+
declare const SystemInformationContext: react.Context<SystemInformation>;
|
|
6
|
+
type DebuggerContextData = {
|
|
7
|
+
setDebugMode: (enabled: boolean) => void;
|
|
8
|
+
logs: AppRootLogEntry[];
|
|
9
|
+
};
|
|
10
|
+
declare const DebuggerContext: react.Context<DebuggerContextData>;
|
|
11
|
+
declare const useSystemInformation: () => SystemInformation;
|
|
12
|
+
declare const useDebuggerContext: () => DebuggerContextData;
|
|
13
|
+
/**
|
|
14
|
+
* Context used to signal that changes have been made that should be committed.
|
|
15
|
+
* This is used to easily signal when a user has made as many changes as they intend to,
|
|
16
|
+
* and then want to commit the changes.
|
|
17
|
+
*/
|
|
18
|
+
type ChangeCommitContextData = {
|
|
19
|
+
commitChanges: () => void;
|
|
20
|
+
};
|
|
21
|
+
declare const ChangeCommitContext: react.Context<ChangeCommitContextData>;
|
|
22
|
+
/**
|
|
23
|
+
* Create a commit boundary that can by frontend components that
|
|
24
|
+
* a user wants to finish making changes.
|
|
25
|
+
*
|
|
26
|
+
* This allows for components to wait until a change has been fully committed
|
|
27
|
+
* and propagated, and then perform an action,
|
|
28
|
+
* such as closing a dialog, or moving focus to another component.
|
|
29
|
+
*/
|
|
30
|
+
declare const useChangeCommitBoundary: (dataRef: unknown, onCommit: () => void) => ChangeCommitContextData;
|
|
31
|
+
|
|
32
|
+
export { ChangeCommitContext, type ChangeCommitContextData, DebuggerContext, type DebuggerContextData, SystemInformationContext, useChangeCommitBoundary, useDebuggerContext, useSystemInformation };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { A as AppRootLogEntry, S as SystemInformation } from '../types-X8O95zmC.js';
|
|
3
|
+
import '@arcanejs/diff';
|
|
4
|
+
|
|
5
|
+
declare const SystemInformationContext: react.Context<SystemInformation>;
|
|
6
|
+
type DebuggerContextData = {
|
|
7
|
+
setDebugMode: (enabled: boolean) => void;
|
|
8
|
+
logs: AppRootLogEntry[];
|
|
9
|
+
};
|
|
10
|
+
declare const DebuggerContext: react.Context<DebuggerContextData>;
|
|
11
|
+
declare const useSystemInformation: () => SystemInformation;
|
|
12
|
+
declare const useDebuggerContext: () => DebuggerContextData;
|
|
13
|
+
/**
|
|
14
|
+
* Context used to signal that changes have been made that should be committed.
|
|
15
|
+
* This is used to easily signal when a user has made as many changes as they intend to,
|
|
16
|
+
* and then want to commit the changes.
|
|
17
|
+
*/
|
|
18
|
+
type ChangeCommitContextData = {
|
|
19
|
+
commitChanges: () => void;
|
|
20
|
+
};
|
|
21
|
+
declare const ChangeCommitContext: react.Context<ChangeCommitContextData>;
|
|
22
|
+
/**
|
|
23
|
+
* Create a commit boundary that can by frontend components that
|
|
24
|
+
* a user wants to finish making changes.
|
|
25
|
+
*
|
|
26
|
+
* This allows for components to wait until a change has been fully committed
|
|
27
|
+
* and propagated, and then perform an action,
|
|
28
|
+
* such as closing a dialog, or moving focus to another component.
|
|
29
|
+
*/
|
|
30
|
+
declare const useChangeCommitBoundary: (dataRef: unknown, onCommit: () => void) => ChangeCommitContextData;
|
|
31
|
+
|
|
32
|
+
export { ChangeCommitContext, type ChangeCommitContextData, DebuggerContext, type DebuggerContextData, SystemInformationContext, useChangeCommitBoundary, useDebuggerContext, useSystemInformation };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeCommitContext,
|
|
3
|
+
DebuggerContext,
|
|
4
|
+
SystemInformationContext,
|
|
5
|
+
useChangeCommitBoundary,
|
|
6
|
+
useDebuggerContext,
|
|
7
|
+
useSystemInformation
|
|
8
|
+
} from "../chunk-EJNNLQ2S.js";
|
|
9
|
+
export {
|
|
10
|
+
ChangeCommitContext,
|
|
11
|
+
DebuggerContext,
|
|
12
|
+
SystemInformationContext,
|
|
13
|
+
useChangeCommitBoundary,
|
|
14
|
+
useDebuggerContext,
|
|
15
|
+
useSystemInformation
|
|
16
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var _chunkMXDDIFIOcjs = require('../../chunk-MXDDIFIO.cjs');
|
|
24
|
+
require('../../chunk-PEARNJ5G.cjs');
|
|
25
|
+
require('../../chunk-RI33QVOD.cjs');
|
|
26
|
+
require('../../chunk-5DRI7C4U.cjs');
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
exports.CheckboxControlButton = _chunkMXDDIFIOcjs.CheckboxControlButton; exports.ControlButton = _chunkMXDDIFIOcjs.ControlButton; exports.ControlButtonGroup = _chunkMXDDIFIOcjs.ControlButtonGroup; exports.ControlColorSelect = _chunkMXDDIFIOcjs.ControlColorSelect; exports.ControlDetails = _chunkMXDDIFIOcjs.ControlDetails; exports.ControlDialog = _chunkMXDDIFIOcjs.ControlDialog; exports.ControlDialogButtons = _chunkMXDDIFIOcjs.ControlDialogButtons; exports.ControlInput = _chunkMXDDIFIOcjs.ControlInput; exports.ControlLabel = _chunkMXDDIFIOcjs.ControlLabel; exports.ControlParagraph = _chunkMXDDIFIOcjs.ControlParagraph; exports.ControlPercent = _chunkMXDDIFIOcjs.ControlPercent; exports.ControlSelect = _chunkMXDDIFIOcjs.ControlSelect; exports.InputSpanningTitle = _chunkMXDDIFIOcjs.InputSpanningTitle; exports.InputWithDelayedPropagation = _chunkMXDDIFIOcjs.InputWithDelayedPropagation; exports.LongPressableControlButton = _chunkMXDDIFIOcjs.LongPressableControlButton; exports.clsControlButton = _chunkMXDDIFIOcjs.clsControlButton; exports.clsControlPosition = _chunkMXDDIFIOcjs.clsControlPosition; exports.clsControlSubgridPosition = _chunkMXDDIFIOcjs.clsControlSubgridPosition; exports.controlButtonColorVariable = _chunkMXDDIFIOcjs.controlButtonColorVariable; exports.controlButtonColorVariables = _chunkMXDDIFIOcjs.controlButtonColorVariables; exports.controlPositionClass = _chunkMXDDIFIOcjs.controlPositionClass;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef, ReactNode, CSSProperties, FC, ComponentProps, InputHTMLAttributes, MutableRefObject } from 'react';
|
|
3
|
+
import { TooltipProps } from '../tooltip.cjs';
|
|
4
|
+
import { PressableOnClickListener } from '../input.cjs';
|
|
5
|
+
import { DialogProps } from '../dialogs.cjs';
|
|
6
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
+
import { SigilColor } from '../styling.cjs';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
type ControlPosition = 'row' | 'label' | 'first' | 'second' | 'both' | 'all' | 'extra';
|
|
11
|
+
declare const clsControlPosition: (position?: ControlPosition) => "control-grid-pos-row" | "control-grid-pos-label" | "control-grid-pos-first" | "control-grid-pos-second" | "control-grid-pos-both" | "control-grid-pos-all" | "control-grid-pos-extra" | undefined;
|
|
12
|
+
declare const clsControlSubgridPosition: (position: ControlPosition, subgrid?: boolean) => "col-[1/span_1]" | "col-[2/span_1]" | "col-[3/span_1]" | undefined;
|
|
13
|
+
declare const controlPositionClass: (position?: ControlPosition) => "control-grid-pos-row" | "control-grid-pos-label" | "control-grid-pos-first" | "control-grid-pos-second" | "control-grid-pos-both" | "control-grid-pos-all" | "control-grid-pos-extra" | undefined;
|
|
14
|
+
|
|
15
|
+
declare const CONTROL_BUTTON_VAR_SUFFIX: {
|
|
16
|
+
readonly bg: "bg";
|
|
17
|
+
readonly bgHover: "bg-hover";
|
|
18
|
+
readonly bgActive: "bg-active";
|
|
19
|
+
readonly fg: "fg";
|
|
20
|
+
readonly fgHover: "fg-hover";
|
|
21
|
+
readonly fgActive: "fg-active";
|
|
22
|
+
readonly border: "border";
|
|
23
|
+
readonly borderHover: "border-hover";
|
|
24
|
+
readonly borderActive: "border-active";
|
|
25
|
+
};
|
|
26
|
+
declare const controlButtonColorVariable: (property: keyof typeof CONTROL_BUTTON_VAR_SUFFIX) => string;
|
|
27
|
+
declare const controlButtonColorVariables: (usage: Record<keyof typeof CONTROL_BUTTON_VAR_SUFFIX, string>) => CSSProperties;
|
|
28
|
+
type ControlButtonVariant = 'standard' | 'border' | 'large' | 'table-row' | 'toolbar' | 'titlebar' | 'properties';
|
|
29
|
+
type ControlButtonProps = Omit<ComponentPropsWithoutRef<'button'>, 'children' | 'onClick' | 'title'> & {
|
|
30
|
+
onClick: PressableOnClickListener;
|
|
31
|
+
variant: ControlButtonVariant;
|
|
32
|
+
active?: boolean;
|
|
33
|
+
title?: ReactNode;
|
|
34
|
+
tooltipSide?: TooltipProps['side'];
|
|
35
|
+
position?: ControlPosition;
|
|
36
|
+
} & ({
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
icon?: string;
|
|
39
|
+
} | {
|
|
40
|
+
children?: undefined;
|
|
41
|
+
icon: string;
|
|
42
|
+
});
|
|
43
|
+
type ControlButtonFrameProps = Omit<ComponentPropsWithoutRef<'button'>, 'children' | 'title'> & {
|
|
44
|
+
children?: ReactNode;
|
|
45
|
+
icon?: string;
|
|
46
|
+
variant?: ControlButtonVariant;
|
|
47
|
+
active?: boolean;
|
|
48
|
+
touching?: boolean;
|
|
49
|
+
title?: ReactNode;
|
|
50
|
+
tooltipSide?: TooltipProps['side'];
|
|
51
|
+
position?: ControlPosition;
|
|
52
|
+
};
|
|
53
|
+
declare const clsControlButton: ({ variant, active, touching, position, className, }: Pick<ControlButtonFrameProps, "variant" | "active" | "touching" | "position" | "className">) => string;
|
|
54
|
+
declare const ControlButton: react.ForwardRefExoticComponent<ControlButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
55
|
+
type CheckboxControlButtonProps = Omit<ControlButtonProps, 'children' | 'icon'> & {
|
|
56
|
+
label?: string;
|
|
57
|
+
};
|
|
58
|
+
declare const CheckboxControlButton: react.ForwardRefExoticComponent<Omit<ControlButtonProps, "children" | "icon"> & {
|
|
59
|
+
label?: string;
|
|
60
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
61
|
+
type LongPressableControlButtonProps = Omit<ControlButtonFrameProps, 'icon' | 'onClick' | 'touching'> & {
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
onPress: () => void;
|
|
64
|
+
onRelease: () => void;
|
|
65
|
+
};
|
|
66
|
+
declare const LongPressableControlButton: react.ForwardRefExoticComponent<Omit<ControlButtonFrameProps, "onClick" | "touching" | "icon"> & {
|
|
67
|
+
children: ReactNode;
|
|
68
|
+
onPress: () => void;
|
|
69
|
+
onRelease: () => void;
|
|
70
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
type ControlButtonGroupProps = ComponentPropsWithoutRef<'div'> & {
|
|
72
|
+
position?: ControlPosition;
|
|
73
|
+
};
|
|
74
|
+
declare const ControlButtonGroup: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
75
|
+
position?: ControlPosition;
|
|
76
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
77
|
+
|
|
78
|
+
type ControlParagraphMode = 'error' | 'success' | 'warning';
|
|
79
|
+
type ControlParagraphProps = ComponentPropsWithoutRef<'p'> & {
|
|
80
|
+
position?: ControlPosition;
|
|
81
|
+
mode?: ControlParagraphMode;
|
|
82
|
+
};
|
|
83
|
+
declare const ControlParagraph: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
84
|
+
position?: ControlPosition;
|
|
85
|
+
mode?: ControlParagraphMode;
|
|
86
|
+
} & react.RefAttributes<HTMLParagraphElement>>;
|
|
87
|
+
type ControlLabelProps = ComponentPropsWithoutRef<'div'> & {
|
|
88
|
+
subgrid?: boolean;
|
|
89
|
+
position?: ControlPosition;
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
nonMicro?: boolean;
|
|
92
|
+
};
|
|
93
|
+
declare const ControlLabel: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
94
|
+
subgrid?: boolean;
|
|
95
|
+
position?: ControlPosition;
|
|
96
|
+
disabled?: boolean;
|
|
97
|
+
nonMicro?: boolean;
|
|
98
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
99
|
+
type ControlDetailsProps = ComponentPropsWithoutRef<'div'> & {
|
|
100
|
+
position?: ControlPosition;
|
|
101
|
+
align?: 'start' | 'center' | 'end';
|
|
102
|
+
};
|
|
103
|
+
declare const ControlDetails: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
104
|
+
position?: ControlPosition;
|
|
105
|
+
align?: "start" | "center" | "end";
|
|
106
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
107
|
+
type InputSpanningTitleProps = ComponentPropsWithoutRef<'div'> & {
|
|
108
|
+
position?: ControlPosition;
|
|
109
|
+
};
|
|
110
|
+
declare const InputSpanningTitle: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
111
|
+
position?: ControlPosition;
|
|
112
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
113
|
+
|
|
114
|
+
declare const ControlDialogButtons: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
115
|
+
type ControlDialogProps = Omit<DialogProps, 'variant'> & {
|
|
116
|
+
large?: boolean;
|
|
117
|
+
};
|
|
118
|
+
declare const ControlDialog: FC<ControlDialogProps>;
|
|
119
|
+
|
|
120
|
+
type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'ref' | 'onChange'> & {
|
|
121
|
+
value: string | null;
|
|
122
|
+
disabled?: boolean;
|
|
123
|
+
onChange: (value: string, enterPressed: boolean) => void;
|
|
124
|
+
inputRef?: MutableRefObject<HTMLInputElement | null>;
|
|
125
|
+
};
|
|
126
|
+
declare const InputWithDelayedPropagation: FC<InputProps>;
|
|
127
|
+
type ControlInputProps = ComponentProps<typeof InputWithDelayedPropagation> & {
|
|
128
|
+
position?: ControlPosition;
|
|
129
|
+
subgrid?: boolean;
|
|
130
|
+
nonMicro?: boolean;
|
|
131
|
+
};
|
|
132
|
+
declare const ControlInput: FC<ControlInputProps>;
|
|
133
|
+
type ControlPercentProps = Omit<ControlInputProps, 'className'> & {
|
|
134
|
+
className?: string;
|
|
135
|
+
};
|
|
136
|
+
declare const ControlPercent: FC<ControlPercentProps>;
|
|
137
|
+
|
|
138
|
+
type SelectOption<T> = {
|
|
139
|
+
label: string;
|
|
140
|
+
value: T;
|
|
141
|
+
/**
|
|
142
|
+
* Set to true to indicate that when selected,
|
|
143
|
+
* the select should look active.
|
|
144
|
+
*/
|
|
145
|
+
active?: boolean;
|
|
146
|
+
};
|
|
147
|
+
type SelectProps<T extends string | null> = {
|
|
148
|
+
options: SelectOption<T>[];
|
|
149
|
+
value: T | '';
|
|
150
|
+
onChange: (value: T) => void;
|
|
151
|
+
triggerText?: (option: SelectOption<T>) => ReactNode;
|
|
152
|
+
triggerButton?: (option: null | SelectOption<T>) => ReactNode;
|
|
153
|
+
option?: (option: SelectOption<T>) => ReactNode;
|
|
154
|
+
variant: ControlButtonVariant;
|
|
155
|
+
position?: ControlPosition;
|
|
156
|
+
disabled?: boolean;
|
|
157
|
+
tooltip?: string;
|
|
158
|
+
placeholder?: ReactNode;
|
|
159
|
+
triggerClassName?: string;
|
|
160
|
+
};
|
|
161
|
+
declare const ControlSelect: <T extends string | null>({ options, value, onChange, triggerText, triggerButton, option, variant, position, disabled, tooltip, placeholder, triggerClassName: className, }: SelectProps<T>) => react_jsx_runtime.JSX.Element;
|
|
162
|
+
type ControlColorSelectProps = {
|
|
163
|
+
color: SigilColor | '';
|
|
164
|
+
onChange: (color: SigilColor) => void;
|
|
165
|
+
} & Pick<SelectProps<SigilColor>, 'variant' | 'position' | 'disabled' | 'tooltip' | 'placeholder'>;
|
|
166
|
+
declare const ControlColorSelect: ({ color, onChange, variant, position, disabled, placeholder, ...props }: ControlColorSelectProps) => react_jsx_runtime.JSX.Element;
|
|
167
|
+
|
|
168
|
+
export { CheckboxControlButton, type CheckboxControlButtonProps, ControlButton, ControlButtonGroup, type ControlButtonGroupProps, type ControlButtonProps, type ControlButtonVariant, ControlColorSelect, ControlDetails, type ControlDetailsProps, ControlDialog, ControlDialogButtons, ControlInput, type ControlInputProps, ControlLabel, type ControlLabelProps, ControlParagraph, type ControlParagraphMode, type ControlParagraphProps, ControlPercent, type ControlPercentProps, type ControlPosition, ControlSelect, InputSpanningTitle, type InputSpanningTitleProps, InputWithDelayedPropagation, LongPressableControlButton, type LongPressableControlButtonProps, type SelectOption, clsControlButton, clsControlPosition, clsControlSubgridPosition, controlButtonColorVariable, controlButtonColorVariables, controlPositionClass };
|