linkedunion-design-kit 1.9.1 → 1.9.2
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 +2 -1
- package/dist/index.js +2 -1
- package/dist/src/components/Accordion/accordion.js +1 -1
- package/dist/src/components/Alerts/Alert/alert.d.ts +19 -0
- package/dist/src/components/Alerts/Alert/alert.js +156 -0
- package/dist/src/components/Alerts/Alert/alert.stories.d.ts +30 -0
- package/dist/src/components/Alerts/Alert/alert.stories.js +166 -0
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.d.ts +45 -0
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.js +168 -0
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.d.ts +69 -0
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.js +213 -0
- package/dist/src/components/Alerts/AlertDialog/index.d.ts +44 -0
- package/dist/src/components/Alerts/AlertDialog/index.js +189 -0
- package/dist/src/components/Avatar/Avatar/Avatar.d.ts +12 -3
- package/dist/src/components/Avatar/Avatar/Avatar.js +49 -11
- package/dist/src/components/Avatar/Avatar/Avatar.stories.d.ts +16 -2
- package/dist/src/components/Avatar/Avatar/Avatar.stories.js +51 -25
- package/dist/src/components/Avatar/Avatar/Avatar.test.js +6 -46
- package/dist/src/components/Avatar/Avatar/Avatar1.stories.d.ts +17 -0
- package/dist/src/components/Avatar/Avatar/Avatar1.stories.js +68 -0
- package/dist/src/components/Avatar/Avatar/index.d.ts +51 -28
- package/dist/src/components/Avatar/Avatar/index.js +76 -28
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.js +1 -1
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.js +1 -1
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.d.ts +3 -0
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.js +18 -0
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.d.ts +44 -0
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.js +41 -0
- package/dist/src/components/Avatar/StatusIndicator/index.d.ts +27 -0
- package/dist/src/components/Avatar/StatusIndicator/index.js +29 -0
- package/dist/src/components/Avatar/StatusIndicator/type.d.ts +6 -0
- package/dist/src/components/Badge/Badge.d.ts +21 -0
- package/dist/src/components/Badge/Badge.js +59 -0
- package/dist/src/components/Badge/Badge.stories.d.ts +719 -0
- package/dist/src/components/Badge/Badge.stories.js +145 -0
- package/dist/src/components/Badge/index.d.ts +47 -0
- package/dist/src/components/Badge/index.js +49 -0
- package/dist/src/components/Button/Button/Button.d.ts +2 -2
- package/dist/src/components/Button/Button/Button.stories.d.ts +4 -4
- package/dist/src/components/Button/IconButton/IconButton.d.ts +2 -2
- package/dist/src/components/Button/IconButton/IconButton.stories.d.ts +4 -4
- package/dist/src/components/Dropdown/Combobox/Combobox.d.ts +3 -0
- package/dist/src/components/Dropdown/Combobox/Combobox.js +160 -0
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.d.ts +13 -0
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.js +225 -0
- package/dist/src/components/Dropdown/Combobox/index.d.ts +35 -0
- package/dist/src/components/Dropdown/Combobox/index.js +36 -0
- package/dist/src/components/Dropdown/Combobox/type.d.ts +25 -0
- package/dist/src/components/Dropdown/Combobox/utils/getLabelVariant.d.ts +3 -0
- package/dist/src/components/Dropdown/Combobox/utils/getLabelVariant.js +7 -0
- package/dist/src/components/Dropdown/Combobox/utils/renderBadge.d.ts +6 -0
- package/dist/src/components/Dropdown/Combobox/utils/renderBadge.js +5 -0
- package/dist/src/components/Dropdown/Combobox/utils/useResponsiveBadge.d.ts +1 -0
- package/dist/src/components/Dropdown/Combobox/utils/useResponsiveBadge.js +14 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.d.ts +37 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.js +96 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.d.ts +25 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.js +253 -0
- package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.d.ts +3 -0
- package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.js +9 -0
- package/dist/src/components/Dropdown/DropdownMenu/index.d.ts +20 -0
- package/dist/src/components/Dropdown/DropdownMenu/index.js +21 -0
- package/dist/src/components/Dropdown/DropdownMenu/type.d.ts +7 -0
- package/dist/src/components/Dropdown/select.js +3 -3
- package/dist/src/components/Icons/LUIcon.d.ts +1 -1
- package/dist/src/components/Icons/LUIcon.js +15 -8
- package/dist/src/components/Icons/LUIcon.test.d.ts +0 -1
- package/dist/src/components/Icons/LUIcon.test.js +306 -253
- package/dist/src/components/Icons/index.d.ts +23 -8
- package/dist/src/components/Icons/index.js +43 -28
- package/dist/src/components/Icons/stories/InteractiveIconSelector.js +3 -3
- package/dist/src/components/Icons/stories/LUIcon.stories.d.ts +9 -5
- package/dist/src/components/Icons/stories/LUIcon.stories.js +28 -43
- package/dist/src/components/Icons/type.d.ts +0 -1
- package/dist/src/components/SweetAlert/SweetAlert.d.ts +40 -0
- package/dist/src/components/SweetAlert/SweetAlert.js +150 -0
- package/dist/src/components/SweetAlert/SweetAlert.stories.d.ts +86 -0
- package/dist/src/components/SweetAlert/SweetAlert.stories.js +305 -0
- package/dist/src/components/SweetAlert/index.d.ts +24 -0
- package/dist/src/components/SweetAlert/index.js +137 -0
- package/dist/src/components/ui/avatar.d.ts +10 -3
- package/dist/src/components/ui/avatar.js +27 -12
- package/dist/src/components/ui/command.d.ts +22 -0
- package/dist/src/components/ui/command.js +65 -0
- package/dist/src/components/ui/dialog.d.ts +15 -0
- package/dist/src/components/ui/dialog.js +68 -0
- package/dist/src/components/ui/popover.d.ts +7 -0
- package/dist/src/components/ui/popover.js +42 -0
- package/dist/src/utils/constants.d.ts +1 -0
- package/dist/src/utils/constants.js +1 -0
- package/dist/styles/global.css +727 -53
- package/dist/tailwind.config.js +6 -0
- package/package.json +6 -1
- package/dist/app/layout.jsx +0 -13
- package/dist/app/page.jsx +0 -5
- package/dist/next.config.d.ts +0 -8
- package/dist/next.config.js +0 -10
- package/dist/src/components/Accordion/Accordion.stories.jsx +0 -33
- package/dist/src/components/Accordion/accordion.jsx +0 -59
- package/dist/src/components/AppIcons/AndroidIcon.jsx +0 -24
- package/dist/src/components/AppIcons/AppIcon.jsx +0 -29
- package/dist/src/components/AppIcons/AppIcon.stories.jsx +0 -223
- package/dist/src/components/AppIcons/AppleIcon.jsx +0 -31
- package/dist/src/components/AppIcons/PlayStoreIcon.jsx +0 -29
- package/dist/src/components/Avatar/Avatar/Avatar.jsx +0 -17
- package/dist/src/components/Avatar/Avatar/Avatar.stories.jsx +0 -31
- package/dist/src/components/Avatar/Avatar/Avatar.test.jsx +0 -51
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.jsx +0 -17
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.jsx +0 -32
- package/dist/src/components/Button/Button/Button.jsx +0 -73
- package/dist/src/components/Button/Button/Button.stories.jsx +0 -283
- package/dist/src/components/Button/Button/Button.test.jsx +0 -73
- package/dist/src/components/Button/Button/index.d.ts +0 -63
- package/dist/src/components/Button/Button/index.js +0 -64
- package/dist/src/components/Button/Button.d.ts +0 -20
- package/dist/src/components/Button/Button.js +0 -83
- package/dist/src/components/Button/Button.stories.d.ts +0 -725
- package/dist/src/components/Button/Button.stories.js +0 -288
- package/dist/src/components/Button/Button.test.js +0 -10
- package/dist/src/components/Button/IconButton/IconButton.jsx +0 -63
- package/dist/src/components/Button/IconButton/IconButton.stories.jsx +0 -128
- package/dist/src/components/Button/IconButton/IconButton.test.jsx +0 -28
- package/dist/src/components/Button/IconButton/index.d.ts +0 -0
- package/dist/src/components/Button/IconButton/index.js +0 -1
- package/dist/src/components/Button/IconButton.d.ts +0 -33
- package/dist/src/components/Button/IconButton.js +0 -79
- package/dist/src/components/Button/IconButton.stories.d.ts +0 -4
- package/dist/src/components/Button/IconButton.stories.js +0 -65
- package/dist/src/components/Button/IconButton.test.js +0 -28
- package/dist/src/components/Card/MultipleNews/MultiNews.jsx +0 -80
- package/dist/src/components/Card/MultipleNews/MultiNews.stories.jsx +0 -104
- package/dist/src/components/Card/PostByCategory/PostByCategory.jsx +0 -60
- package/dist/src/components/Card/PostByCategory/PostByCategory.stories.jsx +0 -106
- package/dist/src/components/Card/SinglePost/SinglePost.jsx +0 -26
- package/dist/src/components/Card/SinglePost/SinglePost.stories.jsx +0 -68
- package/dist/src/components/Card/card.jsx +0 -36
- package/dist/src/components/Card/contactProfile/ContactProfile.jsx +0 -60
- package/dist/src/components/Card/contactProfile/ContactProfile.stories.jsx +0 -103
- package/dist/src/components/Card/photoAlbum/PhotoAlbum.jsx +0 -41
- package/dist/src/components/Card/photoAlbum/PhotoAlbum.stories.jsx +0 -69
- package/dist/src/components/Card/photoGallery/PhotoGallery.jsx +0 -17
- package/dist/src/components/Card/photoGallery/PhotoGallery.stories.jsx +0 -39
- package/dist/src/components/Checkbox/checkbox.jsx +0 -47
- package/dist/src/components/Checkbox/checkbox.stories.jsx +0 -113
- package/dist/src/components/ColorPicker/ColorPicker.jsx +0 -67
- package/dist/src/components/ColorPicker/ColorPicker.stories.jsx +0 -138
- package/dist/src/components/Colors/color.jsx +0 -5
- package/dist/src/components/Colors/color.stories.jsx +0 -20
- package/dist/src/components/Colors/color.test.jsx +0 -23
- package/dist/src/components/Dropdown/Select.stories.jsx +0 -201
- package/dist/src/components/Dropdown/select.jsx +0 -94
- package/dist/src/components/Icons/IconList.test.d.ts +0 -1
- package/dist/src/components/Icons/IconList.test.js +0 -58
- package/dist/src/components/Icons/IconView.d.ts +0 -1
- package/dist/src/components/Icons/IconView.js +0 -8
- package/dist/src/components/Icons/IconView.stories.d.ts +0 -4
- package/dist/src/components/Icons/IconView.stories.js +0 -20
- package/dist/src/components/Icons/LUIcon.jsx +0 -36
- package/dist/src/components/Icons/LUIcon.stories.d.ts +0 -6
- package/dist/src/components/Icons/LUIcon.stories.js +0 -75
- package/dist/src/components/Icons/LUIcon.test.jsx +0 -243
- package/dist/src/components/Icons/SingleIcon.test.d.ts +0 -1
- package/dist/src/components/Icons/SingleIcon.test.js +0 -68
- package/dist/src/components/Icons/stories/IconDropdown.jsx +0 -67
- package/dist/src/components/Icons/stories/IconGallery.jsx +0 -77
- package/dist/src/components/Icons/stories/InteractiveIconSelector.jsx +0 -86
- package/dist/src/components/Icons/stories/LUIcon.stories.jsx +0 -96
- package/dist/src/components/ImageUploader/ImageUploader.stories.jsx +0 -50
- package/dist/src/components/ImageUploader/imageUploader.jsx +0 -94
- package/dist/src/components/Images/LuImage.jsx +0 -19
- package/dist/src/components/Images/LuImage.stories.jsx +0 -154
- package/dist/src/components/Images/LuImage.test.jsx +0 -44
- package/dist/src/components/Input/Input.stories.jsx +0 -250
- package/dist/src/components/Input/input.jsx +0 -110
- package/dist/src/components/Label/Label.jsx +0 -32
- package/dist/src/components/Label/Label.stories.jsx +0 -30
- package/dist/src/components/MediaCard/Card.d.ts +0 -3
- package/dist/src/components/MediaCard/Card.js +0 -45
- package/dist/src/components/MediaCard/Card.stories.d.ts +0 -4
- package/dist/src/components/MediaCard/Card.stories.js +0 -57
- package/dist/src/components/MediaCard/Card.test.d.ts +0 -1
- package/dist/src/components/MediaCard/Card.test.js +0 -28
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.d.ts +0 -2
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.js +0 -27
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.test.d.ts +0 -1
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.test.js +0 -61
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.d.ts +0 -2
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.js +0 -7
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.test.d.ts +0 -1
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.test.js +0 -99
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.d.ts +0 -2
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.js +0 -7
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.test.d.ts +0 -1
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.test.js +0 -99
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.d.ts +0 -2
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.js +0 -31
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.test.d.ts +0 -1
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.test.js +0 -62
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.d.ts +0 -2
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.js +0 -7
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.test.d.ts +0 -1
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.test.js +0 -99
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.d.ts +0 -2
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.js +0 -7
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.test.d.ts +0 -1
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.test.js +0 -99
- package/dist/src/components/MediaCard/VerticalCard/VerticalCard.d.ts +0 -3
- package/dist/src/components/MediaCard/VerticalCard/VerticalCard.js +0 -13
- package/dist/src/components/MediaCard/VerticalCard/VerticalCard.stories.d.ts +0 -5
- package/dist/src/components/MediaCard/VerticalCard/VerticalCard.stories.js +0 -40
- package/dist/src/components/MediaCard/index.d.ts +0 -9
- package/dist/src/components/MediaCard/index.js +0 -13
- package/dist/src/components/MediaCard/type.d.ts +0 -47
- package/dist/src/components/RadioButton/RadioButton.stories.d.ts +0 -10
- package/dist/src/components/RadioButton/RadioButton.stories.js +0 -82
- package/dist/src/components/RadioButton/RadioGroup.stories.d.ts +0 -10
- package/dist/src/components/RadioButton/RadioGroup.stories.js +0 -131
- package/dist/src/components/RadioButton/radio-button.d.ts +0 -14
- package/dist/src/components/RadioButton/radio-button.js +0 -57
- package/dist/src/components/RadioButton/radio-group.d.ts +0 -21
- package/dist/src/components/RadioButton/radio-group.js +0 -59
- package/dist/src/components/RadioGroup/RadioGroup.stories.jsx +0 -146
- package/dist/src/components/RadioGroup/radio-group.jsx +0 -49
- package/dist/src/components/Slider/Slider.stories.jsx +0 -159
- package/dist/src/components/Slider/slider.jsx +0 -31
- package/dist/src/components/Switch/Switch.stories.jsx +0 -66
- package/dist/src/components/Switch/switch.jsx +0 -61
- package/dist/src/components/Tabs/Tabs.stories.jsx +0 -29
- package/dist/src/components/Tabs/tabs.jsx +0 -32
- package/dist/src/components/Title/Title.jsx +0 -8
- package/dist/src/components/Title/Title.stories.jsx +0 -37
- package/dist/src/components/Title/Title.test.jsx +0 -24
- package/dist/src/components/ToolTip/Tooltip.jsx +0 -18
- package/dist/src/components/ToolTip/Tooltip.stories.jsx +0 -25
- package/dist/src/components/Typography/Body/Body.stories.jsx +0 -34
- package/dist/src/components/Typography/Body/body.jsx +0 -52
- package/dist/src/components/Typography/Caption/Caption.stories.jsx +0 -24
- package/dist/src/components/Typography/Caption/caption.jsx +0 -25
- package/dist/src/components/Typography/Display/Display.stories.jsx +0 -24
- package/dist/src/components/Typography/Display/display.jsx +0 -39
- package/dist/src/components/Typography/Heading/Heading.stories.jsx +0 -37
- package/dist/src/components/Typography/Heading/heading.jsx +0 -53
- package/dist/src/components/ui/accordion.d.ts +0 -7
- package/dist/src/components/ui/accordion.js +0 -64
- package/dist/src/components/ui/avatar.jsx +0 -27
- package/dist/src/components/ui/caption.d.ts +0 -8
- package/dist/src/components/ui/caption.js +0 -34
- package/dist/src/components/ui/checkbox.d.ts +0 -4
- package/dist/src/components/ui/checkbox.js +0 -31
- package/dist/src/components/ui/input.d.ts +0 -3
- package/dist/src/components/ui/input.js +0 -29
- package/dist/src/components/ui/switch.d.ts +0 -22
- package/dist/src/components/ui/switch.js +0 -70
- package/dist/src/components/ui/tooltip.jsx +0 -38
- package/dist/src/components/ui/typography.jsx +0 -56
- package/dist/src/context/LocalizationContext.d.ts +0 -23
- package/dist/src/context/LocalizationContext.js +0 -17
- package/dist/src/utils/index.d.ts +0 -17
- package/dist/src/utils/index.js +0 -20
- /package/dist/src/components/{MediaCard → Avatar/StatusIndicator}/type.js +0 -0
- /package/dist/src/components/{Button/Button.test.d.ts → Dropdown/Combobox/type.js} +0 -0
- /package/dist/src/components/{Button/IconButton.test.d.ts → Dropdown/DropdownMenu/type.js} +0 -0
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
49
|
-
import { render, screen } from "@testing-library/react";
|
|
50
|
-
import "@testing-library/jest-dom";
|
|
51
|
-
import { ContactProfileTheme2 } from "./ContactProfileTheme2";
|
|
52
|
-
import userEvent from "@testing-library/user-event";
|
|
53
|
-
describe("ContactProfileTheme1 Component", function () {
|
|
54
|
-
var mockProps = {
|
|
55
|
-
id: 1,
|
|
56
|
-
heading: "John Doe",
|
|
57
|
-
body: "Software Engineer",
|
|
58
|
-
image: "https://via.placeholder.com/150",
|
|
59
|
-
btnLabel: "View Profile",
|
|
60
|
-
href: "/profile",
|
|
61
|
-
className: "custom-class",
|
|
62
|
-
};
|
|
63
|
-
it("Render the contact profile theme1 with correct body and heading text", function () {
|
|
64
|
-
render(_jsx(ContactProfileTheme2, __assign({}, mockProps)));
|
|
65
|
-
var headingElement = screen.getByText(mockProps.heading);
|
|
66
|
-
var bodyElement = screen.getByText(mockProps.body);
|
|
67
|
-
expect(headingElement).toBeInTheDocument();
|
|
68
|
-
expect(bodyElement).toBeInTheDocument();
|
|
69
|
-
});
|
|
70
|
-
it("renders the button with correct label and icon", function () {
|
|
71
|
-
render(_jsx(ContactProfileTheme2, __assign({}, mockProps)));
|
|
72
|
-
var buttonElement = screen.getByRole("button", {
|
|
73
|
-
name: mockProps.btnLabel,
|
|
74
|
-
});
|
|
75
|
-
expect(buttonElement).toBeInTheDocument();
|
|
76
|
-
expect(buttonElement).toHaveTextContent(mockProps.btnLabel);
|
|
77
|
-
});
|
|
78
|
-
it("renders the link with the correct href", function () {
|
|
79
|
-
render(_jsx(ContactProfileTheme2, __assign({}, mockProps)));
|
|
80
|
-
var linkElement = screen.getByRole("link");
|
|
81
|
-
expect(linkElement).toHaveAttribute("href", mockProps.href);
|
|
82
|
-
});
|
|
83
|
-
it("triggers navigation when the button is clicked", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
-
var user, linkElement;
|
|
85
|
-
return __generator(this, function (_a) {
|
|
86
|
-
switch (_a.label) {
|
|
87
|
-
case 0:
|
|
88
|
-
render(_jsx(ContactProfileTheme2, __assign({}, mockProps)));
|
|
89
|
-
user = userEvent.setup();
|
|
90
|
-
linkElement = screen.getByRole("link");
|
|
91
|
-
return [4 /*yield*/, user.click(linkElement)];
|
|
92
|
-
case 1:
|
|
93
|
-
_a.sent();
|
|
94
|
-
expect(linkElement).toHaveAttribute("href", mockProps.href);
|
|
95
|
-
return [2 /*return*/];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}); });
|
|
99
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { colors } from "../../../utils/colors";
|
|
14
|
-
import { PostByCategoryTheme1 } from "./PostByCategoryTheme1";
|
|
15
|
-
import { PostByCategoryTheme2 } from "./PostByCategoryTheme2";
|
|
16
|
-
import { OrientationEnum } from "../../../utils/enums";
|
|
17
|
-
export var PostByCategory = function (props) {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
19
|
-
return (_jsxs("div", { children: [props.layout === OrientationEnum.horizontal ? (_jsx(PostByCategoryTheme1, __assign({}, props))) : (_jsx(PostByCategoryTheme2, __assign({}, props))), _jsx("style", { jsx: true, global: true, children: "\n .card_PostByCategory_title_color_".concat(props.id, " {\n color: ").concat(((_a = props.cardStyle) === null || _a === void 0 ? void 0 : _a.card_title_color) || colors.black, ";\n }\n .card_PostByCategory_description_color_").concat(props.id, " {\n color: ").concat(((_b = props.cardStyle) === null || _b === void 0 ? void 0 : _b.card_description_color) ||
|
|
20
|
-
colors["gray-500"], ";\n }\n .card_shadow_PostByCategory_").concat(props.id, " {\n box-shadow: ").concat(((_c = props.cardStyle) === null || _c === void 0 ? void 0 : _c.card_shadow_toggle) === 1
|
|
21
|
-
? "0px 4px 12px 0px ".concat(((_d = props.cardStyle) === null || _d === void 0 ? void 0 : _d.card_shadow_color) || "rgba(52, 52, 52, 0.15)") //TODO: change shadow color with our color theme
|
|
22
|
-
: "0px 4px 12px 0px rgba(52, 52, 52, 0.15)", ";\n }\n .card_bg_PostByCategory_").concat(props.id, " {\n background-color: ").concat(((_e = props.cardStyle) === null || _e === void 0 ? void 0 : _e.card_background_color) ||
|
|
23
|
-
colors.white, " !important;\n }\n .card_PostByCategory_btn_").concat(props.id, " {\n background-color: ").concat(((_f = props.cardStyle) === null || _f === void 0 ? void 0 : _f.card_button_background_color) ||
|
|
24
|
-
colors["gray-50"], " !important;\n color: ").concat(((_g = props.cardStyle) === null || _g === void 0 ? void 0 : _g.card_button_text_color) ||
|
|
25
|
-
colors["gray-950"], " !important;\n fill: ").concat(((_h = props.cardStyle) === null || _h === void 0 ? void 0 : _h.card_button_text_color) ||
|
|
26
|
-
colors["gray-950"], " !important;\n }\n .card_PostByCategory_btn_").concat(props.id, ":hover {\n background-color: ").concat(((_j = props.cardStyle) === null || _j === void 0 ? void 0 : _j.card_button_background_color) ||
|
|
27
|
-
colors["gray-50"], " !important;\n color: ").concat(((_k = props.cardStyle) === null || _k === void 0 ? void 0 : _k.card_button_text_color) ||
|
|
28
|
-
colors["gray-950"], " !important;\n fill: ").concat(((_l = props.cardStyle) === null || _l === void 0 ? void 0 : _l.card_button_text_color) ||
|
|
29
|
-
colors["gray-950"], " !important;\n }\n .card_PostByCategory_theme2_image_").concat(props === null || props === void 0 ? void 0 : props.id, " {\n border-color: ").concat(((_m = props.cardStyle) === null || _m === void 0 ? void 0 : _m.card_image_border_color) ||
|
|
30
|
-
(colors === null || colors === void 0 ? void 0 : colors.black), " !important;\n border-radius: ").concat(((_o = props.cardStyle) === null || _o === void 0 ? void 0 : _o.card_image_border_radius) || "0", "%;\n border: ").concat(((_p = props.cardStyle) === null || _p === void 0 ? void 0 : _p.card_image_border) || "0", "px solid;\n }\n ") })] }));
|
|
31
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { render, screen } from "@testing-library/react";
|
|
14
|
-
import { PostByCategory } from "./PostByCategory";
|
|
15
|
-
import { OrientationEnum } from "../../../utils/enums";
|
|
16
|
-
import { Dummy_Url } from "../../../utils/constants";
|
|
17
|
-
var mockProps = {
|
|
18
|
-
id: 1,
|
|
19
|
-
layout: OrientationEnum.horizontal,
|
|
20
|
-
image: "/images/demo-image.jpg",
|
|
21
|
-
cardStyle: {
|
|
22
|
-
card_title_color: "#000000",
|
|
23
|
-
card_description_color: "#666666",
|
|
24
|
-
card_shadow_toggle: 1,
|
|
25
|
-
card_shadow_color: "rgba(0,0,0,0.2)",
|
|
26
|
-
card_background_color: "#ffffff",
|
|
27
|
-
card_button_background_color: "#f5f5f5",
|
|
28
|
-
card_button_text_color: "#333333",
|
|
29
|
-
},
|
|
30
|
-
href: Dummy_Url,
|
|
31
|
-
};
|
|
32
|
-
describe("PostByCategory Component", function () {
|
|
33
|
-
it("renders PostByCategoryTheme1 when layout is horizontal", function () {
|
|
34
|
-
render(_jsx(PostByCategory, __assign({}, mockProps)));
|
|
35
|
-
expect(screen.getByTestId("postByCategory-theme1")).toBeInTheDocument();
|
|
36
|
-
});
|
|
37
|
-
it("renders PostByCategoryTheme2 when layout is vertical", function () {
|
|
38
|
-
render(_jsx(PostByCategory, __assign({}, mockProps, { layout: OrientationEnum.vertical })));
|
|
39
|
-
expect(screen.getByTestId("postByCategory-theme2")).toBeInTheDocument();
|
|
40
|
-
});
|
|
41
|
-
it("applies correct styles based on id", function () {
|
|
42
|
-
render(_jsx(PostByCategory, __assign({}, mockProps)));
|
|
43
|
-
var styles = document.styleSheets[document.styleSheets.length - 1].cssRules;
|
|
44
|
-
expect(Array.from(styles).some(function (rule) {
|
|
45
|
-
return rule.cssText.includes(".card_PostByCategory_title_color_1");
|
|
46
|
-
})).toBeTruthy();
|
|
47
|
-
expect(Array.from(styles).some(function (rule) {
|
|
48
|
-
return rule.cssText.includes(".card_bg_PostByCategory_1");
|
|
49
|
-
})).toBeTruthy();
|
|
50
|
-
});
|
|
51
|
-
it("applies default shadow when card_shadow_toggle is not 1", function () {
|
|
52
|
-
render(_jsx(PostByCategory, __assign({}, mockProps, { cardStyle: __assign(__assign({}, mockProps.cardStyle), { card_shadow_toggle: 0 }) })));
|
|
53
|
-
var styles = document.styleSheets[document.styleSheets.length - 1].cssRules;
|
|
54
|
-
expect(Array.from(styles).some(function (rule) {
|
|
55
|
-
return rule.cssText.includes("box-shadow: 0px 4px 12px 0px rgba(52, 52, 52, 0.15)");
|
|
56
|
-
})).toBeTruthy();
|
|
57
|
-
});
|
|
58
|
-
it("renders correctly when cardStyle is undefined", function () {
|
|
59
|
-
render(_jsx(PostByCategory, __assign({}, mockProps, { cardStyle: undefined })));
|
|
60
|
-
expect(screen.getByTestId("postByCategory-theme1")).toBeInTheDocument();
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Link from "next/link";
|
|
3
|
-
import LuImage from "../../../components/Images/LuImage";
|
|
4
|
-
import { Button } from "../../../components/Button/Button";
|
|
5
|
-
export var PostByCategoryTheme1 = function (props) {
|
|
6
|
-
return (_jsxs("div", { "data-testid": "postByCategory-theme1", className: "p-5 card_bg_PostByCategory_".concat(props.id, " rounded-xl ").concat(props.className, " card_shadow_PostByCategory_").concat(props.id, " flex gap-x-[20px] w-full"), children: [_jsx("div", { className: "max-w-[240px] overflow-hidden aspect-square max-xs:hidden", children: _jsx(LuImage, { src: props.image, width: 240, height: 240, className: "rounded-lg w-full h-full object-cover", alt: "Post By Category" }) }), _jsxs("div", { className: "flex flex-1 flex-col", children: [_jsxs("div", { className: "flex flex-col justify-center flex-1 h-full", children: [_jsx("div", { className: "card_PostByCategory_title_color_".concat(props.id, " text-2xl font-semibold capitalize line-clamp-1"), children: props.heading }), _jsx("p", { className: "card_PostByCategory_description_color_".concat(props.id, " text-base font-extralight line-clamp-2 max-xs:line-clamp-1 max-xs:mt-[7px]"), children: props.body })] }), _jsx(Link, { href: props.href, passHref: true, className: "w-full no-underline", children: _jsx(Button, { endIcon: "angle-right", size: "lg", className: "rounded justify-between w-full max-xs:mt-2.5 card_PostByCategory_btn_".concat(props.id), children: props.btnLabel }) })] })] }));
|
|
7
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "@testing-library/jest-dom";
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
49
|
-
import { render, screen } from "@testing-library/react";
|
|
50
|
-
import "@testing-library/jest-dom";
|
|
51
|
-
import { PostByCategoryTheme1 } from "./PostByCategoryTheme1";
|
|
52
|
-
import userEvent from "@testing-library/user-event";
|
|
53
|
-
describe("PostByCategoryTheme1 Component", function () {
|
|
54
|
-
var mockProps = {
|
|
55
|
-
id: 1,
|
|
56
|
-
heading: "John Doe",
|
|
57
|
-
body: "Software Engineer",
|
|
58
|
-
image: "https://via.placeholder.com/150",
|
|
59
|
-
btnLabel: "View Profile",
|
|
60
|
-
href: "/profile",
|
|
61
|
-
className: "custom-class",
|
|
62
|
-
};
|
|
63
|
-
it("Render the post by category theme1 with correct body and heading text", function () {
|
|
64
|
-
render(_jsx(PostByCategoryTheme1, __assign({}, mockProps)));
|
|
65
|
-
var headingElement = screen.getByText(mockProps.heading);
|
|
66
|
-
var bodyElement = screen.getByText(mockProps.body);
|
|
67
|
-
expect(headingElement).toBeInTheDocument();
|
|
68
|
-
expect(bodyElement).toBeInTheDocument();
|
|
69
|
-
});
|
|
70
|
-
it("renders the button with correct label and icon", function () {
|
|
71
|
-
render(_jsx(PostByCategoryTheme1, __assign({}, mockProps)));
|
|
72
|
-
var buttonElement = screen.getByRole("button", {
|
|
73
|
-
name: mockProps.btnLabel,
|
|
74
|
-
});
|
|
75
|
-
expect(buttonElement).toBeInTheDocument();
|
|
76
|
-
expect(buttonElement).toHaveTextContent(mockProps.btnLabel);
|
|
77
|
-
});
|
|
78
|
-
it("renders the link with the correct href", function () {
|
|
79
|
-
render(_jsx(PostByCategoryTheme1, __assign({}, mockProps)));
|
|
80
|
-
var linkElement = screen.getByRole("link");
|
|
81
|
-
expect(linkElement).toHaveAttribute("href", mockProps.href);
|
|
82
|
-
});
|
|
83
|
-
it("triggers navigation when the button is clicked", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
-
var user, linkElement;
|
|
85
|
-
return __generator(this, function (_a) {
|
|
86
|
-
switch (_a.label) {
|
|
87
|
-
case 0:
|
|
88
|
-
render(_jsx(PostByCategoryTheme1, __assign({}, mockProps)));
|
|
89
|
-
user = userEvent.setup();
|
|
90
|
-
linkElement = screen.getByRole("link");
|
|
91
|
-
return [4 /*yield*/, user.click(linkElement)];
|
|
92
|
-
case 1:
|
|
93
|
-
_a.sent();
|
|
94
|
-
expect(linkElement).toHaveAttribute("href", mockProps.href);
|
|
95
|
-
return [2 /*return*/];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}); });
|
|
99
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Link from "next/link";
|
|
3
|
-
import LuImage from "../../../components/Images/LuImage";
|
|
4
|
-
import { Button } from "../../../components/Button/Button";
|
|
5
|
-
export var PostByCategoryTheme2 = function (props) {
|
|
6
|
-
return (_jsxs("div", { "data-testid": "postByCategory-theme2", className: "p-8 card_bg_PostByCategory_".concat(props.id, " rounded-xl ").concat(props.className, " card_shadow_PostByCategory_").concat(props.id, " flex flex-col items-center w-full"), children: [_jsx("div", { className: "w-full max-w-[240px] overflow-hidden aspect-square", children: _jsx(LuImage, { src: props.image, width: 240, height: 240, className: "w-full h-full object-cover card_PostByCategory_theme2_image_".concat(props === null || props === void 0 ? void 0 : props.id), alt: "Post By Category" }) }), _jsxs("div", { className: "flex flex-col items-center flex-grow m-5 text-center h-[100px]", children: [_jsx("div", { className: "text-default card_PostByCategory_title_color_".concat(props.id, " text-2xl font-semibold capitalize line-clamp-1"), children: props.heading }), _jsx("p", { className: "card_PostByCategory_description_color_".concat(props.id, " text-base font-extralight line-clamp-2 max-xs:line-clamp-1 max-sm:mt-[7px]"), children: props.body })] }), _jsx(Link, { href: props.href, passHref: true, className: "w-full no-underline", children: _jsx(Button, { endIcon: "angle-right", size: "lg", className: "rounded justify-between w-full card_PostByCategory_btn_".concat(props.id), children: props.btnLabel }) })] }));
|
|
7
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "@testing-library/jest-dom";
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
49
|
-
import { render, screen } from "@testing-library/react";
|
|
50
|
-
import "@testing-library/jest-dom";
|
|
51
|
-
import { PostByCategoryTheme2 } from "./PostByCategoryTheme2";
|
|
52
|
-
import userEvent from "@testing-library/user-event";
|
|
53
|
-
describe("PostByCategoryTheme2 Component", function () {
|
|
54
|
-
var mockProps = {
|
|
55
|
-
id: 1,
|
|
56
|
-
heading: "John Doe",
|
|
57
|
-
body: "Software Engineer",
|
|
58
|
-
image: "https://via.placeholder.com/150",
|
|
59
|
-
btnLabel: "View Profile",
|
|
60
|
-
href: "/profile",
|
|
61
|
-
className: "custom-class",
|
|
62
|
-
};
|
|
63
|
-
it("Render the post by category theme2 with correct body and heading text", function () {
|
|
64
|
-
render(_jsx(PostByCategoryTheme2, __assign({}, mockProps)));
|
|
65
|
-
var headingElement = screen.getByText(mockProps.heading);
|
|
66
|
-
var bodyElement = screen.getByText(mockProps.body);
|
|
67
|
-
expect(headingElement).toBeInTheDocument();
|
|
68
|
-
expect(bodyElement).toBeInTheDocument();
|
|
69
|
-
});
|
|
70
|
-
it("renders the button with correct label and icon", function () {
|
|
71
|
-
render(_jsx(PostByCategoryTheme2, __assign({}, mockProps)));
|
|
72
|
-
var buttonElement = screen.getByRole("button", {
|
|
73
|
-
name: mockProps.btnLabel,
|
|
74
|
-
});
|
|
75
|
-
expect(buttonElement).toBeInTheDocument();
|
|
76
|
-
expect(buttonElement).toHaveTextContent(mockProps.btnLabel);
|
|
77
|
-
});
|
|
78
|
-
it("renders the link with the correct href", function () {
|
|
79
|
-
render(_jsx(PostByCategoryTheme2, __assign({}, mockProps)));
|
|
80
|
-
var linkElement = screen.getByRole("link");
|
|
81
|
-
expect(linkElement).toHaveAttribute("href", mockProps.href);
|
|
82
|
-
});
|
|
83
|
-
it("triggers navigation when the button is clicked", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
-
var user, linkElement;
|
|
85
|
-
return __generator(this, function (_a) {
|
|
86
|
-
switch (_a.label) {
|
|
87
|
-
case 0:
|
|
88
|
-
render(_jsx(PostByCategoryTheme2, __assign({}, mockProps)));
|
|
89
|
-
user = userEvent.setup();
|
|
90
|
-
linkElement = screen.getByRole("link");
|
|
91
|
-
return [4 /*yield*/, user.click(linkElement)];
|
|
92
|
-
case 1:
|
|
93
|
-
_a.sent();
|
|
94
|
-
expect(linkElement).toHaveAttribute("href", mockProps.href);
|
|
95
|
-
return [2 /*return*/];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}); });
|
|
99
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import LuImage from "../../../components/Images/LuImage";
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
import { getCardImageSrc } from "..";
|
|
5
|
-
import { Heading } from "../../../components/Typography/Heading/heading";
|
|
6
|
-
import { Body } from "../../../components/Typography/Body/body";
|
|
7
|
-
import { Button } from "../../../components/Button/Button";
|
|
8
|
-
var VerticalCard = function (_a) {
|
|
9
|
-
var item = _a.item, footer_logo = _a.footer_logo, _b = _a.href, href = _b === void 0 ? "https://www.google.com/" : _b, _c = _a.btnLabel, btnLabel = _c === void 0 ? "View More" : _c, editor = _a.editor, _d = _a.mediaPosition, mediaPosition = _d === void 0 ? "top" : _d, _e = _a.mediaShape, mediaShape = _e === void 0 ? "square" : _e;
|
|
10
|
-
var imageSrc = getCardImageSrc(item === null || item === void 0 ? void 0 : item.image, footer_logo);
|
|
11
|
-
return (_jsxs("div", { className: "p-8 bg-white rounded-xl inline-flex flex-col gap-5 max-w-[480px] items-center shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card), children: [_jsxs("div", { className: "flex ".concat(mediaPosition === "top" ? "flex-col" : "flex-col-reverse", " items-center gap-5 text-center "), children: [_jsx(LuImage, { src: imageSrc, width: 240, height: 240, className: "w-full h-full ".concat(mediaShape === "square" ? "aspect-5/4 " : "aspect-square rounded-full max-w-[160px]", " object-cover ").concat(editor === null || editor === void 0 ? void 0 : editor.cardImage), alt: "Image" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs(Heading, { variant: "h5-700", className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle), children: [" ", item === null || item === void 0 ? void 0 : item.title] }), _jsx(Body, { variant: "body-md", className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardText), children: item === null || item === void 0 ? void 0 : item.description })] })] }), _jsx(Link, { href: href, passHref: true, children: _jsx(Button, { endIcon: "angle-right", size: "md", shape: "rounded-full", className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn), children: btnLabel }) })] }));
|
|
12
|
-
};
|
|
13
|
-
export default VerticalCard;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Meta } from "@storybook/react";
|
|
2
|
-
import { CardInterface } from "../../../components/Card/type";
|
|
3
|
-
declare const _default: Meta;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const _VerticalCard: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, CardInterface>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import VerticalCard from "./VerticalCard";
|
|
14
|
-
import Card from "../../../components/Card/card";
|
|
15
|
-
import { Dummy_Para, Dummy_Title } from "../../../utils/constants";
|
|
16
|
-
export default {
|
|
17
|
-
title: "Components/VerticalCard",
|
|
18
|
-
component: VerticalCard,
|
|
19
|
-
};
|
|
20
|
-
var Template = function (args) { return _jsx(Card, __assign({}, args)); };
|
|
21
|
-
export var _VerticalCard = Template.bind({});
|
|
22
|
-
_VerticalCard.args = {
|
|
23
|
-
item: {
|
|
24
|
-
image: "/images/demo-image.jpg",
|
|
25
|
-
title: Dummy_Title,
|
|
26
|
-
description: Dummy_Para,
|
|
27
|
-
},
|
|
28
|
-
type: "postByCategory",
|
|
29
|
-
image: "/images/demo-image.jpg",
|
|
30
|
-
href: "https://www.google.com/",
|
|
31
|
-
btnLabel: "View More",
|
|
32
|
-
editor: {
|
|
33
|
-
card: "",
|
|
34
|
-
cardImage: "",
|
|
35
|
-
cardTitle: "",
|
|
36
|
-
cardText: "",
|
|
37
|
-
cardBtn: "",
|
|
38
|
-
},
|
|
39
|
-
orientation: "horizontal",
|
|
40
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare enum SectionTypeEnum {
|
|
2
|
-
multiplePostsTheme = "multiple posts",
|
|
3
|
-
singlePostTheme = "single post",
|
|
4
|
-
postByCategoriesTheme = "post by categories",
|
|
5
|
-
contactsProfileTheme = "contacts profile",
|
|
6
|
-
galleryTheme = "gallery",
|
|
7
|
-
albumTheme = "album"
|
|
8
|
-
}
|
|
9
|
-
export declare function getCardImageSrc(image?: string, footer_logo?: string, fallback?: string): string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export var SectionTypeEnum;
|
|
2
|
-
(function (SectionTypeEnum) {
|
|
3
|
-
SectionTypeEnum["multiplePostsTheme"] = "multiple posts";
|
|
4
|
-
SectionTypeEnum["singlePostTheme"] = "single post";
|
|
5
|
-
SectionTypeEnum["postByCategoriesTheme"] = "post by categories";
|
|
6
|
-
SectionTypeEnum["contactsProfileTheme"] = "contacts profile";
|
|
7
|
-
SectionTypeEnum["galleryTheme"] = "gallery";
|
|
8
|
-
SectionTypeEnum["albumTheme"] = "album";
|
|
9
|
-
})(SectionTypeEnum || (SectionTypeEnum = {}));
|
|
10
|
-
export function getCardImageSrc(image, footer_logo, fallback) {
|
|
11
|
-
if (fallback === void 0) { fallback = "/images/no-image.svg"; }
|
|
12
|
-
return (image === null || image === void 0 ? void 0 : image.trim()) ? image : footer_logo || fallback;
|
|
13
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { OrientationEnum } from "../../utils/enums";
|
|
2
|
-
type layout = keyof typeof OrientationEnum;
|
|
3
|
-
export interface CardProps {
|
|
4
|
-
image: string;
|
|
5
|
-
layout?: layout;
|
|
6
|
-
heading?: string;
|
|
7
|
-
body?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
btnLabel?: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
href: string;
|
|
12
|
-
cardStyle?: {
|
|
13
|
-
card_title_color?: string;
|
|
14
|
-
card_description_color?: string;
|
|
15
|
-
card_shadow_toggle?: number;
|
|
16
|
-
card_shadow_color?: string;
|
|
17
|
-
card_background_color?: string;
|
|
18
|
-
card_button_background_color?: string;
|
|
19
|
-
card_button_text_color?: string;
|
|
20
|
-
card_image_border_color?: string;
|
|
21
|
-
card_image_border_radius?: string;
|
|
22
|
-
card_image_border?: string;
|
|
23
|
-
};
|
|
24
|
-
id?: number;
|
|
25
|
-
}
|
|
26
|
-
export interface EditorInterface {
|
|
27
|
-
cardImage?: string;
|
|
28
|
-
card?: string;
|
|
29
|
-
cardTitle?: string;
|
|
30
|
-
cardText?: string;
|
|
31
|
-
cardBtn?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface CardDataProps {
|
|
34
|
-
image?: string;
|
|
35
|
-
title?: string;
|
|
36
|
-
description?: string;
|
|
37
|
-
}
|
|
38
|
-
export interface CardInterface {
|
|
39
|
-
mediaPosition?: "top" | "middle";
|
|
40
|
-
mediaShape?: "circle" | "square";
|
|
41
|
-
item?: CardDataProps;
|
|
42
|
-
footer_logo?: string;
|
|
43
|
-
href?: string;
|
|
44
|
-
btnLabel?: string;
|
|
45
|
-
editor?: EditorInterface;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { RadioButton } from "./radio-button";
|
|
3
|
-
declare const meta: Meta<typeof RadioButton>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof RadioButton>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const WithLabel: Story;
|
|
8
|
-
export declare const Disabled: Story;
|
|
9
|
-
export declare const Checked: Story;
|
|
10
|
-
export declare const RequiredError: Story;
|