@koobiq/react-primitives 0.0.1-beta.3 → 0.0.1-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/behaviors/index.d.ts +0 -2
- package/dist/behaviors/useButton.d.ts +6 -6
- package/dist/behaviors/useButton.js +10 -21
- package/dist/behaviors/useCheckbox.d.ts +10 -45
- package/dist/behaviors/useCheckbox.js +15 -38
- package/dist/behaviors/useLink.d.ts +5 -9
- package/dist/behaviors/useLink.js +8 -17
- package/dist/behaviors/useNumberField.d.ts +1 -22
- package/dist/behaviors/useNumberField.js +2 -13
- package/dist/behaviors/useToggle.d.ts +309 -37
- package/dist/behaviors/useToggle.js +12 -33
- package/dist/components/Button/Button.js +17 -13
- package/dist/components/Button/ButtonContext.js +1 -0
- package/dist/components/Button/types.d.ts +7 -7
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +36 -19
- package/dist/components/Checkbox/types.d.ts +8 -8
- package/dist/components/Group/Group.js +7 -7
- package/dist/components/Group/GroupContext.js +1 -0
- package/dist/components/Group/types.d.ts +8 -8
- package/dist/components/Input/InputContext.js +1 -0
- package/dist/components/Label/LabelContext.js +1 -0
- package/dist/components/Link/Link.js +30 -9
- package/dist/components/Link/types.d.ts +8 -6
- package/dist/components/NumberField/NumberField.d.ts +1 -1
- package/dist/components/NumberField/NumberField.js +9 -9
- package/dist/components/NumberField/types.d.ts +4 -4
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/Radio/RadioContext.js +1 -0
- package/dist/components/Radio/RadioGroup.d.ts +1 -1
- package/dist/components/Text/TextContext.js +1 -0
- package/dist/components/TextField/TextField.d.ts +2 -1
- package/dist/components/TextField/TextField.js +58 -57
- package/dist/components/TextField/types.d.ts +11 -8
- package/dist/components/Textarea/Textarea.d.ts +2 -4
- package/dist/components/Textarea/Textarea.js +6 -2
- package/dist/components/Textarea/TextareaContext.js +1 -0
- package/dist/components/Textarea/types.d.ts +2 -1
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.js +14 -14
- package/dist/components/Toggle/types.d.ts +7 -7
- package/dist/index.d.ts +21 -3
- package/dist/index.js +61 -6
- package/dist/types.d.ts +3 -6
- package/package.json +29 -8
- package/dist/behaviors/useNumberFieldState.d.ts +0 -25
- package/dist/behaviors/useNumberFieldState.js +0 -13
- package/dist/behaviors/useTextField.d.ts +0 -19
- package/dist/behaviors/useTextField.js +0 -24
package/dist/index.js
CHANGED
|
@@ -1,23 +1,39 @@
|
|
|
1
|
+
import { useToggleButtonGroup, useToggleButtonGroupItem } from "@react-aria/button";
|
|
2
|
+
import { useCalendar, useCalendarCell, useCalendarGrid } from "@react-aria/calendar";
|
|
1
3
|
import { useDialog } from "@react-aria/dialog";
|
|
2
|
-
import { I18nProvider, useLocale, useLocalizedStringFormatter } from "@react-aria/i18n";
|
|
4
|
+
import { I18nProvider, useDateFormatter, useLocale, useLocalizedStringFormatter } from "@react-aria/i18n";
|
|
3
5
|
import { useListBox, useListBoxSection, useOption } from "@react-aria/listbox";
|
|
6
|
+
import { useMenu, useMenuItem, useMenuSection, useMenuTrigger } from "@react-aria/menu";
|
|
4
7
|
import { Overlay, useModalOverlay, useOverlayPosition, useOverlayTrigger, usePopover } from "@react-aria/overlays";
|
|
8
|
+
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
9
|
+
import { useSeparator } from "@react-aria/separator";
|
|
10
|
+
import { useTable, useTableCell, useTableColumnHeader, useTableHeaderRow, useTableRow, useTableRowGroup, useTableSelectAllCheckbox, useTableSelectionCheckbox } from "@react-aria/table";
|
|
11
|
+
import { useTag, useTagGroup } from "@react-aria/tag";
|
|
5
12
|
import { useTooltip, useTooltipTrigger } from "@react-aria/tooltip";
|
|
13
|
+
import { RouterProvider, useRouter } from "@react-aria/utils";
|
|
14
|
+
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
15
|
+
import { useCalendarState } from "@react-stately/calendar";
|
|
6
16
|
import { Item, Section } from "@react-stately/collections";
|
|
17
|
+
import { useListData } from "@react-stately/data";
|
|
7
18
|
import { useListState } from "@react-stately/list";
|
|
19
|
+
import { useMenuTriggerState } from "@react-stately/menu";
|
|
8
20
|
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
21
|
+
import { useSelectState } from "@react-stately/select";
|
|
22
|
+
import { Cell, Column, Row, TableBody, TableHeader, useTableState } from "@react-stately/table";
|
|
23
|
+
import { useToggleGroupState } from "@react-stately/toggle";
|
|
9
24
|
import { useTooltipTriggerState } from "@react-stately/tooltip";
|
|
25
|
+
import { useTreeState } from "@react-stately/tree";
|
|
26
|
+
export * from "@internationalized/date";
|
|
27
|
+
import { Provider, removeDataAttributes, useRenderProps } from "./utils/index.js";
|
|
10
28
|
import { useButton } from "./behaviors/useButton.js";
|
|
11
29
|
import { useCheckbox } from "./behaviors/useCheckbox.js";
|
|
12
30
|
import { useLink } from "./behaviors/useLink.js";
|
|
13
|
-
import { useTextField } from "./behaviors/useTextField.js";
|
|
14
31
|
import { useToggle } from "./behaviors/useToggle.js";
|
|
15
32
|
import { useRadio } from "./behaviors/useRadio.js";
|
|
16
33
|
import { useRadioGroup } from "./behaviors/useRadioGroup.js";
|
|
17
34
|
import { useRadioGroupState } from "./behaviors/useRadioGroupState.js";
|
|
18
35
|
import { useProgressBar } from "./behaviors/useProgressBar.js";
|
|
19
36
|
import { useNumberField } from "./behaviors/useNumberField.js";
|
|
20
|
-
import { useNumberFieldState } from "./behaviors/useNumberFieldState.js";
|
|
21
37
|
import { Text } from "./components/Text/Text.js";
|
|
22
38
|
import { TextContext } from "./components/Text/TextContext.js";
|
|
23
39
|
import { Group } from "./components/Group/Group.js";
|
|
@@ -42,9 +58,12 @@ import { NumberField } from "./components/NumberField/NumberField.js";
|
|
|
42
58
|
export {
|
|
43
59
|
Button,
|
|
44
60
|
ButtonContext,
|
|
61
|
+
Cell,
|
|
45
62
|
Checkbox,
|
|
63
|
+
Column,
|
|
46
64
|
Group,
|
|
47
65
|
GroupContext,
|
|
66
|
+
HiddenSelect,
|
|
48
67
|
I18nProvider,
|
|
49
68
|
Input,
|
|
50
69
|
InputContext,
|
|
@@ -55,30 +74,47 @@ export {
|
|
|
55
74
|
NumberField,
|
|
56
75
|
Overlay,
|
|
57
76
|
ProgressBar,
|
|
77
|
+
Provider,
|
|
58
78
|
Radio,
|
|
59
79
|
RadioContext,
|
|
60
80
|
RadioGroup,
|
|
81
|
+
RouterProvider,
|
|
82
|
+
Row,
|
|
61
83
|
Section,
|
|
84
|
+
TableBody,
|
|
85
|
+
TableHeader,
|
|
62
86
|
Text,
|
|
63
87
|
TextContext,
|
|
64
88
|
TextField,
|
|
65
89
|
Textarea,
|
|
66
90
|
TextareaContext,
|
|
67
91
|
Toggle,
|
|
92
|
+
VisuallyHidden,
|
|
93
|
+
removeDataAttributes,
|
|
68
94
|
useButton,
|
|
95
|
+
useCalendar,
|
|
96
|
+
useCalendarCell,
|
|
97
|
+
useCalendarGrid,
|
|
98
|
+
useCalendarState,
|
|
69
99
|
useCheckbox,
|
|
100
|
+
useDateFormatter,
|
|
70
101
|
useDialog,
|
|
71
102
|
useGroupContext,
|
|
72
103
|
useInputContext,
|
|
73
104
|
useLink,
|
|
74
105
|
useListBox,
|
|
75
106
|
useListBoxSection,
|
|
107
|
+
useListData,
|
|
76
108
|
useListState,
|
|
77
109
|
useLocale,
|
|
78
110
|
useLocalizedStringFormatter,
|
|
111
|
+
useMenu,
|
|
112
|
+
useMenuItem,
|
|
113
|
+
useMenuSection,
|
|
114
|
+
useMenuTrigger,
|
|
115
|
+
useMenuTriggerState,
|
|
79
116
|
useModalOverlay,
|
|
80
117
|
useNumberField,
|
|
81
|
-
useNumberFieldState,
|
|
82
118
|
useOption,
|
|
83
119
|
useOverlayPosition,
|
|
84
120
|
useOverlayTrigger,
|
|
@@ -88,10 +124,29 @@ export {
|
|
|
88
124
|
useRadio,
|
|
89
125
|
useRadioGroup,
|
|
90
126
|
useRadioGroupState,
|
|
91
|
-
|
|
127
|
+
useRenderProps,
|
|
128
|
+
useRouter,
|
|
129
|
+
useSelect,
|
|
130
|
+
useSelectState,
|
|
131
|
+
useSeparator,
|
|
132
|
+
useTable,
|
|
133
|
+
useTableCell,
|
|
134
|
+
useTableColumnHeader,
|
|
135
|
+
useTableHeaderRow,
|
|
136
|
+
useTableRow,
|
|
137
|
+
useTableRowGroup,
|
|
138
|
+
useTableSelectAllCheckbox,
|
|
139
|
+
useTableSelectionCheckbox,
|
|
140
|
+
useTableState,
|
|
141
|
+
useTag,
|
|
142
|
+
useTagGroup,
|
|
92
143
|
useTextareaContext,
|
|
93
144
|
useToggle,
|
|
145
|
+
useToggleButtonGroup,
|
|
146
|
+
useToggleButtonGroupItem,
|
|
147
|
+
useToggleGroupState,
|
|
94
148
|
useTooltip,
|
|
95
149
|
useTooltipTrigger,
|
|
96
|
-
useTooltipTriggerState
|
|
150
|
+
useTooltipTriggerState,
|
|
151
|
+
useTreeState
|
|
97
152
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { ElementType } from 'react';
|
|
2
2
|
import type { AriaButtonOptions } from '@react-aria/button';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** Handler that is called when the press is released over the target. */
|
|
7
|
-
onClick?: AriaButtonOptions<ElementType>['onPress'];
|
|
8
|
-
};
|
|
3
|
+
import type { AriaLinkOptions } from '@react-aria/link';
|
|
4
|
+
export type ButtonOptions = AriaButtonOptions<ElementType>;
|
|
5
|
+
export type LinkOptions = AriaLinkOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/react-primitives",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.31",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"default": "./dist/index.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"directory": "packages/primitives",
|
|
15
|
+
"url": "git+https://github.com/koobiq/react-components.git"
|
|
16
|
+
},
|
|
12
17
|
"type": "module",
|
|
13
18
|
"files": [
|
|
14
19
|
"dist"
|
|
@@ -18,28 +23,44 @@
|
|
|
18
23
|
},
|
|
19
24
|
"sideEffects": false,
|
|
20
25
|
"dependencies": {
|
|
26
|
+
"@internationalized/date": "^3.8.2",
|
|
21
27
|
"@react-aria/button": "^3.9.0",
|
|
28
|
+
"@react-aria/calendar": "^3.8.3",
|
|
22
29
|
"@react-aria/checkbox": "^3.14.0",
|
|
23
30
|
"@react-aria/dialog": "^3.5.19",
|
|
24
|
-
"@react-aria/i18n": "^3.12.
|
|
25
|
-
"@react-aria/link": "^3.
|
|
31
|
+
"@react-aria/i18n": "^3.12.10",
|
|
32
|
+
"@react-aria/link": "^3.8.3",
|
|
26
33
|
"@react-aria/listbox": "^3.14.2",
|
|
34
|
+
"@react-aria/menu": "^3.18.2",
|
|
27
35
|
"@react-aria/numberfield": "^3.11.8",
|
|
28
36
|
"@react-aria/overlays": "^3.23.4",
|
|
29
37
|
"@react-aria/progress": "^3.4.17",
|
|
30
38
|
"@react-aria/radio": "^3.10.9",
|
|
31
|
-
"@react-aria/
|
|
39
|
+
"@react-aria/select": "^3.15.3",
|
|
40
|
+
"@react-aria/separator": "^3.4.8",
|
|
41
|
+
"@react-aria/switch": "^3.7.5",
|
|
42
|
+
"@react-aria/table": "^3.17.3",
|
|
43
|
+
"@react-aria/tag": "^3.6.0",
|
|
44
|
+
"@react-aria/textfield": "^3.17.5",
|
|
32
45
|
"@react-aria/toggle": "^3.10.10",
|
|
33
|
-
"@react-aria/tooltip": "^3.
|
|
46
|
+
"@react-aria/tooltip": "^3.8.5",
|
|
47
|
+
"@react-aria/utils": "^3.29.1",
|
|
34
48
|
"@react-aria/visually-hidden": "^3.8.0",
|
|
49
|
+
"@react-stately/calendar": "^3.8.2",
|
|
35
50
|
"@react-stately/collections": "^3.12.2",
|
|
51
|
+
"@react-stately/data": "^3.13.0",
|
|
36
52
|
"@react-stately/list": "^3.12.0",
|
|
53
|
+
"@react-stately/menu": "^3.9.3",
|
|
37
54
|
"@react-stately/numberfield": "^3.9.7",
|
|
38
55
|
"@react-stately/overlays": "^3.6.11",
|
|
39
56
|
"@react-stately/radio": "^3.10.8",
|
|
40
|
-
"@react-stately/
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
57
|
+
"@react-stately/select": "^3.6.11",
|
|
58
|
+
"@react-stately/table": "^3.14.2",
|
|
59
|
+
"@react-stately/toggle": "^3.7.0",
|
|
60
|
+
"@react-stately/tooltip": "^3.5.5",
|
|
61
|
+
"@react-stately/tree": "^3.8.9",
|
|
62
|
+
"@koobiq/logger": "0.0.1-beta.31",
|
|
63
|
+
"@koobiq/react-core": "0.0.1-beta.31"
|
|
43
64
|
},
|
|
44
65
|
"peerDependencies": {
|
|
45
66
|
"react": "18.x || 19.x",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ExtendableProps } from '@koobiq/react-core';
|
|
2
|
-
import type { NumberFieldStateOptions } from '@react-stately/numberfield';
|
|
3
|
-
export type UseNumberFieldStateProps = ExtendableProps<{
|
|
4
|
-
/**
|
|
5
|
-
* If `true`, the component is disabled.
|
|
6
|
-
* @default false
|
|
7
|
-
* */
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
/** It prevents the user from changing the value of the checkbox.
|
|
10
|
-
* @default false
|
|
11
|
-
*/
|
|
12
|
-
readonly?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* If `true`, the input element is required.
|
|
15
|
-
* @default false
|
|
16
|
-
* */
|
|
17
|
-
required?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* If `true`, the component will indicate an error.
|
|
20
|
-
* @default false
|
|
21
|
-
* */
|
|
22
|
-
error?: boolean;
|
|
23
|
-
}, Omit<NumberFieldStateOptions, 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid'>>;
|
|
24
|
-
export declare function useNumberFieldState(props: UseNumberFieldStateProps): import("@react-stately/numberfield").NumberFieldState;
|
|
25
|
-
export type UseNumberFieldStateReturn = ReturnType<typeof useNumberFieldState>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useNumberFieldState as useNumberFieldState$1 } from "@react-stately/numberfield";
|
|
2
|
-
function useNumberFieldState(props) {
|
|
3
|
-
return useNumberFieldState$1({
|
|
4
|
-
...props,
|
|
5
|
-
isInvalid: props.error || false,
|
|
6
|
-
isReadOnly: props.readonly || false,
|
|
7
|
-
isDisabled: props.disabled || false,
|
|
8
|
-
isRequired: props.required || false
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
useNumberFieldState
|
|
13
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { RefObject } from 'react';
|
|
2
|
-
import type { AriaTextFieldOptions } from '@react-aria/textfield';
|
|
3
|
-
export type UseTextFieldProps = {
|
|
4
|
-
error?: boolean;
|
|
5
|
-
readonly?: boolean;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
inputElementType?: 'input' | 'textarea';
|
|
9
|
-
} & Omit<AriaTextFieldOptions<'input' | 'textarea'>, 'isDisabled' | 'isInvalid' | 'isRequired' | 'isReadOnly'>;
|
|
10
|
-
export declare function useTextField(props: UseTextFieldProps, ref: RefObject<HTMLInputElement | HTMLTextAreaElement | null>): {
|
|
11
|
-
inputProps: import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> | import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
|
|
12
|
-
labelProps: import("@react-types/shared").DOMAttributes | import("react").LabelHTMLAttributes<HTMLLabelElement>;
|
|
13
|
-
descriptionProps: import("@react-types/shared").DOMAttributes;
|
|
14
|
-
errorMessageProps: import("@react-types/shared").DOMAttributes;
|
|
15
|
-
validationErrors: string[];
|
|
16
|
-
validationDetails: ValidityState;
|
|
17
|
-
error: boolean;
|
|
18
|
-
};
|
|
19
|
-
export type UseTextFieldReturn = ReturnType<typeof useTextField>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useTextField as useTextField$1 } from "@react-aria/textfield";
|
|
3
|
-
function useTextField(props, ref) {
|
|
4
|
-
const { disabled, error, label, readonly, required, ...other } = props;
|
|
5
|
-
const { isInvalid, ...textFieldProps } = useTextField$1(
|
|
6
|
-
{
|
|
7
|
-
isDisabled: disabled,
|
|
8
|
-
isReadOnly: readonly,
|
|
9
|
-
isRequired: required,
|
|
10
|
-
isInvalid: error,
|
|
11
|
-
label,
|
|
12
|
-
errorMessage: error ? label : void 0,
|
|
13
|
-
...other
|
|
14
|
-
},
|
|
15
|
-
ref
|
|
16
|
-
);
|
|
17
|
-
return {
|
|
18
|
-
error: isInvalid,
|
|
19
|
-
...textFieldProps
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
useTextField
|
|
24
|
-
};
|