allaw-ui 0.0.351 → 0.0.352
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/components/atoms/buttons/PrimaryButton.d.ts +1 -1
- package/dist/components/atoms/buttons/PrimaryButton.js +29 -6
- package/dist/components/atoms/filters/SingleFilter.css +172 -0
- package/dist/components/atoms/filters/SingleFilter.d.ts +17 -0
- package/dist/components/atoms/filters/SingleFilter.js +70 -0
- package/dist/components/atoms/filters/index.d.ts +2 -0
- package/dist/components/atoms/filters/index.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
|
@@ -12,5 +12,5 @@ export interface PrimaryButtonProps extends ButtonHTMLAttributes<HTMLButtonEleme
|
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
type?: "button" | "submit" | "reset";
|
|
14
14
|
}
|
|
15
|
-
declare const PrimaryButton: React.
|
|
15
|
+
declare const PrimaryButton: React.ForwardRefExoticComponent<PrimaryButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
16
|
export default PrimaryButton;
|
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React, { forwardRef } from "react";
|
|
2
24
|
import "./PrimaryButton.css";
|
|
3
25
|
import "../../../styles/global.css";
|
|
4
|
-
var PrimaryButton = function (_a) {
|
|
5
|
-
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? "button" : _d;
|
|
6
|
-
return (React.createElement("button", { className: "primary-button ".concat(disabled ? "primary-button-disabled" : "primary-button-enabled", " ").concat(fullWidth ? "primary-button-full-width" : ""), disabled: disabled, onClick: onClick, type: type },
|
|
7
|
-
startIcon && React.createElement("span", { className: "primary-button-icon ".concat(startIconName) }),
|
|
26
|
+
var PrimaryButton = forwardRef(function (_a, ref) {
|
|
27
|
+
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? "button" : _d, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "onClick", "fullWidth", "type"]);
|
|
28
|
+
return (React.createElement("button", __assign({ ref: ref, className: "primary-button ".concat(disabled ? "primary-button-disabled" : "primary-button-enabled", " ").concat(fullWidth ? "primary-button-full-width" : ""), disabled: disabled, onClick: onClick, type: type }, props),
|
|
29
|
+
startIcon && (React.createElement("span", { className: "primary-button-icon ".concat(startIconName) })),
|
|
8
30
|
React.createElement("span", { className: "primary-button-label" }, label),
|
|
9
31
|
endIcon && React.createElement("span", { className: "primary-button-icon ".concat(endIconName) })));
|
|
10
|
-
};
|
|
32
|
+
});
|
|
33
|
+
PrimaryButton.displayName = "PrimaryButton";
|
|
11
34
|
export default PrimaryButton;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
.backdrop {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
height: 100vh;
|
|
6
|
+
width: 100vw;
|
|
7
|
+
z-index: 4500;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.baseFilter {
|
|
11
|
+
position: relative;
|
|
12
|
+
width: fit-content;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.smallOpenFilter{
|
|
16
|
+
position: relative;
|
|
17
|
+
width: fit-content;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.options {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 120%;
|
|
23
|
+
left: 0;
|
|
24
|
+
width: fit-content;
|
|
25
|
+
border: 0.5px solid #ddd;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
background-color: #ffffff;
|
|
28
|
+
box-shadow: rgba(9, 30, 66, 0.15) 0px 8px 12px 0px;
|
|
29
|
+
z-index: 5000;
|
|
30
|
+
padding: 0.4rem 0rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.item {
|
|
34
|
+
background: none;
|
|
35
|
+
border: none;
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: row;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 0.75rem;
|
|
40
|
+
padding: 0.5rem 1rem;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
border-left: 2px solid #FFF;
|
|
43
|
+
width: 100%;
|
|
44
|
+
color: #0000
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.round {
|
|
48
|
+
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
border: 1px solid #D1DCE7;
|
|
53
|
+
border-radius: 3rem;
|
|
54
|
+
padding: 2px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.selected {
|
|
58
|
+
background-color: #25BEEB;
|
|
59
|
+
min-width: 0.6rem;
|
|
60
|
+
min-height: 0.6rem;
|
|
61
|
+
border-radius: 1rem;
|
|
62
|
+
display: block;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.notSelected {
|
|
66
|
+
background-color: #FFF;
|
|
67
|
+
min-width: 0.6rem;
|
|
68
|
+
min-height: 0.6rem;
|
|
69
|
+
border-radius: 1rem;
|
|
70
|
+
display: block;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.item > span {
|
|
74
|
+
text-wrap: nowrap;
|
|
75
|
+
font-family: var(--font-open-sans);
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
font-weight: 500;
|
|
78
|
+
color: #000;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.item:hover {
|
|
82
|
+
background-color: #EFF2F5;
|
|
83
|
+
border-left: 2px solid #25BEEB;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.optionsSmall {
|
|
87
|
+
position: fixed;
|
|
88
|
+
right: 0;
|
|
89
|
+
transition: bottom 225ms cubic-bezier(0, 0, 0.2, 1);
|
|
90
|
+
max-height: 90dvh;
|
|
91
|
+
background-color: white;
|
|
92
|
+
width: 100vw;
|
|
93
|
+
display: none;
|
|
94
|
+
border-radius: 16px 16px 0 0;
|
|
95
|
+
padding: 1rem;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
gap: 2rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.smallItem {
|
|
101
|
+
background: none;
|
|
102
|
+
border: none;
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: row-reverse;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: space-between;
|
|
107
|
+
padding: 1.5rem 1rem;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
border-left: 2px solid #FFF;
|
|
110
|
+
width: 100%;
|
|
111
|
+
color: #0000;
|
|
112
|
+
border-top: 1px solid #e4edf6;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.smallItem:first-child {
|
|
116
|
+
border-top: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.smallItem > span {
|
|
120
|
+
text-wrap: nowrap;
|
|
121
|
+
font-family: var(--font-open-sans);
|
|
122
|
+
font-size: 14px;
|
|
123
|
+
font-weight: 500;
|
|
124
|
+
color: #000;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.choices {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.closeButton {
|
|
133
|
+
height: fit-content;
|
|
134
|
+
border: none;
|
|
135
|
+
color: #000;
|
|
136
|
+
background: transparent;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
width: 20px;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.closeButton > i {
|
|
145
|
+
font-size: 16px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.row {
|
|
149
|
+
width: 100%;
|
|
150
|
+
height: fit-content;
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: row;
|
|
153
|
+
justify-content: space-between;
|
|
154
|
+
align-items: center;
|
|
155
|
+
gap: 1rem;
|
|
156
|
+
padding: 1rem 0.5rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@media screen and (max-width: 800px) {
|
|
160
|
+
.options {
|
|
161
|
+
display: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.optionsSmall {
|
|
165
|
+
z-index: 5000;
|
|
166
|
+
display: flex;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.backdrop {
|
|
170
|
+
background: linear-gradient(180deg, rgba(26, 50, 56, 0.00) 0%, rgba(2, 9, 11, 0.45) 100%);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./SingleFilter.css";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export type SingleFilterProps = {
|
|
4
|
+
defaultSelectedValue?: string;
|
|
5
|
+
filterData: {
|
|
6
|
+
value: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
9
|
+
setFilter: (selectedValue: string) => void;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
showNumIndic?: boolean;
|
|
13
|
+
showBackdrop?: boolean;
|
|
14
|
+
isStatusTag?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const SingleFilter: ({ showNumIndic, required, defaultSelectedValue, filterData, setFilter, showBackdrop, children, ...props }: SingleFilterProps) => React.JSX.Element;
|
|
17
|
+
export default SingleFilter;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import "./SingleFilter.css";
|
|
24
|
+
import { FilterButtonPrimary, PrimaryButton } from "../buttons";
|
|
25
|
+
import { TinyInfo } from "../typography";
|
|
26
|
+
import React, { useState } from "react";
|
|
27
|
+
var SingleFilter = function (_a) {
|
|
28
|
+
var _b = _a.showNumIndic, showNumIndic = _b === void 0 ? false : _b, _c = _a.required, required = _c === void 0 ? true : _c, defaultSelectedValue = _a.defaultSelectedValue, filterData = _a.filterData, setFilter = _a.setFilter, _d = _a.showBackdrop, showBackdrop = _d === void 0 ? false : _d, children = _a.children, props = __rest(_a, ["showNumIndic", "required", "defaultSelectedValue", "filterData", "setFilter", "showBackdrop", "children"]);
|
|
29
|
+
var _e = useState(false), isOpen = _e[0], setIsOpen = _e[1];
|
|
30
|
+
var _f = useState(defaultSelectedValue || ""), selectedValue = _f[0], setSelectedValue = _f[1];
|
|
31
|
+
var handleClose = function () {
|
|
32
|
+
setFilter(selectedValue);
|
|
33
|
+
setIsOpen(false);
|
|
34
|
+
};
|
|
35
|
+
var handleButtonTap = function () {
|
|
36
|
+
isOpen ? handleClose() : setIsOpen(true);
|
|
37
|
+
};
|
|
38
|
+
var Item = function (_a) {
|
|
39
|
+
var name = _a.name, value = _a.value;
|
|
40
|
+
return (React.createElement("button", { className: "item", onClick: function () { setSelectedValue(value); handleClose(); } },
|
|
41
|
+
React.createElement("div", { className: "round" },
|
|
42
|
+
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
43
|
+
React.createElement("span", null, name)));
|
|
44
|
+
};
|
|
45
|
+
var SmallItem = function (_a) {
|
|
46
|
+
var name = _a.name, value = _a.value;
|
|
47
|
+
return (React.createElement("button", { className: "smallItem", onClick: function () { setSelectedValue(value); } },
|
|
48
|
+
React.createElement("div", { className: "round" },
|
|
49
|
+
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
50
|
+
React.createElement("span", null, name)));
|
|
51
|
+
};
|
|
52
|
+
return (React.createElement(React.Fragment, null,
|
|
53
|
+
React.createElement("div", __assign({ className: "baseFilter" }, props),
|
|
54
|
+
React.createElement(FilterButtonPrimary, { onClick: handleButtonTap, zIndex: "2000" },
|
|
55
|
+
children,
|
|
56
|
+
React.createElement("p", { style: { color: "#25BEEB", fontWeight: "600" } }, showNumIndic && "(".concat(selectedValue.length, ")"))),
|
|
57
|
+
isOpen && (React.createElement("div", { className: "options" }, filterData && filterData.length > 0 &&
|
|
58
|
+
filterData.map(function (item, idx) { return (React.createElement(Item, { name: item.name, value: item.value, key: idx })); }))),
|
|
59
|
+
React.createElement("div", { className: "optionsSmall", style: { bottom: isOpen ? "0" : "-100%" } },
|
|
60
|
+
React.createElement("div", { className: "row" },
|
|
61
|
+
React.createElement("div", { style: { minWidth: "20px" } }),
|
|
62
|
+
React.createElement(TinyInfo, { text: children, variant: "bold14", color: "noir" }),
|
|
63
|
+
React.createElement("button", { className: "closeButton", onClick: handleClose },
|
|
64
|
+
React.createElement("i", { className: "allaw-icon-close" }))),
|
|
65
|
+
React.createElement("div", { className: "choices" }, filterData && filterData.length > 0 &&
|
|
66
|
+
filterData.map(function (item, idx) { return (React.createElement(SmallItem, { name: item.name, value: item.value, key: idx })); })),
|
|
67
|
+
React.createElement(PrimaryButton, { label: "Voir les r\u00E9sultats", onClick: handleClose }))),
|
|
68
|
+
isOpen && (React.createElement("div", { className: "backdrop", onClick: handleClose }))));
|
|
69
|
+
};
|
|
70
|
+
export default SingleFilter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SingleFilter } from "./SingleFilter";
|
package/dist/index.d.ts
CHANGED
|
@@ -10,12 +10,13 @@ export { default as TabNavigation } from "./components/atoms/buttons/TabNavigati
|
|
|
10
10
|
export { default as TertiaryButton } from "./components/atoms/buttons/TertiaryButton";
|
|
11
11
|
export { default as OAuthProviderButton } from "./components/atoms/buttons/OAuthProviderButton";
|
|
12
12
|
export { default as Checkbox } from "./components/atoms/checkboxes/Checkbox";
|
|
13
|
-
export { default as
|
|
13
|
+
export { default as Fitler } from "./components/atoms/filter/Filter";
|
|
14
14
|
export { default as Input } from "./components/atoms/inputs/Input";
|
|
15
15
|
export type { InputProps, InputRef } from "./components/atoms/inputs/Input";
|
|
16
16
|
export { default as SearchBar } from "./components/atoms/inputs/SearchBar";
|
|
17
17
|
export { default as ProgressBar } from "./components/atoms/progressBars/ProgressBar";
|
|
18
18
|
export { default as RadioButton } from "./components/atoms/radios/RadioButton";
|
|
19
|
+
export { default as SingleFilter } from "./components/atoms/filters/SingleFilter";
|
|
19
20
|
export { default as Select } from "./components/atoms/selects/Select";
|
|
20
21
|
export type { SelectItem, SelectProps, SelectRef, } from "./components/atoms/selects/Select";
|
|
21
22
|
export { default as AppointementStatusTag } from "./components/atoms/tags/AppointementStatusTag";
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ export { default as OAuthProviderButton } from "./components/atoms/buttons/OAuth
|
|
|
14
14
|
// Checkboxes
|
|
15
15
|
export { default as Checkbox } from "./components/atoms/checkboxes/Checkbox";
|
|
16
16
|
// Checkboxes
|
|
17
|
-
export { default as
|
|
17
|
+
export { default as Fitler } from "./components/atoms/filter/Filter";
|
|
18
18
|
// Inputs
|
|
19
19
|
export { default as Input } from "./components/atoms/inputs/Input";
|
|
20
20
|
export { default as SearchBar } from "./components/atoms/inputs/SearchBar";
|
|
@@ -22,6 +22,7 @@ export { default as SearchBar } from "./components/atoms/inputs/SearchBar";
|
|
|
22
22
|
export { default as ProgressBar } from "./components/atoms/progressBars/ProgressBar";
|
|
23
23
|
// Radios
|
|
24
24
|
export { default as RadioButton } from "./components/atoms/radios/RadioButton";
|
|
25
|
+
export { default as SingleFilter } from "./components/atoms/filters/SingleFilter";
|
|
25
26
|
// Selects
|
|
26
27
|
export { default as Select } from "./components/atoms/selects/Select";
|
|
27
28
|
// Tags
|