@intlayer/design-system 7.3.12 → 7.3.14
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/esm/components/TabSelector/TabSelector.mjs +28 -13
- package/dist/esm/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/esm/hooks/useItemSelector.mjs +31 -12
- package/dist/esm/hooks/useItemSelector.mjs.map +1 -1
- package/dist/esm/libs/auth.mjs +2 -1
- package/dist/esm/libs/auth.mjs.map +1 -1
- package/dist/types/components/Badge/index.d.ts +2 -2
- package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts +3 -3
- package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -1
- package/dist/types/components/Breadcrumb/index.d.ts +2 -2
- package/dist/types/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/types/components/Browser/Browser.content.d.ts +11 -11
- package/dist/types/components/Button/Button.d.ts +2 -2
- package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
- package/dist/types/components/Command/index.d.ts +13 -13
- package/dist/types/components/Container/index.d.ts +6 -6
- package/dist/types/components/Container/index.d.ts.map +1 -1
- package/dist/types/components/CopyButton/CopyButton.content.d.ts +3 -3
- package/dist/types/components/CopyButton/CopyButton.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +25 -25
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +9 -9
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +33 -33
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +25 -25
- package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +25 -25
- package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +33 -33
- package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +9 -9
- package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +7 -7
- package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +5 -5
- package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +31 -31
- package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
- package/dist/types/components/EditableField/EditableFieldInput.d.ts.map +1 -1
- package/dist/types/components/ExpandCollapse/expandCollapse.content.d.ts +3 -3
- package/dist/types/components/Form/FormBase.d.ts +2 -2
- package/dist/types/components/Form/FormBase.d.ts.map +1 -1
- package/dist/types/components/Form/FormField.d.ts +2 -2
- package/dist/types/components/Form/FormItem.d.ts +2 -2
- package/dist/types/components/Form/FormItem.d.ts.map +1 -1
- package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts +2 -2
- package/dist/types/components/Form/elements/EditableFieldTextAreaElement.d.ts +2 -2
- package/dist/types/components/Form/elements/FormElement.d.ts +2 -2
- package/dist/types/components/Form/elements/FormElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/MultiselectElement.d.ts +2 -2
- package/dist/types/components/Form/elements/MultiselectElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/OTPElement.d.ts +2 -2
- package/dist/types/components/Form/elements/OTPElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/SelectElement.d.ts +2 -2
- package/dist/types/components/Form/elements/SelectElement.d.ts.map +1 -1
- package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts +2 -2
- package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
- package/dist/types/components/IDE/CodeContext.d.ts +2 -2
- package/dist/types/components/IDE/FileTree.d.ts.map +1 -1
- package/dist/types/components/IDE/code.content.d.ts +5 -5
- package/dist/types/components/IDE/code.content.d.ts.map +1 -1
- package/dist/types/components/IDE/copyCode.content.d.ts +5 -5
- package/dist/types/components/IDE/copyCode.content.d.ts.map +1 -1
- package/dist/types/components/Input/Checkbox.d.ts +4 -4
- package/dist/types/components/Input/Checkbox.d.ts.map +1 -1
- package/dist/types/components/Input/Input.d.ts +3 -3
- package/dist/types/components/Input/Input.d.ts.map +1 -1
- package/dist/types/components/Input/OTPInput.d.ts +6 -6
- package/dist/types/components/Input/OTPInput.d.ts.map +1 -1
- package/dist/types/components/Input/SearchInput.d.ts +2 -2
- package/dist/types/components/Input/SearchInput.d.ts.map +1 -1
- package/dist/types/components/Link/Link.d.ts +4 -4
- package/dist/types/components/Loader/index.content.d.ts +3 -3
- package/dist/types/components/Loader/index.content.d.ts.map +1 -1
- package/dist/types/components/Loader/spinner.d.ts +2 -2
- package/dist/types/components/Loader/spinner.d.ts.map +1 -1
- package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +17 -17
- package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/types/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +13 -13
- package/dist/types/components/MaxWidthSmoother/index.d.ts +2 -2
- package/dist/types/components/MaxWidthSmoother/index.d.ts.map +1 -1
- package/dist/types/components/Navbar/Burger.d.ts +2 -2
- package/dist/types/components/Navbar/Burger.d.ts.map +1 -1
- package/dist/types/components/Navbar/DesktopNavbar.d.ts +2 -2
- package/dist/types/components/Navbar/MobileNavbar.d.ts +2 -2
- package/dist/types/components/Navbar/MobileNavbar.d.ts.map +1 -1
- package/dist/types/components/Navbar/index.d.ts +2 -2
- package/dist/types/components/Navbar/index.d.ts.map +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +3 -3
- package/dist/types/components/Pagination/pagination.content.d.ts +11 -11
- package/dist/types/components/Popover/static.d.ts +3 -3
- package/dist/types/components/Select/Select.d.ts +3 -3
- package/dist/types/components/SocialNetworks/index.d.ts +2 -2
- package/dist/types/components/SwitchSelector/index.d.ts +6 -6
- package/dist/types/components/SwitchSelector/index.d.ts.map +1 -1
- package/dist/types/components/Tab/Tab.d.ts +5 -5
- package/dist/types/components/Tab/TabContext.d.ts +2 -2
- package/dist/types/components/Tab/TabContext.d.ts.map +1 -1
- package/dist/types/components/TabSelector/TabSelector.d.ts +8 -5
- package/dist/types/components/TabSelector/TabSelector.d.ts.map +1 -1
- package/dist/types/components/Table/table.content.d.ts +3 -3
- package/dist/types/components/Table/table.content.d.ts.map +1 -1
- package/dist/types/components/Tag/index.d.ts +5 -5
- package/dist/types/components/Toaster/Toast.d.ts +2 -2
- package/dist/types/components/Toaster/Toaster.d.ts +2 -2
- package/dist/types/hooks/index.d.ts +2 -2
- package/dist/types/hooks/useItemSelector.d.ts +13 -3
- package/dist/types/hooks/useItemSelector.d.ts.map +1 -1
- package/dist/types/libs/auth.d.ts +1 -6620
- package/dist/types/libs/auth.d.ts.map +1 -1
- package/package.json +22 -21
|
@@ -29,15 +29,24 @@ const tabSelectorVariant = cva("relative flex size-full flex-row items-center ga
|
|
|
29
29
|
} },
|
|
30
30
|
defaultVariants: { color: "primary" }
|
|
31
31
|
});
|
|
32
|
-
const indicatorVariant = cva("absolute
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
const indicatorVariant = cva("absolute z-[-1] rounded-lg duration-300 ease-in-out motion-reduce:transition-none", {
|
|
33
|
+
variants: {
|
|
34
|
+
color: {
|
|
35
|
+
primary: "bg-primary/10 aria-selected:text-text",
|
|
36
|
+
secondary: "bg-secondary/10 aria-selected:text-text",
|
|
37
|
+
destructive: "bg-destructive/10 aria-selected:text-text",
|
|
38
|
+
neutral: "bg-neutral/10 aria-selected:text-white/10",
|
|
39
|
+
light: "bg-white/10 aria-selected:text-black",
|
|
40
|
+
dark: "bg-neutral-800/10 aria-selected:text-white",
|
|
41
|
+
text: "bg-text/10 aria-selected:text-text-opposite"
|
|
42
|
+
},
|
|
43
|
+
orientation: {
|
|
44
|
+
horizontal: "top-0 h-full w-auto transition-[left,width]",
|
|
45
|
+
vertical: "left-0 h-auto w-full transition-[top,height]"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
defaultVariants: { orientation: "horizontal" }
|
|
49
|
+
});
|
|
41
50
|
/**
|
|
42
51
|
*
|
|
43
52
|
* Component that allows the user to select one of the provided choices.
|
|
@@ -55,16 +64,19 @@ const indicatorVariant = cva("absolute top-0 z-[-1] h-full w-auto rounded-lg tra
|
|
|
55
64
|
* </TabSelector>
|
|
56
65
|
* ```
|
|
57
66
|
*/
|
|
58
|
-
const TabSelector = ({ tabs, selectedChoice, onTabClick, color = TabSelectorColor.PRIMARY, hoverable = false, className }) => {
|
|
67
|
+
const TabSelector = ({ tabs, selectedChoice, onTabClick, color = TabSelectorColor.PRIMARY, hoverable = false, orientation = "horizontal", className }) => {
|
|
59
68
|
const optionsRefs = useRef([]);
|
|
60
69
|
const indicatorRef = useRef(null);
|
|
61
|
-
const { choiceIndicatorPosition, calculatePosition } = useItemSelector(optionsRefs, {
|
|
70
|
+
const { choiceIndicatorPosition, calculatePosition } = useItemSelector(optionsRefs, {
|
|
71
|
+
isHoverable: hoverable,
|
|
72
|
+
orientation
|
|
73
|
+
});
|
|
62
74
|
useEffect(() => {
|
|
63
75
|
calculatePosition();
|
|
64
76
|
}, [selectedChoice, tabs]);
|
|
65
77
|
return /* @__PURE__ */ jsxs("div", {
|
|
66
78
|
className: cn(tabSelectorVariant({ color }), className),
|
|
67
|
-
"aria-orientation":
|
|
79
|
+
"aria-orientation": orientation,
|
|
68
80
|
"aria-multiselectable": "false",
|
|
69
81
|
role: "tablist",
|
|
70
82
|
children: [tabs.map((Tab, index) => {
|
|
@@ -85,7 +97,10 @@ const TabSelector = ({ tabs, selectedChoice, onTabClick, color = TabSelectorColo
|
|
|
85
97
|
}
|
|
86
98
|
});
|
|
87
99
|
}), choiceIndicatorPosition && /* @__PURE__ */ jsx("div", {
|
|
88
|
-
className: cn(indicatorVariant({
|
|
100
|
+
className: cn(indicatorVariant({
|
|
101
|
+
color,
|
|
102
|
+
orientation
|
|
103
|
+
})),
|
|
89
104
|
style: choiceIndicatorPosition,
|
|
90
105
|
ref: indicatorRef
|
|
91
106
|
}, `${selectedChoice}${JSON.stringify(tabs.map((tab) => tab.key))}`)]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabSelector.mjs","names":[],"sources":["../../../../src/components/TabSelector/TabSelector.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n cloneElement,\n type HTMLAttributes,\n type MouseEvent,\n type ReactElement,\n useEffect,\n useRef,\n} from 'react';\nimport { useItemSelector
|
|
1
|
+
{"version":3,"file":"TabSelector.mjs","names":[],"sources":["../../../../src/components/TabSelector/TabSelector.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n cloneElement,\n type HTMLAttributes,\n type MouseEvent,\n type ReactElement,\n useEffect,\n useRef,\n} from 'react';\nimport {\n type ItemSelectorOrientation,\n useItemSelector,\n} from '../../hooks/useItemSelector';\nimport { cn } from '../../utils/cn';\n\nexport enum TabSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst tabSelectorVariant = cva(\n 'relative flex size-full flex-row items-center gap-2',\n {\n variants: {\n color: {\n primary: 'border-primary text-primary',\n secondary: 'border-secondary text-secondary',\n destructive: 'border-destructive bg-destructive text-destructive',\n neutral: 'border-neutral text-neutral',\n light: 'border-white text-white',\n dark: 'border-neutral-800 text-neutral-800',\n text: 'border-text text-text',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute z-[-1] rounded-lg duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n primary: 'bg-primary/10 aria-selected:text-text',\n secondary: 'bg-secondary/10 aria-selected:text-text',\n destructive: 'bg-destructive/10 aria-selected:text-text',\n neutral: 'bg-neutral/10 aria-selected:text-white/10',\n light: 'bg-white/10 aria-selected:text-black',\n dark: 'bg-neutral-800/10 aria-selected:text-white',\n text: 'bg-text/10 aria-selected:text-text-opposite',\n },\n orientation: {\n horizontal: 'top-0 h-full w-auto transition-[left,width]',\n vertical: 'left-0 h-auto w-full transition-[top,height]',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n }\n);\n\nexport type TabSelectorItemProps = HTMLAttributes<HTMLElement> & {\n key: string | number;\n};\n\nexport type TabSelectorProps<T extends TabSelectorItemProps> = {\n tabs: ReactElement<T>[];\n selectedChoice: T['key'];\n onTabClick?: (choice: T['key']) => void;\n hoverable?: boolean;\n orientation?: ItemSelectorOrientation;\n} & HTMLAttributes<HTMLElement> &\n Omit<VariantProps<typeof tabSelectorVariant>, 'color'> & {\n color?: TabSelectorColor | `${TabSelectorColor}`;\n };\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <TabSelector\n * selectedChoice=\"option1\"\n * onTabClick={(choice) => console.log(choice)}\n * hoverable={true}\n * >\n * <Button key=\"option1\"/>\n * <Button key=\"option2\"/>\n * <Button key=\"option3\"/>\n * </TabSelector>\n * ```\n */\nexport const TabSelector = <T extends TabSelectorItemProps>({\n tabs,\n selectedChoice,\n onTabClick,\n color = TabSelectorColor.PRIMARY,\n hoverable = false,\n orientation = 'horizontal',\n className,\n}: TabSelectorProps<T>) => {\n const optionsRefs = useRef<HTMLElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition, calculatePosition } = useItemSelector(\n optionsRefs,\n { isHoverable: hoverable, orientation }\n );\n\n useEffect(() => {\n calculatePosition();\n }, [selectedChoice, tabs]);\n\n return (\n <div\n className={cn(\n tabSelectorVariant({\n color,\n }),\n className\n )}\n aria-orientation={orientation}\n aria-multiselectable=\"false\"\n role=\"tablist\"\n >\n {tabs.map((Tab, index) => {\n const key = Tab.key!;\n\n const isSelected = selectedChoice === key;\n\n return cloneElement(Tab, {\n key: key ?? index,\n role: 'tab',\n onClick: (e: MouseEvent<HTMLElement>) => {\n Tab.props?.onClick?.(e);\n onTabClick?.(key);\n },\n 'aria-selected': isSelected,\n 'data-active': isSelected as unknown as string,\n tabIndex: isSelected ? 0 : -1,\n ref: (el: HTMLElement) => {\n optionsRefs.current[index] = el!;\n },\n } as unknown as T);\n })}\n {choiceIndicatorPosition && (\n <div\n className={cn(\n indicatorVariant({\n color,\n orientation,\n })\n )}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n key={`${selectedChoice}${JSON.stringify(tabs.map((tab) => tab.key))}`}\n />\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAiBA,IAAY,gEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGF,MAAM,qBAAqB,IACzB,uDACA;CACE,UAAU,EACR,OAAO;EACL,SAAS;EACT,WAAW;EACX,aAAa;EACb,SAAS;EACT,OAAO;EACP,MAAM;EACN,MAAM;EACP,EACF;CACD,iBAAiB,EACf,OAAO,WACR;CACF,CACF;AAED,MAAM,mBAAmB,IACvB,qFACA;CACE,UAAU;EACR,OAAO;GACL,SAAS;GACT,WAAW;GACX,aAAa;GACb,SAAS;GACT,OAAO;GACP,MAAM;GACN,MAAM;GACP;EACD,aAAa;GACX,YAAY;GACZ,UAAU;GACX;EACF;CACD,iBAAiB,EACf,aAAa,cACd;CACF,CACF;;;;;;;;;;;;;;;;;;AAkCD,MAAa,eAA+C,EAC1D,MACA,gBACA,YACA,QAAQ,iBAAiB,SACzB,YAAY,OACZ,cAAc,cACd,gBACyB;CACzB,MAAM,cAAc,OAAsB,EAAE,CAAC;CAC7C,MAAM,eAAe,OAA8B,KAAK;CACxD,MAAM,EAAE,yBAAyB,sBAAsB,gBACrD,aACA;EAAE,aAAa;EAAW;EAAa,CACxC;AAED,iBAAgB;AACd,qBAAmB;IAClB,CAAC,gBAAgB,KAAK,CAAC;AAE1B,QACE,qBAAC;EACC,WAAW,GACT,mBAAmB,EACjB,OACD,CAAC,EACF,UACD;EACD,oBAAkB;EAClB,wBAAqB;EACrB,MAAK;aAEJ,KAAK,KAAK,KAAK,UAAU;GACxB,MAAM,MAAM,IAAI;GAEhB,MAAM,aAAa,mBAAmB;AAEtC,UAAO,aAAa,KAAK;IACvB,KAAK,OAAO;IACZ,MAAM;IACN,UAAU,MAA+B;AACvC,SAAI,OAAO,UAAU,EAAE;AACvB,kBAAa,IAAI;;IAEnB,iBAAiB;IACjB,eAAe;IACf,UAAU,aAAa,IAAI;IAC3B,MAAM,OAAoB;AACxB,iBAAY,QAAQ,SAAS;;IAEhC,CAAiB;IAClB,EACD,2BACC,oBAAC;GACC,WAAW,GACT,iBAAiB;IACf;IACA;IACD,CAAC,CACH;GACD,OAAO;GACP,KAAK;KACA,GAAG,iBAAiB,KAAK,UAAU,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,GACnE;GAEA"}
|
|
@@ -4,9 +4,10 @@ import { useEffect, useState } from "react";
|
|
|
4
4
|
|
|
5
5
|
//#region src/hooks/useItemSelector.ts
|
|
6
6
|
const selectorDefault = (option) => option?.getAttribute("aria-selected") === "true";
|
|
7
|
-
const useItemSelector = (optionsRefs, { selector = selectorDefault, isHoverable = false } = {
|
|
7
|
+
const useItemSelector = (optionsRefs, { selector = selectorDefault, isHoverable = false, orientation = "horizontal" } = {
|
|
8
8
|
selector: selectorDefault,
|
|
9
|
-
isHoverable: false
|
|
9
|
+
isHoverable: false,
|
|
10
|
+
orientation: "horizontal"
|
|
10
11
|
}) => {
|
|
11
12
|
const [choiceIndicatorPosition, setChoiceIndicatorPosition] = useState(null);
|
|
12
13
|
const [hoveredItem, setHoveredItem] = useState(null);
|
|
@@ -16,7 +17,13 @@ const useItemSelector = (optionsRefs, { selector = selectorDefault, isHoverable
|
|
|
16
17
|
if (hoveredItem) targetElement = hoveredItem;
|
|
17
18
|
else targetElement = optionsRefs.current.find(selector) ?? null;
|
|
18
19
|
if (!targetElement) {
|
|
19
|
-
setChoiceIndicatorPosition((prev) => ({
|
|
20
|
+
if (orientation === "vertical") setChoiceIndicatorPosition((prev) => ({
|
|
21
|
+
top: 0,
|
|
22
|
+
height: 0,
|
|
23
|
+
...prev,
|
|
24
|
+
opacity: 0
|
|
25
|
+
}));
|
|
26
|
+
else setChoiceIndicatorPosition((prev) => ({
|
|
20
27
|
left: 0,
|
|
21
28
|
width: 0,
|
|
22
29
|
...prev,
|
|
@@ -24,13 +31,23 @@ const useItemSelector = (optionsRefs, { selector = selectorDefault, isHoverable
|
|
|
24
31
|
}));
|
|
25
32
|
return;
|
|
26
33
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
if (orientation === "vertical") {
|
|
35
|
+
const top = targetElement.offsetTop;
|
|
36
|
+
const height = targetElement.offsetHeight;
|
|
37
|
+
setChoiceIndicatorPosition({
|
|
38
|
+
top,
|
|
39
|
+
height,
|
|
40
|
+
opacity: 1
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
const left = targetElement.offsetLeft;
|
|
44
|
+
const width = targetElement.offsetWidth;
|
|
45
|
+
setChoiceIndicatorPosition({
|
|
46
|
+
left,
|
|
47
|
+
width,
|
|
48
|
+
opacity: 1
|
|
49
|
+
});
|
|
50
|
+
}
|
|
34
51
|
};
|
|
35
52
|
useEffect(() => {
|
|
36
53
|
calculatePosition();
|
|
@@ -92,11 +109,13 @@ const useItemSelector = (optionsRefs, { selector = selectorDefault, isHoverable
|
|
|
92
109
|
optionsRefs,
|
|
93
110
|
selector,
|
|
94
111
|
hoveredItem,
|
|
95
|
-
itemsLength
|
|
112
|
+
itemsLength,
|
|
113
|
+
orientation
|
|
96
114
|
]);
|
|
97
115
|
return {
|
|
98
116
|
choiceIndicatorPosition,
|
|
99
|
-
calculatePosition
|
|
117
|
+
calculatePosition,
|
|
118
|
+
orientation
|
|
100
119
|
};
|
|
101
120
|
};
|
|
102
121
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useItemSelector.mjs","names":["targetElement: HTMLElement | null","mutationObservers: MutationObserver[]","resizeObservers: ResizeObserver[]"],"sources":["../../../src/hooks/useItemSelector.ts"],"sourcesContent":["'use client';\n\nimport { type RefObject, useEffect, useState } from 'react';\n\ntype
|
|
1
|
+
{"version":3,"file":"useItemSelector.mjs","names":["targetElement: HTMLElement | null","mutationObservers: MutationObserver[]","resizeObservers: ResizeObserver[]"],"sources":["../../../src/hooks/useItemSelector.ts"],"sourcesContent":["'use client';\n\nimport { type RefObject, useEffect, useState } from 'react';\n\nexport type ItemSelectorOrientation = 'horizontal' | 'vertical';\n\ntype HorizontalStyleState = {\n left: number;\n width: number;\n opacity: number;\n};\n\ntype VerticalStyleState = {\n top: number;\n height: number;\n opacity: number;\n};\n\ntype StyleState = HorizontalStyleState | VerticalStyleState;\n\nconst selectorDefault = (option: HTMLElement) =>\n option?.getAttribute('aria-selected') === 'true';\n\ntype Options = {\n selector?: (option: HTMLElement, index: number) => boolean;\n isHoverable?: boolean;\n orientation?: ItemSelectorOrientation;\n};\n\nexport const useItemSelector = (\n optionsRefs: RefObject<HTMLElement[]>,\n {\n selector = selectorDefault,\n isHoverable = false,\n orientation = 'horizontal',\n }: Options = {\n selector: selectorDefault,\n isHoverable: false,\n orientation: 'horizontal',\n }\n) => {\n const [choiceIndicatorPosition, setChoiceIndicatorPosition] =\n useState<StyleState | null>(null);\n\n const [hoveredItem, setHoveredItem] = useState<HTMLElement | null>(null);\n\n const itemsLength = optionsRefs.current.length;\n\n const calculatePosition = () => {\n let targetElement: HTMLElement | null = null;\n\n if (hoveredItem) {\n targetElement = hoveredItem;\n } else {\n targetElement = optionsRefs.current.find(selector) ?? null;\n }\n\n if (!targetElement) {\n if (orientation === 'vertical') {\n setChoiceIndicatorPosition((prev) => ({\n top: 0,\n height: 0,\n ...prev,\n opacity: 0,\n }));\n } else {\n setChoiceIndicatorPosition((prev) => ({\n left: 0,\n width: 0,\n ...prev,\n opacity: 0,\n }));\n }\n return;\n }\n\n if (orientation === 'vertical') {\n const top = targetElement.offsetTop;\n const height = targetElement.offsetHeight;\n\n setChoiceIndicatorPosition({\n top,\n height,\n opacity: 1,\n });\n } else {\n const left = targetElement.offsetLeft;\n const width = targetElement.offsetWidth;\n\n setChoiceIndicatorPosition({\n left,\n width,\n opacity: 1,\n });\n }\n };\n\n useEffect(() => {\n calculatePosition();\n\n // Event listeners for window events\n window.addEventListener('resize', calculatePosition);\n window.addEventListener('DOMContentLoaded', calculatePosition);\n\n // MutationObserver to watch for 'aria-selected' changes\n const mutationObservers: MutationObserver[] = [];\n\n optionsRefs.current.forEach((option) => {\n if (option) {\n const observer = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (\n mutation.type === 'attributes' &&\n mutation.attributeName === 'aria-selected'\n ) {\n calculatePosition();\n break;\n }\n }\n });\n\n observer.observe(option, {\n attributes: true,\n attributeFilter: ['aria-selected'],\n });\n\n mutationObservers.push(observer);\n }\n });\n\n // ResizeObserver to watch for size changes\n const resizeObservers: ResizeObserver[] = [];\n\n const observeSize = (element: HTMLElement) => {\n if (!element) return;\n const resizeObserver = new ResizeObserver(() => {\n calculatePosition();\n });\n resizeObserver.observe(element);\n resizeObservers.push(resizeObserver);\n };\n\n // Observe the selected item\n const selectedItem = optionsRefs.current.find(selector) ?? null;\n\n if (selectedItem) {\n observeSize(selectedItem);\n }\n\n // Observe the hovered item\n if (hoveredItem) {\n observeSize(hoveredItem);\n }\n\n // Add hover event listeners\n const handleMouseEnter = (event: Event) => {\n setHoveredItem(event.currentTarget as HTMLElement);\n };\n\n const handleMouseLeave = () => {\n setHoveredItem(null);\n };\n\n if (isHoverable) {\n optionsRefs.current.forEach((option) => {\n option?.addEventListener('mouseenter', handleMouseEnter, {\n passive: true,\n });\n option?.addEventListener('mouseleave', handleMouseLeave, {\n passive: true,\n });\n });\n }\n\n return () => {\n // Cleanup window event listeners\n window.removeEventListener('resize', calculatePosition);\n window.removeEventListener('DOMContentLoaded', calculatePosition);\n\n // Disconnect MutationObservers\n mutationObservers.forEach((observer) => {\n observer.disconnect();\n });\n\n // Disconnect ResizeObservers\n resizeObservers.forEach((observer) => {\n observer.disconnect();\n });\n\n // Remove hover event listeners\n optionsRefs.current.forEach((option) => {\n option?.removeEventListener('mouseenter', handleMouseEnter);\n option?.removeEventListener('mouseleave', handleMouseLeave);\n });\n };\n }, [optionsRefs, selector, hoveredItem, itemsLength, orientation]);\n\n return { choiceIndicatorPosition, calculatePosition, orientation };\n};\n"],"mappings":";;;;;AAoBA,MAAM,mBAAmB,WACvB,QAAQ,aAAa,gBAAgB,KAAK;AAQ5C,MAAa,mBACX,aACA,EACE,WAAW,iBACX,cAAc,OACd,cAAc,iBACH;CACX,UAAU;CACV,aAAa;CACb,aAAa;CACd,KACE;CACH,MAAM,CAAC,yBAAyB,8BAC9B,SAA4B,KAAK;CAEnC,MAAM,CAAC,aAAa,kBAAkB,SAA6B,KAAK;CAExE,MAAM,cAAc,YAAY,QAAQ;CAExC,MAAM,0BAA0B;EAC9B,IAAIA,gBAAoC;AAExC,MAAI,YACF,iBAAgB;MAEhB,iBAAgB,YAAY,QAAQ,KAAK,SAAS,IAAI;AAGxD,MAAI,CAAC,eAAe;AAClB,OAAI,gBAAgB,WAClB,6BAA4B,UAAU;IACpC,KAAK;IACL,QAAQ;IACR,GAAG;IACH,SAAS;IACV,EAAE;OAEH,6BAA4B,UAAU;IACpC,MAAM;IACN,OAAO;IACP,GAAG;IACH,SAAS;IACV,EAAE;AAEL;;AAGF,MAAI,gBAAgB,YAAY;GAC9B,MAAM,MAAM,cAAc;GAC1B,MAAM,SAAS,cAAc;AAE7B,8BAA2B;IACzB;IACA;IACA,SAAS;IACV,CAAC;SACG;GACL,MAAM,OAAO,cAAc;GAC3B,MAAM,QAAQ,cAAc;AAE5B,8BAA2B;IACzB;IACA;IACA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S,WAAW;AACtC,YAAQ,oBAAoB,cAAc,iBAAiB;AAC3D,YAAQ,oBAAoB,cAAc,iBAAiB;KAC3D;;IAEH;EAAC;EAAa;EAAU;EAAa;EAAa;EAAY,CAAC;AAElE,QAAO;EAAE;EAAyB;EAAmB;EAAa"}
|
package/dist/esm/libs/auth.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import configuration from "@intlayer/config/built";
|
|
2
|
+
import { passkeyClient } from "@better-auth/passkey/client";
|
|
2
3
|
import { createAuthClient } from "better-auth/client";
|
|
3
|
-
import { magicLinkClient,
|
|
4
|
+
import { magicLinkClient, twoFactorClient } from "better-auth/client/plugins";
|
|
4
5
|
|
|
5
6
|
//#region src/libs/auth.ts
|
|
6
7
|
const getAuthClient = (backendURL) => createAuthClient({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.mjs","names":["signInEmail: AuthClient['signIn']['email']","signInSocial: AuthClient['signIn']['social']","signUpEmail: AuthClient['signUp']['email']","signOut: AuthClient['signOut']","changePasswordSession: AuthClient['changePassword']","requestPasswordResetSession: AuthClient['requestPasswordReset']","resetPassword: AuthClient['resetPassword']","verifyEmailSession: AuthClient['verifyEmail']","getSession: AuthClient['getSession']","forgetPassword: AuthClient['forgetPassword']","sendVerificationEmail: AuthClient['sendVerificationEmail']","changeEmail: AuthClient['changeEmail']","deleteUser: AuthClient['deleteUser']","revokeSession: AuthClient['revokeSession']","revokeSessions: AuthClient['revokeSessions']","revokeOtherSessions: AuthClient['revokeOtherSessions']","linkSocial: AuthClient['linkSocial']","listAccounts: AuthClient['listAccounts']","unlinkAccount: AuthClient['unlinkAccount']","refreshToken: AuthClient['refreshToken']","getAccessToken: AuthClient['getAccessToken']","accountInfo: AuthClient['accountInfo']","updateUser: AuthClient['updateUser']","listSessions: AuthClient['listSessions']","enableTwoFactor: AuthClient['twoFactor']['enable']","disableTwoFactor: AuthClient['twoFactor']['disable']","verifyTotp: AuthClient['twoFactor']['verifyTotp']","verifyBackupCode: AuthClient['twoFactor']['verifyBackupCode']","addPasskey: AuthClient['passkey']['addPasskey']","signInPasskey: AuthClient['signIn']['passkey']","deletePasskey: AuthClient['passkey']['deletePasskey']","signInMagicLink: any"],"sources":["../../../src/libs/auth.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { createAuthClient } from 'better-auth/client';\nimport {\n magicLinkClient,\n passkeyClient,\n twoFactorClient,\n} from 'better-auth/client/plugins';\n\nconst getAuthClient = (backendURL: string) =>\n createAuthClient({\n baseURL: backendURL,\n withCredentials: true, // makes fetch forward cookies\n plugins: [\n twoFactorClient({\n onTwoFactorRedirect: () => {\n // Preserve redirect_url when redirecting to 2FA\n const searchParams = new URLSearchParams(window.location.search);\n const redirectUrl = searchParams.get('redirect_url');\n const twoFaUrl = redirectUrl\n ? `/auth/2fa?redirect_url=${encodeURIComponent(redirectUrl)}`\n : '/auth/2fa';\n window.location.href = twoFaUrl;\n },\n }),\n passkeyClient(),\n magicLinkClient() as never,\n ],\n });\n\ntype AuthClient = ReturnType<typeof getAuthClient>;\n\nexport interface AuthAPI {\n getAuthClient: () => AuthClient;\n signInEmail: AuthClient['signIn']['email'];\n signUpEmail: AuthClient['signUp']['email'];\n signOut: AuthClient['signOut'];\n signInSocial: AuthClient['signIn']['social'];\n linkSocial: AuthClient['linkSocial'];\n changePasswordSession: AuthClient['changePassword'];\n requestPasswordResetSession: AuthClient['requestPasswordReset'];\n resetPassword: AuthClient['resetPassword'];\n verifyEmailSession: AuthClient['verifyEmail'];\n getSession: AuthClient['getSession'];\n forgetPassword: AuthClient['forgetPassword'];\n sendVerificationEmail: AuthClient['sendVerificationEmail'];\n changeEmail: AuthClient['changeEmail'];\n deleteUser: AuthClient['deleteUser'];\n revokeSession: AuthClient['revokeSession'];\n revokeSessions: AuthClient['revokeSessions'];\n revokeOtherSessions: AuthClient['revokeOtherSessions'];\n listAccounts: AuthClient['listAccounts'];\n unlinkAccount: AuthClient['unlinkAccount'];\n refreshToken: AuthClient['refreshToken'];\n getAccessToken: AuthClient['getAccessToken'];\n accountInfo: AuthClient['accountInfo'];\n updateUser: AuthClient['updateUser'];\n listSessions: AuthClient['listSessions'];\n enableTwoFactor: AuthClient['twoFactor']['enable'];\n disableTwoFactor: AuthClient['twoFactor']['disable'];\n verifyTotp: AuthClient['twoFactor']['verifyTotp'];\n verifyBackupCode: AuthClient['twoFactor']['verifyBackupCode'];\n addPasskey: AuthClient['passkey']['addPasskey'];\n signInPasskey: AuthClient['signIn']['passkey'];\n deletePasskey: AuthClient['passkey']['deletePasskey'];\n listPasskeys: () => Promise<any>;\n signInMagicLink: (\n // Redeclare it because of type inference issues\n input: { email: string; callbackURL: string }\n ) => any;\n}\n\nexport const getAuthAPI = (intlayerConfig?: IntlayerConfig): AuthAPI => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const client = getAuthClient(backendURL);\n\n const signInEmail: AuthClient['signIn']['email'] = async (...args) => {\n return client.signIn.email(...args);\n };\n\n const signInSocial: AuthClient['signIn']['social'] = async (...args) => {\n return client.signIn.social(...args);\n };\n\n const signUpEmail: AuthClient['signUp']['email'] = async (...args) => {\n return client.signUp.email(...args);\n };\n\n const signOut: AuthClient['signOut'] = async (...args) => {\n return client.signOut(...args);\n };\n\n const changePasswordSession: AuthClient['changePassword'] = async (\n ...args\n ) => {\n return client.changePassword(...args);\n };\n\n const requestPasswordResetSession: AuthClient['requestPasswordReset'] =\n async (...args) => {\n return client.requestPasswordReset(...args);\n };\n\n // @ts-ignore - resetPassword is not typed\n const resetPassword: AuthClient['resetPassword'] = async (...args) => {\n return client.resetPassword(...args);\n };\n\n const verifyEmailSession: AuthClient['verifyEmail'] = async (...args) => {\n return client.verifyEmail(...args);\n };\n\n const getSession: AuthClient['getSession'] = async (...args) => {\n return client.getSession(...args);\n };\n\n const forgetPassword: AuthClient['forgetPassword'] = async (...args) => {\n return client.forgetPassword(...args);\n };\n\n const sendVerificationEmail: AuthClient['sendVerificationEmail'] = async (\n ...args\n ) => {\n return client.sendVerificationEmail(...args);\n };\n\n const changeEmail: AuthClient['changeEmail'] = async (...args) => {\n return client.changeEmail(...args);\n };\n\n // @ts-ignore - deleteUser is not typed\n const deleteUser: AuthClient['deleteUser'] = async (...args) => {\n return client.deleteUser(...args);\n };\n\n const revokeSession: AuthClient['revokeSession'] = async (...args) => {\n return client.revokeSession(...args);\n };\n\n const revokeSessions: AuthClient['revokeSessions'] = async (...args) => {\n return client.revokeSessions(...args);\n };\n\n const revokeOtherSessions: AuthClient['revokeOtherSessions'] = async (\n ...args\n ) => {\n return client.revokeOtherSessions(...args);\n };\n\n const linkSocial: AuthClient['linkSocial'] = async (...args) => {\n return client.linkSocial(...args);\n };\n\n const listAccounts: AuthClient['listAccounts'] = async (...args) => {\n return client.listAccounts(...args);\n };\n\n const unlinkAccount: AuthClient['unlinkAccount'] = async (...args) => {\n return client.unlinkAccount(...args);\n };\n\n const refreshToken: AuthClient['refreshToken'] = async (...args) => {\n return client.refreshToken(...args);\n };\n\n const getAccessToken: AuthClient['getAccessToken'] = async (...args) => {\n return client.getAccessToken(...args);\n };\n\n const accountInfo: AuthClient['accountInfo'] = async (...args) => {\n return client.accountInfo(...args);\n };\n\n const updateUser: AuthClient['updateUser'] = async (...args) => {\n return client.updateUser(...args);\n };\n\n const listSessions: AuthClient['listSessions'] = async (...args) => {\n return client.listSessions(...args);\n };\n\n const enableTwoFactor: AuthClient['twoFactor']['enable'] = async (\n ...args\n ) => {\n return client.twoFactor.enable(...args) as ReturnType<\n AuthClient['twoFactor']['enable']\n >;\n };\n\n const disableTwoFactor: AuthClient['twoFactor']['disable'] = async (\n ...args\n ) => {\n return client.twoFactor.disable(...args) as ReturnType<\n AuthClient['twoFactor']['disable']\n >;\n };\n\n const verifyTotp: AuthClient['twoFactor']['verifyTotp'] = async (...args) => {\n return client.twoFactor.verifyTotp(...args) as ReturnType<\n AuthClient['twoFactor']['verifyTotp']\n >;\n };\n\n const verifyBackupCode: AuthClient['twoFactor']['verifyBackupCode'] = async (\n ...args\n ) => {\n return client.twoFactor.verifyBackupCode(...args) as ReturnType<\n AuthClient['twoFactor']['verifyBackupCode']\n >;\n };\n\n const addPasskey: AuthClient['passkey']['addPasskey'] = async (...args) => {\n return client.passkey.addPasskey(...args);\n };\n\n const signInPasskey: AuthClient['signIn']['passkey'] = async (...args) => {\n return client.signIn.passkey(...args);\n };\n\n const deletePasskey: AuthClient['passkey']['deletePasskey'] = async (\n ...args\n ) => {\n return client.passkey.deletePasskey(...args);\n };\n\n const listPasskeys = async () => {\n // @ts-ignore - listPasskeys may not be typed yet\n return client.$fetch('/passkey/list-user-passkeys', {\n method: 'GET',\n });\n };\n\n // it fix type inference issues\n const signInMagicLink: any = async (...args: any[]) => {\n return (client.signIn as any).magicLink(...args);\n };\n\n return {\n getAuthClient: () => client,\n signInEmail,\n signUpEmail,\n signOut,\n signInSocial,\n linkSocial,\n changePasswordSession,\n requestPasswordResetSession,\n resetPassword,\n verifyEmailSession,\n getSession,\n forgetPassword,\n sendVerificationEmail,\n changeEmail,\n deleteUser,\n revokeSession,\n revokeSessions,\n revokeOtherSessions,\n listAccounts,\n unlinkAccount,\n refreshToken,\n getAccessToken,\n accountInfo,\n updateUser,\n listSessions,\n enableTwoFactor,\n disableTwoFactor,\n verifyTotp,\n verifyBackupCode,\n addPasskey,\n signInPasskey,\n deletePasskey,\n listPasskeys,\n signInMagicLink,\n };\n};\n"],"mappings":";;;;;AASA,MAAM,iBAAiB,eACrB,iBAAiB;CACf,SAAS;CACT,iBAAiB;CACjB,SAAS;EACP,gBAAgB,EACd,2BAA2B;GAGzB,MAAM,cADe,IAAI,gBAAgB,OAAO,SAAS,OAAO,CAC/B,IAAI,eAAe;GACpD,MAAM,WAAW,cACb,0BAA0B,mBAAmB,YAAY,KACzD;AACJ,UAA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AkD,OAAO,GAAG,SAAS;AACzE,SAAO,OAAO,QAAQ,WAAW,GAAG,KAAK;;CAG3C,MAAMC,gBAAiD,OAAO,GAAG,SAAS;AACxE,SAAO,OAAO,OAAO,QAAQ,GAAG,KAAK;;CAGvC,MAAMC,gBAAwD,OAC5D,GAAG,SACA;AACH,SAAO,OAAO,QAAQ,cAAc,GAAG,KAAK;;CAG9C,MAAM,eAAe,YAAY;AAE/B,SAAO,OAAO,OAAO,+BAA+B,EAClD,QAAQ,OACT,CAAC;;CAIJ,MAAMC,kBAAuB,OAAO,GAAG,SAAgB;AACrD,SAAQ,OAAO,OAAe,UAAU,GAAG,KAAK;;AAGlD,QAAO;EACL,qBAAqB;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"auth.mjs","names":["signInEmail: AuthClient['signIn']['email']","signInSocial: AuthClient['signIn']['social']","signUpEmail: AuthClient['signUp']['email']","signOut: AuthClient['signOut']","changePasswordSession: AuthClient['changePassword']","requestPasswordResetSession: AuthClient['requestPasswordReset']","resetPassword: AuthClient['resetPassword']","verifyEmailSession: AuthClient['verifyEmail']","getSession: AuthClient['getSession']","forgetPassword: AuthClient['forgetPassword']","sendVerificationEmail: AuthClient['sendVerificationEmail']","changeEmail: AuthClient['changeEmail']","deleteUser: AuthClient['deleteUser']","revokeSession: AuthClient['revokeSession']","revokeSessions: AuthClient['revokeSessions']","revokeOtherSessions: AuthClient['revokeOtherSessions']","linkSocial: AuthClient['linkSocial']","listAccounts: AuthClient['listAccounts']","unlinkAccount: AuthClient['unlinkAccount']","refreshToken: AuthClient['refreshToken']","getAccessToken: AuthClient['getAccessToken']","accountInfo: AuthClient['accountInfo']","updateUser: AuthClient['updateUser']","listSessions: AuthClient['listSessions']","enableTwoFactor: AuthClient['twoFactor']['enable']","disableTwoFactor: AuthClient['twoFactor']['disable']","verifyTotp: AuthClient['twoFactor']['verifyTotp']","verifyBackupCode: AuthClient['twoFactor']['verifyBackupCode']","addPasskey: AuthClient['passkey']['addPasskey']","signInPasskey: AuthClient['signIn']['passkey']","deletePasskey: AuthClient['passkey']['deletePasskey']","signInMagicLink: any"],"sources":["../../../src/libs/auth.ts"],"sourcesContent":["import { passkeyClient } from '@better-auth/passkey/client';\nimport configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { createAuthClient } from 'better-auth/client';\nimport { magicLinkClient, twoFactorClient } from 'better-auth/client/plugins';\n\nconst getAuthClient = (backendURL: string) =>\n createAuthClient({\n baseURL: backendURL,\n withCredentials: true, // makes fetch forward cookies\n plugins: [\n twoFactorClient({\n onTwoFactorRedirect: () => {\n // Preserve redirect_url when redirecting to 2FA\n const searchParams = new URLSearchParams(window.location.search);\n const redirectUrl = searchParams.get('redirect_url');\n const twoFaUrl = redirectUrl\n ? `/auth/2fa?redirect_url=${encodeURIComponent(redirectUrl)}`\n : '/auth/2fa';\n window.location.href = twoFaUrl;\n },\n }),\n passkeyClient(),\n magicLinkClient() as never,\n ],\n });\n\ntype AuthClient = ReturnType<typeof getAuthClient>;\n\nexport interface AuthAPI {\n getAuthClient: () => AuthClient;\n signInEmail: AuthClient['signIn']['email'];\n signUpEmail: AuthClient['signUp']['email'];\n signOut: AuthClient['signOut'];\n signInSocial: AuthClient['signIn']['social'];\n linkSocial: AuthClient['linkSocial'];\n changePasswordSession: AuthClient['changePassword'];\n requestPasswordResetSession: AuthClient['requestPasswordReset'];\n resetPassword: AuthClient['resetPassword'];\n verifyEmailSession: AuthClient['verifyEmail'];\n getSession: AuthClient['getSession'];\n forgetPassword: AuthClient['forgetPassword'];\n sendVerificationEmail: AuthClient['sendVerificationEmail'];\n changeEmail: AuthClient['changeEmail'];\n deleteUser: AuthClient['deleteUser'];\n revokeSession: AuthClient['revokeSession'];\n revokeSessions: AuthClient['revokeSessions'];\n revokeOtherSessions: AuthClient['revokeOtherSessions'];\n listAccounts: AuthClient['listAccounts'];\n unlinkAccount: AuthClient['unlinkAccount'];\n refreshToken: AuthClient['refreshToken'];\n getAccessToken: AuthClient['getAccessToken'];\n accountInfo: AuthClient['accountInfo'];\n updateUser: AuthClient['updateUser'];\n listSessions: AuthClient['listSessions'];\n enableTwoFactor: AuthClient['twoFactor']['enable'];\n disableTwoFactor: AuthClient['twoFactor']['disable'];\n verifyTotp: AuthClient['twoFactor']['verifyTotp'];\n verifyBackupCode: AuthClient['twoFactor']['verifyBackupCode'];\n addPasskey: AuthClient['passkey']['addPasskey'];\n signInPasskey: AuthClient['signIn']['passkey'];\n deletePasskey: AuthClient['passkey']['deletePasskey'];\n listPasskeys: () => Promise<any>;\n signInMagicLink: (\n // Redeclare it because of type inference issues\n input: { email: string; callbackURL: string }\n ) => any;\n}\n\nexport const getAuthAPI = (intlayerConfig?: IntlayerConfig): AuthAPI => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const client = getAuthClient(backendURL);\n\n const signInEmail: AuthClient['signIn']['email'] = async (...args) => {\n return client.signIn.email(...args);\n };\n\n const signInSocial: AuthClient['signIn']['social'] = async (...args) => {\n return client.signIn.social(...args);\n };\n\n const signUpEmail: AuthClient['signUp']['email'] = async (...args) => {\n return client.signUp.email(...args);\n };\n\n const signOut: AuthClient['signOut'] = async (...args) => {\n return client.signOut(...args);\n };\n\n const changePasswordSession: AuthClient['changePassword'] = async (\n ...args\n ) => {\n return client.changePassword(...args);\n };\n\n const requestPasswordResetSession: AuthClient['requestPasswordReset'] =\n async (...args) => {\n return client.requestPasswordReset(...args);\n };\n\n // @ts-ignore - resetPassword is not typed\n const resetPassword: AuthClient['resetPassword'] = async (...args) => {\n return client.resetPassword(...args);\n };\n\n const verifyEmailSession: AuthClient['verifyEmail'] = async (...args) => {\n return client.verifyEmail(...args);\n };\n\n const getSession: AuthClient['getSession'] = async (...args) => {\n return client.getSession(...args);\n };\n\n const forgetPassword: AuthClient['forgetPassword'] = async (...args) => {\n return client.forgetPassword(...args);\n };\n\n const sendVerificationEmail: AuthClient['sendVerificationEmail'] = async (\n ...args\n ) => {\n return client.sendVerificationEmail(...args);\n };\n\n const changeEmail: AuthClient['changeEmail'] = async (...args) => {\n return client.changeEmail(...args);\n };\n\n // @ts-ignore - deleteUser is not typed\n const deleteUser: AuthClient['deleteUser'] = async (...args) => {\n return client.deleteUser(...args);\n };\n\n const revokeSession: AuthClient['revokeSession'] = async (...args) => {\n return client.revokeSession(...args);\n };\n\n const revokeSessions: AuthClient['revokeSessions'] = async (...args) => {\n return client.revokeSessions(...args);\n };\n\n const revokeOtherSessions: AuthClient['revokeOtherSessions'] = async (\n ...args\n ) => {\n return client.revokeOtherSessions(...args);\n };\n\n const linkSocial: AuthClient['linkSocial'] = async (...args) => {\n return client.linkSocial(...args);\n };\n\n const listAccounts: AuthClient['listAccounts'] = async (...args) => {\n return client.listAccounts(...args);\n };\n\n const unlinkAccount: AuthClient['unlinkAccount'] = async (...args) => {\n return client.unlinkAccount(...args);\n };\n\n const refreshToken: AuthClient['refreshToken'] = async (...args) => {\n return client.refreshToken(...args);\n };\n\n const getAccessToken: AuthClient['getAccessToken'] = async (...args) => {\n return client.getAccessToken(...args);\n };\n\n const accountInfo: AuthClient['accountInfo'] = async (...args) => {\n return client.accountInfo(...args);\n };\n\n const updateUser: AuthClient['updateUser'] = async (...args) => {\n return client.updateUser(...args);\n };\n\n const listSessions: AuthClient['listSessions'] = async (...args) => {\n return client.listSessions(...args);\n };\n\n const enableTwoFactor: AuthClient['twoFactor']['enable'] = async (\n ...args\n ) => {\n return client.twoFactor.enable(...args) as ReturnType<\n AuthClient['twoFactor']['enable']\n >;\n };\n\n const disableTwoFactor: AuthClient['twoFactor']['disable'] = async (\n ...args\n ) => {\n return client.twoFactor.disable(...args) as ReturnType<\n AuthClient['twoFactor']['disable']\n >;\n };\n\n const verifyTotp: AuthClient['twoFactor']['verifyTotp'] = async (...args) => {\n return client.twoFactor.verifyTotp(...args) as ReturnType<\n AuthClient['twoFactor']['verifyTotp']\n >;\n };\n\n const verifyBackupCode: AuthClient['twoFactor']['verifyBackupCode'] = async (\n ...args\n ) => {\n return client.twoFactor.verifyBackupCode(...args) as ReturnType<\n AuthClient['twoFactor']['verifyBackupCode']\n >;\n };\n\n const addPasskey: AuthClient['passkey']['addPasskey'] = async (...args) => {\n return client.passkey.addPasskey(...args);\n };\n\n const signInPasskey: AuthClient['signIn']['passkey'] = async (...args) => {\n return client.signIn.passkey(...args);\n };\n\n const deletePasskey: AuthClient['passkey']['deletePasskey'] = async (\n ...args\n ) => {\n return client.passkey.deletePasskey(...args);\n };\n\n const listPasskeys = async () => {\n // @ts-ignore - listPasskeys may not be typed yet\n return client.$fetch('/passkey/list-user-passkeys', {\n method: 'GET',\n });\n };\n\n // it fix type inference issues\n const signInMagicLink: any = async (...args: any[]) => {\n return (client.signIn as any).magicLink(...args);\n };\n\n return {\n getAuthClient: () => client,\n signInEmail,\n signUpEmail,\n signOut,\n signInSocial,\n linkSocial,\n changePasswordSession,\n requestPasswordResetSession,\n resetPassword,\n verifyEmailSession,\n getSession,\n forgetPassword,\n sendVerificationEmail,\n changeEmail,\n deleteUser,\n revokeSession,\n revokeSessions,\n revokeOtherSessions,\n listAccounts,\n unlinkAccount,\n refreshToken,\n getAccessToken,\n accountInfo,\n updateUser,\n listSessions,\n enableTwoFactor,\n disableTwoFactor,\n verifyTotp,\n verifyBackupCode,\n addPasskey,\n signInPasskey,\n deletePasskey,\n listPasskeys,\n signInMagicLink,\n };\n};\n"],"mappings":";;;;;;AAMA,MAAM,iBAAiB,eACrB,iBAAiB;CACf,SAAS;CACT,iBAAiB;CACjB,SAAS;EACP,gBAAgB,EACd,2BAA2B;GAGzB,MAAM,cADe,IAAI,gBAAgB,OAA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,MAAMC,mBAAgE,OACpE,GAAG,SACA;AACH,SAAO,OAAO,UAAU,iBAAiB,GAAG,KAAK;;CAKnD,MAAMC,aAAkD,OAAO,GAAG,SAAS;AACzE,SAAO,OAAO,QAAQ,WAAW,GAAG,KAAK;;CAG3C,MAAMC,gBAAiD,OAAO,GAAG,SAAS;AACxE,SAAO,OAAO,OAAO,QAAQ,GAAG,KAAK;;CAGvC,MAAMC,gBAAwD,OAC5D,GAAG,SACA;AACH,SAAO,OAAO,QAAQ,cAAc,GAAG,KAAK;;CAG9C,MAAM,eAAe,YAAY;AAE/B,SAAO,OAAO,OAAO,+BAA+B,EAClD,QAAQ,OACT,CAAC;;CAIJ,MAAMC,kBAAuB,OAAO,GAAG,SAAgB;AACrD,SAAQ,OAAO,OAAe,UAAU,GAAG,KAAK;;AAGlD,QAAO;EACL,qBAAqB;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as class_variance_authority_types12 from "class-variance-authority/types";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
|
|
5
5
|
//#region src/components/Badge/index.d.ts
|
|
@@ -47,7 +47,7 @@ declare const badgeVariants: (props?: {
|
|
|
47
47
|
color?: BadgeColor;
|
|
48
48
|
variant?: BadgeVariant;
|
|
49
49
|
size?: BadgeSize;
|
|
50
|
-
} &
|
|
50
|
+
} & class_variance_authority_types12.ClassProp) => string;
|
|
51
51
|
/**
|
|
52
52
|
* Badge component props interface
|
|
53
53
|
* @description Comprehensive props for the Badge component with accessibility and interactive features
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types329 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Breadcrumb/breadcrumb.content.d.ts
|
|
4
4
|
declare const breadCrumbContent: {
|
|
5
5
|
key: string;
|
|
6
6
|
content: {
|
|
7
|
-
linkLabel:
|
|
7
|
+
linkLabel: _intlayer_types329.TypedNodeModel<_intlayer_types329.NodeType.Translation, {
|
|
8
8
|
en: string;
|
|
9
9
|
fr: string;
|
|
10
10
|
es: string;
|
|
@@ -23,7 +23,7 @@ declare const breadCrumbContent: {
|
|
|
23
23
|
id: string;
|
|
24
24
|
vi: string;
|
|
25
25
|
}, {
|
|
26
|
-
nodeType:
|
|
26
|
+
nodeType: _intlayer_types329.NodeType.Translation | "translation";
|
|
27
27
|
} & {
|
|
28
28
|
translation: {
|
|
29
29
|
en: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.content.d.ts","names":[],"sources":["../../../../src/components/Breadcrumb/breadcrumb.content.ts"],"sourcesContent":[],"mappings":";;;cAEa;;;IAAA,SAAA,
|
|
1
|
+
{"version":3,"file":"breadcrumb.content.d.ts","names":[],"sources":["../../../../src/components/Breadcrumb/breadcrumb.content.ts"],"sourcesContent":[],"mappings":";;;cAEa;;;IAAA,SAAA,mCA2BS,0CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LinkColor } from "../Link/Link.js";
|
|
2
2
|
import "../Link/index.js";
|
|
3
3
|
import { FC, HTMLAttributes, ReactNode } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as class_variance_authority_types14 from "class-variance-authority/types";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
6
6
|
import { LocalesValues } from "@intlayer/types";
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ import { LocalesValues } from "@intlayer/types";
|
|
|
12
12
|
declare const breadcrumbVariants: (props?: {
|
|
13
13
|
size?: "small" | "medium" | "large";
|
|
14
14
|
spacing?: "compact" | "normal" | "loose";
|
|
15
|
-
} &
|
|
15
|
+
} & class_variance_authority_types14.ClassProp) => string;
|
|
16
16
|
/**
|
|
17
17
|
* Detailed breadcrumb link configuration with optional href or onClick
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAqDM,0BA+JgC;EA/JhC,IAAA,CAAA,EAAA,OAAA,GAAA,QAiBJ,GAAA,OAAA;EA0HG,OAAA,CAAA,EAAA,SAAA,GAAA,QAAsB,GAAA,OAAA;AAoB3B,CAAA,GA9IE
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAqDM,0BA+JgC;EA/JhC,IAAA,CAAA,EAAA,OAAA,GAAA,QAiBJ,GAAA,OAAA;EA0HG,OAAA,CAAA,EAAA,SAAA,GAAA,QAAsB,GAAA,OAAA;AAoB3B,CAAA,GA9IE,gCAAA,CAAA,SA8IoC,EAAA,GAAsB,MAAA;AAE5D;;;KAtBK,sBAAA,GA+BoB;EAId;;;EAyBP,IAAA,CAAA,EAAA,MAAA;EACa;;;EA4BJ,IAAA,EAAA,MAAA;;;;;;;;;;;KArED,cAAA,YAA0B;KAE1B,eAAA;;;;SAIH;;;;;UAKC,eAAe;;;;WAId;;;;;;;;;;cAUG;;;;;;;;;;;;;;;IAeV,oBAAoB,sBACtB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4BJ,YAAY,GAAG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types314 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Browser/Browser.content.d.ts
|
|
4
4
|
declare const browserContent: {
|
|
5
5
|
key: string;
|
|
6
6
|
content: {
|
|
7
|
-
ariaLabel:
|
|
7
|
+
ariaLabel: _intlayer_types314.TypedNodeModel<_intlayer_types314.NodeType.Translation, {
|
|
8
8
|
en: string;
|
|
9
9
|
'en-GB': string;
|
|
10
10
|
fr: string;
|
|
@@ -23,7 +23,7 @@ declare const browserContent: {
|
|
|
23
23
|
id: string;
|
|
24
24
|
vi: string;
|
|
25
25
|
}, {
|
|
26
|
-
nodeType:
|
|
26
|
+
nodeType: _intlayer_types314.NodeType.Translation | "translation";
|
|
27
27
|
} & {
|
|
28
28
|
translation: {
|
|
29
29
|
en: string;
|
|
@@ -45,7 +45,7 @@ declare const browserContent: {
|
|
|
45
45
|
vi: string;
|
|
46
46
|
};
|
|
47
47
|
}>;
|
|
48
|
-
urlLabel:
|
|
48
|
+
urlLabel: _intlayer_types314.TypedNodeModel<_intlayer_types314.NodeType.Translation, {
|
|
49
49
|
en: string;
|
|
50
50
|
'en-GB': string;
|
|
51
51
|
fr: string;
|
|
@@ -64,7 +64,7 @@ declare const browserContent: {
|
|
|
64
64
|
id: string;
|
|
65
65
|
vi: string;
|
|
66
66
|
}, {
|
|
67
|
-
nodeType:
|
|
67
|
+
nodeType: _intlayer_types314.NodeType.Translation | "translation";
|
|
68
68
|
} & {
|
|
69
69
|
translation: {
|
|
70
70
|
en: string;
|
|
@@ -87,7 +87,7 @@ declare const browserContent: {
|
|
|
87
87
|
};
|
|
88
88
|
}>;
|
|
89
89
|
urlPlaceholder: string;
|
|
90
|
-
errorMessage:
|
|
90
|
+
errorMessage: _intlayer_types314.TypedNodeModel<_intlayer_types314.NodeType.Translation, {
|
|
91
91
|
en: string;
|
|
92
92
|
'en-GB': string;
|
|
93
93
|
fr: string;
|
|
@@ -106,7 +106,7 @@ declare const browserContent: {
|
|
|
106
106
|
id: string;
|
|
107
107
|
vi: string;
|
|
108
108
|
}, {
|
|
109
|
-
nodeType:
|
|
109
|
+
nodeType: _intlayer_types314.NodeType.Translation | "translation";
|
|
110
110
|
} & {
|
|
111
111
|
translation: {
|
|
112
112
|
en: string;
|
|
@@ -128,7 +128,7 @@ declare const browserContent: {
|
|
|
128
128
|
vi: string;
|
|
129
129
|
};
|
|
130
130
|
}>;
|
|
131
|
-
reloadButtonTitle:
|
|
131
|
+
reloadButtonTitle: _intlayer_types314.TypedNodeModel<_intlayer_types314.NodeType.Translation, {
|
|
132
132
|
en: string;
|
|
133
133
|
'en-GB': string;
|
|
134
134
|
fr: string;
|
|
@@ -147,7 +147,7 @@ declare const browserContent: {
|
|
|
147
147
|
id: string;
|
|
148
148
|
vi: string;
|
|
149
149
|
}, {
|
|
150
|
-
nodeType:
|
|
150
|
+
nodeType: _intlayer_types314.NodeType.Translation | "translation";
|
|
151
151
|
} & {
|
|
152
152
|
translation: {
|
|
153
153
|
en: string;
|
|
@@ -169,7 +169,7 @@ declare const browserContent: {
|
|
|
169
169
|
vi: string;
|
|
170
170
|
};
|
|
171
171
|
}>;
|
|
172
|
-
iframeTitle:
|
|
172
|
+
iframeTitle: _intlayer_types314.TypedNodeModel<_intlayer_types314.NodeType.Translation, {
|
|
173
173
|
en: string;
|
|
174
174
|
'en-GB': string;
|
|
175
175
|
fr: string;
|
|
@@ -188,7 +188,7 @@ declare const browserContent: {
|
|
|
188
188
|
id: string;
|
|
189
189
|
vi: string;
|
|
190
190
|
}, {
|
|
191
|
-
nodeType:
|
|
191
|
+
nodeType: _intlayer_types314.NodeType.Translation | "translation";
|
|
192
192
|
} & {
|
|
193
193
|
translation: {
|
|
194
194
|
en: string;
|
|
@@ -61,9 +61,9 @@ declare enum ButtonTextAlign {
|
|
|
61
61
|
*/
|
|
62
62
|
declare const buttonVariants: (props?: {
|
|
63
63
|
size?: "md" | "sm" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl";
|
|
64
|
-
color?: "error" | "
|
|
64
|
+
color?: "success" | "error" | "neutral" | "text" | "custom" | "primary" | "secondary" | "destructive" | "light" | "dark" | "card" | "current" | "text-inverse";
|
|
65
65
|
roundedSize?: "md" | "sm" | "lg" | "xl" | "none";
|
|
66
|
-
variant?: "
|
|
66
|
+
variant?: "input" | "default" | "none" | "link" | "outline" | "invisible-link" | "hoverable" | "fade";
|
|
67
67
|
textAlign?: "left" | "center" | "right";
|
|
68
68
|
isFullWidth?: boolean;
|
|
69
69
|
} & class_variance_authority_types10.ClassProp) => string;
|
|
@@ -5,7 +5,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
5
5
|
//#region src/components/CollapsibleTable/CollapsibleTable.d.ts
|
|
6
6
|
declare const collapsibleTableVariants: (props?: {
|
|
7
7
|
size?: "md" | "lg" | "sm" | "xl" | "full";
|
|
8
|
-
variant?: "default" | "
|
|
8
|
+
variant?: "default" | "ghost" | "dark" | "outlined";
|
|
9
9
|
spacing?: "md" | "lg" | "sm" | "none" | "auto";
|
|
10
10
|
} & class_variance_authority_types11.ClassProp) => string;
|
|
11
11
|
interface CollapsibleTableProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, VariantProps<typeof collapsibleTableVariants> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react8 from "react";
|
|
2
2
|
import { ComponentProps, FC, HTMLAttributes } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
4
4
|
import { DialogProps } from "@radix-ui/react-dialog";
|
|
5
5
|
import { Command as Command$1 } from "cmdk";
|
|
6
6
|
|
|
@@ -29,51 +29,51 @@ declare const Command: {
|
|
|
29
29
|
ref?: React.Ref<HTMLInputElement>;
|
|
30
30
|
} & {
|
|
31
31
|
asChild?: boolean;
|
|
32
|
-
}, "key" |
|
|
32
|
+
}, "key" | keyof react8.InputHTMLAttributes<HTMLInputElement> | "asChild">, "type" | "value" | "onChange"> & {
|
|
33
33
|
value?: string;
|
|
34
34
|
onValueChange?: (search: string) => void;
|
|
35
35
|
} & react8.RefAttributes<HTMLInputElement>>;
|
|
36
36
|
List: FC<{
|
|
37
37
|
children?: React.ReactNode;
|
|
38
|
-
} & Pick<Pick<react8.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof HTMLAttributes<HTMLDivElement
|
|
38
|
+
} & Pick<Pick<react8.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
39
39
|
ref?: React.Ref<HTMLDivElement>;
|
|
40
40
|
} & {
|
|
41
41
|
asChild?: boolean;
|
|
42
|
-
}, keyof HTMLAttributes<HTMLDivElement> | "
|
|
42
|
+
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
43
43
|
label?: string;
|
|
44
44
|
} & react8.RefAttributes<HTMLDivElement>>;
|
|
45
45
|
Empty: FC<{
|
|
46
46
|
children?: React.ReactNode;
|
|
47
|
-
} & Pick<Pick<react8.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof HTMLAttributes<HTMLDivElement
|
|
47
|
+
} & Pick<Pick<react8.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
48
48
|
ref?: React.Ref<HTMLDivElement>;
|
|
49
49
|
} & {
|
|
50
50
|
asChild?: boolean;
|
|
51
|
-
}, keyof HTMLAttributes<HTMLDivElement> | "
|
|
51
|
+
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild"> & react8.RefAttributes<HTMLDivElement>>;
|
|
52
52
|
Group: FC<{
|
|
53
53
|
children?: React.ReactNode;
|
|
54
|
-
} & Omit<Pick<Pick<react8.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof HTMLAttributes<HTMLDivElement
|
|
54
|
+
} & Omit<Pick<Pick<react8.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
55
55
|
ref?: React.Ref<HTMLDivElement>;
|
|
56
56
|
} & {
|
|
57
57
|
asChild?: boolean;
|
|
58
|
-
}, keyof HTMLAttributes<HTMLDivElement> | "
|
|
58
|
+
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
|
|
59
59
|
heading?: React.ReactNode;
|
|
60
60
|
value?: string;
|
|
61
61
|
forceMount?: boolean;
|
|
62
62
|
} & react8.RefAttributes<HTMLDivElement>>;
|
|
63
|
-
Separator: FC<Pick<Pick<react8.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof HTMLAttributes<HTMLDivElement
|
|
63
|
+
Separator: FC<Pick<Pick<react8.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
64
64
|
ref?: React.Ref<HTMLDivElement>;
|
|
65
65
|
} & {
|
|
66
66
|
asChild?: boolean;
|
|
67
|
-
}, keyof HTMLAttributes<HTMLDivElement> | "
|
|
67
|
+
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
68
68
|
alwaysRender?: boolean;
|
|
69
69
|
} & react8.RefAttributes<HTMLDivElement>>;
|
|
70
70
|
Item: FC<{
|
|
71
71
|
children?: React.ReactNode;
|
|
72
|
-
} & Omit<Pick<Pick<react8.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof HTMLAttributes<HTMLDivElement
|
|
72
|
+
} & Omit<Pick<Pick<react8.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
73
73
|
ref?: React.Ref<HTMLDivElement>;
|
|
74
74
|
} & {
|
|
75
75
|
asChild?: boolean;
|
|
76
|
-
}, keyof HTMLAttributes<HTMLDivElement> | "
|
|
76
|
+
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild">, "disabled" | "value" | "onSelect"> & {
|
|
77
77
|
disabled?: boolean;
|
|
78
78
|
onSelect?: (value: string) => void;
|
|
79
79
|
value?: string;
|
|
@@ -83,7 +83,7 @@ declare const Command: {
|
|
|
83
83
|
Shortcut: ({
|
|
84
84
|
className,
|
|
85
85
|
...props
|
|
86
|
-
}: HTMLAttributes<HTMLSpanElement>) =>
|
|
86
|
+
}: HTMLAttributes<HTMLSpanElement>) => react_jsx_runtime20.JSX.Element;
|
|
87
87
|
propTypes?: any;
|
|
88
88
|
displayName?: string | undefined;
|
|
89
89
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DetailedHTMLProps, FC, HTMLAttributes, PropsWithChildren } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as class_variance_authority_types13 from "class-variance-authority/types";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
|
|
5
5
|
//#region src/components/Container/index.d.ts
|
|
@@ -9,15 +9,15 @@ import { VariantProps } from "class-variance-authority";
|
|
|
9
9
|
* Provides flexible styling options for background, padding, borders, and layout
|
|
10
10
|
*/
|
|
11
11
|
declare const containerVariants: (props?: {
|
|
12
|
-
roundedSize?: "md" | "lg" | "sm" | "xl" | "
|
|
12
|
+
roundedSize?: "md" | "lg" | "sm" | "xl" | "2xl" | "none" | "3xl" | "full";
|
|
13
13
|
transparency?: "md" | "lg" | "sm" | "xl" | "none" | "full";
|
|
14
|
-
padding?: "md" | "lg" | "sm" | "xl" | "
|
|
14
|
+
padding?: "md" | "lg" | "sm" | "xl" | "2xl" | "none";
|
|
15
15
|
separator?: "without" | "x" | "y" | "both";
|
|
16
16
|
border?: "with" | "none";
|
|
17
|
-
borderColor?: "
|
|
17
|
+
borderColor?: "error" | "text" | "primary" | "secondary" | "neutral" | "success" | "warning";
|
|
18
18
|
background?: "with" | "none" | "hoverable";
|
|
19
|
-
gap?: "md" | "lg" | "sm" | "xl" | "
|
|
20
|
-
} &
|
|
19
|
+
gap?: "md" | "lg" | "sm" | "xl" | "2xl" | "none";
|
|
20
|
+
} & class_variance_authority_types13.ClassProp) => string;
|
|
21
21
|
/** Available rounded corner sizes for the container */
|
|
22
22
|
declare enum ContainerRoundedSize {
|
|
23
23
|
NONE = "none",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/components/Container/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AAaA;AA4EY,cA5EC,iBA4EmB,EAAA,CAAA,KAoEzB,CApEyB,EAAA;EAYpB,WAAA,CAAA,EAAA,IAAA,GAAA,IAAqB,GAAA,IAAA,GAAA,IAAA,GAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/components/Container/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AAaA;AA4EY,cA5EC,iBA4EmB,EAAA,CAAA,KAoEzB,CApEyB,EAAA;EAYpB,WAAA,CAAA,EAAA,IAAA,GAAA,IAAqB,GAAA,IAAA,GAAA,IAAA,GAAA,KAAA,GAAA,MAAA,GAAA,KAAA,GAAA,MAAA;EAUrB,YAAA,CAAA,EAAA,IAAgB,GAAA,IAAA,GAAA,IAAA,GAAA,IAAA,GAAA,MAAA,GAAA,MAAA;EAShB,OAAA,CAAA,EAAA,IAAA,GAAA,IAAkB,GAAA,IAAA,GAAA,IAAA,GAAA,KAAA,GAAA,MAAA;EAQlB,SAAA,CAAA,EAAA,SAAA,GAAoB,GAAA,GAAA,GAAA,GAAA,MAAA;EAWpB,MAAA,CAAA,EAAA,MAAA,GAAA,MAAmB;EAOnB,WAAA,CAAA,EAAA,OAAY,GAAA,MAAA,GAAA,SAAA,GAAA,WAAA,GAAA,SAAA,GAAA,SAAA,GAAA,SAAA;EAUZ,UAAA,CAAA,EAAA,MAAc,GAAA,MAAA,GAAA,WAAA;EACC,GAAA,CAAA,EAAA,IAAA,GAAA,IAAA,GAAA,IAAA,GAAA,IAAA,GAAA,KAAA,GAAA,MAAA;CAApB,GAvEL,gCAAA,CAAA,SAuEK,EAAA,GAAA,MAAA;;AADsB,aAnEjB,oBAAA;EAsEuB,IAAA,GAAA,MAAA;EAAf,EAAA,GAAA,IAAA;EAAgC,EAAA,GAAA,IAAA;EAAlD,EAAA,GAAA,IAAA;EAAiB,EAAA,GAAA,IAAA;EAkCN,MAAA,GAAA,KAgCZ;;;;;aA5HW,qBAAA;;;;;;;;;aAUA,gBAAA;;;;;;;;aASA,kBAAA;;;;;;;aAQA,oBAAA;;;;;;;;;;aAWA,mBAAA;;;;;;aAOA,YAAA;;;;;;;;;KAUA,cAAA,GAAiB,kBAC3B,KAAK,oBAAoB,iCAEzB,kBAAkB,eAAe,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCvC,WAAW,GAAG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types0 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/components/CopyButton/CopyButton.content.d.ts
|
|
4
4
|
declare const copyContentContent: {
|
|
5
5
|
key: string;
|
|
6
6
|
content: {
|
|
7
|
-
label:
|
|
7
|
+
label: _intlayer_types0.TypedNodeModel<_intlayer_types0.NodeType.Translation, {
|
|
8
8
|
en: string;
|
|
9
9
|
fr: string;
|
|
10
10
|
es: string;
|
|
@@ -23,7 +23,7 @@ declare const copyContentContent: {
|
|
|
23
23
|
id: string;
|
|
24
24
|
vi: string;
|
|
25
25
|
}, {
|
|
26
|
-
nodeType:
|
|
26
|
+
nodeType: _intlayer_types0.NodeType.Translation | "translation";
|
|
27
27
|
} & {
|
|
28
28
|
translation: {
|
|
29
29
|
en: string;
|