@sustaina/shared-ui 1.39.0 → 1.40.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.d.mts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +130 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +130 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2973,25 +2973,65 @@ var ConditionNumberInput = ({ row, control, onClear }) => /* @__PURE__ */ jsx(
|
|
|
2973
2973
|
}
|
|
2974
2974
|
}
|
|
2975
2975
|
);
|
|
2976
|
-
var cotton = "hover:ring-2 active:ring-0 focus-visible:ring-2 text-primary-foreground ";
|
|
2976
|
+
var cotton = "hover:ring-2 active:ring-0 focus-visible:ring-2 text-primary-foreground disabled:bg-sus-secondary-gray-5 disabled:text-sus-secondary-gray-8";
|
|
2977
|
+
var outline = "bg-none disabled:bg-none disabled:border-sus-secondary-gray-5 disabled:text-sus-secondary-gray-8";
|
|
2977
2978
|
var buttonVariants = cva(
|
|
2978
|
-
"
|
|
2979
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",
|
|
2979
2980
|
{
|
|
2980
2981
|
variants: {
|
|
2981
2982
|
variant: {
|
|
2982
|
-
default:
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2983
|
+
default: cn(
|
|
2984
|
+
cotton,
|
|
2985
|
+
"bg-sus-primary-green-9 hover:bg-sus-primary-green-8 hover:ring-sus-primary-green-8/20 focus-visible:ring-2 focus-visible:bg-sus-primary-green-8 active:bg-sus-primary-green-10 focus-visible:ring-sus-primary-green-10"
|
|
2986
|
+
),
|
|
2987
|
+
destructive: cn(
|
|
2988
|
+
cotton,
|
|
2989
|
+
"bg-sus-button-red-2 hover:bg-sus-button-red-1 hover:ring-sus-button-red-1/20 focus-visible:ring-2 active:bg-sus-button-red-3 focus-visible:bg-sus-button-red-1 focus-visible:ring-sus-button-red-3"
|
|
2990
|
+
),
|
|
2991
|
+
cancel: cn(
|
|
2992
|
+
cotton,
|
|
2993
|
+
"bg-sus-button-accent-2 hover:bg-sus-button-accent-1 hover:ring-sus-button-accent-1/20 focus-visible:ring-2 active:bg-sus-button-accent-3 focus-visible:bg-sus-button-accent-1 focus-visible:ring-sus-button-accent-3"
|
|
2994
|
+
),
|
|
2995
|
+
warning: cn(
|
|
2996
|
+
cotton,
|
|
2997
|
+
"bg-sus-button-yellow-2 hover:bg-sus-button-yellow-1 hover:ring-sus-button-yellow-1/20 focus-visible:ring-2 active:bg-sus-button-yellow-3 focus-visible:bg-sus-button-yellow-1 focus-visible:ring-sus-button-yellow-3"
|
|
2998
|
+
),
|
|
2999
|
+
cottonYellowDark: cn(
|
|
3000
|
+
cotton,
|
|
3001
|
+
"bg-sus-button-yellowdark-2 hover:bg-sus-button-yellowdark-1 hover:ring-sus-button-yellowdark-1/20 focus-visible:ring-2 active:bg-sus-button-yellowdark-3 focus-visible:bg-sus-button-yellowdark-1 focus-visible:ring-sus-button-yellowdark-3"
|
|
3002
|
+
),
|
|
3003
|
+
cottonGreen: cn(
|
|
3004
|
+
cotton,
|
|
3005
|
+
"bg-sus-button-green-2 hover:bg-sus-button-green-1 hover:ring-sus-button-green-1/20 focus-visible:ring-2 active:bg-sus-button-green-3 focus-visible:bg-sus-button-green-1 focus-visible:ring-sus-button-green-3"
|
|
3006
|
+
),
|
|
3007
|
+
cottonBlue: cn(
|
|
3008
|
+
cotton,
|
|
3009
|
+
"bg-sus-button-blue-2 hover:bg-sus-button-blue-1 hover:ring-sus-button-blue-1/20 focus-visible:ring-2 active:bg-sus-button-blue-3 focus-visible:bg-sus-button-blue-1 focus-visible:ring-sus-button-blue-3"
|
|
3010
|
+
),
|
|
3011
|
+
cottonRed: cn(
|
|
3012
|
+
cotton,
|
|
3013
|
+
"bg-sus-button-red-2 hover:bg-sus-button-red-1 hover:ring-sus-button-red-1/20 focus-visible:ring-2 active:bg-sus-button-red-3 focus-visible:bg-sus-button-red-1 focus-visible:ring-sus-button-red-3"
|
|
3014
|
+
),
|
|
3015
|
+
cottonAccent: cn(
|
|
3016
|
+
cotton,
|
|
3017
|
+
"bg-sus-button-accent-2 hover:bg-sus-button-accent-1 hover:ring-sus-button-accent-1/20 focus-visible:ring-2 active:bg-sus-button-accent-3 focus-visible:bg-sus-button-accent-1 focus-visible:ring-sus-button-accent-3"
|
|
3018
|
+
),
|
|
3019
|
+
cottonYellow: cn(
|
|
3020
|
+
cotton,
|
|
3021
|
+
"bg-sus-button-yellow-2 hover:bg-sus-button-yellow-1 hover:ring-sus-button-yellow-1/20 focus-visible:ring-2 active:bg-sus-button-yellow-3 focus-visible:bg-sus-button-yellow-1 focus-visible:ring-sus-button-yellow-3"
|
|
3022
|
+
),
|
|
3023
|
+
cottonBlack: cn(
|
|
3024
|
+
cotton,
|
|
3025
|
+
"bg-sus-button-black-2 hover:bg-sus-button-black-1 hover:ring-sus-button-black-1/20 focus-visible:ring-2 active:bg-sus-button-black-3 focus-visible:bg-sus-button-black-1 focus-visible:ring-sus-button-black-3"
|
|
3026
|
+
),
|
|
3027
|
+
defaultOutline: cn(
|
|
3028
|
+
outline,
|
|
3029
|
+
"border border-sus-primary-green-9 text-black hover:border-sus-primary-green-8 hover:text-sus-primary-green-8 active:border-sus-primary-green-9 active:text-black focus-visible:border-sus-primary-green-10 focus-visible:text-sus-primary-green-10"
|
|
3030
|
+
),
|
|
3031
|
+
destructiveOutline: cn(
|
|
3032
|
+
outline,
|
|
3033
|
+
"border border-sus-button-red-2 text-black hover:border-sus-button-red-1 hover:text-sus-button-red-1 active:border-sus-button-red-2 active:text-black focus-visible:border-sus-button-red-3 focus-visible:text-sus-button-red-3"
|
|
3034
|
+
),
|
|
2995
3035
|
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
2996
3036
|
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
2997
3037
|
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
@@ -3006,8 +3046,13 @@ var buttonVariants = cva(
|
|
|
3006
3046
|
icon: "size-9",
|
|
3007
3047
|
"icon-xs": "size-5",
|
|
3008
3048
|
"icon-sm": "size-[22px]",
|
|
3009
|
-
"icon-md": "size-
|
|
3010
|
-
"icon-lg": "size-10"
|
|
3049
|
+
"icon-md": "size-9",
|
|
3050
|
+
"icon-lg": "size-10",
|
|
3051
|
+
"icon-rounded": "size-9 rounded-full",
|
|
3052
|
+
"icon-xs-rounded": "size-5 rounded-full",
|
|
3053
|
+
"icon-sm-rounded": "size-[22px] rounded-full",
|
|
3054
|
+
"icon-md-rounded": "size-9 rounded-full",
|
|
3055
|
+
"icon-lg-rounded": "size-10 rounded-full"
|
|
3011
3056
|
},
|
|
3012
3057
|
active: {
|
|
3013
3058
|
true: "",
|
|
@@ -5290,8 +5335,9 @@ var AdvanceSearch = ({
|
|
|
5290
5335
|
/* @__PURE__ */ jsx(
|
|
5291
5336
|
Button,
|
|
5292
5337
|
{
|
|
5338
|
+
variant: "cottonAccent",
|
|
5293
5339
|
type: "button",
|
|
5294
|
-
className: "w-full
|
|
5340
|
+
className: "w-full md:w-auto md:min-w-[120px]",
|
|
5295
5341
|
onClick: () => {
|
|
5296
5342
|
clearAllRow();
|
|
5297
5343
|
setOperatorErrors({});
|
|
@@ -5305,8 +5351,9 @@ var AdvanceSearch = ({
|
|
|
5305
5351
|
/* @__PURE__ */ jsx(
|
|
5306
5352
|
Button,
|
|
5307
5353
|
{
|
|
5354
|
+
variant: "default",
|
|
5308
5355
|
type: "submit",
|
|
5309
|
-
className: "w-full
|
|
5356
|
+
className: "w-full md:w-auto md:min-w-[120px]",
|
|
5310
5357
|
"data-testid": "advsearch-btn-search",
|
|
5311
5358
|
children: "Search"
|
|
5312
5359
|
}
|
|
@@ -12730,7 +12777,70 @@ var TruncatedMouseEnterDiv = ({
|
|
|
12730
12777
|
] });
|
|
12731
12778
|
};
|
|
12732
12779
|
var truncatedMouseEnterDiv_default = TruncatedMouseEnterDiv;
|
|
12780
|
+
var TabSelect = ({
|
|
12781
|
+
items,
|
|
12782
|
+
onSelectTab,
|
|
12783
|
+
labelWrapperClassName,
|
|
12784
|
+
labelClassName,
|
|
12785
|
+
activeBorderClassName,
|
|
12786
|
+
separatorClassName,
|
|
12787
|
+
...rest
|
|
12788
|
+
}) => {
|
|
12789
|
+
const [selected, setSelected] = useState(items[0]);
|
|
12790
|
+
useEffect(() => {
|
|
12791
|
+
onSelectTab(selected.id);
|
|
12792
|
+
}, [onSelectTab, selected]);
|
|
12793
|
+
if (items.length === 0) {
|
|
12794
|
+
return null;
|
|
12795
|
+
}
|
|
12796
|
+
return /* @__PURE__ */ jsx(
|
|
12797
|
+
"div",
|
|
12798
|
+
{
|
|
12799
|
+
className: cn(
|
|
12800
|
+
"w-full h-10 px-3 flex justify-start items-center border-b border-sus-secondary-gray-3 overflow-scroll"
|
|
12801
|
+
),
|
|
12802
|
+
...rest,
|
|
12803
|
+
children: items.length > 0 ? items.map((item, index) => {
|
|
12804
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center w-fit h-full", children: [
|
|
12805
|
+
/* @__PURE__ */ jsxs(
|
|
12806
|
+
"div",
|
|
12807
|
+
{
|
|
12808
|
+
className: cn(
|
|
12809
|
+
"text-sm cursor-pointer relative h-full px-2",
|
|
12810
|
+
selected.id === item.id ? "text-sus-primary-green-9 font-bold" : "text-black font-Semibold",
|
|
12811
|
+
labelWrapperClassName
|
|
12812
|
+
),
|
|
12813
|
+
onClick: () => setSelected(item),
|
|
12814
|
+
children: [
|
|
12815
|
+
/* @__PURE__ */ jsx("span", { className: cn("inline-flex items-center h-full", labelClassName), children: item.label }),
|
|
12816
|
+
/* @__PURE__ */ jsx(
|
|
12817
|
+
"span",
|
|
12818
|
+
{
|
|
12819
|
+
className: cn(
|
|
12820
|
+
"absolute left-0 right-0 bottom-0 border-b-2",
|
|
12821
|
+
selected.id === item.id ? "border-sus-primary-green-9" : "border-transparent",
|
|
12822
|
+
activeBorderClassName
|
|
12823
|
+
)
|
|
12824
|
+
}
|
|
12825
|
+
)
|
|
12826
|
+
]
|
|
12827
|
+
},
|
|
12828
|
+
`${item}.${index}`
|
|
12829
|
+
),
|
|
12830
|
+
/* @__PURE__ */ jsx(
|
|
12831
|
+
Separator2,
|
|
12832
|
+
{
|
|
12833
|
+
hidden: index >= items.length - 1,
|
|
12834
|
+
orientation: "vertical",
|
|
12835
|
+
className: cn("h-[70%]! mx-2 bg-sus-secondary-gray-3", separatorClassName)
|
|
12836
|
+
}
|
|
12837
|
+
)
|
|
12838
|
+
] }, `key-${index}`);
|
|
12839
|
+
}) : ""
|
|
12840
|
+
}
|
|
12841
|
+
);
|
|
12842
|
+
};
|
|
12733
12843
|
|
|
12734
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionMenu, AdministrationIcon, AdvanceSearch_default as AdvanceSearch, AnalyticsIcon, application_log_default as ApplicationLogIcon, arrow_default as ArrowIcon, AuditFooter, Button, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox_default as Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CropperModal, CropperModalError, custom_action_status_default as CustomActionStatusIcon, custom_field_default as CustomFieldIcon, DIALOG_ALERT_I18N_SUBNAMESPACE, DIALOG_ALERT_TEMPLATES, DashboardIcon, DataEntryIcon, DataTable_default as DataTable, DatePicker2 as DatePicker, decrease_default as DecreaseIcon, Dialog, DialogAlert, DialogAlertProvider, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, filters_default as FiltersIcon, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormulaEditor, GridSettingsModal_default as GridSettingsModal, HamburgerMenuIcon, HandymanIcon, HeaderCell_default as HeaderCell, Image2 as Image, information_default as InformationIcon, Input, InputNumber_default as InputNumber, Label2 as Label, LookupSelect, MailIcon, MainListContainer_default as MainListContainer, ManIcon, ManagementIcon, MenuIcon, MonthPicker2 as MonthPicker, navbar_default as Navbar, not_found_default as NotFoundIcon, plus_default as PlusIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PowerIcon, PreventPageLeave_default as PreventPageLeave, QuestionIcon, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, RightPanelContainer_default as RightPanelContainer, role_default as RoleIcon, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, SetupIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, calendar_default as SuiCalendarIcon, calendar2_default as SuiCalendarIcon2, check_default as SuiCheckIcon, dots_vertical_default as SuiDotsVerticalIcon, empty_data_default as SuiEmptyDataIcon, expand_default as SuiExpandIcon, filter_default as SuiFilterIcon, setting_default as SuiSettingIcon, triangle_down_default as SuiTriangleDownIcon, warning_default as SuiWarningIcon, Switch, Textarea, ToolBoxIcon, Tooltip2 as Tooltip, TooltipArrow, TooltipContent2 as TooltipContent, TooltipProvider2 as TooltipProvider, TooltipTrigger2 as TooltipTrigger, trash_default as TrashIcon, truncated_default as Truncated, truncatedMouseEnterDiv_default as TruncatedMouseEnterDiv, ui_exports as UI, user_alone_default as UserAloneIcon, user_friend_default as UserFriendIcon, user_default as UserIcon, VirtualizedCommand_default as VirtualizedCommand, booleanToSelectValue, buildPrefixMap, buttonVariants, cn, compareAlphanumeric, debounce, defaultOperatorShortcuts, defaultOperators, formatISODate, getDialogAlertControls, inputVariants, isDefined, isEmptyObject, isValidParentheses, mapTokensToOutput, parseFormula, parseFormulaToToken, resetVisibleTableState, selectValueToBoolean, spinnerVariants, splitOperators, stripNullishObject, throttle, tokenizeFormulaString, useControllableState_default as useControllableState, useDraftGuardStore, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useIsomorphicLayoutEffect, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useSafeBlocker, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated, validateTokenPrefixes };
|
|
12844
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionMenu, AdministrationIcon, AdvanceSearch_default as AdvanceSearch, AnalyticsIcon, application_log_default as ApplicationLogIcon, arrow_default as ArrowIcon, AuditFooter, Button, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox_default as Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CropperModal, CropperModalError, custom_action_status_default as CustomActionStatusIcon, custom_field_default as CustomFieldIcon, DIALOG_ALERT_I18N_SUBNAMESPACE, DIALOG_ALERT_TEMPLATES, DashboardIcon, DataEntryIcon, DataTable_default as DataTable, DatePicker2 as DatePicker, decrease_default as DecreaseIcon, Dialog, DialogAlert, DialogAlertProvider, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, filters_default as FiltersIcon, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormulaEditor, GridSettingsModal_default as GridSettingsModal, HamburgerMenuIcon, HandymanIcon, HeaderCell_default as HeaderCell, Image2 as Image, information_default as InformationIcon, Input, InputNumber_default as InputNumber, Label2 as Label, LookupSelect, MailIcon, MainListContainer_default as MainListContainer, ManIcon, ManagementIcon, MenuIcon, MonthPicker2 as MonthPicker, navbar_default as Navbar, not_found_default as NotFoundIcon, plus_default as PlusIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PowerIcon, PreventPageLeave_default as PreventPageLeave, QuestionIcon, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, RightPanelContainer_default as RightPanelContainer, role_default as RoleIcon, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, SetupIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, calendar_default as SuiCalendarIcon, calendar2_default as SuiCalendarIcon2, check_default as SuiCheckIcon, dots_vertical_default as SuiDotsVerticalIcon, empty_data_default as SuiEmptyDataIcon, expand_default as SuiExpandIcon, filter_default as SuiFilterIcon, setting_default as SuiSettingIcon, triangle_down_default as SuiTriangleDownIcon, warning_default as SuiWarningIcon, Switch, TabSelect, Textarea, ToolBoxIcon, Tooltip2 as Tooltip, TooltipArrow, TooltipContent2 as TooltipContent, TooltipProvider2 as TooltipProvider, TooltipTrigger2 as TooltipTrigger, trash_default as TrashIcon, truncated_default as Truncated, truncatedMouseEnterDiv_default as TruncatedMouseEnterDiv, ui_exports as UI, user_alone_default as UserAloneIcon, user_friend_default as UserFriendIcon, user_default as UserIcon, VirtualizedCommand_default as VirtualizedCommand, booleanToSelectValue, buildPrefixMap, buttonVariants, cn, compareAlphanumeric, debounce, defaultOperatorShortcuts, defaultOperators, formatISODate, getDialogAlertControls, inputVariants, isDefined, isEmptyObject, isValidParentheses, mapTokensToOutput, parseFormula, parseFormulaToToken, resetVisibleTableState, selectValueToBoolean, spinnerVariants, splitOperators, stripNullishObject, throttle, tokenizeFormulaString, useControllableState_default as useControllableState, useDraftGuardStore, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useIsomorphicLayoutEffect, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useSafeBlocker, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated, validateTokenPrefixes };
|
|
12735
12845
|
//# sourceMappingURL=index.mjs.map
|
|
12736
12846
|
//# sourceMappingURL=index.mjs.map
|