@dropi/react-native-design-system 0.2.9 → 0.2.11
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/README.md +286 -5
- package/lib/molecules/Tags/DefaultTag/DefaultTag.d.ts +11 -0
- package/lib/molecules/Tags/DefaultTag/DefaultTag.js +73 -0
- package/lib/molecules/Tags/DefaultTag/index.d.ts +1 -0
- package/lib/molecules/Tags/DefaultTag/index.js +16 -0
- package/lib/molecules/Tags/OrderTag/OrderTag.d.ts +6 -0
- package/lib/molecules/Tags/OrderTag/OrderTag.js +56 -0
- package/lib/molecules/Tags/OrderTag/index.d.ts +1 -0
- package/lib/molecules/Tags/OrderTag/index.js +16 -0
- package/lib/molecules/Tags/index.d.ts +2 -0
- package/lib/molecules/Tags/index.js +27 -0
- package/lib/molecules/Toasts/FeedbackToast/FeedbackToast.js +2 -1
- package/lib/molecules/index.d.ts +1 -0
- package/lib/molecules/index.js +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,8 +35,15 @@ El **Design System de Dropi** para aplicaciones **React Native**. Este paquete r
|
|
|
35
35
|
- [🧪 Moléculas](#moléculas)
|
|
36
36
|
- [Alert](#alert)
|
|
37
37
|
- [Empty State](#empty-state)
|
|
38
|
-
- [
|
|
38
|
+
- [Radio Buttons](#radio-buttons)
|
|
39
|
+
- [Title Description](#title-description)
|
|
40
|
+
- [Search](#search)
|
|
39
41
|
- [Tooltip](#tooltip)
|
|
42
|
+
- [Tags](#tags)
|
|
43
|
+
- [Order Tag](#order-tag)
|
|
44
|
+
- [Default Tag](#default-tag)
|
|
45
|
+
- [Toasts](#toasts)
|
|
46
|
+
- [Feedback Toast](#feedback-toast)
|
|
40
47
|
|
|
41
48
|
# Instalación
|
|
42
49
|
|
|
@@ -478,17 +485,86 @@ import { EmptyState } from "@dropi/react-native-design-system";
|
|
|
478
485
|
/>
|
|
479
486
|
```
|
|
480
487
|
|
|
481
|
-
##
|
|
488
|
+
## Search
|
|
489
|
+
|
|
490
|
+
El `Search` es un componente de campo de búsqueda diseñado para filtrar contenido de manera interactiva. Incluye un ícono de búsqueda a la izquierda, un campo de texto editable y un botón de limpieza que aparece automáticamente cuando hay texto ingresado. Utiliza `forwardRef` para exponer la referencia del `TextInput` nativo, permitiendo control programático del foco y otras funcionalidades del input. El componente mantiene una apariencia limpia y consistente usando los tokens `colors`, `radius`, `sizes` y `spacing` del design system.
|
|
491
|
+
|
|
492
|
+
### 📦 Importación:
|
|
493
|
+
```Typescript
|
|
494
|
+
import { Search } from "@dropi/react-native-design-system";
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
### ⚙️ Props:
|
|
498
|
+
| Prop | Tipo | Descripción |
|
|
499
|
+
| :------------ | :---------------------- | :--------------------------------------------------------------------------------- |
|
|
500
|
+
| filterText | string | Valor actual del texto de búsqueda. |
|
|
501
|
+
| setFilterText | (text: string) => void | Callback para actualizar el valor del texto. |
|
|
502
|
+
| placeholder | string | *(Opcional)* Texto placeholder. Por defecto es "Buscar". |
|
|
503
|
+
| ref | TextInput | Referencia al TextInput nativo para control programático. |
|
|
504
|
+
| ...rest | TextInputProps | Cualquier prop nativa del componente TextInput de React Native. |
|
|
505
|
+
|
|
506
|
+
### 🧩 Ejemplos de uso:
|
|
507
|
+
```Typescript
|
|
508
|
+
import { useRef, useState } from 'react';
|
|
509
|
+
import { TextInput } from 'react-native';
|
|
510
|
+
import { Search } from '@dropi/react-native-design-system';
|
|
511
|
+
|
|
512
|
+
const MyComponent = () => {
|
|
513
|
+
const [searchText, setSearchText] = useState('');
|
|
514
|
+
const searchRef = useRef<TextInput>(null);
|
|
515
|
+
|
|
516
|
+
const handleFocusSearch = () => {
|
|
517
|
+
searchRef.current?.focus();
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
return (
|
|
521
|
+
<Search
|
|
522
|
+
ref={searchRef}
|
|
523
|
+
filterText={searchText}
|
|
524
|
+
setFilterText={setSearchText}
|
|
525
|
+
placeholder="Buscar productos"
|
|
526
|
+
/>
|
|
527
|
+
);
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
// Uso básico
|
|
531
|
+
<Search
|
|
532
|
+
filterText={query}
|
|
533
|
+
setFilterText={setQuery}
|
|
534
|
+
/>
|
|
535
|
+
|
|
536
|
+
// Con placeholder personalizado
|
|
537
|
+
<Search
|
|
538
|
+
filterText={searchValue}
|
|
539
|
+
setFilterText={setSearchValue}
|
|
540
|
+
placeholder="Buscar por nombre o código"
|
|
541
|
+
/>
|
|
542
|
+
|
|
543
|
+
// Con props adicionales de TextInput
|
|
544
|
+
<Search
|
|
545
|
+
ref={inputRef}
|
|
546
|
+
filterText={filter}
|
|
547
|
+
setFilterText={setFilter}
|
|
548
|
+
placeholder="Filtrar resultados"
|
|
549
|
+
autoFocus
|
|
550
|
+
returnKeyType="search"
|
|
551
|
+
onSubmitEditing={handleSearch}
|
|
552
|
+
/>
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
## Radio Buttons
|
|
556
|
+
|
|
557
|
+
### Title Description
|
|
482
558
|
|
|
483
559
|
El TitleDescription es un componente de selección diseñado para mostrar opciones con un título principal, una descripción opcional, una imagen y un indicador visual circular que refleja si la opción está activa. Es ideal para flujos donde el usuario debe elegir entre varias alternativas.
|
|
484
560
|
Adapta automáticamente tamaños en tablets usando isTablet, mantiene una disposición horizontal limpia y un estilo consistente con el design system.
|
|
485
561
|
|
|
486
|
-
|
|
562
|
+
#### 📦 Importación:
|
|
487
563
|
```Typescript
|
|
488
564
|
import { TitleDescription } from "@dropi/react-native-design-system";
|
|
489
565
|
```
|
|
490
566
|
|
|
491
|
-
|
|
567
|
+
#### ⚙️ Props:
|
|
492
568
|
| Prop | Tipo | Descripción |
|
|
493
569
|
| :------------- | :------------------------ | :-----------------------------------------------------------------------------|
|
|
494
570
|
| title | string | Título principal de la opción. |
|
|
@@ -499,7 +575,7 @@ import { TitleDescription } from "@dropi/react-native-design-system";
|
|
|
499
575
|
| ...rest | TouchableOpacityProps | Props adicionales del contenedor presionable. |
|
|
500
576
|
|
|
501
577
|
|
|
502
|
-
|
|
578
|
+
#### 🧩 Ejemplos de uso:
|
|
503
579
|
```Typescript
|
|
504
580
|
<TitleDescription
|
|
505
581
|
title="Domicilio"
|
|
@@ -561,4 +637,209 @@ import { TitleDescription } from "@dropi/react-native-design-system";
|
|
|
561
637
|
</Body>
|
|
562
638
|
</Tooltip>
|
|
563
639
|
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
## Tags
|
|
643
|
+
|
|
644
|
+
### Order Tag
|
|
645
|
+
|
|
646
|
+
El `OrderTag` es un componente visual diseñado para mostrar el estado actual de un pedido mediante una etiqueta con codificación cromática. Cada estado de pedido se representa con un color específico del sistema, facilitando la identificación rápida del estado sin necesidad de leer el texto completo. El componente es compacto, puede limitar su ancho para contextos reducidos, y utiliza los tokens `colors`, `radius` y `spacing` para mantener consistencia visual con el resto del design system.
|
|
647
|
+
|
|
648
|
+
### 📦 Importación:
|
|
649
|
+
```Typescript
|
|
650
|
+
import { OrderTag } from "@dropi/react-native-design-system";
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
### ⚙️ Props:
|
|
654
|
+
| Prop | Tipo | Descripción |
|
|
655
|
+
| :------------- | :------------------- | :--------------------------------------------------------------------------------------- |
|
|
656
|
+
| status | string | Estado del pedido que determina el color y texto de la etiqueta. |
|
|
657
|
+
| limitedWidth | boolean | *(Opcional)* Limita el ancho máximo a 112px. Por defecto es `false` (ancho completo). |
|
|
658
|
+
|
|
659
|
+
### 📋 Estados disponibles:
|
|
660
|
+
| Estado | Color |
|
|
661
|
+
| :---------------------------- | :------------------------ |
|
|
662
|
+
| ENTREGADO | Success-700 |
|
|
663
|
+
| EN TRANSITO | Success-600 |
|
|
664
|
+
| GUIA_GENERADA | Info-500 |
|
|
665
|
+
| RECOGIDO POR DROPI | Info-700 |
|
|
666
|
+
| ENTREGADO A TRANSPORTADORA | Success-400 |
|
|
667
|
+
| PENDIENTE | Warning-600 |
|
|
668
|
+
| PENDIENTE CONFIRMACION | Warning-500 |
|
|
669
|
+
| NOVEDAD | Error-600 |
|
|
670
|
+
| DEVOLUCION | Error-800 |
|
|
671
|
+
| CANCELADO | Gray-400 |
|
|
672
|
+
|
|
673
|
+
*Cualquier estado no listado mostrará un fondo negro por defecto.*
|
|
674
|
+
|
|
675
|
+
### 🧩 Ejemplos de uso:
|
|
676
|
+
```Typescript
|
|
677
|
+
<OrderTag status="ENTREGADO" />
|
|
678
|
+
|
|
679
|
+
<OrderTag
|
|
680
|
+
status="EN TRANSITO"
|
|
681
|
+
limitedWidth={true}
|
|
682
|
+
/>
|
|
683
|
+
|
|
684
|
+
<OrderTag status="PENDIENTE CONFIRMACION" />
|
|
685
|
+
|
|
686
|
+
<OrderTag
|
|
687
|
+
status="NOVEDAD"
|
|
688
|
+
limitedWidth={false}
|
|
689
|
+
/>
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
### Default Tag
|
|
693
|
+
|
|
694
|
+
El `DefaultTag` es un componente de etiqueta versátil diseñado para categorizar, destacar o marcar contenido dentro de la interfaz. Ofrece dos variantes visuales (`primary` y `secondary`) y seis estados semánticos (`default`, `success`, `info`, `warning`, `red`, `neutral`) que determinan su esquema de color. Además, permite incluir un ícono opcional para reforzar visualmente el significado de la etiqueta. El componente limita su ancho máximo a 160px y se autoajusta al inicio del contenedor, utilizando los tokens `colors`, `radius` y `sizes` para mantener coherencia con el design system.
|
|
695
|
+
|
|
696
|
+
#### 📦 Importación:
|
|
697
|
+
```Typescript
|
|
698
|
+
import { DefaultTag } from "@dropi/react-native-design-system";
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
#### ⚙️ Props:
|
|
702
|
+
| Prop | Tipo | Descripción |
|
|
703
|
+
| :------ | :---------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |
|
|
704
|
+
| type | 'primary' \| 'secondary' | Define la variante visual del tag (colores sólidos o suaves). |
|
|
705
|
+
| label | string | Texto visible dentro de la etiqueta. |
|
|
706
|
+
| state | 'default' \| 'success' \| 'info' \| 'warning' \| 'red' \| 'neutral' | *(Opcional)* Estado semántico que determina el color. Por defecto es `'default'`. |
|
|
707
|
+
| icon | IconName | *(Opcional)* Ícono que aparece antes del texto. |
|
|
708
|
+
|
|
709
|
+
#### 🎨 Estados y colores:
|
|
710
|
+
|
|
711
|
+
**Primary (fondo sólido, texto blanco):**
|
|
712
|
+
| Estado | Color de fondo |
|
|
713
|
+
| :------- | :------------- |
|
|
714
|
+
| default | Primary-500 |
|
|
715
|
+
| success | Success-500 |
|
|
716
|
+
| info | Info-500 |
|
|
717
|
+
| warning | Warning-500 |
|
|
718
|
+
| red | Error-500 |
|
|
719
|
+
| neutral | Gray-500 |
|
|
720
|
+
|
|
721
|
+
**Secondary (fondo suave, texto del color primario del estado):**
|
|
722
|
+
| Estado | Color de fondo | Color de texto |
|
|
723
|
+
| :------- | :------------- | :-------------- |
|
|
724
|
+
| default | Primary-100 | Primary-500 |
|
|
725
|
+
| success | Success-50 | Success-500 |
|
|
726
|
+
| info | Info-50 | Info-500 |
|
|
727
|
+
| warning | Warning-50 | Warning-500 |
|
|
728
|
+
| red | Error-50 | Error-500 |
|
|
729
|
+
| neutral | Gray-50 | Gray-500 |
|
|
730
|
+
|
|
731
|
+
#### 🧩 Ejemplos de uso:
|
|
732
|
+
```Typescript
|
|
733
|
+
<DefaultTag
|
|
734
|
+
type="primary"
|
|
735
|
+
label="Nuevo"
|
|
736
|
+
state="default"
|
|
737
|
+
/>
|
|
738
|
+
|
|
739
|
+
<DefaultTag
|
|
740
|
+
type="secondary"
|
|
741
|
+
label="Aprobado"
|
|
742
|
+
state="success"
|
|
743
|
+
icon="check-circle"
|
|
744
|
+
/>
|
|
745
|
+
|
|
746
|
+
<DefaultTag
|
|
747
|
+
type="primary"
|
|
748
|
+
label="Urgente"
|
|
749
|
+
state="warning"
|
|
750
|
+
icon="alert-triangle"
|
|
751
|
+
/>
|
|
752
|
+
|
|
753
|
+
<DefaultTag
|
|
754
|
+
type="secondary"
|
|
755
|
+
label="Información"
|
|
756
|
+
state="info"
|
|
757
|
+
/>
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
## Toasts
|
|
761
|
+
|
|
762
|
+
### Feedback Toast
|
|
763
|
+
|
|
764
|
+
El `FeedbackToast` es un componente de notificación temporal que aparece desde la parte superior de la pantalla para comunicar el resultado de una acción o mostrar información importante al usuario. Incluye una animación Lottie contextual, una banda lateral de color semántico y botón de cierre. El componente se anima automáticamente al mostrarse con un efecto de "rebote" y puede cerrarse manualmente o mediante programación. Utiliza `forwardRef` para exponer métodos imperativos que permiten controlar su comportamiento desde componentes padres.
|
|
765
|
+
|
|
766
|
+
#### 📦 Importación:
|
|
767
|
+
```Typescript
|
|
768
|
+
import { FeedbackToast } from "@dropi/react-native-design-system";
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
#### ⚙️ Props:
|
|
772
|
+
| Prop | Tipo | Descripción |
|
|
773
|
+
| :------------ | :------------------------------------------- | :------------------------------------------------------------------------------------- |
|
|
774
|
+
| type | 'success' \| 'error' \| 'warning' \| 'info' | Define el tipo de notificación, determina color de banda y animación Lottie. |
|
|
775
|
+
| title | string | *(Opcional)* Título principal del toast. |
|
|
776
|
+
| message | string | *(Opcional)* Mensaje descriptivo del toast. |
|
|
777
|
+
| setShowToast | (show: boolean) => void | Callback para controlar la visibilidad del toast desde el componente padre. |
|
|
778
|
+
| ref | ToastRef | Referencia que expone el método `animateOut()` para cerrar el toast programáticamente. |
|
|
779
|
+
|
|
780
|
+
#### 🎨 Tipos y sus características:
|
|
781
|
+
| Tipo | Color de banda | Animación Lottie |
|
|
782
|
+
| :------- | :------------- | :------------------ |
|
|
783
|
+
| success | Success-500 | afirmacion.json |
|
|
784
|
+
| error | Error-500 | buscando.json |
|
|
785
|
+
| warning | Warning-500 | alerta.json |
|
|
786
|
+
| info | Info-500 | pregunta.json |
|
|
787
|
+
|
|
788
|
+
#### 🧩 Ejemplos de uso:
|
|
789
|
+
```Typescript
|
|
790
|
+
import { useRef, useState } from 'react';
|
|
791
|
+
import { FeedbackToast, ToastRef } from '@dropi/react-native-design-system';
|
|
792
|
+
|
|
793
|
+
const MyComponent = () => {
|
|
794
|
+
const [showToast, setShowToast] = useState(false);
|
|
795
|
+
const toastRef = useRef<ToastRef>(null);
|
|
796
|
+
|
|
797
|
+
const handleSuccess = () => {
|
|
798
|
+
setShowToast(true);
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
const handleCloseToast = () => {
|
|
802
|
+
toastRef.current?.animateOut();
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
return (
|
|
806
|
+
<>
|
|
807
|
+
{showToast && (
|
|
808
|
+
<FeedbackToast
|
|
809
|
+
ref={toastRef}
|
|
810
|
+
type="success"
|
|
811
|
+
title="¡Operación exitosa!"
|
|
812
|
+
message="Los cambios se guardaron correctamente"
|
|
813
|
+
setShowToast={setShowToast}
|
|
814
|
+
/>
|
|
815
|
+
)}
|
|
816
|
+
</>
|
|
817
|
+
);
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
// Toast de error sin título
|
|
821
|
+
<FeedbackToast
|
|
822
|
+
ref={toastRef}
|
|
823
|
+
type="error"
|
|
824
|
+
message="No se pudo completar la operación"
|
|
825
|
+
setShowToast={setShowToast}
|
|
826
|
+
/>
|
|
827
|
+
|
|
828
|
+
// Toast de advertencia
|
|
829
|
+
<FeedbackToast
|
|
830
|
+
ref={toastRef}
|
|
831
|
+
type="warning"
|
|
832
|
+
title="Atención"
|
|
833
|
+
message="Esta acción no se puede deshacer"
|
|
834
|
+
setShowToast={setShowToast}
|
|
835
|
+
/>
|
|
836
|
+
|
|
837
|
+
// Toast informativo
|
|
838
|
+
<FeedbackToast
|
|
839
|
+
ref={toastRef}
|
|
840
|
+
type="info"
|
|
841
|
+
title="Información"
|
|
842
|
+
message="Hay una nueva actualización disponible"
|
|
843
|
+
setShowToast={setShowToast}
|
|
844
|
+
/>
|
|
564
845
|
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IconName } from 'dropi-lib-icons';
|
|
2
|
+
type TagType = 'primary' | 'secondary';
|
|
3
|
+
type TagState = 'default' | 'success' | 'info' | 'warning' | 'red' | 'neutral';
|
|
4
|
+
interface Props {
|
|
5
|
+
type: TagType;
|
|
6
|
+
label: string;
|
|
7
|
+
state?: TagState;
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
}
|
|
10
|
+
export declare const DefaultTag: ({ type, label, state, icon }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DefaultTag = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
9
|
+
var _atoms = require("../../../atoms");
|
|
10
|
+
var _reactNative2 = _interopRequireDefault(require("dropi-lib-icons/react-native"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const TAG_BACKGROUND_COLORS = {
|
|
14
|
+
primary: {
|
|
15
|
+
default: _constants.colors['Primary-500'].light,
|
|
16
|
+
success: _constants.colors['Success-500'].light,
|
|
17
|
+
info: _constants.colors['Info-500'].light,
|
|
18
|
+
warning: _constants.colors['Warning-500'].light,
|
|
19
|
+
red: _constants.colors['Error-500'].light,
|
|
20
|
+
neutral: _constants.colors['Gray-500'].light
|
|
21
|
+
},
|
|
22
|
+
secondary: {
|
|
23
|
+
default: _constants.colors['Primary-100'].light,
|
|
24
|
+
success: _constants.colors['Success-50'].light,
|
|
25
|
+
info: _constants.colors['Info-50'].light,
|
|
26
|
+
warning: _constants.colors['Warning-50'].light,
|
|
27
|
+
red: _constants.colors['Error-50'].light,
|
|
28
|
+
neutral: _constants.colors['Gray-50'].light
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const getBackgroundColor = (type, state) => {
|
|
32
|
+
return TAG_BACKGROUND_COLORS[type][state];
|
|
33
|
+
};
|
|
34
|
+
const DefaultTag = ({
|
|
35
|
+
type,
|
|
36
|
+
label,
|
|
37
|
+
state = 'default',
|
|
38
|
+
icon
|
|
39
|
+
}) => {
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
41
|
+
style: [styles.container, {
|
|
42
|
+
backgroundColor: getBackgroundColor(type, state)
|
|
43
|
+
}],
|
|
44
|
+
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.default, {
|
|
45
|
+
name: icon,
|
|
46
|
+
size: _constants.sizes.s,
|
|
47
|
+
color: type === 'primary' ? _constants.colors['White'].light : getBackgroundColor('primary', state),
|
|
48
|
+
style: {
|
|
49
|
+
marginRight: 4
|
|
50
|
+
}
|
|
51
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_atoms.Body, {
|
|
52
|
+
numberOfLines: 1,
|
|
53
|
+
type: "s-medium",
|
|
54
|
+
style: {
|
|
55
|
+
color: type === 'primary' ? _constants.colors['White'].light : getBackgroundColor('primary', state)
|
|
56
|
+
},
|
|
57
|
+
children: [" ", label, " "]
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
exports.DefaultTag = DefaultTag;
|
|
62
|
+
const styles = _reactNative.StyleSheet.create({
|
|
63
|
+
container: {
|
|
64
|
+
paddingVertical: 4,
|
|
65
|
+
paddingHorizontal: 8,
|
|
66
|
+
borderRadius: _constants.radius["border-5"],
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
justifyContent: 'center',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
maxWidth: 160,
|
|
71
|
+
alignSelf: 'flex-start'
|
|
72
|
+
}
|
|
73
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DefaultTag';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _DefaultTag = require("./DefaultTag");
|
|
7
|
+
Object.keys(_DefaultTag).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _DefaultTag[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _DefaultTag[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.OrderTag = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
9
|
+
var _atoms = require("../../../atoms");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
const STATUS_BACKGROUND_COLORS = {
|
|
12
|
+
'ENTREGADO': _constants.colors['Success-700'].light,
|
|
13
|
+
'EN TRANSITO': _constants.colors['Success-600'].light,
|
|
14
|
+
'GUIA_GENERADA': _constants.colors['Info-500'].light,
|
|
15
|
+
'RECOGIDO POR DROPI': _constants.colors['Info-700'].light,
|
|
16
|
+
'ENTREGADO A TRANSPORTADORA': _constants.colors['Success-400'].light,
|
|
17
|
+
'PENDIENTE': _constants.colors['Warning-600'].light,
|
|
18
|
+
'PENDIENTE CONFIRMACION': _constants.colors['Warning-500'].light,
|
|
19
|
+
'NOVEDAD': _constants.colors['Error-600'].light,
|
|
20
|
+
'DEVOLUCION': _constants.colors['Error-800'].light,
|
|
21
|
+
'CANCELADO': _constants.colors['Gray-400'].light
|
|
22
|
+
};
|
|
23
|
+
const getBackgroundColor = status => {
|
|
24
|
+
return STATUS_BACKGROUND_COLORS[status] || _constants.colors.Black.light;
|
|
25
|
+
};
|
|
26
|
+
const OrderTag = ({
|
|
27
|
+
status,
|
|
28
|
+
limitedWidth = false
|
|
29
|
+
}) => {
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
31
|
+
style: [styles.orderStatusTag, {
|
|
32
|
+
backgroundColor: getBackgroundColor(status),
|
|
33
|
+
maxWidth: limitedWidth ? 112 : '100%'
|
|
34
|
+
}],
|
|
35
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_atoms.Body, {
|
|
36
|
+
type: "xs-medium",
|
|
37
|
+
numberOfLines: 1,
|
|
38
|
+
style: styles.statusText,
|
|
39
|
+
children: status
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
exports.OrderTag = OrderTag;
|
|
44
|
+
const styles = _reactNative.StyleSheet.create({
|
|
45
|
+
orderStatusTag: {
|
|
46
|
+
maxWidth: 112,
|
|
47
|
+
borderRadius: _constants.radius["border-5"],
|
|
48
|
+
paddingHorizontal: _constants.spacing['size-2'],
|
|
49
|
+
paddingVertical: _constants.spacing['size-1'],
|
|
50
|
+
alignSelf: 'flex-start'
|
|
51
|
+
},
|
|
52
|
+
statusText: {
|
|
53
|
+
color: _constants.colors.White.light,
|
|
54
|
+
textAlign: 'center'
|
|
55
|
+
}
|
|
56
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './OrderTag';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _OrderTag = require("./OrderTag");
|
|
7
|
+
Object.keys(_OrderTag).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _OrderTag[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _OrderTag[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _DefaultTag = require("./DefaultTag");
|
|
7
|
+
Object.keys(_DefaultTag).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _DefaultTag[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _DefaultTag[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _OrderTag = require("./OrderTag");
|
|
18
|
+
Object.keys(_OrderTag).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _OrderTag[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _OrderTag[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -81,7 +81,8 @@ const FeedbackToast = exports.FeedbackToast = /*#__PURE__*/(0, _react.forwardRef
|
|
|
81
81
|
style: {
|
|
82
82
|
flexDirection: 'row',
|
|
83
83
|
flex: 1,
|
|
84
|
-
paddingVertical: _constants.spacing['size-4']
|
|
84
|
+
paddingVertical: _constants.spacing['size-4'],
|
|
85
|
+
justifyContent: 'space-between'
|
|
85
86
|
},
|
|
86
87
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
87
88
|
style: {
|
package/lib/molecules/index.d.ts
CHANGED
package/lib/molecules/index.js
CHANGED
|
@@ -68,4 +68,15 @@ Object.keys(_Toasts).forEach(function (key) {
|
|
|
68
68
|
return _Toasts[key];
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
+
});
|
|
72
|
+
var _Tags = require("./Tags");
|
|
73
|
+
Object.keys(_Tags).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _Tags[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _Tags[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
71
82
|
});
|