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