oolib 2.110.1 → 2.111.1
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/UIContent/index.d.ts +17 -17
- package/dist/components/Accordion/index.d.ts +56 -13
- package/dist/components/Accordion/index.js +23 -31
- package/dist/components/Accordion/styled.d.ts +7 -7
- package/dist/components/Accordion/styled.js +7 -8
- package/dist/components/ActionMenu/index.js +2 -9
- package/dist/components/AudioInput/comps/AudioAction.d.ts +1 -1
- package/dist/components/AudioInput/comps/AudioPlayer.d.ts +1 -1
- package/dist/components/AudioInput/index.js +1 -1
- package/dist/components/Breadcrumbs/index.styled.d.ts +1 -1
- package/dist/components/Buttons/index.d.ts +32 -42
- package/dist/components/Buttons/index.js +3 -3
- package/dist/components/Coachmark/comps/MovingCoachmark/index.d.ts +3 -0
- package/dist/components/Coachmark/comps/MovingCoachmark/index.js +68 -0
- package/dist/components/Coachmark/comps/MovingCoachmark/styled.d.ts +2 -0
- package/dist/components/Coachmark/comps/MovingCoachmark/styled.js +45 -0
- package/dist/components/Coachmark/comps/MovingCoachmark/utils/index.d.ts +1 -0
- package/dist/components/Coachmark/comps/MovingCoachmark/utils/index.js +57 -0
- package/dist/components/Coachmark/config.d.ts +31 -0
- package/dist/components/Coachmark/config.js +61 -0
- package/dist/components/Coachmark/index.d.ts +4 -0
- package/dist/components/Coachmark/index.js +74 -0
- package/dist/components/Coachmark/styled.d.ts +1 -0
- package/dist/components/Coachmark/styled.js +37 -0
- package/dist/components/Coachmark/utils/index.d.ts +13 -0
- package/dist/components/Coachmark/utils/index.js +70 -0
- package/dist/components/DateRangePicker/index.d.ts +1 -1
- package/dist/components/DateTimePicker/index.styled.d.ts +0 -0
- package/dist/components/DateTimePicker/index.styled.js +0 -0
- package/dist/components/Dropdowns/DropdownMulti/index.js +4 -28
- package/dist/components/Dropdowns/DropdownSingle/index.js +4 -28
- package/dist/components/Dropdowns/comps/OptionsMulti/index.js +3 -30
- package/dist/components/Dropdowns/comps/OptionsShell/index.js +1 -11
- package/dist/components/Dropdowns/comps/OptionsSingle/index.js +2 -34
- package/dist/components/Dropdowns/comps/SelectDropdown/index.js +1 -12
- package/dist/components/Dropdowns/comps/VirtualizedWrapper/index.d.ts +1 -1
- package/dist/components/Dropdowns/utils/isDynamicOtherOption.d.ts +0 -0
- package/dist/components/Dropdowns/utils/isDynamicOtherOption.js +0 -0
- package/dist/components/EmptyStates/index.js +1 -12
- package/dist/components/FileUploadWrapper/comps/FileUploadShell.d.ts +1 -1
- package/dist/components/FileUploadWrapper/index.d.ts +1 -1
- package/dist/components/FileUploadWrapper/index.js +1 -12
- package/dist/components/IFrameInput/comps/Embed.d.ts +1 -1
- package/dist/components/IFrameInput/index.js +2 -2
- package/dist/components/IFrameInput/utils/DisplayCoachmark.d.ts +7 -0
- package/dist/components/IFrameInput/utils/DisplayCoachmark.js +83 -0
- package/dist/components/ImageInput/comps/GallerySlider/index.js +1 -16
- package/dist/components/ImageInput/comps/ImageEditor/comps/ConfirmDeleteModal/index.d.ts +1 -1
- package/dist/components/ImageInput/comps/ImageEditor/index.js +9 -65
- package/dist/components/ImageInput/comps/Placeholder/index.js +1 -17
- package/dist/components/ImageInput/comps/Placeholder/styled.d.ts +3 -0
- package/dist/components/ImageInput/comps/Placeholder/styled.js +39 -0
- package/dist/components/ImageInput/comps/SingleImageInput/index.js +1 -32
- package/dist/components/ImageInput/derivedComps/ImageDisplayInMask/index.js +1 -1
- package/dist/components/ImageInput/index.js +3 -25
- package/dist/components/InlineAlert/index.d.ts +25 -8
- package/dist/components/InlineAlert/index.js +16 -1
- package/dist/components/LegendRadioCheckList/LegendButton/index.d.ts +10 -0
- package/dist/components/LegendRadioCheckList/LegendButton/index.js +18 -0
- package/dist/components/LegendRadioCheckList/LegendButton/styled.d.ts +3 -0
- package/dist/components/LegendRadioCheckList/LegendButton/styled.js +22 -0
- package/dist/components/LegendRadioCheckList/LegendCheckboxList/index.d.ts +8 -0
- package/dist/components/LegendRadioCheckList/LegendCheckboxList/index.js +49 -0
- package/dist/components/LegendRadioCheckList/LegendCheckboxList/styled.d.ts +0 -0
- package/dist/components/LegendRadioCheckList/LegendCheckboxList/styled.js +0 -0
- package/dist/components/LegendRadioCheckList/LegendRadioList/index.d.ts +8 -0
- package/dist/components/LegendRadioCheckList/LegendRadioList/index.js +34 -0
- package/dist/components/LegendRadioCheckList/LegendRadioList/styled.d.ts +1 -0
- package/dist/components/LegendRadioCheckList/LegendRadioList/styled.js +13 -0
- package/dist/components/Lexical/Plugins/TableCellResizer/index.js +1 -26
- package/dist/components/LoadersAndProgress/LoaderCircle/index.js +2 -2
- package/dist/components/LoadersAndProgress/SkeletonLoader/index.d.ts +1 -1
- package/dist/components/Margins/index.d.ts +1 -1
- package/dist/components/Modals/Modal/styled.d.ts +2 -2
- package/dist/components/Modals/ModalConfirm/styled.d.ts +2 -2
- package/dist/components/OKELink/comps/AvatarDisplay/index.d.ts +8 -0
- package/dist/components/OKELink/comps/AvatarDisplay/index.js +19 -0
- package/dist/components/OKELink/comps/AvatarDisplay/styled.d.ts +2 -0
- package/dist/components/OKELink/comps/AvatarDisplay/styled.js +48 -0
- package/dist/components/OKELink/index.d.ts +1 -1
- package/dist/components/OKELink/index.js +2 -5
- package/dist/components/OKELink/utils/index.d.ts +6 -0
- package/dist/components/OKELink/utils/index.js +20 -0
- package/dist/components/PDFInput/comps/PDFActions.d.ts +1 -1
- package/dist/components/PDFInput/index.js +1 -1
- package/dist/components/Paddings/index.d.ts +1 -1
- package/dist/components/PercentCompletedPie/index.d.ts +19 -5
- package/dist/components/PercentCompletedPie/index.js +15 -5
- package/dist/components/PercentCompletedPie/styled.d.ts +17 -5
- package/dist/components/PercentCompletedPie/styled.js +26 -6
- package/dist/components/Playground/index.d.ts +4 -0
- package/dist/components/Playground/index.js +17 -0
- package/dist/components/Playground/styled.d.ts +1 -0
- package/dist/components/Playground/styled.js +14 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.d.ts +1 -1
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.js +1 -12
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.d.ts +1 -1
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +3 -20
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.js +11 -7
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.js +4 -25
- package/dist/components/RadioAndCheckbox/comps/RadioList/index.js +6 -6
- package/dist/components/ResourceInput/comp/ResourceDisplayBlock.d.ts +1 -1
- package/dist/components/ResourceInput/index.d.ts +1 -1
- package/dist/components/SimpleTable/index.js +5 -22
- package/dist/components/SimpleTable/utils/convertColHeaderConfigToRowData.js +1 -1
- package/dist/components/SimpleTable/utils/convertRowHeaderConfigToCellData.js +1 -1
- package/dist/components/SimpleTable/utils/prepInitValueFromConfigIfNoValue.js +2 -2
- package/dist/components/Switches/index.js +5 -11
- package/dist/components/Tags/index.d.ts +1 -1
- package/dist/components/Tags/index.styled.d.ts +1 -1
- package/dist/components/TimePicker/styled.d.ts +1 -1
- package/dist/components/TimeRangePicker/index.styled.d.ts +0 -0
- package/dist/components/TimeRangePicker/index.styled.js +0 -0
- package/dist/components/Tooltip/index.d.ts +2 -3
- package/dist/components/Typo/index.d.ts +11 -0
- package/dist/components/Typo/index.js +3 -1
- package/dist/components/VideoInput/comps/VideoActionMenu.d.ts +1 -1
- package/dist/components/VideoInput/index.d.ts +1 -1
- package/dist/components/VideoInput/index.js +2 -21
- package/dist/components/Wrappers/WrapperCardGrid.d.ts +2 -0
- package/dist/components/Wrappers/WrapperCardGrid.js +19 -0
- package/dist/components/Wrappers/index.d.ts +1 -1
- package/dist/components/Wrappers/index.js +1 -1
- package/dist/components/cards/ListProfile/styled.d.ts +7 -0
- package/dist/components/cards/ListProfile/styled.js +23 -0
- package/dist/components/cards/utils/parseCardConfig.js +1 -1
- package/dist/d3Modules/index.d.ts +1 -0
- package/dist/d3Modules/index.js +1 -1
- package/dist/icons/custom/index.d.ts +1 -0
- package/dist/icons/custom/index.js +6 -1
- package/dist/icons/index.d.ts +112 -110
- package/dist/icons/index.js +2 -1
- package/dist/stories/Accordion.stories.d.ts +78 -0
- package/dist/stories/Accordion.stories.js +93 -0
- package/dist/stories/ActionMenu.stories.d.ts +166 -0
- package/dist/stories/ActionMenu.stories.js +140 -0
- package/dist/stories/AudioInput.stories.d.ts +20 -0
- package/dist/stories/AudioInput.stories.js +67 -0
- package/dist/stories/Banner.stories.d.ts +97 -0
- package/dist/stories/Banner.stories.js +126 -0
- package/dist/stories/BarChart.stories.d.ts +13 -0
- package/dist/stories/BarChart.stories.js +61 -0
- package/dist/stories/BlockLabel.stories.d.ts +71 -0
- package/dist/stories/BlockLabel.stories.js +106 -0
- package/dist/stories/Breadcrumbs.stories.d.ts +13 -0
- package/dist/stories/Breadcrumbs.stories.js +34 -0
- package/dist/stories/Button.stories.d.ts +209 -0
- package/dist/stories/Button.stories.js +164 -0
- package/dist/stories/Checkbox.stories.d.ts +248 -0
- package/dist/stories/Checkbox.stories.js +249 -0
- package/dist/stories/Colors.stories.d.ts +6 -0
- package/dist/stories/Colors.stories.js +66 -0
- package/dist/stories/DatePicker.stories.d.ts +239 -0
- package/dist/stories/DatePicker.stories.js +267 -0
- package/dist/stories/Divider.stories.d.ts +8 -0
- package/dist/stories/Divider.stories.js +28 -0
- package/dist/stories/Dropdowns.stories.d.ts +114 -0
- package/dist/stories/Dropdowns.stories.js +280 -0
- package/dist/stories/EmptyStates.stories.d.ts +63 -0
- package/dist/stories/EmptyStates.stories.js +69 -0
- package/dist/stories/HomeCover.stories.d.ts +55 -0
- package/dist/stories/HomeCover.stories.js +68 -0
- package/dist/stories/IFrameInput.stories.d.ts +32 -0
- package/dist/stories/IFrameInput.stories.js +51 -0
- package/dist/stories/ImageInput/ImageInput.stories.d.ts +263 -0
- package/dist/stories/ImageInput/ImageInput.stories.js +167 -0
- package/dist/stories/ImageInput/imageInputArgTypes.d.ts +121 -0
- package/dist/stories/ImageInput/imageInputArgTypes.js +78 -0
- package/dist/stories/ImageInput/imageInputParseArgTypes.d.ts +17 -0
- package/dist/stories/ImageInput/imageInputParseArgTypes.js +31 -0
- package/dist/stories/InlineAlert.stories.d.ts +62 -0
- package/dist/stories/InlineAlert.stories.js +62 -0
- package/dist/stories/Layout.stories.d.ts +161 -0
- package/dist/stories/Layout.stories.js +183 -0
- package/dist/stories/LegendRadioList.stories.d.ts +15 -0
- package/dist/stories/LegendRadioList.stories.js +73 -0
- package/dist/stories/Loaders.stories.d.ts +77 -0
- package/dist/stories/Loaders.stories.js +74 -0
- package/dist/stories/Modal.stories.d.ts +135 -0
- package/dist/stories/Modal.stories.js +146 -0
- package/dist/stories/ModalConfirmAction.stories.d.ts +13 -0
- package/dist/stories/ModalConfirmAction.stories.js +47 -0
- package/dist/stories/OKELink.stories.d.ts +72 -0
- package/dist/stories/OKELink.stories.js +110 -0
- package/dist/stories/PDFInput.stories.d.ts +20 -0
- package/dist/stories/PDFInput.stories.js +45 -0
- package/dist/stories/PageScrollIndicator.stories.d.ts +15 -0
- package/dist/stories/PageScrollIndicator.stories.js +26 -0
- package/dist/stories/PercentCompletedPi.stories.d.ts +55 -0
- package/dist/stories/PercentCompletedPi.stories.js +49 -0
- package/dist/stories/Playground.stories.d.ts +22 -0
- package/dist/stories/Playground.stories.js +26 -0
- package/dist/stories/Progress.stories.d.ts +45 -0
- package/dist/stories/Progress.stories.js +50 -0
- package/dist/stories/RadioButton.stories.d.ts +260 -0
- package/dist/stories/RadioButton.stories.js +264 -0
- package/dist/stories/ResourceInput.stories.d.ts +9 -0
- package/dist/stories/ResourceInput.stories.js +53 -0
- package/dist/stories/SimpleTable.stories.d.ts +65 -0
- package/dist/stories/SimpleTable.stories.js +111 -0
- package/dist/stories/SkeletonLoader.stories.d.ts +81 -0
- package/dist/stories/SkeletonLoader.stories.js +82 -0
- package/dist/stories/Switches.stories.d.ts +106 -0
- package/dist/stories/Switches.stories.js +136 -0
- package/dist/stories/TabBar.stories.d.ts +73 -0
- package/dist/stories/TabBar.stories.js +103 -0
- package/dist/stories/TagClear.stories.d.ts +57 -0
- package/dist/stories/TagClear.stories.js +76 -0
- package/dist/stories/TagDisplay.stories.d.ts +73 -0
- package/dist/stories/TagDisplay.stories.js +154 -0
- package/dist/stories/TagLink.stories.d.ts +59 -0
- package/dist/stories/TagLink.stories.js +65 -0
- package/dist/stories/TagSelect.stories.d.ts +41 -0
- package/dist/stories/TagSelect.stories.js +54 -0
- package/dist/stories/TagsInput.stories.d.ts +90 -0
- package/dist/stories/TagsInput.stories.js +168 -0
- package/dist/stories/TextInputs.stories.d.ts +124 -0
- package/dist/stories/TextInputs.stories.js +178 -0
- package/dist/stories/Tooltip.stories.d.ts +41 -0
- package/dist/stories/Tooltip.stories.js +78 -0
- package/dist/stories/Typo.stories.d.ts +304 -0
- package/dist/stories/Typo.stories.js +357 -0
- package/dist/stories/UserRoleBadge.stories.d.ts +19 -0
- package/dist/stories/UserRoleBadge.stories.js +46 -0
- package/dist/stories/Utilities.stories.d.ts +5 -0
- package/dist/stories/Utilities.stories.js +110 -0
- package/dist/stories/VideoInput.stories.d.ts +46 -0
- package/dist/stories/VideoInput.stories.js +49 -0
- package/dist/stories/cards/CardContent.stories.d.ts +67 -0
- package/dist/stories/cards/CardContent.stories.js +47 -0
- package/dist/stories/cards/CardEmbed.stories.d.ts +65 -0
- package/dist/stories/cards/CardEmbed.stories.js +46 -0
- package/dist/stories/cards/CardProfile.stories.d.ts +46 -0
- package/dist/stories/cards/CardProfile.stories.js +48 -0
- package/dist/stories/cards/ListContent.stories.d.ts +81 -0
- package/dist/stories/cards/ListContent.stories.js +50 -0
- package/dist/stories/cards/ListProfile.stories.d.ts +41 -0
- package/dist/stories/cards/ListProfile.stories.js +46 -0
- package/dist/stories/cards/utils/cardArgTypes.d.ts +182 -0
- package/dist/stories/cards/utils/cardArgTypes.js +114 -0
- package/dist/stories/cards/utils/parseCardArgs.d.ts +46 -0
- package/dist/stories/cards/utils/parseCardArgs.js +57 -0
- package/dist/themes/colors.d.ts +51 -0
- package/dist/utils/comps/DisplayIcon/index.d.ts +1 -1
- package/dist/utils/getBlockLabelProps.js +1 -1
- package/dist/utils/getterSetterDeleter/getVal_caseExamples.d.ts +60 -0
- package/dist/utils/getterSetterDeleter/getVal_caseExamples.js +91 -0
- package/dist/utilsOolib/StorybookBannersWrapper.d.ts +2 -0
- package/dist/utilsOolib/StorybookBannersWrapper.js +16 -0
- package/dist/utilsOolib/excludeKeys.d.ts +8 -0
- package/dist/utilsOolib/excludeKeys.js +31 -0
- package/dist/utilsOolib/genRandomHash.d.ts +7 -0
- package/dist/utilsOolib/genRandomHash.js +19 -0
- package/dist/utilsOolib/index.d.ts +13 -5
- package/dist/utilsOolib/index.js +16 -4
- package/dist/utilsOolib/renderRTEPlaceholderForOolibPreview.d.ts +8 -1
- package/dist/utilsOolib/renderRTEPlaceholderForOolibPreview.js +1 -2
- package/package.json +4 -3
- /package/dist/components/Buttons/{index.styled.d.ts → styled.d.ts} +0 -0
- /package/dist/components/Buttons/{index.styled.js → styled.js} +0 -0
|
@@ -0,0 +1,264 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.RadioButton = exports.RadioInput = exports.RadioList = void 0;
|
|
27
|
+
var react_1 = require("react");
|
|
28
|
+
var RadioAndCheckbox_1 = require("../components/RadioAndCheckbox");
|
|
29
|
+
var react_json_view_1 = __importDefault(require("react-json-view"));
|
|
30
|
+
var Divider_1 = require("../components/Divider");
|
|
31
|
+
var themes_1 = require("../themes");
|
|
32
|
+
var greyColor100 = themes_1.colors.greyColor100;
|
|
33
|
+
var ops = [
|
|
34
|
+
{ value: 'op1', display: "Squidward" },
|
|
35
|
+
{ value: 'op2', display: "Mr krabs" },
|
|
36
|
+
{ value: 'op3', display: "Patric" },
|
|
37
|
+
{ value: 'op4', display: "SpongeBob SquarePants !!" },
|
|
38
|
+
{ value: 'op5', display: "Bob Marley" },
|
|
39
|
+
//{ value: 'other', display: "Other"},
|
|
40
|
+
];
|
|
41
|
+
exports.default = {
|
|
42
|
+
title: "Components/RadioButton",
|
|
43
|
+
};
|
|
44
|
+
var RadioList = function (args) {
|
|
45
|
+
var _a = (0, react_1.useState)(), chosenOption = _a[0], setChosenOption = _a[1];
|
|
46
|
+
var _b = (0, react_1.useState)(ops), options = _b[0], setOptions = _b[1];
|
|
47
|
+
(0, react_1.useEffect)(function () {
|
|
48
|
+
setOptions(options.map(function (op, idx) {
|
|
49
|
+
if (op.value === 'other')
|
|
50
|
+
return op;
|
|
51
|
+
var argsText = args["option".concat(idx + 1)];
|
|
52
|
+
return argsText !== op.display ? __assign(__assign({}, op), { display: argsText }) : op;
|
|
53
|
+
}));
|
|
54
|
+
}, [args.option1, args.option2, args.option3, args.option4, args.option5]);
|
|
55
|
+
(0, react_1.useEffect)(function () {
|
|
56
|
+
if (args.markOptions) {
|
|
57
|
+
setOptions(options.map(function (op) {
|
|
58
|
+
if (op.value !== args.corrrectOption) {
|
|
59
|
+
return op.isCorrect ? __assign(__assign({}, op), { isCorrect: false }) : op;
|
|
60
|
+
}
|
|
61
|
+
return __assign(__assign({}, op), { isCorrect: true });
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
}, [args.markOptions, args.corrrectOption]);
|
|
65
|
+
return (React.createElement("div", { style: { backgroundColor: args.invert && greyColor100, padding: '4rem' } },
|
|
66
|
+
React.createElement(RadioAndCheckbox_1.RadioList, { options: options, readOnly: args.readOnly, value: chosenOption, onChange: function (id, val) { return setChosenOption(val); }, rightWrongResult: args.markOptions, label: args.label, listType: args.listingStyle, injectOtherOption: args.addOther, disabled: args.disabled, invert: args.invert, S: args.size == "S", commonIsCorrectDesc: args.feedbackMessage, optionsLimit: args.optionsLimit, saveValueAsString: args.saveValueAsString }),
|
|
67
|
+
React.createElement("br", null),
|
|
68
|
+
" ",
|
|
69
|
+
React.createElement(Divider_1.Divider, null),
|
|
70
|
+
" ",
|
|
71
|
+
React.createElement("br", null),
|
|
72
|
+
React.createElement("details", { style: { margin: '2rem 0' } },
|
|
73
|
+
React.createElement("summary", { style: { fontSize: '1.4rem', marginBottom: 10 } }, "Dev only area"),
|
|
74
|
+
React.createElement(react_json_view_1.default, { theme: "monokai", displayDataTypes: false, style: { fontSize: '1.3rem' }, name: "Value", src: typeof (chosenOption) === 'string' ? { stringValue: chosenOption } : chosenOption || {} }))));
|
|
75
|
+
};
|
|
76
|
+
exports.RadioList = RadioList;
|
|
77
|
+
exports.RadioList.args = {
|
|
78
|
+
size: "Medium",
|
|
79
|
+
listingStyle: 'horizontal',
|
|
80
|
+
optionsLimit: ops.length,
|
|
81
|
+
// label: '',
|
|
82
|
+
option1: ops[0].display,
|
|
83
|
+
option2: ops[1].display,
|
|
84
|
+
option3: ops[2].display,
|
|
85
|
+
option4: ops[3].display,
|
|
86
|
+
option5: ops[4].display,
|
|
87
|
+
addOther: false,
|
|
88
|
+
markOptions: false,
|
|
89
|
+
corrrectOption: ops[3].value,
|
|
90
|
+
feedbackMessage: 'this is correct because I chose so',
|
|
91
|
+
saveValueAsString: false,
|
|
92
|
+
disabled: false,
|
|
93
|
+
readOnly: false,
|
|
94
|
+
invert: false,
|
|
95
|
+
};
|
|
96
|
+
exports.RadioList.argTypes = {
|
|
97
|
+
corrrectOption: {
|
|
98
|
+
name: "Correct Option",
|
|
99
|
+
control: { type: 'select' },
|
|
100
|
+
options: ops.map(function (op) { return op.value; }),
|
|
101
|
+
},
|
|
102
|
+
size: {
|
|
103
|
+
name: "Size",
|
|
104
|
+
control: { type: 'select' },
|
|
105
|
+
options: ['Small', 'Medium'],
|
|
106
|
+
mapping: {
|
|
107
|
+
Small: 'S',
|
|
108
|
+
Medium: 'M',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
listingStyle: {
|
|
112
|
+
name: "Listing Style",
|
|
113
|
+
control: { type: 'select' },
|
|
114
|
+
options: ['horizontal', 'vertical'],
|
|
115
|
+
},
|
|
116
|
+
disabled: {
|
|
117
|
+
name: "Disabled",
|
|
118
|
+
},
|
|
119
|
+
invert: {
|
|
120
|
+
name: "Invert"
|
|
121
|
+
},
|
|
122
|
+
readOnly: {
|
|
123
|
+
name: "Read Only"
|
|
124
|
+
},
|
|
125
|
+
optionsLimit: {
|
|
126
|
+
name: "Options Limit",
|
|
127
|
+
control: { type: 'select' },
|
|
128
|
+
options: Array.from({ length: ops.length + 1 }, function (_, index) { return index; }),
|
|
129
|
+
},
|
|
130
|
+
saveValueAsString: {
|
|
131
|
+
name: "Save Value as String"
|
|
132
|
+
},
|
|
133
|
+
feedbackMessage: {
|
|
134
|
+
name: 'Feedback Message'
|
|
135
|
+
},
|
|
136
|
+
markOptions: {
|
|
137
|
+
name: "Mark Options"
|
|
138
|
+
},
|
|
139
|
+
addOther: {
|
|
140
|
+
name: "Add Other"
|
|
141
|
+
},
|
|
142
|
+
// label: {
|
|
143
|
+
// name: "Label",
|
|
144
|
+
// control: {type: 'text'},
|
|
145
|
+
// defaultValue: 'who lives in a pinapple under the sea?'
|
|
146
|
+
// },
|
|
147
|
+
option1: {
|
|
148
|
+
name: "option 1",
|
|
149
|
+
control: { type: 'text' },
|
|
150
|
+
},
|
|
151
|
+
option2: {
|
|
152
|
+
name: "option 2",
|
|
153
|
+
control: { type: 'text' },
|
|
154
|
+
},
|
|
155
|
+
option3: {
|
|
156
|
+
name: "option 3",
|
|
157
|
+
control: { type: 'text' },
|
|
158
|
+
},
|
|
159
|
+
option4: {
|
|
160
|
+
name: "option 4",
|
|
161
|
+
control: { type: 'text' },
|
|
162
|
+
},
|
|
163
|
+
option5: {
|
|
164
|
+
name: "option 5",
|
|
165
|
+
control: { type: 'text' },
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
var RadioInput = function (args) {
|
|
169
|
+
var _a = (0, react_1.useState)(), value = _a[0], setValue = _a[1];
|
|
170
|
+
var _b = (0, react_1.useState)({ value: 'smth', display: args.label }), option = _b[0], setOption = _b[1];
|
|
171
|
+
(0, react_1.useEffect)(function () {
|
|
172
|
+
setOption(__assign(__assign({}, option), { display: args.option1 }));
|
|
173
|
+
}, [args.option1]);
|
|
174
|
+
(0, react_1.useEffect)(function () {
|
|
175
|
+
setOption(__assign(__assign({}, option), { isCorrect: args.optionIsCorrect }));
|
|
176
|
+
}, [args.optionIsCorrect]);
|
|
177
|
+
return (React.createElement("div", { style: {
|
|
178
|
+
padding: '4rem',
|
|
179
|
+
backgroundColor: args.invert ? greyColor100 : 'unset'
|
|
180
|
+
} },
|
|
181
|
+
React.createElement(RadioAndCheckbox_1.RadioInput, __assign({}, args, { value: value, option: option, S: args.size == "Small",
|
|
182
|
+
rightWrongResult: args.markOptions,
|
|
183
|
+
onClick: function (option) { return setValue(option); } }))));
|
|
184
|
+
};
|
|
185
|
+
exports.RadioInput = RadioInput;
|
|
186
|
+
exports.RadioInput.args = {
|
|
187
|
+
size: 'Medium',
|
|
188
|
+
markOptions: false,
|
|
189
|
+
optionIsCorrect: false,
|
|
190
|
+
disabled: false,
|
|
191
|
+
invert: false
|
|
192
|
+
};
|
|
193
|
+
exports.RadioInput.argTypes = {
|
|
194
|
+
optionIsCorrect: {
|
|
195
|
+
name: "Options is Correct"
|
|
196
|
+
},
|
|
197
|
+
// label: {
|
|
198
|
+
// name: "Text",
|
|
199
|
+
// control: {type: 'text'},
|
|
200
|
+
// },
|
|
201
|
+
size: {
|
|
202
|
+
name: "Size",
|
|
203
|
+
control: { type: "inline-radio" },
|
|
204
|
+
options: ['Small', 'Medium']
|
|
205
|
+
},
|
|
206
|
+
markOptions: {
|
|
207
|
+
name: "Mark Options"
|
|
208
|
+
},
|
|
209
|
+
disabled: {
|
|
210
|
+
name: "Disabled"
|
|
211
|
+
},
|
|
212
|
+
invert: {
|
|
213
|
+
name: "Invert"
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
var RadioButton = function (args) {
|
|
217
|
+
var _a = (0, react_1.useState)(false), chosen = _a[0], setChosen = _a[1];
|
|
218
|
+
return (React.createElement("div", { style: {
|
|
219
|
+
padding: '4rem',
|
|
220
|
+
backgroundColor: args.invert ? greyColor100 : 'unset'
|
|
221
|
+
} },
|
|
222
|
+
React.createElement(RadioAndCheckbox_1.RadioButton, __assign({}, args, { isSelected: chosen, onClick: function () { return setChosen(!chosen); }, S: args.size === 'Small' }))));
|
|
223
|
+
};
|
|
224
|
+
exports.RadioButton = RadioButton;
|
|
225
|
+
exports.RadioButton.args = {
|
|
226
|
+
size: 'Medium',
|
|
227
|
+
disabled: false,
|
|
228
|
+
invert: false,
|
|
229
|
+
};
|
|
230
|
+
exports.RadioButton.argTypes = {
|
|
231
|
+
size: {
|
|
232
|
+
name: "Size",
|
|
233
|
+
control: { type: "inline-radio" },
|
|
234
|
+
options: ['Small', 'Medium']
|
|
235
|
+
},
|
|
236
|
+
disabled: {
|
|
237
|
+
name: "Disabled"
|
|
238
|
+
},
|
|
239
|
+
invert: {
|
|
240
|
+
name: "Invert"
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
var commonExcluded = [
|
|
244
|
+
'option2',
|
|
245
|
+
'option3',
|
|
246
|
+
'option4',
|
|
247
|
+
'option5',
|
|
248
|
+
'corrrectOption',
|
|
249
|
+
'listingStyle',
|
|
250
|
+
'label',
|
|
251
|
+
'feedbackMessage',
|
|
252
|
+
'optionsLimit',
|
|
253
|
+
'addOther',
|
|
254
|
+
'readOnly',
|
|
255
|
+
'saveValueAsString'
|
|
256
|
+
];
|
|
257
|
+
exports.RadioInput.parameters = {
|
|
258
|
+
controls: { exclude: commonExcluded }
|
|
259
|
+
};
|
|
260
|
+
exports.RadioButton.parameters = {
|
|
261
|
+
controls: {
|
|
262
|
+
exclude: __spreadArray(__spreadArray([], commonExcluded, true), ['option1', 'markOptions'], false)
|
|
263
|
+
}
|
|
264
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
26
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
27
|
+
if (ar || !(i in from)) {
|
|
28
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
29
|
+
ar[i] = from[i];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.ResourceInput = void 0;
|
|
36
|
+
var react_1 = __importStar(require("react"));
|
|
37
|
+
var ResourceInput_1 = require("../components/ResourceInput");
|
|
38
|
+
var Wrappers_1 = require("../components/Wrappers");
|
|
39
|
+
var Container_1 = require("../components/Container");
|
|
40
|
+
var themes_1 = require("../themes");
|
|
41
|
+
exports.default = {
|
|
42
|
+
title: "Components/ResourceInput",
|
|
43
|
+
args: {
|
|
44
|
+
invert: false,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
var ResourceInput = function (args) {
|
|
48
|
+
var _a = (0, react_1.useState)([]), value = _a[0], setValue = _a[1];
|
|
49
|
+
return (react_1.default.createElement(Container_1.Container, { style: { background: args.invert ? themes_1.colors.greyColor90 : themes_1.colors.white, padding: '2rem' } },
|
|
50
|
+
react_1.default.createElement(Wrappers_1.Wrapper700, null,
|
|
51
|
+
react_1.default.createElement(ResourceInput_1.ResourceInput, { id: "Resource Input", label: "Resource Input Component", sublabel: "Allowed formats: jpeg, png, jpg, pdf, csv, wav, mp3, xls, ppt, pptx, zip, xlsx, mp4, gif, docx, doc", onChange: function (data) { return setValue(__spreadArray(__spreadArray([], value, true), [data], false)); }, value: value, multiple: true, allowedFormats: ["jpeg", "png", "jpg", "pdf", "csv", "wav", "mp3", "xls", "ppt", "pptx", "zip", "xlsx", "mp4", "gif", "docx", "doc"], invert: args.invert }))));
|
|
52
|
+
};
|
|
53
|
+
exports.ResourceInput = ResourceInput;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/// <reference types="mdx" />
|
|
2
|
+
declare namespace _default {
|
|
3
|
+
let title: string;
|
|
4
|
+
namespace argTypes {
|
|
5
|
+
namespace noOfRows {
|
|
6
|
+
export let name: string;
|
|
7
|
+
export namespace _if {
|
|
8
|
+
let arg: string;
|
|
9
|
+
let truthy: boolean;
|
|
10
|
+
}
|
|
11
|
+
export { _if as if };
|
|
12
|
+
}
|
|
13
|
+
namespace noOfCols {
|
|
14
|
+
let name_1: string;
|
|
15
|
+
export { name_1 as name };
|
|
16
|
+
export namespace _if_1 {
|
|
17
|
+
let arg_1: string;
|
|
18
|
+
export { arg_1 as arg };
|
|
19
|
+
let truthy_1: boolean;
|
|
20
|
+
export { truthy_1 as truthy };
|
|
21
|
+
}
|
|
22
|
+
export { _if_1 as if };
|
|
23
|
+
}
|
|
24
|
+
namespace defaultColWidth {
|
|
25
|
+
let name_2: string;
|
|
26
|
+
export { name_2 as name };
|
|
27
|
+
export namespace _if_2 {
|
|
28
|
+
let arg_2: string;
|
|
29
|
+
export { arg_2 as arg };
|
|
30
|
+
let truthy_2: boolean;
|
|
31
|
+
export { truthy_2 as truthy };
|
|
32
|
+
}
|
|
33
|
+
export { _if_2 as if };
|
|
34
|
+
}
|
|
35
|
+
namespace lockTableHeader {
|
|
36
|
+
let name_3: string;
|
|
37
|
+
export { name_3 as name };
|
|
38
|
+
}
|
|
39
|
+
namespace lockTableColumn {
|
|
40
|
+
let name_4: string;
|
|
41
|
+
export { name_4 as name };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
namespace args {
|
|
45
|
+
let lockTableHeader_1: boolean;
|
|
46
|
+
export { lockTableHeader_1 as lockTableHeader };
|
|
47
|
+
let lockTableColumn_1: boolean;
|
|
48
|
+
export { lockTableColumn_1 as lockTableColumn };
|
|
49
|
+
let noOfRows_1: number;
|
|
50
|
+
export { noOfRows_1 as noOfRows };
|
|
51
|
+
let noOfCols_1: number;
|
|
52
|
+
export { noOfCols_1 as noOfCols };
|
|
53
|
+
let defaultColWidth_1: number;
|
|
54
|
+
export { defaultColWidth_1 as defaultColWidth };
|
|
55
|
+
}
|
|
56
|
+
namespace parameters {
|
|
57
|
+
namespace docs {
|
|
58
|
+
export { SimpleTableDocs as page };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export default _default;
|
|
63
|
+
export function SimpleTable(args: any): React.JSX.Element;
|
|
64
|
+
import SimpleTableDocs from './SimpleTable.mdx';
|
|
65
|
+
import React from "react";
|
|
@@ -0,0 +1,111 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.SimpleTable = void 0;
|
|
41
|
+
var react_1 = __importStar(require("react"));
|
|
42
|
+
var SimpleTable_1 = require("../components/SimpleTable");
|
|
43
|
+
var SimpleTable_mdx_1 = __importDefault(require("./SimpleTable.mdx"));
|
|
44
|
+
var Wrappers_1 = require("../components/Wrappers");
|
|
45
|
+
var Paddings_1 = require("../components/Paddings");
|
|
46
|
+
var themes_1 = require("../themes");
|
|
47
|
+
exports.default = {
|
|
48
|
+
title: "Components/SimpleTable",
|
|
49
|
+
argTypes: {
|
|
50
|
+
noOfRows: {
|
|
51
|
+
name: "Number of Rows",
|
|
52
|
+
if: { arg: 'lockTableHeader', truthy: false },
|
|
53
|
+
},
|
|
54
|
+
noOfCols: {
|
|
55
|
+
name: "Number of columns",
|
|
56
|
+
if: { arg: 'lockTableColumn', truthy: false },
|
|
57
|
+
},
|
|
58
|
+
defaultColWidth: {
|
|
59
|
+
name: "Default column width",
|
|
60
|
+
if: { arg: 'lockTableHeader', truthy: false },
|
|
61
|
+
},
|
|
62
|
+
lockTableHeader: {
|
|
63
|
+
name: "Lock Table Header"
|
|
64
|
+
},
|
|
65
|
+
lockTableColumn: {
|
|
66
|
+
name: "Lock Table column"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
args: {
|
|
70
|
+
lockTableHeader: false,
|
|
71
|
+
lockTableColumn: false,
|
|
72
|
+
noOfRows: 3,
|
|
73
|
+
noOfCols: 3,
|
|
74
|
+
defaultColWidth: 200,
|
|
75
|
+
},
|
|
76
|
+
parameters: {
|
|
77
|
+
docs: {
|
|
78
|
+
page: SimpleTable_mdx_1.default,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
var SimpleTable = function (args) {
|
|
83
|
+
var _a = (0, react_1.useState)(undefined), val = _a[0], setVal = _a[1];
|
|
84
|
+
var props = {
|
|
85
|
+
config: {
|
|
86
|
+
noOfRows: args.noOfRows,
|
|
87
|
+
noOfCols: args.noOfCols,
|
|
88
|
+
colHeaderData: args.lockTableColumn && [
|
|
89
|
+
"Verticle Edit",
|
|
90
|
+
"Latitude",
|
|
91
|
+
"Longitude"
|
|
92
|
+
],
|
|
93
|
+
rowHeaderData: args.lockTableHeader && [
|
|
94
|
+
"Verticle Edit",
|
|
95
|
+
"Latitude",
|
|
96
|
+
"Longitude"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
defaultColWidth: args.defaultColWidth,
|
|
100
|
+
value: val,
|
|
101
|
+
onChange: function (k, v) { return setVal(v); }
|
|
102
|
+
};
|
|
103
|
+
(0, react_1.useEffect)(function () {
|
|
104
|
+
console.log({ data: props });
|
|
105
|
+
}, [props]);
|
|
106
|
+
return (react_1.default.createElement("div", { style: { backgroundColor: themes_1.colors.greyColor10 } },
|
|
107
|
+
react_1.default.createElement(Wrappers_1.Wrapper700, { style: { backgroundColor: 'white' } },
|
|
108
|
+
react_1.default.createElement(Paddings_1.PaddingTopBottom40, null,
|
|
109
|
+
react_1.default.createElement(SimpleTable_1.SimpleTable, __assign({}, props))))));
|
|
110
|
+
};
|
|
111
|
+
exports.SimpleTable = SimpleTable;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let title: string;
|
|
3
|
+
namespace argTypes {
|
|
4
|
+
namespace color {
|
|
5
|
+
export let name: string;
|
|
6
|
+
export { availableColors as options };
|
|
7
|
+
export namespace control {
|
|
8
|
+
let type: string;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
namespace width {
|
|
12
|
+
let name_1: string;
|
|
13
|
+
export { name_1 as name };
|
|
14
|
+
export namespace control_1 {
|
|
15
|
+
let type_1: string;
|
|
16
|
+
export { type_1 as type };
|
|
17
|
+
export let min: number;
|
|
18
|
+
export let max: number;
|
|
19
|
+
export let step: number;
|
|
20
|
+
}
|
|
21
|
+
export { control_1 as control };
|
|
22
|
+
export let defaultValue: number;
|
|
23
|
+
}
|
|
24
|
+
namespace height {
|
|
25
|
+
let name_2: string;
|
|
26
|
+
export { name_2 as name };
|
|
27
|
+
export namespace control_2 {
|
|
28
|
+
let type_2: string;
|
|
29
|
+
export { type_2 as type };
|
|
30
|
+
let min_1: number;
|
|
31
|
+
export { min_1 as min };
|
|
32
|
+
let max_1: number;
|
|
33
|
+
export { max_1 as max };
|
|
34
|
+
let step_1: number;
|
|
35
|
+
export { step_1 as step };
|
|
36
|
+
}
|
|
37
|
+
export { control_2 as control };
|
|
38
|
+
let defaultValue_1: number;
|
|
39
|
+
export { defaultValue_1 as defaultValue };
|
|
40
|
+
}
|
|
41
|
+
namespace textWidth {
|
|
42
|
+
let name_3: string;
|
|
43
|
+
export { name_3 as name };
|
|
44
|
+
export namespace control_3 {
|
|
45
|
+
let type_3: string;
|
|
46
|
+
export { type_3 as type };
|
|
47
|
+
let min_2: number;
|
|
48
|
+
export { min_2 as min };
|
|
49
|
+
let max_2: number;
|
|
50
|
+
export { max_2 as max };
|
|
51
|
+
let step_2: number;
|
|
52
|
+
export { step_2 as step };
|
|
53
|
+
}
|
|
54
|
+
export { control_3 as control };
|
|
55
|
+
let defaultValue_2: number;
|
|
56
|
+
export { defaultValue_2 as defaultValue };
|
|
57
|
+
}
|
|
58
|
+
namespace textHeight {
|
|
59
|
+
let name_4: string;
|
|
60
|
+
export { name_4 as name };
|
|
61
|
+
export namespace control_4 {
|
|
62
|
+
let type_4: string;
|
|
63
|
+
export { type_4 as type };
|
|
64
|
+
let min_3: number;
|
|
65
|
+
export { min_3 as min };
|
|
66
|
+
let max_3: number;
|
|
67
|
+
export { max_3 as max };
|
|
68
|
+
let step_3: number;
|
|
69
|
+
export { step_3 as step };
|
|
70
|
+
}
|
|
71
|
+
export { control_4 as control };
|
|
72
|
+
let defaultValue_3: number;
|
|
73
|
+
export { defaultValue_3 as defaultValue };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
let args: {};
|
|
77
|
+
}
|
|
78
|
+
export default _default;
|
|
79
|
+
export function SkeletonLoader(args: any): React.JSX.Element;
|
|
80
|
+
declare const availableColors: string[];
|
|
81
|
+
import React from "react";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SkeletonLoader = void 0;
|
|
16
|
+
var react_1 = __importDefault(require("react"));
|
|
17
|
+
var SkeletonLoader_1 = require("../components/LoadersAndProgress/SkeletonLoader");
|
|
18
|
+
var themes_1 = require("../themes");
|
|
19
|
+
var Divider_1 = require("../components/Divider");
|
|
20
|
+
var TextLoader_1 = require("../components/LoadersAndProgress/TextLoader");
|
|
21
|
+
var Typo_1 = require("../components/Typo");
|
|
22
|
+
var Paddings_1 = require("../components/Paddings");
|
|
23
|
+
var availableColors = __spreadArray([undefined], Object.keys(themes_1.colors).sort(), true);
|
|
24
|
+
exports.default = {
|
|
25
|
+
title: "Components/SkeletonLoader",
|
|
26
|
+
argTypes: {
|
|
27
|
+
color: {
|
|
28
|
+
name: "Color",
|
|
29
|
+
options: availableColors,
|
|
30
|
+
control: { type: "select" },
|
|
31
|
+
},
|
|
32
|
+
width: {
|
|
33
|
+
name: "Width",
|
|
34
|
+
control: { type: "range", min: 1, max: 1000, step: 1 },
|
|
35
|
+
defaultValue: 50,
|
|
36
|
+
},
|
|
37
|
+
height: {
|
|
38
|
+
name: "Height",
|
|
39
|
+
control: { type: "range", min: 1, max: 1000, step: 1 },
|
|
40
|
+
defaultValue: 50,
|
|
41
|
+
},
|
|
42
|
+
textWidth: {
|
|
43
|
+
name: "Text Width",
|
|
44
|
+
control: { type: "range", min: 1, max: 1000, step: 1 },
|
|
45
|
+
defaultValue: 80,
|
|
46
|
+
},
|
|
47
|
+
textHeight: {
|
|
48
|
+
name: "Text Height",
|
|
49
|
+
control: { type: "range", min: 1, max: 1000, step: 1 },
|
|
50
|
+
defaultValue: 15,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
args: {},
|
|
54
|
+
// parameters: {
|
|
55
|
+
// docs: {
|
|
56
|
+
// page: ButtonDocs,
|
|
57
|
+
// },
|
|
58
|
+
// },
|
|
59
|
+
};
|
|
60
|
+
var SkeletonLoader = function (args) {
|
|
61
|
+
return (react_1.default.createElement("div", null,
|
|
62
|
+
react_1.default.createElement(Paddings_1.PaddingBottom30, null,
|
|
63
|
+
react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, 'Skeleton Loader (Base Component)'),
|
|
64
|
+
react_1.default.createElement(Typo_1.SANS_3, null, "All style attributes are completely controllable"),
|
|
65
|
+
react_1.default.createElement(Paddings_1.PaddingBottom10, null),
|
|
66
|
+
react_1.default.createElement(SkeletonLoader_1.SkeletonLoader, { style: {
|
|
67
|
+
backgroundColor: themes_1.colors[args.color],
|
|
68
|
+
width: args.width,
|
|
69
|
+
height: args.height,
|
|
70
|
+
} })),
|
|
71
|
+
react_1.default.createElement(Divider_1.Divider, null),
|
|
72
|
+
react_1.default.createElement(Paddings_1.PaddingTop30, null),
|
|
73
|
+
react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, 'Text Loader'),
|
|
74
|
+
react_1.default.createElement(Typo_1.SANS_3, null, "Defaults to a height of 1.5rem and width of 8rem. Has a fixed color of primaryColor10"),
|
|
75
|
+
react_1.default.createElement(Paddings_1.PaddingBottom10, null),
|
|
76
|
+
react_1.default.createElement(TextLoader_1.TextLoader, { style: {
|
|
77
|
+
width: args.textWidth,
|
|
78
|
+
height: args.textHeight,
|
|
79
|
+
backgroundColor: themes_1.colors[args.color],
|
|
80
|
+
} })));
|
|
81
|
+
};
|
|
82
|
+
exports.SkeletonLoader = SkeletonLoader;
|