@eml-payments/ui-kit 1.2.7 → 1.2.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.
Files changed (35) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/src/components/Alert/Alert.js +8 -15
  3. package/dist/src/components/Button/Button.types.d.ts +1 -1
  4. package/dist/src/components/Button/index.d.ts +2 -1
  5. package/dist/src/components/Button/index.js +2 -1
  6. package/dist/src/components/Calendar/Calendar.d.ts +9 -0
  7. package/dist/src/components/Calendar/Calendar.js +71 -0
  8. package/dist/src/components/Calendar/Calendar.stories.d.ts +14 -0
  9. package/dist/src/components/Calendar/Calendar.stories.js +98 -0
  10. package/dist/src/components/Calendar/index.d.ts +1 -0
  11. package/dist/src/components/Calendar/index.js +1 -0
  12. package/dist/src/components/DatePicker/DatePicker.d.ts +11 -0
  13. package/dist/src/components/DatePicker/DatePicker.js +37 -0
  14. package/dist/src/components/DatePicker/DatePicker.stories.d.ts +8 -0
  15. package/dist/src/components/DatePicker/DatePicker.stories.js +75 -0
  16. package/dist/src/components/DatePicker/index.d.ts +1 -0
  17. package/dist/src/components/DatePicker/index.js +1 -0
  18. package/dist/src/components/Input/Input.js +2 -2
  19. package/dist/src/components/Input/Input.stories.d.ts +1 -0
  20. package/dist/src/components/Input/Input.stories.js +7 -0
  21. package/dist/src/components/Input/Input.types.d.ts +1 -0
  22. package/dist/src/components/Popover/Popover.d.ts +7 -0
  23. package/dist/src/components/Popover/Popover.js +10 -0
  24. package/dist/src/components/Popover/Popover.stories.d.ts +9 -0
  25. package/dist/src/components/Popover/Popover.stories.js +58 -0
  26. package/dist/src/components/Popover/index.d.ts +1 -0
  27. package/dist/src/components/Popover/index.js +1 -0
  28. package/dist/src/components/Table/hooks/useTableController.d.ts +2 -2
  29. package/dist/src/utils/dayjs.d.ts +2 -0
  30. package/dist/src/utils/dayjs.js +12 -0
  31. package/dist/src/utils/index.d.ts +2 -0
  32. package/dist/src/utils/index.js +2 -0
  33. package/package.json +9 -4
  34. package/dist/index.d.cts +0 -488
  35. package/dist/index.d.ts +0 -488
@@ -0,0 +1,75 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DatePicker } from './DatePicker';
3
+ const meta = {
4
+ title: 'UIKit/DatePicker',
5
+ component: DatePicker,
6
+ tags: ['autodocs'],
7
+ parameters: {
8
+ docs: {
9
+ description: {
10
+ component: 'A date picker component built with Input, Calendar and Popover components.',
11
+ },
12
+ },
13
+ },
14
+ argTypes: {
15
+ placeholder: {
16
+ control: 'text',
17
+ description: 'Placeholder text for the input field',
18
+ },
19
+ label: {
20
+ control: 'text',
21
+ description: 'Label text above the input field',
22
+ },
23
+ dateFormat: {
24
+ control: 'select',
25
+ options: ['DD/MM/YYYY', 'MM/DD/YYYY', 'YYYY-MM-DD', 'DD-MM-YYYY'],
26
+ description: 'Format for displaying and parsing dates',
27
+ },
28
+ currentDate: {
29
+ control: 'date',
30
+ description: 'Initial date value',
31
+ },
32
+ onChangeDate: {
33
+ action: 'dateChanged',
34
+ description: 'Callback fired when date changes',
35
+ },
36
+ },
37
+ args: {
38
+ placeholder: 'DD/MM/YYYY',
39
+ dateFormat: 'DD/MM/YYYY',
40
+ },
41
+ };
42
+ export default meta;
43
+ export const Default = {
44
+ parameters: {
45
+ docs: {
46
+ description: {
47
+ story: 'Basic date picker with input field that supports both typing and calendar selection. Use the controls below to customize the component.',
48
+ },
49
+ },
50
+ },
51
+ };
52
+ export const WithLabel = {
53
+ args: {
54
+ label: 'Select Date',
55
+ },
56
+ parameters: {
57
+ docs: {
58
+ description: {
59
+ story: 'Date picker with a label.',
60
+ },
61
+ },
62
+ },
63
+ };
64
+ export const WithError = {
65
+ render: () => {
66
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(DatePicker, { label: "Date with Invalid Input", placeholder: "DD/MM/YYYY" }), _jsx("p", { className: "text-sm text-gray-600", children: "Try typing an invalid date format (like \"abc\" or \"99/99/9999\") to see the error state." })] }));
67
+ },
68
+ parameters: {
69
+ docs: {
70
+ description: {
71
+ story: 'Date picker showing error state when invalid date format is entered. The component automatically validates input and shows error messages.',
72
+ },
73
+ },
74
+ },
75
+ };
@@ -0,0 +1 @@
1
+ export { DatePicker } from './DatePicker';
@@ -0,0 +1 @@
1
+ export { DatePicker } from './DatePicker';
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { useUIKitTheme } from '../../context/useUIKitTheme';
4
4
  import { cn } from '../../lib/utils';
5
- export const Input = React.forwardRef(({ type, label, error, className, helperText, icon, variant = 'default', ...props }, ref) => {
5
+ export const Input = React.forwardRef(({ type, label, error, className, helperText, icon, variant = 'default', endAdornment, ...props }, ref) => {
6
6
  const theme = useUIKitTheme();
7
7
  return (_jsxs("div", { className: cn(className), children: [label && variant !== 'search' && (_jsx("label", { className: "text-sm font-medium text-foreground", children: label })), _jsxs("div", { className: "relative", children: [_jsx("input", { type: type, style: { fontFamily: theme.fontFamily }, className: cn('flex h-10 w-full text-(--uikit-textSecondary) rounded-(--uikit-radius) border border-(--uikit-inputEnabledBorder) bg-background hover:border-(--uikit-inputHoverBorder) px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm transition focus-visible:outline-none focus-visible:border-(--uikit-primary) focus-visible:ring-2 focus-visible:ring-(--uikit-primary)', {
8
8
  'pl-10': variant === 'search',
9
9
  'border-error': error,
10
- }, className), ref: ref, ...props }), icon && (_jsx("span", { className: cn('absolute inset-y-0 flex items-center', variant === 'search' ? 'left-3' : 'right-3'), children: icon }))] }), error && _jsx("label", { className: "text-sm font-medium text-error", children: error }), !error && helperText && variant !== 'search' && (_jsx("label", { className: "text-sm font-medium text-foreground", children: helperText }))] }));
10
+ }, className), ref: ref, ...props }), icon && (_jsx("span", { className: cn('absolute inset-y-0 flex items-center', variant === 'search' ? 'left-3' : 'right-3'), children: icon })), endAdornment && (_jsx("span", { className: "absolute inset-y-0 right-3 flex items-center", children: endAdornment }))] }), error && _jsx("label", { className: "text-sm font-medium text-error", children: error }), !error && helperText && variant !== 'search' && (_jsx("label", { className: "text-sm font-medium text-foreground", children: helperText }))] }));
11
11
  });
12
12
  Input.displayName = 'Input';
@@ -14,3 +14,4 @@ export declare const DisabledWithValue: Story;
14
14
  export declare const WithError: Story;
15
15
  export declare const withIcon: Story;
16
16
  export declare const VariantSearch: Story;
17
+ export declare const WithEndAdornment: Story;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { AiOutlineSearch } from 'react-icons/ai';
3
+ import { CalendarIcon } from 'lucide-react';
3
4
  import { Input } from './Input';
4
5
  const meta = {
5
6
  title: 'UIKit/Input',
@@ -51,3 +52,9 @@ export const VariantSearch = {
51
52
  icon: _jsx(AiOutlineSearch, { size: 20, className: "text-(--uikit-textSecondary)" }),
52
53
  },
53
54
  };
55
+ export const WithEndAdornment = {
56
+ args: {
57
+ placeholder: 'Enter date...',
58
+ endAdornment: (_jsx("button", { className: "p-1.5 hover:bg-gray-100 rounded-full transition-colors", children: _jsx(CalendarIcon, { size: 16, className: "text-gray-500" }) })),
59
+ },
60
+ };
@@ -5,4 +5,5 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
5
5
  helperText?: string;
6
6
  icon?: React.ReactNode;
7
7
  variant?: 'default' | 'search';
8
+ endAdornment?: React.ReactNode;
8
9
  }
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
3
+ declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
4
+ import { cn } from '../../lib/utils';
5
+ const Popover = PopoverPrimitive.Root;
6
+ const PopoverTrigger = PopoverPrimitive.Trigger;
7
+ const PopoverAnchor = PopoverPrimitive.Anchor;
8
+ const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn('z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]', className), ...props }) })));
9
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
10
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { PopoverContent } from './Popover';
3
+ declare const meta: Meta<typeof PopoverContent>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof PopoverContent>;
6
+ export declare const Default: Story;
7
+ export declare const WithForm: Story;
8
+ export declare const WithActions: Story;
9
+ export declare const CustomStyling: Story;
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Popover, PopoverTrigger, PopoverContent } from './Popover';
3
+ import { Button } from '../Button';
4
+ const meta = {
5
+ title: 'UIKit/Popover',
6
+ component: PopoverContent,
7
+ tags: ['autodocs'],
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
11
+ argTypes: {
12
+ align: {
13
+ control: { type: 'select' },
14
+ options: ['start', 'center', 'end'],
15
+ },
16
+ side: {
17
+ control: { type: 'select' },
18
+ options: ['top', 'right', 'bottom', 'left'],
19
+ },
20
+ sideOffset: {
21
+ control: { type: 'number' },
22
+ },
23
+ alignOffset: {
24
+ control: { type: 'number' },
25
+ },
26
+ },
27
+ };
28
+ export default meta;
29
+ export const Default = {
30
+ render: (args) => (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { variant: "primary", children: "Open Popover" }) }), _jsx(PopoverContent, { ...args, children: _jsxs("div", { children: [_jsx("h4", { className: "font-medium leading-none mb-2", children: "Popover Title" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "This is the content of the popover. You can put any content here." })] }) })] })),
31
+ args: {
32
+ align: 'center',
33
+ sideOffset: 4,
34
+ },
35
+ };
36
+ export const WithForm = {
37
+ render: (args) => (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { variant: "primary", children: "Settings" }) }), _jsx(PopoverContent, { ...args, children: _jsxs("div", { className: "space-y-4", children: [_jsx("h4", { className: "font-medium leading-none", children: "Settings" }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "name-input", className: "text-sm font-medium", children: "Name" }), _jsx("input", { id: "name-input", type: "text", placeholder: "Enter your name", className: "w-full px-3 py-2 border border-gray-300 rounded-md text-sm" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("label", { htmlFor: "email-input", className: "text-sm font-medium", children: "Email" }), _jsx("input", { id: "email-input", type: "email", placeholder: "Enter your email", className: "w-full px-3 py-2 border border-gray-300 rounded-md text-sm" })] }), _jsxs("div", { className: "flex justify-end space-x-2", children: [_jsx(Button, { variant: "ghost", size: "sm", children: "Cancel" }), _jsx(Button, { variant: "primary", size: "sm", children: "Save" })] })] }) })] })),
38
+ args: {
39
+ align: 'center',
40
+ sideOffset: 4,
41
+ },
42
+ };
43
+ export const WithActions = {
44
+ render: (args) => (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { variant: "primary", children: "More Actions" }) }), _jsx(PopoverContent, { ...args, children: _jsxs("div", { className: "space-y-1", children: [_jsx("button", { className: "w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100 rounded", children: "Edit" }), _jsx("button", { className: "w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100 rounded", children: "Duplicate" }), _jsx("button", { className: "w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100 rounded", children: "Archive" }), _jsx("hr", { className: "my-1" }), _jsx("button", { className: "w-full text-left px-2 py-1.5 text-sm hover:bg-red-50 text-red-600 rounded", children: "Delete" })] }) })] })),
45
+ args: {
46
+ align: 'end',
47
+ sideOffset: 4,
48
+ className: 'w-48',
49
+ },
50
+ };
51
+ export const CustomStyling = {
52
+ render: (args) => (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { variant: "primary", children: "Custom Style" }) }), _jsx(PopoverContent, { ...args, children: _jsxs("div", { children: [_jsx("h4", { className: "font-medium leading-none mb-2 text-blue-600", children: "Custom Styled" }), _jsx("p", { className: "text-sm text-gray-600", children: "This popover has custom styling with different colors and spacing." })] }) })] })),
53
+ args: {
54
+ align: 'center',
55
+ sideOffset: 8,
56
+ className: 'bg-blue-50 border-blue-200 p-6 w-80',
57
+ },
58
+ };
@@ -0,0 +1 @@
1
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from './Popover';
@@ -0,0 +1 @@
1
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from './Popover';
@@ -19,8 +19,8 @@ export declare function useTableController<T extends {
19
19
  virtualizationEnabled: boolean;
20
20
  rowVirtualizer: import("@tanstack/virtual-core").Virtualizer<HTMLDivElement, Element> | undefined;
21
21
  hasNextPage: boolean;
22
- parentScrollRef: import("react").RefObject<HTMLDivElement | null>;
23
- loaderRef: import("react").RefObject<HTMLTableRowElement | null>;
22
+ parentScrollRef: import("react").MutableRefObject<HTMLDivElement | null>;
23
+ loaderRef: import("react").MutableRefObject<HTMLTableRowElement | null>;
24
24
  infiniteScroll: import("..").InfiniteScrollOptions | undefined;
25
25
  virtualization: import("..").VirtualizationOptions | undefined;
26
26
  };
@@ -0,0 +1,2 @@
1
+ import dayjs from 'dayjs';
2
+ export { dayjs };
@@ -0,0 +1,12 @@
1
+ import dayjs from 'dayjs';
2
+ import customParseFormat from 'dayjs/plugin/customParseFormat';
3
+ import utc from 'dayjs/plugin/utc';
4
+ import timezone from 'dayjs/plugin/timezone';
5
+ import relativeTime from 'dayjs/plugin/relativeTime';
6
+ import duration from 'dayjs/plugin/duration';
7
+ dayjs.extend(customParseFormat);
8
+ dayjs.extend(utc);
9
+ dayjs.extend(timezone);
10
+ dayjs.extend(relativeTime);
11
+ dayjs.extend(duration);
12
+ export { dayjs };
@@ -0,0 +1,2 @@
1
+ export { dayjs } from './dayjs';
2
+ export * from './classNames';
@@ -0,0 +1,2 @@
1
+ export { dayjs } from './dayjs';
2
+ export * from './classNames';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eml-payments/ui-kit",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "private": false,
5
5
  "description": "ARLO UIKit",
6
6
  "homepage": "https://github.com/EML-Payments/arlo.npm.uikit#readme",
@@ -54,9 +54,10 @@
54
54
  "@radix-ui/react-dialog": "^1.1.14",
55
55
  "@radix-ui/react-dropdown-menu": "^2.1.15",
56
56
  "@radix-ui/react-label": "^2.1.7",
57
+ "@radix-ui/react-popover": "^1.1.15",
57
58
  "@radix-ui/react-radio-group": "^1.3.7",
58
59
  "@radix-ui/react-select": "^2.2.5",
59
- "@radix-ui/react-slot": "^1.2.3",
60
+ "@radix-ui/react-slot": "^1.2.4",
60
61
  "@radix-ui/react-switch": "^1.2.5",
61
62
  "@radix-ui/react-tabs": "^1.1.12",
62
63
  "@radix-ui/react-tooltip": "^1.2.7",
@@ -65,15 +66,19 @@
65
66
  "@tanstack/react-virtual": "^3.13.13",
66
67
  "class-variance-authority": "^0.7.1",
67
68
  "clsx": "^2.1.1",
69
+ "date-fns": "^4.1.0",
70
+ "dayjs": "^1.11.19",
71
+ "lucide-react": "^0.562.0",
68
72
  "prettier": "^3.6.2",
69
73
  "react": ">=18.0.0",
74
+ "react-day-picker": "^9.13.0",
70
75
  "react-dom": ">=18.0.0",
71
76
  "react-icons": "^5.5.0",
72
77
  "react-router-dom": "^7.9.5",
73
- "tailwind-merge": "^3.3.1",
78
+ "tailwind-merge": "^3.4.0",
74
79
  "tailwindcss": "^4.1.11",
75
80
  "tailwindcss-animate": "^1.0.7",
76
- "tw-animate-css": "^1.3.5"
81
+ "tw-animate-css": "^1.4.0"
77
82
  },
78
83
  "devDependencies": {
79
84
  "@eslint/js": "^9.30.1",