@lolmath/ui 2.3.1 → 2.4.0
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/index.cjs +71 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentProps } from 'react';
|
|
3
|
-
import { ButtonProps as ButtonProps$1, ItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, RadioGroupProps, RadioProps, LabelProps, NumberFieldProps, Group, HeadingProps, DialogTriggerProps, ModalOverlayProps, DialogProps } from 'react-aria-components';
|
|
3
|
+
import { ButtonProps as ButtonProps$1, ItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, RadioGroupProps, RadioProps, LabelProps, NumberFieldProps, Group, HeadingProps, DialogTriggerProps, ModalOverlayProps, DialogProps, TabsProps, TabListProps, TabProps, TabPanelProps } from 'react-aria-components';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
interface ButtonProps extends ButtonProps$1 {
|
|
@@ -92,4 +92,9 @@ declare function DialogButtons({ children }: {
|
|
|
92
92
|
}): react_jsx_runtime.JSX.Element;
|
|
93
93
|
declare function DialogTrigger(props: DialogTriggerProps): react_jsx_runtime.JSX.Element;
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
declare function Tabs({ onSelectionChange, ...rest }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
96
|
+
declare function TabList<T extends object>({ ...rest }: TabListProps<T>): react_jsx_runtime.JSX.Element;
|
|
97
|
+
declare function Tab({ children, ...rest }: TabProps): react_jsx_runtime.JSX.Element;
|
|
98
|
+
declare function TabPanel({ ...rest }: TabPanelProps): react_jsx_runtime.JSX.Element;
|
|
99
|
+
|
|
100
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Button, DialogButtons, DialogTrigger, Heading, Item, Label, Modal, NumberField, ProgressBar, Radio, RadioGroup, SearchField, Select, Slider, SliderLabel, Spinner, Switch, Tab, TabList, TabPanel, Tabs, TextField };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentProps } from 'react';
|
|
3
|
-
import { ButtonProps as ButtonProps$1, ItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, RadioGroupProps, RadioProps, LabelProps, NumberFieldProps, Group, HeadingProps, DialogTriggerProps, ModalOverlayProps, DialogProps } from 'react-aria-components';
|
|
3
|
+
import { ButtonProps as ButtonProps$1, ItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, RadioGroupProps, RadioProps, LabelProps, NumberFieldProps, Group, HeadingProps, DialogTriggerProps, ModalOverlayProps, DialogProps, TabsProps, TabListProps, TabProps, TabPanelProps } from 'react-aria-components';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
interface ButtonProps extends ButtonProps$1 {
|
|
@@ -92,4 +92,9 @@ declare function DialogButtons({ children }: {
|
|
|
92
92
|
}): react_jsx_runtime.JSX.Element;
|
|
93
93
|
declare function DialogTrigger(props: DialogTriggerProps): react_jsx_runtime.JSX.Element;
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
declare function Tabs({ onSelectionChange, ...rest }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
96
|
+
declare function TabList<T extends object>({ ...rest }: TabListProps<T>): react_jsx_runtime.JSX.Element;
|
|
97
|
+
declare function Tab({ children, ...rest }: TabProps): react_jsx_runtime.JSX.Element;
|
|
98
|
+
declare function TabPanel({ ...rest }: TabPanelProps): react_jsx_runtime.JSX.Element;
|
|
99
|
+
|
|
100
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Button, DialogButtons, DialogTrigger, Heading, Item, Label, Modal, NumberField, ProgressBar, Radio, RadioGroup, SearchField, Select, Slider, SliderLabel, Spinner, Switch, Tab, TabList, TabPanel, Tabs, TextField };
|
package/dist/index.js
CHANGED
|
@@ -847,6 +847,74 @@ function DialogButtons({ children }) {
|
|
|
847
847
|
function DialogTrigger(props) {
|
|
848
848
|
return /* @__PURE__ */ jsx13(AriaDialogTrigger, { ...props });
|
|
849
849
|
}
|
|
850
|
+
|
|
851
|
+
// src/components/tabs.tsx
|
|
852
|
+
import {
|
|
853
|
+
Tabs as AriaTabs,
|
|
854
|
+
TabList as AriaTabList,
|
|
855
|
+
Tab as AriaTab,
|
|
856
|
+
TabPanel as AriaTabPanel
|
|
857
|
+
} from "react-aria-components";
|
|
858
|
+
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
859
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
860
|
+
import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
861
|
+
function Tabs({ onSelectionChange, ...rest }) {
|
|
862
|
+
const id = useCssId();
|
|
863
|
+
return /* @__PURE__ */ jsx14(TabsContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx14(
|
|
864
|
+
AriaTabs,
|
|
865
|
+
{
|
|
866
|
+
...rest,
|
|
867
|
+
onSelectionChange: (key) => {
|
|
868
|
+
startViewTransition(() => {
|
|
869
|
+
onSelectionChange?.(key);
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
) });
|
|
874
|
+
}
|
|
875
|
+
function TabList({ ...rest }) {
|
|
876
|
+
return /* @__PURE__ */ jsx14(AriaTabList, { ...rest, className: () => "flex gap-0 -ml-4" });
|
|
877
|
+
}
|
|
878
|
+
function Tab({ children, ...rest }) {
|
|
879
|
+
const { id } = useTabsContext();
|
|
880
|
+
return /* @__PURE__ */ jsx14(
|
|
881
|
+
AriaTab,
|
|
882
|
+
{
|
|
883
|
+
...rest,
|
|
884
|
+
className: (values) => twMerge14(
|
|
885
|
+
"font-beaufort text-lol-gold-300 uppercase font-medium text-xs tracking-widest px-4 relative py-1 cursor-pointer select-none",
|
|
886
|
+
(values.isSelected || values.isHovered) && "text-lol-gold-50",
|
|
887
|
+
values.isPressed && "text-lol-gold-500",
|
|
888
|
+
values.isDisabled && "text-lol-gray-500 cursor-default"
|
|
889
|
+
),
|
|
890
|
+
children: (values) => /* @__PURE__ */ jsxs9(Fragment6, { children: [
|
|
891
|
+
typeof children === "function" ? children(values) : children,
|
|
892
|
+
values.isSelected && /* @__PURE__ */ jsx14(
|
|
893
|
+
"div",
|
|
894
|
+
{
|
|
895
|
+
style: {
|
|
896
|
+
viewTransitionName: `tab-indicator-${id}`
|
|
897
|
+
},
|
|
898
|
+
className: twMerge14(
|
|
899
|
+
"h-px bg-gradient-to-r from-transparent via-lol-gold-200 to-transparent absolute bottom-0 w-full left-0"
|
|
900
|
+
)
|
|
901
|
+
}
|
|
902
|
+
)
|
|
903
|
+
] })
|
|
904
|
+
}
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
function TabPanel({ ...rest }) {
|
|
908
|
+
return /* @__PURE__ */ jsx14(AriaTabPanel, { ...rest });
|
|
909
|
+
}
|
|
910
|
+
var TabsContext = createContext2(void 0);
|
|
911
|
+
function useTabsContext() {
|
|
912
|
+
const context = useContext2(TabsContext);
|
|
913
|
+
if (context === void 0) {
|
|
914
|
+
throw new Error("useTabsContext must be used within a Tabs");
|
|
915
|
+
}
|
|
916
|
+
return context;
|
|
917
|
+
}
|
|
850
918
|
export {
|
|
851
919
|
Accordion,
|
|
852
920
|
AccordionContent,
|
|
@@ -869,6 +937,10 @@ export {
|
|
|
869
937
|
SliderLabel,
|
|
870
938
|
Spinner,
|
|
871
939
|
Switch,
|
|
940
|
+
Tab,
|
|
941
|
+
TabList,
|
|
942
|
+
TabPanel,
|
|
943
|
+
Tabs,
|
|
872
944
|
TextField
|
|
873
945
|
};
|
|
874
946
|
//# sourceMappingURL=index.js.map
|