@lolmath/ui 2.3.1 → 2.4.1
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 +81 -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 +82 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -41,6 +41,10 @@ __export(src_exports, {
|
|
|
41
41
|
SliderLabel: () => SliderLabel,
|
|
42
42
|
Spinner: () => Spinner,
|
|
43
43
|
Switch: () => Switch,
|
|
44
|
+
Tab: () => Tab,
|
|
45
|
+
TabList: () => TabList,
|
|
46
|
+
TabPanel: () => TabPanel,
|
|
47
|
+
Tabs: () => Tabs,
|
|
44
48
|
TextField: () => TextField
|
|
45
49
|
});
|
|
46
50
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -852,6 +856,79 @@ function DialogButtons({ children }) {
|
|
|
852
856
|
function DialogTrigger(props) {
|
|
853
857
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_aria_components11.DialogTrigger, { ...props });
|
|
854
858
|
}
|
|
859
|
+
|
|
860
|
+
// src/components/tabs.tsx
|
|
861
|
+
var import_react_aria_components12 = require("react-aria-components");
|
|
862
|
+
var import_tailwind_merge14 = require("tailwind-merge");
|
|
863
|
+
var import_react4 = require("react");
|
|
864
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
865
|
+
function Tabs({ onSelectionChange, ...rest }) {
|
|
866
|
+
const id = useCssId();
|
|
867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabsContext.Provider, { value: { id }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
868
|
+
import_react_aria_components12.Tabs,
|
|
869
|
+
{
|
|
870
|
+
...rest,
|
|
871
|
+
onSelectionChange: (key) => {
|
|
872
|
+
startViewTransition(() => {
|
|
873
|
+
onSelectionChange?.(key);
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
) });
|
|
878
|
+
}
|
|
879
|
+
function TabList({
|
|
880
|
+
className,
|
|
881
|
+
...rest
|
|
882
|
+
}) {
|
|
883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
884
|
+
import_react_aria_components12.TabList,
|
|
885
|
+
{
|
|
886
|
+
...rest,
|
|
887
|
+
className: (values) => (0, import_tailwind_merge14.twMerge)("flex gap-0 -ml-4", resolveClassname(className, values))
|
|
888
|
+
}
|
|
889
|
+
);
|
|
890
|
+
}
|
|
891
|
+
function Tab({ children, className, ...rest }) {
|
|
892
|
+
const { id } = useTabsContext();
|
|
893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
894
|
+
import_react_aria_components12.Tab,
|
|
895
|
+
{
|
|
896
|
+
...rest,
|
|
897
|
+
className: (values) => (0, import_tailwind_merge14.twMerge)(
|
|
898
|
+
"font-beaufort text-lol-gold-300 uppercase font-medium text-xs tracking-widest px-4 relative py-1 cursor-pointer select-none",
|
|
899
|
+
(values.isSelected || values.isHovered) && "text-lol-gold-50",
|
|
900
|
+
values.isPressed && "text-lol-gold-500",
|
|
901
|
+
values.isDisabled && "text-lol-gray-500 cursor-default",
|
|
902
|
+
resolveClassname(className, values)
|
|
903
|
+
),
|
|
904
|
+
children: (values) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
905
|
+
typeof children === "function" ? children(values) : children,
|
|
906
|
+
values.isSelected && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
907
|
+
"div",
|
|
908
|
+
{
|
|
909
|
+
style: {
|
|
910
|
+
viewTransitionName: `tab-indicator-${id}`
|
|
911
|
+
},
|
|
912
|
+
className: (0, import_tailwind_merge14.twMerge)(
|
|
913
|
+
"h-px bg-gradient-to-r from-transparent via-lol-gold-200 to-transparent absolute bottom-0 w-full left-0"
|
|
914
|
+
)
|
|
915
|
+
}
|
|
916
|
+
)
|
|
917
|
+
] })
|
|
918
|
+
}
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
function TabPanel({ ...rest }) {
|
|
922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_aria_components12.TabPanel, { ...rest });
|
|
923
|
+
}
|
|
924
|
+
var TabsContext = (0, import_react4.createContext)(void 0);
|
|
925
|
+
function useTabsContext() {
|
|
926
|
+
const context = (0, import_react4.useContext)(TabsContext);
|
|
927
|
+
if (context === void 0) {
|
|
928
|
+
throw new Error("useTabsContext must be used within a Tabs");
|
|
929
|
+
}
|
|
930
|
+
return context;
|
|
931
|
+
}
|
|
855
932
|
// Annotate the CommonJS export names for ESM import in node:
|
|
856
933
|
0 && (module.exports = {
|
|
857
934
|
Accordion,
|
|
@@ -875,6 +952,10 @@ function DialogTrigger(props) {
|
|
|
875
952
|
SliderLabel,
|
|
876
953
|
Spinner,
|
|
877
954
|
Switch,
|
|
955
|
+
Tab,
|
|
956
|
+
TabList,
|
|
957
|
+
TabPanel,
|
|
958
|
+
Tabs,
|
|
878
959
|
TextField
|
|
879
960
|
});
|
|
880
961
|
//# sourceMappingURL=index.cjs.map
|