@bigbinary/neeto-molecules 3.16.38 → 3.16.39

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.
@@ -2,6 +2,7 @@
2
2
 
3
3
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
4
  var React = require('react');
5
+ var classnames = require('classnames');
5
6
  var Typography = require('@bigbinary/neetoui/Typography');
6
7
  var Alert = require('@bigbinary/neetoui/Alert');
7
8
  var Callout = require('@bigbinary/neetoui/Callout');
@@ -29,7 +30,6 @@ var axios = require('axios');
29
30
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
30
31
  var useMutationWithInvalidation = require('@bigbinary/neeto-commons-frontend/react-utils/useMutationWithInvalidation');
31
32
  var injectCss = require('./inject-css-vQvjPR2x.js');
32
- require('classnames');
33
33
  require('@bigbinary/neeto-cist');
34
34
 
35
35
  function _interopNamespaceDefault(e) {
@@ -3272,38 +3272,41 @@ var AllowedIpRange = withT(function (_ref) {
3272
3272
  index = _ref.index,
3273
3273
  arrayHelpers = _ref.arrayHelpers;
3274
3274
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
3275
- className: "neeto-ui-bg-white neeto-ui-rounded-lg grid grid-cols-2 gap-2 py-2 sm:grid-cols-12 sm:gap-4 sm:py-3",
3276
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
3277
- className: "col-span-1 text-left sm:col-span-4",
3278
- "data-cy": "ip-start-text-field",
3279
- label: t("neetoMolecules.ipRestriction.ipStart"),
3280
- labelProps: {
3281
- className: "sm:hidden"
3282
- },
3283
- name: "allowedIpRanges.".concat(index, ".ipStart"),
3284
- placeholder: t("neetoMolecules.ipRestriction.ipStart")
3285
- }), /*#__PURE__*/jsxRuntime.jsx(Input, {
3286
- className: "col-span-1 text-left sm:col-span-4",
3287
- "data-cy": "ip-end-text-field",
3288
- label: t("neetoMolecules.ipRestriction.ipEnd"),
3289
- labelProps: {
3290
- className: "sm:hidden"
3291
- },
3292
- name: "allowedIpRanges.".concat(index, ".ipEnd"),
3293
- placeholder: t("neetoMolecules.ipRestriction.ipEnd")
3294
- }), /*#__PURE__*/jsxRuntime.jsx(Select, {
3295
- className: "col-span-1 text-left sm:col-span-2",
3296
- "data-testid": "address-type-select-field",
3297
- label: t("neetoMolecules.ipRestriction.type"),
3298
- labelProps: {
3299
- className: "sm:hidden"
3300
- },
3301
- name: "allowedIpRanges.".concat(index, ".addressType"),
3302
- options: ADDRESS_TYPE_SELECT_OPTIONS
3275
+ className: "flex items-start gap-3",
3276
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
3277
+ className: "grid flex-grow grid-cols-1 gap-3 md:grid-cols-3",
3278
+ children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
3279
+ className: "text-left",
3280
+ "data-cy": "ip-start-text-field",
3281
+ label: t("neetoMolecules.ipRestriction.ipStart"),
3282
+ labelProps: {
3283
+ className: "md:hidden"
3284
+ },
3285
+ name: "allowedIpRanges.".concat(index, ".ipStart"),
3286
+ placeholder: t("neetoMolecules.ipRestriction.ipStart")
3287
+ }), /*#__PURE__*/jsxRuntime.jsx(Input, {
3288
+ className: "text-left",
3289
+ "data-cy": "ip-end-text-field",
3290
+ label: t("neetoMolecules.ipRestriction.ipEnd"),
3291
+ labelProps: {
3292
+ className: "md:hidden"
3293
+ },
3294
+ name: "allowedIpRanges.".concat(index, ".ipEnd"),
3295
+ placeholder: t("neetoMolecules.ipRestriction.ipEnd")
3296
+ }), /*#__PURE__*/jsxRuntime.jsx(Select, {
3297
+ className: "text-left",
3298
+ "data-testid": "address-type-select-field",
3299
+ label: t("neetoMolecules.ipRestriction.type"),
3300
+ labelProps: {
3301
+ className: "md:hidden"
3302
+ },
3303
+ name: "allowedIpRanges.".concat(index, ".addressType"),
3304
+ options: ADDRESS_TYPE_SELECT_OPTIONS
3305
+ })]
3303
3306
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
3304
- className: "col-span-1 flex items-start sm:col-span-2 sm:justify-center",
3307
+ className: "flex flex-shrink-0 justify-center md:min-w-14",
3305
3308
  children: /*#__PURE__*/jsxRuntime.jsx(Button, {
3306
- className: "mt-auto sm:mt-0",
3309
+ className: "mt-5 md:mt-0",
3307
3310
  "data-cy": "allowed-ip-range-delete-button",
3308
3311
  "data-testid": "allowed-ip-range-delete-btn",
3309
3312
  icon: Delete,
@@ -3324,48 +3327,57 @@ var AllowedIpRange = withT(function (_ref) {
3324
3327
  var AllowedIpRanges = withT(function (_ref) {
3325
3328
  var t = _ref.t;
3326
3329
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
3327
- className: "space-y-6",
3330
+ className: "space-y-5",
3328
3331
  "data-cy": "allowed-ip-range-container",
3329
3332
  children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
3330
3333
  "data-cy": "allowed-ip-range-heading",
3331
3334
  style: "h4",
3332
3335
  children: t("neetoMolecules.ipRestriction.allowedIpRangeTitle")
3333
3336
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3334
- className: "space-y-2",
3337
+ className: "space-y-3",
3335
3338
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
3336
- className: "hidden grid-cols-12 gap-4 sm:grid",
3337
- children: [/*#__PURE__*/jsxRuntime.jsxs(Typography, {
3338
- className: "neeto-ui-text-gray-700 col-span-4 uppercase",
3339
- style: "h6",
3340
- children: [t("neetoMolecules.ipRestriction.ipStart"), "*"]
3341
- }), /*#__PURE__*/jsxRuntime.jsxs(Typography, {
3342
- className: "neeto-ui-text-gray-700 col-span-4 uppercase",
3343
- style: "h6",
3344
- children: [t("neetoMolecules.ipRestriction.ipEnd"), "*"]
3345
- }), /*#__PURE__*/jsxRuntime.jsxs(Typography, {
3346
- className: "neeto-ui-text-gray-700 col-span-2 uppercase",
3347
- style: "h6",
3348
- children: [t("neetoMolecules.ipRestriction.type"), "*"]
3349
- }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
3350
- className: "neeto-ui-text-gray-700 col-span-2 text-center uppercase",
3351
- style: "h6",
3352
- children: t("neetoMolecules.ipRestriction.actions")
3339
+ className: "hidden gap-3 md:flex",
3340
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
3341
+ className: "grid flex-grow grid-cols-3 gap-3",
3342
+ children: [/*#__PURE__*/jsxRuntime.jsxs(Typography, {
3343
+ className: "neeto-ui-text-gray-700 uppercase",
3344
+ style: "h6",
3345
+ children: [t("neetoMolecules.ipRestriction.ipStart"), "*"]
3346
+ }), /*#__PURE__*/jsxRuntime.jsxs(Typography, {
3347
+ className: "neeto-ui-text-gray-700 uppercase",
3348
+ style: "h6",
3349
+ children: [t("neetoMolecules.ipRestriction.ipEnd"), "*"]
3350
+ }), /*#__PURE__*/jsxRuntime.jsxs(Typography, {
3351
+ className: "neeto-ui-text-gray-700 uppercase",
3352
+ style: "h6",
3353
+ children: [t("neetoMolecules.ipRestriction.type"), "*"]
3354
+ })]
3355
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
3356
+ className: "min-w-14 flex-shrink-0",
3357
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
3358
+ className: "neeto-ui-text-gray-700 text-center uppercase",
3359
+ style: "h6",
3360
+ children: t("neetoMolecules.ipRestriction.actions")
3361
+ })
3353
3362
  })]
3354
3363
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
3355
- className: "w-full space-y-2",
3364
+ className: "w-full space-y-6 md:space-y-4",
3356
3365
  children: /*#__PURE__*/jsxRuntime.jsx(formik.FieldArray, {
3357
3366
  name: "allowedIpRanges",
3358
3367
  children: function children(arrayHelpers) {
3359
3368
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
3360
3369
  children: [arrayHelpers.form.values.allowedIpRanges.map(function (allowedIpRange, index) {
3361
- return /*#__PURE__*/React.createElement(AllowedIpRange, {
3362
- allowedIpRange: allowedIpRange,
3363
- arrayHelpers: arrayHelpers,
3364
- index: index,
3365
- key: allowedIpRange.createdAt
3366
- });
3370
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
3371
+ className: "neeto-ui-border-gray-300 w-full border-b pb-6 last:border-none last:pb-0 md:border-none md:pb-0",
3372
+ children: /*#__PURE__*/React.createElement(AllowedIpRange, {
3373
+ allowedIpRange: allowedIpRange,
3374
+ arrayHelpers: arrayHelpers,
3375
+ index: index,
3376
+ key: allowedIpRange.createdAt
3377
+ })
3378
+ }, index);
3367
3379
  }), /*#__PURE__*/jsxRuntime.jsx(Button, {
3368
- className: "mt-2",
3380
+ className: "md:mt-2",
3369
3381
  "data-cy": "add-allowed-ip-range-button",
3370
3382
  icon: Plus,
3371
3383
  iconPosition: "left",
@@ -3581,7 +3593,9 @@ var IpRestriction = function IpRestriction() {
3581
3593
  })]
3582
3594
  }),
3583
3595
  children: [/*#__PURE__*/jsxRuntime.jsx(BlockNavigation, {}), /*#__PURE__*/jsxRuntime.jsxs("div", {
3584
- className: "nm-ip-restriction space-y-2",
3596
+ className: classnames("nm-ip-restriction space-y-2", {
3597
+ "pb-6": values.ipRestriction
3598
+ }),
3585
3599
  children: [/*#__PURE__*/jsxRuntime.jsx(Checkbox, {
3586
3600
  checked: values.ipRestriction,
3587
3601
  className: "flex-grow-0",
@@ -3601,7 +3615,7 @@ var IpRestriction = function IpRestriction() {
3601
3615
  children: t("neetoMolecules.ipRestriction.description")
3602
3616
  })]
3603
3617
  }), values.ipRestriction && /*#__PURE__*/jsxRuntime.jsxs("div", {
3604
- className: "neeto-ui-border-gray-300 mt-6 w-full space-y-6 border-t pt-6",
3618
+ className: "neeto-ui-border-gray-300 w-full space-y-6 border-t pt-6",
3605
3619
  children: [/*#__PURE__*/jsxRuntime.jsx(CurrentIp$1, {}), /*#__PURE__*/jsxRuntime.jsx(AllowedIpRanges$1, {}), /*#__PURE__*/jsxRuntime.jsx(Callout, {
3606
3620
  style: "warning",
3607
3621
  children: /*#__PURE__*/jsxRuntime.jsx("div", {