@eml-payments/ui-kit 1.1.4 → 1.1.6

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.
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useRef, useState } from 'react';
3
3
  import { cn } from '../../lib/utils';
4
- export function Counter({ to, from = 0, duration = 2, autoStart = true, prefix = '', suffix = '', decimals = 0, separator = ',', className, style, onComplete, triggerOnVisible = false, }) {
4
+ export function Counter({ to, from = 0, duration = 1.2, autoStart = true, prefix = '', suffix = '', decimals = 0, separator = ',', className, style, onComplete, triggerOnVisible = false, }) {
5
5
  const counterRef = useRef(null);
6
6
  const [isVisible, setIsVisible] = useState(false);
7
7
  const [hasStarted, setHasStarted] = useState(false);
@@ -14,7 +14,7 @@ const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) =>
14
14
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
15
15
  const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, "aria-label": "Scroll down", className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: _jsx(IoMdArrowDropdown, { className: "h-4 w-4" }) })));
16
16
  SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
17
- const SelectContent = React.forwardRef(({ className, children, position = 'popper', disableSearch = false, searchPlaceholder = 'Search...', ...props }, ref) => {
17
+ const SelectContent = React.forwardRef(({ className, children, position = 'popper', showAlwaysSearch = false, searchPlaceholder = 'Search...', ...props }, ref) => {
18
18
  const [searchValue, setSearchValue] = React.useState('');
19
19
  const searchRef = React.useRef(null);
20
20
  const viewportRef = React.useRef(null);
@@ -38,7 +38,7 @@ const SelectContent = React.forwardRef(({ className, children, position = 'poppe
38
38
  countItems(children);
39
39
  return count;
40
40
  }, [children]);
41
- const shouldShowSearch = !disableSearch && totalItems > 7;
41
+ const shouldShowSearch = showAlwaysSearch || totalItems > 7;
42
42
  const handleSearchChange = (value) => {
43
43
  setSearchValue(value);
44
44
  setTimeout(() => {
@@ -9,4 +9,4 @@ export declare const WithLabel: Story;
9
9
  export declare const Size: Story;
10
10
  export declare const WithError: Story;
11
11
  export declare const WithManyOptions: Story;
12
- export declare const WithSearchDisabled: Story;
12
+ export declare const WithSearchEnabled: Story;
@@ -34,6 +34,6 @@ export const WithError = {
34
34
  export const WithManyOptions = {
35
35
  render: (args) => (_jsxs(Select, { ...args, children: [_jsx(SelectTrigger, { className: "w-[320px]", children: _jsx(SelectValue, { placeholder: "Select a fruit..." }) }), _jsxs(SelectContent, { searchPlaceholder: "Search fruits...", children: [_jsx(SelectScrollUpButton, { children: _jsx(FaChevronUp, { className: "h-4 w-4" }) }), _jsx(SelectScrollDownButton, { children: _jsx(FaChevronDown, { className: "h-4 w-4" }) }), _jsxs(SelectGroup, { children: [_jsx(SelectItem, { value: "apple", children: "Apple" }), _jsx(SelectItem, { value: "banana", children: "Banana" }), _jsx(SelectItem, { value: "orange", children: "Orange" }), _jsx(SelectItem, { value: "grape", children: "Grape" }), _jsx(SelectItem, { value: "pineapple", children: "Pineapple" }), _jsx(SelectItem, { value: "strawberry", children: "Strawberry" }), _jsx(SelectItem, { value: "mango", children: "Mango" }), _jsx(SelectItem, { value: "watermelon", children: "Watermelon" }), _jsx(SelectItem, { value: "kiwi", children: "Kiwi" }), _jsx(SelectItem, { value: "blueberry", children: "Blueberry" })] })] })] })),
36
36
  };
37
- export const WithSearchDisabled = {
38
- render: (args) => (_jsxs(Select, { ...args, children: [_jsx(SelectTrigger, { className: "w-[320px]", children: _jsx(SelectValue, { placeholder: "Select a fruit..." }) }), _jsxs(SelectContent, { disableSearch: true, children: [_jsx(SelectScrollUpButton, { children: _jsx(FaChevronUp, { className: "h-4 w-4" }) }), _jsx(SelectScrollDownButton, { children: _jsx(FaChevronDown, { className: "h-4 w-4" }) }), _jsxs(SelectGroup, { children: [_jsx(SelectItem, { value: "apple", children: "Apple" }), _jsx(SelectItem, { value: "banana", children: "Banana" }), _jsx(SelectItem, { value: "orange", children: "Orange" }), _jsx(SelectItem, { value: "grape", children: "Grape" }), _jsx(SelectItem, { value: "pineapple", children: "Pineapple" }), _jsx(SelectItem, { value: "strawberry", children: "Strawberry" }), _jsx(SelectItem, { value: "mango", children: "Mango" }), _jsx(SelectItem, { value: "watermelon", children: "Watermelon" }), _jsx(SelectItem, { value: "kiwi", children: "Kiwi" }), _jsx(SelectItem, { value: "blueberry", children: "Blueberry" })] })] })] })),
37
+ export const WithSearchEnabled = {
38
+ render: (args) => (_jsxs(Select, { ...args, children: [_jsx(SelectTrigger, { className: "w-[320px]", children: _jsx(SelectValue, { placeholder: "Select a fruit..." }) }), _jsxs(SelectContent, { showAlwaysSearch: true, children: [_jsx(SelectScrollUpButton, { children: _jsx(FaChevronUp, { className: "h-4 w-4" }) }), _jsx(SelectScrollDownButton, { children: _jsx(FaChevronDown, { className: "h-4 w-4" }) }), _jsxs(SelectGroup, { children: [_jsx(SelectItem, { value: "apple", children: "Apple" }), _jsx(SelectItem, { value: "banana", children: "Banana" })] })] })] })),
39
39
  };
@@ -10,6 +10,6 @@ export interface SelectTriggerProps extends ComponentProps<typeof ShadCNSelectTr
10
10
  size?: 'sm' | 'md';
11
11
  }
12
12
  export interface SelectContentProps extends ComponentProps<typeof ShadCNSelectContent> {
13
- disableSearch?: boolean;
13
+ showAlwaysSearch?: boolean;
14
14
  searchPlaceholder?: string;
15
15
  }
@@ -12,7 +12,7 @@ export const Default = {
12
12
  render: () => (_jsx(TooltipStoryWrapper, { content: "Simple tooltip", children: _jsx(Button, { children: "Hover me" }) })),
13
13
  };
14
14
  export const LongTextResponsive = {
15
- render: () => (_jsx(TooltipStoryWrapper, { content: "This tooltip contains a longer message that wraps gracefully across multiple lines. On smaller\n\t\tscreens, it narrows and stacks vertically so it's easier to read\u2014especially useful for\n\t\taccessibility, mobile devices, or multi-language support.", side: "top", children: _jsx(Button, { children: "Hover me" }) })),
15
+ render: () => (_jsx(TooltipStoryWrapper, { content: "This tooltip contains a longer message that wraps gracefully across multiple lines. On smaller\r\n\t\tscreens, it narrows and stacks vertically so it's easier to read\u2014especially useful for\r\n\t\taccessibility, mobile devices, or multi-language support.", side: "top", children: _jsx(Button, { children: "Hover me" }) })),
16
16
  };
17
17
  export const OnDifferentSides = {
18
18
  render: () => (_jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx(TooltipStoryWrapper, { content: "Top tooltip", side: "top", children: _jsx(Button, { children: "Top" }) }), _jsx(TooltipStoryWrapper, { content: "Bottom tooltip", side: "bottom", children: _jsx(Button, { children: "Bottom" }) }), _jsx(TooltipStoryWrapper, { content: "Left tooltip", side: "left", children: _jsx(Button, { children: "Left" }) }), _jsx(TooltipStoryWrapper, { content: "Right tooltip", side: "right", children: _jsx(Button, { children: "Right" }) })] })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eml-payments/ui-kit",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "private": false,
5
5
  "description": "ARLO UIKit",
6
6
  "homepage": "https://github.com/EML-Payments/arlo.npm.uikit#readme",