@lolmath/ui 3.0.1 → 3.1.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 +204 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +205 -1
- 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, ButtonRenderProps, ListBoxItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SliderOutputProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, InputProps, RadioGroupProps, RadioProps, NumberFieldProps, Group, HeadingProps as HeadingProps$1, DialogTriggerProps, ModalOverlayProps, DialogProps, TabsProps, TabListProps, TabProps, TabPanelProps, CheckboxProps, TextAreaProps, TooltipProps, LabelProps as LabelProps$1 } from 'react-aria-components';
|
|
3
|
+
import { ButtonProps as ButtonProps$1, ButtonRenderProps, ListBoxItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SliderOutputProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, InputProps, RadioGroupProps, RadioProps, NumberFieldProps, Group, HeadingProps as HeadingProps$1, DialogTriggerProps, ModalOverlayProps, DialogProps, TabsProps, TabListProps, TabProps, TabPanelProps, CheckboxProps, TextAreaProps, TooltipProps, LabelProps as LabelProps$1, ToggleButtonProps as ToggleButtonProps$1 } from 'react-aria-components';
|
|
4
4
|
export { Key, TooltipTrigger } from 'react-aria-components';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
@@ -208,4 +208,14 @@ declare function Label({ preset, color, className, ...rest }: LabelProps): JSX.E
|
|
|
208
208
|
|
|
209
209
|
declare const tv: tailwind_variants.TV;
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
type ToggleButtonShape = "round" | "square" | "normal";
|
|
212
|
+
type ToggleButtonPreset = "gold" | "hextech" | "dimmed";
|
|
213
|
+
interface ToggleButtonProps extends ToggleButtonProps$1 {
|
|
214
|
+
innerProps?: ComponentProps<"span">;
|
|
215
|
+
preset?: ToggleButtonPreset;
|
|
216
|
+
thin?: boolean;
|
|
217
|
+
shape?: ToggleButtonShape;
|
|
218
|
+
}
|
|
219
|
+
declare function ToggleButton({ children, className, innerProps, preset, shape, thin, ...props }: ToggleButtonProps): react_jsx_runtime.JSX.Element;
|
|
220
|
+
|
|
221
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Button, type ButtonPreset, type ButtonShape, Card, type CardProps, Checkbox, DialogButtons, DialogHeading, DialogTrigger, Heading, type HeadingColor, type HeadingElement, Item, Label, Modal, NumberField, ProgressBar, Radio, RadioGroup, SearchField, Select, Slider, SliderOutput, Spinner, Switch, Tab, TabList, TabPanel, Tabs, Text, TextArea, type TextColor, type TextElement, TextField, type TextPreset, ToggleButton, type ToggleButtonPreset, type ToggleButtonShape, Tooltip, accordionTrigger, accordionTriggerInner, borderInverted, tv };
|
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, ButtonRenderProps, ListBoxItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SliderOutputProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, InputProps, RadioGroupProps, RadioProps, NumberFieldProps, Group, HeadingProps as HeadingProps$1, DialogTriggerProps, ModalOverlayProps, DialogProps, TabsProps, TabListProps, TabProps, TabPanelProps, CheckboxProps, TextAreaProps, TooltipProps, LabelProps as LabelProps$1 } from 'react-aria-components';
|
|
3
|
+
import { ButtonProps as ButtonProps$1, ButtonRenderProps, ListBoxItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SliderOutputProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, InputProps, RadioGroupProps, RadioProps, NumberFieldProps, Group, HeadingProps as HeadingProps$1, DialogTriggerProps, ModalOverlayProps, DialogProps, TabsProps, TabListProps, TabProps, TabPanelProps, CheckboxProps, TextAreaProps, TooltipProps, LabelProps as LabelProps$1, ToggleButtonProps as ToggleButtonProps$1 } from 'react-aria-components';
|
|
4
4
|
export { Key, TooltipTrigger } from 'react-aria-components';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
@@ -208,4 +208,14 @@ declare function Label({ preset, color, className, ...rest }: LabelProps): JSX.E
|
|
|
208
208
|
|
|
209
209
|
declare const tv: tailwind_variants.TV;
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
type ToggleButtonShape = "round" | "square" | "normal";
|
|
212
|
+
type ToggleButtonPreset = "gold" | "hextech" | "dimmed";
|
|
213
|
+
interface ToggleButtonProps extends ToggleButtonProps$1 {
|
|
214
|
+
innerProps?: ComponentProps<"span">;
|
|
215
|
+
preset?: ToggleButtonPreset;
|
|
216
|
+
thin?: boolean;
|
|
217
|
+
shape?: ToggleButtonShape;
|
|
218
|
+
}
|
|
219
|
+
declare function ToggleButton({ children, className, innerProps, preset, shape, thin, ...props }: ToggleButtonProps): react_jsx_runtime.JSX.Element;
|
|
220
|
+
|
|
221
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Button, type ButtonPreset, type ButtonShape, Card, type CardProps, Checkbox, DialogButtons, DialogHeading, DialogTrigger, Heading, type HeadingColor, type HeadingElement, Item, Label, Modal, NumberField, ProgressBar, Radio, RadioGroup, SearchField, Select, Slider, SliderOutput, Spinner, Switch, Tab, TabList, TabPanel, Tabs, Text, TextArea, type TextColor, type TextElement, TextField, type TextPreset, ToggleButton, type ToggleButtonPreset, type ToggleButtonShape, Tooltip, accordionTrigger, accordionTriggerInner, borderInverted, tv };
|
package/dist/index.js
CHANGED
|
@@ -200,7 +200,7 @@ var button = tv({
|
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
shape: ["round", "square"],
|
|
203
|
-
class: "aspect-square p-
|
|
203
|
+
class: "flex aspect-square h-7 items-center justify-center p-0 font-black leading-none"
|
|
204
204
|
},
|
|
205
205
|
{
|
|
206
206
|
isHovered: true,
|
|
@@ -1597,6 +1597,209 @@ function Label2({
|
|
|
1597
1597
|
className: text({ preset, color, className })
|
|
1598
1598
|
});
|
|
1599
1599
|
}
|
|
1600
|
+
|
|
1601
|
+
// src/components/toggle-button.tsx
|
|
1602
|
+
import {
|
|
1603
|
+
ToggleButton as AriaToggleButton
|
|
1604
|
+
} from "react-aria-components";
|
|
1605
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1606
|
+
var toggleButtonBorder = tv({
|
|
1607
|
+
base: "bg-gradient-to-t outline-none transition-colors duration-200",
|
|
1608
|
+
variants: {
|
|
1609
|
+
preset: {
|
|
1610
|
+
gold: "",
|
|
1611
|
+
hextech: "",
|
|
1612
|
+
dimmed: dimmedGradient
|
|
1613
|
+
},
|
|
1614
|
+
shape: {
|
|
1615
|
+
round: "aspect-square rounded-full",
|
|
1616
|
+
square: "aspect-square",
|
|
1617
|
+
normal: ""
|
|
1618
|
+
},
|
|
1619
|
+
isHovered: {
|
|
1620
|
+
true: ""
|
|
1621
|
+
},
|
|
1622
|
+
isPressed: {
|
|
1623
|
+
true: ""
|
|
1624
|
+
},
|
|
1625
|
+
isDisabled: {
|
|
1626
|
+
true: ""
|
|
1627
|
+
},
|
|
1628
|
+
isFocused: {
|
|
1629
|
+
true: ""
|
|
1630
|
+
},
|
|
1631
|
+
isFocusVisible: {
|
|
1632
|
+
true: ""
|
|
1633
|
+
},
|
|
1634
|
+
isSelected: {
|
|
1635
|
+
true: ""
|
|
1636
|
+
}
|
|
1637
|
+
},
|
|
1638
|
+
compoundVariants: [
|
|
1639
|
+
{
|
|
1640
|
+
preset: ["dimmed"],
|
|
1641
|
+
isSelected: true,
|
|
1642
|
+
class: [goldGradient]
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
preset: ["gold"],
|
|
1646
|
+
class: goldGradient
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
preset: ["gold", "dimmed"],
|
|
1650
|
+
isHovered: true,
|
|
1651
|
+
class: goldGradientHover
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
preset: ["gold", "dimmed"],
|
|
1655
|
+
isPressed: true,
|
|
1656
|
+
class: goldGradientPressed
|
|
1657
|
+
},
|
|
1658
|
+
{
|
|
1659
|
+
preset: ["gold", "dimmed"],
|
|
1660
|
+
isDisabled: true,
|
|
1661
|
+
class: goldGradientDisabled
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
preset: ["gold"],
|
|
1665
|
+
isFocusVisible: true,
|
|
1666
|
+
class: "outline outline-offset-2 outline-yellow-50"
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
preset: ["hextech"],
|
|
1670
|
+
class: hextechGradient
|
|
1671
|
+
},
|
|
1672
|
+
{
|
|
1673
|
+
preset: ["hextech"],
|
|
1674
|
+
isHovered: true,
|
|
1675
|
+
class: hextechGradientHover
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
preset: ["hextech"],
|
|
1679
|
+
isPressed: true,
|
|
1680
|
+
class: hextechGradientPressed
|
|
1681
|
+
},
|
|
1682
|
+
{
|
|
1683
|
+
preset: ["hextech"],
|
|
1684
|
+
isDisabled: true,
|
|
1685
|
+
class: hextechGradientDisabled
|
|
1686
|
+
}
|
|
1687
|
+
]
|
|
1688
|
+
});
|
|
1689
|
+
var toggleButton = tv({
|
|
1690
|
+
base: "text-lol-gold-300 font-beaufort block font-bold uppercase tracking-wide transition-colors duration-200",
|
|
1691
|
+
variants: {
|
|
1692
|
+
preset: {
|
|
1693
|
+
gold: "bg-lol-grey-300",
|
|
1694
|
+
hextech: "text-lol-blue-100 bg-lol-grey-300",
|
|
1695
|
+
dimmed: "bg-lol-grey-hextech-black"
|
|
1696
|
+
},
|
|
1697
|
+
isHovered: {
|
|
1698
|
+
true: "text-lol-gold-100"
|
|
1699
|
+
},
|
|
1700
|
+
isPressed: {
|
|
1701
|
+
true: "text-lol-grey-150"
|
|
1702
|
+
},
|
|
1703
|
+
isDisabled: {
|
|
1704
|
+
true: "text-lol-grey-150"
|
|
1705
|
+
},
|
|
1706
|
+
isFocused: {
|
|
1707
|
+
true: ""
|
|
1708
|
+
},
|
|
1709
|
+
isSelected: {
|
|
1710
|
+
true: [
|
|
1711
|
+
hextechGradient,
|
|
1712
|
+
"text-lol-blue-100 shadow-lol-grey-300 bg-gradient-to-t shadow shadow-inner"
|
|
1713
|
+
]
|
|
1714
|
+
},
|
|
1715
|
+
isFocusVisible: {
|
|
1716
|
+
true: ""
|
|
1717
|
+
},
|
|
1718
|
+
shape: {
|
|
1719
|
+
round: "rounded-full",
|
|
1720
|
+
square: "",
|
|
1721
|
+
normal: ""
|
|
1722
|
+
},
|
|
1723
|
+
thin: {
|
|
1724
|
+
true: ""
|
|
1725
|
+
}
|
|
1726
|
+
},
|
|
1727
|
+
compoundVariants: [
|
|
1728
|
+
{
|
|
1729
|
+
preset: ["gold", "hextech", "dimmed"],
|
|
1730
|
+
class: "px-4 py-2"
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
preset: ["gold", "hextech", "dimmed"],
|
|
1734
|
+
thin: true,
|
|
1735
|
+
class: "m-px"
|
|
1736
|
+
},
|
|
1737
|
+
{
|
|
1738
|
+
preset: ["gold", "hextech", "dimmed"],
|
|
1739
|
+
thin: false,
|
|
1740
|
+
class: "m-0.5"
|
|
1741
|
+
},
|
|
1742
|
+
{
|
|
1743
|
+
preset: ["hextech"],
|
|
1744
|
+
isHovered: true,
|
|
1745
|
+
class: "text-lol-blue-100"
|
|
1746
|
+
},
|
|
1747
|
+
{
|
|
1748
|
+
preset: ["hextech"],
|
|
1749
|
+
isPressed: true,
|
|
1750
|
+
class: "text-lol-blue-400"
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
preset: ["hextech"],
|
|
1754
|
+
isSelected: true,
|
|
1755
|
+
class: ""
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
shape: ["round", "square"],
|
|
1759
|
+
class: "flex aspect-square h-7 items-center justify-center p-0 font-black leading-none"
|
|
1760
|
+
}
|
|
1761
|
+
]
|
|
1762
|
+
});
|
|
1763
|
+
function ToggleButton({
|
|
1764
|
+
children,
|
|
1765
|
+
className,
|
|
1766
|
+
innerProps = {},
|
|
1767
|
+
preset = "gold",
|
|
1768
|
+
shape = "normal",
|
|
1769
|
+
thin = preset === "dimmed" ? true : false,
|
|
1770
|
+
...props
|
|
1771
|
+
}) {
|
|
1772
|
+
return /* @__PURE__ */ jsx18(
|
|
1773
|
+
AriaToggleButton,
|
|
1774
|
+
{
|
|
1775
|
+
...props,
|
|
1776
|
+
className: (values) => toggleButtonBorder({
|
|
1777
|
+
...values,
|
|
1778
|
+
preset,
|
|
1779
|
+
shape,
|
|
1780
|
+
className: resolveClassName(className, values)
|
|
1781
|
+
}),
|
|
1782
|
+
children: (values) => /* @__PURE__ */ jsx18(
|
|
1783
|
+
"span",
|
|
1784
|
+
{
|
|
1785
|
+
...innerProps,
|
|
1786
|
+
className: toggleButton({
|
|
1787
|
+
...values,
|
|
1788
|
+
preset,
|
|
1789
|
+
shape,
|
|
1790
|
+
thin,
|
|
1791
|
+
className: resolveClassName(innerProps.className, values)
|
|
1792
|
+
}),
|
|
1793
|
+
style: {
|
|
1794
|
+
// backgroundImage: hextechMagic,
|
|
1795
|
+
// backgroundPosition: "center",
|
|
1796
|
+
},
|
|
1797
|
+
children: typeof children === "function" ? children(values) : children
|
|
1798
|
+
}
|
|
1799
|
+
)
|
|
1800
|
+
}
|
|
1801
|
+
);
|
|
1802
|
+
}
|
|
1600
1803
|
export {
|
|
1601
1804
|
Accordion,
|
|
1602
1805
|
AccordionContent,
|
|
@@ -1629,6 +1832,7 @@ export {
|
|
|
1629
1832
|
Text,
|
|
1630
1833
|
TextArea,
|
|
1631
1834
|
TextField,
|
|
1835
|
+
ToggleButton,
|
|
1632
1836
|
Tooltip,
|
|
1633
1837
|
TooltipTrigger,
|
|
1634
1838
|
accordionTrigger,
|