@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,140 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
import { Group, DateSegment, DateInput } from 'react-aria-components';
|
|
3
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
4
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
+
import { dateInputGroupVariants } from '../../styles/src/components/date-input-group/date-input-group.styles.js';
|
|
6
|
+
|
|
7
|
+
const DateInputGroupContext = /*#__PURE__*/createContext({});
|
|
8
|
+
|
|
9
|
+
/* -------------------------------------------------------------------------------------------------
|
|
10
|
+
* DateInputGroup Root
|
|
11
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
12
|
+
|
|
13
|
+
const DateInputGroupRoot = ({
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
fullWidth,
|
|
17
|
+
...props
|
|
18
|
+
}) => {
|
|
19
|
+
const slots = React.useMemo(() => dateInputGroupVariants({
|
|
20
|
+
fullWidth
|
|
21
|
+
}), [fullWidth]);
|
|
22
|
+
return /*#__PURE__*/jsx(DateInputGroupContext, {
|
|
23
|
+
value: {
|
|
24
|
+
slots
|
|
25
|
+
},
|
|
26
|
+
children: /*#__PURE__*/jsx(Group, {
|
|
27
|
+
className: composeTwRenderProps(className, slots?.base()),
|
|
28
|
+
"data-slot": "date-input-group",
|
|
29
|
+
...props,
|
|
30
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
31
|
+
children: typeof children === "function" ? children(values) : children
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/* -------------------------------------------------------------------------------------------------
|
|
38
|
+
* DateInputGroup Prefix
|
|
39
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
40
|
+
|
|
41
|
+
const DateInputGroupPrefix = ({
|
|
42
|
+
children,
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}) => {
|
|
46
|
+
const {
|
|
47
|
+
slots
|
|
48
|
+
} = useContext(DateInputGroupContext);
|
|
49
|
+
return /*#__PURE__*/jsx("div", {
|
|
50
|
+
className: composeSlotClassName(slots?.prefix, className),
|
|
51
|
+
"data-slot": "date-input-group-prefix",
|
|
52
|
+
...props,
|
|
53
|
+
children: children
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/* -------------------------------------------------------------------------------------------------
|
|
58
|
+
* DateInputGroup Input
|
|
59
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
60
|
+
|
|
61
|
+
const DateInputGroupInput = ({
|
|
62
|
+
className,
|
|
63
|
+
...props
|
|
64
|
+
}) => {
|
|
65
|
+
const {
|
|
66
|
+
slots
|
|
67
|
+
} = useContext(DateInputGroupContext);
|
|
68
|
+
|
|
69
|
+
// TimeInput and DateInput have compatible interfaces
|
|
70
|
+
// React Aria Components will handle the correct primitive based on parent context (TimeField vs DateField)
|
|
71
|
+
// We use DateInputPrimitive as the default, but it will work with TimeField context
|
|
72
|
+
return /*#__PURE__*/jsx(DateInput, {
|
|
73
|
+
className: composeTwRenderProps(className, slots?.input()),
|
|
74
|
+
"data-slot": "date-input-group-input",
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/* -------------------------------------------------------------------------------------------------
|
|
80
|
+
* DateInputGroup Segment
|
|
81
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
82
|
+
|
|
83
|
+
const DateInputGroupSegment = ({
|
|
84
|
+
className,
|
|
85
|
+
segment,
|
|
86
|
+
...props
|
|
87
|
+
}) => {
|
|
88
|
+
const {
|
|
89
|
+
slots
|
|
90
|
+
} = useContext(DateInputGroupContext);
|
|
91
|
+
|
|
92
|
+
// TimeSegment and DateSegment have compatible interfaces
|
|
93
|
+
// React Aria Components will handle the correct primitive based on parent context
|
|
94
|
+
// We use DateSegmentPrimitive as the default, but it will work with TimeField context
|
|
95
|
+
return /*#__PURE__*/jsx(DateSegment, {
|
|
96
|
+
className: composeSlotClassName(slots?.segment, className),
|
|
97
|
+
"data-slot": "date-input-group-segment",
|
|
98
|
+
segment: segment,
|
|
99
|
+
...props
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/* -------------------------------------------------------------------------------------------------
|
|
104
|
+
* DateInputGroup Compound
|
|
105
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
106
|
+
|
|
107
|
+
const DateInputGroupInputCompound = ({
|
|
108
|
+
className,
|
|
109
|
+
...props
|
|
110
|
+
}) => {
|
|
111
|
+
return /*#__PURE__*/jsx(DateInputGroupInput, {
|
|
112
|
+
className: composeTwRenderProps(className),
|
|
113
|
+
...props,
|
|
114
|
+
children: segment => /*#__PURE__*/jsx(DateInputGroupSegment, {
|
|
115
|
+
segment: segment
|
|
116
|
+
})
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/* -------------------------------------------------------------------------------------------------
|
|
121
|
+
* DateInputGroup Suffix
|
|
122
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
123
|
+
|
|
124
|
+
const DateInputGroupSuffix = ({
|
|
125
|
+
children,
|
|
126
|
+
className,
|
|
127
|
+
...props
|
|
128
|
+
}) => {
|
|
129
|
+
const {
|
|
130
|
+
slots
|
|
131
|
+
} = useContext(DateInputGroupContext);
|
|
132
|
+
return /*#__PURE__*/jsx("div", {
|
|
133
|
+
className: composeSlotClassName(slots?.suffix, className),
|
|
134
|
+
"data-slot": "date-input-group-suffix",
|
|
135
|
+
...props,
|
|
136
|
+
children: children
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export { DateInputGroupInput, DateInputGroupInputCompound, DateInputGroupPrefix, DateInputGroupRoot, DateInputGroupSegment, DateInputGroupSuffix };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { DateInputGroupInput, DateInputGroupInputCompound, DateInputGroupPrefix, DateInputGroupRoot, DateInputGroupSegment, DateInputGroupSuffix } from "./date-input-group";
|
|
3
|
+
export declare const DateInputGroup: (({ children, className, fullWidth, ...props }: import("./date-input-group").DateInputGroupRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, fullWidth, ...props }: import("./date-input-group").DateInputGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Input: ({ className, ...props }: import("./date-input-group").DateInputGroupInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Segment: ({ className, segment, ...props }: import("./date-input-group").DateInputGroupSegmentProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Prefix: ({ children, className, ...props }: import("./date-input-group").DateInputGroupPrefixProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Suffix: ({ children, className, ...props }: import("./date-input-group").DateInputGroupSuffixProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
InputCompound: ({ className, ...props }: import("./date-input-group").DateInputGroupInputCompoundProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
export type DateInputGroup = {
|
|
12
|
+
Props: ComponentProps<typeof DateInputGroupRoot>;
|
|
13
|
+
RootProps: ComponentProps<typeof DateInputGroupRoot>;
|
|
14
|
+
InputProps: ComponentProps<typeof DateInputGroupInput>;
|
|
15
|
+
SegmentProps: ComponentProps<typeof DateInputGroupSegment>;
|
|
16
|
+
PrefixProps: ComponentProps<typeof DateInputGroupPrefix>;
|
|
17
|
+
SuffixProps: ComponentProps<typeof DateInputGroupSuffix>;
|
|
18
|
+
InputCompoundProps: ComponentProps<typeof DateInputGroupInputCompound>;
|
|
19
|
+
};
|
|
20
|
+
export { DateInputGroupInput, DateInputGroupPrefix, DateInputGroupRoot, DateInputGroupSegment, DateInputGroupSuffix, DateInputGroupInputCompound, };
|
|
21
|
+
export type { DateInputGroupRootProps, DateInputGroupRootProps as DateInputGroupProps, DateInputGroupInputProps, DateInputGroupSegmentProps, DateInputGroupPrefixProps, DateInputGroupSuffixProps, DateInputGroupInputCompoundProps, } from "./date-input-group";
|
|
22
|
+
export { dateInputGroupVariants } from "@arobo/styles";
|
|
23
|
+
export type { DateInputGroupVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DateInputGroupRoot, DateInputGroupInputCompound, DateInputGroupSuffix, DateInputGroupPrefix, DateInputGroupSegment, DateInputGroupInput } from './date-input-group.js';
|
|
2
|
+
export { dateInputGroupVariants } from '../../styles/src/components/date-input-group/date-input-group.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const DateInputGroup = Object.assign(DateInputGroupRoot, {
|
|
8
|
+
Root: DateInputGroupRoot,
|
|
9
|
+
Input: DateInputGroupInput,
|
|
10
|
+
Segment: DateInputGroupSegment,
|
|
11
|
+
Prefix: DateInputGroupPrefix,
|
|
12
|
+
Suffix: DateInputGroupSuffix,
|
|
13
|
+
InputCompound: DateInputGroupInputCompound
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { DateInputGroup, DateInputGroupInput, DateInputGroupInputCompound, DateInputGroupPrefix, DateInputGroupRoot, DateInputGroupSegment, DateInputGroupSuffix };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DatePickerProps as DatePickerPrimitiveProps, DateValue, ValidationResult } from "react-aria-components";
|
|
3
|
+
interface DatePickerRootProps<T extends DateValue> extends DatePickerPrimitiveProps<T> {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function DatePickerRoot<T extends DateValue>({ label, description, errorMessage, icon, ...props }: DatePickerRootProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { DatePickerRoot };
|
|
11
|
+
export type { DatePickerRootProps };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CalendarIcon } from 'lucide-react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { DatePicker } from 'react-aria-components';
|
|
4
|
+
import { Button } from '../button/index.js';
|
|
5
|
+
import { Calendar } from '../calendar/index.js';
|
|
6
|
+
import { DateInputGroup } from '../date-input-group/index.js';
|
|
7
|
+
import { Description } from '../description/index.js';
|
|
8
|
+
import { FieldError } from '../field-error/index.js';
|
|
9
|
+
import { Label } from '../label/index.js';
|
|
10
|
+
import { Popover } from '../popover/index.js';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
+
import { datePickerVariants } from '../../styles/src/components/date-picker/date-picker.styles.js';
|
|
13
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
14
|
+
|
|
15
|
+
function DatePickerRoot({
|
|
16
|
+
label,
|
|
17
|
+
description,
|
|
18
|
+
errorMessage,
|
|
19
|
+
icon,
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
const slots = React.useMemo(() => datePickerVariants({}), []);
|
|
23
|
+
const finalIcon = icon ?? /*#__PURE__*/jsx(CalendarIcon, {
|
|
24
|
+
"aria-hidden": true
|
|
25
|
+
});
|
|
26
|
+
const iconSegment = /*#__PURE__*/React.isValidElement(finalIcon) ? /*#__PURE__*/React.cloneElement(finalIcon, {
|
|
27
|
+
"data-slot": "icon",
|
|
28
|
+
"aria-hidden": true
|
|
29
|
+
}) : finalIcon;
|
|
30
|
+
return (
|
|
31
|
+
/*#__PURE__*/
|
|
32
|
+
// The Popover component provides context for the DatePickerPrimitive to control its
|
|
33
|
+
// behavior.
|
|
34
|
+
jsx(Popover, {
|
|
35
|
+
children: /*#__PURE__*/jsxs(DatePicker, {
|
|
36
|
+
...props,
|
|
37
|
+
className: composeTwRenderProps(props.className, slots.base()),
|
|
38
|
+
children: [label && /*#__PURE__*/jsx(Label, {
|
|
39
|
+
children: label
|
|
40
|
+
}), /*#__PURE__*/jsxs(DateInputGroup, {
|
|
41
|
+
children: [/*#__PURE__*/jsx(DateInputGroup.InputCompound, {
|
|
42
|
+
className: slots.input()
|
|
43
|
+
}), /*#__PURE__*/jsx(Popover.Trigger, {
|
|
44
|
+
asChild: true,
|
|
45
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
46
|
+
isIconOnly: true,
|
|
47
|
+
variant: "ghost",
|
|
48
|
+
"data-slot": "trigger",
|
|
49
|
+
className: slots.trigger(),
|
|
50
|
+
children: iconSegment
|
|
51
|
+
})
|
|
52
|
+
})]
|
|
53
|
+
}), description && /*#__PURE__*/jsx(Description, {
|
|
54
|
+
children: description
|
|
55
|
+
}), /*#__PURE__*/jsx(FieldError, {
|
|
56
|
+
children: errorMessage
|
|
57
|
+
}), /*#__PURE__*/jsx(Popover.Content, {
|
|
58
|
+
children: /*#__PURE__*/jsx(Popover.Dialog, {
|
|
59
|
+
children: /*#__PURE__*/jsx(Calendar, {})
|
|
60
|
+
})
|
|
61
|
+
})]
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { DatePickerRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { DatePickerRoot } from "./date-picker";
|
|
3
|
+
export declare const DatePicker: typeof DatePickerRoot & {
|
|
4
|
+
Root: typeof DatePickerRoot;
|
|
5
|
+
};
|
|
6
|
+
export type DatePicker = {
|
|
7
|
+
Props: ComponentProps<typeof DatePickerRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof DatePickerRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { DatePickerRoot } from "./date-picker";
|
|
11
|
+
export type { DatePickerRootProps, DatePickerRootProps as DatePickerProps, } from "./date-picker";
|
|
12
|
+
export { datePickerVariants } from "@arobo/styles";
|
|
13
|
+
export type { DatePickerVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DatePickerRoot } from './date-picker.js';
|
|
2
|
+
export { datePickerVariants } from '../../styles/src/components/date-picker/date-picker.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const DatePicker = Object.assign(DatePickerRoot, {
|
|
8
|
+
Root: DatePickerRoot
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { DatePicker, DatePickerRoot };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DateRangePickerProps as DateRangePickerPrimitiveProps, DateValue, ValidationResult } from "react-aria-components";
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface DateRangePickerRootProps<T extends DateValue> extends DateRangePickerPrimitiveProps<T> {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const DateRangePickerRoot: <T extends DateValue>({ label, description, errorMessage, icon, ...props }: DateRangePickerRootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { DateRangePickerRoot };
|
|
11
|
+
export type { DateRangePickerRootProps };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CalendarIcon } from 'lucide-react';
|
|
2
|
+
import { DateRangePicker } from 'react-aria-components';
|
|
3
|
+
import { Button } from '../button/index.js';
|
|
4
|
+
import { DateInputGroup } from '../date-input-group/index.js';
|
|
5
|
+
import { Description } from '../description/index.js';
|
|
6
|
+
import { FieldError } from '../field-error/index.js';
|
|
7
|
+
import { Label } from '../label/index.js';
|
|
8
|
+
import { Popover } from '../popover/index.js';
|
|
9
|
+
import { RangeCalendar } from '../range-calendar/index.js';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
+
import { dateRangePickerVariants } from '../../styles/src/components/date-range-picker/date-range-picker.styles.js';
|
|
13
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
14
|
+
|
|
15
|
+
const DateRangePickerRoot = ({
|
|
16
|
+
label,
|
|
17
|
+
description,
|
|
18
|
+
errorMessage,
|
|
19
|
+
icon,
|
|
20
|
+
...props
|
|
21
|
+
}) => {
|
|
22
|
+
const slots = React.useMemo(() => dateRangePickerVariants({}), []);
|
|
23
|
+
const finalIcon = icon ?? /*#__PURE__*/jsx(CalendarIcon, {
|
|
24
|
+
"aria-hidden": true
|
|
25
|
+
});
|
|
26
|
+
const iconSegment = /*#__PURE__*/React.isValidElement(finalIcon) ? /*#__PURE__*/React.cloneElement(finalIcon, {
|
|
27
|
+
"data-slot": "icon",
|
|
28
|
+
"aria-hidden": true
|
|
29
|
+
}) : finalIcon;
|
|
30
|
+
return /*#__PURE__*/jsx(Popover.Root, {
|
|
31
|
+
children: /*#__PURE__*/jsxs(DateRangePicker, {
|
|
32
|
+
...props,
|
|
33
|
+
className: composeTwRenderProps(props.className, "group flex flex-col gap-1 font-sans"),
|
|
34
|
+
children: [label && /*#__PURE__*/jsx(Label, {
|
|
35
|
+
children: label
|
|
36
|
+
}), /*#__PURE__*/jsxs(DateInputGroup, {
|
|
37
|
+
className: slots.inputGroup(),
|
|
38
|
+
children: [/*#__PURE__*/jsx(DateInputGroup.InputCompound, {
|
|
39
|
+
slot: "start",
|
|
40
|
+
className: slots.input()
|
|
41
|
+
}), /*#__PURE__*/jsx("span", {
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
className: slots.separator(),
|
|
44
|
+
children: "\u2013"
|
|
45
|
+
}), /*#__PURE__*/jsx(DateInputGroup.InputCompound, {
|
|
46
|
+
slot: "end",
|
|
47
|
+
className: slots.input()
|
|
48
|
+
}), /*#__PURE__*/jsx(Popover.Trigger, {
|
|
49
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
50
|
+
isIconOnly: true,
|
|
51
|
+
variant: "ghost",
|
|
52
|
+
"data-slot": "trigger",
|
|
53
|
+
className: slots.trigger(),
|
|
54
|
+
children: iconSegment
|
|
55
|
+
})
|
|
56
|
+
})]
|
|
57
|
+
}), description && /*#__PURE__*/jsx(Description, {
|
|
58
|
+
children: description
|
|
59
|
+
}), /*#__PURE__*/jsx(FieldError, {
|
|
60
|
+
children: errorMessage
|
|
61
|
+
}), /*#__PURE__*/jsx(Popover.Content, {
|
|
62
|
+
children: /*#__PURE__*/jsx(Popover.Dialog, {
|
|
63
|
+
children: /*#__PURE__*/jsx(RangeCalendar, {})
|
|
64
|
+
})
|
|
65
|
+
})]
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { DateRangePickerRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { DateRangePickerRoot } from "./date-range-picker";
|
|
3
|
+
export declare const DateRangePicker: (<T extends import("react-aria-components").DateValue>({ label, description, errorMessage, icon, ...props }: import("./date-range-picker").DateRangePickerRootProps<T>) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: <T extends import("react-aria-components").DateValue>({ label, description, errorMessage, icon, ...props }: import("./date-range-picker").DateRangePickerRootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type DateRangePicker = {
|
|
7
|
+
Props: ComponentProps<typeof DateRangePickerRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof DateRangePickerRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { DateRangePickerRoot } from "./date-range-picker";
|
|
11
|
+
export type { DateRangePickerRootProps, DateRangePickerRootProps as DateRangePickerProps, } from "./date-range-picker";
|
|
12
|
+
export { dateRangePickerVariants } from "@arobo/styles";
|
|
13
|
+
export type { DateRangePickerVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DateRangePickerRoot } from './date-range-picker.js';
|
|
2
|
+
export { dateRangePickerVariants } from '../../styles/src/components/date-range-picker/date-range-picker.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const DateRangePicker = Object.assign(DateRangePickerRoot, {
|
|
8
|
+
Root: DateRangePickerRoot
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { DateRangePicker, DateRangePickerRoot };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DescriptionVariants } from "@arobo/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { TextProps } from "react-aria-components";
|
|
4
|
+
import { Text } from "react-aria-components";
|
|
5
|
+
interface DescriptionRootProps extends ComponentPropsWithRef<typeof Text>, TextProps, DescriptionVariants {
|
|
6
|
+
}
|
|
7
|
+
declare const DescriptionRoot: ({ children, className, ...rest }: DescriptionRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { DescriptionRoot };
|
|
9
|
+
export type { DescriptionRootProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Text } from 'react-aria-components';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { descriptionVariants } from '../../styles/src/components/description/description.styles.js';
|
|
4
|
+
|
|
5
|
+
const DescriptionRoot = ({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
...rest
|
|
9
|
+
}) => {
|
|
10
|
+
return /*#__PURE__*/jsx(Text, {
|
|
11
|
+
className: descriptionVariants({
|
|
12
|
+
className
|
|
13
|
+
}),
|
|
14
|
+
"data-slot": "description",
|
|
15
|
+
slot: "description",
|
|
16
|
+
...rest,
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { DescriptionRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { DescriptionRoot } from "./description";
|
|
3
|
+
export declare const Description: (({ children, className, ...rest }: import("./description").DescriptionRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, ...rest }: import("./description").DescriptionRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type Description = {
|
|
7
|
+
Props: ComponentProps<typeof DescriptionRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof DescriptionRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { DescriptionRoot };
|
|
11
|
+
export type { DescriptionRootProps, DescriptionRootProps as DescriptionProps, } from "./description";
|
|
12
|
+
export { descriptionVariants } from "@arobo/styles";
|
|
13
|
+
export type { DescriptionVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DescriptionRoot } from './description.js';
|
|
2
|
+
export { descriptionVariants } from '../../styles/src/components/description/description.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const Description = Object.assign(DescriptionRoot, {
|
|
8
|
+
Root: DescriptionRoot
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { Description, DescriptionRoot };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ErrorMessageVariants } from "@arobo/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { TextProps } from "react-aria-components";
|
|
4
|
+
import { Text } from "react-aria-components";
|
|
5
|
+
interface ErrorMessageRootProps extends ComponentPropsWithRef<typeof Text>, TextProps, ErrorMessageVariants {
|
|
6
|
+
}
|
|
7
|
+
declare const ErrorMessageRoot: ({ children, className, ...rest }: ErrorMessageRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { ErrorMessageRoot };
|
|
9
|
+
export type { ErrorMessageRootProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Text } from 'react-aria-components';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { errorMessageVariants } from '../../styles/src/components/error-message/error-message.styles.js';
|
|
4
|
+
|
|
5
|
+
const ErrorMessageRoot = ({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
...rest
|
|
9
|
+
}) => {
|
|
10
|
+
return /*#__PURE__*/jsx(Text, {
|
|
11
|
+
className: errorMessageVariants({
|
|
12
|
+
className
|
|
13
|
+
}),
|
|
14
|
+
"data-slot": "error-message",
|
|
15
|
+
slot: "errorMessage",
|
|
16
|
+
...rest,
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { ErrorMessageRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ErrorMessageRoot } from "./error-message";
|
|
3
|
+
export declare const ErrorMessage: (({ children, className, ...rest }: import("./error-message").ErrorMessageRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, ...rest }: import("./error-message").ErrorMessageRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type ErrorMessage = {
|
|
7
|
+
Props: ComponentProps<typeof ErrorMessageRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof ErrorMessageRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { ErrorMessageRoot };
|
|
11
|
+
export type { ErrorMessageRootProps, ErrorMessageRootProps as ErrorMessageProps, } from "./error-message";
|
|
12
|
+
export { errorMessageVariants } from "@arobo/styles";
|
|
13
|
+
export type { ErrorMessageVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ErrorMessageRoot } from './error-message.js';
|
|
2
|
+
export { errorMessageVariants } from '../../styles/src/components/error-message/error-message.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const ErrorMessage = Object.assign(ErrorMessageRoot, {
|
|
8
|
+
Root: ErrorMessageRoot
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { ErrorMessage, ErrorMessageRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FieldErrorVariants } from "@arobo/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { FieldError as FieldErrorPrimitive } from "react-aria-components";
|
|
4
|
+
interface FieldErrorRootProps extends ComponentPropsWithRef<typeof FieldErrorPrimitive>, FieldErrorVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const FieldErrorRoot: ({ children, className, ...rest }: FieldErrorRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { FieldErrorRoot };
|
|
8
|
+
export type { FieldErrorRootProps };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FieldError } from 'react-aria-components';
|
|
2
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { fieldErrorVariants } from '../../styles/src/components/field-error/field-error.styles.js';
|
|
5
|
+
|
|
6
|
+
const FieldErrorRoot = ({
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
...rest
|
|
10
|
+
}) => {
|
|
11
|
+
return /*#__PURE__*/jsx(FieldError, {
|
|
12
|
+
"data-visible": true,
|
|
13
|
+
className: composeTwRenderProps(className, fieldErrorVariants()),
|
|
14
|
+
"data-slot": "field-error",
|
|
15
|
+
...rest,
|
|
16
|
+
children: renderProps => typeof children === "function" ? children(renderProps) : children
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { FieldErrorRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { FieldErrorRoot } from "./field-error";
|
|
3
|
+
export declare const FieldError: (({ children, className, ...rest }: import("./field-error").FieldErrorRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, ...rest }: import("./field-error").FieldErrorRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type FieldError = {
|
|
7
|
+
Props: ComponentProps<typeof FieldErrorRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof FieldErrorRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { FieldErrorRoot };
|
|
11
|
+
export type { FieldErrorRootProps, FieldErrorRootProps as FieldErrorProps, } from "./field-error";
|
|
12
|
+
export { fieldErrorVariants } from "@arobo/styles";
|
|
13
|
+
export type { FieldErrorVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FieldErrorRoot } from './field-error.js';
|
|
2
|
+
export { fieldErrorVariants } from '../../styles/src/components/field-error/field-error.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const FieldError = Object.assign(FieldErrorRoot, {
|
|
8
|
+
Root: FieldErrorRoot
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { FieldError, FieldErrorRoot };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { type FieldGroupVariants } from "@arobo/styles";
|
|
4
|
+
import { Group } from "react-aria-components";
|
|
5
|
+
interface FieldGroupRootProps extends FieldGroupVariants, ComponentPropsWithRef<typeof Group> {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const FieldGroupRoot: React.ForwardRefExoticComponent<Omit<FieldGroupRootProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export { FieldGroupRoot };
|
|
11
|
+
export type { FieldGroupRootProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { Group, composeRenderProps } from 'react-aria-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { fieldGroupVariants } from '../../styles/src/components/field-group/field-group.styles.js';
|
|
5
|
+
|
|
6
|
+
const FieldGroupRoot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
return /*#__PURE__*/jsx(Group, {
|
|
8
|
+
...props,
|
|
9
|
+
ref: ref,
|
|
10
|
+
className: composeRenderProps(props.className, (className, renderProps) => fieldGroupVariants({
|
|
11
|
+
...renderProps,
|
|
12
|
+
className
|
|
13
|
+
}))
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
FieldGroupRoot.displayName = "HeroUI.FieldGroup";
|
|
17
|
+
|
|
18
|
+
export { FieldGroupRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { FieldGroupRoot } from "./field-group";
|
|
3
|
+
export declare const FieldGroup: import("react").ForwardRefExoticComponent<Omit<import("./field-group").FieldGroupRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
Root: import("react").ForwardRefExoticComponent<Omit<import("./field-group").FieldGroupRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
};
|
|
6
|
+
export type FieldGroup = {
|
|
7
|
+
Props: ComponentProps<typeof FieldGroupRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof FieldGroupRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { FieldGroupRoot } from "./field-group";
|
|
11
|
+
export type { FieldGroupRootProps, FieldGroupRootProps as FieldGroupProps, } from "./field-group";
|
|
12
|
+
export { fieldGroupVariants } from "@arobo/styles";
|
|
13
|
+
export type { FieldGroupVariants } from "@arobo/styles";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FieldGroupRoot } from './field-group.js';
|
|
2
|
+
export { fieldGroupVariants } from '../../styles/src/components/field-group/field-group.styles.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const FieldGroup = Object.assign(FieldGroupRoot, {
|
|
8
|
+
Root: FieldGroupRoot
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { FieldGroup, FieldGroupRoot };
|