@lolmath/ui 3.0.1 → 3.1.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 +200 -17
- 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 +201 -17
- 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
|
@@ -44,7 +44,7 @@ var tv = createTV({
|
|
|
44
44
|
// src/components/button.tsx
|
|
45
45
|
import { jsx } from "react/jsx-runtime";
|
|
46
46
|
var buttonBorder = tv({
|
|
47
|
-
base: "bg-gradient-to-t outline-none transition-colors duration-200",
|
|
47
|
+
base: "bg-gradient-to-t p-0.5 outline-none transition-colors duration-200",
|
|
48
48
|
variants: {
|
|
49
49
|
preset: {
|
|
50
50
|
primary: "",
|
|
@@ -72,6 +72,9 @@ var buttonBorder = tv({
|
|
|
72
72
|
},
|
|
73
73
|
isFocusVisible: {
|
|
74
74
|
true: ""
|
|
75
|
+
},
|
|
76
|
+
thin: {
|
|
77
|
+
true: "p-px"
|
|
75
78
|
}
|
|
76
79
|
},
|
|
77
80
|
compoundVariants: [
|
|
@@ -121,7 +124,7 @@ var buttonBorder = tv({
|
|
|
121
124
|
]
|
|
122
125
|
});
|
|
123
126
|
var button = tv({
|
|
124
|
-
base: "text-lol-gold-300 font-beaufort block font-bold uppercase tracking-wide transition-colors duration-200",
|
|
127
|
+
base: "text-lol-gold-300 font-beaufort block h-full w-full font-bold uppercase tracking-wide transition-colors duration-200",
|
|
125
128
|
variants: {
|
|
126
129
|
preset: {
|
|
127
130
|
primary: "from-lol-gold-600 via-lol-gold-600 to-lol-gold-700 bg-gradient-to-b",
|
|
@@ -149,9 +152,6 @@ var button = tv({
|
|
|
149
152
|
round: "rounded-full",
|
|
150
153
|
square: "",
|
|
151
154
|
normal: ""
|
|
152
|
-
},
|
|
153
|
-
thin: {
|
|
154
|
-
true: ""
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
compoundVariants: [
|
|
@@ -163,16 +163,6 @@ var button = tv({
|
|
|
163
163
|
preset: ["primary", "secondary", "hextech"],
|
|
164
164
|
class: "bg-lol-grey-300"
|
|
165
165
|
},
|
|
166
|
-
{
|
|
167
|
-
preset: ["primary", "secondary", "hextech", "dimmed"],
|
|
168
|
-
thin: true,
|
|
169
|
-
class: "m-px"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
preset: ["primary", "secondary", "hextech", "dimmed"],
|
|
173
|
-
thin: false,
|
|
174
|
-
class: "m-0.5"
|
|
175
|
-
},
|
|
176
166
|
{
|
|
177
167
|
preset: ["hextech"],
|
|
178
168
|
isHovered: true,
|
|
@@ -200,7 +190,7 @@ var button = tv({
|
|
|
200
190
|
},
|
|
201
191
|
{
|
|
202
192
|
shape: ["round", "square"],
|
|
203
|
-
class: "aspect-square p-
|
|
193
|
+
class: "flex aspect-square h-7 items-center justify-center p-0 font-black leading-none"
|
|
204
194
|
},
|
|
205
195
|
{
|
|
206
196
|
isHovered: true,
|
|
@@ -229,6 +219,7 @@ function _Button({
|
|
|
229
219
|
className: resolveClassName(className, values),
|
|
230
220
|
preset,
|
|
231
221
|
shape,
|
|
222
|
+
thin,
|
|
232
223
|
...values
|
|
233
224
|
});
|
|
234
225
|
},
|
|
@@ -240,7 +231,6 @@ function _Button({
|
|
|
240
231
|
className: resolveClassName(innerClassName, values),
|
|
241
232
|
preset,
|
|
242
233
|
shape,
|
|
243
|
-
thin,
|
|
244
234
|
...values
|
|
245
235
|
}),
|
|
246
236
|
children: typeof children === "function" ? children(values) : children
|
|
@@ -1597,6 +1587,199 @@ function Label2({
|
|
|
1597
1587
|
className: text({ preset, color, className })
|
|
1598
1588
|
});
|
|
1599
1589
|
}
|
|
1590
|
+
|
|
1591
|
+
// src/components/toggle-button.tsx
|
|
1592
|
+
import {
|
|
1593
|
+
ToggleButton as AriaToggleButton
|
|
1594
|
+
} from "react-aria-components";
|
|
1595
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1596
|
+
var toggleButtonBorder = tv({
|
|
1597
|
+
base: "bg-gradient-to-t p-0.5 outline-none transition-colors duration-200",
|
|
1598
|
+
variants: {
|
|
1599
|
+
preset: {
|
|
1600
|
+
gold: "",
|
|
1601
|
+
hextech: "",
|
|
1602
|
+
dimmed: dimmedGradient
|
|
1603
|
+
},
|
|
1604
|
+
shape: {
|
|
1605
|
+
round: "aspect-square rounded-full",
|
|
1606
|
+
square: "aspect-square",
|
|
1607
|
+
normal: ""
|
|
1608
|
+
},
|
|
1609
|
+
isHovered: {
|
|
1610
|
+
true: ""
|
|
1611
|
+
},
|
|
1612
|
+
isPressed: {
|
|
1613
|
+
true: ""
|
|
1614
|
+
},
|
|
1615
|
+
isDisabled: {
|
|
1616
|
+
true: ""
|
|
1617
|
+
},
|
|
1618
|
+
isFocused: {
|
|
1619
|
+
true: ""
|
|
1620
|
+
},
|
|
1621
|
+
isFocusVisible: {
|
|
1622
|
+
true: ""
|
|
1623
|
+
},
|
|
1624
|
+
isSelected: {
|
|
1625
|
+
true: ""
|
|
1626
|
+
},
|
|
1627
|
+
thin: {
|
|
1628
|
+
true: "p-px"
|
|
1629
|
+
}
|
|
1630
|
+
},
|
|
1631
|
+
compoundVariants: [
|
|
1632
|
+
{
|
|
1633
|
+
preset: ["dimmed"],
|
|
1634
|
+
isSelected: true,
|
|
1635
|
+
class: [goldGradient]
|
|
1636
|
+
},
|
|
1637
|
+
{
|
|
1638
|
+
preset: ["gold"],
|
|
1639
|
+
class: goldGradient
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
preset: ["gold", "dimmed"],
|
|
1643
|
+
isHovered: true,
|
|
1644
|
+
class: goldGradientHover
|
|
1645
|
+
},
|
|
1646
|
+
{
|
|
1647
|
+
preset: ["gold", "dimmed"],
|
|
1648
|
+
isPressed: true,
|
|
1649
|
+
class: goldGradientPressed
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
preset: ["gold", "dimmed"],
|
|
1653
|
+
isDisabled: true,
|
|
1654
|
+
class: goldGradientDisabled
|
|
1655
|
+
},
|
|
1656
|
+
{
|
|
1657
|
+
preset: ["gold"],
|
|
1658
|
+
isFocusVisible: true,
|
|
1659
|
+
class: "outline outline-offset-2 outline-yellow-50"
|
|
1660
|
+
},
|
|
1661
|
+
{
|
|
1662
|
+
preset: ["hextech"],
|
|
1663
|
+
class: hextechGradient
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
preset: ["hextech"],
|
|
1667
|
+
isHovered: true,
|
|
1668
|
+
class: hextechGradientHover
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
preset: ["hextech"],
|
|
1672
|
+
isPressed: true,
|
|
1673
|
+
class: hextechGradientPressed
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
preset: ["hextech"],
|
|
1677
|
+
isDisabled: true,
|
|
1678
|
+
class: hextechGradientDisabled
|
|
1679
|
+
}
|
|
1680
|
+
]
|
|
1681
|
+
});
|
|
1682
|
+
var toggleButton = tv({
|
|
1683
|
+
base: "text-lol-gold-300 font-beaufort block font-bold uppercase tracking-wide transition-colors duration-200",
|
|
1684
|
+
variants: {
|
|
1685
|
+
preset: {
|
|
1686
|
+
gold: "bg-lol-grey-300",
|
|
1687
|
+
hextech: "text-lol-blue-100 bg-lol-grey-300",
|
|
1688
|
+
dimmed: "bg-lol-grey-hextech-black"
|
|
1689
|
+
},
|
|
1690
|
+
isHovered: {
|
|
1691
|
+
true: "text-lol-gold-100"
|
|
1692
|
+
},
|
|
1693
|
+
isPressed: {
|
|
1694
|
+
true: "text-lol-grey-150"
|
|
1695
|
+
},
|
|
1696
|
+
isDisabled: {
|
|
1697
|
+
true: "text-lol-grey-150"
|
|
1698
|
+
},
|
|
1699
|
+
isFocused: {
|
|
1700
|
+
true: ""
|
|
1701
|
+
},
|
|
1702
|
+
isSelected: {
|
|
1703
|
+
true: [
|
|
1704
|
+
hextechGradient,
|
|
1705
|
+
"text-lol-blue-100 shadow-lol-grey-300 bg-gradient-to-t shadow shadow-inner"
|
|
1706
|
+
]
|
|
1707
|
+
},
|
|
1708
|
+
isFocusVisible: {
|
|
1709
|
+
true: ""
|
|
1710
|
+
},
|
|
1711
|
+
shape: {
|
|
1712
|
+
round: "rounded-full",
|
|
1713
|
+
square: "",
|
|
1714
|
+
normal: ""
|
|
1715
|
+
}
|
|
1716
|
+
},
|
|
1717
|
+
compoundVariants: [
|
|
1718
|
+
{
|
|
1719
|
+
preset: ["gold", "hextech", "dimmed"],
|
|
1720
|
+
class: "px-4 py-2"
|
|
1721
|
+
},
|
|
1722
|
+
{
|
|
1723
|
+
preset: ["hextech"],
|
|
1724
|
+
isHovered: true,
|
|
1725
|
+
class: "text-lol-blue-100"
|
|
1726
|
+
},
|
|
1727
|
+
{
|
|
1728
|
+
preset: ["hextech"],
|
|
1729
|
+
isPressed: true,
|
|
1730
|
+
class: "text-lol-blue-400"
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
preset: ["hextech"],
|
|
1734
|
+
isSelected: true,
|
|
1735
|
+
class: ""
|
|
1736
|
+
},
|
|
1737
|
+
{
|
|
1738
|
+
shape: ["round", "square"],
|
|
1739
|
+
class: "flex aspect-square h-7 items-center justify-center p-0 font-black leading-none"
|
|
1740
|
+
}
|
|
1741
|
+
]
|
|
1742
|
+
});
|
|
1743
|
+
function ToggleButton({
|
|
1744
|
+
children,
|
|
1745
|
+
className,
|
|
1746
|
+
innerProps = {},
|
|
1747
|
+
preset = "gold",
|
|
1748
|
+
shape = "normal",
|
|
1749
|
+
thin = preset === "dimmed" ? true : false,
|
|
1750
|
+
...props
|
|
1751
|
+
}) {
|
|
1752
|
+
return /* @__PURE__ */ jsx18(
|
|
1753
|
+
AriaToggleButton,
|
|
1754
|
+
{
|
|
1755
|
+
...props,
|
|
1756
|
+
className: (values) => toggleButtonBorder({
|
|
1757
|
+
...values,
|
|
1758
|
+
preset,
|
|
1759
|
+
shape,
|
|
1760
|
+
thin,
|
|
1761
|
+
className: resolveClassName(className, values)
|
|
1762
|
+
}),
|
|
1763
|
+
children: (values) => /* @__PURE__ */ jsx18(
|
|
1764
|
+
"span",
|
|
1765
|
+
{
|
|
1766
|
+
...innerProps,
|
|
1767
|
+
className: toggleButton({
|
|
1768
|
+
...values,
|
|
1769
|
+
preset,
|
|
1770
|
+
shape,
|
|
1771
|
+
className: resolveClassName(innerProps.className, values)
|
|
1772
|
+
}),
|
|
1773
|
+
style: {
|
|
1774
|
+
// backgroundImage: hextechMagic,
|
|
1775
|
+
// backgroundPosition: "center",
|
|
1776
|
+
},
|
|
1777
|
+
children: typeof children === "function" ? children(values) : children
|
|
1778
|
+
}
|
|
1779
|
+
)
|
|
1780
|
+
}
|
|
1781
|
+
);
|
|
1782
|
+
}
|
|
1600
1783
|
export {
|
|
1601
1784
|
Accordion,
|
|
1602
1785
|
AccordionContent,
|
|
@@ -1629,6 +1812,7 @@ export {
|
|
|
1629
1812
|
Text,
|
|
1630
1813
|
TextArea,
|
|
1631
1814
|
TextField,
|
|
1815
|
+
ToggleButton,
|
|
1632
1816
|
Tooltip,
|
|
1633
1817
|
TooltipTrigger,
|
|
1634
1818
|
accordionTrigger,
|