infinity-ui-elements 1.9.7 → 1.9.9
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/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Chip/Chip.d.ts +40 -0
- package/dist/components/Chip/Chip.d.ts.map +1 -0
- package/dist/components/Chip/Chip.stories.d.ts +12 -0
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -0
- package/dist/components/Chip/index.d.ts +3 -0
- package/dist/components/Chip/index.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +171 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +172 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -519,7 +519,7 @@ const Button = React__namespace.forwardRef(({ className, variant = "primary", co
|
|
|
519
519
|
}
|
|
520
520
|
return `var(--color-action-ink-${color}-normal)`;
|
|
521
521
|
};
|
|
522
|
-
const buttonContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isLoading && !isIconOnly && (jsxRuntime.jsx(reactSpinners.PulseLoader, { color: getLoaderColor(), size: 10 })), isLoading && isIconOnly && (jsxRuntime.jsx(reactSpinners.ClipLoader, { color: getLoaderColor(), size: 20 })), !isLoading && leadingIcon &&
|
|
522
|
+
const buttonContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isLoading && !isIconOnly && (jsxRuntime.jsx(reactSpinners.PulseLoader, { color: getLoaderColor(), size: 10 })), isLoading && isIconOnly && (jsxRuntime.jsx(reactSpinners.ClipLoader, { color: getLoaderColor(), size: 20 })), !isLoading && leadingIcon && jsxRuntime.jsx("span", { children: leadingIcon }), !isIconOnly && !isLoading && children, isIconOnly && !isLoading && children, !isLoading && trailingIcon && jsxRuntime.jsx("span", { children: trailingIcon })] }));
|
|
523
523
|
return (jsxRuntime.jsx(Comp, { className: cn(buttonVariants({
|
|
524
524
|
variant,
|
|
525
525
|
color,
|
|
@@ -1676,6 +1676,175 @@ const Checkbox = React__namespace.forwardRef(({ label, errorText, size = "medium
|
|
|
1676
1676
|
});
|
|
1677
1677
|
Checkbox.displayName = "Checkbox";
|
|
1678
1678
|
|
|
1679
|
+
const chipVariants = classVarianceAuthority.cva("inline-flex items-center justify-center whitespace-nowrap rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none", {
|
|
1680
|
+
variants: {
|
|
1681
|
+
intent: {
|
|
1682
|
+
primary: "",
|
|
1683
|
+
positive: "",
|
|
1684
|
+
negative: "",
|
|
1685
|
+
},
|
|
1686
|
+
selection: {
|
|
1687
|
+
default: "",
|
|
1688
|
+
light: "",
|
|
1689
|
+
intense: "",
|
|
1690
|
+
},
|
|
1691
|
+
size: {
|
|
1692
|
+
xsmall: "h-[24px] px-3 gap-2 text-body-small-medium",
|
|
1693
|
+
small: "h-[28px] px-4 gap-2 text-body-medium-medium",
|
|
1694
|
+
medium: "h-[36px] px-5 gap-3 text-body-large-medium",
|
|
1695
|
+
large: "h-[44px] px-6 gap-3 text-heading-medium-medium",
|
|
1696
|
+
},
|
|
1697
|
+
isDisabled: {
|
|
1698
|
+
true: "cursor-not-allowed",
|
|
1699
|
+
false: "cursor-pointer",
|
|
1700
|
+
},
|
|
1701
|
+
},
|
|
1702
|
+
compoundVariants: [
|
|
1703
|
+
// Selection: default (neutral chip, intent influences focus ring/border)
|
|
1704
|
+
{
|
|
1705
|
+
selection: "default",
|
|
1706
|
+
class: `
|
|
1707
|
+
bg-surface-fill-neutral-intense
|
|
1708
|
+
text-action-ink-neutral-normal
|
|
1709
|
+
border-action-outline-neutral-faded
|
|
1710
|
+
hover:bg-action-fill-neutral-faded-hover
|
|
1711
|
+
hover:border-action-outline-neutral-faded-hover
|
|
1712
|
+
active:bg-action-fill-neutral-faded-activated
|
|
1713
|
+
active:border-action-outline-neutral-faded-activated
|
|
1714
|
+
disabled:bg-surface-fill-neutral-moderate
|
|
1715
|
+
disabled:text-surface-ink-neutral-disabled
|
|
1716
|
+
disabled:border-action-outline-neutral-disabled
|
|
1717
|
+
`,
|
|
1718
|
+
},
|
|
1719
|
+
{
|
|
1720
|
+
selection: "default",
|
|
1721
|
+
intent: "primary",
|
|
1722
|
+
class: "focus-visible:ring-action-outline-primary-faded-hover focus-visible:border-action-outline-primary-faded-hover",
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
selection: "default",
|
|
1726
|
+
intent: "positive",
|
|
1727
|
+
class: "focus-visible:ring-action-outline-positive-faded-hover focus-visible:border-action-outline-positive-faded-hover",
|
|
1728
|
+
},
|
|
1729
|
+
{
|
|
1730
|
+
selection: "default",
|
|
1731
|
+
intent: "negative",
|
|
1732
|
+
class: "focus-visible:ring-action-outline-negative-faded-hover focus-visible:border-action-outline-negative-faded-hover",
|
|
1733
|
+
},
|
|
1734
|
+
// Selection: light
|
|
1735
|
+
{
|
|
1736
|
+
selection: "light",
|
|
1737
|
+
intent: "primary",
|
|
1738
|
+
class: `
|
|
1739
|
+
bg-action-fill-primary-faded
|
|
1740
|
+
text-action-ink-primary-normal
|
|
1741
|
+
border-action-outline-primary-faded
|
|
1742
|
+
hover:bg-action-fill-primary-faded-hover
|
|
1743
|
+
hover:border-action-outline-primary-faded-hover
|
|
1744
|
+
active:bg-action-fill-primary-faded-activated
|
|
1745
|
+
active:border-action-outline-primary-faded-activated
|
|
1746
|
+
focus-visible:ring-action-outline-primary-faded-hover
|
|
1747
|
+
disabled:bg-action-fill-primary-disabled
|
|
1748
|
+
disabled:text-action-ink-primary-disabled
|
|
1749
|
+
disabled:border-action-outline-primary-disabled
|
|
1750
|
+
`,
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
selection: "light",
|
|
1754
|
+
intent: "positive",
|
|
1755
|
+
class: `
|
|
1756
|
+
bg-action-fill-positive-faded
|
|
1757
|
+
text-action-ink-positive-normal
|
|
1758
|
+
border-action-outline-positive-faded
|
|
1759
|
+
hover:bg-action-fill-positive-faded-hover
|
|
1760
|
+
hover:border-action-outline-positive-faded-hover
|
|
1761
|
+
active:bg-action-fill-positive-faded-activated
|
|
1762
|
+
active:border-action-outline-positive-faded-activated
|
|
1763
|
+
focus-visible:ring-action-outline-positive-faded-hover
|
|
1764
|
+
disabled:bg-action-fill-positive-disabled
|
|
1765
|
+
disabled:text-action-ink-positive-disabled
|
|
1766
|
+
disabled:border-action-outline-positive-disabled
|
|
1767
|
+
`,
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
selection: "light",
|
|
1771
|
+
intent: "negative",
|
|
1772
|
+
class: `
|
|
1773
|
+
bg-action-fill-negative-faded
|
|
1774
|
+
text-action-ink-negative-normal
|
|
1775
|
+
border-action-outline-negative-faded
|
|
1776
|
+
hover:bg-action-fill-negative-faded-hover
|
|
1777
|
+
hover:border-action-outline-negative-faded-hover
|
|
1778
|
+
active:bg-action-fill-negative-faded-activated
|
|
1779
|
+
active:border-action-outline-negative-faded-activated
|
|
1780
|
+
focus-visible:ring-action-outline-negative-faded-hover
|
|
1781
|
+
disabled:bg-action-fill-negative-disabled
|
|
1782
|
+
disabled:text-action-ink-negative-disabled
|
|
1783
|
+
disabled:border-action-outline-negative-disabled
|
|
1784
|
+
`,
|
|
1785
|
+
},
|
|
1786
|
+
// Selection: intense
|
|
1787
|
+
{
|
|
1788
|
+
selection: "intense",
|
|
1789
|
+
intent: "primary",
|
|
1790
|
+
class: `
|
|
1791
|
+
bg-action-fill-primary-default
|
|
1792
|
+
text-action-ink-on-primary-normal
|
|
1793
|
+
border-transparent
|
|
1794
|
+
hover:bg-action-fill-primary-hover
|
|
1795
|
+
active:bg-action-fill-primary-activated
|
|
1796
|
+
focus-visible:ring-action-outline-primary-faded-hover
|
|
1797
|
+
disabled:bg-action-fill-primary-disabled
|
|
1798
|
+
disabled:text-action-ink-primary-disabled
|
|
1799
|
+
`,
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
selection: "intense",
|
|
1803
|
+
intent: "positive",
|
|
1804
|
+
class: `
|
|
1805
|
+
bg-action-fill-positive-default
|
|
1806
|
+
text-action-ink-on-primary-normal
|
|
1807
|
+
border-transparent
|
|
1808
|
+
hover:bg-action-fill-positive-hover
|
|
1809
|
+
active:bg-action-fill-positive-activated
|
|
1810
|
+
focus-visible:ring-action-outline-positive-faded-hover
|
|
1811
|
+
disabled:bg-action-fill-positive-disabled
|
|
1812
|
+
disabled:text-action-ink-positive-disabled
|
|
1813
|
+
`,
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
selection: "intense",
|
|
1817
|
+
intent: "negative",
|
|
1818
|
+
class: `
|
|
1819
|
+
bg-action-fill-negative-default
|
|
1820
|
+
text-action-ink-on-primary-normal
|
|
1821
|
+
border-transparent
|
|
1822
|
+
hover:bg-action-fill-negative-hover
|
|
1823
|
+
active:bg-action-fill-negative-activated
|
|
1824
|
+
focus-visible:ring-action-outline-negative-faded-hover
|
|
1825
|
+
disabled:bg-action-fill-negative-disabled
|
|
1826
|
+
disabled:text-action-ink-negative-disabled
|
|
1827
|
+
`,
|
|
1828
|
+
},
|
|
1829
|
+
],
|
|
1830
|
+
defaultVariants: {
|
|
1831
|
+
intent: "primary",
|
|
1832
|
+
selection: "default",
|
|
1833
|
+
size: "medium",
|
|
1834
|
+
isDisabled: false,
|
|
1835
|
+
},
|
|
1836
|
+
});
|
|
1837
|
+
const Chip = React__namespace.forwardRef(({ className, intent = "primary", selection = "default", size = "medium", isDisabled = false, leadingComponent, trailingComponent, disabled, children, type, ...props }, ref) => {
|
|
1838
|
+
const finalDisabled = Boolean(disabled || isDisabled);
|
|
1839
|
+
return (jsxRuntime.jsxs("button", { ref: ref, type: type ?? "button", disabled: finalDisabled, className: cn(chipVariants({
|
|
1840
|
+
intent,
|
|
1841
|
+
selection,
|
|
1842
|
+
size,
|
|
1843
|
+
isDisabled: finalDisabled,
|
|
1844
|
+
}), className), ...props, children: [leadingComponent && (jsxRuntime.jsx("span", { className: "inline-flex items-center", children: leadingComponent })), jsxRuntime.jsx("span", { className: "inline-flex items-center", children: children }), trailingComponent && (jsxRuntime.jsx("span", { className: "inline-flex items-center", children: trailingComponent }))] }));
|
|
1845
|
+
});
|
|
1846
|
+
Chip.displayName = "Chip";
|
|
1847
|
+
|
|
1679
1848
|
const counterVariants = classVarianceAuthority.cva("inline-flex items-center justify-center transition-colors", {
|
|
1680
1849
|
variants: {
|
|
1681
1850
|
size: {
|
|
@@ -5982,6 +6151,7 @@ exports.Badge = Badge;
|
|
|
5982
6151
|
exports.Button = Button;
|
|
5983
6152
|
exports.ButtonGroup = ButtonGroup;
|
|
5984
6153
|
exports.Checkbox = Checkbox;
|
|
6154
|
+
exports.Chip = Chip;
|
|
5985
6155
|
exports.Counter = Counter;
|
|
5986
6156
|
exports.DatePicker = DatePicker;
|
|
5987
6157
|
exports.DateRangePicker = DateRangePicker;
|
|
@@ -6025,6 +6195,7 @@ exports.badgeVariants = badgeVariants;
|
|
|
6025
6195
|
exports.buttonGroupVariants = buttonGroupVariants;
|
|
6026
6196
|
exports.buttonVariants = buttonVariants;
|
|
6027
6197
|
exports.checkboxVariants = checkboxVariants;
|
|
6198
|
+
exports.chipVariants = chipVariants;
|
|
6028
6199
|
exports.cn = cn;
|
|
6029
6200
|
exports.counterVariants = counterVariants;
|
|
6030
6201
|
exports.datePickerVariants = datePickerVariants;
|