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.
@@ -9,6 +9,7 @@ export interface DatepickerProps {
9
9
  yearDropdownItemNumber?: number;
10
10
  maxDaysInPast?: number;
11
11
  minDate?: Date;
12
+ disableFutur?: Boolean;
12
13
  }
13
14
  declare const Datepicker: React.FC<DatepickerProps>;
14
15
  export default Datepicker;
@@ -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 _d = useState(value), selectedDate = _d[0], setSelectedDate = _d[1];
53
- var _e = useState(false), isOpen = _e[0], setIsOpen = _e[1];
54
- var _f = useState({ top: 0, left: 0 }), position = _f[0], setPosition = _f[1];
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 _g = useState("bottom"), placement = _g[0], setPlacement = _g[1];
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 ? "center" : _c, responsiveSize = _a.responsiveSize, _d = _a.as, Component = _d === void 0 ? "span" : _d;
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)
@@ -75,4 +75,5 @@ export const H6: any;
75
75
  export const H7: any;
76
76
  export const ResponsiveHeading: any;
77
77
  export const CustomElement: any;
78
+ export const CenteredHeading: any;
78
79
  import Heading from "./Heading";
@@ -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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "2.9.4",
3
+ "version": "2.9.6",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",