@lion-npm/ui 0.0.0-stage → 1.0.1
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/.oxlintrc.json +8 -0
- package/AGENTS.md +0 -0
- package/Dockerfile +7 -0
- package/LICENSE +21 -0
- package/README.md +31 -2
- package/compose.yml +14 -0
- package/index.html +15 -0
- package/package.json +27 -4
- package/public/favicon.svg +1 -0
- package/public/icons.svg +24 -0
- package/src/App.tsx +81 -0
- package/src/assets/css/buttons/buttons-android.css +251 -0
- package/src/assets/css/buttons/buttons-ios.css +213 -0
- package/src/assets/css/buttons/buttons-web.css +138 -0
- package/src/assets/css/custom.css +8 -0
- package/src/assets/css/index.css +60 -0
- package/src/assets/css/inputs/inputs-android.css +259 -0
- package/src/assets/css/inputs/inputs-bootstrap.css +74 -0
- package/src/assets/css/inputs/inputs-ios.css +268 -0
- package/src/assets/css/loadings/loading-bar.css +86 -0
- package/src/assets/css/modals/modals.css +236 -0
- package/src/components/buttons/AndroidButton.tsx +43 -0
- package/src/components/buttons/BootstrapButton.tsx +50 -0
- package/src/components/buttons/IOSButton.tsx +42 -0
- package/src/components/buttons/LionButton.tsx +76 -0
- package/src/components/inputs/AndroidInput.tsx +158 -0
- package/src/components/inputs/BootstrapInput.tsx +106 -0
- package/src/components/inputs/IOSInput.tsx +163 -0
- package/src/components/loadings/LoadingBar.tsx +21 -0
- package/src/components/modals/LionModal.tsx +157 -0
- package/src/context/LionUIComponentsContext.tsx +65 -0
- package/src/features/Header.tsx +77 -0
- package/src/features/VariantList.tsx +19 -0
- package/src/features/buttons/ButtonsSection.tsx +7 -0
- package/src/features/buttons/components/ButtonsAndroidSection.tsx +79 -0
- package/src/features/buttons/components/ButtonsBootstrapSection.tsx +77 -0
- package/src/features/buttons/components/ButtonsCustomSection.tsx +234 -0
- package/src/features/buttons/components/ButtonsIOSSection.tsx +78 -0
- package/src/features/inputs/InputsSection.tsx +7 -0
- package/src/features/inputs/components/InputsAndroidSection.tsx +155 -0
- package/src/features/inputs/components/InputsBootstrapSection.tsx +154 -0
- package/src/features/inputs/components/InputsIOSSection.tsx +156 -0
- package/src/features/loadings/LoadingSection.tsx +5 -0
- package/src/features/loadings/components/LoadingBarSection.tsx +74 -0
- package/src/features/modals/ModalsSection.tsx +5 -0
- package/src/features/modals/components/ModalsAndroidSection.tsx +103 -0
- package/src/features/modals/components/ModalsDefaultForm.tsx +31 -0
- package/src/features/modals/components/ModalsDefaultInput.tsx +22 -0
- package/src/features/modals/components/ModalsIOSSection.tsx +106 -0
- package/src/features/modals/components/ModalsWebSection.tsx +99 -0
- package/src/interfaces/LionUIComponentsProviderProps.tsx +7 -0
- package/src/interfaces/LionUIContextProps.tsx +6 -0
- package/src/interfaces/LionUIState.tsx +8 -0
- package/src/main.tsx +9 -0
- package/src/types/Android/AndroidInputShapeTypes.tsx +7 -0
- package/src/types/Android/AndroidInputStyleTypes.tsx +7 -0
- package/src/types/Android/AndroidShapeTypes.tsx +6 -0
- package/src/types/Android/AndroidStyleTypes.tsx +9 -0
- package/src/types/ButtonTypes.tsx +9 -0
- package/src/types/IOS/IOSShapeTypes.tsx +7 -0
- package/src/types/IOS/IOSStyleTypes.tsx +9 -0
- package/src/types/IOS/iOSInputShapeTypes.tsx +9 -0
- package/src/types/IOS/iOSInputStyleTypes.tsx +11 -0
- package/src/types/InputTypes.tsx +13 -0
- package/src/types/PlatformTypes.tsx +9 -0
- package/src/types/SizeTypes.tsx +11 -0
- package/src/types/VariantTypes.tsx +19 -0
- package/src/types/Web/BootstrapInputShapeTypes.tsx +9 -0
- package/src/types/Web/BootstrapInputStyleTypes.tsx +8 -0
- package/src/types/Web/BootstrapShapeTypes.tsx +8 -0
- package/src/types/Web/BootstrapStyleTypes.tsx +7 -0
- package/tsconfig.app.json +26 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +23 -0
- package/vite.config.ts +11 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type { FC, ReactNode } from "react";
|
|
2
|
+
import { Button, Modal } from "react-bootstrap";
|
|
3
|
+
import { VariantTypes } from "../../types/VariantTypes.tsx";
|
|
4
|
+
import { PlatformTypes } from "../../types/PlatformTypes.tsx";
|
|
5
|
+
import { ButtonTypes } from "../../types/ButtonTypes.tsx";
|
|
6
|
+
import { SizeTypes } from "../../types/SizeTypes.tsx";
|
|
7
|
+
import { useLionUI } from "../../context/LionUIComponentsContext.tsx";
|
|
8
|
+
|
|
9
|
+
export interface LionModalProps {
|
|
10
|
+
modalId: string;
|
|
11
|
+
title: string;
|
|
12
|
+
body: ReactNode;
|
|
13
|
+
buttons?: ReactNode;
|
|
14
|
+
backdrop: string;
|
|
15
|
+
fullscreen?: true | "sm" | "md" | "lg" | "xl" | "xxl" | "sm-down" | "md-down" | "lg-down" | "xl-down" | "xxl-down";
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
size?: SizeTypes.SM | SizeTypes.LG | SizeTypes.XL;
|
|
18
|
+
variant?: VariantTypes | string;
|
|
19
|
+
platform?: string;
|
|
20
|
+
cancelButtonIcon?: ReactNode;
|
|
21
|
+
cancelButtonText?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function LionModal({
|
|
25
|
+
modalId,
|
|
26
|
+
title,
|
|
27
|
+
body,
|
|
28
|
+
buttons,
|
|
29
|
+
backdrop = "static",
|
|
30
|
+
fullscreen = "sm-down",
|
|
31
|
+
size = SizeTypes.LG,
|
|
32
|
+
variant = VariantTypes.LIGHT,
|
|
33
|
+
platform = undefined,
|
|
34
|
+
cancelButtonIcon = null,
|
|
35
|
+
cancelButtonText = "Cancel",
|
|
36
|
+
}: LionModalProps) {
|
|
37
|
+
const { state, updateState } = useLionUI();
|
|
38
|
+
const platformDefined = platform || state.platform;
|
|
39
|
+
const isIOS = platformDefined === PlatformTypes.IOS;
|
|
40
|
+
const isAndroid = platformDefined === PlatformTypes.ANDROID;
|
|
41
|
+
|
|
42
|
+
const modalPlatformClass = isIOS
|
|
43
|
+
? "ios-modal"
|
|
44
|
+
: isAndroid
|
|
45
|
+
? "android-modal"
|
|
46
|
+
: "web-modal";
|
|
47
|
+
|
|
48
|
+
const getHeaderTextColor = (variantType: VariantTypes | string | undefined): string => {
|
|
49
|
+
switch (variantType) {
|
|
50
|
+
case VariantTypes.LIGHT:
|
|
51
|
+
case VariantTypes.LINK:
|
|
52
|
+
case VariantTypes.WARNING:
|
|
53
|
+
case VariantTypes.INFO:
|
|
54
|
+
return "text-dark";
|
|
55
|
+
case VariantTypes.PRIMARY:
|
|
56
|
+
case VariantTypes.SECONDARY:
|
|
57
|
+
case VariantTypes.SUCCESS:
|
|
58
|
+
case VariantTypes.DANGER:
|
|
59
|
+
case VariantTypes.DARK:
|
|
60
|
+
case VariantTypes.LION_GLAM:
|
|
61
|
+
case VariantTypes.LION_TECH:
|
|
62
|
+
case VariantTypes.LION_PACKAGES:
|
|
63
|
+
case VariantTypes.LION_PARKING:
|
|
64
|
+
default:
|
|
65
|
+
return "text-white";
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const getCancelButtonTextColor = (variantType: VariantTypes | string | undefined): string => {
|
|
70
|
+
switch (variantType) {
|
|
71
|
+
case VariantTypes.LIGHT:
|
|
72
|
+
case VariantTypes.LINK:
|
|
73
|
+
case VariantTypes.DARK:
|
|
74
|
+
case VariantTypes.MODAL:
|
|
75
|
+
return "text-dark";
|
|
76
|
+
case VariantTypes.WARNING:
|
|
77
|
+
return "text-warning";
|
|
78
|
+
case VariantTypes.PRIMARY:
|
|
79
|
+
return "text-primary";
|
|
80
|
+
case VariantTypes.INFO:
|
|
81
|
+
return "text-info";
|
|
82
|
+
case VariantTypes.SECONDARY:
|
|
83
|
+
return "text-secondary";
|
|
84
|
+
case VariantTypes.DANGER:
|
|
85
|
+
return "text-danger";
|
|
86
|
+
case VariantTypes.SUCCESS:
|
|
87
|
+
return "text-success";
|
|
88
|
+
case VariantTypes.LION_PARKING:
|
|
89
|
+
case VariantTypes.LION_PACKAGES:
|
|
90
|
+
return "text-lion-packages";
|
|
91
|
+
case VariantTypes.LION_TECH:
|
|
92
|
+
return "text-lion-tech";
|
|
93
|
+
case VariantTypes.LION_GLAM:
|
|
94
|
+
return "text-lion-glam";
|
|
95
|
+
default:
|
|
96
|
+
return "text-white";
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const textColorClass = getHeaderTextColor(variant);
|
|
101
|
+
const cancelTextColorClass = getCancelButtonTextColor(variant);
|
|
102
|
+
|
|
103
|
+
const CancelButton: FC = () => (
|
|
104
|
+
<Button
|
|
105
|
+
// @ts-ignore
|
|
106
|
+
type={ButtonTypes.BUTTON}
|
|
107
|
+
variant={VariantTypes.MODAL}
|
|
108
|
+
id={"modal-cancel-button"}
|
|
109
|
+
className={`btn-modal btn-modal-cancel ${cancelTextColorClass}`}
|
|
110
|
+
onClick={() => updateState({ modal: null })}
|
|
111
|
+
disabled={state.reload || state.loading}
|
|
112
|
+
>
|
|
113
|
+
{cancelButtonIcon ?? cancelButtonText}
|
|
114
|
+
</Button>
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<Modal
|
|
119
|
+
// @ts-ignore
|
|
120
|
+
backdrop={backdrop}
|
|
121
|
+
id={modalId}
|
|
122
|
+
show={modalId === state.modal}
|
|
123
|
+
fullscreen={fullscreen}
|
|
124
|
+
onHide={() => updateState({ modal: null })}
|
|
125
|
+
size={size}
|
|
126
|
+
scrollable
|
|
127
|
+
centered
|
|
128
|
+
className={modalPlatformClass}
|
|
129
|
+
>
|
|
130
|
+
<Modal.Header
|
|
131
|
+
closeButton={!state.reload || !state.loading}
|
|
132
|
+
className={`custom-modal-header py-3 px-4 bg-${variant} ${textColorClass}`}
|
|
133
|
+
>
|
|
134
|
+
<Modal.Title
|
|
135
|
+
className={`custom-modal-title w-100 ${textColorClass} ${
|
|
136
|
+
isIOS ? "text-center fw-semibold" : "text-start fw-bold"
|
|
137
|
+
}`}
|
|
138
|
+
>
|
|
139
|
+
{title}
|
|
140
|
+
</Modal.Title>
|
|
141
|
+
</Modal.Header>
|
|
142
|
+
|
|
143
|
+
{/* state.loading && <LoadingBar /> */}
|
|
144
|
+
|
|
145
|
+
<Modal.Body className="custom-modal-body px-4 py-3">
|
|
146
|
+
{modalId === state.modal ? body : null}
|
|
147
|
+
</Modal.Body>
|
|
148
|
+
|
|
149
|
+
<Modal.Footer className="custom-modal-footer p-0">
|
|
150
|
+
<div className="custom-btn-group w-100 d-flex align-items-stretch">
|
|
151
|
+
<CancelButton />
|
|
152
|
+
{buttons}
|
|
153
|
+
</div>
|
|
154
|
+
</Modal.Footer>
|
|
155
|
+
</Modal>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createContext, type FC, useContext, useEffect, useState } from 'react';
|
|
2
|
+
import { Capacitor } from '@capacitor/core';
|
|
3
|
+
import { PlatformTypes } from "../types/PlatformTypes.tsx";
|
|
4
|
+
import type { LionUIContextProps } from "../interfaces/LionUIContextProps.tsx";
|
|
5
|
+
import type { LionUIComponentsProviderProps } from "../interfaces/LionUIComponentsProviderProps.tsx";
|
|
6
|
+
import type { LionUIState } from "../interfaces/LionUIState.tsx";
|
|
7
|
+
|
|
8
|
+
const LionUIComponentsContext = createContext<LionUIContextProps | undefined>(undefined);
|
|
9
|
+
|
|
10
|
+
export const LionUIComponentsProvider: FC<LionUIComponentsProviderProps> = ({
|
|
11
|
+
children,
|
|
12
|
+
defaultPlatform,
|
|
13
|
+
}) => {
|
|
14
|
+
const [state, setState] = useState<LionUIState>(() => {
|
|
15
|
+
let initialPlatform: PlatformTypes = PlatformTypes.WEB;
|
|
16
|
+
|
|
17
|
+
if (defaultPlatform) {
|
|
18
|
+
initialPlatform = defaultPlatform;
|
|
19
|
+
} else {
|
|
20
|
+
const capPlatform = Capacitor.getPlatform();
|
|
21
|
+
if (capPlatform === 'ios' || capPlatform === 'android') {
|
|
22
|
+
initialPlatform = capPlatform as PlatformTypes;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
platform: initialPlatform,
|
|
28
|
+
loading: false,
|
|
29
|
+
reload: false,
|
|
30
|
+
modal: null,
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const updateState = (partial: Partial<LionUIState>) => {
|
|
35
|
+
setState((prev) => ({ ...prev, ...partial }));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (!defaultPlatform) {
|
|
40
|
+
const capPlatform = Capacitor.getPlatform();
|
|
41
|
+
|
|
42
|
+
const detected: PlatformTypes = capPlatform === 'ios' || capPlatform === 'android' ? (capPlatform as PlatformTypes) : PlatformTypes.WEB;
|
|
43
|
+
|
|
44
|
+
if (detected !== state.platform) {
|
|
45
|
+
setState((prev) => ({ ...prev, platform: detected }));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, [defaultPlatform, state.platform]);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<LionUIComponentsContext.Provider value={{ state, updateState }}>
|
|
52
|
+
{children}
|
|
53
|
+
</LionUIComponentsContext.Provider>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const useLionUI = (): LionUIContextProps => {
|
|
58
|
+
const context = useContext(LionUIComponentsContext);
|
|
59
|
+
|
|
60
|
+
if (!context) {
|
|
61
|
+
throw new Error('useLionUI debe ser utilizado dentro de un LionUIComponentsProvider');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return context;
|
|
65
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import Container from 'react-bootstrap/Container';
|
|
2
|
+
import Nav from 'react-bootstrap/Nav';
|
|
3
|
+
import Navbar from 'react-bootstrap/Navbar';
|
|
4
|
+
import NavDropdown from 'react-bootstrap/NavDropdown';
|
|
5
|
+
import {Link} from "react-router-dom";
|
|
6
|
+
|
|
7
|
+
export default function Header() {
|
|
8
|
+
return (
|
|
9
|
+
<Navbar expand="lg" className="bg-body-tertiary">
|
|
10
|
+
<Container>
|
|
11
|
+
<Navbar.Brand as={Link} to={"/"} href={"#"}>
|
|
12
|
+
Lion-UI
|
|
13
|
+
</Navbar.Brand>
|
|
14
|
+
|
|
15
|
+
<Navbar.Toggle aria-controls="lion-ui-navbar-nav" />
|
|
16
|
+
|
|
17
|
+
<Navbar.Collapse id="lion-ui-navbar-nav">
|
|
18
|
+
<Nav className="ms-auto">
|
|
19
|
+
<NavDropdown title="Buttons" id="buttons-nav-dropdown">
|
|
20
|
+
<NavDropdown.Item as={Link} to={"/buttons/custom"} href={"#"}>
|
|
21
|
+
Custom
|
|
22
|
+
</NavDropdown.Item>
|
|
23
|
+
|
|
24
|
+
<NavDropdown.Divider />
|
|
25
|
+
|
|
26
|
+
<NavDropdown.Item as={Link} to={"/buttons/android"} href={"#"}>
|
|
27
|
+
Android
|
|
28
|
+
</NavDropdown.Item>
|
|
29
|
+
|
|
30
|
+
<NavDropdown.Item as={Link} to={"/buttons/ios"} href={"#"}>
|
|
31
|
+
IOS
|
|
32
|
+
</NavDropdown.Item>
|
|
33
|
+
|
|
34
|
+
<NavDropdown.Item as={Link} to={"/buttons/web"} href={"#"}>
|
|
35
|
+
Web
|
|
36
|
+
</NavDropdown.Item>
|
|
37
|
+
</NavDropdown>
|
|
38
|
+
|
|
39
|
+
<NavDropdown title="Inputs" id="inputs-nav-dropdown">
|
|
40
|
+
<NavDropdown.Item as={Link} to={"/inputs/android"} href={"#"}>
|
|
41
|
+
Android
|
|
42
|
+
</NavDropdown.Item>
|
|
43
|
+
|
|
44
|
+
<NavDropdown.Item as={Link} to={"/inputs/ios"} href={"#"}>
|
|
45
|
+
IOS
|
|
46
|
+
</NavDropdown.Item>
|
|
47
|
+
|
|
48
|
+
<NavDropdown.Item as={Link} to={"/inputs/web"} href={"#"}>
|
|
49
|
+
Web
|
|
50
|
+
</NavDropdown.Item>
|
|
51
|
+
</NavDropdown>
|
|
52
|
+
|
|
53
|
+
<NavDropdown title="Modals" id="modals-nav-dropdown">
|
|
54
|
+
<NavDropdown.Item as={Link} to={"/modals/android"} href={"#"}>
|
|
55
|
+
Android
|
|
56
|
+
</NavDropdown.Item>
|
|
57
|
+
|
|
58
|
+
<NavDropdown.Item as={Link} to={"/modals/ios"} href={"#"}>
|
|
59
|
+
IOS
|
|
60
|
+
</NavDropdown.Item>
|
|
61
|
+
|
|
62
|
+
<NavDropdown.Item as={Link} to={"/modals/web"} href={"#"}>
|
|
63
|
+
Web
|
|
64
|
+
</NavDropdown.Item>
|
|
65
|
+
</NavDropdown>
|
|
66
|
+
|
|
67
|
+
<NavDropdown title="Loadings" id="loadings-nav-dropdown">
|
|
68
|
+
<NavDropdown.Item as={Link} to={"/loadings/bar"} href={"#"}>
|
|
69
|
+
Bar
|
|
70
|
+
</NavDropdown.Item>
|
|
71
|
+
</NavDropdown>
|
|
72
|
+
</Nav>
|
|
73
|
+
</Navbar.Collapse>
|
|
74
|
+
</Container>
|
|
75
|
+
</Navbar>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {VariantTypes} from "../types/VariantTypes.tsx";
|
|
2
|
+
|
|
3
|
+
const VariantList: Array<VariantTypes> = [
|
|
4
|
+
VariantTypes.SECONDARY,
|
|
5
|
+
VariantTypes.PRIMARY,
|
|
6
|
+
VariantTypes.SUCCESS,
|
|
7
|
+
VariantTypes.DANGER,
|
|
8
|
+
VariantTypes.WARNING,
|
|
9
|
+
VariantTypes.INFO,
|
|
10
|
+
VariantTypes.LIGHT,
|
|
11
|
+
VariantTypes.LINK,
|
|
12
|
+
VariantTypes.DARK,
|
|
13
|
+
VariantTypes.LION_PACKAGES,
|
|
14
|
+
VariantTypes.LION_PARKING,
|
|
15
|
+
VariantTypes.LION_TECH,
|
|
16
|
+
VariantTypes.LION_GLAM,
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export default VariantList;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { AndroidStyleTypes } from "../../../types/Android/AndroidStyleTypes.tsx";
|
|
2
|
+
import { AndroidShapeTypes } from "../../../types/Android/AndroidShapeTypes.tsx";
|
|
3
|
+
import { ButtonTypes } from "../../../types/ButtonTypes.tsx";
|
|
4
|
+
import VariantList from "../../VariantList.tsx";
|
|
5
|
+
|
|
6
|
+
import { Fragment } from "react";
|
|
7
|
+
import AndroidButton from "../../../components/buttons/AndroidButton.tsx";
|
|
8
|
+
|
|
9
|
+
// List of Material Design 3 styles
|
|
10
|
+
const StyleTypeList: Array<{ label: string; styleType: AndroidStyleTypes }> = [
|
|
11
|
+
{ label: "Filled", styleType: AndroidStyleTypes.FILLED },
|
|
12
|
+
{ label: "Elevated", styleType: AndroidStyleTypes.ELEVATED },
|
|
13
|
+
{ label: "Tonal", styleType: AndroidStyleTypes.TONAL },
|
|
14
|
+
{ label: "Outlined", styleType: AndroidStyleTypes.OUTLINED },
|
|
15
|
+
{ label: "Text", styleType: AndroidStyleTypes.TEXT },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
// List of supported button shapes
|
|
19
|
+
const ShapeList: Array<{ label: string; shape: AndroidShapeTypes }> = [
|
|
20
|
+
{ label: "Pill Shape", shape: AndroidShapeTypes.PILL },
|
|
21
|
+
{ label: "Rounded Shape", shape: AndroidShapeTypes.ROUNDED },
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export default function ButtonsAndroidSection() {
|
|
25
|
+
return (
|
|
26
|
+
<Fragment>
|
|
27
|
+
<h2>Buttons (Android MD3)</h2>
|
|
28
|
+
|
|
29
|
+
{StyleTypeList.map(({ label: styleLabel, styleType }) => (
|
|
30
|
+
<div key={styleType} className="my-4">
|
|
31
|
+
<h4 className="text-primary mb-3">{styleLabel} Buttons</h4>
|
|
32
|
+
|
|
33
|
+
{ShapeList.map(({ label: shapeLabel, shape }) => (
|
|
34
|
+
<div key={`${styleType}-${shape}`} className="ms-3 mb-4">
|
|
35
|
+
<h6 className="text-secondary mb-2">{shapeLabel}</h6>
|
|
36
|
+
|
|
37
|
+
{/* Enabled State */}
|
|
38
|
+
<div className="mb-3">
|
|
39
|
+
<span className="text-muted d-block mb-1 small">Enabled</span>
|
|
40
|
+
<div className="d-flex flex-wrap gap-2 py-1">
|
|
41
|
+
{VariantList.map((variant) => (
|
|
42
|
+
<AndroidButton
|
|
43
|
+
key={`${styleType}-${shape}-${variant}-enabled`}
|
|
44
|
+
type={ButtonTypes.BUTTON}
|
|
45
|
+
styleType={styleType}
|
|
46
|
+
shape={shape}
|
|
47
|
+
variant={variant}
|
|
48
|
+
>
|
|
49
|
+
{variant}
|
|
50
|
+
</AndroidButton>
|
|
51
|
+
))}
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
{/* Disabled State */}
|
|
56
|
+
<div>
|
|
57
|
+
<span className="text-muted d-block mb-1 small">Disabled</span>
|
|
58
|
+
<div className="d-flex flex-wrap gap-2 py-1">
|
|
59
|
+
{VariantList.map((variant) => (
|
|
60
|
+
<AndroidButton
|
|
61
|
+
key={`${styleType}-${shape}-${variant}-disabled`}
|
|
62
|
+
type={ButtonTypes.BUTTON}
|
|
63
|
+
styleType={styleType}
|
|
64
|
+
shape={shape}
|
|
65
|
+
variant={variant}
|
|
66
|
+
disabled={true}
|
|
67
|
+
>
|
|
68
|
+
{variant}
|
|
69
|
+
</AndroidButton>
|
|
70
|
+
))}
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
))}
|
|
75
|
+
</div>
|
|
76
|
+
))}
|
|
77
|
+
</Fragment>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ButtonTypes } from "../../../types/ButtonTypes.tsx";
|
|
2
|
+
import VariantList from "../../VariantList.tsx";
|
|
3
|
+
import { BootstrapStyleTypes } from "../../../types/Web/BootstrapStyleTypes.tsx";
|
|
4
|
+
import { BootstrapShapeTypes } from "../../../types/Web/BootstrapShapeTypes.tsx";
|
|
5
|
+
|
|
6
|
+
import { Fragment } from "react";
|
|
7
|
+
import BootstrapButton from "../../../components/buttons/BootstrapButton.tsx";
|
|
8
|
+
|
|
9
|
+
// List of Bootstrap styles
|
|
10
|
+
const StyleTypeList: Array<{ label: string; styleType: BootstrapStyleTypes }> = [
|
|
11
|
+
{ label: "Filled", styleType: BootstrapStyleTypes.FILLED },
|
|
12
|
+
{ label: "Outlined", styleType: BootstrapStyleTypes.OUTLINED },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
// List of supported Bootstrap shapes
|
|
16
|
+
const ShapeList: Array<{ label: string; shape: BootstrapShapeTypes }> = [
|
|
17
|
+
{ label: "Default Shape", shape: BootstrapShapeTypes.DEFAULT },
|
|
18
|
+
{ label: "Pill Shape", shape: BootstrapShapeTypes.PILL },
|
|
19
|
+
{ label: "Square Shape", shape: BootstrapShapeTypes.SQUARE },
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export default function ButtonsBootstrapSection() {
|
|
23
|
+
return (
|
|
24
|
+
<Fragment>
|
|
25
|
+
<h2>Buttons (Bootstrap Web / Desktop)</h2>
|
|
26
|
+
|
|
27
|
+
{StyleTypeList.map(({ label: styleLabel, styleType }) => (
|
|
28
|
+
<div key={styleType} className="my-4">
|
|
29
|
+
<h4 className="text-primary mb-3">{styleLabel} Buttons</h4>
|
|
30
|
+
|
|
31
|
+
{ShapeList.map(({ label: shapeLabel, shape }) => (
|
|
32
|
+
<div key={`${styleType}-${shape}`} className="ms-3 mb-4">
|
|
33
|
+
<h6 className="text-secondary mb-2">{shapeLabel}</h6>
|
|
34
|
+
|
|
35
|
+
{/* Enabled State */}
|
|
36
|
+
<div className="mb-3">
|
|
37
|
+
<span className="text-muted d-block mb-1 small">Enabled</span>
|
|
38
|
+
<div className="d-flex flex-wrap gap-2 py-1">
|
|
39
|
+
{VariantList.map((variant) => (
|
|
40
|
+
<BootstrapButton
|
|
41
|
+
key={`${styleType}-${shape}-${variant}-enabled`}
|
|
42
|
+
type={ButtonTypes.BUTTON}
|
|
43
|
+
styleType={styleType}
|
|
44
|
+
shape={shape}
|
|
45
|
+
variant={variant}
|
|
46
|
+
>
|
|
47
|
+
{variant}
|
|
48
|
+
</BootstrapButton>
|
|
49
|
+
))}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
{/* Disabled State */}
|
|
54
|
+
<div>
|
|
55
|
+
<span className="text-muted d-block mb-1 small">Disabled</span>
|
|
56
|
+
<div className="d-flex flex-wrap gap-2 py-1">
|
|
57
|
+
{VariantList.map((variant) => (
|
|
58
|
+
<BootstrapButton
|
|
59
|
+
key={`${styleType}-${shape}-${variant}-disabled`}
|
|
60
|
+
type={ButtonTypes.BUTTON}
|
|
61
|
+
styleType={styleType}
|
|
62
|
+
shape={shape}
|
|
63
|
+
variant={variant}
|
|
64
|
+
disabled={true}
|
|
65
|
+
>
|
|
66
|
+
{variant}
|
|
67
|
+
</BootstrapButton>
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
))}
|
|
73
|
+
</div>
|
|
74
|
+
))}
|
|
75
|
+
</Fragment>
|
|
76
|
+
);
|
|
77
|
+
}
|