allaw-ui 2.9.4 → 2.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/datepickers/Datepicker.d.ts +1 -0
- package/dist/components/atoms/datepickers/Datepicker.js +6 -6
- package/dist/components/atoms/typography/Heading.js +1 -1
- package/dist/components/atoms/typography/Heading.stories.d.ts +1 -0
- package/dist/components/atoms/typography/Heading.stories.js +9 -1
- package/package.json +1 -1
|
@@ -48,13 +48,13 @@ var CustomInput = forwardRef(function (_a, ref) {
|
|
|
48
48
|
});
|
|
49
49
|
CustomInput.displayName = "CustomInput";
|
|
50
50
|
var Datepicker = function (_a) {
|
|
51
|
-
var value = _a.value, onChange = _a.onChange, _b = _a.placeholder, placeholder = _b === void 0 ? "Sélectionner une date" : _b, _c = _a.yearDropdownItemNumber, yearDropdownItemNumber = _c === void 0 ? 10 : _c, maxDaysInPast = _a.maxDaysInPast, minDate = _a.minDate;
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
51
|
+
var value = _a.value, onChange = _a.onChange, _b = _a.placeholder, placeholder = _b === void 0 ? "Sélectionner une date" : _b, _c = _a.yearDropdownItemNumber, yearDropdownItemNumber = _c === void 0 ? 10 : _c, maxDaysInPast = _a.maxDaysInPast, minDate = _a.minDate, _d = _a.disableFutur, disableFutur = _d === void 0 ? true : _d;
|
|
52
|
+
var _e = useState(value), selectedDate = _e[0], setSelectedDate = _e[1];
|
|
53
|
+
var _f = useState(false), isOpen = _f[0], setIsOpen = _f[1];
|
|
54
|
+
var _g = useState({ top: 0, left: 0 }), position = _g[0], setPosition = _g[1];
|
|
55
55
|
var buttonRef = useRef(null);
|
|
56
56
|
var calendarRef = useRef(null);
|
|
57
|
-
var
|
|
57
|
+
var _h = useState("bottom"), placement = _h[0], setPlacement = _h[1];
|
|
58
58
|
useEffect(function () {
|
|
59
59
|
setSelectedDate(value);
|
|
60
60
|
}, [value]);
|
|
@@ -146,6 +146,6 @@ var Datepicker = function (_a) {
|
|
|
146
146
|
ReactDOM.createPortal(React.createElement("div", { ref: calendarRef, className: "datepicker-portal ".concat(placement), style: __assign({ left: "".concat(position.left, "px") }, (placement === "bottom"
|
|
147
147
|
? { top: "".concat(position.top, "px") }
|
|
148
148
|
: { top: "".concat(position.top, "px") })) },
|
|
149
|
-
React.createElement(ReactDatePicker, { selected: selectedDate, onChange: handleDateChange, locale: fr, inline: true, dateFormat: "dd MMMM yyyy", calendarClassName: "custom-calendar", showMonthDropdown: true, showYearDropdown: true, dropdownMode: "select", maxDate: new Date(), minDate: calculatedMinDate })), document.body)));
|
|
149
|
+
React.createElement(ReactDatePicker, { selected: selectedDate, onChange: handleDateChange, locale: fr, inline: true, dateFormat: "dd MMMM yyyy", calendarClassName: "custom-calendar", showMonthDropdown: true, showYearDropdown: true, dropdownMode: "select", maxDate: disableFutur ? new Date() : undefined, minDate: calculatedMinDate })), document.body)));
|
|
150
150
|
};
|
|
151
151
|
export default Datepicker;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { useEffect, useState } from "react";
|
|
3
3
|
import "./Heading.css";
|
|
4
4
|
var Heading = function (_a) {
|
|
5
|
-
var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "pure-white" : _b, text = _a.text, _c = _a.align, align = _c === void 0 ? "
|
|
5
|
+
var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "pure-white" : _b, text = _a.text, _c = _a.align, align = _c === void 0 ? "left" : _c, responsiveSize = _a.responsiveSize, _d = _a.as, Component = _d === void 0 ? "span" : _d;
|
|
6
6
|
var _e = useState(variant), currentVariant = _e[0], setCurrentVariant = _e[1];
|
|
7
7
|
useEffect(function () {
|
|
8
8
|
if (!responsiveSize)
|
|
@@ -61,8 +61,8 @@ export default {
|
|
|
61
61
|
backgrounds: {
|
|
62
62
|
default: "light",
|
|
63
63
|
values: [
|
|
64
|
-
{ name: "light", value: "#ffffff" },
|
|
65
64
|
{ name: "grey", value: "#728ea7" },
|
|
65
|
+
{ name: "light", value: "#ffffff" },
|
|
66
66
|
{ name: "figma", value: "#404040" },
|
|
67
67
|
{ name: "dark", value: "#171e25" },
|
|
68
68
|
],
|
|
@@ -140,3 +140,11 @@ CustomElement.args = {
|
|
|
140
140
|
text: "This heading uses a paragraph tag",
|
|
141
141
|
as: "p",
|
|
142
142
|
};
|
|
143
|
+
export var CenteredHeading = Template.bind({});
|
|
144
|
+
CenteredHeading.args = {
|
|
145
|
+
variant: "h3",
|
|
146
|
+
color: "bleu-allaw",
|
|
147
|
+
text: "This heading is centered",
|
|
148
|
+
align: "center",
|
|
149
|
+
as: "h3",
|
|
150
|
+
};
|