mautourco-components 0.1.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/README.md +187 -0
- package/dist/components/atoms/Avatar/Avatar.d.ts +14 -0
- package/dist/components/atoms/Avatar/Avatar.js +31 -0
- package/dist/components/atoms/Button/Button.d.ts +27 -0
- package/dist/components/atoms/Button/Button.js +35 -0
- package/dist/components/atoms/Checkbox/Checkbox.d.ts +13 -0
- package/dist/components/atoms/Checkbox/Checkbox.js +33 -0
- package/dist/components/atoms/Icon/Icon.d.ts +10 -0
- package/dist/components/atoms/Icon/Icon.js +102 -0
- package/dist/components/atoms/Icon/icons/ArrivalIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/ArrivalIcon.js +31 -0
- package/dist/components/atoms/Icon/icons/CalendarIcon.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/CalendarIcon.js +41 -0
- package/dist/components/atoms/Icon/icons/CarIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/CarIcon.js +30 -0
- package/dist/components/atoms/Icon/icons/Check.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/Check.js +30 -0
- package/dist/components/atoms/Icon/icons/CheckCircleIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/CheckCircleIcon.js +30 -0
- package/dist/components/atoms/Icon/icons/Chevron.d.ts +9 -0
- package/dist/components/atoms/Icon/icons/Chevron.js +54 -0
- package/dist/components/atoms/Icon/icons/ChevronDownIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/ChevronDownIcon.js +30 -0
- package/dist/components/atoms/Icon/icons/Close.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/Close.js +30 -0
- package/dist/components/atoms/Icon/icons/DeleteIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/DeleteIcon.js +30 -0
- package/dist/components/atoms/Icon/icons/DepartureIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/DepartureIcon.js +30 -0
- package/dist/components/atoms/Icon/icons/EyeIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/EyeIcon.js +30 -0
- package/dist/components/atoms/Icon/icons/FacebookIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/FacebookIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/InfoIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/InfoIcon.js +30 -0
- package/dist/components/atoms/Icon/icons/LinkedInIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/LinkedInIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/MapPinIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/MapPinIcon.js +30 -0
- package/dist/components/atoms/Icon/icons/MautoucoLogo.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/MautoucoLogo.js +37 -0
- package/dist/components/atoms/Icon/icons/MenuIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/MenuIcon.js +37 -0
- package/dist/components/atoms/Icon/icons/MoreIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/MoreIcon.js +30 -0
- package/dist/components/atoms/Icon/icons/Search.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/Search.js +30 -0
- package/dist/components/atoms/Icon/icons/Settings.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/Settings.js +30 -0
- package/dist/components/atoms/Icon/icons/StrollerIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/StrollerIcon.js +30 -0
- package/dist/components/atoms/Icon/icons/TwitterIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/TwitterIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/User.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/User.js +30 -0
- package/dist/components/atoms/Icon/icons/UserIcon.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/UserIcon.js +41 -0
- package/dist/components/atoms/Icon/icons/Youtube.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/Youtube.js +36 -0
- package/dist/components/atoms/Inputs/DropdownInput/DropdownInput.d.ts +12 -0
- package/dist/components/atoms/Inputs/DropdownInput/DropdownInput.js +53 -0
- package/dist/components/atoms/Inputs/Input/Input.d.ts +15 -0
- package/dist/components/atoms/Inputs/Input/Input.js +27 -0
- package/dist/components/atoms/Inputs/Textarea/Textarea.d.ts +14 -0
- package/dist/components/atoms/Inputs/Textarea/Textarea.js +15 -0
- package/dist/components/atoms/Link/Link.d.ts +44 -0
- package/dist/components/atoms/Link/Link.js +76 -0
- package/dist/components/atoms/SelectedValue/SelectedValue.d.ts +11 -0
- package/dist/components/atoms/SelectedValue/SelectedValue.js +29 -0
- package/dist/components/atoms/Spinner/Spinner.d.ts +9 -0
- package/dist/components/atoms/Spinner/Spinner.js +38 -0
- package/dist/components/atoms/Spinner/variants/ButtonSpinner.d.ts +8 -0
- package/dist/components/atoms/Spinner/variants/ButtonSpinner.js +19 -0
- package/dist/components/atoms/Spinner/variants/LoadingSpinner.d.ts +7 -0
- package/dist/components/atoms/Spinner/variants/LoadingSpinner.js +7 -0
- package/dist/components/atoms/Tab/Tab.d.ts +22 -0
- package/dist/components/atoms/Tab/Tab.js +54 -0
- package/dist/components/atoms/Typography/Heading/Heading.d.ts +9 -0
- package/dist/components/atoms/Typography/Heading/Heading.js +25 -0
- package/dist/components/atoms/Typography/Text/Text.d.ts +10 -0
- package/dist/components/atoms/Typography/Text/Text.js +77 -0
- package/dist/components/atoms/Typography/Typography.d.ts +24 -0
- package/dist/components/atoms/Typography/Typography.js +100 -0
- package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.d.ts +29 -0
- package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.js +106 -0
- package/dist/components/molecules/UserCard/UserCard.d.ts +20 -0
- package/dist/components/molecules/UserCard/UserCard.js +57 -0
- package/dist/components/organisms/Footer/Footer.d.ts +38 -0
- package/dist/components/organisms/Footer/Footer.js +74 -0
- package/dist/components/organisms/TopNavigation/DesktopNav.d.ts +33 -0
- package/dist/components/organisms/TopNavigation/DesktopNav.js +26 -0
- package/dist/components/organisms/TopNavigation/MobileNav.d.ts +32 -0
- package/dist/components/organisms/TopNavigation/MobileNav.js +45 -0
- package/dist/components/organisms/TopNavigation/TopNavigation.d.ts +33 -0
- package/dist/components/organisms/TopNavigation/TopNavigation.js +20 -0
- package/dist/hooks/useMobile.d.ts +5 -0
- package/dist/hooks/useMobile.js +26 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +28 -0
- package/dist/styles/tokens/tokens.d.ts +3108 -0
- package/dist/styles/tokens/tokens.js +2652 -0
- package/package.json +90 -0
- package/src/components/atoms/Avatar/Avatar.tsx +60 -0
- package/src/components/atoms/Button/Button.css +200 -0
- package/src/components/atoms/Button/Button.tsx +82 -0
- package/src/components/atoms/Checkbox/Checkbox.tsx +69 -0
- package/src/components/atoms/Icon/Icon.tsx +135 -0
- package/src/components/atoms/Icon/icons/ArrivalIcon.tsx +52 -0
- package/src/components/atoms/Icon/icons/CalendarIcon.tsx +63 -0
- package/src/components/atoms/Icon/icons/CarIcon.tsx +44 -0
- package/src/components/atoms/Icon/icons/Check.tsx +36 -0
- package/src/components/atoms/Icon/icons/CheckCircleIcon.tsx +48 -0
- package/src/components/atoms/Icon/icons/Chevron.tsx +73 -0
- package/src/components/atoms/Icon/icons/ChevronDownIcon.tsx +46 -0
- package/src/components/atoms/Icon/icons/Close.tsx +40 -0
- package/src/components/atoms/Icon/icons/DeleteIcon.tsx +44 -0
- package/src/components/atoms/Icon/icons/DepartureIcon.tsx +50 -0
- package/src/components/atoms/Icon/icons/EyeIcon.tsx +44 -0
- package/src/components/atoms/Icon/icons/FacebookIcon.tsx +50 -0
- package/src/components/atoms/Icon/icons/InfoIcon.tsx +44 -0
- package/src/components/atoms/Icon/icons/LinkedInIcon.tsx +50 -0
- package/src/components/atoms/Icon/icons/MapPinIcon.tsx +44 -0
- package/src/components/atoms/Icon/icons/MautoucoLogo.tsx +93 -0
- package/src/components/atoms/Icon/icons/MenuIcon.tsx +49 -0
- package/src/components/atoms/Icon/icons/MoreIcon.tsx +44 -0
- package/src/components/atoms/Icon/icons/Search.tsx +37 -0
- package/src/components/atoms/Icon/icons/Settings.tsx +38 -0
- package/src/components/atoms/Icon/icons/StrollerIcon.tsx +44 -0
- package/src/components/atoms/Icon/icons/TwitterIcon.tsx +50 -0
- package/src/components/atoms/Icon/icons/User.tsx +37 -0
- package/src/components/atoms/Icon/icons/UserIcon.tsx +63 -0
- package/src/components/atoms/Icon/icons/Youtube.tsx +50 -0
- package/src/components/atoms/Inputs/DropdownInput/DropdownInput.tsx +96 -0
- package/src/components/atoms/Inputs/Input/Input.tsx +66 -0
- package/src/components/atoms/Inputs/Textarea/Textarea.tsx +51 -0
- package/src/components/atoms/Link/Link.tsx +168 -0
- package/src/components/atoms/SelectedValue/SelectedValue.tsx +59 -0
- package/src/components/atoms/Spinner/Spinner.tsx +56 -0
- package/src/components/atoms/Spinner/variants/ButtonSpinner.tsx +37 -0
- package/src/components/atoms/Spinner/variants/LoadingSpinner.tsx +22 -0
- package/src/components/atoms/Tab/Tab.css +147 -0
- package/src/components/atoms/Tab/Tab.tsx +96 -0
- package/src/components/atoms/Typography/Typography.tsx +153 -0
- package/src/components/molecules/MultiSelectDropdown/MultiSelectDropdown.tsx +245 -0
- package/src/components/molecules/UserCard/UserCard.stories.tsx +36 -0
- package/src/components/molecules/UserCard/UserCard.tsx +173 -0
- package/src/components/organisms/Footer/Footer.tsx +290 -0
- package/src/components/organisms/TopNavigation/DesktopNav.tsx +122 -0
- package/src/components/organisms/TopNavigation/MobileNav.tsx +212 -0
- package/src/components/organisms/TopNavigation/TopNavigation.tsx +45 -0
- package/src/styles/components/avatar.css +58 -0
- package/src/styles/components/checkbox.css +132 -0
- package/src/styles/components/dropdown.css +214 -0
- package/src/styles/components/forms.css +147 -0
- package/src/styles/components/multiselect-dropdown.css +231 -0
- package/src/styles/components/organism/footer.css +113 -0
- package/src/styles/components/organism/topnavigation.css +162 -0
- package/src/styles/components/scrollbar.css +63 -0
- package/src/styles/components/selected-value.css +80 -0
- package/src/styles/components/typography.css +251 -0
- package/src/styles/tokens/_tokens.scss +2072 -0
- package/src/styles/tokens/tokens.css +2075 -0
- package/src/styles/tokens/tokens.js +2653 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../../atoms/Icon/Icon";
|
|
3
|
+
import Button from "../../atoms/Button/Button";
|
|
4
|
+
import { UserCard } from "../../molecules/UserCard/UserCard";
|
|
5
|
+
|
|
6
|
+
type Link = {
|
|
7
|
+
label: string;
|
|
8
|
+
route: string;
|
|
9
|
+
isButton?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type User = {
|
|
14
|
+
name: string;
|
|
15
|
+
agency: string;
|
|
16
|
+
isAdmin: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type Agency = {
|
|
20
|
+
id: number;
|
|
21
|
+
name: string;
|
|
22
|
+
localisation: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export interface MobileNavProps {
|
|
26
|
+
links: Link[];
|
|
27
|
+
onLinkClick?: (link: Link) => void;
|
|
28
|
+
onLogin?: () => void;
|
|
29
|
+
onLogout?: () => void;
|
|
30
|
+
user?: User;
|
|
31
|
+
active?: string;
|
|
32
|
+
logoUrl: string | React.FC<React.SVGProps<SVGSVGElement>>;
|
|
33
|
+
selectedAgency?: Agency;
|
|
34
|
+
onAgencyChange?: (agency: Agency) => void;
|
|
35
|
+
agencies?: Agency[];
|
|
36
|
+
homeUrl?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const MobileNav: React.FC<MobileNavProps> = ({
|
|
40
|
+
links,
|
|
41
|
+
onLinkClick,
|
|
42
|
+
onLogin,
|
|
43
|
+
onLogout,
|
|
44
|
+
user,
|
|
45
|
+
active,
|
|
46
|
+
logoUrl,
|
|
47
|
+
selectedAgency,
|
|
48
|
+
onAgencyChange,
|
|
49
|
+
agencies,
|
|
50
|
+
homeUrl,
|
|
51
|
+
}) => {
|
|
52
|
+
const [open, setOpen] = React.useState(false);
|
|
53
|
+
const closeRef = React.useRef<HTMLButtonElement>(null);
|
|
54
|
+
const Logo = typeof logoUrl === "function" ? logoUrl : null;
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<header className="header">
|
|
59
|
+
<button aria-label="Open Menu" onClick={() => setOpen(true)}>
|
|
60
|
+
<Icon name="menu" size="sm" />
|
|
61
|
+
</button>
|
|
62
|
+
<div className="header-logo">
|
|
63
|
+
<a
|
|
64
|
+
href={homeUrl ?? "/"}
|
|
65
|
+
className="header-logo__link"
|
|
66
|
+
onClick={(e) => {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
onLinkClick?.({ label: "Home", route: homeUrl ?? "/" });
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
{Logo ? (
|
|
72
|
+
<Logo className="header-logo__image" />
|
|
73
|
+
) : (
|
|
74
|
+
<img
|
|
75
|
+
src={logoUrl as string}
|
|
76
|
+
alt="Mautourco"
|
|
77
|
+
className="header-logo__image"
|
|
78
|
+
draggable={false}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
</a>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="header-user-actions">
|
|
84
|
+
{!user && (
|
|
85
|
+
<Button
|
|
86
|
+
size="sm"
|
|
87
|
+
variant="secondary"
|
|
88
|
+
onClick={() => {
|
|
89
|
+
onLogin?.();
|
|
90
|
+
setOpen(false);
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
Login
|
|
94
|
+
</Button>
|
|
95
|
+
)}
|
|
96
|
+
</div>
|
|
97
|
+
</header>
|
|
98
|
+
<div
|
|
99
|
+
aria-hidden={!open}
|
|
100
|
+
className={`mobile-nav__backdrop ${
|
|
101
|
+
open ? "mobile-nav__backdrop--open" : "mobile-nav__backdrop--closed"
|
|
102
|
+
}`}
|
|
103
|
+
onClick={() => setOpen(false)}
|
|
104
|
+
/>
|
|
105
|
+
|
|
106
|
+
<aside
|
|
107
|
+
role="dialog"
|
|
108
|
+
aria-modal="true"
|
|
109
|
+
aria-label="Main menu"
|
|
110
|
+
className={`
|
|
111
|
+
mobile-nav__sheet
|
|
112
|
+
${open ? "mobile-nav__sheet--open" : "mobile-nav__sheet--closed"}
|
|
113
|
+
`}
|
|
114
|
+
>
|
|
115
|
+
<div className="mobile-nav__header">
|
|
116
|
+
<div>
|
|
117
|
+
<button
|
|
118
|
+
ref={closeRef}
|
|
119
|
+
aria-label="Close menu"
|
|
120
|
+
onClick={() => setOpen(false)}
|
|
121
|
+
className="mobile-nav__close-button"
|
|
122
|
+
>
|
|
123
|
+
<Icon name="close" size="sm" />
|
|
124
|
+
</button>
|
|
125
|
+
</div>
|
|
126
|
+
{user ? (
|
|
127
|
+
<UserCard
|
|
128
|
+
user={user}
|
|
129
|
+
agencies={agencies || []}
|
|
130
|
+
selectedAgency={selectedAgency}
|
|
131
|
+
onSelectAgency={onAgencyChange}
|
|
132
|
+
/>
|
|
133
|
+
) : (
|
|
134
|
+
<a
|
|
135
|
+
href={homeUrl ?? "/"}
|
|
136
|
+
className="header-logo__link"
|
|
137
|
+
onClick={(e) => {
|
|
138
|
+
e.preventDefault();
|
|
139
|
+
onLinkClick?.({ label: "Home", route: homeUrl ?? "/" });
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
{Logo ? (
|
|
143
|
+
<Logo className="header-logo__image-mobile" />
|
|
144
|
+
) : (
|
|
145
|
+
<img
|
|
146
|
+
src={logoUrl as string}
|
|
147
|
+
alt="Mautourco"
|
|
148
|
+
className="header-logo__image-mobile"
|
|
149
|
+
draggable={false}
|
|
150
|
+
/>
|
|
151
|
+
)}
|
|
152
|
+
</a>
|
|
153
|
+
)}
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<nav className="mobile-nav__content">
|
|
157
|
+
<ul className="mobile-nav__list">
|
|
158
|
+
{links.map((l, i) => {
|
|
159
|
+
const activeItem = active && active === l.label;
|
|
160
|
+
return (
|
|
161
|
+
<li
|
|
162
|
+
key={`${l.route}-${i}`}
|
|
163
|
+
className={`header__item ${activeItem ? "header__item--active" : ""}`}
|
|
164
|
+
>
|
|
165
|
+
<button
|
|
166
|
+
disabled={l.disabled}
|
|
167
|
+
onClick={() => {
|
|
168
|
+
onLinkClick?.(l);
|
|
169
|
+
setOpen(false);
|
|
170
|
+
}}
|
|
171
|
+
className="mobile-nav__item-button"
|
|
172
|
+
>
|
|
173
|
+
{l.label}
|
|
174
|
+
</button>
|
|
175
|
+
</li>
|
|
176
|
+
);
|
|
177
|
+
})}
|
|
178
|
+
</ul>
|
|
179
|
+
</nav>
|
|
180
|
+
|
|
181
|
+
<div className="mobile-nav__footer">
|
|
182
|
+
{user ? (
|
|
183
|
+
<div className="mobile-nav__user-info">
|
|
184
|
+
<Button
|
|
185
|
+
onClick={() => {
|
|
186
|
+
onLogout?.();
|
|
187
|
+
setOpen(false);
|
|
188
|
+
}}
|
|
189
|
+
className="mobile-nav__logout-button"
|
|
190
|
+
>
|
|
191
|
+
Logout
|
|
192
|
+
</Button>
|
|
193
|
+
</div>
|
|
194
|
+
) : (
|
|
195
|
+
<Button
|
|
196
|
+
size="sm"
|
|
197
|
+
variant="secondary"
|
|
198
|
+
onClick={() => {
|
|
199
|
+
onLogin?.();
|
|
200
|
+
setOpen(false);
|
|
201
|
+
}}
|
|
202
|
+
>
|
|
203
|
+
Login
|
|
204
|
+
</Button>
|
|
205
|
+
)}
|
|
206
|
+
</div>
|
|
207
|
+
</aside>
|
|
208
|
+
</>
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export default MobileNav;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useMobile } from "../../../hooks/useMobile";
|
|
3
|
+
import MobileNav from "./MobileNav";
|
|
4
|
+
import { DesktopNav } from "./DesktopNav";
|
|
5
|
+
|
|
6
|
+
type Link = {
|
|
7
|
+
label: string;
|
|
8
|
+
route: string;
|
|
9
|
+
isButton?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type User = {
|
|
14
|
+
name: string;
|
|
15
|
+
agency: string;
|
|
16
|
+
isAdmin: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type Agency = {
|
|
20
|
+
id: number;
|
|
21
|
+
name: string;
|
|
22
|
+
localisation: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export interface TopNavigationProps {
|
|
26
|
+
links: Link[];
|
|
27
|
+
onLinkClick?: (link: Link) => void;
|
|
28
|
+
onLogin?: () => void;
|
|
29
|
+
onLogout?: () => void;
|
|
30
|
+
user?: User;
|
|
31
|
+
active?: string;
|
|
32
|
+
logoUrl: string | React.FC<React.SVGProps<SVGSVGElement>>;
|
|
33
|
+
homeUrl?: string;
|
|
34
|
+
selectedAgency?: Agency;
|
|
35
|
+
onAgencyChange?: (agency: Agency) => void;
|
|
36
|
+
agencies?: Agency[];
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const TopNavigation: React.FC<TopNavigationProps> = (props) => {
|
|
41
|
+
const { isMobile, isTablet } = useMobile();
|
|
42
|
+
const isSmallScreen = isMobile || isTablet;
|
|
43
|
+
|
|
44
|
+
return isSmallScreen ? <MobileNav {...props} /> : <DesktopNav {...props} />;
|
|
45
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.avatar {
|
|
2
|
+
@apply relative inline-flex items-center justify-center overflow-hidden select-none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.avatar--sm {
|
|
6
|
+
@apply w-4 h-4 text-[10px];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.avatar--md {
|
|
10
|
+
@apply w-6 h-6 text-[11px];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.avatar--lg {
|
|
14
|
+
@apply w-8 h-8 text-xs;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.avatar--xl {
|
|
18
|
+
@apply w-12 h-12 text-sm;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.avatar--circle {
|
|
22
|
+
@apply rounded-full;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.avatar--rounded {
|
|
26
|
+
border-radius: var(--avatar-corner-radius-square, 6px);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.avatar--gray {
|
|
30
|
+
@apply bg-slate-100 text-slate-700;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.avatar--blue {
|
|
34
|
+
@apply bg-[var(--color-blue-600)] text-white;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.avatar--pink {
|
|
38
|
+
@apply bg-[var(--color-pink-700)] text-white;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.avatar--orange {
|
|
42
|
+
@apply bg-[var(--color-orange-700)] text-white;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.avatar--green {
|
|
46
|
+
@apply bg-[var(--color-green-800)] text-white;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Internal elements */
|
|
50
|
+
.avatar__img {
|
|
51
|
+
@apply absolute object-cover w-full h-full;
|
|
52
|
+
inset: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.avatar__initial {
|
|
56
|
+
@apply font-medium leading-none;
|
|
57
|
+
}
|
|
58
|
+
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/* Checkbox Component Styles */
|
|
2
|
+
.checkbox-container {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.checkbox-wrapper {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.checkbox-input {
|
|
14
|
+
position: absolute;
|
|
15
|
+
opacity: 0;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
height: 0;
|
|
18
|
+
width: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.checkbox-label {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
column-gap: var(--checkbox-spacing-inline-gap, var(--multiselect-spacing-option-icon-gap));
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
user-select: none;
|
|
27
|
+
width: 100%;
|
|
28
|
+
padding: var(--checkbox-spacing-label-padding, 8px 12px);
|
|
29
|
+
border-radius: var(--checkbox-border-radius, 6px);
|
|
30
|
+
transition: all var(--checkbox-transition-duration, 0.2s) var(--checkbox-transition-timing, ease-in-out);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.checkbox-box {
|
|
34
|
+
position: relative;
|
|
35
|
+
width: var(--checkbox-size-box-width);
|
|
36
|
+
height: var(--checkbox-size-box-height);
|
|
37
|
+
border: var(--checkbox-border-width) solid var(--checkbox-color-box-default-border);
|
|
38
|
+
border-radius: var(--checkbox-size-box-border-radius);
|
|
39
|
+
background-color: var(--checkbox-color-box-default-background);
|
|
40
|
+
opacity: var(--checkbox-opacity-default);
|
|
41
|
+
top: var(--checkbox-position-top);
|
|
42
|
+
left: var(--checkbox-position-left);
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
transition: all var(--checkbox-transition-duration) var(--checkbox-transition-timing);
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.checkbox-text {
|
|
51
|
+
margin-left: 0;
|
|
52
|
+
font-family: var(--checkbox-typography-fontFamily, 'Inter', sans-serif);
|
|
53
|
+
font-size: var(--checkbox-typography-fontSize, 14px);
|
|
54
|
+
line-height: var(--checkbox-typography-lineHeight, 20px);
|
|
55
|
+
color: var(--checkbox-color-label-default-text, #111827);
|
|
56
|
+
transition: color var(--checkbox-transition-duration, 0.2s) var(--checkbox-transition-timing, ease-in-out);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.checkbox-leading {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.checkbox-icon {
|
|
66
|
+
color: var(--checkbox-color-icon-checked);
|
|
67
|
+
width: var(--checkbox-size-icon-width, 14px);
|
|
68
|
+
height: var(--checkbox-size-icon-height, 14px);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* States */
|
|
72
|
+
.checkbox--default .checkbox-label:hover {
|
|
73
|
+
background-color: var(--checkbox-color-label-hover-background, #f9fafb);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.checkbox--default .checkbox-label:hover .checkbox-box {
|
|
77
|
+
background-color: var(--checkbox-color-box-hover-background, #f3f4f6);
|
|
78
|
+
border-color: var(--checkbox-color-box-hover-border, #9ca3af);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.checkbox--checked .checkbox-box {
|
|
82
|
+
background-color: var(--checkbox-color-box-checked-background);
|
|
83
|
+
border-color: var(--checkbox-color-box-checked-border);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.checkbox--checked .checkbox-label {
|
|
87
|
+
background-color: transparent;
|
|
88
|
+
border-radius: var(--checkbox-border-radius);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.checkbox--error .checkbox-box {
|
|
92
|
+
background-color: var(--checkbox-color-box-error-background, #fef2f2);
|
|
93
|
+
border-color: var(--checkbox-color-box-error-border, #ef4444);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.checkbox--error .checkbox-text {
|
|
97
|
+
color: var(--checkbox-color-label-error-text, #dc2626);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.checkbox--error .checkbox-label {
|
|
101
|
+
background-color: var(--checkbox-color-label-error-background, #fef2f2);
|
|
102
|
+
border-radius: var(--checkbox-border-radius, 6px);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.checkbox--disabled .checkbox-label {
|
|
106
|
+
cursor: not-allowed;
|
|
107
|
+
background-color: var(--checkbox-color-label-disabled-background, transparent);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.checkbox--disabled .checkbox-box {
|
|
111
|
+
background-color: var(--checkbox-color-box-disabled-background, #f3f4f6);
|
|
112
|
+
border-color: var(--checkbox-color-box-disabled-border, #e5e7eb);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.checkbox--disabled .checkbox-text {
|
|
116
|
+
color: var(--checkbox-color-label-disabled-text, #9ca3af);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.checkbox--disabled .checkbox-icon {
|
|
120
|
+
color: var(--checkbox-color-icon-disabled, #9ca3af);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Focus styles */
|
|
124
|
+
.checkbox-input:focus + .checkbox-label .checkbox-box {
|
|
125
|
+
outline: 2px solid var(--checkbox-color-focus-outline, #3b82f6);
|
|
126
|
+
outline-offset: 2px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Disabled focus */
|
|
130
|
+
.checkbox--disabled .checkbox-input:focus + .checkbox-label .checkbox-box {
|
|
131
|
+
outline: none;
|
|
132
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/* DropdownInput Component Styles */
|
|
2
|
+
.dropdown-container {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: block;
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.dropdown-input {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
width: 100%;
|
|
13
|
+
min-height: 40px;
|
|
14
|
+
padding: 8px 12px;
|
|
15
|
+
border: 1px solid var(--multiselect-color-input-border-default, #6B7280);
|
|
16
|
+
border-radius: var(--input-border-radius-default, 6px);
|
|
17
|
+
background-color: var(--color-white, #ffffff);
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
transition: all 0.2s ease-in-out;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.dropdown-input:hover:not(.dropdown-input--disabled) {
|
|
24
|
+
border-color: var(--multiselect-color-input-border-hover, #4B5563);
|
|
25
|
+
background-color: var(--color-neutral-50, #f9fafb);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.dropdown-input__text {
|
|
29
|
+
flex: 1;
|
|
30
|
+
font-family: var(--typography-font-family-sans, 'Inter', sans-serif);
|
|
31
|
+
font-size: var(--input-font-size-default, 14px);
|
|
32
|
+
line-height: var(--input-line-height-default, 20px);
|
|
33
|
+
color: var(--color-neutral-900, #111827);
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dropdown-input__icon {
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
margin-left: 8px;
|
|
42
|
+
color: var(--color-neutral-600, #4b5563);
|
|
43
|
+
transition: transform 0.2s ease-in-out;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.dropdown-input__icon--loading {
|
|
47
|
+
animation: spin 1s linear infinite;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.dropdown-input__icon--chevron {
|
|
51
|
+
transition: transform 0.2s ease-in-out;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dropdown-input--open .dropdown-input__icon--chevron {
|
|
55
|
+
transform: rotate(180deg);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* States */
|
|
59
|
+
.dropdown-input--default .dropdown-input__text {
|
|
60
|
+
color: var(--color-neutral-500, #6b7280);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.dropdown-input--loading .dropdown-input__text {
|
|
64
|
+
color: var(--color-neutral-500, #6b7280);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.dropdown-input--selected .dropdown-input__text {
|
|
68
|
+
color: var(--color-neutral-900, #111827);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.dropdown-input--error {
|
|
72
|
+
background-color: var(--color-red-50, #fef2f2);
|
|
73
|
+
border-color: var(--multiselect-color-input-border-error, #ef4444);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.dropdown-input--error .dropdown-input__text {
|
|
77
|
+
color: var(--color-red-600, #dc2626);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.dropdown-input--error .dropdown-input__icon {
|
|
81
|
+
color: var(--color-red-600, #dc2626);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.dropdown-input--disabled {
|
|
85
|
+
background-color: var(--color-neutral-100, #f3f4f6);
|
|
86
|
+
border-color: var(--multiselect-color-input-border-disabled, #D1D5DB);
|
|
87
|
+
cursor: not-allowed;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.dropdown-input--disabled .dropdown-input__text {
|
|
91
|
+
color: var(--color-neutral-400, #9ca3af);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.dropdown-input--disabled .dropdown-input__icon {
|
|
95
|
+
color: var(--color-neutral-400, #9ca3af);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Dropdown Menu */
|
|
99
|
+
.dropdown-menu {
|
|
100
|
+
position: absolute;
|
|
101
|
+
top: calc(100% + var(--multiselect-spacing-menu-gap));
|
|
102
|
+
left: 0;
|
|
103
|
+
right: 0;
|
|
104
|
+
z-index: 1000;
|
|
105
|
+
width: 100%;
|
|
106
|
+
background-color: var(--multiselect-color-menu-background);
|
|
107
|
+
border: var(--multiselect-border-width) solid var(--multiselect-color-dropdownbasic-border);
|
|
108
|
+
border-top: 1px solid var(--multiselect-color-dropdownbasic-border);
|
|
109
|
+
border-radius: var(--multiselect-border-radius);
|
|
110
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
111
|
+
max-height: var(--multiselect-size-menu-max-height);
|
|
112
|
+
overflow-y: auto;
|
|
113
|
+
padding: var(--multiselect-spacing-menu-padding);
|
|
114
|
+
opacity: 1;
|
|
115
|
+
transform: translateY(0);
|
|
116
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
117
|
+
animation: dropdownFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.dropdown-option {
|
|
121
|
+
padding: var(--multiselect-spacing-option-padding);
|
|
122
|
+
font-family: var(--typography-font-family-sans, 'Inter', sans-serif);
|
|
123
|
+
font-size: var(--input-font-size-default, 14px);
|
|
124
|
+
line-height: var(--input-line-height-default, 20px);
|
|
125
|
+
color: var(--multiselect-color-option-text);
|
|
126
|
+
background-color: var(--multiselect-color-option-background);
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
gap: var(--multiselect-spacing-option-gap);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.dropdown-option:hover {
|
|
135
|
+
background-color: var(--multiselect-color-option-background-hover);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.dropdown-option:active {
|
|
139
|
+
background-color: var(--multiselect-color-option-background-hover);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Dropdown Footer */
|
|
143
|
+
.dropdown-footer {
|
|
144
|
+
padding: var(--multiselect-spacing-footer-padding);
|
|
145
|
+
font-family: var(--typography-font-family-sans, 'Inter', sans-serif);
|
|
146
|
+
font-size: var(--input-font-size-default, 14px);
|
|
147
|
+
line-height: var(--input-line-height-default, 20px);
|
|
148
|
+
color: var(--multiselect-color-footer-text);
|
|
149
|
+
background-color: var(--multiselect-color-footer-background);
|
|
150
|
+
border-top: 1px solid var(--multiselect-color-menu-border);
|
|
151
|
+
margin-top: 4px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Animations */
|
|
155
|
+
@keyframes dropdownFadeIn {
|
|
156
|
+
from {
|
|
157
|
+
opacity: 0;
|
|
158
|
+
transform: translateY(-10px);
|
|
159
|
+
}
|
|
160
|
+
to {
|
|
161
|
+
opacity: 1;
|
|
162
|
+
transform: translateY(0);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@keyframes dropdownFadeOut {
|
|
167
|
+
from {
|
|
168
|
+
opacity: 1;
|
|
169
|
+
transform: translateY(0);
|
|
170
|
+
}
|
|
171
|
+
to {
|
|
172
|
+
opacity: 0;
|
|
173
|
+
transform: translateY(-10px);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@keyframes spin {
|
|
178
|
+
from {
|
|
179
|
+
transform: rotate(0deg);
|
|
180
|
+
}
|
|
181
|
+
to {
|
|
182
|
+
transform: rotate(360deg);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@keyframes spin-slow {
|
|
187
|
+
from {
|
|
188
|
+
transform: rotate(0deg);
|
|
189
|
+
}
|
|
190
|
+
to {
|
|
191
|
+
transform: rotate(360deg);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@keyframes spin-fast {
|
|
196
|
+
from {
|
|
197
|
+
transform: rotate(0deg);
|
|
198
|
+
}
|
|
199
|
+
to {
|
|
200
|
+
transform: rotate(360deg);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.animate-spin {
|
|
205
|
+
animation: spin 1s linear infinite;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.animate-spin-slow {
|
|
209
|
+
animation: spin-slow 2s linear infinite;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.animate-spin-fast {
|
|
213
|
+
animation: spin-fast 0.5s linear infinite;
|
|
214
|
+
}
|