@arquimedes.co/eureka-forms 3.0.58 → 3.0.59-test

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.
@@ -6,6 +6,7 @@ import FormContext from '../../../../../Contexts/FormContext';
6
6
  import { useAppSelector } from '../../../../../hooks';
7
7
  import { useContext } from 'react';
8
8
  import DeleteIcon from '../../../../../Icons/DeleteIcon';
9
+ import { pillSurfaceStyle } from '../../../../../Utils/SurfaceStyle';
9
10
  function IncidentComponent({ step, incident, handleDelete, ...others }) {
10
11
  const { formStyle, postview } = useAppSelector((state) => state.global);
11
12
  const form = useContext(FormContext);
@@ -16,7 +17,7 @@ function IncidentComponent({ step, incident, handleDelete, ...others }) {
16
17
  if (incident.deleted) {
17
18
  return _jsx("div", {});
18
19
  }
19
- return (_jsx("div", { className: widthStats.isMobile || form.size.blockNum < 3 ? styles.mobileContainer : styles.container, children: _jsxs("div", { className: styles.contentContainer, style: {
20
+ return (_jsx("div", { className: widthStats.isMobile || form.size.blockNum < 3 ? styles.mobileContainer : styles.container, style: pillSurfaceStyle(formStyle), children: _jsxs("div", { className: styles.contentContainer, style: {
20
21
  width: (form.size.blockSize + form.size.spacingSize) * (form.size.blockNum - 1),
21
22
  }, children: [_jsxs("div", { className: styles.titleLbl, style: { color: formStyle.textColor }, children: [step.unitLabel + ' ' + incident.num, ":"] }), _jsx("div", { className: !others.editable || postview ? styles.disabledDeleteBtn : styles.deleteBtn, style: { color: formStyle.textColor }, onClick: () => {
22
23
  if (others.editable && !postview) {
@@ -1,7 +1,6 @@
1
1
  .container,
2
2
  .mobileContainer {
3
- background-color: #f0f0f0;
4
- border: 1px solid #d6d6d6;
3
+ border: 1px solid;
5
4
  width: fit-content;
6
5
  border-radius: 20px;
7
6
  margin-bottom: 10px;
@@ -10,6 +10,7 @@ import DeleteIcon from '../../../../../Icons/DeleteIcon';
10
10
  import { MobileStepper, styled } from '@mui/material';
11
11
  import ArrowRightIcon from '../../../../../Icons/ArrowRightIcon';
12
12
  import ArrowLeftIcon from '../../../../../Icons/ArrowLeftIcon';
13
+ import { pillSurfaceStyle } from '../../../../../Utils/SurfaceStyle';
13
14
  function PagedMapperElement({ step, num, loading, element, children, editable, onChange, value, handleDelete, customElementModifiers, customElementRender, }) {
14
15
  const deletable = step.deletable ?? true;
15
16
  const { size } = useContext(FormContext);
@@ -77,7 +78,7 @@ function PagedMapperElement({ step, num, loading, element, children, editable, o
77
78
  const { calcName } = customElementModifiers ?? {};
78
79
  const name = calcName ? calcName(element) : step.unitLabel ? step.unitLabel + ' ' + (num + 1) : '';
79
80
  const renderElement = (renderElementButtons) => {
80
- return (_jsx("div", { className: widthStats.isMobile ? styles.mobileContainer : styles.container, ref: containerRef, children: _jsxs("div", { className: styles.contentContainer, style: {
81
+ return (_jsx("div", { className: widthStats.isMobile ? styles.mobileContainer : styles.container, style: pillSurfaceStyle(formStyle), ref: containerRef, children: _jsxs("div", { className: styles.contentContainer, style: {
81
82
  width: (size.blockSize + size.spacingSize) * (step.style?.size ?? size.blockNum - 1),
82
83
  }, children: [name && (_jsx("div", { className: styles.titleLbl, style: { color: formStyle.textColor }, children: loading ? 'Cargando...' : name + ':' })), _jsxs("div", { className: styles.btnsContainer, children: [renderElementButtons?.(element), (deletable || !element.isOriginal) && (_jsx("div", { className: !editable || postview ? styles.disabledDeleteBtn : styles.deleteBtn, style: { color: formStyle.textColor }, onClick: () => {
83
84
  if (editable && !postview) {
@@ -4,8 +4,7 @@
4
4
 
5
5
  .container,
6
6
  .mobileContainer {
7
- background-color: #f0f0f0;
8
- border: 1px solid #d6d6d6;
7
+ border: 1px solid;
9
8
  width: fit-content;
10
9
  border-radius: 20px;
11
10
  margin-bottom: 10px;
@@ -4,6 +4,7 @@ import styles from './PillMapperElement.module.css';
4
4
  import FormContext from '../../../../../Contexts/FormContext';
5
5
  import { useAppSelector } from '../../../../../hooks';
6
6
  import DeleteIcon from '../../../../../Icons/DeleteIcon';
7
+ import { pillSurfaceStyle } from '../../../../../Utils/SurfaceStyle';
7
8
  function PillMapperElement({ step, num, loading, element, children, editable, handleDelete, customElementModifiers, customElementRender, }) {
8
9
  const deletable = step.deletable ?? true;
9
10
  const { size } = useContext(FormContext);
@@ -16,6 +17,7 @@ function PillMapperElement({ step, num, loading, element, children, editable, ha
16
17
  const isDeleted = customElementModifiers?.isDeleted?.(element) ?? false;
17
18
  const renderElement = (renderElementButtons) => {
18
19
  return (_jsx("div", { className: widthStats.isMobile ? styles.mobileContainer : styles.container, style: {
20
+ ...pillSurfaceStyle(formStyle),
19
21
  opacity: isDeleted ? 0.5 : 1,
20
22
  }, children: _jsxs("div", { className: styles.contentContainer, style: {
21
23
  width: (size.blockSize + size.spacingSize) * (step.style?.size ?? size.blockNum - 1),
@@ -4,8 +4,7 @@
4
4
 
5
5
  .container,
6
6
  .mobileContainer {
7
- background-color: #f0f0f0;
8
- border: 1px solid #d6d6d6;
7
+ border: 1px solid;
9
8
  width: fit-content;
10
9
  border-radius: 20px;
11
10
  margin-bottom: 10px;
@@ -0,0 +1,11 @@
1
+ import { FormStyle } from '../@Types/Form';
2
+ /**
3
+ * Inline surface for "pill" containers (mapper elements, incidents) that sit on a step.
4
+ * The tint and border are mixed from the form's own colors so they work on any form style,
5
+ * including the admin's dark scheme, instead of a fixed light grey.
6
+ * On the default light style this resolves to roughly #f0f0f0 / #d6d6d6, the previous fixed values.
7
+ */
8
+ export declare function pillSurfaceStyle(formStyle: FormStyle): {
9
+ backgroundColor: string;
10
+ borderColor: string;
11
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Inline surface for "pill" containers (mapper elements, incidents) that sit on a step.
3
+ * The tint and border are mixed from the form's own colors so they work on any form style,
4
+ * including the admin's dark scheme, instead of a fixed light grey.
5
+ * On the default light style this resolves to roughly #f0f0f0 / #d6d6d6, the previous fixed values.
6
+ */
7
+ export function pillSurfaceStyle(formStyle) {
8
+ const base = formStyle.stepBackgroundColor;
9
+ const text = formStyle.textColor;
10
+ return {
11
+ backgroundColor: `color-mix(in srgb, ${text} 7%, ${base})`,
12
+ borderColor: `color-mix(in srgb, ${text} 20%, ${base})`,
13
+ };
14
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version": "3.0.58",
4
+ "version":"3.0.59-test",
5
5
  "scripts": {
6
6
  "watch": "tsgo --noEmit --watch --project tsconfig.app.json",
7
7
  "start": "vite",