@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.
- package/dist/components/select/index.d.ts +2 -1
- package/dist/components/table/tableRow/index.d.ts +1 -1
- package/dist/components/themeIcon/index.d.ts +2 -2
- package/dist/index.cjs +130 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +121 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export { TableHeader } from './components/table/tableHeader';
|
|
|
48
48
|
export { TableHeaderItem } from './components/table/tableHeaderItem';
|
|
49
49
|
export { TableHeaderRow } from './components/table/tableHeaderRow';
|
|
50
50
|
export { TableRow } from './components/table/tableRow';
|
|
51
|
+
export { TabsWrapper } from './components/tabs';
|
|
52
|
+
export { TabsBadge } from './components/tabs/TabsBadge';
|
|
51
53
|
export { Textarea } from './components/textArea';
|
|
52
54
|
export { TextInput } from './components/textInput';
|
|
53
55
|
export { ThemeIcon } from './components/themeIcon';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
import * as React$1 from "react";
|
|
2
5
|
import React, { Component, Fragment, cloneElement, createContext, createElement, createRef, forwardRef, isValidElement, memo, useCallback, useContext, useDebugValue, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, version } from "react";
|
|
3
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -103320,7 +103323,10 @@ LinkText.displayName = "LinkText";
|
|
|
103320
103323
|
const BreadCrumb = ({ children }) => /* @__PURE__ */ jsx(LinkText, {
|
|
103321
103324
|
"data-component": "BreadCrumb",
|
|
103322
103325
|
classNames: "flex items-center",
|
|
103323
|
-
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconArrowNarrowLeft, { size: 20 }),
|
|
103326
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconArrowNarrowLeft, { size: 20 }), /* @__PURE__ */ jsx("span", {
|
|
103327
|
+
className: "flex items-center gap-5",
|
|
103328
|
+
children
|
|
103329
|
+
})] })
|
|
103324
103330
|
});
|
|
103325
103331
|
BreadCrumb.displayName = "BreadCrumb";
|
|
103326
103332
|
|
|
@@ -109967,12 +109973,21 @@ const ScrollToTop = ({ scrollToTopTitle }) => {
|
|
|
109967
109973
|
else clearInterval(scrollInterval);
|
|
109968
109974
|
}, 15);
|
|
109969
109975
|
};
|
|
109970
|
-
return /* @__PURE__ */ jsx(
|
|
109976
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("button", {
|
|
109971
109977
|
title: scrollToTopTitle,
|
|
109978
|
+
type: "button",
|
|
109979
|
+
disabled: false,
|
|
109980
|
+
"data-testid": "scrollToTop",
|
|
109981
|
+
"data-component": "ActionIcon",
|
|
109972
109982
|
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]"}`,
|
|
109973
109983
|
onClick: scrollToTop,
|
|
109974
|
-
|
|
109975
|
-
|
|
109984
|
+
"data-tooltip-id": scrollToTopTitle,
|
|
109985
|
+
"data-tooltip-content": scrollToTopTitle,
|
|
109986
|
+
children: /* @__PURE__ */ jsx(IconChevronUp, {})
|
|
109987
|
+
}), /* @__PURE__ */ jsx(M, {
|
|
109988
|
+
id: scrollToTopTitle,
|
|
109989
|
+
className: "z-[99]"
|
|
109990
|
+
})] });
|
|
109976
109991
|
};
|
|
109977
109992
|
|
|
109978
109993
|
//#endregion
|
|
@@ -115894,13 +115909,107 @@ const TableHeaderRow = ({ children,...props }) => /* @__PURE__ */ jsx("div", {
|
|
|
115894
115909
|
|
|
115895
115910
|
//#endregion
|
|
115896
115911
|
//#region src/components/table/tableRow/index.tsx
|
|
115897
|
-
|
|
115912
|
+
function TableRow({ children, className,...props }) {
|
|
115913
|
+
return /* @__PURE__ */ jsx("div", {
|
|
115914
|
+
"data-component": "tableRow",
|
|
115915
|
+
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)}`,
|
|
115916
|
+
...props,
|
|
115917
|
+
children
|
|
115918
|
+
});
|
|
115919
|
+
}
|
|
115920
|
+
|
|
115921
|
+
//#endregion
|
|
115922
|
+
//#region src/components/tabs/Tab.tsx
|
|
115923
|
+
const Tab = forwardRef(({ tabId, activeTab, tabContent, clickFnc, rightSection }, ref) => /* @__PURE__ */ jsxs("button", {
|
|
115898
115924
|
ref,
|
|
115899
|
-
"data-
|
|
115900
|
-
className: `${
|
|
115901
|
-
|
|
115902
|
-
children
|
|
115925
|
+
"data-testid": `tab-${tabId}`,
|
|
115926
|
+
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`,
|
|
115927
|
+
onClick: () => clickFnc(tabId),
|
|
115928
|
+
children: [tabContent, rightSection && /* @__PURE__ */ jsx("span", {
|
|
115929
|
+
className: "ml-2 inline-flex",
|
|
115930
|
+
children: rightSection
|
|
115931
|
+
})]
|
|
115932
|
+
}));
|
|
115933
|
+
|
|
115934
|
+
//#endregion
|
|
115935
|
+
//#region src/components/tabs/TabsWrapper.tsx
|
|
115936
|
+
const TabsWrapper = ({ setActiveTab, activeTab, tabs }) => {
|
|
115937
|
+
const tabRefs = useMemo(() => {
|
|
115938
|
+
const refs = {};
|
|
115939
|
+
tabs?.forEach((tab) => {
|
|
115940
|
+
refs[tab.value] = createRef();
|
|
115941
|
+
});
|
|
115942
|
+
return refs;
|
|
115943
|
+
}, [tabs]);
|
|
115944
|
+
const [underlineStyle, setUnderlineStyle] = useState({
|
|
115945
|
+
width: 0,
|
|
115946
|
+
left: 0
|
|
115947
|
+
});
|
|
115948
|
+
useEffect(() => {
|
|
115949
|
+
if (activeTab && tabRefs[activeTab]?.current) {
|
|
115950
|
+
const activeTabElement = tabRefs[activeTab].current;
|
|
115951
|
+
setUnderlineStyle({
|
|
115952
|
+
width: activeTabElement?.offsetWidth || 0,
|
|
115953
|
+
left: activeTabElement?.offsetLeft || 0
|
|
115954
|
+
});
|
|
115955
|
+
}
|
|
115956
|
+
}, [activeTab, tabRefs]);
|
|
115957
|
+
return /* @__PURE__ */ jsx("div", {
|
|
115958
|
+
className: "w-full",
|
|
115959
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
115960
|
+
className: "relative inline-block w-auto border-b-[3px] border-gray-200",
|
|
115961
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
115962
|
+
className: "flex",
|
|
115963
|
+
children: tabs && tabs?.map((tab) => tab.requiredPermissions ? /* @__PURE__ */ jsx(TabContent, {
|
|
115964
|
+
tab,
|
|
115965
|
+
ref: tabRefs[tab.value],
|
|
115966
|
+
setActiveTab,
|
|
115967
|
+
activeTab
|
|
115968
|
+
}, tab.value) : /* @__PURE__ */ jsx(TabContent, {
|
|
115969
|
+
tab,
|
|
115970
|
+
ref: tabRefs[tab.value],
|
|
115971
|
+
setActiveTab,
|
|
115972
|
+
activeTab
|
|
115973
|
+
}, tab.value))
|
|
115974
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
115975
|
+
className: "absolute h-[3px] bg-gray-900 transition-all duration-300",
|
|
115976
|
+
style: {
|
|
115977
|
+
width: underlineStyle.width,
|
|
115978
|
+
left: underlineStyle.left,
|
|
115979
|
+
bottom: "-3px"
|
|
115980
|
+
}
|
|
115981
|
+
})]
|
|
115982
|
+
})
|
|
115983
|
+
});
|
|
115984
|
+
};
|
|
115985
|
+
const TabContent = forwardRef(({ tab, setActiveTab, activeTab }, ref) => /* @__PURE__ */ jsx(Tab, {
|
|
115986
|
+
ref,
|
|
115987
|
+
tabId: tab.value,
|
|
115988
|
+
setActiveTab,
|
|
115989
|
+
activeTab: activeTab === tab.value,
|
|
115990
|
+
tabContent: tab.name,
|
|
115991
|
+
rightSection: tab?.rightSection || undefined,
|
|
115992
|
+
clickFnc: () => {
|
|
115993
|
+
tab.clickFnc(tab.value);
|
|
115994
|
+
setActiveTab(tab.value);
|
|
115995
|
+
}
|
|
115903
115996
|
}));
|
|
115997
|
+
TabContent.displayName = "TabContent";
|
|
115998
|
+
|
|
115999
|
+
//#endregion
|
|
116000
|
+
//#region src/components/tabs/TabsBadge.tsx
|
|
116001
|
+
const TabsBadge = ({ children }) => {
|
|
116002
|
+
const isCircular = typeof children === "number" && children <= 9 || typeof children === "string" && children.length === 1 || false;
|
|
116003
|
+
return /* @__PURE__ */ jsx("div", {
|
|
116004
|
+
"data-testid": "tabs-badge",
|
|
116005
|
+
className: clsx_default("bg-pink h-5 rounded-full text-xs leading-5 font-medium text-white", {
|
|
116006
|
+
"w-5 text-center": isCircular,
|
|
116007
|
+
"px-2": !isCircular
|
|
116008
|
+
}),
|
|
116009
|
+
children
|
|
116010
|
+
});
|
|
116011
|
+
};
|
|
116012
|
+
TabsBadge.displayName = "TabsBadge";
|
|
115904
116013
|
|
|
115905
116014
|
//#endregion
|
|
115906
116015
|
//#region src/components/textArea/index.tsx
|
|
@@ -115927,7 +116036,7 @@ const Textarea = forwardRef(({ className, label, error: error$1, rows = 8,...pro
|
|
|
115927
116036
|
|
|
115928
116037
|
//#endregion
|
|
115929
116038
|
//#region src/components/themeIcon/index.tsx
|
|
115930
|
-
|
|
116039
|
+
function ThemeIcon({ styleVariant = "black", className, icon, adjustedSize, title,...props }) {
|
|
115931
116040
|
const classNames$1 = cn("bg-transparent h-9 w-9 rounded-[5px] grid place-content-center", {
|
|
115932
116041
|
"text-black": styleVariant === COLOR.BLACK,
|
|
115933
116042
|
"text-gray-500": styleVariant === COLOR.GRAY,
|
|
@@ -115944,14 +116053,13 @@ const ThemeIcon = forwardRef(({ styleVariant = "black", className, icon, adjuste
|
|
|
115944
116053
|
"data-tooltip-content": title,
|
|
115945
116054
|
"data-component": "ThemeIcon",
|
|
115946
116055
|
className: classNames$1,
|
|
115947
|
-
ref,
|
|
115948
116056
|
...props,
|
|
115949
116057
|
children: formatIcon(icon, {
|
|
115950
116058
|
strokeWidth: "1",
|
|
115951
116059
|
size: adjustedSize ? adjustedSize : 20
|
|
115952
116060
|
})
|
|
115953
116061
|
}), /* @__PURE__ */ jsx(M, { id: title })] });
|
|
115954
|
-
}
|
|
116062
|
+
}
|
|
115955
116063
|
|
|
115956
116064
|
//#endregion
|
|
115957
116065
|
//#region src/components/toggle/index.tsx
|
|
@@ -140311,5 +140419,5 @@ const setCSSVariable = (variable, value) => {
|
|
|
140311
140419
|
};
|
|
140312
140420
|
|
|
140313
140421
|
//#endregion
|
|
140314
|
-
export { AccordionItem, AccordionWrapper, ActionIcon, Alert, AppleAppButtonIcon, AutoCompleteInput, Avatar, AvatarIndicator, Badge, BigBadge, BreadCrumb, Button, CSS_VARIABLE_KEYS, Checkbox, Divider, FavouriteButton, Filters, GoogleAppButtonIcon, HR, HamburgerMenuButton, Island, Label, LinkText, Loader, LogoBlack, Modal, NavButtons, NumberField, NumberedStepper, PageUnavailable, PasswordInput, Popover, ProgressBar, RadioButton, Rating, RegionSelector, Reviews, ScrollToTop, SearchInput, Select, SettingsCard, Skeleton, SkillPill, Stepper, StickyMobileButtonWrapper, Table, TableCell, TableHeader, TableHeaderItem, TableHeaderRow, TableRow, TextInput, Textarea, ThemeIcon, Toggle, Tooltip, TruncatedText, UnorderedList, UnorderedListItem, UnstyledButton, WysiwygEditor, buttonVariants, getCSSVariable, setCSSVariable };
|
|
140422
|
+
export { AccordionItem, AccordionWrapper, ActionIcon, Alert, AppleAppButtonIcon, AutoCompleteInput, Avatar, AvatarIndicator, Badge, BigBadge, BreadCrumb, Button, CSS_VARIABLE_KEYS, Checkbox, Divider, FavouriteButton, Filters, GoogleAppButtonIcon, HR, HamburgerMenuButton, Island, Label, LinkText, Loader, LogoBlack, Modal, NavButtons, NumberField, NumberedStepper, PageUnavailable, PasswordInput, Popover, ProgressBar, RadioButton, Rating, RegionSelector, Reviews, ScrollToTop, SearchInput, Select, SettingsCard, Skeleton, SkillPill, Stepper, StickyMobileButtonWrapper, Table, TableCell, TableHeader, TableHeaderItem, TableHeaderRow, TableRow, TabsBadge, TabsWrapper, TextInput, Textarea, ThemeIcon, Toggle, Tooltip, TruncatedText, UnorderedList, UnorderedListItem, UnstyledButton, WysiwygEditor, buttonVariants, getCSSVariable, setCSSVariable };
|
|
140315
140423
|
//# sourceMappingURL=index.js.map
|