infinity-ui-elements 1.9.6 → 1.9.8
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/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/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- 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 +180 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +181 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./components/Badge";
|
|
|
5
5
|
export * from "./components/Button";
|
|
6
6
|
export * from "./components/ButtonGroup";
|
|
7
7
|
export * from "./components/Checkbox";
|
|
8
|
+
export * from "./components/Chip";
|
|
8
9
|
export * from "./components/Counter";
|
|
9
10
|
export * from "./components/DatePicker";
|
|
10
11
|
export * from "./components/DateRangePicker";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CA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,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AAGvC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,IAAI,EACJ,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1655,6 +1655,175 @@ const Checkbox = React.forwardRef(({ label, errorText, size = "medium", validati
|
|
|
1655
1655
|
});
|
|
1656
1656
|
Checkbox.displayName = "Checkbox";
|
|
1657
1657
|
|
|
1658
|
+
const chipVariants = 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", {
|
|
1659
|
+
variants: {
|
|
1660
|
+
intent: {
|
|
1661
|
+
primary: "",
|
|
1662
|
+
positive: "",
|
|
1663
|
+
negative: "",
|
|
1664
|
+
},
|
|
1665
|
+
selection: {
|
|
1666
|
+
default: "",
|
|
1667
|
+
light: "",
|
|
1668
|
+
intense: "",
|
|
1669
|
+
},
|
|
1670
|
+
size: {
|
|
1671
|
+
xsmall: "h-[24px] px-3 gap-2 text-body-small-medium",
|
|
1672
|
+
small: "h-[28px] px-4 gap-2 text-body-medium-medium",
|
|
1673
|
+
medium: "h-[36px] px-5 gap-3 text-body-large-medium",
|
|
1674
|
+
large: "h-[44px] px-6 gap-3 text-heading-medium-medium",
|
|
1675
|
+
},
|
|
1676
|
+
isDisabled: {
|
|
1677
|
+
true: "cursor-not-allowed",
|
|
1678
|
+
false: "cursor-pointer",
|
|
1679
|
+
},
|
|
1680
|
+
},
|
|
1681
|
+
compoundVariants: [
|
|
1682
|
+
// Selection: default (neutral chip, intent influences focus ring/border)
|
|
1683
|
+
{
|
|
1684
|
+
selection: "default",
|
|
1685
|
+
class: `
|
|
1686
|
+
bg-surface-fill-neutral-intense
|
|
1687
|
+
text-action-ink-neutral-normal
|
|
1688
|
+
border-action-outline-neutral-faded
|
|
1689
|
+
hover:bg-action-fill-neutral-faded-hover
|
|
1690
|
+
hover:border-action-outline-neutral-faded-hover
|
|
1691
|
+
active:bg-action-fill-neutral-faded-activated
|
|
1692
|
+
active:border-action-outline-neutral-faded-activated
|
|
1693
|
+
disabled:bg-surface-fill-neutral-moderate
|
|
1694
|
+
disabled:text-surface-ink-neutral-disabled
|
|
1695
|
+
disabled:border-action-outline-neutral-disabled
|
|
1696
|
+
`,
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
selection: "default",
|
|
1700
|
+
intent: "primary",
|
|
1701
|
+
class: "focus-visible:ring-action-outline-primary-faded-hover focus-visible:border-action-outline-primary-faded-hover",
|
|
1702
|
+
},
|
|
1703
|
+
{
|
|
1704
|
+
selection: "default",
|
|
1705
|
+
intent: "positive",
|
|
1706
|
+
class: "focus-visible:ring-action-outline-positive-faded-hover focus-visible:border-action-outline-positive-faded-hover",
|
|
1707
|
+
},
|
|
1708
|
+
{
|
|
1709
|
+
selection: "default",
|
|
1710
|
+
intent: "negative",
|
|
1711
|
+
class: "focus-visible:ring-action-outline-negative-faded-hover focus-visible:border-action-outline-negative-faded-hover",
|
|
1712
|
+
},
|
|
1713
|
+
// Selection: light
|
|
1714
|
+
{
|
|
1715
|
+
selection: "light",
|
|
1716
|
+
intent: "primary",
|
|
1717
|
+
class: `
|
|
1718
|
+
bg-action-fill-primary-faded
|
|
1719
|
+
text-action-ink-primary-normal
|
|
1720
|
+
border-action-outline-primary-faded
|
|
1721
|
+
hover:bg-action-fill-primary-faded-hover
|
|
1722
|
+
hover:border-action-outline-primary-faded-hover
|
|
1723
|
+
active:bg-action-fill-primary-faded-activated
|
|
1724
|
+
active:border-action-outline-primary-faded-activated
|
|
1725
|
+
focus-visible:ring-action-outline-primary-faded-hover
|
|
1726
|
+
disabled:bg-action-fill-primary-disabled
|
|
1727
|
+
disabled:text-action-ink-primary-disabled
|
|
1728
|
+
disabled:border-action-outline-primary-disabled
|
|
1729
|
+
`,
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
selection: "light",
|
|
1733
|
+
intent: "positive",
|
|
1734
|
+
class: `
|
|
1735
|
+
bg-action-fill-positive-faded
|
|
1736
|
+
text-action-ink-positive-normal
|
|
1737
|
+
border-action-outline-positive-faded
|
|
1738
|
+
hover:bg-action-fill-positive-faded-hover
|
|
1739
|
+
hover:border-action-outline-positive-faded-hover
|
|
1740
|
+
active:bg-action-fill-positive-faded-activated
|
|
1741
|
+
active:border-action-outline-positive-faded-activated
|
|
1742
|
+
focus-visible:ring-action-outline-positive-faded-hover
|
|
1743
|
+
disabled:bg-action-fill-positive-disabled
|
|
1744
|
+
disabled:text-action-ink-positive-disabled
|
|
1745
|
+
disabled:border-action-outline-positive-disabled
|
|
1746
|
+
`,
|
|
1747
|
+
},
|
|
1748
|
+
{
|
|
1749
|
+
selection: "light",
|
|
1750
|
+
intent: "negative",
|
|
1751
|
+
class: `
|
|
1752
|
+
bg-action-fill-negative-faded
|
|
1753
|
+
text-action-ink-negative-normal
|
|
1754
|
+
border-action-outline-negative-faded
|
|
1755
|
+
hover:bg-action-fill-negative-faded-hover
|
|
1756
|
+
hover:border-action-outline-negative-faded-hover
|
|
1757
|
+
active:bg-action-fill-negative-faded-activated
|
|
1758
|
+
active:border-action-outline-negative-faded-activated
|
|
1759
|
+
focus-visible:ring-action-outline-negative-faded-hover
|
|
1760
|
+
disabled:bg-action-fill-negative-disabled
|
|
1761
|
+
disabled:text-action-ink-negative-disabled
|
|
1762
|
+
disabled:border-action-outline-negative-disabled
|
|
1763
|
+
`,
|
|
1764
|
+
},
|
|
1765
|
+
// Selection: intense
|
|
1766
|
+
{
|
|
1767
|
+
selection: "intense",
|
|
1768
|
+
intent: "primary",
|
|
1769
|
+
class: `
|
|
1770
|
+
bg-action-fill-primary-default
|
|
1771
|
+
text-action-ink-on-primary-normal
|
|
1772
|
+
border-transparent
|
|
1773
|
+
hover:bg-action-fill-primary-hover
|
|
1774
|
+
active:bg-action-fill-primary-activated
|
|
1775
|
+
focus-visible:ring-action-outline-primary-faded-hover
|
|
1776
|
+
disabled:bg-action-fill-primary-disabled
|
|
1777
|
+
disabled:text-action-ink-primary-disabled
|
|
1778
|
+
`,
|
|
1779
|
+
},
|
|
1780
|
+
{
|
|
1781
|
+
selection: "intense",
|
|
1782
|
+
intent: "positive",
|
|
1783
|
+
class: `
|
|
1784
|
+
bg-action-fill-positive-default
|
|
1785
|
+
text-action-ink-on-primary-normal
|
|
1786
|
+
border-transparent
|
|
1787
|
+
hover:bg-action-fill-positive-hover
|
|
1788
|
+
active:bg-action-fill-positive-activated
|
|
1789
|
+
focus-visible:ring-action-outline-positive-faded-hover
|
|
1790
|
+
disabled:bg-action-fill-positive-disabled
|
|
1791
|
+
disabled:text-action-ink-positive-disabled
|
|
1792
|
+
`,
|
|
1793
|
+
},
|
|
1794
|
+
{
|
|
1795
|
+
selection: "intense",
|
|
1796
|
+
intent: "negative",
|
|
1797
|
+
class: `
|
|
1798
|
+
bg-action-fill-negative-default
|
|
1799
|
+
text-action-ink-on-primary-normal
|
|
1800
|
+
border-transparent
|
|
1801
|
+
hover:bg-action-fill-negative-hover
|
|
1802
|
+
active:bg-action-fill-negative-activated
|
|
1803
|
+
focus-visible:ring-action-outline-negative-faded-hover
|
|
1804
|
+
disabled:bg-action-fill-negative-disabled
|
|
1805
|
+
disabled:text-action-ink-negative-disabled
|
|
1806
|
+
`,
|
|
1807
|
+
},
|
|
1808
|
+
],
|
|
1809
|
+
defaultVariants: {
|
|
1810
|
+
intent: "primary",
|
|
1811
|
+
selection: "default",
|
|
1812
|
+
size: "medium",
|
|
1813
|
+
isDisabled: false,
|
|
1814
|
+
},
|
|
1815
|
+
});
|
|
1816
|
+
const Chip = React.forwardRef(({ className, intent = "primary", selection = "default", size = "medium", isDisabled = false, leadingComponent, trailingComponent, disabled, children, type, ...props }, ref) => {
|
|
1817
|
+
const finalDisabled = Boolean(disabled || isDisabled);
|
|
1818
|
+
return (jsxs("button", { ref: ref, type: type ?? "button", disabled: finalDisabled, className: cn(chipVariants({
|
|
1819
|
+
intent,
|
|
1820
|
+
selection,
|
|
1821
|
+
size,
|
|
1822
|
+
isDisabled: finalDisabled,
|
|
1823
|
+
}), className), ...props, children: [leadingComponent && (jsx("span", { className: "inline-flex items-center", children: leadingComponent })), jsx("span", { className: "inline-flex items-center", children: children }), trailingComponent && (jsx("span", { className: "inline-flex items-center", children: trailingComponent }))] }));
|
|
1824
|
+
});
|
|
1825
|
+
Chip.displayName = "Chip";
|
|
1826
|
+
|
|
1658
1827
|
const counterVariants = cva("inline-flex items-center justify-center transition-colors", {
|
|
1659
1828
|
variants: {
|
|
1660
1829
|
size: {
|
|
@@ -2899,7 +3068,7 @@ const DateRangePicker = React.forwardRef(({ className, value: controlledValue, d
|
|
|
2899
3068
|
? `${window.innerHeight - position.bottom - gap - 10}px`
|
|
2900
3069
|
: `${position.top - gap - 10}px`,
|
|
2901
3070
|
overflowY: "auto",
|
|
2902
|
-
}, className: cn("bg-surface-fill-neutral-intense rounded-large shadow-lg border border-surface-outline-neutral-subtle", calendarClassName), onClick: (e) => e.stopPropagation(), children: jsxs("div", { className: "flex", children: [showPresets && presets.length > 0 && (jsx("div", { className: "w-
|
|
3071
|
+
}, className: cn("bg-surface-fill-neutral-intense rounded-large shadow-lg border-[0.5px] border-surface-outline-neutral-subtle", calendarClassName), onClick: (e) => e.stopPropagation(), children: jsxs("div", { className: "flex flex-col", children: [jsxs("div", { className: "flex flex-row p-7 gap-7", children: [showPresets && presets.length > 0 && (jsx("div", { className: "w-[160px] flex flex-col gap-2", children: presets.map((preset) => (jsx(ListItem, { title: preset.label, type: "single", showChevron: false, isSelected: selectedPreset === preset.value, onClick: () => handlePresetClick(preset), containerClassName: "px-4 py-3" }, preset.value))) })), jsxs("div", { className: "flex gap-7", children: [jsxs("div", { className: "flex flex-col gap-3", children: [jsx("div", { className: "flex flex-col px-3", children: jsx("p", { className: "text-body-small-medium", children: "Start Date" }) }), jsxs("div", { className: "flex flex-col p-5 rounded-[8px] bg-surface-fill-neutral-moderate", children: [jsxs("div", { className: "flex items-center justify-between mb-3 px-3", children: [jsx("h3", { className: "text-body-small-medium font-medium text-surface-ink-neutral-normal", children: formatMonthYear(startMonth) }), jsxs("div", { className: "flex items-center gap-2", children: [jsx("button", { onClick: handlePrevStartMonth, className: "p-1 hover:bg-surface-fill-neutral-faded rounded transition-colors", "aria-label": "Previous month", children: jsx(ChevronLeft, { className: "w-4 h-4 text-surface-ink-neutral-normal" }) }), jsx("button", { onClick: handleNextStartMonth, className: "p-1 hover:bg-surface-fill-neutral-faded rounded transition-colors", "aria-label": "Next month", children: jsx(ChevronRight, { className: "w-4 h-4 text-surface-ink-neutral-normal" }) })] })] }), jsx("div", { className: "date-range-calendar-wrapper", children: jsx(Calendar$1, { onChange: handleStartDateChange, value: tempValue.startDate, minDate: minDateParsed ?? undefined, maxDate: tempValue.endDate
|
|
2903
3072
|
? tempValue.endDate
|
|
2904
3073
|
: maxDateParsed ?? undefined, activeStartDate: startMonth, onActiveStartDateChange: ({ activeStartDate, }) => {
|
|
2905
3074
|
if (activeStartDate)
|
|
@@ -2931,15 +3100,15 @@ const DateRangePicker = React.forwardRef(({ className, value: controlledValue, d
|
|
|
2931
3100
|
"SAT",
|
|
2932
3101
|
];
|
|
2933
3102
|
return weekdayNames[date.getDay()];
|
|
2934
|
-
} }) })] })] })] }), jsxs("div", { className: "
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
3103
|
+
} }) })] })] })] })] }), jsxs("div", { className: "border-t-[0.5px] border-surface-outline-neutral-subtle flex px-8 py-5 items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: "w-2 h-2 rounded-full bg-action-fill-primary-default" }), jsx("span", { className: "text-sm text-surface-ink-neutral-normal", children: tempValue.startDate && tempValue.endDate
|
|
3104
|
+
? isSameDay(tempValue.startDate, tempValue.endDate)
|
|
3105
|
+
? "Today"
|
|
3106
|
+
: `${formatDate(tempValue.startDate)} - ${formatDate(tempValue.endDate)}`
|
|
3107
|
+
: tempValue.startDate
|
|
3108
|
+
? `From ${formatDate(tempValue.startDate)}`
|
|
3109
|
+
: tempValue.endDate
|
|
3110
|
+
? `Until ${formatDate(tempValue.endDate)}`
|
|
3111
|
+
: "No selection" })] }), jsxs("div", { className: "flex items-center gap-4", children: [jsx(Button, { variant: "secondary", color: "neutral", size: "small", onClick: handleCancel, children: "Cancel" }), jsx(Button, { variant: "primary", color: "primary", size: "small", onClick: handleApply, children: "Apply date range" })] })] })] }) }));
|
|
2943
3112
|
return createPortal(calendarPopup, document.body);
|
|
2944
3113
|
})()] }));
|
|
2945
3114
|
});
|
|
@@ -5953,5 +6122,5 @@ const UploadBox = React.forwardRef(({ label, helperText, errorText, successText,
|
|
|
5953
6122
|
});
|
|
5954
6123
|
UploadBox.displayName = "UploadBox";
|
|
5955
6124
|
|
|
5956
|
-
export { Alert, Amount, Avatar, AvatarCell, Badge, Button, ButtonGroup, Checkbox, Counter, DatePicker, DateRangePicker, Divider, Dropdown, DropdownMenu, FormFooter, FormHeader, Icon, IconButton, IconCell, Link, ListItem, Modal, NumberCell, Pagination, Radio, RadioGroup, SearchableDropdown, Select, SelectTextField, SidePanel, Skeleton, SlotCell, SpacerCell, Switch, TabItem, Table, TableDetailPanel, Tabs, Text, TextArea, TextField, Toast, ToastProvider, Tooltip, UploadBox, alertVariants, avatarVariants, badgeVariants, buttonGroupVariants, buttonVariants, checkboxVariants, cn, counterVariants, datePickerVariants, dateRangePickerVariants, dropdownVariants, getAvailableIcons, hasIcon, iconButtonVariants, iconRegistry, linkVariants, listItemVariants, paginationVariants, radioVariants, selectTriggerVariants, switchVariants, tableCellVariants, tableHeaderVariants, tableVariants, textAreaVariants, textFieldVariants, tooltipVariants, uploadBoxVariants, useToast };
|
|
6125
|
+
export { Alert, Amount, Avatar, AvatarCell, Badge, Button, ButtonGroup, Checkbox, Chip, Counter, DatePicker, DateRangePicker, Divider, Dropdown, DropdownMenu, FormFooter, FormHeader, Icon, IconButton, IconCell, Link, ListItem, Modal, NumberCell, Pagination, Radio, RadioGroup, SearchableDropdown, Select, SelectTextField, SidePanel, Skeleton, SlotCell, SpacerCell, Switch, TabItem, Table, TableDetailPanel, Tabs, Text, TextArea, TextField, Toast, ToastProvider, Tooltip, UploadBox, alertVariants, avatarVariants, badgeVariants, buttonGroupVariants, buttonVariants, checkboxVariants, chipVariants, cn, counterVariants, datePickerVariants, dateRangePickerVariants, dropdownVariants, getAvailableIcons, hasIcon, iconButtonVariants, iconRegistry, linkVariants, listItemVariants, paginationVariants, radioVariants, selectTriggerVariants, switchVariants, tableCellVariants, tableHeaderVariants, tableVariants, textAreaVariants, textFieldVariants, tooltipVariants, uploadBoxVariants, useToast };
|
|
5957
6126
|
//# sourceMappingURL=index.esm.js.map
|