dirk-cfx-react 1.1.80 → 1.1.81
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/components/index.cjs +29 -7
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +5 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +29 -7
- package/dist/components/index.js.map +1 -1
- package/dist/index.cjs +29 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -977,8 +977,12 @@ type SwitchPanelProps = {
|
|
|
977
977
|
checked: boolean;
|
|
978
978
|
onChange: (v: boolean) => void;
|
|
979
979
|
disabled?: boolean;
|
|
980
|
+
/** Icon rendered on the Switch's thumb (e.g. a Lock when locked). */
|
|
981
|
+
thumbIcon?: ReactNode;
|
|
982
|
+
/** Compact variant — used for nested rows inside an editor card. */
|
|
983
|
+
compact?: boolean;
|
|
980
984
|
};
|
|
981
|
-
declare function SwitchPanel({ label, description, checked, onChange, disabled }: SwitchPanelProps): react_jsx_runtime.JSX.Element;
|
|
985
|
+
declare function SwitchPanel({ label, description, checked, onChange, disabled, thumbIcon, compact, }: SwitchPanelProps): react_jsx_runtime.JSX.Element;
|
|
982
986
|
|
|
983
987
|
type MissingItem = {
|
|
984
988
|
name: string;
|
|
@@ -977,8 +977,12 @@ type SwitchPanelProps = {
|
|
|
977
977
|
checked: boolean;
|
|
978
978
|
onChange: (v: boolean) => void;
|
|
979
979
|
disabled?: boolean;
|
|
980
|
+
/** Icon rendered on the Switch's thumb (e.g. a Lock when locked). */
|
|
981
|
+
thumbIcon?: ReactNode;
|
|
982
|
+
/** Compact variant — used for nested rows inside an editor card. */
|
|
983
|
+
compact?: boolean;
|
|
980
984
|
};
|
|
981
|
-
declare function SwitchPanel({ label, description, checked, onChange, disabled }: SwitchPanelProps): react_jsx_runtime.JSX.Element;
|
|
985
|
+
declare function SwitchPanel({ label, description, checked, onChange, disabled, thumbIcon, compact, }: SwitchPanelProps): react_jsx_runtime.JSX.Element;
|
|
982
986
|
|
|
983
987
|
type MissingItem = {
|
|
984
988
|
name: string;
|
package/dist/components/index.js
CHANGED
|
@@ -5125,25 +5125,46 @@ function AdminPageTitle(props) {
|
|
|
5125
5125
|
/* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", tt: "uppercase", lts: "0.1em", size: "sm", c: "rgba(255,255,255,0.6)", children: locale(props.title) })
|
|
5126
5126
|
] });
|
|
5127
5127
|
}
|
|
5128
|
-
function SwitchPanel({
|
|
5128
|
+
function SwitchPanel({
|
|
5129
|
+
label,
|
|
5130
|
+
description,
|
|
5131
|
+
checked,
|
|
5132
|
+
onChange,
|
|
5133
|
+
disabled,
|
|
5134
|
+
thumbIcon,
|
|
5135
|
+
compact
|
|
5136
|
+
}) {
|
|
5129
5137
|
const theme = useMantineTheme();
|
|
5130
5138
|
const pc = theme.colors[theme.primaryColor];
|
|
5139
|
+
const bg = compact ? alpha(theme.colors.dark[6], 0.5) : alpha(theme.colors.dark[5], 0.35);
|
|
5140
|
+
const border = compact ? "0.1vh solid rgba(255,255,255,0.04)" : "0.1vh solid rgba(255,255,255,0.05)";
|
|
5131
5141
|
return /* @__PURE__ */ jsxs(
|
|
5132
5142
|
Flex,
|
|
5133
5143
|
{
|
|
5134
5144
|
justify: "space-between",
|
|
5135
5145
|
align: "center",
|
|
5136
|
-
|
|
5146
|
+
px: compact ? "xs" : "xs",
|
|
5147
|
+
py: compact ? "xxs" : "xs",
|
|
5137
5148
|
style: {
|
|
5138
|
-
background:
|
|
5139
|
-
border
|
|
5149
|
+
background: bg,
|
|
5150
|
+
border,
|
|
5140
5151
|
borderRadius: theme.radius.xs,
|
|
5141
5152
|
opacity: disabled ? 0.5 : 1
|
|
5142
5153
|
},
|
|
5143
5154
|
children: [
|
|
5144
5155
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "xxs", style: { flex: 1, minWidth: 0 }, children: [
|
|
5145
|
-
typeof label === "string" ? /* @__PURE__ */ jsx(
|
|
5146
|
-
|
|
5156
|
+
typeof label === "string" ? compact ? /* @__PURE__ */ jsx(
|
|
5157
|
+
Text,
|
|
5158
|
+
{
|
|
5159
|
+
ff: "Akrobat Bold",
|
|
5160
|
+
size: "xxs",
|
|
5161
|
+
c: "rgba(255,255,255,0.85)",
|
|
5162
|
+
tt: "uppercase",
|
|
5163
|
+
lts: "0.05em",
|
|
5164
|
+
children: label
|
|
5165
|
+
}
|
|
5166
|
+
) : /* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xs", c: "rgba(255,255,255,0.85)", children: label }) : label,
|
|
5167
|
+
description && (typeof description === "string" ? /* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xxs", c: compact ? "rgba(255,255,255,0.4)" : "rgba(255,255,255,0.45)", children: description }) : description)
|
|
5147
5168
|
] }),
|
|
5148
5169
|
/* @__PURE__ */ jsx(
|
|
5149
5170
|
Switch,
|
|
@@ -5151,7 +5172,8 @@ function SwitchPanel({ label, description, checked, onChange, disabled }) {
|
|
|
5151
5172
|
checked,
|
|
5152
5173
|
disabled,
|
|
5153
5174
|
onChange: (e) => onChange(e.currentTarget.checked),
|
|
5154
|
-
size: "md",
|
|
5175
|
+
size: compact ? "sm" : "md",
|
|
5176
|
+
thumbIcon,
|
|
5155
5177
|
styles: {
|
|
5156
5178
|
track: {
|
|
5157
5179
|
background: checked ? alpha(pc[6], 0.4) : "rgba(255,255,255,0.08)",
|