@youngonesworks/ui 0.1.29 → 0.1.31

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,4 +1,5 @@
1
- import React, { type ReactElement } from 'react';
1
+ import * as React from 'react';
2
+ import { type ReactElement } from 'react';
2
3
  import { type ActionMeta, type GroupBase, type Props, type PropsValue, type SingleValue } from 'react-select';
3
4
  interface CustomSelectProps<T> extends Props<T, false, GroupBase<T>> {
4
5
  small?: boolean;
@@ -4,5 +4,5 @@ interface ITableRow extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
4
4
  className?: string;
5
5
  header?: boolean;
6
6
  }
7
- export declare const TableRow: import("react").ForwardRefExoticComponent<ITableRow & import("react").RefAttributes<HTMLDivElement>>;
7
+ export declare function TableRow({ children, className, ...props }: ITableRow): import("react/jsx-runtime").JSX.Element;
8
8
  export {};
@@ -1,4 +1,4 @@
1
- import React, { type HTMLAttributes } from 'react';
1
+ import { type HTMLAttributes } from 'react';
2
2
  export interface IThemeIcon extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
3
3
  styleVariant?: 'black' | 'gray' | 'pink' | 'pink-with-background' | 'turquoise' | 'accent-blue' | 'check' | 'warning' | 'error';
4
4
  icon: React.ReactNode;
@@ -6,4 +6,4 @@ export interface IThemeIcon extends Omit<HTMLAttributes<HTMLDivElement>, 'classN
6
6
  adjustedSize?: string | number;
7
7
  title: string;
8
8
  }
9
- export declare const ThemeIcon: React.ForwardRefExoticComponent<IThemeIcon & React.RefAttributes<HTMLDivElement>>;
9
+ export declare function ThemeIcon({ styleVariant, className, icon, adjustedSize, title, ...props }: IThemeIcon): import("react/jsx-runtime").JSX.Element;
package/dist/index.cjs CHANGED
@@ -1,3 +1,6 @@
1
+ 'use client';
2
+
3
+
1
4
  //#region rolldown:runtime
2
5
  var __create = Object.create;
3
6
  var __defProp$1 = Object.defineProperty;
@@ -103318,7 +103321,10 @@ LinkText.displayName = "LinkText";
103318
103321
  const BreadCrumb = ({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkText, {
103319
103322
  "data-component": "BreadCrumb",
103320
103323
  classNames: "flex items-center",
103321
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconArrowNarrowLeft, { size: 20 }), children] })
103324
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconArrowNarrowLeft, { size: 20 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
103325
+ className: "flex items-center gap-5",
103326
+ children
103327
+ })] })
103322
103328
  });
103323
103329
  BreadCrumb.displayName = "BreadCrumb";
103324
103330
 
@@ -109965,12 +109971,21 @@ const ScrollToTop = ({ scrollToTopTitle }) => {
109965
109971
  else clearInterval(scrollInterval);
109966
109972
  }, 15);
109967
109973
  };
109968
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActionIcon, {
109974
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
109969
109975
  title: scrollToTopTitle,
109976
+ type: "button",
109977
+ disabled: false,
109978
+ "data-testid": "scrollToTop",
109979
+ "data-component": "ActionIcon",
109970
109980
  className: `active:translate-y-[1px] content-center rounded-[4px] border-gray-200 hover:border-black child:p-10 disabled:text-gray-500 bg-turquoise-700 hover:bg-turquoise-600 fixed -right-[10px] bottom-[105px] z-40 flex h-[43px] w-[62px] cursor-pointer items-center justify-center rounded-l-3xl border-0 px-2 text-black duration-500 ${isVisible ? "translate-x-0" : "translate-x-[60px]"}`,
109971
109981
  onClick: scrollToTop,
109972
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronUp, {})
109973
- });
109982
+ "data-tooltip-id": scrollToTopTitle,
109983
+ "data-tooltip-content": scrollToTopTitle,
109984
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronUp, {})
109985
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(M, {
109986
+ id: scrollToTopTitle,
109987
+ className: "z-[99]"
109988
+ })] });
109974
109989
  };
109975
109990
 
109976
109991
  //#endregion
@@ -111918,9 +111933,9 @@ var jsx = function jsx$3(type, props) {
111918
111933
  }
111919
111934
  return react.createElement.apply(null, createElementArgArray);
111920
111935
  };
111921
- (function(_jsx$66) {
111936
+ (function(_jsx$69) {
111922
111937
  var JSX;
111923
- (function(_JSX) {})(JSX || (JSX = _jsx$66.JSX || (_jsx$66.JSX = {})));
111938
+ (function(_JSX) {})(JSX || (JSX = _jsx$69.JSX || (_jsx$69.JSX = {})));
111924
111939
  })(jsx || (jsx = {}));
111925
111940
  var Global = /* @__PURE__ */ withEmotionCache(function(props, cache) {
111926
111941
  var styles = props.styles;
@@ -115892,13 +115907,107 @@ const TableHeaderRow = ({ children,...props }) => /* @__PURE__ */ (0, react_jsx_
115892
115907
 
115893
115908
  //#endregion
115894
115909
  //#region src/components/table/tableRow/index.tsx
115895
- const TableRow = (0, react.forwardRef)(({ children, className,...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
115910
+ function TableRow({ children, className,...props }) {
115911
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
115912
+ "data-component": "tableRow",
115913
+ className: `${cn("table-row border-x-0 border-y-0 border-t border-solid border-gray-200 xl:border-t xl:border-solid xl:border-gray-200", "hover:bg-ultra-light-blue", className)}`,
115914
+ ...props,
115915
+ children
115916
+ });
115917
+ }
115918
+
115919
+ //#endregion
115920
+ //#region src/components/tabs/Tab.tsx
115921
+ const Tab = (0, react.forwardRef)(({ tabId, activeTab, tabContent, clickFnc, rightSection }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
115896
115922
  ref,
115897
- "data-component": "tableRow",
115898
- className: `${cn("table-row border-x-0 border-y-0 border-t border-solid border-gray-200 xl:border-t xl:border-solid xl:border-gray-200", "hover:bg-ultra-light-blue", className)}`,
115899
- ...props,
115900
- children
115923
+ "data-testid": `tab-${tabId}`,
115924
+ className: `${activeTab && "text-light-blue bg-[#F0F0F6]"} bg-ultra-light-blue px-5 py-[10px] text-xs font-normal whitespace-nowrap text-black transition-colors duration-100 hover:border-black hover:bg-[#F0F0F6] data-active:border-black data-active:bg-[#F0F0F6] data-active:font-medium data-active:text-black`,
115925
+ onClick: () => clickFnc(tabId),
115926
+ children: [tabContent, rightSection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
115927
+ className: "ml-2 inline-flex",
115928
+ children: rightSection
115929
+ })]
115930
+ }));
115931
+
115932
+ //#endregion
115933
+ //#region src/components/tabs/TabsWrapper.tsx
115934
+ const TabsWrapper = ({ setActiveTab, activeTab, tabs }) => {
115935
+ const tabRefs = (0, react.useMemo)(() => {
115936
+ const refs = {};
115937
+ tabs?.forEach((tab) => {
115938
+ refs[tab.value] = (0, react.createRef)();
115939
+ });
115940
+ return refs;
115941
+ }, [tabs]);
115942
+ const [underlineStyle, setUnderlineStyle] = (0, react.useState)({
115943
+ width: 0,
115944
+ left: 0
115945
+ });
115946
+ (0, react.useEffect)(() => {
115947
+ if (activeTab && tabRefs[activeTab]?.current) {
115948
+ const activeTabElement = tabRefs[activeTab].current;
115949
+ setUnderlineStyle({
115950
+ width: activeTabElement?.offsetWidth || 0,
115951
+ left: activeTabElement?.offsetLeft || 0
115952
+ });
115953
+ }
115954
+ }, [activeTab, tabRefs]);
115955
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
115956
+ className: "w-full",
115957
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
115958
+ className: "relative inline-block w-auto border-b-[3px] border-gray-200",
115959
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
115960
+ className: "flex",
115961
+ children: tabs && tabs?.map((tab) => tab.requiredPermissions ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabContent, {
115962
+ tab,
115963
+ ref: tabRefs[tab.value],
115964
+ setActiveTab,
115965
+ activeTab
115966
+ }, tab.value) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabContent, {
115967
+ tab,
115968
+ ref: tabRefs[tab.value],
115969
+ setActiveTab,
115970
+ activeTab
115971
+ }, tab.value))
115972
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
115973
+ className: "absolute h-[3px] bg-gray-900 transition-all duration-300",
115974
+ style: {
115975
+ width: underlineStyle.width,
115976
+ left: underlineStyle.left,
115977
+ bottom: "-3px"
115978
+ }
115979
+ })]
115980
+ })
115981
+ });
115982
+ };
115983
+ const TabContent = (0, react.forwardRef)(({ tab, setActiveTab, activeTab }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tab, {
115984
+ ref,
115985
+ tabId: tab.value,
115986
+ setActiveTab,
115987
+ activeTab: activeTab === tab.value,
115988
+ tabContent: tab.name,
115989
+ rightSection: tab?.rightSection || undefined,
115990
+ clickFnc: () => {
115991
+ tab.clickFnc(tab.value);
115992
+ setActiveTab(tab.value);
115993
+ }
115901
115994
  }));
115995
+ TabContent.displayName = "TabContent";
115996
+
115997
+ //#endregion
115998
+ //#region src/components/tabs/TabsBadge.tsx
115999
+ const TabsBadge = ({ children }) => {
116000
+ const isCircular = typeof children === "number" && children <= 9 || typeof children === "string" && children.length === 1 || false;
116001
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
116002
+ "data-testid": "tabs-badge",
116003
+ className: clsx_default("bg-pink h-5 rounded-full text-xs leading-5 font-medium text-white", {
116004
+ "w-5 text-center": isCircular,
116005
+ "px-2": !isCircular
116006
+ }),
116007
+ children
116008
+ });
116009
+ };
116010
+ TabsBadge.displayName = "TabsBadge";
115902
116011
 
115903
116012
  //#endregion
115904
116013
  //#region src/components/textArea/index.tsx
@@ -115925,7 +116034,7 @@ const Textarea = (0, react.forwardRef)(({ className, label, error: error$1, rows
115925
116034
 
115926
116035
  //#endregion
115927
116036
  //#region src/components/themeIcon/index.tsx
115928
- const ThemeIcon = (0, react.forwardRef)(({ styleVariant = "black", className, icon, adjustedSize, title,...props }, ref) => {
116037
+ function ThemeIcon({ styleVariant = "black", className, icon, adjustedSize, title,...props }) {
115929
116038
  const classNames$1 = cn("bg-transparent h-9 w-9 rounded-[5px] grid place-content-center", {
115930
116039
  "text-black": styleVariant === COLOR.BLACK,
115931
116040
  "text-gray-500": styleVariant === COLOR.GRAY,
@@ -115942,14 +116051,13 @@ const ThemeIcon = (0, react.forwardRef)(({ styleVariant = "black", className, ic
115942
116051
  "data-tooltip-content": title,
115943
116052
  "data-component": "ThemeIcon",
115944
116053
  className: classNames$1,
115945
- ref,
115946
116054
  ...props,
115947
116055
  children: formatIcon(icon, {
115948
116056
  strokeWidth: "1",
115949
116057
  size: adjustedSize ? adjustedSize : 20
115950
116058
  })
115951
116059
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(M, { id: title })] });
115952
- });
116060
+ }
115953
116061
 
115954
116062
  //#endregion
115955
116063
  //#region src/components/toggle/index.tsx
@@ -136842,7 +136950,7 @@ function requireUseSyncExternalStoreShim_development() {
136842
136950
  return x$2 === y$2 && (x$2 !== 0 || 1 / x$2 === 1 / y$2) || x$2 !== x$2 && y$2 !== y$2;
136843
136951
  }
136844
136952
  var objectIs = typeof Object.is === "function" ? Object.is : is;
136845
- var useState$13 = React$1$1.useState, useEffect$10 = React$1$1.useEffect, useLayoutEffect$4 = React$1$1.useLayoutEffect, useDebugValue$1 = React$1$1.useDebugValue;
136953
+ var useState$14 = React$1$1.useState, useEffect$11 = React$1$1.useEffect, useLayoutEffect$4 = React$1$1.useLayoutEffect, useDebugValue$1 = React$1$1.useDebugValue;
136846
136954
  var didWarnOld18Alpha = false;
136847
136955
  var didWarnUncachedGetSnapshot = false;
136848
136956
  function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
@@ -136864,7 +136972,7 @@ function requireUseSyncExternalStoreShim_development() {
136864
136972
  }
136865
136973
  }
136866
136974
  }
136867
- var _useState = useState$13({ inst: {
136975
+ var _useState = useState$14({ inst: {
136868
136976
  value,
136869
136977
  getSnapshot
136870
136978
  } }), inst = _useState[0].inst, forceUpdate = _useState[1];
@@ -136879,7 +136987,7 @@ function requireUseSyncExternalStoreShim_development() {
136879
136987
  value,
136880
136988
  getSnapshot
136881
136989
  ]);
136882
- useEffect$10(function() {
136990
+ useEffect$11(function() {
136883
136991
  if (checkIfSnapshotChanged(inst)) {
136884
136992
  forceUpdate({ inst });
136885
136993
  }
@@ -137200,7 +137308,7 @@ function requireWithSelector_development() {
137200
137308
  }
137201
137309
  var objectIs = typeof Object.is === "function" ? Object.is : is;
137202
137310
  var useSyncExternalStore = shim$1.useSyncExternalStore;
137203
- var useRef$6 = React$1$1.useRef, useEffect$10 = React$1$1.useEffect, useMemo$3 = React$1$1.useMemo, useDebugValue$1 = React$1$1.useDebugValue;
137311
+ var useRef$6 = React$1$1.useRef, useEffect$11 = React$1$1.useEffect, useMemo$4 = React$1$1.useMemo, useDebugValue$1 = React$1$1.useDebugValue;
137204
137312
  function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual$1) {
137205
137313
  var instRef = useRef$6(null);
137206
137314
  var inst;
@@ -137213,7 +137321,7 @@ function requireWithSelector_development() {
137213
137321
  } else {
137214
137322
  inst = instRef.current;
137215
137323
  }
137216
- var _useMemo = useMemo$3(function() {
137324
+ var _useMemo = useMemo$4(function() {
137217
137325
  var hasMemo = false;
137218
137326
  var memoizedSnapshot;
137219
137327
  var memoizedSelection;
@@ -137262,7 +137370,7 @@ function requireWithSelector_development() {
137262
137370
  isEqual$1
137263
137371
  ]), getSelection$1 = _useMemo[0], getServerSelection = _useMemo[1];
137264
137372
  var value = useSyncExternalStore(subscribe, getSelection$1, getServerSelection);
137265
- useEffect$10(function() {
137373
+ useEffect$11(function() {
137266
137374
  inst.hasValue = true;
137267
137375
  inst.value = value;
137268
137376
  }, [value]);
@@ -140360,6 +140468,8 @@ exports.TableHeader = TableHeader;
140360
140468
  exports.TableHeaderItem = TableHeaderItem;
140361
140469
  exports.TableHeaderRow = TableHeaderRow;
140362
140470
  exports.TableRow = TableRow;
140471
+ exports.TabsBadge = TabsBadge;
140472
+ exports.TabsWrapper = TabsWrapper;
140363
140473
  exports.TextInput = TextInput;
140364
140474
  exports.Textarea = Textarea;
140365
140475
  exports.ThemeIcon = ThemeIcon;