@kud/ink-ui 0.10.1 → 0.11.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/index.d.ts +9 -1
- package/dist/index.js +19 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -212,6 +212,14 @@ type ToggleProps = {
|
|
|
212
212
|
};
|
|
213
213
|
declare const Toggle: ({ label, on, color }: ToggleProps) => React.JSX.Element;
|
|
214
214
|
|
|
215
|
+
type ToggleSwitchProps = {
|
|
216
|
+
on: boolean;
|
|
217
|
+
label?: string;
|
|
218
|
+
onColor?: string;
|
|
219
|
+
offColor?: string;
|
|
220
|
+
};
|
|
221
|
+
declare const ToggleSwitch: ({ on, label, onColor, offColor, }: ToggleSwitchProps) => React.JSX.Element;
|
|
222
|
+
|
|
215
223
|
type ProgressBarProps = {
|
|
216
224
|
value: number;
|
|
217
225
|
width?: number;
|
|
@@ -269,4 +277,4 @@ declare const spacing: {
|
|
|
269
277
|
};
|
|
270
278
|
type Spacing = (typeof spacing)[keyof typeof spacing];
|
|
271
279
|
|
|
272
|
-
export { Alert, Badge, type BadgeVariant, Banner, type Color, type Column, Columns, ConfirmInput, EmailInput, FooterHints, Header, type Hint, type IconMode, KeyValue, LoadingScreen, MultiSelect, type NotifyOptions, OrderedList, Panel, PasswordInput, ProgressBar, ScrollView, Select, type SelectOption, SelectableRow, type Spacing, type Span, Spinner, StatusMessage, type StatusVariant, type StyledLine, Switch, type SwitchValue, type TabItem, Table, Tabs, TextInput, Toast, Toggle, UnorderedList, colors, getIconMode, notify, setIconMode, spacing };
|
|
280
|
+
export { Alert, Badge, type BadgeVariant, Banner, type Color, type Column, Columns, ConfirmInput, EmailInput, FooterHints, Header, type Hint, type IconMode, KeyValue, LoadingScreen, MultiSelect, type NotifyOptions, OrderedList, Panel, PasswordInput, ProgressBar, ScrollView, Select, type SelectOption, SelectableRow, type Spacing, type Span, Spinner, StatusMessage, type StatusVariant, type StyledLine, Switch, type SwitchValue, type TabItem, Table, Tabs, TextInput, Toast, Toggle, ToggleSwitch, UnorderedList, colors, getIconMode, notify, setIconMode, spacing };
|
package/dist/index.js
CHANGED
|
@@ -583,6 +583,24 @@ var Toggle = ({ label, on, color = colors.accent }) => /* @__PURE__ */ jsxs(Text
|
|
|
583
583
|
" ",
|
|
584
584
|
on ? "\u25CF" : "\u25CB"
|
|
585
585
|
] });
|
|
586
|
+
var CAP_LEFT = "\uE0B6";
|
|
587
|
+
var CAP_RIGHT = "\uE0B4";
|
|
588
|
+
var ToggleSwitch = ({
|
|
589
|
+
on,
|
|
590
|
+
label,
|
|
591
|
+
onColor = colors.success,
|
|
592
|
+
offColor = "gray"
|
|
593
|
+
}) => {
|
|
594
|
+
const track = on ? onColor : offColor;
|
|
595
|
+
return /* @__PURE__ */ jsxs(Box, { columnGap: 1, children: [
|
|
596
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
597
|
+
/* @__PURE__ */ jsx(Text, { color: track, children: CAP_LEFT }),
|
|
598
|
+
/* @__PURE__ */ jsx(Text, { backgroundColor: track, color: "black", children: on ? " \u25CF" : "\u25CF " }),
|
|
599
|
+
/* @__PURE__ */ jsx(Text, { color: track, children: CAP_RIGHT })
|
|
600
|
+
] }),
|
|
601
|
+
label !== void 0 && /* @__PURE__ */ jsx(Text, { color: on ? onColor : void 0, dimColor: !on, children: label })
|
|
602
|
+
] });
|
|
603
|
+
};
|
|
586
604
|
var ProgressBar = ({ value, width = 20 }) => {
|
|
587
605
|
const clamped = Math.max(0, Math.min(100, value));
|
|
588
606
|
const filled = Math.round(clamped / 100 * width);
|
|
@@ -692,4 +710,4 @@ var notify = (message, options = {}) => {
|
|
|
692
710
|
child.unref();
|
|
693
711
|
};
|
|
694
712
|
|
|
695
|
-
export { Alert, Badge, Banner, Columns, ConfirmInput, EmailInput, FooterHints, Header, KeyValue, LoadingScreen, MultiSelect, OrderedList, Panel, PasswordInput, ProgressBar, ScrollView, Select, SelectableRow, Spinner, StatusMessage, Switch, Table, Tabs, TextInput, Toast, Toggle, UnorderedList, colors, getIconMode, notify, setIconMode, spacing };
|
|
713
|
+
export { Alert, Badge, Banner, Columns, ConfirmInput, EmailInput, FooterHints, Header, KeyValue, LoadingScreen, MultiSelect, OrderedList, Panel, PasswordInput, ProgressBar, ScrollView, Select, SelectableRow, Spinner, StatusMessage, Switch, Table, Tabs, TextInput, Toast, Toggle, ToggleSwitch, UnorderedList, colors, getIconMode, notify, setIconMode, spacing };
|