pixelize-design-library 2.1.47 → 2.1.48
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/Input/Switch/InputSwitch.d.ts +12 -0
- package/dist/Components/Input/Switch/InputSwitch.js +53 -0
- package/dist/Pages/input.js +6 -1
- package/dist/index.d.mts +1468 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -2
- package/dist/index.mjs +263 -0
- package/package.json +1 -1
- package/dist/Components/KaTable/CustomHeader.d.ts +0 -14
- package/dist/Components/KaTable/CustomHeader.js +0 -69
- package/dist/Components/KaTable/KaTable.d.ts +0 -13
- package/dist/Components/KaTable/KaTable.js +0 -111
- package/dist/Components/KaTable/KaTableProps.d.ts +0 -23
- package/dist/Components/KaTable/KaTableProps.js +0 -2
- package/dist/Components/KaTable/SelectionCell.d.ts +0 -8
- package/dist/Components/KaTable/SelectionCell.js +0 -38
- package/dist/Components/KaTable/SelectionHeader.d.ts +0 -3
- package/dist/Components/KaTable/SelectionHeader.js +0 -56
- package/dist/Components/KaTable/ka-table.css +0 -27
- package/dist/Components/KaTable/useMergedChildComponents.d.ts +0 -14
- package/dist/Components/KaTable/useMergedChildComponents.js +0 -224
- package/dist/Components/Table/Table.css +0 -16
- package/dist/Pages/KaTableExample.d.ts +0 -3
- package/dist/Pages/KaTableExample.js +0 -259
- package/dist/Theme/Default/fonts.d.ts +0 -35
- package/dist/Theme/Default/fonts.js +0 -37
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SwitchProps } from "@chakra-ui/react";
|
|
3
|
+
export interface ThemedSwitchProps extends SwitchProps {
|
|
4
|
+
switchText?: string;
|
|
5
|
+
switchTextPosition?: "left" | "right";
|
|
6
|
+
isInformation?: boolean;
|
|
7
|
+
informationMessage?: string;
|
|
8
|
+
isRequired?: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
}
|
|
12
|
+
export declare const InputSwitch: ({ switchText, switchTextPosition, id, isChecked, label, isInformation, informationMessage, isRequired, size, ...props }: ThemedSwitchProps) => React.JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.InputSwitch = void 0;
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var react_2 = require("@chakra-ui/react");
|
|
31
|
+
var FormLabel_1 = require("../../Common/FormLabel");
|
|
32
|
+
var InputSwitch = function (_a) {
|
|
33
|
+
var switchText = _a.switchText, _b = _a.switchTextPosition, switchTextPosition = _b === void 0 ? "right" : _b, id = _a.id, isChecked = _a.isChecked, label = _a.label, isInformation = _a.isInformation, informationMessage = _a.informationMessage, isRequired = _a.isRequired, _c = _a.size, size = _c === void 0 ? "md" : _c, props = __rest(_a, ["switchText", "switchTextPosition", "id", "isChecked", "label", "isInformation", "informationMessage", "isRequired", "size"]);
|
|
34
|
+
var activeColor = (0, react_2.useColorModeValue)("blue.500", "blue.300");
|
|
35
|
+
var inactiveColor = (0, react_2.useColorModeValue)("gray.300", "gray.600");
|
|
36
|
+
var sizeStyles = {
|
|
37
|
+
sm: { fontSize: "sm", spacing: 1 },
|
|
38
|
+
md: { fontSize: "md", spacing: 2 },
|
|
39
|
+
lg: { fontSize: "lg", spacing: 3 },
|
|
40
|
+
};
|
|
41
|
+
return (react_1.default.createElement(react_2.FormControl, null,
|
|
42
|
+
label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, id: id, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired })),
|
|
43
|
+
react_1.default.createElement(react_2.Box, { display: "flex", alignItems: "center", flexGrow: 1 },
|
|
44
|
+
react_1.default.createElement(react_2.HStack, { spacing: sizeStyles[size].spacing },
|
|
45
|
+
switchText && switchTextPosition === "left" && (react_1.default.createElement(react_2.FormLabel, { mb: "0", htmlFor: id, fontSize: sizeStyles[size].fontSize, cursor: "pointer" }, switchText)),
|
|
46
|
+
react_1.default.createElement(react_2.Switch, __assign({ id: id, size: size, isChecked: isChecked, colorScheme: "blue", sx: {
|
|
47
|
+
"span.chakra-switch__track": {
|
|
48
|
+
bg: isChecked ? activeColor : inactiveColor,
|
|
49
|
+
},
|
|
50
|
+
} }, props)),
|
|
51
|
+
switchText && switchTextPosition === "right" && (react_1.default.createElement(react_2.FormLabel, { mb: "0", htmlFor: id, fontSize: sizeStyles[size].fontSize, cursor: "pointer" }, switchText))))));
|
|
52
|
+
};
|
|
53
|
+
exports.InputSwitch = InputSwitch;
|
package/dist/Pages/input.js
CHANGED
|
@@ -29,8 +29,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
var react_1 = __importStar(require("react"));
|
|
30
30
|
var TextInput_1 = __importDefault(require("../Components/Input/TextInput"));
|
|
31
31
|
var PhoneNumberInput_1 = __importDefault(require("../Components/Input/PhoneNumberInput"));
|
|
32
|
+
var InputSwitch_1 = require("../Components/Input/Switch/InputSwitch");
|
|
32
33
|
var InputPage = function () {
|
|
33
34
|
var _a = (0, react_1.useState)([]), countries = _a[0], setCountries = _a[1];
|
|
35
|
+
var _b = (0, react_1.useState)(false), switchState = _b[0], setSwitchState = _b[1];
|
|
34
36
|
(0, react_1.useEffect)(function () {
|
|
35
37
|
fetch("https://dev.api.pixelizetech.com/account/api/allCountries")
|
|
36
38
|
.then(function (res) { return res.json(); })
|
|
@@ -71,6 +73,9 @@ var InputPage = function () {
|
|
|
71
73
|
isRequired: true, informationMessage: "This is information", isInformation: true,
|
|
72
74
|
// isDisabled
|
|
73
75
|
minW: "200px", maxW: "300px" }),
|
|
74
|
-
react_1.default.createElement(PhoneNumberInput_1.default, { label: "Phone", id: "input1", name: "hello", country: "IN", value: "", countries: countries, onChange: function (val) {
|
|
76
|
+
react_1.default.createElement(PhoneNumberInput_1.default, { label: "Phone", id: "input1", name: "hello", country: "IN", value: "", countries: countries, onChange: function (val) {
|
|
77
|
+
console.log(val, "hello");
|
|
78
|
+
}, isRequired: true, informationMessage: "This is information", isInformation: true, error: true, errorMessage: "Required", showCountrySelect: true, minW: "200px", maxW: "300px" }),
|
|
79
|
+
react_1.default.createElement(InputSwitch_1.InputSwitch, { id: "repeat-switch", isChecked: switchState, onChange: function (e) { return setSwitchState(e.target.checked); }, switchText: "Repeat", switchTextPosition: "right", label: "My Switch", isInformation: true, informationMessage: "This is information", isRequired: true, size: "md" })));
|
|
75
80
|
};
|
|
76
81
|
exports.default = InputPage;
|