@caratlogic/design-system 0.1.24 → 0.1.26
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/molecules/DateInput/DateInput.d.ts +1 -1
- package/dist/components/molecules/DateInput/DateInput.d.ts.map +1 -1
- package/dist/components/molecules/DateInput/DateInput.types.d.ts +7 -0
- package/dist/components/molecules/DateInput/DateInput.types.d.ts.map +1 -1
- package/dist/components/molecules/FilterSelect/FilterMultiSelect.d.ts +8 -0
- package/dist/components/molecules/FilterSelect/FilterMultiSelect.d.ts.map +1 -1
- package/dist/components/organisms/ActivityFeed/ActivityFeed.components.d.ts.map +1 -1
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -15250,7 +15250,7 @@ const isFilterActive = (value, resetValue) => !!value && value !== resetValue;
|
|
|
15250
15250
|
* `FilterSelect` trigger look (filter icon + count badge when active).
|
|
15251
15251
|
* Selecting items keeps the popover open; the trigger shows the count.
|
|
15252
15252
|
*/
|
|
15253
|
-
const FilterMultiSelect = ({ label, value, onChange, options, triggerClassName, contentClassName, }) => {
|
|
15253
|
+
const FilterMultiSelect = ({ label, value, onChange, options, triggerClassName, contentClassName, listClassName, modal = false, }) => {
|
|
15254
15254
|
const active = value.length > 0;
|
|
15255
15255
|
const toggle = (optValue) => {
|
|
15256
15256
|
if (value.includes(optValue)) {
|
|
@@ -15260,7 +15260,7 @@ const FilterMultiSelect = ({ label, value, onChange, options, triggerClassName,
|
|
|
15260
15260
|
onChange([...value, optValue]);
|
|
15261
15261
|
}
|
|
15262
15262
|
};
|
|
15263
|
-
return (jsxs(Popover, { children: [jsx(PopoverTrigger, { className: cn(TRIGGER_BASE, 'inline-flex items-center justify-between', active && TRIGGER_ACTIVE, triggerClassName), children: jsxs("span", { className: "flex items-center gap-2", children: [jsx(Funnel, { className: cn('h-4 w-4 shrink-0', active ? 'text-primary' : 'text-muted-foreground'), "aria-hidden": "true" }), label, active && (jsx("span", { className: "ml-1 inline-flex h-4 min-w-4 items-center justify-center rounded bg-primary/10 px-1 text-[10px] font-semibold leading-none text-primary", children: value.length }))] }) }), jsx(PopoverContent, { align: "start", className: cn('w-56 p-1', contentClassName), children: jsx("div", { className:
|
|
15263
|
+
return (jsxs(Popover, { modal: modal, children: [jsx(PopoverTrigger, { className: cn(TRIGGER_BASE, 'inline-flex items-center justify-between', active && TRIGGER_ACTIVE, triggerClassName), children: jsxs("span", { className: "flex items-center gap-2", children: [jsx(Funnel, { className: cn('h-4 w-4 shrink-0', active ? 'text-primary' : 'text-muted-foreground'), "aria-hidden": "true" }), label, active && (jsx("span", { className: "ml-1 inline-flex h-4 min-w-4 items-center justify-center rounded bg-primary/10 px-1 text-[10px] font-semibold leading-none text-primary", children: value.length }))] }) }), jsx(PopoverContent, { align: "start", className: cn('w-56 p-1', contentClassName), children: jsx("div", { className: cn('max-h-[18rem] overflow-y-auto', listClassName), children: options.map((opt) => {
|
|
15264
15264
|
const checked = value.includes(opt.value);
|
|
15265
15265
|
return (jsxs("button", { type: "button", onClick: () => toggle(opt.value), className: "flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-foreground hover:bg-muted/60", children: [jsx(Checkbox, { checked: checked, onCheckedChange: () => toggle(opt.value),
|
|
15266
15266
|
// Stop the inner checkbox click from double-toggling via the button.
|
|
@@ -37058,7 +37058,7 @@ styleInject(css_248z$1);
|
|
|
37058
37058
|
* Date field that can be typed or picked. The text box takes a masked
|
|
37059
37059
|
* `DD/MM/YYYY` entry; the trailing button opens the same calendar as before.
|
|
37060
37060
|
*/
|
|
37061
|
-
function DateInput({ value, onChange, onBlur, name, id, className, min, max, disabled, placeholder = DATE_FORMAT, ariaLabel, }) {
|
|
37061
|
+
function DateInput({ value, onChange, onBlur, name, id, className, min, max, disabled, placeholder = DATE_FORMAT, ariaLabel, align = 'start', }) {
|
|
37062
37062
|
const { open, text, invalid, bounds, inputRef, handleOpenChange, handleTextChange, handleKeyDown, handleTextBlur, toggleOpen, selectDate, clearDate, selectToday, } = useDateInput({ value, onChange, onBlur, min, max, disabled });
|
|
37063
37063
|
// NOTE: We drive `open` ourselves from the button's onClick instead of using
|
|
37064
37064
|
// Radix's <PopoverTrigger> toggle. When this Popover is nested inside the
|
|
@@ -37068,7 +37068,7 @@ function DateInput({ value, onChange, onBlur, name, id, className, min, max, dis
|
|
|
37068
37068
|
// source of truth — no double-fire, and it works across browsers. `modal`
|
|
37069
37069
|
// lets the open popover own pointer events above the dialog so the calendar
|
|
37070
37070
|
// (portalled to <body>) stays clickable.
|
|
37071
|
-
return (jsxs(Popover, { open: open, onOpenChange: handleOpenChange, modal: true, children: [jsx(PopoverAnchor, { asChild: true, children: jsxs("div", { "data-slot": "input", "data-empty": !value || undefined, "data-invalid": invalid || undefined, className: cn('border-input-border flex h-9 w-full min-w-0 items-center gap-2 rounded-md border bg-transparent px-3 py-1 shadow-[0_1px_2px_0_#0000000d] transition-[color,box-shadow] outline-none', 'focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]', 'data-[invalid]:border-destructive data-[invalid]:ring-destructive/20 data-[invalid]:ring-[3px]', disabled && 'cursor-not-allowed bg-muted/50 text-label', className), children: [jsx("input", { ref: inputRef, type: "text", inputMode: "numeric", autoComplete: "off", spellCheck: false, id: id, name: name, value: text, placeholder: placeholder, disabled: disabled, maxLength: DATE_FORMAT.length, "aria-label": ariaLabel, "aria-invalid": invalid || undefined, title: DATE_FORMAT_HINT, onChange: handleTextChange, onKeyDown: handleKeyDown, onBlur: handleTextBlur, className: "placeholder:text-placeholder selection:bg-primary selection:text-primary-foreground h-full min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-sm disabled:cursor-not-allowed disabled:text-label md:text-sm" }), jsx("button", { type: "button", disabled: disabled, "aria-label": CALENDAR_BUTTON_LABEL, "aria-haspopup": "dialog", "aria-expanded": open, onClick: toggleOpen, className: "-mr-1 inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-ring/50 focus-visible:ring-[2px] disabled:cursor-not-allowed", children: jsx(CalendarDays, { className: "h-4 w-4 stroke-[1.75]" }) })] }) }), jsx(PopoverContent, { align:
|
|
37071
|
+
return (jsxs(Popover, { open: open, onOpenChange: handleOpenChange, modal: true, children: [jsx(PopoverAnchor, { asChild: true, children: jsxs("div", { "data-slot": "input", "data-empty": !value || undefined, "data-invalid": invalid || undefined, className: cn('border-input-border flex h-9 w-full min-w-0 items-center gap-2 rounded-md border bg-transparent px-3 py-1 shadow-[0_1px_2px_0_#0000000d] transition-[color,box-shadow] outline-none', 'focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]', 'data-[invalid]:border-destructive data-[invalid]:ring-destructive/20 data-[invalid]:ring-[3px]', disabled && 'cursor-not-allowed bg-muted/50 text-label', className), children: [jsx("input", { ref: inputRef, type: "text", inputMode: "numeric", autoComplete: "off", spellCheck: false, id: id, name: name, value: text, placeholder: placeholder, disabled: disabled, maxLength: DATE_FORMAT.length, "aria-label": ariaLabel, "aria-invalid": invalid || undefined, title: DATE_FORMAT_HINT, onChange: handleTextChange, onKeyDown: handleKeyDown, onBlur: handleTextBlur, className: "placeholder:text-placeholder selection:bg-primary selection:text-primary-foreground h-full min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-sm disabled:cursor-not-allowed disabled:text-label md:text-sm" }), jsx("button", { type: "button", disabled: disabled, "aria-label": CALENDAR_BUTTON_LABEL, "aria-haspopup": "dialog", "aria-expanded": open, onClick: toggleOpen, className: "-mr-1 inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-ring/50 focus-visible:ring-[2px] disabled:cursor-not-allowed", children: jsx(CalendarDays, { className: "h-4 w-4 stroke-[1.75]" }) })] }) }), jsx(PopoverContent, { align: align, className: "date-range-picker-popover w-auto p-4", children: jsx(DatePicker, { inline: true, selected: value ?? null, minDate: toBoundDate(bounds.minDate), maxDate: toBoundDate(bounds.maxDate), onChange: selectDate, calendarClassName: "date-range-picker-calendar", formatWeekDay: (weekday) => weekday.slice(0, 2), renderCustomHeader: ({ monthDate, changeYear, changeMonth, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, }) => (jsx(DatePickerHeader, { monthDate: monthDate, changeYear: changeYear, changeMonth: changeMonth, decreaseMonth: decreaseMonth, increaseMonth: increaseMonth, prevMonthButtonDisabled: prevMonthButtonDisabled, nextMonthButtonDisabled: nextMonthButtonDisabled, minYear: bounds.minYear, maxYear: bounds.maxYear })), children: jsxs("div", { className: "date-range-picker-footer", children: [jsx("button", { type: "button", onClick: clearDate, className: "date-range-picker-action", children: "Clear" }), jsx("button", { type: "button", onClick: selectToday, className: "date-range-picker-action", children: "Today" })] }) }) })] }));
|
|
37072
37072
|
}
|
|
37073
37073
|
|
|
37074
37074
|
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
@@ -67846,7 +67846,7 @@ function CategoryIcon({ entry, showRail, }) {
|
|
|
67846
67846
|
return (jsxs("div", { className: "relative self-stretch", children: [jsx("span", { className: cn('relative z-10 flex size-8 items-center justify-center rounded-full', meta.iconClassName), children: jsx(Icon, { className: "size-4", "aria-hidden": "true" }) }), showRail && (jsx("span", { "aria-hidden": "true", className: "absolute top-9 -bottom-4 left-1/2 w-px -translate-x-1/2 bg-border" }))] }));
|
|
67847
67847
|
}
|
|
67848
67848
|
function ChangesTable({ changes, }) {
|
|
67849
|
-
return (jsxs("div", { className: "overflow-hidden rounded-lg border border-border bg-card", children: [jsx("p", { className: "border-b border-border px-3 py-2 text-[0.625rem] font-semibold tracking-wide text-muted-foreground uppercase", children: "What changed" }), changes.length === 0 ? (jsx("p", { className: "px-3 py-2.5 text-xs text-muted-foreground", children: "No field detail was recorded for this entry." })) : (jsxs("table", { className: "w-full text-sm", "aria-label": ACTIVITY_FEED_ARIA.changesTable, children: [jsx("thead", { children: jsxs("tr", { className: "bg-muted/40 text-left text-xs text-muted-foreground", children: [jsx("th", { scope: "col", className: "px-3 py-1.5 font-normal", children: "Field" }), jsx("th", { scope: "col", className: "px-3 py-1.5 font-normal", children: "Before" }), jsx("th", { scope: "col", className: "px-3 py-1.5 font-normal", children: "After" })] }) }), jsx("tbody", { children: changes.map((change) => (jsxs("tr", { className: "border-t border-border align-top", children: [jsx("th", { scope: "row", className: "px-3 py-2 text-left text-xs font-normal text-secondary-foreground", children: change.field }), jsx("td", { className: "px-3 py-2 text-xs text-muted-foreground
|
|
67849
|
+
return (jsxs("div", { className: "overflow-hidden rounded-lg border border-border bg-card", children: [jsx("p", { className: "border-b border-border px-3 py-2 text-[0.625rem] font-semibold tracking-wide text-muted-foreground uppercase", children: "What changed" }), changes.length === 0 ? (jsx("p", { className: "px-3 py-2.5 text-xs text-muted-foreground", children: "No field detail was recorded for this entry." })) : (jsxs("table", { className: "w-full text-sm", "aria-label": ACTIVITY_FEED_ARIA.changesTable, children: [jsx("thead", { children: jsxs("tr", { className: "bg-muted/40 text-left text-xs text-muted-foreground", children: [jsx("th", { scope: "col", className: "px-3 py-1.5 font-normal", children: "Field" }), jsx("th", { scope: "col", className: "px-3 py-1.5 font-normal", children: "Before" }), jsx("th", { scope: "col", className: "px-3 py-1.5 font-normal", children: "After" })] }) }), jsx("tbody", { children: changes.map((change) => (jsxs("tr", { className: "border-t border-border align-top", children: [jsx("th", { scope: "row", className: "px-3 py-2 text-left text-xs font-normal text-secondary-foreground", children: change.field }), jsx("td", { className: "px-3 py-2 text-xs text-muted-foreground", children: change.before ?? 'Not set' }), jsx("td", { className: "px-3 py-2 text-xs font-medium text-foreground", children: change.after ?? 'Not set' })] }, change.field))) })] }))] }));
|
|
67850
67850
|
}
|
|
67851
67851
|
function ContactCard({ contact, }) {
|
|
67852
67852
|
const name = contact.name || contact.company || contact.email || 'Unknown contact';
|