@lion-npm/ui 1.0.1 → 1.0.3

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 (75) hide show
  1. package/dist/index.js +2564 -0
  2. package/dist/style.css +2 -0
  3. package/package.json +20 -2
  4. package/.oxlintrc.json +0 -8
  5. package/AGENTS.md +0 -0
  6. package/Dockerfile +0 -7
  7. package/compose.yml +0 -14
  8. package/index.html +0 -15
  9. package/src/App.tsx +0 -81
  10. package/src/assets/css/buttons/buttons-android.css +0 -251
  11. package/src/assets/css/buttons/buttons-ios.css +0 -213
  12. package/src/assets/css/buttons/buttons-web.css +0 -138
  13. package/src/assets/css/custom.css +0 -8
  14. package/src/assets/css/index.css +0 -60
  15. package/src/assets/css/inputs/inputs-android.css +0 -259
  16. package/src/assets/css/inputs/inputs-bootstrap.css +0 -74
  17. package/src/assets/css/inputs/inputs-ios.css +0 -268
  18. package/src/assets/css/loadings/loading-bar.css +0 -86
  19. package/src/assets/css/modals/modals.css +0 -236
  20. package/src/components/buttons/AndroidButton.tsx +0 -43
  21. package/src/components/buttons/BootstrapButton.tsx +0 -50
  22. package/src/components/buttons/IOSButton.tsx +0 -42
  23. package/src/components/buttons/LionButton.tsx +0 -76
  24. package/src/components/inputs/AndroidInput.tsx +0 -158
  25. package/src/components/inputs/BootstrapInput.tsx +0 -106
  26. package/src/components/inputs/IOSInput.tsx +0 -163
  27. package/src/components/loadings/LoadingBar.tsx +0 -21
  28. package/src/components/modals/LionModal.tsx +0 -157
  29. package/src/context/LionUIComponentsContext.tsx +0 -65
  30. package/src/features/Header.tsx +0 -77
  31. package/src/features/VariantList.tsx +0 -19
  32. package/src/features/buttons/ButtonsSection.tsx +0 -7
  33. package/src/features/buttons/components/ButtonsAndroidSection.tsx +0 -79
  34. package/src/features/buttons/components/ButtonsBootstrapSection.tsx +0 -77
  35. package/src/features/buttons/components/ButtonsCustomSection.tsx +0 -234
  36. package/src/features/buttons/components/ButtonsIOSSection.tsx +0 -78
  37. package/src/features/inputs/InputsSection.tsx +0 -7
  38. package/src/features/inputs/components/InputsAndroidSection.tsx +0 -155
  39. package/src/features/inputs/components/InputsBootstrapSection.tsx +0 -154
  40. package/src/features/inputs/components/InputsIOSSection.tsx +0 -156
  41. package/src/features/loadings/LoadingSection.tsx +0 -5
  42. package/src/features/loadings/components/LoadingBarSection.tsx +0 -74
  43. package/src/features/modals/ModalsSection.tsx +0 -5
  44. package/src/features/modals/components/ModalsAndroidSection.tsx +0 -103
  45. package/src/features/modals/components/ModalsDefaultForm.tsx +0 -31
  46. package/src/features/modals/components/ModalsDefaultInput.tsx +0 -22
  47. package/src/features/modals/components/ModalsIOSSection.tsx +0 -106
  48. package/src/features/modals/components/ModalsWebSection.tsx +0 -99
  49. package/src/interfaces/LionUIComponentsProviderProps.tsx +0 -7
  50. package/src/interfaces/LionUIContextProps.tsx +0 -6
  51. package/src/interfaces/LionUIState.tsx +0 -8
  52. package/src/main.tsx +0 -9
  53. package/src/types/Android/AndroidInputShapeTypes.tsx +0 -7
  54. package/src/types/Android/AndroidInputStyleTypes.tsx +0 -7
  55. package/src/types/Android/AndroidShapeTypes.tsx +0 -6
  56. package/src/types/Android/AndroidStyleTypes.tsx +0 -9
  57. package/src/types/ButtonTypes.tsx +0 -9
  58. package/src/types/IOS/IOSShapeTypes.tsx +0 -7
  59. package/src/types/IOS/IOSStyleTypes.tsx +0 -9
  60. package/src/types/IOS/iOSInputShapeTypes.tsx +0 -9
  61. package/src/types/IOS/iOSInputStyleTypes.tsx +0 -11
  62. package/src/types/InputTypes.tsx +0 -13
  63. package/src/types/PlatformTypes.tsx +0 -9
  64. package/src/types/SizeTypes.tsx +0 -11
  65. package/src/types/VariantTypes.tsx +0 -19
  66. package/src/types/Web/BootstrapInputShapeTypes.tsx +0 -9
  67. package/src/types/Web/BootstrapInputStyleTypes.tsx +0 -8
  68. package/src/types/Web/BootstrapShapeTypes.tsx +0 -8
  69. package/src/types/Web/BootstrapStyleTypes.tsx +0 -7
  70. package/tsconfig.app.json +0 -26
  71. package/tsconfig.json +0 -7
  72. package/tsconfig.node.json +0 -23
  73. package/vite.config.ts +0 -11
  74. /package/{public → dist}/favicon.svg +0 -0
  75. /package/{public → dist}/icons.svg +0 -0
@@ -1,156 +0,0 @@
1
- import VariantList from "../../VariantList.tsx";
2
- import { iOSInputStyleTypes } from "../../../types/IOS/iOSInputStyleTypes.tsx";
3
- import { iOSInputShapeTypes } from "../../../types/IOS/iOSInputShapeTypes.tsx";
4
- import { InputTypes } from "../../../types/InputTypes.tsx";
5
-
6
- import { Fragment, useState } from "react";
7
- import IOSInput from "../../../components/inputs/IOSInput.tsx";
8
-
9
- const StyleTypeList: Array<{ label: string; styleType: iOSInputStyleTypes }> = [
10
- { label: "Form", styleType: iOSInputStyleTypes.FORM },
11
- { label: "Rounded Border", styleType: iOSInputStyleTypes.ROUNDED_BORDER },
12
- ];
13
-
14
- const ShapeList: Array<{ label: string; shape: iOSInputShapeTypes }> = [
15
- { label: "Rounded Shape", shape: iOSInputShapeTypes.ROUNDED },
16
- { label: "Pill Shape", shape: iOSInputShapeTypes.PILL },
17
- { label: "Square Shape", shape: iOSInputShapeTypes.SQUARE },
18
- ];
19
-
20
- export default function InputsIOSSection() {
21
- const [inputValue, setInputValue] = useState<string>("");
22
-
23
- const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
24
- setInputValue(e.target.value);
25
- };
26
-
27
- return (
28
- <Fragment>
29
- <h2>Inputs (iOS SwiftUI)</h2>
30
-
31
- {StyleTypeList.map(({ label: styleLabel, styleType }) => (
32
- <div key={styleType} className="my-4">
33
- <h4 className="text-primary mb-3">{styleLabel} Inputs</h4>
34
-
35
- {ShapeList.map(({ label: shapeLabel, shape }) => (
36
- <div key={`${styleType}-${shape}`} className="mb-5">
37
- <div className={"ms-3"}>
38
- <h6 className="text-secondary mb-3">{shapeLabel}</h6>
39
- </div>
40
-
41
- {/* Enabled State */}
42
- <div className="mb-4">
43
- <span className="text-muted d-block mb-2 small font-monospace">Enabled</span>
44
- <div className="row g-3">
45
- {VariantList.map((variant) => (
46
- <div key={`${styleType}-${shape}-${variant}-enabled`} className="col-12 col-md-6 col-lg-4">
47
- <IOSInput
48
- type={InputTypes.TEXT}
49
- styleType={styleType}
50
- shape={shape}
51
- variant={variant}
52
- label={`Label (${variant})`}
53
- helperText="Texto de ayuda opcional"
54
- required={true}
55
- placeholder="Custom Placeholder..."
56
- value={inputValue}
57
- onChange={handleChange}
58
- />
59
- </div>
60
- ))}
61
- </div>
62
- </div>
63
-
64
- {/* With Value / Floating State */}
65
- <div className="mb-4">
66
- <span className="text-muted d-block mb-2 small font-monospace">With Value / Floating</span>
67
- <div className="row g-3">
68
- {VariantList.map((variant) => (
69
- <div key={`${styleType}-${shape}-${variant}-value`} className="col-12 col-md-6 col-lg-4">
70
- <IOSInput
71
- type={InputTypes.TEXT}
72
- styleType={styleType}
73
- shape={shape}
74
- variant={variant}
75
- label="Usuario"
76
- defaultValue="lion.developer"
77
- helperText="Campo completado"
78
- placeholder="Custom Placeholder..."
79
- autoComplete="off"
80
- />
81
- </div>
82
- ))}
83
- </div>
84
- </div>
85
-
86
- {/* Error State */}
87
- <div className="mb-4">
88
- <span className="text-muted d-block mb-2 small font-monospace">Error State</span>
89
- <div className="row g-3">
90
- {VariantList.map((variant) => (
91
- <div key={`${styleType}-${shape}-${variant}-error`} className="col-12 col-md-6 col-lg-4">
92
- <IOSInput
93
- type={InputTypes.TEXT}
94
- styleType={styleType}
95
- shape={shape}
96
- variant={variant}
97
- label="Correo electrónico"
98
- defaultValue="correo-invalido"
99
- error="El formato del correo no es válido"
100
- placeholder="Custom Placeholder..."
101
- />
102
- </div>
103
- ))}
104
- </div>
105
- </div>
106
-
107
- {/* Disabled State */}
108
- <div className="mb-4">
109
- <span className="text-muted d-block mb-2 small font-monospace">Disabled</span>
110
- <div className="row g-3">
111
- {VariantList.map((variant) => (
112
- <div key={`${styleType}-${shape}-${variant}-disabled`} className="col-12 col-md-6 col-lg-4">
113
- <IOSInput
114
- type={InputTypes.TEXT}
115
- styleType={styleType}
116
- shape={shape}
117
- variant={variant}
118
- label="Deshabilitado"
119
- defaultValue="Valor bloqueado"
120
- disabled={true}
121
- helperText="No editable"
122
- placeholder="Custom Placeholder..."
123
- />
124
- </div>
125
- ))}
126
- </div>
127
- </div>
128
-
129
- {/* Readonly State */}
130
- <div>
131
- <span className="text-muted d-block mb-2 small font-monospace">ReadOnly</span>
132
- <div className="row g-3">
133
- {VariantList.map((variant) => (
134
- <div key={`${styleType}-${shape}-${variant}-readonly`} className="col-12 col-md-6 col-lg-4">
135
- <IOSInput
136
- type={InputTypes.TEXT}
137
- styleType={styleType}
138
- shape={shape}
139
- variant={variant}
140
- label="ReadOnly"
141
- defaultValue="Valor bloqueado"
142
- readOnly={true}
143
- helperText="No editable"
144
- placeholder="Custom Placeholder..."
145
- />
146
- </div>
147
- ))}
148
- </div>
149
- </div>
150
- </div>
151
- ))}
152
- </div>
153
- ))}
154
- </Fragment>
155
- );
156
- }
@@ -1,5 +0,0 @@
1
- import { Outlet } from "react-router-dom";
2
-
3
- export default function LoadingSection() {
4
- return <Outlet />
5
- }
@@ -1,74 +0,0 @@
1
- import { Fragment, useState } from "react";
2
- import { ButtonTypes } from "../../../types/ButtonTypes.tsx";
3
- import { VariantTypes } from "../../../types/VariantTypes.tsx";
4
- import { PlatformTypes } from "../../../types/PlatformTypes.tsx";
5
- import { useLionUI } from "../../../context/LionUIComponentsContext.tsx";
6
- import LionButton from "../../../components/buttons/LionButton.tsx";
7
- import LoadingBar from "../../../components/loadings/LoadingBar.tsx";
8
-
9
- const variantsList = [
10
- { type: VariantTypes.SUCCESS, name: "Success" },
11
- { type: VariantTypes.INFO, name: "Info" },
12
- { type: VariantTypes.PRIMARY, name: "Primary" },
13
- { type: VariantTypes.DANGER, name: "Danger" },
14
- { type: VariantTypes.WARNING, name: "Warning" },
15
- { type: VariantTypes.LIGHT, name: "Light" },
16
- { type: VariantTypes.LINK, name: "Link" },
17
- { type: VariantTypes.DARK, name: "Dark" },
18
- { type: VariantTypes.LION_PACKAGES, name: "Lion Packages" },
19
- { type: VariantTypes.LION_PARKING, name: "Lion Parking" },
20
- { type: VariantTypes.LION_TECH, name: "Lion Tech" },
21
- { type: VariantTypes.LION_GLAM, name: "Lion Glam" },
22
- ];
23
-
24
- export default function LoadingBarSection() {
25
- const { updateState } = useLionUI();
26
-
27
- // Local state exclusively for this section's testing demo
28
- const [isLoading, setIsLoading] = useState<boolean>(false);
29
- const [activeVariant, setActiveVariant] = useState<VariantTypes | string>(VariantTypes.PRIMARY);
30
-
31
- // Trigger local loading state for 5 seconds simulation
32
- const handleTriggerLoading = (variant: VariantTypes | string) => {
33
- setActiveVariant(variant);
34
- setIsLoading(true);
35
-
36
- // Also update global loading if needed by the LoadingBar component, or handle it locally
37
- updateState({ loading: true });
38
-
39
- // Automatically disable loading after 5 seconds
40
- setTimeout(() => {
41
- setIsLoading(false);
42
- updateState({ loading: false });
43
- }, 5000);
44
- };
45
-
46
- return (
47
- <Fragment>
48
- <h2>Loading Bar Demonstrations</h2>
49
- <p className="text-muted">Click any button below to trigger the loading bar for 5 seconds using its respective variant.</p>
50
-
51
- {/* Top demonstration loading bar container using local state variant */}
52
- <div className="mb-4" style={{ minHeight: "10px" }}>
53
- <LoadingBar variant={activeVariant} />
54
- </div>
55
-
56
- <div className="d-flex gap-3 flex-wrap">
57
- {variantsList.map((variantObj) => (
58
- <LionButton
59
- key={variantObj.type}
60
- platform={PlatformTypes.WEB}
61
- variant={variantObj.type}
62
- type={ButtonTypes.BUTTON}
63
- disabled={isLoading}
64
- onClick={() => handleTriggerLoading(variantObj.type)}
65
- >
66
- {isLoading && activeVariant === variantObj.type
67
- ? "Loading..."
68
- : `Test ${variantObj.name}`}
69
- </LionButton>
70
- ))}
71
- </div>
72
- </Fragment>
73
- );
74
- }
@@ -1,5 +0,0 @@
1
- import { Outlet } from "react-router-dom";
2
-
3
- export default function ModalsSection() {
4
- return <Outlet />
5
- }
@@ -1,103 +0,0 @@
1
- import { Fragment } from "react";
2
- import { ButtonTypes } from "../../../types/ButtonTypes.tsx";
3
- import { AndroidShapeTypes } from "../../../types/Android/AndroidShapeTypes.tsx";
4
- import { AndroidStyleTypes } from "../../../types/Android/AndroidStyleTypes.tsx";
5
- import { VariantTypes } from "../../../types/VariantTypes.tsx";
6
- import { PlatformTypes } from "../../../types/PlatformTypes.tsx";
7
- import { SizeTypes } from "../../../types/SizeTypes.tsx";
8
- import { useLionUI } from "../../../context/LionUIComponentsContext.tsx";
9
- import LionModal from "../../../components/modals/LionModal.tsx";
10
- import ModalsDefaultForm from "./ModalsDefaultForm.tsx";
11
- import LionButton from "../../../components/buttons/LionButton.tsx";
12
-
13
- const variantsList = [
14
- { type: VariantTypes.SUCCESS, name: "Success" },
15
- { type: VariantTypes.INFO, name: "Info" },
16
- { type: VariantTypes.PRIMARY, name: "Primary" },
17
- { type: VariantTypes.DANGER, name: "Danger" },
18
- { type: VariantTypes.WARNING, name: "Warning" },
19
- { type: VariantTypes.LIGHT, name: "Light" },
20
- { type: VariantTypes.LINK, name: "Link" },
21
- { type: VariantTypes.DARK, name: "Dark" },
22
- { type: VariantTypes.LION_PACKAGES, name: "Lion Packages" },
23
- { type: VariantTypes.LION_PARKING, name: "Lion Parking" },
24
- { type: VariantTypes.LION_TECH, name: "Lion Tech" },
25
- { type: VariantTypes.LION_GLAM, name: "Lion Glam" },
26
- ];
27
-
28
- const sizesList = [
29
- { size: SizeTypes.SM, label: "SM", titleSuffix: "Small Modal" },
30
- { size: SizeTypes.LG, label: "LG", titleSuffix: "Large Modal" },
31
- { size: SizeTypes.XL, label: "XL", titleSuffix: "Extra Large Modal" },
32
- { size: SizeTypes.LG, label: "Full", titleSuffix: "Fullscreen Modal", fullscreen: true as const },
33
- ];
34
-
35
- const modalsConfig = variantsList.flatMap((variantObj) =>
36
- sizesList.map((sizeObj) => ({
37
- id: `android-modal-${variantObj.type}-${sizeObj.label.toLowerCase()}`,
38
- label: sizeObj.label,
39
- size: sizeObj.size,
40
- fullscreen: sizeObj.fullscreen,
41
- variant: variantObj.type,
42
- title: `Android ${variantObj.name} ${sizeObj.titleSuffix}`,
43
- }))
44
- );
45
-
46
- export default function ModalsAndroidSection() {
47
- const { updateState } = useLionUI();
48
-
49
- return (
50
- <Fragment>
51
- <h2>Modals (Android)</h2>
52
-
53
- {variantsList.map((variantObj) => {
54
- const variantModals = modalsConfig.filter(
55
- (modal) => modal.variant === variantObj.type
56
- );
57
-
58
- return (
59
- <div key={variantObj.type} className="mb-4">
60
- <h5 className="text-muted mb-2">{variantObj.name}</h5>
61
- <div className="d-flex gap-3 flex-wrap">
62
- {variantModals.map((modal) => (
63
- <LionButton
64
- key={modal.id}
65
- platform={PlatformTypes.ANDROID}
66
- shape={AndroidShapeTypes.ROUNDED}
67
- styleType={AndroidStyleTypes.TONAL}
68
- variant={modal.variant}
69
- type={ButtonTypes.BUTTON}
70
- onClick={() => updateState({ modal: modal.id })}
71
- >
72
- {modal.label}
73
- </LionButton>
74
- ))}
75
- </div>
76
- </div>
77
- );
78
- })}
79
-
80
- {modalsConfig.map((modal) => (
81
- <LionModal
82
- key={modal.id}
83
- platform={PlatformTypes.ANDROID}
84
- modalId={modal.id}
85
- variant={modal.variant}
86
- title={modal.title}
87
- size={modal.size}
88
- fullscreen={modal.fullscreen}
89
- body={<ModalsDefaultForm variant={modal.variant} />}
90
- buttons={(
91
- <LionButton
92
- variant={VariantTypes.MODAL}
93
- type={ButtonTypes.BUTTON}
94
- onClick={() => alert("Clicked")}
95
- >
96
- Click
97
- </LionButton>
98
- )}
99
- />
100
- ))}
101
- </Fragment>
102
- );
103
- }
@@ -1,31 +0,0 @@
1
- import { Col, Form, Row } from "react-bootstrap";
2
- import ModalsDefaultInput from "./ModalsDefaultInput.tsx";
3
-
4
- // @ts-ignore
5
- export default function ModalsDefaultForm ({ platform, variant }) {
6
- return (
7
- <Form>
8
- <ModalsDefaultInput platform={platform} variant={variant} />
9
-
10
- <ModalsDefaultInput platform={platform} variant={variant} />
11
-
12
- <Row>
13
- <Col xs={12} sm={12} md={12} lg={6} xl={6} xxl={6}>
14
- <ModalsDefaultInput platform={platform} variant={variant} />
15
- </Col>
16
-
17
- <Col xs={12} sm={12} md={12} lg={6} xl={6} xxl={6}>
18
- <ModalsDefaultInput platform={platform} variant={variant} />
19
- </Col>
20
-
21
- <Col xs={12} sm={12} md={12} lg={6} xl={6} xxl={6}>
22
- <ModalsDefaultInput platform={platform} variant={variant} />
23
- </Col>
24
-
25
- <Col xs={12} sm={12} md={12} lg={6} xl={6} xxl={6}>
26
- <ModalsDefaultInput platform={platform} variant={variant} />
27
- </Col>
28
- </Row>
29
- </Form>
30
- );
31
- }
@@ -1,22 +0,0 @@
1
- import { Form } from "react-bootstrap";
2
- import { InputTypes } from "../../../types/InputTypes.tsx";
3
- import AndroidInput from "../../../components/inputs/AndroidInput.tsx";
4
- import {PlatformTypes} from "../../../types/PlatformTypes.tsx";
5
- import IOSInput from "../../../components/inputs/IOSInput.tsx";
6
- import BootstrapInput from "../../../components/inputs/BootstrapInput.tsx";
7
-
8
- // @ts-ignore
9
- export default function ModalsDefaultInput({ platform, variant }) {
10
- const InputComponent = PlatformTypes.IOS === platform ? IOSInput : PlatformTypes.ANDROID === platform ? AndroidInput : BootstrapInput;
11
-
12
- return (
13
- <Form.Group className="mb-3">
14
- <InputComponent
15
- type={InputTypes.TEXT}
16
- label="Extra Large input text"
17
- variant={variant}
18
- placeholder="Example text..."
19
- />
20
- </Form.Group>
21
- );
22
- }
@@ -1,106 +0,0 @@
1
- import { Fragment } from "react";
2
- import { ButtonTypes } from "../../../types/ButtonTypes.tsx";
3
- import { VariantTypes } from "../../../types/VariantTypes.tsx";
4
- import { PlatformTypes } from "../../../types/PlatformTypes.tsx";
5
- import { SizeTypes } from "../../../types/SizeTypes.tsx";
6
- import { useLionUI } from "../../../context/LionUIComponentsContext.tsx";
7
- import LionModal from "../../../components/modals/LionModal.tsx";
8
- import ModalsDefaultForm from "./ModalsDefaultForm.tsx";
9
- import LionButton from "../../../components/buttons/LionButton.tsx";
10
- import {IOSStyleTypes} from "../../../types/IOS/IOSStyleTypes.tsx";
11
- import {IOSShapeTypes} from "../../../types/IOS/IOSShapeTypes.tsx";
12
-
13
- const variantsList = [
14
- { type: VariantTypes.SUCCESS, name: "Success" },
15
- { type: VariantTypes.INFO, name: "Info" },
16
- { type: VariantTypes.PRIMARY, name: "Primary" },
17
- { type: VariantTypes.DANGER, name: "Danger" },
18
- { type: VariantTypes.WARNING, name: "Warning" },
19
- { type: VariantTypes.LIGHT, name: "Light" },
20
- { type: VariantTypes.LINK, name: "Link" },
21
- { type: VariantTypes.DARK, name: "Dark" },
22
- { type: VariantTypes.LION_PACKAGES, name: "Lion Packages" },
23
- { type: VariantTypes.LION_PARKING, name: "Lion Parking" },
24
- { type: VariantTypes.LION_TECH, name: "Lion Tech" },
25
- { type: VariantTypes.LION_GLAM, name: "Lion Glam" },
26
- ];
27
-
28
- const sizesList = [
29
- { size: SizeTypes.SM, label: "SM", titleSuffix: "Small Modal" },
30
- { size: SizeTypes.LG, label: "LG", titleSuffix: "Large Modal" },
31
- { size: SizeTypes.XL, label: "XL", titleSuffix: "Extra Large Modal" },
32
- { size: SizeTypes.LG, label: "Full", titleSuffix: "Fullscreen Modal", fullscreen: true as const },
33
- ];
34
-
35
- const modalsConfig = variantsList.flatMap((variantObj) =>
36
- sizesList.map((sizeObj) => ({
37
- id: `ios-modal-${variantObj.type}-${sizeObj.label.toLowerCase()}`,
38
- label: sizeObj.label,
39
- size: sizeObj.size,
40
- fullscreen: sizeObj.fullscreen,
41
- variant: variantObj.type,
42
- title: `iOS ${variantObj.name} ${sizeObj.titleSuffix}`,
43
- }))
44
- );
45
-
46
- export default function ModalsIOSSection() {
47
- const { updateState } = useLionUI();
48
-
49
- return (
50
- <Fragment>
51
- <h2>Modals (iOS)</h2>
52
-
53
- {variantsList.map((variantObj) => {
54
- const variantModals = modalsConfig.filter(
55
- (modal) => modal.variant === variantObj.type
56
- );
57
-
58
- return (
59
- <div key={variantObj.type} className="mb-4">
60
- <h5 className="text-muted mb-2">{variantObj.name}</h5>
61
- <div className="d-flex gap-3 flex-wrap">
62
- {variantModals.map((modal) => (
63
- <LionButton
64
- key={modal.id}
65
- platform={PlatformTypes.IOS}
66
- variant={modal.variant}
67
- styleType={IOSStyleTypes.TINTED}
68
- shape={IOSShapeTypes.ROUNDED}
69
- // @ts-ignore
70
- type={ButtonTypes.BUTTON}
71
- onClick={() => updateState({ modal: modal.id })}
72
- >
73
- {modal.label}
74
- </LionButton>
75
- ))}
76
- </div>
77
- </div>
78
- );
79
- })}
80
-
81
- {modalsConfig.map((modal) => (
82
- <LionModal
83
- key={modal.id}
84
- backdrop={"static"}
85
- platform={PlatformTypes.IOS}
86
- modalId={modal.id}
87
- variant={modal.variant}
88
- title={modal.title}
89
- size={modal.size}
90
- fullscreen={modal.fullscreen}
91
- body={<ModalsDefaultForm platform={PlatformTypes.IOS} variant={modal.variant} />}
92
- buttons={(
93
- <LionButton
94
- variant={VariantTypes.MODAL}
95
- //@ts-ignore
96
- type={ButtonTypes.BUTTON}
97
- onClick={() => alert("Clicked")}
98
- >
99
- Click
100
- </LionButton>
101
- )}
102
- />
103
- ))}
104
- </Fragment>
105
- );
106
- }
@@ -1,99 +0,0 @@
1
- import { Fragment } from "react";
2
- import { ButtonTypes } from "../../../types/ButtonTypes.tsx";
3
- import { VariantTypes } from "../../../types/VariantTypes.tsx";
4
- import { PlatformTypes } from "../../../types/PlatformTypes.tsx";
5
- import { SizeTypes } from "../../../types/SizeTypes.tsx";
6
- import { useLionUI } from "../../../context/LionUIComponentsContext.tsx";
7
- import LionModal from "../../../components/modals/LionModal.tsx";
8
- import ModalsDefaultForm from "./ModalsDefaultForm.tsx";
9
- import LionButton from "../../../components/buttons/LionButton.tsx";
10
-
11
- const variantsList = [
12
- { type: VariantTypes.SUCCESS, name: "Success" },
13
- { type: VariantTypes.INFO, name: "Info" },
14
- { type: VariantTypes.PRIMARY, name: "Primary" },
15
- { type: VariantTypes.DANGER, name: "Danger" },
16
- { type: VariantTypes.WARNING, name: "Warning" },
17
- { type: VariantTypes.LIGHT, name: "Light" },
18
- { type: VariantTypes.LINK, name: "Link" },
19
- { type: VariantTypes.DARK, name: "Dark" },
20
- { type: VariantTypes.LION_PACKAGES, name: "Lion Packages" },
21
- { type: VariantTypes.LION_PARKING, name: "Lion Parking" },
22
- { type: VariantTypes.LION_TECH, name: "Lion Tech" },
23
- { type: VariantTypes.LION_GLAM, name: "Lion Glam" },
24
- ];
25
-
26
- const sizesList = [
27
- { size: SizeTypes.SM, label: "SM", titleSuffix: "Small Modal" },
28
- { size: SizeTypes.LG, label: "LG", titleSuffix: "Large Modal" },
29
- { size: SizeTypes.XL, label: "XL", titleSuffix: "Extra Large Modal" },
30
- { size: SizeTypes.LG, label: "Full", titleSuffix: "Fullscreen Modal", fullscreen: true as const },
31
- ];
32
-
33
- const modalsConfig = variantsList.flatMap((variantObj) =>
34
- sizesList.map((sizeObj) => ({
35
- id: `web-modal-${variantObj.type}-${sizeObj.label.toLowerCase()}`,
36
- label: sizeObj.label,
37
- size: sizeObj.size,
38
- fullscreen: sizeObj.fullscreen,
39
- variant: variantObj.type,
40
- title: `Web ${variantObj.name} ${sizeObj.titleSuffix}`,
41
- }))
42
- );
43
-
44
- export default function ModalsWebSection() {
45
- const { updateState } = useLionUI();
46
-
47
- return (
48
- <Fragment>
49
- <h2>Modals (Web)</h2>
50
-
51
- {variantsList.map((variantObj) => {
52
- const variantModals = modalsConfig.filter(
53
- (modal) => modal.variant === variantObj.type
54
- );
55
-
56
- return (
57
- <div key={variantObj.type} className="mb-4">
58
- <h5 className="text-muted mb-2">{variantObj.name}</h5>
59
- <div className="d-flex gap-3 flex-wrap">
60
- {variantModals.map((modal) => (
61
- <LionButton
62
- key={modal.id}
63
- platform={PlatformTypes.WEB}
64
- variant={modal.variant}
65
- type={ButtonTypes.BUTTON}
66
- onClick={() => updateState({ modal: modal.id })}
67
- >
68
- {modal.label}
69
- </LionButton>
70
- ))}
71
- </div>
72
- </div>
73
- );
74
- })}
75
-
76
- {modalsConfig.map((modal) => (
77
- <LionModal
78
- key={modal.id}
79
- platform={PlatformTypes.WEB}
80
- modalId={modal.id}
81
- variant={modal.variant}
82
- title={modal.title}
83
- size={modal.size}
84
- fullscreen={modal.fullscreen}
85
- body={<ModalsDefaultForm variant={modal.variant} />}
86
- buttons={(
87
- <LionButton
88
- variant={VariantTypes.MODAL}
89
- type={ButtonTypes.BUTTON}
90
- onClick={() => alert("Clicked")}
91
- >
92
- Click
93
- </LionButton>
94
- )}
95
- />
96
- ))}
97
- </Fragment>
98
- );
99
- }
@@ -1,7 +0,0 @@
1
- import React from "react";
2
- import type { PlatformTypes } from "../types/PlatformTypes.tsx";
3
-
4
- export interface LionUIComponentsProviderProps {
5
- children: React.ReactNode;
6
- defaultPlatform?: PlatformTypes;
7
- }
@@ -1,6 +0,0 @@
1
- import type { LionUIState } from "./LionUIState.tsx";
2
-
3
- export interface LionUIContextProps {
4
- state: LionUIState;
5
- updateState: (partial: Partial<LionUIState>) => void;
6
- }
@@ -1,8 +0,0 @@
1
- import type { PlatformTypes } from "../types/PlatformTypes.tsx";
2
-
3
- export interface LionUIState {
4
- platform: PlatformTypes;
5
- loading: boolean;
6
- reload: boolean;
7
- modal?: string | null;
8
- }
package/src/main.tsx DELETED
@@ -1,9 +0,0 @@
1
- import { createRoot } from 'react-dom/client'
2
- import App from "./App.tsx";
3
- import {BrowserRouter} from 'react-router-dom';
4
-
5
- createRoot(document.getElementById('root')!).render(
6
- <BrowserRouter>
7
- <App />
8
- </BrowserRouter>,
9
- )
@@ -1,7 +0,0 @@
1
- export const AndroidInputShapeTypes = {
2
- SMALL: "small",
3
- NORMAL: "normal",
4
- } as const;
5
-
6
- export type AndroidInputShapeTypes =
7
- (typeof AndroidInputShapeTypes)[keyof typeof AndroidInputShapeTypes];
@@ -1,7 +0,0 @@
1
- export const AndroidInputStyleTypes = {
2
- FILLED: "filled",
3
- OUTLINED: "outlined",
4
- } as const;
5
-
6
- export type AndroidInputStyleTypes =
7
- (typeof AndroidInputStyleTypes)[keyof typeof AndroidInputStyleTypes];