arengibook 0.0.21 → 0.0.23

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.
Files changed (2) hide show
  1. package/dist/index.js +131 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,35 @@
1
1
  import React from 'react';
2
+ import { Calendar } from 'primereact/calendar';
3
+
4
+ function _extends() {
5
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
6
+ for (var e = 1; e < arguments.length; e++) {
7
+ var t = arguments[e];
8
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
9
+ }
10
+ return n;
11
+ }, _extends.apply(null, arguments);
12
+ }
13
+ function _objectWithoutProperties(e, t) {
14
+ if (null == e) return {};
15
+ var o,
16
+ r,
17
+ i = _objectWithoutPropertiesLoose(e, t);
18
+ if (Object.getOwnPropertySymbols) {
19
+ var n = Object.getOwnPropertySymbols(e);
20
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
21
+ }
22
+ return i;
23
+ }
24
+ function _objectWithoutPropertiesLoose(r, e) {
25
+ if (null == r) return {};
26
+ var t = {};
27
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
28
+ if (-1 !== e.indexOf(n)) continue;
29
+ t[n] = r[n];
30
+ }
31
+ return t;
32
+ }
2
33
 
3
34
  function getDefaultExportFromCjs (x) {
4
35
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -1194,17 +1225,108 @@ function requirePropTypes () {
1194
1225
  var propTypesExports = /*@__PURE__*/ requirePropTypes();
1195
1226
  var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
1196
1227
 
1197
- const Button = ({
1198
- label,
1199
- onClick
1200
- }) => {
1201
- return /*#__PURE__*/React.createElement("button", {
1202
- onClick: onClick
1203
- }, label);
1228
+ function styleInject(css, ref) {
1229
+ if ( ref === void 0 ) ref = {};
1230
+ var insertAt = ref.insertAt;
1231
+
1232
+ if (typeof document === 'undefined') { return; }
1233
+
1234
+ var head = document.head || document.getElementsByTagName('head')[0];
1235
+ var style = document.createElement('style');
1236
+ style.type = 'text/css';
1237
+
1238
+ if (insertAt === 'top') {
1239
+ if (head.firstChild) {
1240
+ head.insertBefore(style, head.firstChild);
1241
+ } else {
1242
+ head.appendChild(style);
1243
+ }
1244
+ } else {
1245
+ head.appendChild(style);
1246
+ }
1247
+
1248
+ if (style.styleSheet) {
1249
+ style.styleSheet.cssText = css;
1250
+ } else {
1251
+ style.appendChild(document.createTextNode(css));
1252
+ }
1253
+ }
1254
+
1255
+ var css_248z = ".storybook-button {\n display: inline-block;\n cursor: pointer;\n border: 0;\n border-radius: 3em;\n font-weight: 700;\n line-height: 1;\n font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n}\n.storybook-button--primary {\n background-color: #555ab9;\n color: white;\n}\n.storybook-button--secondary {\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;\n background-color: transparent;\n color: #333;\n}\n.storybook-button--small {\n padding: 10px 16px;\n font-size: 12px;\n}\n.storybook-button--medium {\n padding: 11px 20px;\n font-size: 14px;\n}\n.storybook-button--large {\n padding: 12px 24px;\n font-size: 16px;\n}\n";
1256
+ styleInject(css_248z);
1257
+
1258
+ const _excluded = ["primary", "backgroundColor", "borderRadius", "size", "label"];
1259
+
1260
+ /** Primary UI component for user interaction */
1261
+ const Button = _ref => {
1262
+ let {
1263
+ primary = false,
1264
+ backgroundColor = null,
1265
+ borderRadius = 10,
1266
+ size = 'medium',
1267
+ label
1268
+ } = _ref,
1269
+ props = _objectWithoutProperties(_ref, _excluded);
1270
+ const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
1271
+ return /*#__PURE__*/React.createElement("button", _extends({
1272
+ type: "button",
1273
+ className: ['storybook-button', `storybook-button--${size}`, mode].join(' '),
1274
+ style: {
1275
+ backgroundColor,
1276
+ borderRadius
1277
+ }
1278
+ }, props), label);
1204
1279
  };
1205
1280
  Button.propTypes = {
1281
+ /** Is this the principal call to action on the page? */
1282
+ primary: PropTypes.bool,
1283
+ /** What background color to use */
1284
+ backgroundColor: PropTypes.string,
1285
+ /** How large should the button be? */
1286
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
1287
+ /** Button contents */
1206
1288
  label: PropTypes.string.isRequired,
1207
- onClick: PropTypes.func
1289
+ /** Optional click handler */
1290
+ onClick: PropTypes.func,
1291
+ /** Je test mon border-radius */
1292
+ borderRadius: PropTypes.number
1293
+ };
1294
+
1295
+ const DatePicker = ({
1296
+ value,
1297
+ onChange,
1298
+ placeholder,
1299
+ dateFormat = "dd/mm/yy",
1300
+ view = 'date',
1301
+ invalid = false,
1302
+ errorMessage = '',
1303
+ disabled = false
1304
+ }) => {
1305
+ const style = {
1306
+ border: invalid ? '1px solid red' : '1px solid #ccc',
1307
+ padding: '0.5rem',
1308
+ borderRadius: '6px'
1309
+ };
1310
+ return /*#__PURE__*/React.createElement("div", {
1311
+ className: "flex flex-col gap-1"
1312
+ }, /*#__PURE__*/React.createElement(Calendar, {
1313
+ value: value,
1314
+ onChange: onChange,
1315
+ showIcon: true,
1316
+ placeholder: placeholder,
1317
+ dateFormat: dateFormat,
1318
+ inputStyle: style,
1319
+ view: view,
1320
+ disabled: disabled,
1321
+ showWeek: true,
1322
+ showTime: true,
1323
+ hourFormat: "24"
1324
+ }), invalid && /*#__PURE__*/React.createElement("small", {
1325
+ style: {
1326
+ color: 'red',
1327
+ fontStyle: 'italic'
1328
+ }
1329
+ }, errorMessage || 'Date invalide'));
1208
1330
  };
1209
1331
 
1210
- export { Button };
1332
+ export { Button, DatePicker };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "0.0.21",
4
+ "version": "0.0.23",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {