allaw-ui 3.5.0 → 3.5.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.
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ export type InboxButtonProps = {
3
+ itemNumber?: number;
4
+ onClick?: () => void;
5
+ labelIfNone: string;
6
+ labelIfOne: string;
7
+ labelIfMultiple: string;
8
+ background?: "mid-grey" | "dark-grey" | "noir" | "light-red" | "light-blue" | "dark-green";
9
+ color?: "mid-grey" | "dark-grey" | "noir" | "pure-white" | "red" | "green" | "blue";
10
+ startIcon?: string;
11
+ startIconName?: string;
12
+ };
13
+ declare const InboxButton: ({ itemNumber, onClick, labelIfNone, labelIfOne, labelIfMultiple, background, color, startIcon, startIconName, }: InboxButtonProps) => React.JSX.Element;
14
+ export default InboxButton;
@@ -0,0 +1,16 @@
1
+ import clsx from "clsx";
2
+ import React from "react";
3
+ import styles from "./InboxButton.module.css";
4
+ var InboxButton = function (_a) {
5
+ var _b = _a.itemNumber, itemNumber = _b === void 0 ? 0 : _b, onClick = _a.onClick, labelIfNone = _a.labelIfNone, labelIfOne = _a.labelIfOne, labelIfMultiple = _a.labelIfMultiple, background = _a.background, color = _a.color, startIcon = _a.startIcon, startIconName = _a.startIconName;
6
+ var disabled = itemNumber === 0;
7
+ var label = itemNumber === 0
8
+ ? labelIfNone
9
+ : itemNumber === 1
10
+ ? labelIfOne
11
+ : labelIfMultiple.replace("{{count}}", String(itemNumber));
12
+ return (React.createElement("button", { className: clsx(styles.inboxBtn, disabled && styles.disabled, background && styles["bg-".concat(background)]), disabled: disabled, onClick: onClick },
13
+ startIcon && (React.createElement("i", { className: clsx(styles.icon, startIcon, color && styles["color-".concat(color)]), "aria-label": startIconName })),
14
+ React.createElement("span", { className: clsx(styles.label, disabled && styles.labelDisabled, color && styles["color-".concat(color)]) }, label)));
15
+ };
16
+ export default InboxButton;
@@ -0,0 +1,100 @@
1
+ @import "../../../styles/colors.css";
2
+
3
+ .inboxBtn {
4
+ display: flex;
5
+ flex-direction: row;
6
+ flex-wrap: nowrap;
7
+ justify-content: center;
8
+ align-items: center;
9
+ gap: 0.5rem;
10
+ padding: 0.5rem;
11
+ width: 100%;
12
+ border: none;
13
+ border-radius: 0.5rem;
14
+ cursor: pointer;
15
+ }
16
+
17
+ .inboxBtn:hover {
18
+ filter: brightness(0.95);
19
+ }
20
+
21
+ .disabled {
22
+ cursor: initial;
23
+ background-color: var(--tag-light-blue);
24
+ color: var(--tag-blue);
25
+ }
26
+
27
+ .label {
28
+ font-family: var(--font-open-sans);
29
+ font-size: 16px;
30
+ font-style: normal;
31
+ font-weight: 600;
32
+ line-height: normal;
33
+ }
34
+
35
+ .labelDisabled {
36
+ color: var(--tag-blue);
37
+ }
38
+
39
+ .bg-mid-grey {
40
+ background-color: var(--mid-grey);
41
+ }
42
+
43
+ .bg-dark-grey {
44
+ background-color: var(--dark-grey);
45
+ }
46
+
47
+ .bg-noir {
48
+ background-color: var(--noir);
49
+ }
50
+
51
+ .bg-pure-white {
52
+ background-color: var(--pure-white);
53
+ }
54
+
55
+ .bg-light-red {
56
+ background-color: var(--red-tag-light);
57
+ }
58
+
59
+ .bg-light-blue {
60
+ background-color: var(--blue-tag-light);
61
+ }
62
+
63
+ .bg-dark-green {
64
+ background-color: var(--green-tag-dark);
65
+ }
66
+
67
+ .color-mid-grey {
68
+ color: var(--mid-grey);
69
+ }
70
+
71
+ .color-dark-grey {
72
+ color: var(--dark-grey);
73
+ }
74
+
75
+ .color-noir {
76
+ color: var(--noir);
77
+ }
78
+
79
+ .color-pure-white {
80
+ color: var(--pure-white);
81
+ }
82
+
83
+ .color-red {
84
+ color: var(--actions-error);
85
+ }
86
+
87
+ .color-green {
88
+ color: var(--actions-valid);
89
+ }
90
+
91
+ .color-blue {
92
+ color: var(--blue-tag-dark);
93
+ }
94
+
95
+ .icon {
96
+ font-size: 24px;
97
+ line-height: 1;
98
+ display: flex;
99
+ align-items: center;
100
+ }
@@ -0,0 +1,97 @@
1
+ declare namespace _default {
2
+ export let title: string;
3
+ export { InboxButton as component };
4
+ export let tags: string[];
5
+ export namespace argTypes {
6
+ namespace itemNumber {
7
+ namespace control {
8
+ let type: string;
9
+ }
10
+ let description: string;
11
+ let defaultValue: number;
12
+ }
13
+ namespace labelIfNone {
14
+ export namespace control_1 {
15
+ let type_1: string;
16
+ export { type_1 as type };
17
+ }
18
+ export { control_1 as control };
19
+ let description_1: string;
20
+ export { description_1 as description };
21
+ }
22
+ namespace labelIfOne {
23
+ export namespace control_2 {
24
+ let type_2: string;
25
+ export { type_2 as type };
26
+ }
27
+ export { control_2 as control };
28
+ let description_2: string;
29
+ export { description_2 as description };
30
+ }
31
+ namespace labelIfMultiple {
32
+ export namespace control_3 {
33
+ let type_3: string;
34
+ export { type_3 as type };
35
+ }
36
+ export { control_3 as control };
37
+ let description_3: string;
38
+ export { description_3 as description };
39
+ }
40
+ namespace background {
41
+ export namespace control_4 {
42
+ let type_4: string;
43
+ export { type_4 as type };
44
+ export let options: string[];
45
+ }
46
+ export { control_4 as control };
47
+ let description_4: string;
48
+ export { description_4 as description };
49
+ }
50
+ namespace color {
51
+ export namespace control_5 {
52
+ let type_5: string;
53
+ export { type_5 as type };
54
+ let options_1: string[];
55
+ export { options_1 as options };
56
+ }
57
+ export { control_5 as control };
58
+ let description_5: string;
59
+ export { description_5 as description };
60
+ }
61
+ namespace startIcon {
62
+ export namespace control_6 {
63
+ let type_6: string;
64
+ export { type_6 as type };
65
+ }
66
+ export { control_6 as control };
67
+ let description_6: string;
68
+ export { description_6 as description };
69
+ }
70
+ namespace startIconName {
71
+ export namespace control_7 {
72
+ let type_7: string;
73
+ export { type_7 as type };
74
+ }
75
+ export { control_7 as control };
76
+ let description_7: string;
77
+ export { description_7 as description };
78
+ }
79
+ namespace onClick {
80
+ let action: string;
81
+ }
82
+ }
83
+ export namespace parameters {
84
+ namespace docs {
85
+ export namespace description_8 {
86
+ let component: string;
87
+ }
88
+ export { description_8 as description };
89
+ }
90
+ }
91
+ }
92
+ export default _default;
93
+ export const AucuneNotification: any;
94
+ export const UneNotification: any;
95
+ export const PlusieursNotifications: any;
96
+ export const ClientQualifications: any;
97
+ import InboxButton from "./InboxButton";
@@ -0,0 +1,130 @@
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
+ import React from "react";
13
+ import "../../../styles/global.css";
14
+ import InboxButton from "./InboxButton";
15
+ export default {
16
+ title: "Components/Atoms/Buttons/InboxButton",
17
+ component: InboxButton,
18
+ tags: ["autodocs"],
19
+ argTypes: {
20
+ itemNumber: {
21
+ control: { type: "number" },
22
+ description: "Nombre d’éléments à traiter",
23
+ defaultValue: 0,
24
+ },
25
+ labelIfNone: {
26
+ control: { type: "text" },
27
+ description: "Texte affiché si itemNumber === 0",
28
+ },
29
+ labelIfOne: {
30
+ control: { type: "text" },
31
+ description: "Texte affiché si itemNumber === 1",
32
+ },
33
+ labelIfMultiple: {
34
+ control: { type: "text" },
35
+ description: "Texte affiché si itemNumber > 1 (utiliser {{count}} pour injecter la valeur)",
36
+ },
37
+ background: {
38
+ control: {
39
+ type: "select",
40
+ options: [
41
+ "light-blue",
42
+ "light-red",
43
+ "mid-grey",
44
+ "dark-grey",
45
+ "noir",
46
+ "tag-light-blue",
47
+ "dark-green",
48
+ ],
49
+ },
50
+ description: "Couleur de fond (classe CSS)",
51
+ },
52
+ color: {
53
+ control: {
54
+ type: "select",
55
+ options: [
56
+ "blue",
57
+ "red",
58
+ "green",
59
+ "mid-grey",
60
+ "dark-grey",
61
+ "noir",
62
+ "pure-white",
63
+ ],
64
+ },
65
+ description: "Couleur du texte (classe CSS)",
66
+ },
67
+ startIcon: {
68
+ control: { type: "text" },
69
+ description: "Nom de la classe d’icône (ex : allaw-icon-folder)",
70
+ },
71
+ startIconName: {
72
+ control: { type: "text" },
73
+ description: "Label accessible pour l’icône (aria-label)",
74
+ },
75
+ onClick: { action: "clicked" },
76
+ },
77
+ parameters: {
78
+ docs: {
79
+ description: {
80
+ component: "Bouton de notification dynamique avec icône, texte conditionnel, et couleurs personnalisables via les classes CSS d’Allaw.",
81
+ },
82
+ },
83
+ },
84
+ };
85
+ var Template = function (args) { return (React.createElement("div", { style: { padding: "20px", display: "flex", gap: "20px", flexWrap: "wrap" } },
86
+ React.createElement(InboxButton, __assign({}, args)))); };
87
+ export var AucuneNotification = Template.bind({});
88
+ AucuneNotification.args = {
89
+ itemNumber: 0,
90
+ labelIfNone: "Aucune notification",
91
+ labelIfOne: "1 Notification",
92
+ labelIfMultiple: "{{count}} notifications",
93
+ background: "light-blue",
94
+ color: "blue",
95
+ startIcon: "allaw-icon-inbox",
96
+ startIconName: "Dossier",
97
+ };
98
+ export var UneNotification = Template.bind({});
99
+ UneNotification.args = {
100
+ itemNumber: 1,
101
+ labelIfNone: "Aucune notification",
102
+ labelIfOne: "1 Notification",
103
+ labelIfMultiple: "{{count}} notifications",
104
+ background: "light-red",
105
+ color: "red",
106
+ startIcon: "allaw-icon-inbox",
107
+ startIconName: "Dossier",
108
+ };
109
+ export var PlusieursNotifications = Template.bind({});
110
+ PlusieursNotifications.args = {
111
+ itemNumber: 7,
112
+ labelIfNone: "Aucune Notification",
113
+ labelIfOne: "1 Notification",
114
+ labelIfMultiple: "{{count}} Notifications",
115
+ background: "light-red",
116
+ color: "red",
117
+ startIcon: "allaw-icon-inbox",
118
+ startIconName: "Dossier",
119
+ };
120
+ export var ClientQualifications = Template.bind({});
121
+ ClientQualifications.args = {
122
+ itemNumber: 5,
123
+ labelIfNone: "Aucun client à qualifier",
124
+ labelIfOne: "1 Client à qualifier",
125
+ labelIfMultiple: "{{count}} clients à qualifier",
126
+ background: "dark-green",
127
+ color: "pure-white",
128
+ startIcon: "allaw-icon-check-circle",
129
+ startIconName: "Dossier",
130
+ };
@@ -1,24 +1,26 @@
1
- export { default as FavoriteToggle } from "./FavoriteToggle";
2
- export { default as FilterButtonPrimary } from "./FilterButtonPrimary";
3
- export { default as FilterButton } from "./FilterButton";
4
- export { default as GhostButton } from "./GhostButton";
5
- export { default as IconButton } from "./IconButton";
6
- export { default as PendingDocuments } from "./PendingDocuments";
7
- export { default as PrimaryButton } from "./PrimaryButton";
8
- export { default as SecondaryButton } from "./SecondaryButton";
9
- export { default as TabNavigation } from "./TabNavigation";
10
- export { default as TertiaryButton } from "./TertiaryButton";
11
- export { default as OAuthProviderButton } from "./OAuthProviderButton";
12
1
  export { default as ActionButton } from "./ActionButton";
2
+ export type { ActionButtonProps } from "./ActionButton";
3
+ export { default as FavoriteToggle } from "./FavoriteToggle";
13
4
  export type { FavoriteToggleProps } from "./FavoriteToggle";
5
+ export { default as FilterButton } from "./FilterButton";
14
6
  export type { FilterButtonProps } from "./FilterButton";
7
+ export { default as FilterButtonPrimary } from "./FilterButtonPrimary";
8
+ export type { FilterButtonPrimaryProps } from "./FilterButtonPrimary";
9
+ export { default as GhostButton } from "./GhostButton";
15
10
  export type { GhostButtonProps } from "./GhostButton";
11
+ export { default as IconButton } from "./IconButton";
16
12
  export type { IconButtonProps } from "./IconButton";
13
+ export { default as InboxButton } from "./InboxButton";
14
+ export type { InboxButtonProps } from "./InboxButton";
15
+ export { default as OAuthProviderButton } from "./OAuthProviderButton";
16
+ export type { OAuthProviderButtonProps } from "./OAuthProviderButton";
17
+ export { default as PendingDocuments } from "./PendingDocuments";
17
18
  export type { PendingDocumentsProps } from "./PendingDocuments";
19
+ export { default as PrimaryButton } from "./PrimaryButton";
18
20
  export type { PrimaryButtonProps } from "./PrimaryButton";
21
+ export { default as SecondaryButton } from "./SecondaryButton";
19
22
  export type { SecondaryButtonProps } from "./SecondaryButton";
23
+ export { default as TabNavigation } from "./TabNavigation";
20
24
  export type { TabNavigationProps } from "./TabNavigation";
25
+ export { default as TertiaryButton } from "./TertiaryButton";
21
26
  export type { TertiaryButtonProps } from "./TertiaryButton";
22
- export type { OAuthProviderButtonProps } from "./OAuthProviderButton";
23
- export type { FilterButtonPrimaryProps } from "./FilterButtonPrimary";
24
- export type { ActionButtonProps } from "./ActionButton";
@@ -1,12 +1,13 @@
1
+ export { default as ActionButton } from "./ActionButton";
1
2
  export { default as FavoriteToggle } from "./FavoriteToggle";
2
- export { default as FilterButtonPrimary } from "./FilterButtonPrimary";
3
3
  export { default as FilterButton } from "./FilterButton";
4
+ export { default as FilterButtonPrimary } from "./FilterButtonPrimary";
4
5
  export { default as GhostButton } from "./GhostButton";
5
6
  export { default as IconButton } from "./IconButton";
7
+ export { default as InboxButton } from "./InboxButton";
8
+ export { default as OAuthProviderButton } from "./OAuthProviderButton";
6
9
  export { default as PendingDocuments } from "./PendingDocuments";
7
10
  export { default as PrimaryButton } from "./PrimaryButton";
8
11
  export { default as SecondaryButton } from "./SecondaryButton";
9
12
  export { default as TabNavigation } from "./TabNavigation";
10
13
  export { default as TertiaryButton } from "./TertiaryButton";
11
- export { default as OAuthProviderButton } from "./OAuthProviderButton";
12
- export { default as ActionButton } from "./ActionButton";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",