@logora/debate 0.3.3 → 0.3.6

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.
@@ -1,33 +1,33 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import O from "classnames";
2
+ import b from "classnames";
3
3
  import "react";
4
- import b from "react-oauth-popup";
4
+ import p from "react-oauth-popup";
5
5
  import { useLocation as x } from "react-router-dom";
6
- import p from "./OAuth2Button.module.scss.js";
7
- const j = ({
8
- provider: c,
9
- authDialogUrl: d,
10
- clientId: m,
11
- redirectUri: h,
6
+ import c from "./OAuth2Button.module.scss.js";
7
+ const U = p?.default ?? p, A = ({
8
+ provider: d,
9
+ authDialogUrl: m,
10
+ clientId: h,
11
+ redirectUri: u,
12
12
  scope: f,
13
- responseType: r,
14
- accessType: o = "",
15
- forceAuth: u = !1,
16
- onCode: l,
13
+ responseType: o,
14
+ accessType: r = "",
15
+ forceAuth: l = !1,
16
+ onCode: P,
17
17
  onClose: t,
18
18
  popup: w = !0,
19
19
  children: n,
20
- className: P,
20
+ className: _,
21
21
  state: s = ""
22
22
  }) => {
23
23
  x();
24
- const C = (a, U) => {
25
- l(a, c);
26
- }, _ = () => {
24
+ const C = (a, g) => {
25
+ P(a, d);
26
+ }, O = () => {
27
27
  t && t();
28
28
  }, i = () => {
29
- const a = new URL(d);
30
- return a.searchParams.append("client_id", m), a.searchParams.append("redirect_uri", h), a.searchParams.append("scope", f), u && a.searchParams.append("force_authentication", "1"), r && a.searchParams.append("response_type", r), o && a.searchParams.append("access_type", o), typeof window < "u" && a.searchParams.append(
29
+ const a = new URL(m);
30
+ return a.searchParams.append("client_id", h), a.searchParams.append("redirect_uri", u), a.searchParams.append("scope", f), l && a.searchParams.append("force_authentication", "1"), o && a.searchParams.append("response_type", o), r && a.searchParams.append("access_type", r), typeof window < "u" && a.searchParams.append(
31
31
  "state",
32
32
  s ? window.btoa(s) : window.btoa(window.location.href)
33
33
  ), a.href;
@@ -36,19 +36,19 @@ const j = ({
36
36
  "div",
37
37
  {
38
38
  "data-testid": "container",
39
- className: O(p.oauthButtonContainer, P),
39
+ className: b(c.oauthButtonContainer, _),
40
40
  children: w ? /* @__PURE__ */ e(
41
- b,
41
+ U,
42
42
  {
43
43
  url: i(),
44
44
  onCode: C,
45
- onClose: _,
46
- children: /* @__PURE__ */ e("div", { className: p.oauthPopupContainer, children: n })
45
+ onClose: O,
46
+ children: /* @__PURE__ */ e("div", { className: c.oauthPopupContainer, children: n })
47
47
  }
48
48
  ) : /* @__PURE__ */ e("a", { href: i(), children: n })
49
49
  }
50
50
  );
51
51
  };
52
52
  export {
53
- j as OAuth2Button
53
+ A as OAuth2Button
54
54
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.3.3",
3
+ "version": "0.3.6",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -76,7 +76,7 @@
76
76
  "webfontloader": "^1.6.28"
77
77
  },
78
78
  "devDependencies": {
79
- "@biomejs/biome": "^1.9.4",
79
+ "@biomejs/biome": "^2.4.11",
80
80
  "@faker-js/faker": "^10.4.0",
81
81
  "@storybook/addon-a11y": "^10.3.5",
82
82
  "@storybook/addon-docs": "^10.3.5",
@@ -87,13 +87,13 @@
87
87
  "@testing-library/react": "^16.3.2",
88
88
  "@testing-library/user-event": "^14.5.2",
89
89
  "@vitejs/plugin-react": "^4.7.0",
90
- "@vitest/coverage-v8": "^4.1.3",
90
+ "@vitest/coverage-v8": "^4.1.4",
91
91
  "jsdom": "^29.0.2",
92
92
  "sass": "^1.85.0",
93
93
  "storybook": "^10.3.5",
94
94
  "vite": "^7.3.2",
95
95
  "vite-plugin-lib-inject-css": "^2.2.2",
96
- "vitest": "^4.1.3"
96
+ "vitest": "^4.1.4"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "react": "^17.0.0 || ^18.0.0",
@@ -0,0 +1,66 @@
1
+ import React, { useState } from "react";
2
+ import cx from "classnames";
3
+ import styles from "./tabs.stories.module.scss";
4
+
5
+ const TabsDemo = ({ tabs }) => {
6
+ const [activeTab, setActiveTab] = useState(0);
7
+
8
+ return (
9
+ <div>
10
+ <nav>
11
+ <ul className={styles.navTabs}>
12
+ {tabs.map((tab, index) => (
13
+ <li key={tab} className={styles.navItem}>
14
+ <div
15
+ className={cx(styles.navLink, {
16
+ [styles.active]: activeTab === index,
17
+ })}
18
+ onClick={() => setActiveTab(index)}
19
+ onKeyUp={(e) => {
20
+ if (e.key === "Enter" || e.key === " ") setActiveTab(index);
21
+ }}
22
+ role="tab"
23
+ tabIndex={0}
24
+ aria-selected={activeTab === index}
25
+ >
26
+ {tab}
27
+ </div>
28
+ </li>
29
+ ))}
30
+ </ul>
31
+ </nav>
32
+ <div className={styles.tabContent}>
33
+ {tabs.map((tab, index) => (
34
+ <div
35
+ key={tab}
36
+ className={cx(styles.tabPane, { [styles.active]: activeTab === index })}
37
+ >
38
+ Contenu de l'onglet : <strong>{tab}</strong>
39
+ </div>
40
+ ))}
41
+ </div>
42
+ </div>
43
+ );
44
+ };
45
+
46
+ const meta = {
47
+ title: "Styles/Tabs",
48
+ component: TabsDemo,
49
+ args: {
50
+ tabs: ["Onglet 1", "Onglet 2", "Onglet 3"],
51
+ },
52
+ argTypes: {
53
+ tabs: { control: "object" },
54
+ },
55
+ render: (args) => <TabsDemo {...args} />,
56
+ };
57
+
58
+ export default meta;
59
+
60
+ export const DefaultTabs = {};
61
+
62
+ export const TwoTabs = {
63
+ args: {
64
+ tabs: ["En cours", "Sélectionnés"],
65
+ },
66
+ };
@@ -25,10 +25,6 @@
25
25
  display: none;
26
26
  }
27
27
 
28
- .navItem {
29
- margin-bottom: -1px;
30
- }
31
-
32
28
  .navLink {
33
29
  border: 1px solid transparent;
34
30
  border-top-left-radius: theme.$box-border-radius;
@@ -56,7 +52,7 @@
56
52
 
57
53
  .navLink {
58
54
  display: block;
59
- padding-bottom: spacing.$spacer-xs;
55
+ padding-bottom: spacing.$spacer-sm;
60
56
 
61
57
  &:hover,
62
58
  &:focus {
@@ -99,22 +95,28 @@
99
95
  outline: 0;
100
96
  }
101
97
 
102
- .navLink.active,
103
- .navLink:hover {
98
+ .navLink.active {
104
99
  border: none !important;
105
100
  color: theme.$text-primary !important;
106
101
  background: transparent;
107
102
  font-weight: theme.$font-weight-bold;
108
103
  }
109
104
 
105
+ .navLink:hover {
106
+ border: none !important;
107
+ color: theme.$text-primary !important;
108
+ background: transparent;
109
+ }
110
+
110
111
  .navLink::after {
111
112
  content: "";
112
113
  background-color: theme.$text-primary;
113
- height: 4px;
114
+ height: 2px;
114
115
  position: absolute;
115
116
  width: 100%;
116
117
  left: 0;
117
118
  bottom: -1px;
119
+ z-index: 1;
118
120
  transition: all 250ms ease 0s;
119
121
  transform: scale(0);
120
122
  }
@@ -0,0 +1 @@
1
+ @use './tabs';