@arobo/react 1.0.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/README.md +27 -0
- package/dist/components/button/button.d.ts +10 -0
- package/dist/components/button/button.js +48 -0
- package/dist/components/button/index.d.ts +15 -0
- package/dist/components/button/index.js +12 -0
- package/dist/components/button-group/button-group.d.ts +19 -0
- package/dist/components/button-group/button-group.js +52 -0
- package/dist/components/button-group/index.d.ts +14 -0
- package/dist/components/button-group/index.js +9 -0
- package/dist/components/calendar/calendar.d.ts +17 -0
- package/dist/components/calendar/calendar.js +98 -0
- package/dist/components/calendar/index.d.ts +13 -0
- package/dist/components/calendar/index.js +12 -0
- package/dist/components/card/card.d.ts +22 -0
- package/dist/components/card/card.js +140 -0
- package/dist/components/card/index.d.ts +23 -0
- package/dist/components/card/index.js +16 -0
- package/dist/components/checkbox/checkbox.d.ts +22 -0
- package/dist/components/checkbox/checkbox.js +123 -0
- package/dist/components/checkbox/index.d.ts +19 -0
- package/dist/components/checkbox/index.js +14 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +14 -0
- package/dist/components/checkbox-group/checkbox-group.js +32 -0
- package/dist/components/checkbox-group/index.d.ts +3 -0
- package/dist/components/checkbox-group/index.js +2 -0
- package/dist/components/close-button/close-button.d.ts +8 -0
- package/dist/components/close-button/close-button.js +32 -0
- package/dist/components/close-button/index.d.ts +13 -0
- package/dist/components/close-button/index.js +11 -0
- package/dist/components/combobox/combobox.d.ts +23 -0
- package/dist/components/combobox/combobox.js +113 -0
- package/dist/components/combobox/index.d.ts +19 -0
- package/dist/components/combobox/index.js +14 -0
- package/dist/components/date-field/date-field.d.ts +9 -0
- package/dist/components/date-field/date-field.js +28 -0
- package/dist/components/date-field/index.d.ts +13 -0
- package/dist/components/date-field/index.js +11 -0
- package/dist/components/date-input-group/date-input-group.d.ts +25 -0
- package/dist/components/date-input-group/date-input-group.js +140 -0
- package/dist/components/date-input-group/index.d.ts +23 -0
- package/dist/components/date-input-group/index.js +16 -0
- package/dist/components/date-picker/date-picker.d.ts +11 -0
- package/dist/components/date-picker/date-picker.js +67 -0
- package/dist/components/date-picker/index.d.ts +13 -0
- package/dist/components/date-picker/index.js +11 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts +11 -0
- package/dist/components/date-range-picker/date-range-picker.js +70 -0
- package/dist/components/date-range-picker/index.d.ts +13 -0
- package/dist/components/date-range-picker/index.js +11 -0
- package/dist/components/description/description.d.ts +9 -0
- package/dist/components/description/description.js +21 -0
- package/dist/components/description/index.d.ts +13 -0
- package/dist/components/description/index.js +11 -0
- package/dist/components/error-message/error-message.d.ts +9 -0
- package/dist/components/error-message/error-message.js +21 -0
- package/dist/components/error-message/index.d.ts +13 -0
- package/dist/components/error-message/index.js +11 -0
- package/dist/components/field-error/field-error.d.ts +8 -0
- package/dist/components/field-error/field-error.js +20 -0
- package/dist/components/field-error/index.d.ts +13 -0
- package/dist/components/field-error/index.js +11 -0
- package/dist/components/field-group/field-group.d.ts +11 -0
- package/dist/components/field-group/field-group.js +18 -0
- package/dist/components/field-group/index.d.ts +13 -0
- package/dist/components/field-group/index.js +11 -0
- package/dist/components/icons.d.ts +16 -0
- package/dist/components/icons.js +36 -0
- package/dist/components/index.d.ts +21 -0
- package/dist/components/input/index.d.ts +13 -0
- package/dist/components/input/index.js +11 -0
- package/dist/components/input/input.d.ts +8 -0
- package/dist/components/input/input.js +27 -0
- package/dist/components/label/index.d.ts +13 -0
- package/dist/components/label/index.js +11 -0
- package/dist/components/label/label.d.ts +8 -0
- package/dist/components/label/label.js +26 -0
- package/dist/components/popover/index.d.ts +23 -0
- package/dist/components/popover/index.js +16 -0
- package/dist/components/popover/popover.d.ts +26 -0
- package/dist/components/popover/popover.js +154 -0
- package/dist/components/range-calendar/index.d.ts +13 -0
- package/dist/components/range-calendar/index.js +11 -0
- package/dist/components/range-calendar/range-calendar.d.ts +7 -0
- package/dist/components/range-calendar/range-calendar.js +44 -0
- package/dist/components/surface/index.d.ts +14 -0
- package/dist/components/surface/index.js +12 -0
- package/dist/components/surface/surface.d.ts +12 -0
- package/dist/components/surface/surface.js +35 -0
- package/dist/components/text-field/index.d.ts +14 -0
- package/dist/components/text-field/index.js +12 -0
- package/dist/components/text-field/text-field.d.ts +18 -0
- package/dist/components/text-field/text-field.js +38 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +62 -0
- package/dist/styles/src/components/button/button.styles.js +36 -0
- package/dist/styles/src/components/button-group/button-group.styles.js +16 -0
- package/dist/styles/src/components/calendar/calendar.styles.js +25 -0
- package/dist/styles/src/components/card/card.styles.js +33 -0
- package/dist/styles/src/components/checkbox/checkbox.styles.js +25 -0
- package/dist/styles/src/components/checkbox-group/checkbox-group.styles.js +22 -0
- package/dist/styles/src/components/close-button/close-button.styles.js +15 -0
- package/dist/styles/src/components/combobox/combobox.styles.js +24 -0
- package/dist/styles/src/components/date-field/date-field.styles.js +16 -0
- package/dist/styles/src/components/date-input-group/date-input-group.styles.js +24 -0
- package/dist/styles/src/components/date-picker/date-picker.styles.js +11 -0
- package/dist/styles/src/components/date-range-picker/date-range-picker.styles.js +28 -0
- package/dist/styles/src/components/description/description.styles.js +7 -0
- package/dist/styles/src/components/error-message/error-message.styles.js +7 -0
- package/dist/styles/src/components/field-error/field-error.styles.js +7 -0
- package/dist/styles/src/components/field-group/field-group.styles.js +25 -0
- package/dist/styles/src/components/input/input.styles.js +21 -0
- package/dist/styles/src/components/label/label.styles.js +23 -0
- package/dist/styles/src/components/popover/popover.styles.js +12 -0
- package/dist/styles/src/components/range-calendar/range-calendar.styles.js +26 -0
- package/dist/styles/src/components/surface/surface.styles.js +32 -0
- package/dist/styles/src/components/text-field/text-field.styles.js +16 -0
- package/dist/styles/src/utils/state.js +13 -0
- package/dist/utils/assertion.d.ts +9 -0
- package/dist/utils/assertion.js +3 -0
- package/dist/utils/compose.d.ts +6 -0
- package/dist/utils/compose.js +18 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/styles.d.ts +16 -0
- package/dist/utils/styles.js +13 -0
- package/package.json +40 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
3
|
+
}
|
|
4
|
+
export declare const IconChevronDown: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const IconChevronRight: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const ExternalLinkIcon: ({ height, width, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const CircleDashedIcon: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const CloseIcon: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const InfoIcon: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const WarningIcon: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const DangerIcon: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const SuccessIcon: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const IconMinus: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const IconPlus: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const IconSearch: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
const IconChevronDown = props => /*#__PURE__*/jsx("svg", {
|
|
4
|
+
"aria-hidden": "true",
|
|
5
|
+
"aria-label": "Chevron down icon",
|
|
6
|
+
fill: "none",
|
|
7
|
+
role: "presentation",
|
|
8
|
+
viewBox: "0 0 16 16",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
...props,
|
|
11
|
+
children: /*#__PURE__*/jsx("path", {
|
|
12
|
+
clipRule: "evenodd",
|
|
13
|
+
d: "M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06",
|
|
14
|
+
fill: "currentColor",
|
|
15
|
+
fillRule: "evenodd"
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
const CloseIcon = props => /*#__PURE__*/jsx("svg", {
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
"aria-label": "Close icon",
|
|
21
|
+
fill: "none",
|
|
22
|
+
height: 16,
|
|
23
|
+
role: "presentation",
|
|
24
|
+
viewBox: "0 0 16 16",
|
|
25
|
+
width: 16,
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27
|
+
...props,
|
|
28
|
+
children: /*#__PURE__*/jsx("path", {
|
|
29
|
+
clipRule: "evenodd",
|
|
30
|
+
d: "M3.47 3.47a.75.75 0 0 1 1.06 0L8 6.94l3.47-3.47a.75.75 0 1 1 1.06 1.06L9.06 8l3.47 3.47a.75.75 0 1 1-1.06 1.06L8 9.06l-3.47 3.47a.75.75 0 0 1-1.06-1.06L6.94 8 3.47 4.53a.75.75 0 0 1 0-1.06Z",
|
|
31
|
+
fill: "currentColor",
|
|
32
|
+
fillRule: "evenodd"
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { CloseIcon, IconChevronDown };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from "./button";
|
|
2
|
+
export * from "./button-group";
|
|
3
|
+
export * from "./calendar";
|
|
4
|
+
export * from "./checkbox";
|
|
5
|
+
export * from "./checkbox-group";
|
|
6
|
+
export * from "./close-button";
|
|
7
|
+
export * from "./combobox";
|
|
8
|
+
export * from "./date-field";
|
|
9
|
+
export * from "./date-input-group";
|
|
10
|
+
export * from "./date-picker";
|
|
11
|
+
export * from "./date-range-picker";
|
|
12
|
+
export * from "./description";
|
|
13
|
+
export * from "./error-message";
|
|
14
|
+
export * from "./field-error";
|
|
15
|
+
export * from "./field-group";
|
|
16
|
+
export * from "./input";
|
|
17
|
+
export * from "./label";
|
|
18
|
+
export * from "./popover";
|
|
19
|
+
export * from "./range-calendar";
|
|
20
|
+
export * from "./surface";
|
|
21
|
+
export * from "./text-field";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { InputRoot } from "./input";
|
|
3
|
+
export declare const Input: (({ className, fullWidth, variant: variantProp, ...rest }: import("./input").InputRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ className, fullWidth, variant: variantProp, ...rest }: import("./input").InputRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type Input = {
|
|
7
|
+
Props: ComponentProps<typeof InputRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof InputRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { InputRoot } from "./input";
|
|
11
|
+
export type { InputRootProps, InputRootProps as InputProps, } from "./input";
|
|
12
|
+
export { inputVariants } from "@arobo/styles";
|
|
13
|
+
export type { InputVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputRoot } from './input.js';
|
|
2
|
+
export { inputVariants } from '../../styles/src/components/input/input.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const Input = Object.assign(InputRoot, {
|
|
8
|
+
Root: InputRoot
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { Input, InputRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InputVariants } from "@arobo/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { Input as InputPrimitive } from "react-aria-components";
|
|
4
|
+
interface InputRootProps extends ComponentPropsWithRef<typeof InputPrimitive>, InputVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const InputRoot: ({ className, fullWidth, variant: variantProp, ...rest }: InputRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { InputRoot };
|
|
8
|
+
export type { InputRootProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { Input } from 'react-aria-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { TextFieldContext } from '../text-field/text-field.js';
|
|
5
|
+
import { inputVariants } from '../../styles/src/components/input/input.styles.js';
|
|
6
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
7
|
+
|
|
8
|
+
const InputRoot = ({
|
|
9
|
+
className,
|
|
10
|
+
fullWidth,
|
|
11
|
+
variant: variantProp,
|
|
12
|
+
...rest
|
|
13
|
+
}) => {
|
|
14
|
+
const context = useContext(TextFieldContext);
|
|
15
|
+
// Use variant from context if not explicitly provided
|
|
16
|
+
const variant = variantProp ?? context.variant;
|
|
17
|
+
return /*#__PURE__*/jsx(Input, {
|
|
18
|
+
className: composeTwRenderProps(className, inputVariants({
|
|
19
|
+
fullWidth,
|
|
20
|
+
variant
|
|
21
|
+
})),
|
|
22
|
+
"data-slot": "input",
|
|
23
|
+
...rest
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { InputRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { LabelRoot } from "./label";
|
|
3
|
+
export declare const Label: (({ children, className, isDisabled, isInvalid, isRequired, ...rest }: import("./label").LabelRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, isDisabled, isInvalid, isRequired, ...rest }: import("./label").LabelRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type Label = {
|
|
7
|
+
Props: ComponentProps<typeof LabelRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof LabelRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { LabelRoot };
|
|
11
|
+
export type { LabelRootProps, LabelRootProps as LabelProps } from "./label";
|
|
12
|
+
export { labelVariants } from "@arobo/styles";
|
|
13
|
+
export type { LabelVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LabelRoot } from './label.js';
|
|
2
|
+
export { labelVariants } from '../../styles/src/components/label/label.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const Label = Object.assign(LabelRoot, {
|
|
8
|
+
Root: LabelRoot
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { Label, LabelRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LabelVariants } from "@arobo/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { Label as LabelPrimitive } from "react-aria-components";
|
|
4
|
+
interface LabelRootProps extends ComponentPropsWithRef<typeof LabelPrimitive>, LabelVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const LabelRoot: ({ children, className, isDisabled, isInvalid, isRequired, ...rest }: LabelRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { LabelRoot };
|
|
8
|
+
export type { LabelRootProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Label } from 'react-aria-components';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { labelVariants } from '../../styles/src/components/label/label.styles.js';
|
|
4
|
+
|
|
5
|
+
const LabelRoot = ({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
isDisabled,
|
|
9
|
+
isInvalid,
|
|
10
|
+
isRequired,
|
|
11
|
+
...rest
|
|
12
|
+
}) => {
|
|
13
|
+
return /*#__PURE__*/jsx(Label, {
|
|
14
|
+
className: labelVariants({
|
|
15
|
+
isRequired,
|
|
16
|
+
isDisabled,
|
|
17
|
+
isInvalid,
|
|
18
|
+
className
|
|
19
|
+
}),
|
|
20
|
+
"data-slot": "label",
|
|
21
|
+
...rest,
|
|
22
|
+
children: children
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { LabelRoot };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { PopoverArrow, PopoverContent, PopoverDialog, PopoverHeading, PopoverRoot, PopoverTrigger } from "./popover";
|
|
3
|
+
export declare const Popover: (({ children, ...props }: import("react").ComponentPropsWithRef<typeof import("react-aria-components").DialogTrigger>) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, ...props }: import("react").ComponentPropsWithRef<typeof import("react-aria-components").DialogTrigger>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Trigger: ({ children, className, ...props }: import("./popover").PopoverTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Dialog: ({ children, className, ...props }: import("./popover").PopoverDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Arrow: ({ children, className, ...props }: import("./popover").PopoverArrowProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Content: ({ children, className, ...props }: import("./popover").PopoverContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Heading: ({ children, className, ...props }: import("./popover").PopoverHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
export type Popover = {
|
|
12
|
+
Props: ComponentProps<typeof PopoverRoot>;
|
|
13
|
+
RootProps: ComponentProps<typeof PopoverRoot>;
|
|
14
|
+
TriggerProps: ComponentProps<typeof PopoverTrigger>;
|
|
15
|
+
DialogProps: ComponentProps<typeof PopoverDialog>;
|
|
16
|
+
ArrowProps: ComponentProps<typeof PopoverArrow>;
|
|
17
|
+
ContentProps: ComponentProps<typeof PopoverContent>;
|
|
18
|
+
HeadingProps: ComponentProps<typeof PopoverHeading>;
|
|
19
|
+
};
|
|
20
|
+
export { PopoverArrow, PopoverContent, PopoverDialog, PopoverHeading, PopoverRoot, PopoverTrigger, };
|
|
21
|
+
export type { PopoverRootProps, PopoverRootProps as PopoverProps, PopoverTriggerProps, PopoverDialogProps, PopoverArrowProps, PopoverContentProps, PopoverHeadingProps, } from "./popover";
|
|
22
|
+
export { popoverVariants } from "@arobo/styles";
|
|
23
|
+
export type { PopoverVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PopoverRoot, PopoverHeading, PopoverContent, PopoverArrow, PopoverDialog, PopoverTrigger } from './popover.js';
|
|
2
|
+
export { popoverVariants } from '../../styles/src/components/popover/popover.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const Popover = Object.assign(PopoverRoot, {
|
|
8
|
+
Root: PopoverRoot,
|
|
9
|
+
Trigger: PopoverTrigger,
|
|
10
|
+
Dialog: PopoverDialog,
|
|
11
|
+
Arrow: PopoverArrow,
|
|
12
|
+
Content: PopoverContent,
|
|
13
|
+
Heading: PopoverHeading
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { Popover, PopoverArrow, PopoverContent, PopoverDialog, PopoverHeading, PopoverRoot, PopoverTrigger };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PopoverVariants } from "@arobo/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Dialog as DialogPrimitive, Heading as HeadingPrimitive, OverlayArrow, Popover as PopoverPrimitive, DialogTrigger as PopoverTriggerPrimitive } from "react-aria-components";
|
|
5
|
+
type PopoverRootProps = ComponentPropsWithRef<typeof PopoverTriggerPrimitive>;
|
|
6
|
+
declare const PopoverRoot: ({ children, ...props }: ComponentPropsWithRef<typeof PopoverTriggerPrimitive>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
interface PopoverContentProps extends Omit<ComponentPropsWithRef<typeof PopoverPrimitive>, "children">, PopoverVariants {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const PopoverContent: ({ children, className, ...props }: PopoverContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
type PopoverArrowProps = Omit<ComponentPropsWithRef<typeof OverlayArrow>, "children"> & {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
declare const PopoverArrow: ({ children, className, ...props }: PopoverArrowProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
type PopoverDialogProps = Omit<ComponentPropsWithRef<typeof DialogPrimitive>, "children"> & {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
};
|
|
18
|
+
declare const PopoverDialog: ({ children, className, ...props }: PopoverDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
type PopoverTriggerProps = ComponentPropsWithRef<"div"> & {
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
};
|
|
22
|
+
declare const PopoverTrigger: ({ children, className, ...props }: PopoverTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
type PopoverHeadingProps = ComponentPropsWithRef<typeof HeadingPrimitive> & {};
|
|
24
|
+
declare const PopoverHeading: ({ children, className, ...props }: PopoverHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { PopoverRoot, PopoverTrigger, PopoverDialog, PopoverArrow, PopoverContent, PopoverHeading, };
|
|
26
|
+
export type { PopoverRootProps, PopoverTriggerProps, PopoverDialogProps, PopoverArrowProps, PopoverContentProps, PopoverHeadingProps, };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
import { DialogTrigger, Heading, Popover, OverlayArrow, Dialog, Pressable } from 'react-aria-components';
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import { composeSlotClassName, composeTwRenderProps } from '../../utils/compose.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import { popoverVariants } from '../../styles/src/components/popover/popover.styles.js';
|
|
7
|
+
import { SurfaceContext } from '../surface/surface.js';
|
|
8
|
+
|
|
9
|
+
const PopoverContext = /*#__PURE__*/createContext({});
|
|
10
|
+
|
|
11
|
+
/* -------------------------------------------------------------------------------------------------
|
|
12
|
+
* Popover Root
|
|
13
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
14
|
+
|
|
15
|
+
const PopoverRoot = ({
|
|
16
|
+
children,
|
|
17
|
+
...props
|
|
18
|
+
}) => {
|
|
19
|
+
const slots = React.useMemo(() => popoverVariants(), []);
|
|
20
|
+
return /*#__PURE__*/jsx(PopoverContext, {
|
|
21
|
+
value: {
|
|
22
|
+
slots
|
|
23
|
+
},
|
|
24
|
+
children: /*#__PURE__*/jsx(DialogTrigger, {
|
|
25
|
+
"data-slot": "popover-root",
|
|
26
|
+
...props,
|
|
27
|
+
children: children
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/* -------------------------------------------------------------------------------------------------
|
|
33
|
+
* Popover Content
|
|
34
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
35
|
+
|
|
36
|
+
const PopoverContent = ({
|
|
37
|
+
children,
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}) => {
|
|
41
|
+
const {
|
|
42
|
+
slots
|
|
43
|
+
} = useContext(PopoverContext);
|
|
44
|
+
return /*#__PURE__*/jsx(PopoverContext, {
|
|
45
|
+
value: {
|
|
46
|
+
slots
|
|
47
|
+
},
|
|
48
|
+
children: /*#__PURE__*/jsx(SurfaceContext, {
|
|
49
|
+
value: {
|
|
50
|
+
variant: "default"
|
|
51
|
+
},
|
|
52
|
+
children: /*#__PURE__*/jsx(Popover, {
|
|
53
|
+
...props,
|
|
54
|
+
className: composeTwRenderProps(className, slots?.base()),
|
|
55
|
+
children: children
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/* -------------------------------------------------------------------------------------------------
|
|
62
|
+
* Popover Arrow
|
|
63
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
64
|
+
|
|
65
|
+
const PopoverArrow = ({
|
|
66
|
+
children,
|
|
67
|
+
className,
|
|
68
|
+
...props
|
|
69
|
+
}) => {
|
|
70
|
+
const defaultArrow = /*#__PURE__*/jsx("svg", {
|
|
71
|
+
width: 12,
|
|
72
|
+
height: 12,
|
|
73
|
+
viewBox: "0 0 12 12",
|
|
74
|
+
"data-slot": "popover-overlay-arrow",
|
|
75
|
+
children: /*#__PURE__*/jsx("path", {
|
|
76
|
+
d: "M0 0 L6 6 L12 0"
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
const arrow = /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, {
|
|
80
|
+
"data-slot": "popover-overlay-arrow"
|
|
81
|
+
}) : defaultArrow;
|
|
82
|
+
return /*#__PURE__*/jsx(OverlayArrow, {
|
|
83
|
+
"data-slot": "popover-overlay-arrow-group",
|
|
84
|
+
...props,
|
|
85
|
+
className: className,
|
|
86
|
+
children: arrow
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/* -------------------------------------------------------------------------------------------------
|
|
91
|
+
* Popover Dialog
|
|
92
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
93
|
+
|
|
94
|
+
const PopoverDialog = ({
|
|
95
|
+
children,
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}) => {
|
|
99
|
+
const {
|
|
100
|
+
slots
|
|
101
|
+
} = useContext(PopoverContext);
|
|
102
|
+
return /*#__PURE__*/jsx(Dialog, {
|
|
103
|
+
"data-slot": "popover-dialog",
|
|
104
|
+
...props,
|
|
105
|
+
className: composeSlotClassName(slots?.dialog, className),
|
|
106
|
+
children: children
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/* -------------------------------------------------------------------------------------------------
|
|
111
|
+
* Popover Trigger
|
|
112
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
113
|
+
|
|
114
|
+
const PopoverTrigger = ({
|
|
115
|
+
children,
|
|
116
|
+
className,
|
|
117
|
+
...props
|
|
118
|
+
}) => {
|
|
119
|
+
const {
|
|
120
|
+
slots
|
|
121
|
+
} = useContext(PopoverContext);
|
|
122
|
+
const Component = props.asChild ? Slot : "div";
|
|
123
|
+
return /*#__PURE__*/jsx(Pressable, {
|
|
124
|
+
children: /*#__PURE__*/jsx(Component, {
|
|
125
|
+
className: composeSlotClassName(slots?.trigger, className),
|
|
126
|
+
"data-slot": "popover-trigger",
|
|
127
|
+
role: "button",
|
|
128
|
+
...props,
|
|
129
|
+
children: children
|
|
130
|
+
})
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/* -------------------------------------------------------------------------------------------------
|
|
135
|
+
* Popover Heading
|
|
136
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
137
|
+
|
|
138
|
+
const PopoverHeading = ({
|
|
139
|
+
children,
|
|
140
|
+
className,
|
|
141
|
+
...props
|
|
142
|
+
}) => {
|
|
143
|
+
const {
|
|
144
|
+
slots
|
|
145
|
+
} = useContext(PopoverContext);
|
|
146
|
+
return /*#__PURE__*/jsx(Heading, {
|
|
147
|
+
slot: "title",
|
|
148
|
+
...props,
|
|
149
|
+
className: composeSlotClassName(slots?.heading, className),
|
|
150
|
+
children: children
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export { PopoverArrow, PopoverContent, PopoverDialog, PopoverHeading, PopoverRoot, PopoverTrigger };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { RangeCalendarRoot } from "./range-calendar";
|
|
3
|
+
export declare const RangeCalendar: (<T extends import("react-aria-components").DateValue>({ errorMessage, ...props }: import("./range-calendar").RangeCalendarRootProps<T>) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: <T extends import("react-aria-components").DateValue>({ errorMessage, ...props }: import("./range-calendar").RangeCalendarRootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type RangeCalendar = {
|
|
7
|
+
Props: ComponentProps<typeof RangeCalendarRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof RangeCalendarRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { RangeCalendarRoot } from "./range-calendar";
|
|
11
|
+
export type { RangeCalendarRootProps, RangeCalendarRootProps as RangeCalendarProps, } from "./range-calendar";
|
|
12
|
+
export { rangeCalendarVariants } from "@arobo/styles";
|
|
13
|
+
export type { RangeCalendarVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RangeCalendarRoot } from './range-calendar.js';
|
|
2
|
+
export { rangeCalendarVariants } from '../../styles/src/components/range-calendar/range-calendar.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const RangeCalendar = Object.assign(RangeCalendarRoot, {
|
|
8
|
+
Root: RangeCalendarRoot
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { RangeCalendar, RangeCalendarRoot };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RangeCalendarProps as RangeCalendarPrimitiveProps, DateValue } from "react-aria-components";
|
|
2
|
+
interface RangeCalendarRootProps<T extends DateValue> extends Omit<RangeCalendarPrimitiveProps<T>, "visibleDuration"> {
|
|
3
|
+
errorMessage?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const RangeCalendarRoot: <T extends DateValue>({ errorMessage, ...props }: RangeCalendarRootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { RangeCalendarRoot };
|
|
7
|
+
export type { RangeCalendarRootProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { RangeCalendar, CalendarGrid, CalendarGridBody, CalendarCell } from 'react-aria-components';
|
|
2
|
+
import { ErrorMessage } from '../error-message/index.js';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { CalendarHeader, CalendarGridHeader } from '../calendar/calendar.js';
|
|
5
|
+
import { rangeCalendarVariants } from '../../styles/src/components/range-calendar/range-calendar.styles.js';
|
|
6
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
7
|
+
|
|
8
|
+
const RangeCalendarRoot = ({
|
|
9
|
+
errorMessage,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
return /*#__PURE__*/jsxs(RangeCalendar, {
|
|
13
|
+
...props,
|
|
14
|
+
className: composeTwRenderProps(props.className, rangeCalendarVariants.base),
|
|
15
|
+
children: [/*#__PURE__*/jsx(CalendarHeader, {}), /*#__PURE__*/jsxs(CalendarGrid, {
|
|
16
|
+
className: rangeCalendarVariants.slots.grid,
|
|
17
|
+
children: [/*#__PURE__*/jsx(CalendarGridHeader, {}), /*#__PURE__*/jsx(CalendarGridBody, {
|
|
18
|
+
children: date => /*#__PURE__*/jsx(CalendarCell, {
|
|
19
|
+
date: date,
|
|
20
|
+
className: rangeCalendarVariants.slots.cell,
|
|
21
|
+
children: ({
|
|
22
|
+
formattedDate,
|
|
23
|
+
isSelected,
|
|
24
|
+
isSelectionStart,
|
|
25
|
+
isSelectionEnd,
|
|
26
|
+
isFocusVisible,
|
|
27
|
+
isDisabled
|
|
28
|
+
}) => /*#__PURE__*/jsx("span", {
|
|
29
|
+
"data-slot": "cell-content",
|
|
30
|
+
"data-selection-state": isSelected && (isSelectionStart || isSelectionEnd) ? "cap" : isSelected ? "middle" : "none",
|
|
31
|
+
"data-disabled": isDisabled ? true : undefined,
|
|
32
|
+
"data-focus-visible": isFocusVisible ? true : undefined,
|
|
33
|
+
children: formattedDate
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
})]
|
|
37
|
+
}), errorMessage && /*#__PURE__*/jsx(ErrorMessage, {
|
|
38
|
+
slot: "errorMessage",
|
|
39
|
+
children: errorMessage
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { RangeCalendarRoot };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { SurfaceRoot } from "./surface";
|
|
3
|
+
export declare const Surface: (({ children, className, variant, effect, ...rest }: import("./surface").SurfaceRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, variant, effect, ...rest }: import("./surface").SurfaceRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type Surface = {
|
|
7
|
+
Props: ComponentProps<typeof SurfaceRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof SurfaceRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { SurfaceRoot } from "./surface";
|
|
11
|
+
export type { SurfaceRootProps, SurfaceRootProps as SurfaceProps, } from "./surface";
|
|
12
|
+
export { SurfaceContext } from "./surface";
|
|
13
|
+
export { surfaceVariants } from "@arobo/styles";
|
|
14
|
+
export type { SurfaceVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SurfaceRoot } from './surface.js';
|
|
2
|
+
export { SurfaceContext } from './surface.js';
|
|
3
|
+
export { surfaceVariants } from '../../styles/src/components/surface/surface.styles.js';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const Surface = Object.assign(SurfaceRoot, {
|
|
9
|
+
Root: SurfaceRoot
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { Surface, SurfaceRoot };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SurfaceVariants } from "@arobo/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
type SurfaceContext = {
|
|
5
|
+
variant?: SurfaceVariants["variant"];
|
|
6
|
+
};
|
|
7
|
+
declare const SurfaceContext: React.Context<SurfaceContext>;
|
|
8
|
+
interface SurfaceRootProps extends ComponentPropsWithRef<"div">, SurfaceVariants {
|
|
9
|
+
}
|
|
10
|
+
declare const SurfaceRoot: ({ children, className, variant, effect, ...rest }: SurfaceRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { SurfaceRoot, SurfaceContext };
|
|
12
|
+
export type { SurfaceRootProps };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { surfaceVariants } from '../../styles/src/components/surface/surface.styles.js';
|
|
4
|
+
|
|
5
|
+
const SurfaceContext = /*#__PURE__*/createContext({});
|
|
6
|
+
|
|
7
|
+
/* ------------------------------------------------------------------------------------------------
|
|
8
|
+
* Surface Root
|
|
9
|
+
* --------------------------------------------------------------------------------------------- */
|
|
10
|
+
|
|
11
|
+
const SurfaceRoot = ({
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
variant = "default",
|
|
15
|
+
effect = "none",
|
|
16
|
+
...rest
|
|
17
|
+
}) => {
|
|
18
|
+
return /*#__PURE__*/jsx(SurfaceContext, {
|
|
19
|
+
value: {
|
|
20
|
+
variant
|
|
21
|
+
},
|
|
22
|
+
children: /*#__PURE__*/jsx("div", {
|
|
23
|
+
className: surfaceVariants({
|
|
24
|
+
variant,
|
|
25
|
+
className,
|
|
26
|
+
effect
|
|
27
|
+
}),
|
|
28
|
+
"data-slot": "surface",
|
|
29
|
+
...rest,
|
|
30
|
+
children: children
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { SurfaceContext, SurfaceRoot };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { TextFieldRoot } from "./text-field";
|
|
3
|
+
export declare const TextField: (({ children, className, fullWidth, variant, ...props }: import("./text-field").TextFieldRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, fullWidth, variant, ...props }: import("./text-field").TextFieldRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type TextField = {
|
|
7
|
+
Props: ComponentProps<typeof TextFieldRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof TextFieldRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { TextFieldRoot };
|
|
11
|
+
export type { TextFieldRootProps, TextFieldRootProps as TextFieldProps, } from "./text-field";
|
|
12
|
+
export { TextFieldContext } from "./text-field";
|
|
13
|
+
export { textFieldVariants } from "@arobo/styles";
|
|
14
|
+
export type { TextFieldVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TextFieldRoot } from './text-field.js';
|
|
2
|
+
export { TextFieldContext } from './text-field.js';
|
|
3
|
+
export { textFieldVariants } from '../../styles/src/components/text-field/text-field.styles.js';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const TextField = Object.assign(TextFieldRoot, {
|
|
9
|
+
Root: TextFieldRoot
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { TextField, TextFieldRoot };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TextFieldVariants } from "@arobo/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { TextField as TextFieldPrimitive } from "react-aria-components";
|
|
5
|
+
type TextFieldContext = {
|
|
6
|
+
variant?: "primary" | "secondary";
|
|
7
|
+
};
|
|
8
|
+
declare const TextFieldContext: React.Context<TextFieldContext>;
|
|
9
|
+
interface TextFieldRootProps extends ComponentPropsWithRef<typeof TextFieldPrimitive>, TextFieldVariants {
|
|
10
|
+
/**
|
|
11
|
+
* The variant of the text field.
|
|
12
|
+
* @default "primary"
|
|
13
|
+
*/
|
|
14
|
+
variant?: "primary" | "secondary";
|
|
15
|
+
}
|
|
16
|
+
declare const TextFieldRoot: ({ children, className, fullWidth, variant, ...props }: TextFieldRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export { TextFieldRoot, TextFieldContext };
|
|
18
|
+
export type { TextFieldRootProps };
|