@koobiq/react-primitives 0.0.1 → 0.1.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/dist/behaviors/index.d.ts +0 -1
- package/dist/components/Button/types.d.ts +4 -0
- package/dist/components/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/ProgressBar/types.d.ts +2 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -2
- package/package.json +3 -3
- package/dist/behaviors/useProgressBar.d.ts +0 -7
- package/dist/behaviors/useProgressBar.js +0 -9
|
@@ -33,5 +33,9 @@ export type ButtonBaseProps = RenderProps<ButtonRenderProps> & {
|
|
|
33
33
|
formTarget?: string;
|
|
34
34
|
tabIndex?: number;
|
|
35
35
|
slot?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Whether this button is loading.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
36
40
|
isLoading?: boolean;
|
|
37
41
|
} & Omit<UseButtonProps<never>, 'elementType' | 'href'>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { polymorphicForwardRef, mergeProps } from "@koobiq/react-core";
|
|
4
|
+
import { useProgressBar } from "@react-aria/progress";
|
|
4
5
|
import { useRenderProps, Provider } from "../../utils/index.js";
|
|
5
|
-
import { useProgressBar } from "../../behaviors/useProgressBar.js";
|
|
6
6
|
import { LabelContext } from "../Label/LabelContext.js";
|
|
7
7
|
const ProgressBar = polymorphicForwardRef(
|
|
8
8
|
(props, ref) => {
|
|
@@ -11,13 +11,13 @@ const ProgressBar = polymorphicForwardRef(
|
|
|
11
11
|
minValue = 0,
|
|
12
12
|
maxValue = 100,
|
|
13
13
|
as: Tag = "div",
|
|
14
|
-
|
|
14
|
+
isIndeterminate = false,
|
|
15
15
|
...other
|
|
16
16
|
} = props;
|
|
17
17
|
const { progressBarProps, labelProps } = useProgressBar(props);
|
|
18
|
-
const percentage =
|
|
18
|
+
const percentage = isIndeterminate ? void 0 : (value - minValue) / (maxValue - minValue) * 100;
|
|
19
19
|
const renderValues = {
|
|
20
|
-
|
|
20
|
+
isIndeterminate,
|
|
21
21
|
percentage
|
|
22
22
|
};
|
|
23
23
|
const renderProps = useRenderProps({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ExtendableProps } from '@koobiq/react-core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AriaProgressBarProps } from '@react-aria/progress';
|
|
3
3
|
import type { RenderProps } from '../../utils';
|
|
4
4
|
export type ProgressBarRenderProps = {
|
|
5
|
-
indeterminate?: boolean;
|
|
6
5
|
percentage?: number;
|
|
7
6
|
};
|
|
8
|
-
export type ProgressBarBaseProps = ExtendableProps<RenderProps<ProgressBarRenderProps>,
|
|
7
|
+
export type ProgressBarBaseProps = ExtendableProps<RenderProps<ProgressBarRenderProps>, AriaProgressBarProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from '@react-aria/datepicker';
|
|
|
22
22
|
export * from '@react-stately/datepicker';
|
|
23
23
|
export * from '@react-aria/table';
|
|
24
24
|
export * from '@react-stately/table';
|
|
25
|
+
export * from '@react-aria/progress';
|
|
25
26
|
export type { CalendarProps, CalendarAria, CalendarGridAria, CalendarCellAria, AriaCalendarProps, AriaCalendarCellProps, AriaCalendarGridProps, } from '@react-aria/calendar';
|
|
26
27
|
export { useCalendar, useCalendarCell, useCalendarGrid, } from '@react-aria/calendar';
|
|
27
28
|
export * from '@react-stately/calendar';
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export * from "@react-aria/datepicker";
|
|
|
22
22
|
export * from "@react-stately/datepicker";
|
|
23
23
|
export * from "@react-aria/table";
|
|
24
24
|
export * from "@react-stately/table";
|
|
25
|
+
export * from "@react-aria/progress";
|
|
25
26
|
import { useCalendar, useCalendarCell, useCalendarGrid } from "@react-aria/calendar";
|
|
26
27
|
export * from "@react-stately/calendar";
|
|
27
28
|
import { Provider, removeDataAttributes, useRenderProps } from "./utils/index.js";
|
|
@@ -32,7 +33,6 @@ import { useSwitch } from "./behaviors/useSwitch.js";
|
|
|
32
33
|
import { useRadio } from "./behaviors/useRadio.js";
|
|
33
34
|
import { useRadioGroup } from "./behaviors/useRadioGroup.js";
|
|
34
35
|
import { useRadioGroupState } from "./behaviors/useRadioGroupState.js";
|
|
35
|
-
import { useProgressBar } from "./behaviors/useProgressBar.js";
|
|
36
36
|
import { useNumberField } from "./behaviors/useNumberField.js";
|
|
37
37
|
import { Text } from "./components/Text/Text.js";
|
|
38
38
|
import { TextContext } from "./components/Text/TextContext.js";
|
|
@@ -89,7 +89,6 @@ export {
|
|
|
89
89
|
useLink,
|
|
90
90
|
useNumberField,
|
|
91
91
|
useOverlayTriggerState,
|
|
92
|
-
useProgressBar,
|
|
93
92
|
useRadio,
|
|
94
93
|
useRadioGroup,
|
|
95
94
|
useRadioGroupState,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/react-primitives",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"@react-stately/toggle": "^3.7.0",
|
|
60
60
|
"@react-stately/tooltip": "^3.5.5",
|
|
61
61
|
"@react-stately/tree": "^3.8.9",
|
|
62
|
-
"@koobiq/logger": "0.
|
|
63
|
-
"@koobiq/react-core": "0.
|
|
62
|
+
"@koobiq/logger": "0.1.1",
|
|
63
|
+
"@koobiq/react-core": "0.1.1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"react": "18.x || 19.x",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ExtendableProps } from '@koobiq/react-core';
|
|
2
|
-
import type { AriaProgressBarProps } from '@react-aria/progress';
|
|
3
|
-
export type UseProgressBarProps = ExtendableProps<Omit<AriaProgressBarProps, 'isIndeterminate'>, {
|
|
4
|
-
indeterminate?: boolean;
|
|
5
|
-
}>;
|
|
6
|
-
export declare function useProgressBar(props: UseProgressBarProps): import("@react-aria/progress").ProgressBarAria;
|
|
7
|
-
export type UseProgressBarReturn = ReturnType<typeof useProgressBar>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useProgressBar as useProgressBar$1 } from "@react-aria/progress";
|
|
3
|
-
function useProgressBar(props) {
|
|
4
|
-
const { indeterminate, ...other } = props;
|
|
5
|
-
return useProgressBar$1({ ...other, isIndeterminate: indeterminate });
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
useProgressBar
|
|
9
|
-
};
|