@ark-ui/solid 3.7.0 → 3.9.0
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/cjs/index.js +272 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +245 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/source/components/editable/editable-root.jsx +3 -2
- package/dist/source/components/editable/index.js +1 -0
- package/dist/source/components/editable/use-editable.js +2 -0
- package/dist/source/components/index.js +2 -0
- package/dist/source/components/steps/index.js +17 -0
- package/dist/source/components/steps/steps-completed-content.jsx +8 -0
- package/dist/source/components/steps/steps-content.jsx +10 -0
- package/dist/source/components/steps/steps-indicator.jsx +10 -0
- package/dist/source/components/steps/steps-item-context.jsx +5 -0
- package/dist/source/components/steps/steps-item.jsx +18 -0
- package/dist/source/components/steps/steps-list.jsx +8 -0
- package/dist/source/components/steps/steps-next-trigger.jsx +8 -0
- package/dist/source/components/steps/steps-prev-trigger.jsx +8 -0
- package/dist/source/components/steps/steps-progress.jsx +8 -0
- package/dist/source/components/steps/steps-root-provider.jsx +11 -0
- package/dist/source/components/steps/steps-root.jsx +23 -0
- package/dist/source/components/steps/steps-separator.jsx +10 -0
- package/dist/source/components/steps/steps-trigger.jsx +10 -0
- package/dist/source/components/steps/steps.js +12 -0
- package/dist/source/components/steps/use-steps-context.js +5 -0
- package/dist/source/components/steps/use-steps-item-context.js +5 -0
- package/dist/source/components/steps/use-steps-item-props-context.js +5 -0
- package/dist/source/components/steps/use-steps.js +18 -0
- package/dist/source/components/timer/index.js +9 -0
- package/dist/source/components/timer/timer-action-trigger.jsx +8 -0
- package/dist/source/components/timer/timer-context.jsx +2 -0
- package/dist/source/components/timer/timer-item.jsx +10 -0
- package/dist/source/components/timer/timer-root-provider.jsx +11 -0
- package/dist/source/components/timer/timer-root.jsx +22 -0
- package/dist/source/components/timer/timer-separator.jsx +8 -0
- package/dist/source/components/timer/timer.js +6 -0
- package/dist/source/components/timer/use-timer-context.js +5 -0
- package/dist/source/components/timer/use-timer.js +15 -0
- package/dist/types/components/editable/index.d.ts +3 -0
- package/dist/types/components/editable/use-editable.d.ts +6 -1
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/steps/index.d.ts +18 -0
- package/dist/types/components/steps/steps-completed-content.d.ts +6 -0
- package/dist/types/components/steps/steps-content.d.ts +7 -0
- package/dist/types/components/steps/steps-indicator.d.ts +6 -0
- package/dist/types/components/steps/steps-item-context.d.ts +9 -0
- package/dist/types/components/steps/steps-item.d.ts +7 -0
- package/dist/types/components/steps/steps-list.d.ts +6 -0
- package/dist/types/components/steps/steps-next-trigger.d.ts +6 -0
- package/dist/types/components/steps/steps-prev-trigger.d.ts +6 -0
- package/dist/types/components/steps/steps-progress.d.ts +6 -0
- package/dist/types/components/steps/steps-root-provider.d.ts +11 -0
- package/dist/types/components/steps/steps-root.d.ts +7 -0
- package/dist/types/components/steps/steps-separator.d.ts +6 -0
- package/dist/types/components/steps/steps-trigger.d.ts +6 -0
- package/dist/types/components/steps/steps.d.ts +13 -0
- package/dist/types/components/steps/use-steps-context.d.ts +4 -0
- package/dist/types/components/steps/use-steps-item-context.d.ts +5 -0
- package/dist/types/components/steps/use-steps-item-props-context.d.ts +4 -0
- package/dist/types/components/steps/use-steps.d.ts +13 -0
- package/dist/types/components/timer/index.d.ts +9 -0
- package/dist/types/components/timer/timer-action-trigger.d.ts +7 -0
- package/dist/types/components/timer/timer-context.d.ts +6 -0
- package/dist/types/components/timer/timer-item.d.ts +7 -0
- package/dist/types/components/timer/timer-root-provider.d.ts +11 -0
- package/dist/types/components/timer/timer-root.d.ts +7 -0
- package/dist/types/components/timer/timer-separator.d.ts +6 -0
- package/dist/types/components/timer/timer.d.ts +6 -0
- package/dist/types/components/timer/use-timer-context.d.ts +4 -0
- package/dist/types/components/timer/use-timer.d.ts +9 -0
- package/package.json +53 -52
|
@@ -7,8 +7,10 @@ export const EditableRoot = (props) => {
|
|
|
7
7
|
const [useEditableProps, localProps] = createSplitProps()(props, [
|
|
8
8
|
'activationMode',
|
|
9
9
|
'autoResize',
|
|
10
|
+
'defaultEdit',
|
|
10
11
|
'defaultValue',
|
|
11
12
|
'disabled',
|
|
13
|
+
'edit',
|
|
12
14
|
'finalFocusEl',
|
|
13
15
|
'form',
|
|
14
16
|
'id',
|
|
@@ -16,7 +18,7 @@ export const EditableRoot = (props) => {
|
|
|
16
18
|
'invalid',
|
|
17
19
|
'maxLength',
|
|
18
20
|
'name',
|
|
19
|
-
'
|
|
21
|
+
'onEditChange',
|
|
20
22
|
'onFocusOutside',
|
|
21
23
|
'onInteractOutside',
|
|
22
24
|
'onPointerDownOutside',
|
|
@@ -27,7 +29,6 @@ export const EditableRoot = (props) => {
|
|
|
27
29
|
'readOnly',
|
|
28
30
|
'required',
|
|
29
31
|
'selectOnFocus',
|
|
30
|
-
'startWithEditView',
|
|
31
32
|
'submitMode',
|
|
32
33
|
'translations',
|
|
33
34
|
'value',
|
|
@@ -20,7 +20,9 @@ export const useEditable = (props) => {
|
|
|
20
20
|
readOnly: field?.().readOnly,
|
|
21
21
|
required: field?.().required,
|
|
22
22
|
getRootNode: environment().getRootNode,
|
|
23
|
+
edit: props.defaultEdit,
|
|
23
24
|
value: props.defaultValue,
|
|
25
|
+
'edit.controlled': props.edit !== undefined,
|
|
24
26
|
...props,
|
|
25
27
|
}));
|
|
26
28
|
const [state, send] = useMachine(editable.machine(context()), { context });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { StepsCompletedContent, } from './steps-completed-content';
|
|
2
|
+
export { StepsContent } from './steps-content';
|
|
3
|
+
export { StepsIndicator, } from './steps-indicator';
|
|
4
|
+
export { StepsItem } from './steps-item';
|
|
5
|
+
export { StepsItemContext } from './steps-item-context';
|
|
6
|
+
export { StepsList } from './steps-list';
|
|
7
|
+
export { StepsNextTrigger, } from './steps-next-trigger';
|
|
8
|
+
export { StepsPrevTrigger, } from './steps-prev-trigger';
|
|
9
|
+
export { StepsProgress, } from './steps-progress';
|
|
10
|
+
export { StepsRoot } from './steps-root';
|
|
11
|
+
export { StepsRootProvider, } from './steps-root-provider';
|
|
12
|
+
export { StepsSeparator, } from './steps-separator';
|
|
13
|
+
export { StepsTrigger } from './steps-trigger';
|
|
14
|
+
export { useSteps } from './use-steps';
|
|
15
|
+
export { useStepsContext } from './use-steps-context';
|
|
16
|
+
export { useStepsItemContext } from './use-steps-item-context';
|
|
17
|
+
export * as Steps from './steps';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { ark } from '../factory';
|
|
3
|
+
import { useStepsContext } from './use-steps-context';
|
|
4
|
+
export const StepsCompletedContent = (props) => {
|
|
5
|
+
const steps = useStepsContext();
|
|
6
|
+
const mergedProps = mergeProps(() => steps().getContentProps({ index: steps().count }), props);
|
|
7
|
+
return <ark.div {...mergedProps}/>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { createSplitProps } from '../../utils/create-split-props';
|
|
3
|
+
import { ark } from '../factory';
|
|
4
|
+
import { useStepsContext } from './use-steps-context';
|
|
5
|
+
export const StepsContent = (props) => {
|
|
6
|
+
const [itemProps, localProps] = createSplitProps()(props, ['index']);
|
|
7
|
+
const steps = useStepsContext();
|
|
8
|
+
const mergedProps = mergeProps(() => steps().getContentProps(itemProps), localProps);
|
|
9
|
+
return <ark.div {...mergedProps}/>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { ark } from '../factory';
|
|
3
|
+
import { useStepsContext } from './use-steps-context';
|
|
4
|
+
import { useStepsItemPropsContext } from './use-steps-item-props-context';
|
|
5
|
+
export const StepsIndicator = (props) => {
|
|
6
|
+
const steps = useStepsContext();
|
|
7
|
+
const itemProps = useStepsItemPropsContext();
|
|
8
|
+
const mergedProps = mergeProps(() => steps().getIndicatorProps(itemProps), props);
|
|
9
|
+
return <ark.div {...mergedProps}/>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { createMemo } from 'solid-js';
|
|
3
|
+
import { createSplitProps } from '../../utils/create-split-props';
|
|
4
|
+
import { ark } from '../factory';
|
|
5
|
+
import { useStepsContext } from './use-steps-context';
|
|
6
|
+
import { StepsItemProvider } from './use-steps-item-context';
|
|
7
|
+
import { StepsItemPropsProvider } from './use-steps-item-props-context';
|
|
8
|
+
export const StepsItem = (props) => {
|
|
9
|
+
const [itemProps, localProps] = createSplitProps()(props, ['index']);
|
|
10
|
+
const steps = useStepsContext();
|
|
11
|
+
const mergedProps = mergeProps(() => steps().getItemProps(itemProps), localProps);
|
|
12
|
+
const itemState = createMemo(() => steps().getItemState(itemProps));
|
|
13
|
+
return (<StepsItemPropsProvider value={itemProps}>
|
|
14
|
+
<StepsItemProvider value={itemState}>
|
|
15
|
+
<ark.li {...mergedProps}/>
|
|
16
|
+
</StepsItemProvider>
|
|
17
|
+
</StepsItemPropsProvider>);
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { ark } from '../factory';
|
|
3
|
+
import { useStepsContext } from './use-steps-context';
|
|
4
|
+
export const StepsList = (props) => {
|
|
5
|
+
const steps = useStepsContext();
|
|
6
|
+
const mergedProps = mergeProps(() => steps().getListProps(), props);
|
|
7
|
+
return <ark.ol {...mergedProps}/>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { ark } from '../factory';
|
|
3
|
+
import { useStepsContext } from './use-steps-context';
|
|
4
|
+
export const StepsNextTrigger = (props) => {
|
|
5
|
+
const steps = useStepsContext();
|
|
6
|
+
const mergedProps = mergeProps(() => steps().getNextTriggerProps(), props);
|
|
7
|
+
return <ark.button {...mergedProps}/>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { ark } from '../factory';
|
|
3
|
+
import { useStepsContext } from './use-steps-context';
|
|
4
|
+
export const StepsPrevTrigger = (props) => {
|
|
5
|
+
const steps = useStepsContext();
|
|
6
|
+
const mergedProps = mergeProps(() => steps().getPrevTriggerProps(), props);
|
|
7
|
+
return <ark.button {...mergedProps}/>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { ark } from '../factory';
|
|
3
|
+
import { useStepsContext } from './use-steps-context';
|
|
4
|
+
export const StepsProgress = (props) => {
|
|
5
|
+
const steps = useStepsContext();
|
|
6
|
+
const mergedProps = mergeProps(() => steps().getProgressProps(), props);
|
|
7
|
+
return <ark.div {...mergedProps}/>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { createSplitProps } from '../../utils/create-split-props';
|
|
3
|
+
import { ark } from '../factory';
|
|
4
|
+
import { StepsProvider } from './use-steps-context';
|
|
5
|
+
export const StepsRootProvider = (props) => {
|
|
6
|
+
const [{ value: steps }, rootProps] = createSplitProps()(props, ['value']);
|
|
7
|
+
const mergedProps = mergeProps(() => steps().getRootProps(), rootProps);
|
|
8
|
+
return (<StepsProvider value={steps}>
|
|
9
|
+
<ark.div {...mergedProps}>{props.children}</ark.div>
|
|
10
|
+
</StepsProvider>);
|
|
11
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { createSplitProps } from '../../utils/create-split-props';
|
|
3
|
+
import { ark } from '../factory';
|
|
4
|
+
import { useSteps } from './use-steps';
|
|
5
|
+
import { StepsProvider } from './use-steps-context';
|
|
6
|
+
export const StepsRoot = (props) => {
|
|
7
|
+
const [useStepsProps, localProps] = createSplitProps()(props, [
|
|
8
|
+
'defaultStep',
|
|
9
|
+
'id',
|
|
10
|
+
'ids',
|
|
11
|
+
'count',
|
|
12
|
+
'linear',
|
|
13
|
+
'onStepChange',
|
|
14
|
+
'onStepComplete',
|
|
15
|
+
'orientation',
|
|
16
|
+
'step',
|
|
17
|
+
]);
|
|
18
|
+
const steps = useSteps(useStepsProps);
|
|
19
|
+
const mergedProps = mergeProps(() => steps().getRootProps(), localProps);
|
|
20
|
+
return (<StepsProvider value={steps}>
|
|
21
|
+
<ark.div {...mergedProps}/>
|
|
22
|
+
</StepsProvider>);
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { ark } from '../factory';
|
|
3
|
+
import { useStepsContext } from './use-steps-context';
|
|
4
|
+
import { useStepsItemPropsContext } from './use-steps-item-props-context';
|
|
5
|
+
export const StepsSeparator = (props) => {
|
|
6
|
+
const steps = useStepsContext();
|
|
7
|
+
const itemProps = useStepsItemPropsContext();
|
|
8
|
+
const mergedProps = mergeProps(() => steps().getSeparatorProps(itemProps), props);
|
|
9
|
+
return <ark.div {...mergedProps}/>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { ark } from '../factory';
|
|
3
|
+
import { useStepsContext } from './use-steps-context';
|
|
4
|
+
import { useStepsItemPropsContext } from './use-steps-item-props-context';
|
|
5
|
+
export const StepsTrigger = (props) => {
|
|
6
|
+
const steps = useStepsContext();
|
|
7
|
+
const itemProps = useStepsItemPropsContext();
|
|
8
|
+
const mergedProps = mergeProps(() => steps().getTriggerProps(itemProps), props);
|
|
9
|
+
return <ark.button {...mergedProps}/>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { StepsContent as Content, } from './steps-content';
|
|
2
|
+
export { StepsCompletedContent as CompletedContent, } from './steps-completed-content';
|
|
3
|
+
export { StepsIndicator as Indicator, } from './steps-indicator';
|
|
4
|
+
export { StepsItem as Item, } from './steps-item';
|
|
5
|
+
export { StepsList as List, } from './steps-list';
|
|
6
|
+
export { StepsNextTrigger as NextTrigger, } from './steps-next-trigger';
|
|
7
|
+
export { StepsPrevTrigger as PrevTrigger, } from './steps-prev-trigger';
|
|
8
|
+
export { StepsProgress as Progress, } from './steps-progress';
|
|
9
|
+
export { StepsRoot as Root, } from './steps-root';
|
|
10
|
+
export { StepsRootProvider as RootProvider, } from './steps-root-provider';
|
|
11
|
+
export { StepsSeparator as Separator, } from './steps-separator';
|
|
12
|
+
export { StepsTrigger as Trigger, } from './steps-trigger';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { normalizeProps, useMachine } from '@zag-js/solid';
|
|
2
|
+
import * as steps from '@zag-js/steps';
|
|
3
|
+
import { createMemo, createUniqueId } from 'solid-js';
|
|
4
|
+
import { useEnvironmentContext, useLocaleContext } from '../../providers';
|
|
5
|
+
export function useSteps(props = {}) {
|
|
6
|
+
const environment = useEnvironmentContext();
|
|
7
|
+
const locale = useLocaleContext();
|
|
8
|
+
const id = createUniqueId();
|
|
9
|
+
const context = createMemo(() => ({
|
|
10
|
+
id,
|
|
11
|
+
dir: locale().dir,
|
|
12
|
+
getRootNode: environment().getRootNode,
|
|
13
|
+
step: props.defaultStep,
|
|
14
|
+
...props,
|
|
15
|
+
}));
|
|
16
|
+
const [state, send] = useMachine(steps.machine(context()), { context });
|
|
17
|
+
return createMemo(() => steps.connect(state, send, normalizeProps));
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { TimerContext, } from './timer-context';
|
|
2
|
+
export { TimerActionTrigger, } from './timer-action-trigger';
|
|
3
|
+
export { TimerItem, } from './timer-item';
|
|
4
|
+
export { TimerSeparator, } from './timer-separator';
|
|
5
|
+
export { TimerRoot, } from './timer-root';
|
|
6
|
+
export { TimerRootProvider, } from './timer-root-provider';
|
|
7
|
+
export { useTimer } from './use-timer';
|
|
8
|
+
export { useTimerContext } from './use-timer-context';
|
|
9
|
+
export * as Timer from './timer';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { ark } from '../factory';
|
|
3
|
+
import { useTimerContext } from './use-timer-context';
|
|
4
|
+
export const TimerActionTrigger = (props) => {
|
|
5
|
+
const timer = useTimerContext();
|
|
6
|
+
const mergedProps = mergeProps(() => timer().getActionTriggerProps(props), props);
|
|
7
|
+
return <ark.button {...mergedProps}/>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { createSplitProps } from '../../utils/create-split-props';
|
|
3
|
+
import { ark } from '../factory';
|
|
4
|
+
import { useTimerContext } from './use-timer-context';
|
|
5
|
+
export const TimerItem = (props) => {
|
|
6
|
+
const [itemProps, localProps] = createSplitProps()(props, ['type']);
|
|
7
|
+
const timer = useTimerContext();
|
|
8
|
+
const mergedProps = mergeProps(() => timer().getItemProps(itemProps), localProps);
|
|
9
|
+
return <ark.div {...mergedProps}>{timer().formattedTime[itemProps.type]}</ark.div>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { createSplitProps } from '../../utils/create-split-props';
|
|
3
|
+
import { ark } from '../factory';
|
|
4
|
+
import { TimerProvider } from './use-timer-context';
|
|
5
|
+
export const TimerRootProvider = (props) => {
|
|
6
|
+
const [{ value: timer }, localProps] = createSplitProps()(props, ['value']);
|
|
7
|
+
const mergedProps = mergeProps(() => timer().getRootProps(), localProps);
|
|
8
|
+
return (<TimerProvider value={timer}>
|
|
9
|
+
<ark.div {...mergedProps}/>
|
|
10
|
+
</TimerProvider>);
|
|
11
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { createSplitProps } from '../../utils/create-split-props';
|
|
3
|
+
import { ark } from '../factory';
|
|
4
|
+
import { useTimer } from './use-timer';
|
|
5
|
+
import { TimerProvider } from './use-timer-context';
|
|
6
|
+
export const TimerRoot = (props) => {
|
|
7
|
+
const [useTimerProps, localProps] = createSplitProps()(props, [
|
|
8
|
+
'id',
|
|
9
|
+
'autoStart',
|
|
10
|
+
'interval',
|
|
11
|
+
'countdown',
|
|
12
|
+
'startMs',
|
|
13
|
+
'targetMs',
|
|
14
|
+
'onComplete',
|
|
15
|
+
'onTick',
|
|
16
|
+
]);
|
|
17
|
+
const timer = useTimer(useTimerProps);
|
|
18
|
+
const mergedProps = mergeProps(() => timer().getRootProps(), localProps);
|
|
19
|
+
return (<TimerProvider value={timer}>
|
|
20
|
+
<ark.div {...mergedProps}/>
|
|
21
|
+
</TimerProvider>);
|
|
22
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
|
+
import { ark } from '../factory';
|
|
3
|
+
import { useTimerContext } from './use-timer-context';
|
|
4
|
+
export const TimerSeparator = (props) => {
|
|
5
|
+
const timer = useTimerContext();
|
|
6
|
+
const mergedProps = mergeProps(() => timer().getSeparatorProps(), props);
|
|
7
|
+
return <ark.div {...mergedProps}/>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { TimerContext as Context, } from './timer-context';
|
|
2
|
+
export { TimerActionTrigger as ActionTrigger, } from './timer-action-trigger';
|
|
3
|
+
export { TimerItem as Item, } from './timer-item';
|
|
4
|
+
export { TimerSeparator as Separator, } from './timer-separator';
|
|
5
|
+
export { TimerRoot as Root, } from './timer-root';
|
|
6
|
+
export { TimerRootProvider as RootProvider, } from './timer-root-provider';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { normalizeProps, useMachine } from '@zag-js/solid';
|
|
2
|
+
import * as timer from '@zag-js/timer';
|
|
3
|
+
import { createMemo, createUniqueId } from 'solid-js';
|
|
4
|
+
import { useEnvironmentContext } from '../../providers';
|
|
5
|
+
export const useTimer = (props) => {
|
|
6
|
+
const env = useEnvironmentContext();
|
|
7
|
+
const id = createUniqueId();
|
|
8
|
+
const context = createMemo(() => ({
|
|
9
|
+
id,
|
|
10
|
+
getRootNode: env().getRootNode,
|
|
11
|
+
...props,
|
|
12
|
+
}));
|
|
13
|
+
const [state, send] = useMachine(timer.machine(context()), { context });
|
|
14
|
+
return createMemo(() => timer.connect(state, send, normalizeProps));
|
|
15
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export type { ValueChangeDetails as EditableValueChangeDetails } from '@zag-js/editable';
|
|
2
|
+
export interface EditableEditChangeDetails {
|
|
3
|
+
edit: boolean;
|
|
4
|
+
}
|
|
2
5
|
export { EditableArea, type EditableAreaProps, type EditableAreaBaseProps, } from './editable-area';
|
|
3
6
|
export { EditableCancelTrigger, type EditableCancelTriggerProps, type EditableCancelTriggerBaseProps, } from './editable-cancel-trigger';
|
|
4
7
|
export { EditableContext, type EditableContextProps, } from './editable-context';
|
|
@@ -2,7 +2,12 @@ import * as editable from '@zag-js/editable';
|
|
|
2
2
|
import { type PropTypes } from '@zag-js/solid';
|
|
3
3
|
import { type Accessor } from 'solid-js';
|
|
4
4
|
import type { Optional } from '../../types';
|
|
5
|
-
export interface UseEditableProps extends Optional<Omit<editable.Context, 'dir' | 'getRootNode'>, 'id'> {
|
|
5
|
+
export interface UseEditableProps extends Optional<Omit<editable.Context, 'dir' | 'getRootNode' | 'edit.controlled'>, 'id'> {
|
|
6
|
+
/**
|
|
7
|
+
* The initial edit state of the editable when it is first rendered.
|
|
8
|
+
* Use when you do not need to control its edit state.
|
|
9
|
+
*/
|
|
10
|
+
defaultEdit?: editable.Context['edit'];
|
|
6
11
|
/**
|
|
7
12
|
* The initial value of the editable when it is first rendered.
|
|
8
13
|
* Use when you do not need to control the state of the editable.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { StepChangeDetails } from '@zag-js/steps';
|
|
2
|
+
export { StepsCompletedContent, type StepsCompletedContentBaseProps, type StepsCompletedContentProps, } from './steps-completed-content';
|
|
3
|
+
export { StepsContent, type StepsContentBaseProps, type StepsContentProps } from './steps-content';
|
|
4
|
+
export { StepsIndicator, type StepsIndicatorBaseProps, type StepsIndicatorProps, } from './steps-indicator';
|
|
5
|
+
export { StepsItem, type StepsItemBaseProps, type StepsItemProps } from './steps-item';
|
|
6
|
+
export { StepsItemContext, type StepsItemContextProps } from './steps-item-context';
|
|
7
|
+
export { StepsList, type StepsListBaseProps, type StepsListProps } from './steps-list';
|
|
8
|
+
export { StepsNextTrigger, type StepsNextTriggerBaseProps, type StepsNextTriggerProps, } from './steps-next-trigger';
|
|
9
|
+
export { StepsPrevTrigger, type StepsPrevTriggerBaseProps, type StepsPrevTriggerProps, } from './steps-prev-trigger';
|
|
10
|
+
export { StepsProgress, type StepsProgressBaseProps, type StepsProgressProps, } from './steps-progress';
|
|
11
|
+
export { StepsRoot, type StepsRootBaseProps, type StepsRootProps } from './steps-root';
|
|
12
|
+
export { StepsRootProvider, type StepsRootProviderBaseProps, type StepsRootProviderProps, } from './steps-root-provider';
|
|
13
|
+
export { StepsSeparator, type StepsSeparatorBaseProps, type StepsSeparatorProps, } from './steps-separator';
|
|
14
|
+
export { StepsTrigger, type StepsTriggerBaseProps, type StepsTriggerProps } from './steps-trigger';
|
|
15
|
+
export { useSteps, type UseStepsProps, type UseStepsReturn } from './use-steps';
|
|
16
|
+
export { useStepsContext, type UseStepsContext } from './use-steps-context';
|
|
17
|
+
export { useStepsItemContext, type UseStepsItemContext } from './use-steps-item-context';
|
|
18
|
+
export * as Steps from './steps';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
2
|
+
export interface StepsCompletedContentBaseProps extends PolymorphicProps<'div'> {
|
|
3
|
+
}
|
|
4
|
+
export interface StepsCompletedContentProps extends HTMLProps<'div'>, StepsCompletedContentBaseProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const StepsCompletedContent: (props: StepsCompletedContentProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ItemProps } from '@zag-js/steps';
|
|
2
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
3
|
+
export interface StepsContentBaseProps extends PolymorphicProps<'div'>, ItemProps {
|
|
4
|
+
}
|
|
5
|
+
export interface StepsContentProps extends HTMLProps<'div'>, StepsContentBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const StepsContent: (props: StepsContentProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
2
|
+
export interface StepsIndicatorBaseProps extends PolymorphicProps<'div'> {
|
|
3
|
+
}
|
|
4
|
+
export interface StepsIndicatorProps extends HTMLProps<'div'>, StepsIndicatorBaseProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const StepsIndicator: (props: StepsIndicatorProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSX } from 'solid-js';
|
|
2
|
+
import { type UseStepsItemContext } from './use-steps-item-context';
|
|
3
|
+
export interface StepsItemContextProps {
|
|
4
|
+
children: (context: UseStepsItemContext) => JSX.Element;
|
|
5
|
+
}
|
|
6
|
+
export declare const StepsItemContext: {
|
|
7
|
+
(props: StepsItemContextProps): JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ItemProps } from '@zag-js/steps';
|
|
2
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
3
|
+
export interface StepsItemBaseProps extends ItemProps, PolymorphicProps<'li'> {
|
|
4
|
+
}
|
|
5
|
+
export interface StepsItemProps extends HTMLProps<'li'>, StepsItemBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const StepsItem: (props: StepsItemProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
2
|
+
export interface StepsListBaseProps extends PolymorphicProps<'ol'> {
|
|
3
|
+
}
|
|
4
|
+
export interface StepsListProps extends HTMLProps<'ol'>, StepsListBaseProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const StepsList: (props: StepsListProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
2
|
+
export interface StepsNextTriggerBaseProps extends PolymorphicProps<'button'> {
|
|
3
|
+
}
|
|
4
|
+
export interface StepsNextTriggerProps extends HTMLProps<'button'>, StepsNextTriggerBaseProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const StepsNextTrigger: (props: StepsNextTriggerProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
2
|
+
export interface StepsPrevTriggerBaseProps extends PolymorphicProps<'button'> {
|
|
3
|
+
}
|
|
4
|
+
export interface StepsPrevTriggerProps extends HTMLProps<'button'>, StepsPrevTriggerBaseProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const StepsPrevTrigger: (props: StepsPrevTriggerProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
2
|
+
export interface StepsProgressBaseProps extends PolymorphicProps<'div'> {
|
|
3
|
+
}
|
|
4
|
+
export interface StepsProgressProps extends HTMLProps<'div'>, StepsProgressBaseProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const StepsProgress: (props: StepsProgressProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
2
|
+
import type { UseStepsReturn } from './use-steps';
|
|
3
|
+
interface RootProviderProps {
|
|
4
|
+
value: UseStepsReturn;
|
|
5
|
+
}
|
|
6
|
+
export interface StepsRootProviderBaseProps extends RootProviderProps, PolymorphicProps<'div'> {
|
|
7
|
+
}
|
|
8
|
+
export interface StepsRootProviderProps extends HTMLProps<'div'>, StepsRootProviderBaseProps {
|
|
9
|
+
}
|
|
10
|
+
export declare const StepsRootProvider: (props: StepsRootProviderProps) => import("solid-js").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
2
|
+
import { type UseStepsProps } from './use-steps';
|
|
3
|
+
export interface StepsRootBaseProps extends UseStepsProps, PolymorphicProps<'div'> {
|
|
4
|
+
}
|
|
5
|
+
export interface StepsRootProps extends HTMLProps<'div'>, StepsRootBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const StepsRoot: (props: StepsRootProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
2
|
+
export interface StepsSeparatorBaseProps extends PolymorphicProps<'div'> {
|
|
3
|
+
}
|
|
4
|
+
export interface StepsSeparatorProps extends HTMLProps<'div'>, StepsSeparatorBaseProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const StepsSeparator: (props: StepsSeparatorProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLProps, type PolymorphicProps } from '../factory';
|
|
2
|
+
export interface StepsTriggerBaseProps extends PolymorphicProps<'button'> {
|
|
3
|
+
}
|
|
4
|
+
export interface StepsTriggerProps extends HTMLProps<'button'>, StepsTriggerBaseProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const StepsTrigger: (props: StepsTriggerProps) => import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type { StepChangeDetails as ChangeDetails } from '@zag-js/steps';
|
|
2
|
+
export { StepsContent as Content, type StepsContentBaseProps as ContentBaseProps, type StepsContentProps as ContentProps, } from './steps-content';
|
|
3
|
+
export { StepsCompletedContent as CompletedContent, type StepsCompletedContentBaseProps as CompletedContentBaseProps, type StepsCompletedContentProps as CompletedContentProps, } from './steps-completed-content';
|
|
4
|
+
export { StepsIndicator as Indicator, type StepsIndicatorBaseProps as IndicatorBaseProps, type StepsIndicatorProps as IndicatorProps, } from './steps-indicator';
|
|
5
|
+
export { StepsItem as Item, type StepsItemBaseProps as ItemBaseProps, type StepsItemProps as ItemProps, } from './steps-item';
|
|
6
|
+
export { StepsList as List, type StepsListBaseProps as ListBaseProps, type StepsListProps as ListProps, } from './steps-list';
|
|
7
|
+
export { StepsNextTrigger as NextTrigger, type StepsNextTriggerBaseProps as NextTriggerBaseProps, type StepsNextTriggerProps as NextTriggerProps, } from './steps-next-trigger';
|
|
8
|
+
export { StepsPrevTrigger as PrevTrigger, type StepsPrevTriggerBaseProps as PrevTriggerBaseProps, type StepsPrevTriggerProps as PrevTriggerProps, } from './steps-prev-trigger';
|
|
9
|
+
export { StepsProgress as Progress, type StepsProgressBaseProps as ProgressBaseProps, type StepsProgressProps as ProgressProps, } from './steps-progress';
|
|
10
|
+
export { StepsRoot as Root, type StepsRootBaseProps as RootBaseProps, type StepsRootProps as RootProps, } from './steps-root';
|
|
11
|
+
export { StepsRootProvider as RootProvider, type StepsRootProviderBaseProps as RootProviderBaseProps, type StepsRootProviderProps as RootProviderProps, } from './steps-root-provider';
|
|
12
|
+
export { StepsSeparator as Separator, type StepsSeparatorBaseProps as SeparatorBaseProps, type StepsSeparatorProps as SeparatorProps, } from './steps-separator';
|
|
13
|
+
export { StepsTrigger as Trigger, type StepsTriggerBaseProps as TriggerBaseProps, type StepsTriggerProps as TriggerProps, } from './steps-trigger';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ItemState } from '@zag-js/steps';
|
|
2
|
+
import type { Accessor } from 'solid-js';
|
|
3
|
+
export interface UseStepsItemContext extends Accessor<ItemState> {
|
|
4
|
+
}
|
|
5
|
+
export declare const StepsItemProvider: import("solid-js").ContextProviderComponent<UseStepsItemContext>, useStepsItemContext: () => UseStepsItemContext;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ItemProps } from '@zag-js/steps';
|
|
2
|
+
export interface UseStepsItemPropsContext extends ItemProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const StepsItemPropsProvider: import("solid-js").ContextProviderComponent<UseStepsItemPropsContext>, useStepsItemPropsContext: () => UseStepsItemPropsContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type PropTypes } from '@zag-js/solid';
|
|
2
|
+
import * as steps from '@zag-js/steps';
|
|
3
|
+
import { type Accessor } from 'solid-js';
|
|
4
|
+
import type { Optional } from '../../types';
|
|
5
|
+
export interface UseStepsProps extends Optional<Omit<steps.Context, 'dir' | 'getRootNode'>, 'id'> {
|
|
6
|
+
/**
|
|
7
|
+
* The initial value of the step
|
|
8
|
+
*/
|
|
9
|
+
defaultStep?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface UseStepsReturn extends Accessor<steps.Api<PropTypes>> {
|
|
12
|
+
}
|
|
13
|
+
export declare function useSteps(props?: UseStepsProps): UseStepsReturn;
|