@yuno-payments/dashboard-design-system 0.0.170 → 0.0.172
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/atoms/access-denied-alert/access-denied-alert.d.ts +16 -0
- package/dist/components/atoms/accordion/accordion.d.ts +66 -0
- package/dist/components/atoms/alert/alert.d.ts +26 -1
- package/dist/components/atoms/alert/alert.js +9 -8
- package/dist/components/atoms/avatar/avatar-group.d.ts +28 -0
- package/dist/components/atoms/avatar/avatar.d.ts +25 -0
- package/dist/components/atoms/avatar/avatar.js +9 -9
- package/dist/components/atoms/badge/badge.d.ts +30 -2
- package/dist/components/atoms/badge/badge.js +27 -11
- package/dist/components/atoms/button/button.d.ts +44 -0
- package/dist/components/atoms/card/card.d.ts +137 -3
- package/dist/components/atoms/card/card.js +56 -28
- package/dist/components/atoms/checkbox/checkbox.d.ts +38 -2
- package/dist/components/atoms/checkbox/checkbox.js +61 -27
- package/dist/components/atoms/combobox/combobox.d.ts +18 -0
- package/dist/components/atoms/combobox/combobox.js +41 -41
- package/dist/components/atoms/combobox/types.d.ts +90 -1
- package/dist/components/atoms/currency-field/currency-field.d.ts +38 -0
- package/dist/components/atoms/currency-field/currency-field.js +22 -19
- package/dist/components/atoms/date-picker/date-picker.d.ts +15 -0
- package/dist/components/atoms/date-range-picker/date-range-picker.d.ts +15 -0
- package/dist/components/atoms/dots-menu/dots-menu.d.ts +16 -0
- package/dist/components/atoms/dots-menu/dots-menu.js +8 -8
- package/dist/components/atoms/dots-menu/dots-menu.types.d.ts +52 -0
- package/dist/components/atoms/dropdown-menu/dropdown-menu.d.ts +50 -0
- package/dist/components/atoms/field/field.d.ts +55 -0
- package/dist/components/atoms/field/field.js +53 -46
- package/dist/components/atoms/filter/filter-date-range.d.ts +12 -2
- package/dist/components/atoms/filter/filter-date-range.js +203 -168
- package/dist/components/atoms/filter/filter.d.ts +6 -0
- package/dist/components/atoms/filter/filter.js +91 -76
- package/dist/components/atoms/filter/index.d.ts +1 -1
- package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +208 -2
- package/dist/components/atoms/filter-dropdown/filter-dropdown.js +214 -160
- package/dist/components/atoms/icon/aida-logo.d.ts +3 -0
- package/dist/components/atoms/icon/aida-logo.js +64 -0
- package/dist/components/atoms/icon/icon-list.d.ts +5 -0
- package/dist/components/atoms/icon/icon-list.js +394 -384
- package/dist/components/atoms/icon/icon.d.ts +29 -0
- package/dist/components/atoms/index.d.ts +3 -2
- package/dist/components/atoms/label/index.d.ts +1 -1
- package/dist/components/atoms/label/label.d.ts +11 -0
- package/dist/components/atoms/label/label.js +28 -0
- package/dist/components/atoms/link/link.d.ts +20 -0
- package/dist/components/atoms/loading/index.d.ts +1 -0
- package/dist/components/atoms/loading/loading.d.ts +39 -0
- package/dist/components/atoms/loading/loading.js +37 -0
- package/dist/components/atoms/multi-select/multi-select.d.ts +1 -1
- package/dist/components/atoms/multi-select/multi-select.js +6 -6
- package/dist/components/atoms/multi-values-field/multi-values-field.d.ts +16 -0
- package/dist/components/atoms/multi-values-field/multi-values-field.js +109 -87
- package/dist/components/atoms/multi-values-field/multi-values-field.types.d.ts +81 -0
- package/dist/components/atoms/otp-field/otp-field.d.ts +32 -0
- package/dist/components/atoms/password-field/password-field.d.ts +23 -0
- package/dist/components/atoms/password-field/password-field.js +1 -1
- package/dist/components/atoms/progress/progress.d.ts +15 -0
- package/dist/components/atoms/protected-field/protected-field.d.ts +10 -0
- package/dist/components/atoms/protected-field/protected-field.types.d.ts +14 -0
- package/dist/components/atoms/radio-group/radio-group-option.js +11 -11
- package/dist/components/atoms/radio-group/radio-group.d.ts +50 -1
- package/dist/components/atoms/radio-group/radio-group.js +13 -12
- package/dist/components/atoms/search-field/search-field.d.ts +14 -0
- package/dist/components/atoms/search-field/search-field.js +17 -17
- package/dist/components/atoms/search-field/search-field.types.d.ts +57 -0
- package/dist/components/atoms/select/index.d.ts +2 -0
- package/dist/components/atoms/select/search-select.d.ts +22 -0
- package/dist/components/atoms/select/search-select.js +201 -0
- package/dist/components/atoms/select/select.d.ts +83 -1
- package/dist/components/atoms/select/select.js +21 -21
- package/dist/components/atoms/separator/separator.d.ts +17 -0
- package/dist/components/atoms/skeleton/index.d.ts +9 -0
- package/dist/components/atoms/switch/switch.d.ts +56 -2
- package/dist/components/atoms/switch/switch.js +64 -32
- package/dist/components/atoms/tabs/index.d.ts +16 -0
- package/dist/components/atoms/textarea/textarea.d.ts +32 -0
- package/dist/components/atoms/textarea/textarea.js +1 -1
- package/dist/components/atoms/time-picker/time-picker.d.ts +73 -2
- package/dist/components/atoms/time-picker/time-picker.js +218 -3
- package/dist/components/atoms/toaster/index.d.ts +15 -0
- package/dist/components/atoms/toggle-group/toggle-group.d.ts +26 -1
- package/dist/components/atoms/toggle-group/toggle-group.js +15 -14
- package/dist/components/atoms/tooltip/tooltip.d.ts +53 -2
- package/dist/components/atoms/typography/typography.d.ts +18 -0
- package/dist/components/molecules/breadcrumb/breadcrumb.d.ts +50 -0
- package/dist/components/molecules/breadcrumb/breadcrumb.js +17 -17
- package/dist/components/molecules/dialog-content/dialog-content.d.ts +16 -0
- package/dist/components/molecules/dialog-footer/dialog-footer.d.ts +20 -0
- package/dist/components/molecules/dialog-header/dialog-header.d.ts +31 -0
- package/dist/components/molecules/empty/empty-icon.js +6 -6
- package/dist/components/molecules/empty/empty.d.ts +16 -1
- package/dist/components/molecules/empty/empty.js +37 -34
- package/dist/components/molecules/highlight-banner/highlight-banner.d.ts +17 -0
- package/dist/components/molecules/pagination/pagination.d.ts +49 -0
- package/dist/components/organisms/data-table/components/cells/data-table-list-cell.d.ts +41 -0
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-content.js +1 -1
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +18 -18
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.d.ts +18 -0
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +10 -10
- package/dist/components/organisms/data-table/components/data-table-body.d.ts +18 -0
- package/dist/components/organisms/data-table/components/data-table-header.d.ts +12 -0
- package/dist/components/organisms/data-table/components/data-table-header.js +7 -7
- package/dist/components/organisms/data-table/components/states/data-table-loading.d.ts +24 -0
- package/dist/components/organisms/data-table/components/states/data-table-loading.js +6 -6
- package/dist/components/organisms/data-table/data-table.d.ts +133 -4
- package/dist/components/organisms/data-table/data-table.js +132 -100
- package/dist/components/organisms/data-table/data-table.types.d.ts +35 -26
- package/dist/components/organisms/data-table/hooks/use-data-table-columns.js +57 -41
- package/dist/components/organisms/data-table/hooks/use-data-table-state.d.ts +8 -2
- package/dist/components/organisms/data-table/hooks/use-data-table-state.js +82 -47
- package/dist/components/organisms/data-table/utils/data-table-constants.d.ts +8 -2
- package/dist/components/organisms/data-table/utils/data-table-constants.js +16 -10
- package/dist/components/organisms/data-table/utils/data-table-styles.d.ts +1652 -0
- package/dist/components/organisms/data-table/utils/data-table-styles.js +29 -14
- package/dist/components/organisms/dialog/dialog.d.ts +67 -1
- package/dist/components/organisms/dialog/dialog.js +78 -61
- package/dist/components/organisms/index.d.ts +2 -0
- package/dist/components/organisms/sheet/sheet.d.ts +69 -0
- package/dist/components/organisms/sheet/sheet.js +34 -33
- package/dist/components/organisms/tutorial/index.d.ts +2 -0
- package/dist/components/organisms/tutorial/tutorial.d.ts +16 -0
- package/dist/components/organisms/tutorial/tutorial.js +114 -0
- package/dist/components/organisms/tutorial/tutorial.types.d.ts +15 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/use-body-scroll-lock.d.ts +13 -0
- package/dist/hooks/use-escape-key.d.ts +14 -0
- package/dist/hooks/use-media-query.d.ts +20 -0
- package/dist/hooks/use-media-query.js +21 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +173 -162
- package/dist/lib/notification-alert.d.ts +42 -0
- package/dist/lib/notification-alert.js +75 -0
- package/dist/node_modules/@phosphor-icons/react/dist/csr/File.es.js +8 -0
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Microphone.es.js +8 -0
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Stop.es.js +8 -0
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Table.es.js +8 -0
- package/dist/node_modules/@phosphor-icons/react/dist/defs/File.es.js +30 -0
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Microphone.es.js +36 -0
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Stop.es.js +36 -0
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Table.es.js +30 -0
- package/dist/vendor/shadcn/avatar.js +19 -19
- package/dist/vendor/shadcn/badge.js +15 -15
- package/dist/vendor/shadcn/card.js +7 -7
- package/dist/vendor/shadcn/date-picker.d.ts +2 -2
- package/dist/vendor/shadcn/date-picker.js +1 -1
- package/dist/vendor/shadcn/date-range-picker.d.ts +2 -2
- package/dist/vendor/shadcn/date-range-picker.js +1 -1
- package/dist/vendor/shadcn/dialog.js +2 -2
- package/dist/vendor/shadcn/input-group.js +17 -17
- package/dist/vendor/shadcn/input.js +7 -7
- package/dist/vendor/shadcn/popover.js +1 -1
- package/dist/vendor/shadcn/select.js +2 -2
- package/dist/vendor/shadcn/sonner.d.ts +26 -1
- package/dist/vendor/shadcn/sonner.js +12 -8
- package/dist/vendor/shadcn/table.js +30 -30
- package/dist/vendor/shadcn/textarea.js +9 -9
- package/dist/vendor/shadcn/time-picker.d.ts +1 -2
- package/dist/vendor/shadcn/time-picker.js +17 -23
- package/dist/vendor/shadcn/toggle.js +13 -13
- package/dist/vendor/shadcn/tooltip.js +25 -15
- package/package.json +1 -1
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { InputOTP } from '../../../vendor/shadcn/input-otp';
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* Props for the OTPField component
|
|
6
|
+
*/
|
|
4
7
|
export interface OTPFieldProps extends Omit<ComponentProps<typeof InputOTP>, "maxLength" | "render"> {
|
|
8
|
+
/**
|
|
9
|
+
* Number of OTP input slots
|
|
10
|
+
* @default 6
|
|
11
|
+
*/
|
|
5
12
|
maxLength?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Label text displayed above the input
|
|
15
|
+
*/
|
|
6
16
|
label?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Error message displayed below the input
|
|
19
|
+
*/
|
|
7
20
|
error?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Additional CSS classes for the field wrapper
|
|
23
|
+
*/
|
|
8
24
|
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Additional CSS classes for the OTP input container
|
|
27
|
+
*/
|
|
9
28
|
containerClassName?: string;
|
|
10
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* One-Time Password input field with individual digit slots.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <OTPField
|
|
36
|
+
* label="Enter verification code"
|
|
37
|
+
* maxLength={6}
|
|
38
|
+
* value={otp}
|
|
39
|
+
* onChange={(value) => setOtp(value)}
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
11
43
|
declare const OTPField: React.ForwardRefExoticComponent<Omit<OTPFieldProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
12
44
|
export { OTPField };
|
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { FieldProps } from '../field';
|
|
3
3
|
import { LinkProps } from '../link';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the PasswordField component
|
|
6
|
+
*/
|
|
4
7
|
export interface PasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type">, Omit<FieldProps, "type" | "endIcon" | "endIconProps"> {
|
|
8
|
+
/**
|
|
9
|
+
* Whether password is visible by default
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
5
12
|
defaultVisible?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Props for the "Forgot password?" link
|
|
15
|
+
*/
|
|
6
16
|
forgotPasswordLinkProps?: LinkProps;
|
|
7
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Password input field with toggle visibility button and optional "Forgot password?" link.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <PasswordField
|
|
24
|
+
* label="Password"
|
|
25
|
+
* forgotPasswordLinkProps={{ href: '/forgot-password' }}
|
|
26
|
+
* value={password}
|
|
27
|
+
* onChange={(e) => setPassword(e.target.value)}
|
|
28
|
+
* />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
8
31
|
declare const PasswordField: import('react').ForwardRefExoticComponent<PasswordFieldProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
9
32
|
export { PasswordField };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as s } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { forwardRef as m, useState as p } from "react";
|
|
3
3
|
import { cn as x } from "../../../lib/utils.js";
|
|
4
|
-
import { Label as f } from "
|
|
4
|
+
import { Label as f } from "../label/label.js";
|
|
5
5
|
import { Link as w } from "../link/link.js";
|
|
6
6
|
import { Field as d } from "../field/field.js";
|
|
7
7
|
const u = m(
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { Progress as ShadcnProgress } from '../../../vendor/shadcn/progress';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Progress component
|
|
5
|
+
*/
|
|
3
6
|
interface ProgressProps extends ComponentProps<typeof ShadcnProgress> {
|
|
7
|
+
/**
|
|
8
|
+
* Current progress value (0-100)
|
|
9
|
+
*/
|
|
4
10
|
value?: number;
|
|
5
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Progress bar component for showing task completion or loading status.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Progress value={75} />
|
|
18
|
+
* <Progress value={progressPercent} className="w-full" />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
6
21
|
declare const Progress: {
|
|
7
22
|
({ value, ...props }: ProgressProps): import("react/jsx-runtime").JSX.Element;
|
|
8
23
|
displayName: string;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
import { ProtectedFieldProps } from './protected-field.types';
|
|
2
|
+
/**
|
|
3
|
+
* Display-only field that can mask sensitive information with asterisks.
|
|
4
|
+
* Automatically truncates long text and provides protected view.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <ProtectedField text="secret-api-key-12345" protect={true} />
|
|
9
|
+
* <ProtectedField text="user@email.com" protect={false} />
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
2
12
|
export declare const ProtectedField: ({ protect, text, className, }: ProtectedFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the ProtectedField component
|
|
3
|
+
*/
|
|
1
4
|
export interface ProtectedFieldProps {
|
|
5
|
+
/**
|
|
6
|
+
* Text to display (will be masked if protected)
|
|
7
|
+
* @default "Default Text"
|
|
8
|
+
*/
|
|
2
9
|
text?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to mask the text with asterisks
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
3
14
|
protect?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Additional CSS classes
|
|
17
|
+
*/
|
|
4
18
|
className?: string;
|
|
5
19
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as r } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { RadioGroupItem as d } from "../../../vendor/shadcn/radio-group.js";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Label as
|
|
5
|
-
const
|
|
3
|
+
import { cn as a } from "../../../lib/utils.js";
|
|
4
|
+
import { Label as l } from "../label/label.js";
|
|
5
|
+
const o = ({
|
|
6
6
|
option: e,
|
|
7
7
|
radioId: s,
|
|
8
8
|
isInlineLayout: t = !1
|
|
@@ -17,39 +17,39 @@ const u = ({
|
|
|
17
17
|
value: e.value,
|
|
18
18
|
id: s,
|
|
19
19
|
disabled: e.disabled,
|
|
20
|
-
className: "size-3.5 data-[state=unchecked]:bg-
|
|
20
|
+
className: "size-3.5 data-[state=unchecked]:bg-background border-border cursor-pointer"
|
|
21
21
|
}
|
|
22
22
|
),
|
|
23
23
|
t ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
24
24
|
/* @__PURE__ */ r.jsx(
|
|
25
|
-
|
|
25
|
+
l,
|
|
26
26
|
{
|
|
27
27
|
htmlFor: s,
|
|
28
|
-
className:
|
|
28
|
+
className: a(
|
|
29
29
|
"cursor-pointer",
|
|
30
30
|
e.disabled && "text-muted-foreground"
|
|
31
31
|
),
|
|
32
32
|
children: e.label
|
|
33
33
|
}
|
|
34
34
|
),
|
|
35
|
-
e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-
|
|
35
|
+
e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-muted-foreground ml-auto", children: e.description })
|
|
36
36
|
] }) : /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-1.5 flex-1", children: [
|
|
37
37
|
/* @__PURE__ */ r.jsx(
|
|
38
|
-
|
|
38
|
+
l,
|
|
39
39
|
{
|
|
40
40
|
htmlFor: s,
|
|
41
|
-
className:
|
|
41
|
+
className: a(
|
|
42
42
|
"cursor-pointer",
|
|
43
43
|
e.disabled && "text-muted-foreground"
|
|
44
44
|
),
|
|
45
45
|
children: e.label
|
|
46
46
|
}
|
|
47
47
|
),
|
|
48
|
-
e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-
|
|
48
|
+
e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-muted-foreground", children: e.description })
|
|
49
49
|
] })
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
export {
|
|
54
|
-
|
|
54
|
+
o as RadioGroupOption
|
|
55
55
|
};
|
|
@@ -1,15 +1,64 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { RadioGroup as ShadcnRadioGroup } from '../../../vendor/shadcn/radio-group';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a single radio option
|
|
5
|
+
*/
|
|
3
6
|
interface RadioOption {
|
|
7
|
+
/**
|
|
8
|
+
* Unique value for this option
|
|
9
|
+
*/
|
|
4
10
|
value: string;
|
|
11
|
+
/**
|
|
12
|
+
* Display label for the option
|
|
13
|
+
*/
|
|
5
14
|
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional description text
|
|
17
|
+
*/
|
|
6
18
|
description?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether this option is disabled
|
|
21
|
+
*/
|
|
7
22
|
disabled?: boolean;
|
|
8
23
|
}
|
|
9
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Props for the RadioGroup component
|
|
26
|
+
*/
|
|
27
|
+
interface RadioGroupProps extends Omit<ComponentProps<typeof ShadcnRadioGroup>, "children" | "onValueChange"> {
|
|
28
|
+
/**
|
|
29
|
+
* Array of radio options to display
|
|
30
|
+
*/
|
|
10
31
|
options: RadioOption[];
|
|
32
|
+
/**
|
|
33
|
+
* Layout direction of radio buttons
|
|
34
|
+
* @default "vertical"
|
|
35
|
+
*/
|
|
11
36
|
orientation?: "vertical" | "horizontal";
|
|
37
|
+
/**
|
|
38
|
+
* Visual layout style
|
|
39
|
+
* @default "stacked"
|
|
40
|
+
*/
|
|
12
41
|
layout?: "stacked" | "inline";
|
|
42
|
+
/**
|
|
43
|
+
* Callback fired when selection changes
|
|
44
|
+
*/
|
|
45
|
+
onChange?: (value: string) => void;
|
|
13
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Radio button group for single-selection from multiple options.
|
|
49
|
+
* Supports vertical/horizontal layouts and inline/stacked styles.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <RadioGroup
|
|
54
|
+
* name="plan"
|
|
55
|
+
* options={[
|
|
56
|
+
* { value: 'free', label: 'Free Plan', description: '$0/month' },
|
|
57
|
+
* { value: 'pro', label: 'Pro Plan', description: '$10/month' }
|
|
58
|
+
* ]}
|
|
59
|
+
* onChange={(value) => console.log(value)}
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
14
63
|
declare const RadioGroup: import('react').ForwardRefExoticComponent<Omit<RadioGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
64
|
export { RadioGroup, type RadioGroupProps, type RadioOption };
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { j as r } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { forwardRef as d } from "react";
|
|
3
3
|
import { RadioGroup as f } from "../../../vendor/shadcn/radio-group.js";
|
|
4
|
-
import { RadioGroupOption as
|
|
5
|
-
const
|
|
6
|
-
({ options: a, name:
|
|
7
|
-
const
|
|
4
|
+
import { RadioGroupOption as x } from "./radio-group-option.js";
|
|
5
|
+
const c = d(
|
|
6
|
+
({ options: a, name: e, orientation: i = "vertical", layout: t = "stacked", onChange: l, ...n }, s) => {
|
|
7
|
+
const p = t === "inline", m = i === "horizontal";
|
|
8
8
|
return /* @__PURE__ */ r.jsx(
|
|
9
9
|
f,
|
|
10
10
|
{
|
|
11
11
|
ref: s,
|
|
12
|
-
className:
|
|
13
|
-
|
|
12
|
+
className: m ? "flex flex-row flex-wrap gap-6" : "flex flex-col gap-3",
|
|
13
|
+
onValueChange: l,
|
|
14
|
+
...n,
|
|
14
15
|
children: a.map((o) => {
|
|
15
|
-
const
|
|
16
|
+
const u = `${e}-${o.value}`;
|
|
16
17
|
return /* @__PURE__ */ r.jsx(
|
|
17
|
-
|
|
18
|
+
x,
|
|
18
19
|
{
|
|
19
20
|
option: o,
|
|
20
|
-
radioId:
|
|
21
|
-
isInlineLayout:
|
|
21
|
+
radioId: u,
|
|
22
|
+
isInlineLayout: p
|
|
22
23
|
},
|
|
23
24
|
o.value
|
|
24
25
|
);
|
|
@@ -27,7 +28,7 @@ const x = d(
|
|
|
27
28
|
);
|
|
28
29
|
}
|
|
29
30
|
);
|
|
30
|
-
|
|
31
|
+
c.displayName = "RadioGroup";
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
+
c as RadioGroup
|
|
33
34
|
};
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
import { SearchFieldProps } from './search-field.types';
|
|
2
|
+
/**
|
|
3
|
+
* Search input field with history dropdown and persistence support.
|
|
4
|
+
* Features search-on-change, history storage, and keyboard navigation.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <SearchField
|
|
9
|
+
* label="Search products"
|
|
10
|
+
* onSearch={(query) => handleSearch(query)}
|
|
11
|
+
* persistKey="product-search"
|
|
12
|
+
* searchOnChange={false}
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
2
16
|
declare const SearchField: import('react').ForwardRefExoticComponent<SearchFieldProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
3
17
|
export { SearchField };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { forwardRef as U, useId as Y, useState as
|
|
2
|
+
import { forwardRef as U, useId as Y, useState as n, useRef as V, useEffect as z } from "react";
|
|
3
3
|
import { cn as r } from "../../../lib/utils.js";
|
|
4
4
|
import { Input as Z } from "../../../vendor/shadcn/input.js";
|
|
5
|
-
import { cva as D } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
6
|
-
import { Label as K } from "../../../vendor/shadcn/label.js";
|
|
7
5
|
import { Icon as w } from "../icon/icon.js";
|
|
6
|
+
import { cva as D } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
7
|
+
import { Label as K } from "../label/label.js";
|
|
8
8
|
const P = D("flex gap-2 w-full", {
|
|
9
9
|
variants: {
|
|
10
10
|
layout: {
|
|
@@ -28,7 +28,7 @@ const P = D("flex gap-2 w-full", {
|
|
|
28
28
|
}), te = U(
|
|
29
29
|
({
|
|
30
30
|
placeholder: F = "Search...",
|
|
31
|
-
onSearch:
|
|
31
|
+
onSearch: l,
|
|
32
32
|
limitSearch: y = 10,
|
|
33
33
|
persistKey: c = "",
|
|
34
34
|
value: m = "",
|
|
@@ -43,15 +43,15 @@ const P = D("flex gap-2 w-full", {
|
|
|
43
43
|
inputProps: h,
|
|
44
44
|
...E
|
|
45
45
|
}, i) => {
|
|
46
|
-
const M = Y(), u = O || h?.id || M, b = !!a, [o, d] =
|
|
46
|
+
const M = Y(), u = O || h?.id || M, b = !!a, [o, d] = n(m), [f, R] = n(() => {
|
|
47
47
|
if (c) {
|
|
48
48
|
const e = localStorage.getItem(`${c}_searchfield`);
|
|
49
49
|
return e ? JSON.parse(e) : [];
|
|
50
50
|
}
|
|
51
51
|
return [];
|
|
52
|
-
}), [C, L] =
|
|
52
|
+
}), [C, L] = n([]), [B, v] = n(!1), [J, I] = n(!1), g = V(null), _ = V(null), G = (e) => {
|
|
53
53
|
const s = e.target.value;
|
|
54
|
-
d(s), (s === "" || H) &&
|
|
54
|
+
d(s), (s === "" || H) && l(s);
|
|
55
55
|
}, W = (e) => {
|
|
56
56
|
e.key === "Enter" && o !== "" && S();
|
|
57
57
|
}, S = () => {
|
|
@@ -65,11 +65,11 @@ const P = D("flex gap-2 w-full", {
|
|
|
65
65
|
R(k), c && localStorage.setItem(
|
|
66
66
|
`${c}_searchfield`,
|
|
67
67
|
JSON.stringify(k)
|
|
68
|
-
),
|
|
68
|
+
), l(o);
|
|
69
69
|
}, X = () => {
|
|
70
|
-
d(""),
|
|
70
|
+
d(""), l(""), g.current?.focus();
|
|
71
71
|
}, q = (e) => {
|
|
72
|
-
d(e),
|
|
72
|
+
d(e), l(e), v(!1), g.current?.focus();
|
|
73
73
|
}, A = () => {
|
|
74
74
|
v(!0);
|
|
75
75
|
}, Q = () => {
|
|
@@ -105,16 +105,16 @@ const P = D("flex gap-2 w-full", {
|
|
|
105
105
|
placeholder: F,
|
|
106
106
|
disabled: x,
|
|
107
107
|
autoComplete: "off",
|
|
108
|
-
className: r(
|
|
109
|
-
b && "border-destructive focus-visible:border-destructive",
|
|
110
|
-
"!px-9",
|
|
111
|
-
h?.className
|
|
112
|
-
),
|
|
113
108
|
"aria-invalid": b,
|
|
114
109
|
"aria-describedby": p || a ? `${u}-description` : void 0,
|
|
115
110
|
...E,
|
|
116
111
|
...h,
|
|
117
|
-
id: u
|
|
112
|
+
id: u,
|
|
113
|
+
className: r(
|
|
114
|
+
b && "border-destructive focus-visible:border-destructive",
|
|
115
|
+
"!px-9",
|
|
116
|
+
h?.className
|
|
117
|
+
)
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
120
|
/* @__PURE__ */ t.jsx(
|
|
@@ -124,7 +124,7 @@ const P = D("flex gap-2 w-full", {
|
|
|
124
124
|
size: "sm",
|
|
125
125
|
onClick: S,
|
|
126
126
|
className: r(
|
|
127
|
-
"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",
|
|
127
|
+
"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground dark:text-foreground",
|
|
128
128
|
!x && "cursor-pointer hover:text-foreground transition-colors"
|
|
129
129
|
)
|
|
130
130
|
}
|
|
@@ -1,20 +1,77 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a search history value
|
|
4
|
+
*/
|
|
2
5
|
export interface SearchValue {
|
|
6
|
+
/**
|
|
7
|
+
* Display label for the search value
|
|
8
|
+
*/
|
|
3
9
|
label: string;
|
|
10
|
+
/**
|
|
11
|
+
* Actual value of the search
|
|
12
|
+
*/
|
|
4
13
|
value: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether this value is currently selected
|
|
16
|
+
*/
|
|
5
17
|
isSelected?: boolean;
|
|
6
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Props for the SearchField component
|
|
21
|
+
*/
|
|
7
22
|
export interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "className"> {
|
|
23
|
+
/**
|
|
24
|
+
* Placeholder text for the input
|
|
25
|
+
* @default "Search..."
|
|
26
|
+
*/
|
|
8
27
|
placeholder?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Callback fired when search is triggered
|
|
30
|
+
*/
|
|
9
31
|
onSearch: (value: string) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum number of search history items to store
|
|
34
|
+
* @default 10
|
|
35
|
+
*/
|
|
10
36
|
limitSearch?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Key for persisting search history in localStorage
|
|
39
|
+
* @default ""
|
|
40
|
+
*/
|
|
11
41
|
persistKey?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Controlled value of the input
|
|
44
|
+
* @default ""
|
|
45
|
+
*/
|
|
12
46
|
value?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether to trigger search on every change or only on Enter
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
13
51
|
searchOnChange?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Label text displayed above the input
|
|
54
|
+
*/
|
|
14
55
|
label?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Helper text displayed below the input
|
|
58
|
+
*/
|
|
15
59
|
description?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Error message displayed below the input
|
|
62
|
+
*/
|
|
16
63
|
error?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Layout orientation
|
|
66
|
+
* @default "vertical"
|
|
67
|
+
*/
|
|
17
68
|
layout?: "vertical" | "horizontal";
|
|
69
|
+
/**
|
|
70
|
+
* Additional CSS classes for the wrapper
|
|
71
|
+
*/
|
|
18
72
|
className?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Additional props to pass to the input element
|
|
75
|
+
*/
|
|
19
76
|
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
20
77
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SelectOption, SelectOptionGroup } from './select';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface SearchSelectProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
optional?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
options?: SelectOption[];
|
|
14
|
+
groups?: SelectOptionGroup[];
|
|
15
|
+
className?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
searchPlaceholder?: string;
|
|
18
|
+
maxHeight?: number;
|
|
19
|
+
}
|
|
20
|
+
declare const SearchSelect: React.ForwardRefExoticComponent<SearchSelectProps & React.RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
export { SearchSelect };
|
|
22
|
+
export type { SearchSelectProps };
|