@olenbetong/synergi-react 1.0.4 → 1.0.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.
Files changed (42) hide show
  1. package/dist/esm/ob.react.js +43 -56
  2. package/dist/esm/ob.react.min.css.map +1 -1
  3. package/dist/esm/ob.react.min.js +1 -1
  4. package/dist/esm/ob.react.min.js.map +3 -3
  5. package/dist/iife/ob.react.js +46 -59
  6. package/dist/iife/ob.react.min.css.map +1 -1
  7. package/dist/iife/ob.react.min.js +1 -1
  8. package/dist/iife/ob.react.min.js.map +3 -3
  9. package/dist/styles/styles.css +1 -1
  10. package/dist/styles/styles.css.map +1 -1
  11. package/es/Checkbox/index.js +1 -0
  12. package/es/ColorCard/index.css +1 -1
  13. package/es/DateNavigator/index.css +1 -1
  14. package/es/DateNavigator/index.js +1 -1
  15. package/es/LinkedCardList/index.css +1 -1
  16. package/es/PageBanner/index.css +1 -1
  17. package/es/PageBanner/index.js +2 -1
  18. package/es/Portal/index.js +5 -7
  19. package/es/Sidebar/index.js +1 -0
  20. package/es/Spinner/index.d.ts +1 -1
  21. package/es/SplitContainer/index.d.ts +1 -1
  22. package/es/SplitContainer/index.js +2 -1
  23. package/es/ValueToggle/index.js +1 -1
  24. package/es/index.css +1 -1
  25. package/es/useTranslation/index.js +2 -1
  26. package/package.json +5 -5
  27. package/src/Checkbox/index.tsx +2 -1
  28. package/src/ColorCard/index.scss +3 -3
  29. package/src/DateNavigator/index.scss +2 -2
  30. package/src/DateNavigator/index.tsx +1 -1
  31. package/src/LinkedCardList/index.scss +4 -4
  32. package/src/PageBanner/index.scss +8 -8
  33. package/src/PageBanner/index.tsx +2 -1
  34. package/src/Portal/index.tsx +8 -7
  35. package/src/ProgressBar/index.scss +3 -3
  36. package/src/Sidebar/index.tsx +1 -0
  37. package/src/Spinner/index.tsx +1 -1
  38. package/src/SplitContainer/index.tsx +6 -4
  39. package/src/ValueToggle/index.scss +1 -1
  40. package/src/ValueToggle/index.tsx +1 -1
  41. package/src/index.scss +9 -9
  42. package/src/useTranslation/index.ts +2 -1
@@ -2,7 +2,8 @@ import "./index.scss";
2
2
 
3
3
  import clsx from "clsx";
4
4
  import localforage from "localforage";
5
- import React, { Children, forwardRef, useEffect, useRef, useState } from "react";
5
+ import type React from "react";
6
+ import { Children, forwardRef, useEffect, useRef, useState } from "react";
6
7
 
7
8
  const article = globalThis.af?.article?.id ?? globalThis.window?.location.pathname.substring(1).split("/")[0];
8
9
  const settingsStore = localforage.createInstance({
@@ -63,7 +64,7 @@ type DividerProps = {
63
64
 
64
65
  const Divider = forwardRef<HTMLDivElement, DividerProps>(function Divider(props: DividerProps, ref) {
65
66
  return (
66
- <div tabIndex={0} className={clsx("ObSplitContainer-divider", props.className)} ref={ref}>
67
+ <div className={clsx("ObSplitContainer-divider", props.className)} ref={ref}>
67
68
  <span>•••</span>
68
69
  </div>
69
70
  );
@@ -174,6 +175,7 @@ export function SplitContainer({
174
175
 
175
176
  let childrenArray = Children.toArray(children);
176
177
 
178
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
177
179
  useEffect(() => {
178
180
  let divider = dividerRef.current;
179
181
  if (divider) {
@@ -229,8 +231,8 @@ export function SplitContainer({
229
231
  }
230
232
 
231
233
  function handleKeyDown(event: KeyboardEvent) {
232
- let reduce: boolean = true;
233
- let shouldHandle: boolean = false;
234
+ let reduce = true;
235
+ let shouldHandle = false;
234
236
  if (!event.altKey && !event.ctrlKey && !event.metaKey) {
235
237
  if (direction === "horizontal" && ["ArrowLeft", "ArrowRight"].includes(event.key)) {
236
238
  shouldHandle = true;
@@ -1,4 +1,4 @@
1
- @import "../styles/variables";
1
+ @use "../styles/variables";
2
2
 
3
3
  .ObValueToggle-root {
4
4
  display: flex;
@@ -23,7 +23,7 @@ function ValueToggleInner(
23
23
  }>,
24
24
  ) {
25
25
  const wrapperRef = useRef<HTMLDivElement>(null);
26
- const [toggleName] = useState("obet-value-toggle-" + String(++valueToggleId));
26
+ const [toggleName] = useState(`obet-value-toggle-${String(++valueToggleId)}`);
27
27
  const isControlled = value !== undefined;
28
28
 
29
29
  useImperativeHandle(ref, () => {
package/src/index.scss CHANGED
@@ -1,9 +1,9 @@
1
- @import "./Checkbox/index.scss";
2
- @import "./ColorCard/index.scss";
3
- @import "./DateNavigator/index.scss";
4
- @import "./LinkedCardList/index.scss";
5
- @import "./PageBanner/index.scss";
6
- @import "./ProgressBar/index.scss";
7
- @import "./Sidebar/index.scss";
8
- @import "./SplitContainer/index.scss";
9
- @import "./ValueToggle/index.scss";
1
+ @use "Checkbox/index.scss";
2
+ @use "ColorCard/index.scss" as index2;
3
+ @use "DateNavigator/index.scss" as index3;
4
+ @use "LinkedCardList/index.scss" as index4;
5
+ @use "PageBanner/index.scss" as index5;
6
+ @use "ProgressBar/index.scss" as index6;
7
+ @use "Sidebar/index.scss" as index7;
8
+ @use "SplitContainer/index.scss" as index8;
9
+ @use "ValueToggle/index.scss" as index9;
@@ -16,7 +16,7 @@ async function translateText(text: string, target: string, apiKey: string) {
16
16
  let json = await result.json();
17
17
  let { data } = json;
18
18
 
19
- if (data && data.translations) {
19
+ if (data?.translations) {
20
20
  let [translation] = data.translations;
21
21
 
22
22
  return {
@@ -35,6 +35,7 @@ export function useTranslation(text: string, targetLanguage: string, apiKey: str
35
35
  let [isTranslating, setIsTranslating] = useState(false);
36
36
  let textRef = useRef(text);
37
37
 
38
+ // biome-ignore lint/correctness/useExhaustiveDependencies: this is a way of resetting the state so we don't show outdated translations when the text changes
38
39
  useEffect(() => {
39
40
  textRef.current = text;
40
41
  return () => {