luan-ui 0.1.0
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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/components/accordion/accordion.d.ts +34 -0
- package/dist/components/accordion/accordion.js +15 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/button/button.d.ts +60 -0
- package/dist/components/button/button.js +80 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/card/card.d.ts +172 -0
- package/dist/components/card/card.js +212 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +39 -0
- package/dist/components/checkbox/checkbox.js +66 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/dialog/dialog.d.ts +10 -0
- package/dist/components/dialog/dialog.js +23 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/form-field/form-field-context.d.ts +13 -0
- package/dist/components/form-field/form-field-context.js +12 -0
- package/dist/components/form-field/form-field-context.js.map +1 -0
- package/dist/components/form-field/form-field.d.ts +25 -0
- package/dist/components/form-field/form-field.js +46 -0
- package/dist/components/form-field/form-field.js.map +1 -0
- package/dist/components/form-helper/form-helper.d.ts +21 -0
- package/dist/components/form-helper/form-helper.js +42 -0
- package/dist/components/form-helper/form-helper.js.map +1 -0
- package/dist/components/icon/icon.d.ts +54 -0
- package/dist/components/icon/icon.js +67 -0
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/input/input.d.ts +15 -0
- package/dist/components/input/input.js +42 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/label/label.d.ts +16 -0
- package/dist/components/label/label.js +23 -0
- package/dist/components/label/label.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +86 -0
- package/dist/components/pagination/pagination.js +134 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/popover/popover.d.ts +64 -0
- package/dist/components/popover/popover.js +81 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/progress/progress.d.ts +17 -0
- package/dist/components/progress/progress.js +18 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +33 -0
- package/dist/components/radio-group/radio-group.js +37 -0
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/select/select.d.ts +42 -0
- package/dist/components/select/select.js +58 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +5 -0
- package/dist/components/skeleton/skeleton.js +10 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/slider/slider.d.ts +39 -0
- package/dist/components/slider/slider.js +36 -0
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/slot/slot.d.ts +13 -0
- package/dist/components/slot/slot.js +70 -0
- package/dist/components/slot/slot.js.map +1 -0
- package/dist/components/switch/switch.d.ts +41 -0
- package/dist/components/switch/switch.js +74 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/table/table.d.ts +33 -0
- package/dist/components/table/table.js +45 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +6 -0
- package/dist/components/tabs/tabs.js +13 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/toast/toast.d.ts +33 -0
- package/dist/components/toast/toast.js +33 -0
- package/dist/components/toast/toast.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +35 -0
- package/dist/components/tooltip/tooltip.js +48 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/utilities/cn/cn.d.ts +2 -0
- package/dist/utilities/cn/cn.js +6 -0
- package/dist/utilities/cn/cn.js.map +1 -0
- package/dist/utilities/get-variants/get-variants.d.ts +56 -0
- package/dist/utilities/get-variants/get-variants.js +79 -0
- package/dist/utilities/get-variants/get-variants.js.map +1 -0
- package/dist/utilities/merge-refs/merge-refs.d.ts +2 -0
- package/dist/utilities/merge-refs/merge-refs.js +13 -0
- package/dist/utilities/merge-refs/merge-refs.js.map +1 -0
- package/dist/utilities/pagination/get-truncated-elements.d.ts +7 -0
- package/dist/utilities/pagination/get-truncated-elements.js +101 -0
- package/dist/utilities/pagination/get-truncated-elements.js.map +1 -0
- package/dist/utilities/pagination/keyboard-navigation.d.ts +1 -0
- package/dist/utilities/pagination/keyboard-navigation.js +70 -0
- package/dist/utilities/pagination/keyboard-navigation.js.map +1 -0
- package/dist/utilities/responsive/responsive.d.ts +37 -0
- package/dist/utilities/responsive/responsive.js +40 -0
- package/dist/utilities/responsive/responsive.js.map +1 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Benedikt Sperl
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Accordion as RadixAccordion } from "radix-ui";
|
|
2
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Accordion component that allows users to expand and collapse content sections.
|
|
5
|
+
* Built on top of Radix UI's Accordion primitive.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <Accordion type="single" collapsible>
|
|
10
|
+
* <AccordionItem value="item-1">
|
|
11
|
+
* <AccordionTrigger>Section 1</AccordionTrigger>
|
|
12
|
+
* <AccordionContent>Content for section 1</AccordionContent>
|
|
13
|
+
* </AccordionItem>
|
|
14
|
+
* </Accordion>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param {Object} props - The component props
|
|
18
|
+
* @param {string} props.className - Optional class name for custom styling
|
|
19
|
+
* @param {React.ReactNode} props.children - The accordion items to render
|
|
20
|
+
* @param {"single" | "multiple"} [props.type="single"] - Whether to allow single or multiple items expanded
|
|
21
|
+
* @param {boolean} [props.collapsible=false] - Whether the expanded item can be collapsed
|
|
22
|
+
* @param {string} [props.value] - The controlled value(s) of the expanded accordion item(s)
|
|
23
|
+
* @param {function} [props.onValueChange] - Callback when value changes
|
|
24
|
+
* @returns {React.ReactNode} The rendered accordion component
|
|
25
|
+
*/
|
|
26
|
+
export type AccordionProps = ComponentPropsWithoutRef<typeof RadixAccordion.Root>;
|
|
27
|
+
declare const Accordion: import("react").ForwardRefExoticComponent<(RadixAccordion.AccordionSingleProps | RadixAccordion.AccordionMultipleProps) & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export type AccordionItemProps = ComponentPropsWithoutRef<typeof RadixAccordion.Item>;
|
|
29
|
+
declare const AccordionItem: import("react").ForwardRefExoticComponent<Omit<RadixAccordion.AccordionItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
30
|
+
export type AccordionTriggerProps = ComponentPropsWithoutRef<typeof RadixAccordion.Trigger>;
|
|
31
|
+
declare const AccordionTrigger: import("react").ForwardRefExoticComponent<Omit<RadixAccordion.AccordionTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
export type AccordionContentProps = ComponentPropsWithoutRef<typeof RadixAccordion.Content>;
|
|
33
|
+
declare const AccordionContent: import("react").ForwardRefExoticComponent<Omit<RadixAccordion.AccordionContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
34
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from "@components/icon/icon";
|
|
3
|
+
import { ChevronDownIcon } from "@radix-ui/react-icons";
|
|
4
|
+
import { cn } from "@utilities/cn/cn";
|
|
5
|
+
import { Accordion as RadixAccordion } from "radix-ui";
|
|
6
|
+
import { forwardRef, } from "react";
|
|
7
|
+
const Accordion = RadixAccordion.Root;
|
|
8
|
+
const AccordionItem = forwardRef(({ className, ...props }, ref) => (_jsx(RadixAccordion.Item, { ref: ref, className: cn("border-gray-200 border-b", className), ...props })));
|
|
9
|
+
AccordionItem.displayName = "AccordionItem";
|
|
10
|
+
const AccordionTrigger = forwardRef(({ className, children, ...props }, ref) => (_jsx(RadixAccordion.Header, { className: "flex", children: _jsxs(RadixAccordion.Trigger, { ref: ref, className: cn("flex flex-1 cursor-pointer items-center justify-between py-4 text-left font-medium text-sm transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className), ...props, children: [children, _jsx(Icon, { asChild: true, size: "small", children: _jsx(ChevronDownIcon, { className: "shrink-0 cursor-pointer text-gray-500 transition-transform duration-350" }) })] }) })));
|
|
11
|
+
AccordionTrigger.displayName = "AccordionTrigger";
|
|
12
|
+
const AccordionContent = forwardRef(({ className, children, ...props }, ref) => (_jsx(RadixAccordion.Content, { ref: ref, className: cn("overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", className), ...props, children: _jsx("div", { className: "pt-0 pb-4", children: children }) })));
|
|
13
|
+
AccordionContent.displayName = "AccordionContent";
|
|
14
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
15
|
+
//# sourceMappingURL=accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAGN,UAAU,GACV,MAAM,OAAO,CAAC;AA6Bf,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC;AAMtC,MAAM,aAAa,GAAG,UAAU,CAG9B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACnC,KAAC,cAAc,CAAC,IAAI,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACR,CACF,CAAC,CAAC;AACH,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAM5C,MAAM,gBAAgB,GAAG,UAAU,CAGjC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC7C,KAAC,cAAc,CAAC,MAAM,IAAC,SAAS,EAAC,MAAM,YACtC,MAAC,cAAc,CAAC,OAAO,IACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,+JAA+J,EAC/J,SAAS,CACT,KACG,KAAK,aAER,QAAQ,EACT,KAAC,IAAI,IAAC,OAAO,QAAC,IAAI,EAAC,OAAO,YACzB,KAAC,eAAe,IAAC,SAAS,EAAC,yEAAyE,GAAG,GACjG,IACiB,GACF,CACxB,CAAC,CAAC;AACH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAMlD,MAAM,gBAAgB,GAAG,UAAU,CAGjC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC7C,KAAC,cAAc,CAAC,OAAO,IACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,2GAA2G,EAC3G,SAAS,CACT,KACG,KAAK,YAET,cAAK,SAAS,EAAC,WAAW,YAAE,QAAQ,GAAO,GACnB,CACzB,CAAC,CAAC;AACH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ResponsiveValue } from "@utilities/responsive/responsive";
|
|
2
|
+
export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
|
+
variant?: "primary" | "secondary";
|
|
4
|
+
size?: ResponsiveValue<"small" | "medium" | "large">;
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
iconStart?: React.ReactNode;
|
|
7
|
+
iconEnd?: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare const SIZES: {
|
|
10
|
+
sm: {
|
|
11
|
+
small: string;
|
|
12
|
+
medium: string;
|
|
13
|
+
large: string;
|
|
14
|
+
};
|
|
15
|
+
md: {
|
|
16
|
+
small: string;
|
|
17
|
+
medium: string;
|
|
18
|
+
large: string;
|
|
19
|
+
};
|
|
20
|
+
lg: {
|
|
21
|
+
small: string;
|
|
22
|
+
medium: string;
|
|
23
|
+
large: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* A flexible button component that supports variants, sizes, and icons
|
|
28
|
+
* @param {Object} props - The props for the Button component
|
|
29
|
+
* @param {'primary' | 'secondary'} [props.variant='primary'] - The visual style variant of the button
|
|
30
|
+
* @param {'small' | 'medium' | 'large'} [props.size='medium'] - The size of the button
|
|
31
|
+
* @param {boolean} [props.asChild] - Whether to render the button as a child component using Radix Slot
|
|
32
|
+
* @param {React.ReactNode} [props.iconStart] - Icon element to display before the button content
|
|
33
|
+
* @param {React.ReactNode} [props.iconEnd] - Icon element to display after the button content
|
|
34
|
+
* @param {string} [props.className] - Additional CSS classes to apply
|
|
35
|
+
* @param {boolean} [props.disabled] - Whether the button is disabled
|
|
36
|
+
* @returns {React.ReactElement} The Button component
|
|
37
|
+
* @example
|
|
38
|
+
* // Basic usage
|
|
39
|
+
* <Button>Click me</Button>
|
|
40
|
+
*
|
|
41
|
+
* // With variants and size
|
|
42
|
+
* <Button variant="secondary" size="large">
|
|
43
|
+
* Large Secondary Button
|
|
44
|
+
* </Button>
|
|
45
|
+
*
|
|
46
|
+
* // With icons
|
|
47
|
+
* <Button iconStart={<SearchIcon />} iconEnd={<ArrowRightIcon />}>
|
|
48
|
+
* Search
|
|
49
|
+
* </Button>
|
|
50
|
+
*
|
|
51
|
+
* // Disabled state
|
|
52
|
+
* <Button disabled>Disabled Button</Button>
|
|
53
|
+
*/
|
|
54
|
+
export declare const Button: import("react").ForwardRefExoticComponent<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
55
|
+
variant?: "primary" | "secondary";
|
|
56
|
+
size?: ResponsiveValue<"small" | "medium" | "large">;
|
|
57
|
+
asChild?: boolean;
|
|
58
|
+
iconStart?: React.ReactNode;
|
|
59
|
+
iconEnd?: React.ReactNode;
|
|
60
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from "@components/icon/icon";
|
|
3
|
+
import { Slot, Slottable } from "@components/slot/slot";
|
|
4
|
+
import { getVariants } from "@utilities/get-variants/get-variants";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
export const SIZES = {
|
|
7
|
+
sm: {
|
|
8
|
+
small: "sm:text-sm sm:px-2 sm:py-1 sm:gap-2",
|
|
9
|
+
medium: "sm:text-base sm:px-4 sm:py-2 sm:gap-4",
|
|
10
|
+
large: "sm:text-lg sm:px-6 sm:py-3 sm:gap-6",
|
|
11
|
+
},
|
|
12
|
+
md: {
|
|
13
|
+
small: "md:text-sm md:px-2 md:py-1 md:gap-2",
|
|
14
|
+
medium: "md:text-base md:px-4 md:py-2 md:gap-4",
|
|
15
|
+
large: "md:text-lg md:px-6 md:py-3 md:gap-6",
|
|
16
|
+
},
|
|
17
|
+
lg: {
|
|
18
|
+
small: "lg:text-sm lg:px-2 lg:py-1 lg:gap-2",
|
|
19
|
+
medium: "lg:text-base lg:px-4 lg:py-2 lg:gap-4",
|
|
20
|
+
large: "lg:text-lg lg:px-6 lg:py-3 lg:gap-6",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const buttonStyles = getVariants({
|
|
24
|
+
base: "flex w-fit cursor-pointer items-center justify-center gap-2 rounded border font-semibold",
|
|
25
|
+
variants: {
|
|
26
|
+
variant: {
|
|
27
|
+
primary: "border-transparent bg-gray-700 text-white hover:bg-gray-800",
|
|
28
|
+
secondary: "border-gray-700 bg-white text-gray-700 hover:bg-gray-50",
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
small: "gap-2 px-2 py-1 text-sm",
|
|
32
|
+
medium: "gap-3 px-4 py-2 text-base",
|
|
33
|
+
large: "gap-4 px-6 py-3 text-lg",
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
true: "cursor-not-allowed opacity-50",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
compoundVariants: [
|
|
40
|
+
{
|
|
41
|
+
variant: "secondary",
|
|
42
|
+
size: "medium",
|
|
43
|
+
className: "test-compound-variant",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* A flexible button component that supports variants, sizes, and icons
|
|
49
|
+
* @param {Object} props - The props for the Button component
|
|
50
|
+
* @param {'primary' | 'secondary'} [props.variant='primary'] - The visual style variant of the button
|
|
51
|
+
* @param {'small' | 'medium' | 'large'} [props.size='medium'] - The size of the button
|
|
52
|
+
* @param {boolean} [props.asChild] - Whether to render the button as a child component using Radix Slot
|
|
53
|
+
* @param {React.ReactNode} [props.iconStart] - Icon element to display before the button content
|
|
54
|
+
* @param {React.ReactNode} [props.iconEnd] - Icon element to display after the button content
|
|
55
|
+
* @param {string} [props.className] - Additional CSS classes to apply
|
|
56
|
+
* @param {boolean} [props.disabled] - Whether the button is disabled
|
|
57
|
+
* @returns {React.ReactElement} The Button component
|
|
58
|
+
* @example
|
|
59
|
+
* // Basic usage
|
|
60
|
+
* <Button>Click me</Button>
|
|
61
|
+
*
|
|
62
|
+
* // With variants and size
|
|
63
|
+
* <Button variant="secondary" size="large">
|
|
64
|
+
* Large Secondary Button
|
|
65
|
+
* </Button>
|
|
66
|
+
*
|
|
67
|
+
* // With icons
|
|
68
|
+
* <Button iconStart={<SearchIcon />} iconEnd={<ArrowRightIcon />}>
|
|
69
|
+
* Search
|
|
70
|
+
* </Button>
|
|
71
|
+
*
|
|
72
|
+
* // Disabled state
|
|
73
|
+
* <Button disabled>Disabled Button</Button>
|
|
74
|
+
*/
|
|
75
|
+
export const Button = forwardRef(({ asChild, children, variant = "primary", size = "medium", className, disabled, iconStart, iconEnd, ...props }, ref) => {
|
|
76
|
+
const Component = asChild ? Slot : "button";
|
|
77
|
+
return (_jsx(Component, { ref: ref, className: buttonStyles({ variant, size, disabled, className }), ...props, children: _jsx(Slottable, { child: children, children: (child) => (_jsxs(_Fragment, { children: [iconStart && (_jsx(Icon, { size: size, asChild: true, children: iconStart })), child, iconEnd && (_jsx(Icon, { size: size, asChild: true, children: iconEnd }))] })) }) }));
|
|
78
|
+
});
|
|
79
|
+
Button.displayName = "Button";
|
|
80
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAUnC,MAAM,CAAC,MAAM,KAAK,GAAG;IACpB,EAAE,EAAE;QACH,KAAK,EAAE,qCAAqC;QAC5C,MAAM,EAAE,uCAAuC;QAC/C,KAAK,EAAE,qCAAqC;KAC5C;IACD,EAAE,EAAE;QACH,KAAK,EAAE,qCAAqC;QAC5C,MAAM,EAAE,uCAAuC;QAC/C,KAAK,EAAE,qCAAqC;KAC5C;IACD,EAAE,EAAE;QACH,KAAK,EAAE,qCAAqC;QAC5C,MAAM,EAAE,uCAAuC;QAC/C,KAAK,EAAE,qCAAqC;KAC5C;CACD,CAAC;AAEF,MAAM,YAAY,GAAG,WAAW,CAAC;IAChC,IAAI,EAAE,0FAA0F;IAChG,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,OAAO,EAAE,6DAA6D;YACtE,SAAS,EAAE,yDAAyD;SACpE;QACD,IAAI,EAAE;YACL,KAAK,EAAE,yBAAyB;YAChC,MAAM,EAAE,2BAA2B;YACnC,KAAK,EAAE,yBAAyB;SAChC;QACD,QAAQ,EAAE;YACT,IAAI,EAAE,+BAA+B;SACrC;KACD;IACD,gBAAgB,EAAE;QACjB;YACC,OAAO,EAAE,WAAW;YACpB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,uBAAuB;SAClC;KACD;CACD,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC/B,CACC,EACC,OAAO,EACP,QAAQ,EACR,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACR,EACD,GAAG,EACF,EAAE;IACH,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC5C,OAAO,CACN,KAAC,SAAS,IACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,KAC3D,KAAK,YAET,KAAC,SAAS,IAAC,KAAK,EAAE,QAAQ,YACxB,CAAC,KAAK,EAAE,EAAE,CAAC,CACX,8BACE,SAAS,IAAI,CACb,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,kBACvB,SAAS,GACJ,CACP,EACA,KAAK,EACL,OAAO,IAAI,CACX,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,kBACvB,OAAO,GACF,CACP,IACC,CACH,GACU,GACD,CACZ,CAAC;AACH,CAAC,CACD,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { ResponsiveValue } from "@utilities/responsive/responsive";
|
|
2
|
+
/**
|
|
3
|
+
* Card
|
|
4
|
+
*/
|
|
5
|
+
export type CardProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
size?: ResponsiveValue<"small" | "medium" | "large">;
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const CARD_SIZES: {
|
|
10
|
+
sm: {
|
|
11
|
+
small: string;
|
|
12
|
+
medium: string;
|
|
13
|
+
large: string;
|
|
14
|
+
};
|
|
15
|
+
md: {
|
|
16
|
+
small: string;
|
|
17
|
+
medium: string;
|
|
18
|
+
large: string;
|
|
19
|
+
};
|
|
20
|
+
lg: {
|
|
21
|
+
small: string;
|
|
22
|
+
medium: string;
|
|
23
|
+
large: string;
|
|
24
|
+
};
|
|
25
|
+
xl: {
|
|
26
|
+
small: string;
|
|
27
|
+
medium: string;
|
|
28
|
+
large: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Card component that provides a container with consistent styling and spacing.
|
|
33
|
+
* Supports different sizes and can be used with asChild prop for composition.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <Card size="medium">
|
|
38
|
+
* <CardHeader>Header</CardHeader>
|
|
39
|
+
* <CardContent>Content</CardContent>
|
|
40
|
+
* <CardFooter>Footer</CardFooter>
|
|
41
|
+
* </Card>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const Card: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & {
|
|
45
|
+
size?: ResponsiveValue<"small" | "medium" | "large">;
|
|
46
|
+
asChild?: boolean;
|
|
47
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
48
|
+
/**
|
|
49
|
+
* Card Header
|
|
50
|
+
*/
|
|
51
|
+
export type CardHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
52
|
+
size?: ResponsiveValue<"small" | "medium" | "large">;
|
|
53
|
+
asChild?: boolean;
|
|
54
|
+
};
|
|
55
|
+
export declare const CARD_HEADER_SIZES: {
|
|
56
|
+
sm: {
|
|
57
|
+
small: string;
|
|
58
|
+
medium: string;
|
|
59
|
+
large: string;
|
|
60
|
+
};
|
|
61
|
+
md: {
|
|
62
|
+
small: string;
|
|
63
|
+
medium: string;
|
|
64
|
+
large: string;
|
|
65
|
+
};
|
|
66
|
+
lg: {
|
|
67
|
+
small: string;
|
|
68
|
+
medium: string;
|
|
69
|
+
large: string;
|
|
70
|
+
};
|
|
71
|
+
xl: {
|
|
72
|
+
small: string;
|
|
73
|
+
medium: string;
|
|
74
|
+
large: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Card Header component that provides a consistent header section for the Card.
|
|
79
|
+
* Inherits size from parent Card component.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```tsx
|
|
83
|
+
* <CardHeader>
|
|
84
|
+
* <h2>Title</h2>
|
|
85
|
+
* <button>Action</button>
|
|
86
|
+
* </CardHeader>
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare const CardHeader: import("react").ForwardRefExoticComponent<Omit<CardHeaderProps, "size"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
90
|
+
/**
|
|
91
|
+
* Card Content
|
|
92
|
+
*/
|
|
93
|
+
export type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
94
|
+
size?: ResponsiveValue<"small" | "medium" | "large">;
|
|
95
|
+
asChild?: boolean;
|
|
96
|
+
};
|
|
97
|
+
export declare const CARD_CONTENT_SIZES: {
|
|
98
|
+
sm: {
|
|
99
|
+
small: string;
|
|
100
|
+
medium: string;
|
|
101
|
+
large: string;
|
|
102
|
+
};
|
|
103
|
+
md: {
|
|
104
|
+
small: string;
|
|
105
|
+
medium: string;
|
|
106
|
+
large: string;
|
|
107
|
+
};
|
|
108
|
+
lg: {
|
|
109
|
+
small: string;
|
|
110
|
+
medium: string;
|
|
111
|
+
large: string;
|
|
112
|
+
};
|
|
113
|
+
xl: {
|
|
114
|
+
small: string;
|
|
115
|
+
medium: string;
|
|
116
|
+
large: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Card Content component that provides the main content area for the Card.
|
|
121
|
+
* Inherits size from parent Card component.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* <CardContent>
|
|
126
|
+
* <p>Main content goes here</p>
|
|
127
|
+
* </CardContent>
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export declare const CardContent: import("react").ForwardRefExoticComponent<Omit<CardContentProps, "size"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
131
|
+
/**
|
|
132
|
+
* Card Footer
|
|
133
|
+
*/
|
|
134
|
+
export type CardFooterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
135
|
+
size?: ResponsiveValue<"small" | "medium" | "large">;
|
|
136
|
+
asChild?: boolean;
|
|
137
|
+
};
|
|
138
|
+
export declare const CARD_FOOTER_SIZES: {
|
|
139
|
+
sm: {
|
|
140
|
+
small: string;
|
|
141
|
+
medium: string;
|
|
142
|
+
large: string;
|
|
143
|
+
};
|
|
144
|
+
md: {
|
|
145
|
+
small: string;
|
|
146
|
+
medium: string;
|
|
147
|
+
large: string;
|
|
148
|
+
};
|
|
149
|
+
lg: {
|
|
150
|
+
small: string;
|
|
151
|
+
medium: string;
|
|
152
|
+
large: string;
|
|
153
|
+
};
|
|
154
|
+
xl: {
|
|
155
|
+
small: string;
|
|
156
|
+
medium: string;
|
|
157
|
+
large: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Card Footer component that provides a consistent footer section for the Card.
|
|
162
|
+
* Inherits size from parent Card component.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```tsx
|
|
166
|
+
* <CardFooter>
|
|
167
|
+
* <button>Cancel</button>
|
|
168
|
+
* <button>Submit</button>
|
|
169
|
+
* </CardFooter>
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
export declare const CardFooter: import("react").ForwardRefExoticComponent<Omit<CardFooterProps, "size"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "@components/slot/slot";
|
|
3
|
+
import { getVariants } from "@utilities/get-variants/get-variants";
|
|
4
|
+
import { createContext, forwardRef, useContext } from "react";
|
|
5
|
+
const CardContext = createContext(undefined);
|
|
6
|
+
const useCardContext = () => {
|
|
7
|
+
const context = useContext(CardContext);
|
|
8
|
+
if (!context) {
|
|
9
|
+
throw new Error("Card components must be used within a Card");
|
|
10
|
+
}
|
|
11
|
+
return context;
|
|
12
|
+
};
|
|
13
|
+
export const CARD_SIZES = {
|
|
14
|
+
sm: {
|
|
15
|
+
small: "sm:gap-2 sm:py-2",
|
|
16
|
+
medium: "sm:gap-4 sm:py-4",
|
|
17
|
+
large: "sm:gap-6 sm:py-6",
|
|
18
|
+
},
|
|
19
|
+
md: {
|
|
20
|
+
small: "md:gap-2 md:py-2",
|
|
21
|
+
medium: "md:gap-4 md:py-4",
|
|
22
|
+
large: "md:gap-6 md:py-6",
|
|
23
|
+
},
|
|
24
|
+
lg: {
|
|
25
|
+
small: "lg:gap-2 lg:py-2",
|
|
26
|
+
medium: "lg:gap-4 lg:py-4",
|
|
27
|
+
large: "lg:gap-6 lg:py-6",
|
|
28
|
+
},
|
|
29
|
+
xl: {
|
|
30
|
+
small: "xl:gap-2 xl:py-2",
|
|
31
|
+
medium: "xl:gap-4 xl:py-4",
|
|
32
|
+
large: "xl:gap-6 xl:py-6",
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
const cardStyles = getVariants({
|
|
36
|
+
base: "flex flex-col rounded-lg border border-gray-200 bg-white shadow-md",
|
|
37
|
+
variants: {
|
|
38
|
+
size: {
|
|
39
|
+
small: "gap-2 py-2",
|
|
40
|
+
medium: "gap-4 py-4",
|
|
41
|
+
large: "gap-6 py-6",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Card component that provides a container with consistent styling and spacing.
|
|
47
|
+
* Supports different sizes and can be used with asChild prop for composition.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <Card size="medium">
|
|
52
|
+
* <CardHeader>Header</CardHeader>
|
|
53
|
+
* <CardContent>Content</CardContent>
|
|
54
|
+
* <CardFooter>Footer</CardFooter>
|
|
55
|
+
* </Card>
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export const Card = forwardRef(({ className, size = "medium", asChild, ...props }, ref) => {
|
|
59
|
+
const Component = asChild ? Slot : "div";
|
|
60
|
+
return (_jsx(CardContext.Provider, { value: { size }, children: _jsx(Component, { ref: ref, className: cardStyles({ className, size }), ...props }) }));
|
|
61
|
+
});
|
|
62
|
+
Card.displayName = "Card";
|
|
63
|
+
export const CARD_HEADER_SIZES = {
|
|
64
|
+
sm: {
|
|
65
|
+
small: "sm:px-2 sm:pb-2",
|
|
66
|
+
medium: "sm:px-4 sm:pb-4",
|
|
67
|
+
large: "sm:px-6 sm:pb-6",
|
|
68
|
+
},
|
|
69
|
+
md: {
|
|
70
|
+
small: "md:px-2 md:pb-2",
|
|
71
|
+
medium: "md:px-4 md:pb-4",
|
|
72
|
+
large: "md:px-6 md:pb-6",
|
|
73
|
+
},
|
|
74
|
+
lg: {
|
|
75
|
+
small: "lg:px-2 lg:pb-2",
|
|
76
|
+
medium: "lg:px-4 lg:pb-4",
|
|
77
|
+
large: "lg:px-6 lg:pb-6",
|
|
78
|
+
},
|
|
79
|
+
xl: {
|
|
80
|
+
small: "xl:px-2 xl:pb-2",
|
|
81
|
+
medium: "xl:px-4 xl:pb-4",
|
|
82
|
+
large: "xl:px-6 xl:pb-6",
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
const cardHeaderStyles = getVariants({
|
|
86
|
+
base: "flex items-center justify-between border-gray-200 border-b",
|
|
87
|
+
variants: {
|
|
88
|
+
size: {
|
|
89
|
+
small: "px-2 pb-2",
|
|
90
|
+
medium: "px-4 pb-4",
|
|
91
|
+
large: "px-6 pb-6",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Card Header component that provides a consistent header section for the Card.
|
|
97
|
+
* Inherits size from parent Card component.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```tsx
|
|
101
|
+
* <CardHeader>
|
|
102
|
+
* <h2>Title</h2>
|
|
103
|
+
* <button>Action</button>
|
|
104
|
+
* </CardHeader>
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export const CardHeader = forwardRef(({ className, asChild, ...props }, ref) => {
|
|
108
|
+
const { size } = useCardContext();
|
|
109
|
+
const Component = asChild ? Slot : "div";
|
|
110
|
+
return (_jsx(Component, { ref: ref, className: cardHeaderStyles({ className, size }), ...props }));
|
|
111
|
+
});
|
|
112
|
+
CardHeader.displayName = "CardHeader";
|
|
113
|
+
export const CARD_CONTENT_SIZES = {
|
|
114
|
+
sm: {
|
|
115
|
+
small: "sm:gap-2 sm:px-2",
|
|
116
|
+
medium: "sm:gap-4 sm:px-4",
|
|
117
|
+
large: "sm:gap-6 sm:px-6",
|
|
118
|
+
},
|
|
119
|
+
md: {
|
|
120
|
+
small: "md:gap-2 md:px-2",
|
|
121
|
+
medium: "md:gap-4 md:px-4",
|
|
122
|
+
large: "md:gap-6 md:px-6",
|
|
123
|
+
},
|
|
124
|
+
lg: {
|
|
125
|
+
small: "lg:gap-2 lg:px-2",
|
|
126
|
+
medium: "lg:gap-4 lg:px-4",
|
|
127
|
+
large: "lg:gap-6 lg:px-6",
|
|
128
|
+
},
|
|
129
|
+
xl: {
|
|
130
|
+
small: "xl:gap-2 xl:px-2",
|
|
131
|
+
medium: "xl:gap-4 xl:px-4",
|
|
132
|
+
large: "xl:gap-6 xl:px-6",
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
const cardContentStyles = getVariants({
|
|
136
|
+
base: "flex flex-col",
|
|
137
|
+
variants: {
|
|
138
|
+
size: {
|
|
139
|
+
small: "gap-2 px-2",
|
|
140
|
+
medium: "gap-4 px-4",
|
|
141
|
+
large: "gap-6 px-6",
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* Card Content component that provides the main content area for the Card.
|
|
147
|
+
* Inherits size from parent Card component.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```tsx
|
|
151
|
+
* <CardContent>
|
|
152
|
+
* <p>Main content goes here</p>
|
|
153
|
+
* </CardContent>
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export const CardContent = forwardRef(({ className, asChild, ...props }, ref) => {
|
|
157
|
+
const { size } = useCardContext();
|
|
158
|
+
const Component = asChild ? Slot : "div";
|
|
159
|
+
return (_jsx(Component, { ref: ref, className: cardContentStyles({ className, size }), ...props }));
|
|
160
|
+
});
|
|
161
|
+
CardContent.displayName = "CardContent";
|
|
162
|
+
export const CARD_FOOTER_SIZES = {
|
|
163
|
+
sm: {
|
|
164
|
+
small: "sm:px-2 sm:pt-2",
|
|
165
|
+
medium: "sm:px-4 sm:pt-4",
|
|
166
|
+
large: "sm:px-6 sm:pt-6",
|
|
167
|
+
},
|
|
168
|
+
md: {
|
|
169
|
+
small: "md:px-2 md:pt-2",
|
|
170
|
+
medium: "md:px-4 md:pt-4",
|
|
171
|
+
large: "lg:px-6 lg:pt-6",
|
|
172
|
+
},
|
|
173
|
+
lg: {
|
|
174
|
+
small: "lg:px-2 lg:pt-2",
|
|
175
|
+
medium: "lg:px-4 lg:pt-4",
|
|
176
|
+
large: "lg:px-6 lg:pt-6",
|
|
177
|
+
},
|
|
178
|
+
xl: {
|
|
179
|
+
small: "xl:px-2 xl:pt-2",
|
|
180
|
+
medium: "xl:px-4 xl:pt-4",
|
|
181
|
+
large: "xl:px-6 xl:pt-6",
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
const cardFooterStyles = getVariants({
|
|
185
|
+
base: "flex items-center justify-between border-gray-200 border-t",
|
|
186
|
+
variants: {
|
|
187
|
+
size: {
|
|
188
|
+
small: "px-2 pt-2",
|
|
189
|
+
medium: "px-4 pt-4",
|
|
190
|
+
large: "px-6 pt-6",
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
/**
|
|
195
|
+
* Card Footer component that provides a consistent footer section for the Card.
|
|
196
|
+
* Inherits size from parent Card component.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* ```tsx
|
|
200
|
+
* <CardFooter>
|
|
201
|
+
* <button>Cancel</button>
|
|
202
|
+
* <button>Submit</button>
|
|
203
|
+
* </CardFooter>
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
export const CardFooter = forwardRef(({ className, asChild, ...props }, ref) => {
|
|
207
|
+
const { size } = useCardContext();
|
|
208
|
+
const Component = asChild ? Slot : "div";
|
|
209
|
+
return (_jsx(Component, { ref: ref, className: cardFooterStyles({ className, size }), ...props }));
|
|
210
|
+
});
|
|
211
|
+
CardFooter.displayName = "CardFooter";
|
|
212
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAQ9D,MAAM,WAAW,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAC;AAE3E,MAAM,cAAc,GAAG,GAAG,EAAE;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,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rimitive } from "radix-ui";
|
|
3
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
4
|
+
export type CheckboxProps = ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & {
|
|
5
|
+
size?: ResponsiveValue<"small" | "medium" | "large">;
|
|
6
|
+
};
|
|
7
|
+
export declare const SIZES: {
|
|
8
|
+
sm: {
|
|
9
|
+
small: string;
|
|
10
|
+
medium: string;
|
|
11
|
+
large: string;
|
|
12
|
+
};
|
|
13
|
+
md: {
|
|
14
|
+
small: string;
|
|
15
|
+
medium: string;
|
|
16
|
+
large: string;
|
|
17
|
+
};
|
|
18
|
+
lg: {
|
|
19
|
+
small: string;
|
|
20
|
+
medium: string;
|
|
21
|
+
large: string;
|
|
22
|
+
};
|
|
23
|
+
xl: {
|
|
24
|
+
small: string;
|
|
25
|
+
medium: string;
|
|
26
|
+
large: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* A checkbox component built on top of Radix UI's checkbox primitive.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <Checkbox id="checkbox" onCheckedChange={(checked) => console.log(checked)} />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
38
|
+
size?: ResponsiveValue<"small" | "medium" | "large">;
|
|
39
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|