@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,38 @@
|
|
|
1
|
+
import React, { createContext } from 'react';
|
|
2
|
+
import { TextField } from 'react-aria-components';
|
|
3
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
4
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
+
import { textFieldVariants } from '../../styles/src/components/text-field/text-field.styles.js';
|
|
6
|
+
|
|
7
|
+
const TextFieldContext = /*#__PURE__*/createContext({});
|
|
8
|
+
|
|
9
|
+
/* -------------------------------------------------------------------------------------------------
|
|
10
|
+
* TextField Root
|
|
11
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
12
|
+
|
|
13
|
+
const TextFieldRoot = ({
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
fullWidth,
|
|
17
|
+
variant,
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
20
|
+
const styles = React.useMemo(() => textFieldVariants({
|
|
21
|
+
fullWidth
|
|
22
|
+
}), [fullWidth]);
|
|
23
|
+
return /*#__PURE__*/jsx(TextField, {
|
|
24
|
+
"data-slot": "text-field",
|
|
25
|
+
...props,
|
|
26
|
+
className: composeTwRenderProps(className, styles),
|
|
27
|
+
children: values => /*#__PURE__*/jsx(TextFieldContext, {
|
|
28
|
+
value: {
|
|
29
|
+
variant
|
|
30
|
+
},
|
|
31
|
+
children: /*#__PURE__*/jsx(Fragment, {
|
|
32
|
+
children: typeof children === "function" ? children(values) : children
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { TextFieldContext, TextFieldRoot };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export { buttonVariants } from './styles/src/components/button/button.styles.js';
|
|
2
|
+
export { Button } from './components/button/index.js';
|
|
3
|
+
export { ButtonRoot } from './components/button/button.js';
|
|
4
|
+
export { BUTTON_GROUP_CHILD, ButtonGroupContext, ButtonGroupRoot } from './components/button-group/button-group.js';
|
|
5
|
+
export { buttonGroupVariants } from './styles/src/components/button-group/button-group.styles.js';
|
|
6
|
+
export { ButtonGroup } from './components/button-group/index.js';
|
|
7
|
+
export { CalendarCell, CalendarGrid, CalendarGridHeader, CalendarHeader, CalendarRoot } from './components/calendar/calendar.js';
|
|
8
|
+
export { calendarVariants } from './styles/src/components/calendar/calendar.styles.js';
|
|
9
|
+
export { Calendar } from './components/calendar/index.js';
|
|
10
|
+
export { CheckboxContent, CheckboxControl, CheckboxIndicator, CheckboxRoot } from './components/checkbox/checkbox.js';
|
|
11
|
+
export { checkboxVariants } from './styles/src/components/checkbox/checkbox.styles.js';
|
|
12
|
+
export { Checkbox } from './components/checkbox/index.js';
|
|
13
|
+
export { CheckboxGroup } from './components/checkbox-group/checkbox-group.js';
|
|
14
|
+
export { checkboxGroupVariants } from './styles/src/components/checkbox-group/checkbox-group.styles.js';
|
|
15
|
+
export { closeButtonVariants } from './styles/src/components/close-button/close-button.styles.js';
|
|
16
|
+
export { CloseButton } from './components/close-button/index.js';
|
|
17
|
+
export { CloseButtonRoot } from './components/close-button/close-button.js';
|
|
18
|
+
export { comboboxVariants } from './styles/src/components/combobox/combobox.styles.js';
|
|
19
|
+
export { ComboBox } from './components/combobox/index.js';
|
|
20
|
+
export { ComboBoxInputGroup, ComboBoxPopover, ComboBoxRoot, ComboBoxTrigger } from './components/combobox/combobox.js';
|
|
21
|
+
export { dateFieldVariants } from './styles/src/components/date-field/date-field.styles.js';
|
|
22
|
+
export { DateField } from './components/date-field/index.js';
|
|
23
|
+
export { DateFieldRoot } from './components/date-field/date-field.js';
|
|
24
|
+
export { dateInputGroupVariants } from './styles/src/components/date-input-group/date-input-group.styles.js';
|
|
25
|
+
export { DateInputGroup } from './components/date-input-group/index.js';
|
|
26
|
+
export { DateInputGroupInput, DateInputGroupInputCompound, DateInputGroupPrefix, DateInputGroupRoot, DateInputGroupSegment, DateInputGroupSuffix } from './components/date-input-group/date-input-group.js';
|
|
27
|
+
export { DatePickerRoot } from './components/date-picker/date-picker.js';
|
|
28
|
+
export { datePickerVariants } from './styles/src/components/date-picker/date-picker.styles.js';
|
|
29
|
+
export { DatePicker } from './components/date-picker/index.js';
|
|
30
|
+
export { DateRangePickerRoot } from './components/date-range-picker/date-range-picker.js';
|
|
31
|
+
export { dateRangePickerVariants } from './styles/src/components/date-range-picker/date-range-picker.styles.js';
|
|
32
|
+
export { DateRangePicker } from './components/date-range-picker/index.js';
|
|
33
|
+
export { descriptionVariants } from './styles/src/components/description/description.styles.js';
|
|
34
|
+
export { Description } from './components/description/index.js';
|
|
35
|
+
export { DescriptionRoot } from './components/description/description.js';
|
|
36
|
+
export { errorMessageVariants } from './styles/src/components/error-message/error-message.styles.js';
|
|
37
|
+
export { ErrorMessage } from './components/error-message/index.js';
|
|
38
|
+
export { ErrorMessageRoot } from './components/error-message/error-message.js';
|
|
39
|
+
export { fieldErrorVariants } from './styles/src/components/field-error/field-error.styles.js';
|
|
40
|
+
export { FieldError } from './components/field-error/index.js';
|
|
41
|
+
export { FieldErrorRoot } from './components/field-error/field-error.js';
|
|
42
|
+
export { FieldGroupRoot } from './components/field-group/field-group.js';
|
|
43
|
+
export { fieldGroupVariants } from './styles/src/components/field-group/field-group.styles.js';
|
|
44
|
+
export { FieldGroup } from './components/field-group/index.js';
|
|
45
|
+
export { InputRoot } from './components/input/input.js';
|
|
46
|
+
export { inputVariants } from './styles/src/components/input/input.styles.js';
|
|
47
|
+
export { Input } from './components/input/index.js';
|
|
48
|
+
export { labelVariants } from './styles/src/components/label/label.styles.js';
|
|
49
|
+
export { Label } from './components/label/index.js';
|
|
50
|
+
export { LabelRoot } from './components/label/label.js';
|
|
51
|
+
export { popoverVariants } from './styles/src/components/popover/popover.styles.js';
|
|
52
|
+
export { Popover } from './components/popover/index.js';
|
|
53
|
+
export { PopoverArrow, PopoverContent, PopoverDialog, PopoverHeading, PopoverRoot, PopoverTrigger } from './components/popover/popover.js';
|
|
54
|
+
export { RangeCalendarRoot } from './components/range-calendar/range-calendar.js';
|
|
55
|
+
export { rangeCalendarVariants } from './styles/src/components/range-calendar/range-calendar.styles.js';
|
|
56
|
+
export { RangeCalendar } from './components/range-calendar/index.js';
|
|
57
|
+
export { SurfaceContext, SurfaceRoot } from './components/surface/surface.js';
|
|
58
|
+
export { surfaceVariants } from './styles/src/components/surface/surface.styles.js';
|
|
59
|
+
export { Surface } from './components/surface/index.js';
|
|
60
|
+
export { TextFieldContext, TextFieldRoot } from './components/text-field/text-field.js';
|
|
61
|
+
export { textFieldVariants } from './styles/src/components/text-field/text-field.styles.js';
|
|
62
|
+
export { TextField } from './components/text-field/index.js';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const buttonVariants = tv({
|
|
4
|
+
base: "button",
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
fullWidth: false,
|
|
7
|
+
isIconOnly: false,
|
|
8
|
+
size: "md",
|
|
9
|
+
variant: "primary"
|
|
10
|
+
},
|
|
11
|
+
variants: {
|
|
12
|
+
fullWidth: {
|
|
13
|
+
false: "",
|
|
14
|
+
true: "button--full-width"
|
|
15
|
+
},
|
|
16
|
+
isIconOnly: {
|
|
17
|
+
true: "button--icon-only"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
lg: "button--lg",
|
|
21
|
+
md: "button--md",
|
|
22
|
+
sm: "button--sm"
|
|
23
|
+
},
|
|
24
|
+
variant: {
|
|
25
|
+
danger: "button--danger",
|
|
26
|
+
"danger-soft": "button--danger-soft",
|
|
27
|
+
ghost: "button--ghost",
|
|
28
|
+
outline: "button--outline",
|
|
29
|
+
primary: "button--primary",
|
|
30
|
+
secondary: "button--secondary",
|
|
31
|
+
tertiary: "button--tertiary"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { buttonVariants };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const buttonGroupVariants = tv({
|
|
4
|
+
base: "button-group",
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
fullWidth: false
|
|
7
|
+
},
|
|
8
|
+
variants: {
|
|
9
|
+
fullWidth: {
|
|
10
|
+
false: "",
|
|
11
|
+
true: "button-group--full-width"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { buttonGroupVariants };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const calendarVariants = tv({
|
|
4
|
+
base: "calendar",
|
|
5
|
+
slots: {
|
|
6
|
+
cell: "calendar__cell"
|
|
7
|
+
},
|
|
8
|
+
defaultVariants: {
|
|
9
|
+
variant: "primary",
|
|
10
|
+
size: "md"
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
primary: "calendar--primary",
|
|
15
|
+
secondary: "calendar--secondary"
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
sm: "calendar--sm",
|
|
19
|
+
md: "calendar--md",
|
|
20
|
+
lg: "calendar--lg"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { calendarVariants };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const cardVariants = tv({
|
|
4
|
+
defaultVariants: {
|
|
5
|
+
variant: "default"
|
|
6
|
+
},
|
|
7
|
+
slots: {
|
|
8
|
+
base: "card",
|
|
9
|
+
content: "card__content",
|
|
10
|
+
description: "card__description",
|
|
11
|
+
footer: "card__footer",
|
|
12
|
+
header: "card__header",
|
|
13
|
+
title: "card__title"
|
|
14
|
+
},
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: {
|
|
18
|
+
base: "card--default"
|
|
19
|
+
},
|
|
20
|
+
secondary: {
|
|
21
|
+
base: "card--secondary"
|
|
22
|
+
},
|
|
23
|
+
tertiary: {
|
|
24
|
+
base: "card--tertiary"
|
|
25
|
+
},
|
|
26
|
+
transparent: {
|
|
27
|
+
base: "card--transparent"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export { cardVariants };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const checkboxVariants = tv({
|
|
4
|
+
defaultVariants: {
|
|
5
|
+
variant: "primary"
|
|
6
|
+
},
|
|
7
|
+
slots: {
|
|
8
|
+
base: "checkbox",
|
|
9
|
+
content: "checkbox__content",
|
|
10
|
+
control: "checkbox__control",
|
|
11
|
+
indicator: "checkbox__indicator"
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
primary: {
|
|
16
|
+
base: "checkbox--primary"
|
|
17
|
+
},
|
|
18
|
+
secondary: {
|
|
19
|
+
base: "checkbox--secondary"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { checkboxVariants };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const checkboxGroupVariants = tv({
|
|
4
|
+
base: "checkbox-group",
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
variant: "primary",
|
|
7
|
+
size: "md"
|
|
8
|
+
},
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
primary: "checkbox-group--primary",
|
|
12
|
+
secondary: "checkbox-group--secondary"
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
sm: "checkbox-group--sm",
|
|
16
|
+
md: "checkbox-group--md",
|
|
17
|
+
lg: "checkbox-group--lg"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export { checkboxGroupVariants };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const closeButtonVariants = tv({
|
|
4
|
+
base: "close-button",
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
variant: "default"
|
|
7
|
+
},
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "close-button--default"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { closeButtonVariants };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const comboboxVariants = tv({
|
|
4
|
+
defaultVariants: {
|
|
5
|
+
fullWidth: false
|
|
6
|
+
},
|
|
7
|
+
slots: {
|
|
8
|
+
base: "combobox",
|
|
9
|
+
inputGroup: "combobox__input-group",
|
|
10
|
+
popover: "combobox__popover",
|
|
11
|
+
trigger: "combobox__trigger"
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
fullWidth: {
|
|
15
|
+
false: {},
|
|
16
|
+
true: {
|
|
17
|
+
base: "combobox--full-width",
|
|
18
|
+
inputGroup: "combobox__input-group--full-width"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { comboboxVariants };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const dateFieldVariants = tv({
|
|
4
|
+
base: "date-field",
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
fullWidth: false
|
|
7
|
+
},
|
|
8
|
+
variants: {
|
|
9
|
+
fullWidth: {
|
|
10
|
+
false: "",
|
|
11
|
+
true: "date-field--full-width"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { dateFieldVariants };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const dateInputGroupVariants = tv({
|
|
4
|
+
defaultVariants: {
|
|
5
|
+
fullWidth: false
|
|
6
|
+
},
|
|
7
|
+
slots: {
|
|
8
|
+
base: "date-input-group",
|
|
9
|
+
input: "date-input-group__input",
|
|
10
|
+
prefix: "date-input-group__prefix",
|
|
11
|
+
segment: "date-input-group__segment",
|
|
12
|
+
suffix: "date-input-group__suffix"
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
fullWidth: {
|
|
16
|
+
false: {},
|
|
17
|
+
true: {
|
|
18
|
+
base: "date-input-group--full-width"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { dateInputGroupVariants };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const dateRangePickerVariants = tv({
|
|
4
|
+
base: "date-range-picker",
|
|
5
|
+
slots: {
|
|
6
|
+
trigger: "date-range-picker__trigger",
|
|
7
|
+
inputGroup: "date-range-picker__input-group",
|
|
8
|
+
input: "date-range-picker__input",
|
|
9
|
+
separator: "date-range-picker__separator"
|
|
10
|
+
},
|
|
11
|
+
defaultVariants: {
|
|
12
|
+
variant: "primary",
|
|
13
|
+
size: "md"
|
|
14
|
+
},
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
primary: "date-range-picker--primary",
|
|
18
|
+
secondary: "date-range-picker--secondary"
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
sm: "date-range-picker--sm",
|
|
22
|
+
md: "date-range-picker--md",
|
|
23
|
+
lg: "date-range-picker--lg"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export { dateRangePickerVariants };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
import { focusRing } from '../../utils/state.js';
|
|
3
|
+
|
|
4
|
+
const fieldBorderStyles = tv({
|
|
5
|
+
base: "transition",
|
|
6
|
+
variants: {
|
|
7
|
+
isFocusWithin: {
|
|
8
|
+
false: "border-neutral-300 hover:border-neutral-400 dark:border-neutral-600 dark:hover:border-neutral-500 forced-colors:border-[ButtonBorder]",
|
|
9
|
+
true: "border-neutral-600 dark:border-neutral-300 forced-colors:border-[Highlight]"
|
|
10
|
+
},
|
|
11
|
+
isInvalid: {
|
|
12
|
+
true: "border-red-600 dark:border-red-600 forced-colors:border-[Mark]"
|
|
13
|
+
},
|
|
14
|
+
isDisabled: {
|
|
15
|
+
true: "border-neutral-200 dark:border-neutral-700 forced-colors:border-[GrayText]"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const fieldGroupVariants = tv({
|
|
20
|
+
extend: focusRing,
|
|
21
|
+
base: "field-group",
|
|
22
|
+
variants: fieldBorderStyles.variants
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { fieldBorderStyles, fieldGroupVariants };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const inputVariants = tv({
|
|
4
|
+
base: "input",
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
fullWidth: false,
|
|
7
|
+
variant: "primary"
|
|
8
|
+
},
|
|
9
|
+
variants: {
|
|
10
|
+
fullWidth: {
|
|
11
|
+
false: "",
|
|
12
|
+
true: "input--full-width"
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
primary: "input--primary",
|
|
16
|
+
secondary: "input--secondary"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export { inputVariants };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const labelVariants = tv({
|
|
4
|
+
base: "label",
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
isDisabled: false,
|
|
7
|
+
isInvalid: false,
|
|
8
|
+
isRequired: false
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
isDisabled: {
|
|
12
|
+
true: "label--disabled"
|
|
13
|
+
},
|
|
14
|
+
isInvalid: {
|
|
15
|
+
true: "label--invalid"
|
|
16
|
+
},
|
|
17
|
+
isRequired: {
|
|
18
|
+
true: "label--required"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export { labelVariants };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const rangeCalendarVariants = tv({
|
|
4
|
+
base: "range-calendar",
|
|
5
|
+
slots: {
|
|
6
|
+
cell: "range-calendar__cell",
|
|
7
|
+
grid: "range-calendar__grid"
|
|
8
|
+
},
|
|
9
|
+
defaultVariants: {
|
|
10
|
+
variant: "primary",
|
|
11
|
+
size: "md"
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
primary: "range-calendar--primary",
|
|
16
|
+
secondary: "range-calendar--secondary"
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
sm: "range-calendar--sm",
|
|
20
|
+
md: "range-calendar--md",
|
|
21
|
+
lg: "range-calendar--lg"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { rangeCalendarVariants };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const surfaceVariants = tv({
|
|
4
|
+
base: "surface",
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
variant: "default",
|
|
7
|
+
effect: "none"
|
|
8
|
+
},
|
|
9
|
+
variants: {
|
|
10
|
+
effect: {
|
|
11
|
+
none: "",
|
|
12
|
+
liquid: "surface--liquid"
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
default: "surface--default",
|
|
16
|
+
secondary: "surface--secondary",
|
|
17
|
+
tertiary: "surface--tertiary",
|
|
18
|
+
transparent: "surface--transparent"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
compoundVariants: [{
|
|
22
|
+
effect: "liquid",
|
|
23
|
+
variant: "transparent",
|
|
24
|
+
class: "surface--liquid-transparent"
|
|
25
|
+
}, {
|
|
26
|
+
effect: "liquid",
|
|
27
|
+
variant: "default",
|
|
28
|
+
class: "surface--liquid-default"
|
|
29
|
+
}]
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { surfaceVariants };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const textFieldVariants = tv({
|
|
4
|
+
base: "text-field",
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
fullWidth: false
|
|
7
|
+
},
|
|
8
|
+
variants: {
|
|
9
|
+
fullWidth: {
|
|
10
|
+
false: "",
|
|
11
|
+
true: "text-field--full-width"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { textFieldVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type Dict<T = any> = Record<string, T>;
|
|
2
|
+
export declare function isArray<T>(value: any): value is Array<T>;
|
|
3
|
+
export declare function isEmptyArray(value: any): boolean;
|
|
4
|
+
export declare function isObject(value: any): value is Dict;
|
|
5
|
+
export declare function isEmptyObject(value: any): boolean;
|
|
6
|
+
export declare function isEmpty(value: any): boolean;
|
|
7
|
+
export type Booleanish = boolean | "true" | "false";
|
|
8
|
+
export declare const dataAttr: (condition: boolean | undefined) => Booleanish;
|
|
9
|
+
export declare const isNumeric: (value?: string | number) => boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare function composeTwRenderProps<T>(className: string | ((v: T) => string) | undefined, tailwind?: string | ((v: T) => string | undefined)): string | ((v: T) => string);
|
|
2
|
+
export declare const composeSlotClassName: (slotFn: ((args?: {
|
|
3
|
+
className?: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}) => string) | undefined, className?: string, variants?: Record<string, any>) => string | undefined;
|
|
6
|
+
export { composeTwRenderProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { composeRenderProps } from 'react-aria-components';
|
|
2
|
+
import { cx } from 'tailwind-variants';
|
|
3
|
+
|
|
4
|
+
function composeTwRenderProps(className, tailwind) {
|
|
5
|
+
return composeRenderProps(className, (className, renderProps) => {
|
|
6
|
+
const tw = typeof tailwind === "function" ? tailwind(renderProps) ?? "" : tailwind ?? "";
|
|
7
|
+
const cls = className ?? "";
|
|
8
|
+
return cx(tw, cls) ?? "";
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
const composeSlotClassName = (slotFn, className, variants) => {
|
|
12
|
+
return typeof slotFn === "function" ? slotFn({
|
|
13
|
+
...({}),
|
|
14
|
+
className
|
|
15
|
+
}) : className;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { composeSlotClassName, composeTwRenderProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const focusRing: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
isFocusVisible: {
|
|
3
|
+
false: string;
|
|
4
|
+
true: string;
|
|
5
|
+
};
|
|
6
|
+
}, undefined, "focus-ring", {
|
|
7
|
+
isFocusVisible: {
|
|
8
|
+
false: string;
|
|
9
|
+
true: string;
|
|
10
|
+
};
|
|
11
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
12
|
+
isFocusVisible: {
|
|
13
|
+
false: string;
|
|
14
|
+
true: string;
|
|
15
|
+
};
|
|
16
|
+
}, undefined, "focus-ring", unknown, unknown, undefined>>;
|