allaw-ui 1.1.1 → 2.0.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/assets/allaw-font.eot +0 -0
- package/dist/assets/allaw-font.svg +15 -0
- package/dist/assets/allaw-font.ttf +0 -0
- package/dist/assets/allaw-font.woff +0 -0
- package/dist/components/atoms/buttons/ActionCircleButton.stories.d.ts +35 -0
- package/dist/components/atoms/buttons/ActionCircleButton.stories.js +54 -0
- package/dist/components/atoms/buttons/AgendaSlot.stories.d.ts +41 -0
- package/dist/components/atoms/buttons/AgendaSlot.stories.js +77 -0
- package/dist/components/atoms/buttons/FavoriteToggle.stories.d.ts +23 -0
- package/dist/components/atoms/buttons/FavoriteToggle.stories.js +61 -0
- package/dist/components/atoms/buttons/FilterButton.stories.d.ts +36 -0
- package/dist/components/atoms/buttons/FilterButton.stories.js +56 -0
- package/dist/components/atoms/buttons/FilterButtonPrimary.stories.d.ts +7 -0
- package/dist/components/atoms/buttons/FilterButtonPrimary.stories.js +26 -0
- package/dist/components/atoms/buttons/GhostButton.stories.d.ts +79 -0
- package/dist/components/atoms/buttons/GhostButton.stories.js +95 -0
- package/dist/components/atoms/buttons/IconButton.js +2 -2
- package/dist/components/atoms/buttons/IconButton.stories.d.ts +48 -0
- package/dist/components/atoms/buttons/IconButton.stories.js +76 -0
- package/dist/components/atoms/buttons/OAuthProviderButton.css +25 -23
- package/dist/components/atoms/buttons/OAuthProviderButton.d.ts +2 -2
- package/dist/components/atoms/buttons/OAuthProviderButton.js +43 -10
- package/dist/components/atoms/buttons/OAuthProviderButton.stories.d.ts +56 -0
- package/dist/components/atoms/buttons/OAuthProviderButton.stories.js +130 -0
- package/dist/components/atoms/buttons/PendingDocuments.d.ts +0 -1
- package/dist/components/atoms/buttons/PendingDocuments.js +6 -4
- package/dist/components/atoms/buttons/PendingDocuments.stories.d.ts +52 -0
- package/dist/components/atoms/buttons/PendingDocuments.stories.js +67 -0
- package/dist/components/atoms/buttons/PrimaryButton.css +1 -0
- package/dist/components/atoms/buttons/PrimaryButton.stories.d.ts +86 -0
- package/dist/components/atoms/buttons/PrimaryButton.stories.js +147 -0
- package/dist/components/atoms/buttons/SecondaryButton.stories.d.ts +72 -0
- package/dist/components/atoms/buttons/SecondaryButton.stories.js +149 -0
- package/dist/components/atoms/buttons/TabNavigation.css +2 -0
- package/dist/components/atoms/buttons/TabNavigation.stories.d.ts +44 -0
- package/dist/components/atoms/buttons/TabNavigation.stories.js +66 -0
- package/dist/components/atoms/buttons/TertiaryButton.stories.d.ts +42 -0
- package/dist/components/atoms/buttons/TertiaryButton.stories.js +60 -0
- package/dist/components/atoms/buttons/{PendingDocuments.css → pendingDocuments.module.css} +9 -8
- package/dist/components/atoms/checkboxes/Checkbox.stories.d.ts +77 -0
- package/dist/components/atoms/checkboxes/Checkbox.stories.js +123 -0
- package/dist/components/atoms/datepickers/Datepicker.js +1 -0
- package/dist/components/atoms/datepickers/Datepicker.stories.d.ts +90 -0
- package/dist/components/atoms/datepickers/Datepicker.stories.js +67 -0
- package/dist/components/atoms/filter/Filter.stories.d.ts +9 -0
- package/dist/components/atoms/filter/Filter.stories.js +77 -0
- package/dist/components/atoms/filters/SingleFilter.stories.d.ts +7 -0
- package/dist/components/atoms/filters/SingleFilter.stories.js +34 -0
- package/dist/components/atoms/inputs/Input.stories.d.ts +62 -0
- package/dist/components/atoms/inputs/Input.stories.js +101 -0
- package/dist/components/atoms/inputs/SearchBar.stories.d.ts +54 -0
- package/dist/components/atoms/inputs/SearchBar.stories.js +67 -0
- package/dist/components/atoms/inputs/TextArea.stories.d.ts +70 -0
- package/dist/components/atoms/inputs/TextArea.stories.js +113 -0
- package/dist/components/atoms/progressBars/ProgressBar.css +2 -3
- package/dist/components/atoms/progressBars/ProgressBar.js +2 -3
- package/dist/components/atoms/progressBars/ProgressBar.stories.d.ts +83 -0
- package/dist/components/atoms/progressBars/ProgressBar.stories.js +88 -0
- package/dist/components/atoms/radios/RadioButton.stories.d.ts +36 -0
- package/dist/components/atoms/radios/RadioButton.stories.js +75 -0
- package/dist/components/atoms/selects/ComboBox.css +1 -1
- package/dist/components/atoms/selects/ComboBox.stories.d.ts +94 -0
- package/dist/components/atoms/selects/ComboBox.stories.js +122 -0
- package/dist/components/atoms/selects/Select.d.ts +0 -1
- package/dist/components/atoms/selects/Select.js +47 -20
- package/dist/components/atoms/selects/{Select.css → Select.module.css} +12 -13
- package/dist/components/atoms/selects/Select.stories.d.ts +86 -0
- package/dist/components/atoms/selects/Select.stories.js +154 -0
- package/dist/components/atoms/selects/SelectableListItem.d.ts +13 -0
- package/dist/components/atoms/selects/SelectableListItem.js +18 -0
- package/dist/components/atoms/selects/SelectableListItem.module.css +157 -0
- package/dist/components/atoms/selects/SelectableListItem.stories.d.ts +33 -0
- package/dist/components/atoms/selects/SelectableListItem.stories.js +53 -0
- package/dist/components/atoms/selects/index.d.ts +2 -0
- package/dist/components/atoms/selects/index.js +1 -0
- package/dist/components/atoms/tags/AppointementStatusTag.stories.d.ts +17 -0
- package/dist/components/atoms/tags/AppointementStatusTag.stories.js +70 -0
- package/dist/components/atoms/tags/FolderStatusTag.css +4 -4
- package/dist/components/atoms/tags/FolderStatusTag.stories.d.ts +28 -0
- package/dist/components/atoms/tags/FolderStatusTag.stories.js +51 -0
- package/dist/components/atoms/tags/OtherStatusTag.css +20 -1
- package/dist/components/atoms/tags/OtherStatusTag.d.ts +1 -0
- package/dist/components/atoms/tags/OtherStatusTag.js +2 -2
- package/dist/components/atoms/tags/OtherStatusTag.stories.d.ts +97 -0
- package/dist/components/atoms/tags/OtherStatusTag.stories.js +151 -0
- package/dist/components/atoms/typography/CardDate.stories.d.ts +119 -0
- package/dist/components/atoms/typography/CardDate.stories.js +103 -0
- package/dist/components/atoms/typography/Heading.js +1 -1
- package/dist/components/atoms/typography/Heading.stories.d.ts +45 -0
- package/dist/components/atoms/typography/Heading.stories.js +90 -0
- package/dist/components/atoms/typography/Link.d.ts +13 -0
- package/dist/components/atoms/typography/Link.js +35 -0
- package/dist/components/atoms/typography/Link.module.css +60 -0
- package/dist/components/atoms/typography/Link.stories.d.ts +57 -0
- package/dist/components/atoms/typography/Link.stories.js +105 -0
- package/dist/components/atoms/typography/Paragraph.d.ts +2 -0
- package/dist/components/atoms/typography/Paragraph.js +3 -3
- package/dist/components/atoms/typography/Paragraph.stories.d.ts +56 -0
- package/dist/components/atoms/typography/Paragraph.stories.js +97 -0
- package/dist/components/atoms/typography/SmallTitle.stories.d.ts +42 -0
- package/dist/components/atoms/typography/SmallTitle.stories.js +72 -0
- package/dist/components/atoms/typography/Subtitle.stories.d.ts +40 -0
- package/dist/components/atoms/typography/Subtitle.stories.js +60 -0
- package/dist/components/atoms/typography/TinyInfo.d.ts +1 -0
- package/dist/components/atoms/typography/TinyInfo.js +2 -2
- package/dist/components/atoms/typography/TinyInfo.stories.d.ts +52 -0
- package/dist/components/atoms/typography/TinyInfo.stories.js +97 -0
- package/dist/components/atoms/typography/index.d.ts +2 -0
- package/dist/components/atoms/typography/index.js +1 -0
- package/dist/components/atoms/uiVariables/AnimatedBorder.css +55 -0
- package/dist/components/atoms/uiVariables/AnimatedBorder.d.ts +4 -0
- package/dist/components/atoms/uiVariables/AnimatedBorder.js +11 -0
- package/dist/components/atoms/uiVariables/AnimatedBorder.stories.d.ts +17 -0
- package/dist/components/atoms/uiVariables/AnimatedBorder.stories.js +20 -0
- package/dist/components/atoms/uiVariables/BorderRadius.stories.d.ts +18 -0
- package/dist/components/atoms/uiVariables/BorderRadius.stories.js +34 -0
- package/dist/components/atoms/uiVariables/Shadows.stories.d.ts +18 -0
- package/dist/components/atoms/uiVariables/Shadows.stories.js +34 -0
- package/dist/components/atoms/uiVariables/Strokes.stories.d.ts +18 -0
- package/dist/components/atoms/uiVariables/Strokes.stories.js +34 -0
- package/dist/components/molecules/appointmentSlot/AppointmentSlot.stories.d.ts +70 -0
- package/dist/components/molecules/appointmentSlot/AppointmentSlot.stories.js +186 -0
- package/dist/components/molecules/billingCount/BillingCount.stories.d.ts +21 -0
- package/dist/components/molecules/billingCount/BillingCount.stories.js +44 -0
- package/dist/components/molecules/blogCard/BlogCard.d.ts +13 -0
- package/dist/components/molecules/blogCard/BlogCard.js +33 -0
- package/dist/components/molecules/blogCard/BlogCard.module.css +148 -0
- package/dist/components/molecules/blogCard/BlogCard.stories.d.ts +10 -0
- package/dist/components/molecules/blogCard/BlogCard.stories.js +33 -0
- package/dist/components/molecules/blogCard/index.d.ts +2 -0
- package/dist/components/molecules/blogCard/index.js +1 -0
- package/dist/components/molecules/blogFooter/BlogFooter.d.ts +12 -0
- package/dist/components/molecules/blogFooter/BlogFooter.js +14 -0
- package/dist/components/molecules/blogFooter/BlogFooter.module.css +48 -0
- package/dist/components/molecules/blogFooter/BlogFooter.stories.d.ts +60 -0
- package/dist/components/molecules/blogFooter/BlogFooter.stories.js +67 -0
- package/dist/components/molecules/blogFooter/index.d.ts +2 -0
- package/dist/components/molecules/blogFooter/index.js +1 -0
- package/dist/components/molecules/blogHeader/BlogHeader.d.ts +11 -0
- package/dist/components/molecules/blogHeader/BlogHeader.js +21 -0
- package/dist/components/molecules/blogHeader/BlogHeader.module.css +150 -0
- package/dist/components/molecules/blogHeader/BlogHeader.stories.d.ts +49 -0
- package/dist/components/molecules/blogHeader/BlogHeader.stories.js +63 -0
- package/dist/components/molecules/blogHeader/index.d.ts +2 -0
- package/dist/components/molecules/blogHeader/index.js +1 -0
- package/dist/components/molecules/blogText/BlogText.d.ts +7 -0
- package/dist/components/molecules/blogText/BlogText.js +11 -0
- package/dist/components/molecules/blogText/BlogText.module.css +59 -0
- package/dist/components/molecules/blogText/BlogText.stories.d.ts +31 -0
- package/dist/components/molecules/blogText/BlogText.stories.js +51 -0
- package/dist/components/molecules/blogText/index.d.ts +2 -0
- package/dist/components/molecules/blogText/index.js +1 -0
- package/dist/components/molecules/blogTextImageBlock/BlogTextImageBlock.d.ts +8 -0
- package/dist/components/molecules/blogTextImageBlock/BlogTextImageBlock.js +15 -0
- package/dist/components/molecules/blogTextImageBlock/BlogTextImageBlock.module.css +108 -0
- package/dist/components/molecules/blogTextImageBlock/BlogTextImageBlock.stories.d.ts +37 -0
- package/dist/components/molecules/blogTextImageBlock/BlogTextImageBlock.stories.js +58 -0
- package/dist/components/molecules/blogTextImageBlock/index.d.ts +2 -0
- package/dist/components/molecules/blogTextImageBlock/index.js +1 -0
- package/dist/components/molecules/breadcrumb/Breadcrumb.stories.d.ts +24 -0
- package/dist/components/molecules/breadcrumb/Breadcrumb.stories.js +54 -0
- package/dist/components/molecules/caseCard/CaseCard.stories.d.ts +114 -0
- package/dist/components/molecules/caseCard/CaseCard.stories.js +200 -0
- package/dist/components/molecules/caseCardCompact/CaseCardCompact.js +2 -1
- package/dist/components/molecules/caseCardCompact/CaseCardCompact.stories.d.ts +11 -0
- package/dist/components/molecules/caseCardCompact/CaseCardCompact.stories.js +59 -0
- package/dist/components/molecules/caseCardCompact/caseCardCompact.css +5 -2
- package/dist/components/molecules/caseLinkCard/CaseCardLink.stories.d.ts +9 -0
- package/dist/components/molecules/caseLinkCard/CaseCardLink.stories.js +37 -0
- package/dist/components/molecules/caseLinkCard/CaseLinkCard.css +2 -4
- package/dist/components/molecules/checkboxForm/CheckboxForm.d.ts +1 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.js +2 -2
- package/dist/components/molecules/checkboxForm/CheckboxForm.stories.d.ts +90 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.stories.js +149 -0
- package/dist/components/molecules/clientLinkCard/ClientLinkCard.stories.d.ts +11 -0
- package/dist/components/molecules/clientLinkCard/ClientLinkCard.stories.js +59 -0
- package/dist/components/molecules/contactCard/ContactCard.d.ts +3 -2
- package/dist/components/molecules/contactCard/ContactCard.js +23 -24
- package/dist/components/molecules/contactCard/ContactCard.stories.d.ts +68 -0
- package/dist/components/molecules/contactCard/ContactCard.stories.js +80 -0
- package/dist/components/molecules/contactCard/DetailedContactCard.stories.d.ts +94 -0
- package/dist/components/molecules/contactCard/DetailedContactCard.stories.js +83 -0
- package/dist/components/molecules/contactCard/{ContactCard.css → contactCard.module.css} +34 -28
- package/dist/components/molecules/datepickerForm/DatepickerForm.stories.d.ts +164 -0
- package/dist/components/molecules/datepickerForm/DatepickerForm.stories.js +113 -0
- package/dist/components/molecules/documentCard/DocumentCard.css +4 -1
- package/dist/components/molecules/documentCard/DocumentCard.d.ts +3 -2
- package/dist/components/molecules/documentCard/DocumentCard.js +45 -7
- package/dist/components/molecules/documentCard/DocumentCard.stories.d.ts +71 -0
- package/dist/components/molecules/documentCard/DocumentCard.stories.js +100 -0
- package/dist/components/molecules/employeeCard/EmployeeCard.stories.d.ts +74 -0
- package/dist/components/molecules/employeeCard/EmployeeCard.stories.js +65 -0
- package/dist/components/molecules/loadingBox/LoadingBox.stories.d.ts +54 -0
- package/dist/components/molecules/loadingBox/LoadingBox.stories.js +128 -0
- package/dist/components/molecules/pagination/Pagination.stories.d.ts +44 -0
- package/dist/components/molecules/pagination/Pagination.stories.js +59 -0
- package/dist/components/molecules/proCard/ProCard.js +0 -4
- package/dist/components/molecules/proCard/ProCard.stories.d.ts +49 -0
- package/dist/components/molecules/proCard/ProCard.stories.js +69 -0
- package/dist/components/molecules/radioForm/RadioForm.stories.d.ts +27 -0
- package/dist/components/molecules/radioForm/RadioForm.stories.js +52 -0
- package/dist/components/molecules/selectForm/SelectForm.stories.d.ts +58 -0
- package/dist/components/molecules/selectForm/SelectForm.stories.js +96 -0
- package/dist/components/molecules/stepper/Stepper.css +17 -4
- package/dist/components/molecules/stepper/Stepper.stories.d.ts +42 -0
- package/dist/components/molecules/stepper/Stepper.stories.js +132 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +8 -1
- package/dist/stories/Header.d.ts +13 -0
- package/dist/stories/Header.js +20 -0
- package/dist/stories/Header.stories.d.ts +18 -0
- package/dist/stories/Header.stories.js +26 -0
- package/dist/stories/Page.d.ts +3 -0
- package/dist/stories/Page.js +37 -0
- package/dist/stories/Page.stories.d.ts +12 -0
- package/dist/stories/Page.stories.js +76 -0
- package/dist/stories/header.css +32 -0
- package/dist/stories/page.css +69 -0
- package/dist/styles/colors.css +2 -0
- package/dist/styles/colors.module.css +107 -0
- package/dist/styles/icons.css +76 -107
- package/package.json +16 -14
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./OtherStatusTag.css";
|
|
3
3
|
var OtherStatusTag = function (_a) {
|
|
4
|
-
var _b = _a.label, label = _b === void 0 ? "Tags" : _b, _c = _a.type, type = _c === void 0 ? "readonly" : _c, _d = _a.startIcon, startIcon = _d === void 0 ? false : _d, _e = _a.startIconName, startIconName = _e === void 0 ? "allaw-icon-pmr" : _e, labelLimit = _a.labelLimit, _f = _a.style, style = _f === void 0 ? "normal" : _f;
|
|
4
|
+
var _b = _a.label, label = _b === void 0 ? "Tags" : _b, _c = _a.type, type = _c === void 0 ? "readonly" : _c, _d = _a.startIcon, startIcon = _d === void 0 ? false : _d, _e = _a.startIconName, startIconName = _e === void 0 ? "allaw-icon-pmr" : _e, labelLimit = _a.labelLimit, _f = _a.style, style = _f === void 0 ? "normal" : _f, _g = _a.informationColor, informationColor = _g === void 0 ? "blue" : _g;
|
|
5
5
|
var truncateText = function (text, limit) {
|
|
6
6
|
if (!limit || text.length <= limit)
|
|
7
7
|
return text;
|
|
8
8
|
return "".concat(text.slice(0, limit), "...");
|
|
9
9
|
};
|
|
10
|
-
return (React.createElement("div", { className: "other-status-tag ".concat(type, " ").concat(style) },
|
|
10
|
+
return (React.createElement("div", { className: "other-status-tag ".concat(type, " ").concat(style, " ").concat(type === "information" ? "information-color-".concat(informationColor) : "") },
|
|
11
11
|
type === "information" && startIcon && (React.createElement("span", { className: "icon ".concat(startIconName) })),
|
|
12
12
|
React.createElement("span", { className: "other-status-tag-label", title: label }, truncateText(label, labelLimit)),
|
|
13
13
|
type === "editable" && React.createElement("span", { className: "icon allaw-icon-close" })));
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let title: string;
|
|
3
|
+
export { OtherStatusTag as component };
|
|
4
|
+
export let tags: string[];
|
|
5
|
+
export namespace argTypes {
|
|
6
|
+
export namespace label {
|
|
7
|
+
namespace control {
|
|
8
|
+
let type: string;
|
|
9
|
+
}
|
|
10
|
+
let description: string;
|
|
11
|
+
}
|
|
12
|
+
export namespace type_1 {
|
|
13
|
+
export namespace control_1 {
|
|
14
|
+
let type_2: string;
|
|
15
|
+
export { type_2 as type };
|
|
16
|
+
export let options: string[];
|
|
17
|
+
}
|
|
18
|
+
export { control_1 as control };
|
|
19
|
+
let description_1: string;
|
|
20
|
+
export { description_1 as description };
|
|
21
|
+
}
|
|
22
|
+
export { type_1 as type };
|
|
23
|
+
export namespace startIcon {
|
|
24
|
+
export namespace control_2 {
|
|
25
|
+
let type_3: string;
|
|
26
|
+
export { type_3 as type };
|
|
27
|
+
}
|
|
28
|
+
export { control_2 as control };
|
|
29
|
+
let description_2: string;
|
|
30
|
+
export { description_2 as description };
|
|
31
|
+
}
|
|
32
|
+
export namespace startIconName {
|
|
33
|
+
export namespace control_3 {
|
|
34
|
+
let type_4: string;
|
|
35
|
+
export { type_4 as type };
|
|
36
|
+
}
|
|
37
|
+
export { control_3 as control };
|
|
38
|
+
let description_3: string;
|
|
39
|
+
export { description_3 as description };
|
|
40
|
+
}
|
|
41
|
+
export namespace labelLimit {
|
|
42
|
+
export namespace control_4 {
|
|
43
|
+
let type_5: string;
|
|
44
|
+
export { type_5 as type };
|
|
45
|
+
}
|
|
46
|
+
export { control_4 as control };
|
|
47
|
+
let description_4: string;
|
|
48
|
+
export { description_4 as description };
|
|
49
|
+
}
|
|
50
|
+
export namespace style {
|
|
51
|
+
export namespace control_5 {
|
|
52
|
+
let type_6: string;
|
|
53
|
+
export { type_6 as type };
|
|
54
|
+
let options_1: string[];
|
|
55
|
+
export { options_1 as options };
|
|
56
|
+
}
|
|
57
|
+
export { control_5 as control };
|
|
58
|
+
let description_5: string;
|
|
59
|
+
export { description_5 as description };
|
|
60
|
+
export let defaultValue: string;
|
|
61
|
+
}
|
|
62
|
+
export namespace informationColor {
|
|
63
|
+
export namespace control_6 {
|
|
64
|
+
let type_7: string;
|
|
65
|
+
export { type_7 as type };
|
|
66
|
+
let options_2: string[];
|
|
67
|
+
export { options_2 as options };
|
|
68
|
+
}
|
|
69
|
+
export { control_6 as control };
|
|
70
|
+
let description_6: string;
|
|
71
|
+
export { description_6 as description };
|
|
72
|
+
let defaultValue_1: string;
|
|
73
|
+
export { defaultValue_1 as defaultValue };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export namespace parameters {
|
|
77
|
+
namespace backgrounds {
|
|
78
|
+
let _default: string;
|
|
79
|
+
export { _default as default };
|
|
80
|
+
export let values: {
|
|
81
|
+
name: string;
|
|
82
|
+
value: string;
|
|
83
|
+
}[];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export default _default;
|
|
88
|
+
export const ReadOnly: any;
|
|
89
|
+
export const Editable: any;
|
|
90
|
+
export const Information: any;
|
|
91
|
+
export const LongLabel: any;
|
|
92
|
+
export const LongLabelWithoutLimit: any;
|
|
93
|
+
export const ReadOnlyCompact: any;
|
|
94
|
+
export const EditableCompact: any;
|
|
95
|
+
export const InformationCompact: any;
|
|
96
|
+
export const LongLabelCompact: any;
|
|
97
|
+
import OtherStatusTag from "./OtherStatusTag";
|
|
@@ -0,0 +1,151 @@
|
|
|
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 React from "react";
|
|
13
|
+
import OtherStatusTag from "./OtherStatusTag";
|
|
14
|
+
import "../../../styles/global.css";
|
|
15
|
+
export default {
|
|
16
|
+
title: "Components/Atoms/Tags/OtherStatusTag",
|
|
17
|
+
component: OtherStatusTag,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
argTypes: {
|
|
20
|
+
label: {
|
|
21
|
+
control: {
|
|
22
|
+
type: "text",
|
|
23
|
+
},
|
|
24
|
+
description: "Texte à afficher dans le tag",
|
|
25
|
+
},
|
|
26
|
+
type: {
|
|
27
|
+
control: {
|
|
28
|
+
type: "select",
|
|
29
|
+
options: ["readonly", "editable", "information"],
|
|
30
|
+
},
|
|
31
|
+
description: "Type de tag à afficher",
|
|
32
|
+
},
|
|
33
|
+
startIcon: {
|
|
34
|
+
control: {
|
|
35
|
+
type: "boolean",
|
|
36
|
+
},
|
|
37
|
+
description: "Afficher une icône au début",
|
|
38
|
+
},
|
|
39
|
+
startIconName: {
|
|
40
|
+
control: {
|
|
41
|
+
type: "text",
|
|
42
|
+
},
|
|
43
|
+
description: "Nom de l'icône à afficher",
|
|
44
|
+
},
|
|
45
|
+
labelLimit: {
|
|
46
|
+
control: {
|
|
47
|
+
type: "number",
|
|
48
|
+
},
|
|
49
|
+
description: "Nombre maximum de caractères avant troncature",
|
|
50
|
+
},
|
|
51
|
+
style: {
|
|
52
|
+
control: {
|
|
53
|
+
type: "select",
|
|
54
|
+
options: ["normal", "compact"],
|
|
55
|
+
},
|
|
56
|
+
description: "Style du tag (normal ou compact)",
|
|
57
|
+
defaultValue: "normal",
|
|
58
|
+
},
|
|
59
|
+
informationColor: {
|
|
60
|
+
control: {
|
|
61
|
+
type: "select",
|
|
62
|
+
options: ["blue", "green", "red", "orange"],
|
|
63
|
+
},
|
|
64
|
+
description: "Couleur du tag d'information",
|
|
65
|
+
defaultValue: "blue",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
parameters: {
|
|
69
|
+
backgrounds: {
|
|
70
|
+
default: "light",
|
|
71
|
+
values: [
|
|
72
|
+
{ name: "light", value: "#ffffff" },
|
|
73
|
+
{ name: "grey", value: "#728ea7" },
|
|
74
|
+
{ name: "figma", value: "#404040" },
|
|
75
|
+
{ name: "dark", value: "#171e25" },
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
var Template = function (args) { return React.createElement(OtherStatusTag, __assign({}, args)); };
|
|
81
|
+
export var ReadOnly = Template.bind({});
|
|
82
|
+
ReadOnly.args = {
|
|
83
|
+
label: "Tags",
|
|
84
|
+
type: "readonly",
|
|
85
|
+
startIcon: false,
|
|
86
|
+
startIconName: "allaw-icon-pmr",
|
|
87
|
+
};
|
|
88
|
+
export var Editable = Template.bind({});
|
|
89
|
+
Editable.args = {
|
|
90
|
+
label: "Tags",
|
|
91
|
+
type: "editable",
|
|
92
|
+
startIcon: false,
|
|
93
|
+
startIconName: "allaw-icon-pmr",
|
|
94
|
+
};
|
|
95
|
+
export var Information = Template.bind({});
|
|
96
|
+
Information.args = {
|
|
97
|
+
label: "Informations",
|
|
98
|
+
type: "information",
|
|
99
|
+
startIcon: true,
|
|
100
|
+
startIconName: "allaw-icon-pmr",
|
|
101
|
+
informationColor: "blue",
|
|
102
|
+
};
|
|
103
|
+
export var LongLabel = Template.bind({});
|
|
104
|
+
LongLabel.args = {
|
|
105
|
+
label: "Un très long label qui sera tronqué automatiquement",
|
|
106
|
+
type: "readonly",
|
|
107
|
+
labelLimit: 20,
|
|
108
|
+
};
|
|
109
|
+
export var LongLabelWithoutLimit = Template.bind({});
|
|
110
|
+
LongLabelWithoutLimit.args = {
|
|
111
|
+
label: "Un très long label qui ne sera pas tronqué",
|
|
112
|
+
type: "readonly",
|
|
113
|
+
};
|
|
114
|
+
// Documentation supplémentaire
|
|
115
|
+
LongLabel.parameters = {
|
|
116
|
+
docs: {
|
|
117
|
+
description: {
|
|
118
|
+
story: "Exemple avec un label long et une limite de caractères",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
LongLabelWithoutLimit.parameters = {
|
|
123
|
+
docs: {
|
|
124
|
+
description: {
|
|
125
|
+
story: "Exemple avec un label long sans limite de caractères",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
export var ReadOnlyCompact = Template.bind({});
|
|
130
|
+
ReadOnlyCompact.args = __assign(__assign({}, ReadOnly.args), { style: "compact" });
|
|
131
|
+
export var EditableCompact = Template.bind({});
|
|
132
|
+
EditableCompact.args = __assign(__assign({}, Editable.args), { style: "compact" });
|
|
133
|
+
export var InformationCompact = Template.bind({});
|
|
134
|
+
InformationCompact.args = __assign(__assign({}, Information.args), { style: "compact" });
|
|
135
|
+
export var LongLabelCompact = Template.bind({});
|
|
136
|
+
LongLabelCompact.args = __assign(__assign({}, LongLabel.args), { style: "compact" });
|
|
137
|
+
// Documentation pour les variantes compactes
|
|
138
|
+
ReadOnlyCompact.parameters = {
|
|
139
|
+
docs: {
|
|
140
|
+
description: {
|
|
141
|
+
story: "Version compacte du tag en lecture seule",
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
EditableCompact.parameters = {
|
|
146
|
+
docs: {
|
|
147
|
+
description: {
|
|
148
|
+
story: "Version compacte du tag éditable",
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let title: string;
|
|
3
|
+
export { CardDate as component };
|
|
4
|
+
export let tags: string[];
|
|
5
|
+
export namespace parameters {
|
|
6
|
+
let componentSubtitle: string;
|
|
7
|
+
namespace docs {
|
|
8
|
+
namespace description {
|
|
9
|
+
let component: string;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
namespace backgrounds {
|
|
13
|
+
let _default: string;
|
|
14
|
+
export { _default as default };
|
|
15
|
+
export let values: {
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export namespace argTypes {
|
|
22
|
+
namespace date {
|
|
23
|
+
export let control: string;
|
|
24
|
+
let description_1: string;
|
|
25
|
+
export { description_1 as description };
|
|
26
|
+
export namespace table {
|
|
27
|
+
namespace type {
|
|
28
|
+
let summary: string;
|
|
29
|
+
}
|
|
30
|
+
namespace defaultValue {
|
|
31
|
+
let summary_1: string;
|
|
32
|
+
export { summary_1 as summary };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
namespace showYear {
|
|
37
|
+
let control_1: string;
|
|
38
|
+
export { control_1 as control };
|
|
39
|
+
let description_2: string;
|
|
40
|
+
export { description_2 as description };
|
|
41
|
+
export namespace table_1 {
|
|
42
|
+
export namespace type_1 {
|
|
43
|
+
let summary_2: string;
|
|
44
|
+
export { summary_2 as summary };
|
|
45
|
+
}
|
|
46
|
+
export { type_1 as type };
|
|
47
|
+
export namespace defaultValue_1 {
|
|
48
|
+
let summary_3: boolean;
|
|
49
|
+
export { summary_3 as summary };
|
|
50
|
+
}
|
|
51
|
+
export { defaultValue_1 as defaultValue };
|
|
52
|
+
}
|
|
53
|
+
export { table_1 as table };
|
|
54
|
+
}
|
|
55
|
+
namespace variant {
|
|
56
|
+
let control_2: string;
|
|
57
|
+
export { control_2 as control };
|
|
58
|
+
export let options: string[];
|
|
59
|
+
let description_3: string;
|
|
60
|
+
export { description_3 as description };
|
|
61
|
+
export namespace table_2 {
|
|
62
|
+
export namespace type_2 {
|
|
63
|
+
let summary_4: string;
|
|
64
|
+
export { summary_4 as summary };
|
|
65
|
+
}
|
|
66
|
+
export { type_2 as type };
|
|
67
|
+
export namespace defaultValue_2 {
|
|
68
|
+
let summary_5: string;
|
|
69
|
+
export { summary_5 as summary };
|
|
70
|
+
}
|
|
71
|
+
export { defaultValue_2 as defaultValue };
|
|
72
|
+
}
|
|
73
|
+
export { table_2 as table };
|
|
74
|
+
}
|
|
75
|
+
namespace label {
|
|
76
|
+
let control_3: string;
|
|
77
|
+
export { control_3 as control };
|
|
78
|
+
let description_4: string;
|
|
79
|
+
export { description_4 as description };
|
|
80
|
+
export namespace table_3 {
|
|
81
|
+
export namespace type_3 {
|
|
82
|
+
let summary_6: string;
|
|
83
|
+
export { summary_6 as summary };
|
|
84
|
+
}
|
|
85
|
+
export { type_3 as type };
|
|
86
|
+
export namespace defaultValue_3 {
|
|
87
|
+
let summary_7: string;
|
|
88
|
+
export { summary_7 as summary };
|
|
89
|
+
}
|
|
90
|
+
export { defaultValue_3 as defaultValue };
|
|
91
|
+
}
|
|
92
|
+
export { table_3 as table };
|
|
93
|
+
}
|
|
94
|
+
namespace isDisabled {
|
|
95
|
+
let control_4: string;
|
|
96
|
+
export { control_4 as control };
|
|
97
|
+
let description_5: string;
|
|
98
|
+
export { description_5 as description };
|
|
99
|
+
export namespace table_4 {
|
|
100
|
+
export namespace type_4 {
|
|
101
|
+
let summary_8: string;
|
|
102
|
+
export { summary_8 as summary };
|
|
103
|
+
}
|
|
104
|
+
export { type_4 as type };
|
|
105
|
+
export namespace defaultValue_4 {
|
|
106
|
+
let summary_9: boolean;
|
|
107
|
+
export { summary_9 as summary };
|
|
108
|
+
}
|
|
109
|
+
export { defaultValue_4 as defaultValue };
|
|
110
|
+
}
|
|
111
|
+
export { table_4 as table };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export default _default;
|
|
116
|
+
export const Default: any;
|
|
117
|
+
export const DisabledHorizontal: any;
|
|
118
|
+
export const DisabledVertical: any;
|
|
119
|
+
import CardDate from "./CardDate";
|
|
@@ -0,0 +1,103 @@
|
|
|
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 React from "react";
|
|
13
|
+
import CardDate from "./CardDate";
|
|
14
|
+
import "../../../styles/global.css";
|
|
15
|
+
export default {
|
|
16
|
+
title: "Components/Atoms/typography/CardDate",
|
|
17
|
+
component: CardDate,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
parameters: {
|
|
20
|
+
componentSubtitle: "Composant d'affichage de date pour les cards",
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
component: "Un composant qui affiche une date formatée avec le jour de la semaine, le jour du mois, le mois et optionnellement l'année.",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
backgrounds: {
|
|
27
|
+
default: "light",
|
|
28
|
+
values: [
|
|
29
|
+
{ name: "light", value: "#ffffff" },
|
|
30
|
+
{ name: "grey", value: "#728ea7" },
|
|
31
|
+
{ name: "figma", value: "#404040" },
|
|
32
|
+
{ name: "dark", value: "#171e25" },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
argTypes: {
|
|
37
|
+
date: {
|
|
38
|
+
control: "text",
|
|
39
|
+
description: "Date au format ISO (ex: 2024-10-31)",
|
|
40
|
+
table: {
|
|
41
|
+
type: { summary: "string" },
|
|
42
|
+
defaultValue: { summary: "undefined" },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
showYear: {
|
|
46
|
+
control: "boolean",
|
|
47
|
+
description: "Afficher ou masquer l'année",
|
|
48
|
+
table: {
|
|
49
|
+
type: { summary: "boolean" },
|
|
50
|
+
defaultValue: { summary: true },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
variant: {
|
|
54
|
+
control: "select",
|
|
55
|
+
options: ["horizontal", "hybride", "vertical"], // Mise à jour des options
|
|
56
|
+
description: "Variante de style de la date",
|
|
57
|
+
table: {
|
|
58
|
+
type: { summary: "string" },
|
|
59
|
+
defaultValue: { summary: "hybride" },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
label: {
|
|
63
|
+
control: "text",
|
|
64
|
+
description: "Label à afficher avant la date",
|
|
65
|
+
table: {
|
|
66
|
+
type: { summary: "string" },
|
|
67
|
+
defaultValue: { summary: "undefined" },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
isDisabled: {
|
|
71
|
+
control: "boolean",
|
|
72
|
+
description: "Indique si le composant est désactivé",
|
|
73
|
+
table: {
|
|
74
|
+
type: { summary: "boolean" },
|
|
75
|
+
defaultValue: { summary: false },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
var Template = function (args) { return React.createElement(CardDate, __assign({}, args)); };
|
|
81
|
+
export var Default = Template.bind({});
|
|
82
|
+
Default.args = {
|
|
83
|
+
date: "2024-10-31",
|
|
84
|
+
showYear: true,
|
|
85
|
+
variant: "hybride",
|
|
86
|
+
};
|
|
87
|
+
export var DisabledHorizontal = Template.bind({});
|
|
88
|
+
DisabledHorizontal.args = {
|
|
89
|
+
date: "2024-10-31",
|
|
90
|
+
showYear: true,
|
|
91
|
+
variant: "horizontal",
|
|
92
|
+
label: "Clôturé le",
|
|
93
|
+
isDisabled: true, // Exemple avec isDisabled
|
|
94
|
+
};
|
|
95
|
+
export var DisabledVertical = Template.bind({});
|
|
96
|
+
DisabledVertical.args = {
|
|
97
|
+
date: "2024-10-31",
|
|
98
|
+
showYear: true,
|
|
99
|
+
variant: "vertical",
|
|
100
|
+
label: "Clôturé le",
|
|
101
|
+
isDisabled: true, // Exemple avec isDisabled
|
|
102
|
+
};
|
|
103
|
+
// Ajoutez d'autres histoires si nécessaire
|
|
@@ -2,6 +2,6 @@ import React from "react";
|
|
|
2
2
|
import "./Heading.css";
|
|
3
3
|
var Heading = function (_a) {
|
|
4
4
|
var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "pure-white" : _b, text = _a.text, _c = _a.align, align = _c === void 0 ? "center" : _c;
|
|
5
|
-
return React.createElement("span", { className: "heading ".concat(variant, " color-").concat(color, " align-").concat(align) }, text);
|
|
5
|
+
return (React.createElement("span", { className: "heading ".concat(variant, " color-").concat(color, " align-").concat(align) }, text));
|
|
6
6
|
};
|
|
7
7
|
export default Heading;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let title: string;
|
|
3
|
+
export { Heading as component };
|
|
4
|
+
export let tags: string[];
|
|
5
|
+
export namespace argTypes {
|
|
6
|
+
namespace variant {
|
|
7
|
+
namespace control {
|
|
8
|
+
let type: string;
|
|
9
|
+
let options: string[];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
namespace color {
|
|
13
|
+
export namespace control_1 {
|
|
14
|
+
let type_1: string;
|
|
15
|
+
export { type_1 as type };
|
|
16
|
+
let options_1: string[];
|
|
17
|
+
export { options_1 as options };
|
|
18
|
+
}
|
|
19
|
+
export { control_1 as control };
|
|
20
|
+
}
|
|
21
|
+
namespace text {
|
|
22
|
+
let control_2: string;
|
|
23
|
+
export { control_2 as control };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export namespace parameters {
|
|
27
|
+
namespace backgrounds {
|
|
28
|
+
let _default: string;
|
|
29
|
+
export { _default as default };
|
|
30
|
+
export let values: {
|
|
31
|
+
name: string;
|
|
32
|
+
value: string;
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export default _default;
|
|
38
|
+
export const H1: any;
|
|
39
|
+
export const H2: any;
|
|
40
|
+
export const H3: any;
|
|
41
|
+
export const H4: any;
|
|
42
|
+
export const H5: any;
|
|
43
|
+
export const H6: any;
|
|
44
|
+
export const H7: any;
|
|
45
|
+
import Heading from "./Heading";
|
|
@@ -0,0 +1,90 @@
|
|
|
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 React from "react";
|
|
13
|
+
import Heading from "./Heading";
|
|
14
|
+
import "../../../styles/global.css";
|
|
15
|
+
export default {
|
|
16
|
+
title: "Components/UI-Variables/Typography/Heading",
|
|
17
|
+
component: Heading,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
argTypes: {
|
|
20
|
+
variant: {
|
|
21
|
+
control: {
|
|
22
|
+
type: "select",
|
|
23
|
+
options: ["h1", "h2", "h3", "h4", "h5", "h6", "h7"],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
color: {
|
|
27
|
+
control: {
|
|
28
|
+
type: "select",
|
|
29
|
+
options: ["bleu-allaw", "mid-grey", "dark-grey", "noir", "pure-white"],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
text: {
|
|
33
|
+
control: "text",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
parameters: {
|
|
37
|
+
backgrounds: {
|
|
38
|
+
default: "light",
|
|
39
|
+
values: [
|
|
40
|
+
{ name: "light", value: "#ffffff" },
|
|
41
|
+
{ name: "grey", value: "#728ea7" },
|
|
42
|
+
{ name: "figma", value: "#404040" },
|
|
43
|
+
{ name: "dark", value: "#171e25" },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
var Template = function (args) { return React.createElement(Heading, __assign({}, args)); };
|
|
49
|
+
export var H1 = Template.bind({});
|
|
50
|
+
H1.args = {
|
|
51
|
+
variant: "h1",
|
|
52
|
+
color: "pure-white",
|
|
53
|
+
text: "Poppins – SemiBold – 60px",
|
|
54
|
+
};
|
|
55
|
+
export var H2 = Template.bind({});
|
|
56
|
+
H2.args = {
|
|
57
|
+
variant: "h2",
|
|
58
|
+
color: "pure-white",
|
|
59
|
+
text: "Poppins – SemiBold – 36px",
|
|
60
|
+
};
|
|
61
|
+
export var H3 = Template.bind({});
|
|
62
|
+
H3.args = {
|
|
63
|
+
variant: "h3",
|
|
64
|
+
color: "pure-white",
|
|
65
|
+
text: "Poppins – SemiBold – 28px",
|
|
66
|
+
};
|
|
67
|
+
export var H4 = Template.bind({});
|
|
68
|
+
H4.args = {
|
|
69
|
+
variant: "h4",
|
|
70
|
+
color: "pure-white",
|
|
71
|
+
text: "Poppins – SemiBold – 24px",
|
|
72
|
+
};
|
|
73
|
+
export var H5 = Template.bind({});
|
|
74
|
+
H5.args = {
|
|
75
|
+
variant: "h5",
|
|
76
|
+
color: "pure-white",
|
|
77
|
+
text: "Poppins – Medium – 24px",
|
|
78
|
+
};
|
|
79
|
+
export var H6 = Template.bind({});
|
|
80
|
+
H6.args = {
|
|
81
|
+
variant: "h6",
|
|
82
|
+
color: "pure-white",
|
|
83
|
+
text: "Poppins – SemiBold – 18px",
|
|
84
|
+
};
|
|
85
|
+
export var H7 = Template.bind({});
|
|
86
|
+
H7.args = {
|
|
87
|
+
variant: "h7",
|
|
88
|
+
color: "pure-white",
|
|
89
|
+
text: "Poppins – SemiBold – 14px",
|
|
90
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface LinkProps {
|
|
3
|
+
variant: "bold" | "semiBold" | "medium";
|
|
4
|
+
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white" | "grey-venom" | "venom-grey-dark";
|
|
5
|
+
text: React.ReactNode;
|
|
6
|
+
maxLines?: number;
|
|
7
|
+
maxChars?: number;
|
|
8
|
+
size?: "default" | "small";
|
|
9
|
+
className?: string;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const Link: React.FC<LinkProps>;
|
|
13
|
+
export default Link;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 React from "react";
|
|
13
|
+
import styles from "./Link.module.css";
|
|
14
|
+
import { convertToHtml } from "../../../utils/utils";
|
|
15
|
+
var Link = function (_a) {
|
|
16
|
+
var variant = _a.variant, color = _a.color, text = _a.text, maxLines = _a.maxLines, maxChars = _a.maxChars, _b = _a.size, size = _b === void 0 ? "default" : _b, className = _a.className, onClick = _a.onClick;
|
|
17
|
+
var truncateText = function (text, maxChars) {
|
|
18
|
+
if (text.length <= maxChars)
|
|
19
|
+
return text;
|
|
20
|
+
return text.slice(0, maxChars) + "...";
|
|
21
|
+
};
|
|
22
|
+
var htmlText = convertToHtml(text);
|
|
23
|
+
var truncatedText = maxChars ? truncateText(htmlText, maxChars) : htmlText;
|
|
24
|
+
var isClickable = typeof onClick === "function";
|
|
25
|
+
var colorClassName = color ? "color-".concat(color) : "";
|
|
26
|
+
return (React.createElement("div", { className: "".concat(styles.link, " ").concat(styles[variant], " ").concat(size === "small" ? styles["link-small"] : "", " ").concat(className || "", " ").concat(isClickable ? styles.pointer : "", " ").concat(styles[colorClassName]), style: __assign({ whiteSpace: "pre-line" }, (maxLines
|
|
27
|
+
? {
|
|
28
|
+
WebkitLineClamp: maxLines,
|
|
29
|
+
display: "-webkit-box",
|
|
30
|
+
WebkitBoxOrient: "vertical",
|
|
31
|
+
overflow: "hidden",
|
|
32
|
+
}
|
|
33
|
+
: {})), onClick: onClick, dangerouslySetInnerHTML: { __html: truncatedText } }));
|
|
34
|
+
};
|
|
35
|
+
export default Link;
|