@lion-npm/ui 1.0.2 → 1.0.4

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 (106) hide show
  1. package/dist/components/buttons/AndroidButton.d.ts +16 -0
  2. package/dist/components/buttons/BootstrapButton.d.ts +16 -0
  3. package/dist/components/buttons/IOSButton.d.ts +16 -0
  4. package/dist/components/buttons/LionButton.d.ts +18 -0
  5. package/dist/components/inputs/AndroidInput.d.ts +20 -0
  6. package/dist/components/inputs/BootstrapInput.d.ts +16 -0
  7. package/dist/components/inputs/IOSInput.d.ts +21 -0
  8. package/dist/components/inputs/LionInput.d.ts +27 -0
  9. package/dist/components/loadings/LoadingBar.d.ts +5 -0
  10. package/dist/components/modals/LionModal.d.ts +17 -0
  11. package/dist/context/LionUIComponentsContext.d.ts +5 -0
  12. package/{src/index.ts → dist/index.d.ts} +1 -3
  13. package/dist/index.js +2564 -0
  14. package/{src/interfaces/LionUIComponentsProviderProps.tsx → dist/interfaces/LionUIComponentsProviderProps.d.ts} +1 -2
  15. package/{src/interfaces/LionUIContextProps.tsx → dist/interfaces/LionUIContextProps.d.ts} +1 -2
  16. package/{src/interfaces/LionUIState.tsx → dist/interfaces/LionUIState.d.ts} +2 -3
  17. package/dist/style.css +2 -0
  18. package/dist/types/Android/AndroidInputShapeTypes.d.ts +5 -0
  19. package/dist/types/Android/AndroidInputStyleTypes.d.ts +5 -0
  20. package/dist/types/Android/AndroidShapeTypes.d.ts +5 -0
  21. package/dist/types/Android/AndroidStyleTypes.d.ts +8 -0
  22. package/dist/types/ButtonTypes.d.ts +7 -0
  23. package/dist/types/IOS/IOSInputShapeTypes.d.ts +6 -0
  24. package/dist/types/IOS/IOSInputStyleTypes.d.ts +8 -0
  25. package/dist/types/IOS/IOSShapeTypes.d.ts +5 -0
  26. package/dist/types/IOS/IOSStyleTypes.d.ts +7 -0
  27. package/dist/types/InputTypes.d.ts +11 -0
  28. package/dist/types/PlatformTypes.d.ts +7 -0
  29. package/dist/types/SizeTypes.d.ts +9 -0
  30. package/dist/types/VariantTypes.d.ts +17 -0
  31. package/dist/types/Web/BootstrapInputShapeTypes.d.ts +6 -0
  32. package/dist/types/Web/BootstrapInputStyleTypes.d.ts +5 -0
  33. package/dist/types/Web/BootstrapShapeTypes.d.ts +6 -0
  34. package/dist/types/Web/BootstrapStyleTypes.d.ts +5 -0
  35. package/package.json +19 -2
  36. package/.oxlintrc.json +0 -8
  37. package/AGENTS.md +0 -0
  38. package/Dockerfile +0 -7
  39. package/compose.yml +0 -14
  40. package/index.html +0 -15
  41. package/src/App.tsx +0 -84
  42. package/src/assets/css/buttons/buttons-android.css +0 -251
  43. package/src/assets/css/buttons/buttons-ios.css +0 -213
  44. package/src/assets/css/buttons/buttons-web.css +0 -138
  45. package/src/assets/css/custom.css +0 -8
  46. package/src/assets/css/index.css +0 -60
  47. package/src/assets/css/inputs/inputs-android.css +0 -259
  48. package/src/assets/css/inputs/inputs-bootstrap.css +0 -74
  49. package/src/assets/css/inputs/inputs-ios.css +0 -268
  50. package/src/assets/css/loadings/loading-bar.css +0 -86
  51. package/src/assets/css/modals/modals.css +0 -236
  52. package/src/components/buttons/AndroidButton.tsx +0 -43
  53. package/src/components/buttons/BootstrapButton.tsx +0 -50
  54. package/src/components/buttons/IOSButton.tsx +0 -42
  55. package/src/components/buttons/LionButton.tsx +0 -73
  56. package/src/components/inputs/AndroidInput.tsx +0 -158
  57. package/src/components/inputs/BootstrapInput.tsx +0 -106
  58. package/src/components/inputs/IOSInput.tsx +0 -163
  59. package/src/components/inputs/LionInput.tsx +0 -81
  60. package/src/components/loadings/LoadingBar.tsx +0 -21
  61. package/src/components/modals/LionModal.tsx +0 -155
  62. package/src/context/LionUIComponentsContext.tsx +0 -73
  63. package/src/features/Header.tsx +0 -83
  64. package/src/features/VariantList.tsx +0 -19
  65. package/src/features/buttons/ButtonsSection.tsx +0 -7
  66. package/src/features/buttons/components/ButtonsAndroidSection.tsx +0 -79
  67. package/src/features/buttons/components/ButtonsBootstrapSection.tsx +0 -77
  68. package/src/features/buttons/components/ButtonsCustomSection.tsx +0 -234
  69. package/src/features/buttons/components/ButtonsIOSSection.tsx +0 -78
  70. package/src/features/inputs/InputsSection.tsx +0 -7
  71. package/src/features/inputs/components/InputsAndroidSection.tsx +0 -155
  72. package/src/features/inputs/components/InputsBootstrapSection.tsx +0 -154
  73. package/src/features/inputs/components/InputsCustomSection.tsx +0 -234
  74. package/src/features/inputs/components/InputsIOSSection.tsx +0 -156
  75. package/src/features/loadings/LoadingSection.tsx +0 -5
  76. package/src/features/loadings/components/LoadingBarSection.tsx +0 -74
  77. package/src/features/modals/ModalsSection.tsx +0 -5
  78. package/src/features/modals/components/ModalsAndroidSection.tsx +0 -108
  79. package/src/features/modals/components/ModalsDefaultForm.tsx +0 -31
  80. package/src/features/modals/components/ModalsDefaultInput.tsx +0 -22
  81. package/src/features/modals/components/ModalsIOSSection.tsx +0 -106
  82. package/src/features/modals/components/ModalsWebSection.tsx +0 -104
  83. package/src/main.tsx +0 -9
  84. package/src/types/Android/AndroidInputShapeTypes.tsx +0 -7
  85. package/src/types/Android/AndroidInputStyleTypes.tsx +0 -7
  86. package/src/types/Android/AndroidShapeTypes.tsx +0 -6
  87. package/src/types/Android/AndroidStyleTypes.tsx +0 -9
  88. package/src/types/ButtonTypes.tsx +0 -9
  89. package/src/types/IOS/IOSInputShapeTypes.tsx +0 -9
  90. package/src/types/IOS/IOSInputStyleTypes.tsx +0 -11
  91. package/src/types/IOS/IOSShapeTypes.tsx +0 -7
  92. package/src/types/IOS/IOSStyleTypes.tsx +0 -9
  93. package/src/types/InputTypes.tsx +0 -13
  94. package/src/types/PlatformTypes.tsx +0 -9
  95. package/src/types/SizeTypes.tsx +0 -11
  96. package/src/types/VariantTypes.tsx +0 -19
  97. package/src/types/Web/BootstrapInputShapeTypes.tsx +0 -9
  98. package/src/types/Web/BootstrapInputStyleTypes.tsx +0 -8
  99. package/src/types/Web/BootstrapShapeTypes.tsx +0 -8
  100. package/src/types/Web/BootstrapStyleTypes.tsx +0 -7
  101. package/tsconfig.app.json +0 -26
  102. package/tsconfig.json +0 -7
  103. package/tsconfig.node.json +0 -23
  104. package/vite.config.ts +0 -30
  105. /package/{public → dist}/favicon.svg +0 -0
  106. /package/{public → dist}/icons.svg +0 -0
@@ -1,154 +0,0 @@
1
- import { Fragment, useState } from "react";
2
- import VariantList from "../../VariantList";
3
- import { InputTypes } from "../../../types/InputTypes";
4
- import {BootstrapInputShapeTypes} from "../../../types/Web/BootstrapInputShapeTypes.tsx";
5
- import {BootstrapInputStyleTypes} from "../../../types/Web/BootstrapInputStyleTypes.tsx";
6
- import BootstrapInput from "../../../components/inputs/BootstrapInput";
7
-
8
- const StyleTypeList: Array<{ label: string; styleType: BootstrapInputStyleTypes }> = [
9
- { label: "Floating Labels", styleType: BootstrapInputStyleTypes.FLOATING },
10
- { label: "Standard Label", styleType: BootstrapInputStyleTypes.STANDARD },
11
- ];
12
-
13
- const ShapeList: Array<{ label: string; shape: BootstrapInputShapeTypes }> = [
14
- { label: "Rounded Shape", shape: BootstrapInputShapeTypes.ROUNDED },
15
- { label: "Pill Shape", shape: BootstrapInputShapeTypes.PILL },
16
- { label: "Square Shape", shape: BootstrapInputShapeTypes.SQUARE },
17
- ];
18
-
19
- export default function InputsBootstrapSection() {
20
- const [inputValue, setInputValue] = useState<string>("");
21
-
22
- const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
23
- setInputValue(e.target.value);
24
- };
25
-
26
- return (
27
- <Fragment>
28
- <h2>Inputs (Bootstrap 5 Desktop)</h2>
29
-
30
- {StyleTypeList.map(({ label: styleLabel, styleType }) => (
31
- <div key={styleType} className="my-4">
32
- <h4 className="text-primary mb-3">{styleLabel}</h4>
33
-
34
- {ShapeList.map(({ label: shapeLabel, shape }) => (
35
- <div key={`${styleType}-${shape}`} className="mb-5">
36
- <div className={"ms-3"}>
37
- <h6 className="text-secondary mb-3">{shapeLabel}</h6>
38
- </div>
39
-
40
- {/* Enabled State */}
41
- <div className="mb-4">
42
- <span className="text-muted d-block mb-2 small font-monospace">Enabled</span>
43
- <div className="row g-3">
44
- {VariantList.map((variant) => (
45
- <div key={`${styleType}-${shape}-${variant}-enabled`} className="col-12 col-md-6 col-lg-4">
46
- <BootstrapInput
47
- type={InputTypes.TEXT}
48
- styleType={styleType}
49
- shape={shape}
50
- variant={variant}
51
- label={`Field (${variant})`}
52
- helperText="Optional helper text"
53
- required={true}
54
- placeholder="Custom Placeholder..."
55
- value={inputValue}
56
- onChange={handleChange}
57
- />
58
- </div>
59
- ))}
60
- </div>
61
- </div>
62
-
63
- {/* With Value / Floating State */}
64
- <div className="mb-4">
65
- <span className="text-muted d-block mb-2 small font-monospace">With Value / Floating</span>
66
- <div className="row g-3">
67
- {VariantList.map((variant) => (
68
- <div key={`${styleType}-${shape}-${variant}-value`} className="col-12 col-md-6 col-lg-4">
69
- <BootstrapInput
70
- type={InputTypes.TEXT}
71
- styleType={styleType}
72
- shape={shape}
73
- variant={variant}
74
- label="Username"
75
- defaultValue="lion.developer"
76
- helperText="Completed field"
77
- placeholder="Custom Placeholder..."
78
- />
79
- </div>
80
- ))}
81
- </div>
82
- </div>
83
-
84
- {/* Error State */}
85
- <div className="mb-4">
86
- <span className="text-muted d-block mb-2 small font-monospace">Error State</span>
87
- <div className="row g-3">
88
- {VariantList.map((variant) => (
89
- <div key={`${styleType}-${shape}-${variant}-error`} className="col-12 col-md-6 col-lg-4">
90
- <BootstrapInput
91
- type={InputTypes.TEXT}
92
- styleType={styleType}
93
- shape={shape}
94
- variant={variant}
95
- label="Email Address"
96
- defaultValue="invalid-email"
97
- error="The email format is invalid"
98
- placeholder="Custom Placeholder..."
99
- />
100
- </div>
101
- ))}
102
- </div>
103
- </div>
104
-
105
- {/* Disabled State */}
106
- <div className="mb-4">
107
- <span className="text-muted d-block mb-2 small font-monospace">Disabled</span>
108
- <div className="row g-3">
109
- {VariantList.map((variant) => (
110
- <div key={`${styleType}-${shape}-${variant}-disabled`} className="col-12 col-md-6 col-lg-4">
111
- <BootstrapInput
112
- type={InputTypes.TEXT}
113
- styleType={styleType}
114
- shape={shape}
115
- variant={variant}
116
- label="Disabled"
117
- defaultValue="Locked value"
118
- disabled={true}
119
- helperText="Non-editable"
120
- placeholder="Custom Placeholder..."
121
- />
122
- </div>
123
- ))}
124
- </div>
125
- </div>
126
-
127
- {/* Readonly State */}
128
- <div>
129
- <span className="text-muted d-block mb-2 small font-monospace">ReadOnly</span>
130
- <div className="row g-3">
131
- {VariantList.map((variant) => (
132
- <div key={`${styleType}-${shape}-${variant}-readonly`} className="col-12 col-md-6 col-lg-4">
133
- <BootstrapInput
134
- type={InputTypes.TEXT}
135
- styleType={styleType}
136
- shape={shape}
137
- variant={variant}
138
- label="ReadOnly"
139
- defaultValue="Locked value"
140
- readOnly={true}
141
- helperText="Non-editable"
142
- placeholder="Custom Placeholder..."
143
- />
144
- </div>
145
- ))}
146
- </div>
147
- </div>
148
- </div>
149
- ))}
150
- </div>
151
- ))}
152
- </Fragment>
153
- );
154
- }
@@ -1,234 +0,0 @@
1
- import VariantList from "../../VariantList.tsx";
2
- import { PlatformTypes } from "../../../types/PlatformTypes.tsx";
3
- import { InputTypes } from "../../../types/InputTypes.tsx";
4
- import { AndroidInputStyleTypes } from "../../../types/Android/AndroidInputStyleTypes.tsx";
5
- import { IOSInputStyleTypes } from "../../../types/IOS/IOSInputStyleTypes.tsx";
6
- import { BootstrapInputStyleTypes } from "../../../types/Web/BootstrapInputStyleTypes.tsx";
7
- import { AndroidInputShapeTypes } from "../../../types/Android/AndroidInputShapeTypes.tsx";
8
- import { BootstrapInputShapeTypes } from "../../../types/Web/BootstrapInputShapeTypes.tsx";
9
- import { IOSInputShapeTypes } from "../../../types/IOS/IOSInputShapeTypes.tsx";
10
- import { Fragment, useState } from "react";
11
- import LionInput from "../../../components/inputs/LionInput.tsx";
12
-
13
- const shapesByPlatform = {
14
- [PlatformTypes.ANDROID]: [
15
- { label: "Small", value: AndroidInputShapeTypes.SMALL },
16
- { label: "Normal", value: AndroidInputShapeTypes.NORMAL },
17
- ],
18
- [PlatformTypes.IOS]: [
19
- { label: "Rounded", value: IOSInputShapeTypes.ROUNDED },
20
- { label: "Pill", value: IOSInputShapeTypes.PILL },
21
- { label: "Square", value: IOSInputShapeTypes.SQUARE },
22
- ],
23
- [PlatformTypes.WEB]: [
24
- { label: "Rounded", value: BootstrapInputShapeTypes.ROUNDED },
25
- { label: "Pill", value: BootstrapInputShapeTypes.PILL },
26
- { label: "Square", value: BootstrapInputShapeTypes.SQUARE },
27
- ],
28
- };
29
-
30
- const stylesByPlatform = {
31
- [PlatformTypes.ANDROID]: [
32
- { label: "Outlined", value: AndroidInputStyleTypes.OUTLINED },
33
- { label: "Filled", value: AndroidInputStyleTypes.FILLED },
34
- ],
35
- [PlatformTypes.IOS]: [
36
- { label: "Form", value: IOSInputStyleTypes.FORM },
37
- { label: "Rounded Border", value: IOSInputStyleTypes.ROUNDED_BORDER },
38
- { label: "Filled", value: IOSInputStyleTypes.FILLED },
39
- { label: "Outlined", value: IOSInputStyleTypes.OUTLINED },
40
- { label: "Plain", value: IOSInputStyleTypes.PLAIN },
41
- ],
42
- [PlatformTypes.WEB]: [
43
- { label: "Floating", value: BootstrapInputStyleTypes.FLOATING },
44
- { label: "Standard", value: BootstrapInputStyleTypes.STANDARD },
45
- ],
46
- };
47
-
48
- export default function InputsCustomSection() {
49
- const [selectedPlatform, setSelectedPlatform] = useState<PlatformTypes>(PlatformTypes.ANDROID);
50
- const [selectedAndroidShape, setSelectedAndroidShape] = useState<AndroidInputShapeTypes>(AndroidInputShapeTypes.NORMAL);
51
- const [selectedIOSShape, setSelectedIOSShape] = useState<IOSInputShapeTypes>(IOSInputShapeTypes.ROUNDED);
52
- const [selectedWebShape, setSelectedWebShape] = useState<BootstrapInputShapeTypes>(BootstrapInputShapeTypes.ROUNDED);
53
-
54
- const [selectedAndroidStyle, setSelectedAndroidStyle] = useState<AndroidInputStyleTypes>(AndroidInputStyleTypes.OUTLINED);
55
- const [selectedIOSStyle, setSelectedIOSStyle] = useState<IOSInputStyleTypes>(IOSInputStyleTypes.ROUNDED_BORDER);
56
- const [selectedWebStyle, setSelectedWebStyle] = useState<BootstrapInputStyleTypes>(BootstrapInputStyleTypes.FLOATING);
57
-
58
- return (
59
- <Fragment>
60
- <h2>Inputs (Custom Cross-Platform Test)</h2>
61
-
62
- <div className="card p-3 mb-4 bg-light">
63
- <div className="row g-3">
64
- <div className="col-md-4">
65
- <label className="form-label fw-bold">Platform:</label>
66
- <div className="btn-group w-100" role="group">
67
- <button
68
- type="button"
69
- className={`btn ${selectedPlatform === PlatformTypes.ANDROID ? "btn-primary" : "btn-outline-primary"}`}
70
- onClick={() => setSelectedPlatform(PlatformTypes.ANDROID)}
71
- >
72
- Android
73
- </button>
74
- <button
75
- type="button"
76
- className={`btn ${selectedPlatform === PlatformTypes.IOS ? "btn-primary" : "btn-outline-primary"}`}
77
- onClick={() => setSelectedPlatform(PlatformTypes.IOS)}
78
- >
79
- iOS
80
- </button>
81
- <button
82
- type="button"
83
- className={`btn ${selectedPlatform === PlatformTypes.WEB ? "btn-primary" : "btn-outline-primary"}`}
84
- onClick={() => setSelectedPlatform(PlatformTypes.WEB)}
85
- >
86
- Web
87
- </button>
88
- </div>
89
- </div>
90
-
91
- <div className="col-md-4">
92
- <label className="form-label fw-bold">Shape:</label>
93
-
94
- {selectedPlatform === PlatformTypes.ANDROID && (
95
- <select
96
- className="form-select"
97
- value={selectedAndroidShape}
98
- onChange={(e) => setSelectedAndroidShape(e.target.value as AndroidInputShapeTypes)}
99
- >
100
- {shapesByPlatform[PlatformTypes.ANDROID].map((s) => (
101
- <option key={s.value} value={s.value}>{s.label}</option>
102
- ))}
103
- </select>
104
- )}
105
-
106
- {selectedPlatform === PlatformTypes.IOS && (
107
- <select
108
- className="form-select"
109
- value={selectedIOSShape}
110
- onChange={(e) => setSelectedIOSShape(e.target.value as IOSInputShapeTypes)}
111
- >
112
- {shapesByPlatform[PlatformTypes.IOS].map((s) => (
113
- <option key={s.value} value={s.value}>{s.label}</option>
114
- ))}
115
- </select>
116
- )}
117
-
118
- {selectedPlatform === PlatformTypes.WEB && (
119
- <select
120
- className="form-select"
121
- value={selectedWebShape}
122
- onChange={(e) => setSelectedWebShape(e.target.value as BootstrapInputShapeTypes)}
123
- >
124
- {shapesByPlatform[PlatformTypes.WEB].map((s) => (
125
- <option key={s.value} value={s.value}>{s.label}</option>
126
- ))}
127
- </select>
128
- )}
129
- </div>
130
-
131
- <div className="col-md-4">
132
- <label className="form-label fw-bold">StyleType:</label>
133
- {selectedPlatform === PlatformTypes.ANDROID && (
134
- <select
135
- className="form-select"
136
- value={selectedAndroidStyle}
137
- onChange={(e) => setSelectedAndroidStyle(e.target.value as AndroidInputStyleTypes)}
138
- >
139
- {stylesByPlatform[PlatformTypes.ANDROID].map((s) => (
140
- <option key={s.value} value={s.value}>{s.label}</option>
141
- ))}
142
- </select>
143
- )}
144
-
145
- {selectedPlatform === PlatformTypes.IOS && (
146
- <select
147
- className="form-select"
148
- value={selectedIOSStyle}
149
- onChange={(e) => setSelectedIOSStyle(e.target.value as IOSInputStyleTypes)}
150
- >
151
- {stylesByPlatform[PlatformTypes.IOS].map((s) => (
152
- <option key={s.value} value={s.value}>{s.label}</option>
153
- ))}
154
- </select>
155
- )}
156
-
157
- {selectedPlatform === PlatformTypes.WEB && (
158
- <select
159
- className="form-select"
160
- value={selectedWebStyle}
161
- onChange={(e) => setSelectedWebStyle(e.target.value as BootstrapInputStyleTypes)}
162
- >
163
- {stylesByPlatform[PlatformTypes.WEB].map((s) => (
164
- <option key={s.value} value={s.value}>{s.label}</option>
165
- ))}
166
- </select>
167
- )}
168
- </div>
169
- </div>
170
- </div>
171
-
172
- <div className="my-4">
173
- <div className="ms-3 mb-4">
174
- {/* Enabled State */}
175
- <div className="mb-4">
176
- <span className="text-muted d-block mb-2 small fw-bold">Enabled</span>
177
- <div className="row g-3">
178
- {VariantList.map((variant) => (
179
- <div key={`custom-input-${variant}-enabled`} className="col-md-4">
180
- <LionInput
181
- type={InputTypes.TEXT}
182
- platform={selectedPlatform}
183
- variant={variant}
184
- label={`${variant} input`}
185
- placeholder="Enter text..."
186
- styleType={{
187
- android: selectedAndroidStyle,
188
- ios: selectedIOSStyle,
189
- web: selectedWebStyle,
190
- }}
191
- shape={{
192
- android: selectedAndroidShape,
193
- ios: selectedIOSShape,
194
- web: selectedWebShape,
195
- }}
196
- />
197
- </div>
198
- ))}
199
- </div>
200
- </div>
201
-
202
- {/* Disabled State */}
203
- <div>
204
- <span className="text-muted d-block mb-2 small fw-bold">Disabled</span>
205
- <div className="row g-3">
206
- {VariantList.map((variant) => (
207
- <div key={`custom-input-${variant}-disabled`} className="col-md-4">
208
- <LionInput
209
- type={InputTypes.TEXT}
210
- platform={selectedPlatform}
211
- variant={variant}
212
- label={`${variant} input`}
213
- placeholder="Disabled..."
214
- disabled={true}
215
- styleType={{
216
- android: selectedAndroidStyle,
217
- ios: selectedIOSStyle,
218
- web: selectedWebStyle,
219
- }}
220
- shape={{
221
- android: selectedAndroidShape,
222
- ios: selectedIOSShape,
223
- web: selectedWebShape,
224
- }}
225
- />
226
- </div>
227
- ))}
228
- </div>
229
- </div>
230
- </div>
231
- </div>
232
- </Fragment>
233
- );
234
- }
@@ -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
- }