@ark-ui/solid 1.0.0 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ark-ui/solid",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A collection of unstyled, accessible UI components for Solid, utilizing state machines for seamless interaction.",
5
5
  "keywords": [
6
6
  "accordion",
@@ -80,36 +80,35 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "@ark-ui/anatomy": "1.0.0",
83
- "@zag-js/accordion": "0.28.0",
84
- "@zag-js/avatar": "0.28.0",
85
- "@zag-js/carousel": "0.28.0",
86
- "@zag-js/checkbox": "0.28.0",
87
- "@zag-js/color-picker": "0.28.0",
88
- "@zag-js/combobox": "0.28.0",
89
- "@zag-js/date-picker": "0.28.0",
90
- "@zag-js/dialog": "0.28.0",
91
- "@zag-js/editable": "0.28.0",
92
- "@zag-js/hover-card": "0.28.0",
93
- "@zag-js/menu": "0.28.0",
94
- "@zag-js/number-input": "0.28.0",
95
- "@zag-js/pagination": "0.28.0",
96
- "@zag-js/pin-input": "0.28.0",
97
- "@zag-js/popover": "0.28.0",
98
- "@zag-js/presence": "0.28.0",
99
- "@zag-js/radio-group": "0.28.0",
100
- "@zag-js/rating-group": "0.28.0",
101
- "@zag-js/select": "0.28.0",
102
- "@zag-js/slider": "0.28.0",
103
- "@zag-js/solid": "0.28.0",
104
- "@zag-js/splitter": "0.28.0",
105
- "@zag-js/switch": "0.28.0",
106
- "@zag-js/tabs": "0.28.0",
107
- "@zag-js/tags-input": "0.28.0",
108
- "@zag-js/toast": "0.28.0",
109
- "@zag-js/toggle-group": "0.28.0",
110
- "@zag-js/tooltip": "0.28.0",
111
- "@zag-js/types": "0.28.0",
112
- "resize-observer-polyfill": "1.5.1"
83
+ "@zag-js/accordion": "0.29.0",
84
+ "@zag-js/avatar": "0.29.0",
85
+ "@zag-js/carousel": "0.29.0",
86
+ "@zag-js/checkbox": "0.29.0",
87
+ "@zag-js/color-picker": "0.29.0",
88
+ "@zag-js/combobox": "0.29.0",
89
+ "@zag-js/date-picker": "0.29.0",
90
+ "@zag-js/dialog": "0.29.0",
91
+ "@zag-js/editable": "0.29.0",
92
+ "@zag-js/hover-card": "0.29.0",
93
+ "@zag-js/menu": "0.29.0",
94
+ "@zag-js/number-input": "0.29.0",
95
+ "@zag-js/pagination": "0.29.0",
96
+ "@zag-js/pin-input": "0.29.0",
97
+ "@zag-js/popover": "0.29.0",
98
+ "@zag-js/presence": "0.29.0",
99
+ "@zag-js/radio-group": "0.29.0",
100
+ "@zag-js/rating-group": "0.29.0",
101
+ "@zag-js/select": "0.29.0",
102
+ "@zag-js/slider": "0.29.0",
103
+ "@zag-js/solid": "0.29.0",
104
+ "@zag-js/splitter": "0.29.0",
105
+ "@zag-js/switch": "0.29.0",
106
+ "@zag-js/tabs": "0.29.0",
107
+ "@zag-js/tags-input": "0.29.0",
108
+ "@zag-js/toast": "0.29.0",
109
+ "@zag-js/toggle-group": "0.29.0",
110
+ "@zag-js/tooltip": "0.29.0",
111
+ "@zag-js/types": "0.29.0"
113
112
  },
114
113
  "devDependencies": {
115
114
  "@release-it/keep-a-changelog": "4.0.0",
@@ -133,6 +132,7 @@
133
132
  "react": "18.2.0",
134
133
  "react-dom": "18.2.0",
135
134
  "release-it": "16.2.1",
135
+ "resize-observer-polyfill": "1.5.1",
136
136
  "rollup": "4.3.0",
137
137
  "rollup-preset-solid": "2.0.1",
138
138
  "solid-js": "1.8.5",
@@ -1,12 +1,13 @@
1
1
  import { mergeProps } from '@zag-js/solid';
2
2
  import { Show } from 'solid-js';
3
3
  import { ark } from '../factory';
4
- import { usePresenceContext } from '../presence';
4
+ import { usePresence, usePresencePropsContext } from '../presence';
5
5
  import { useDialogContext } from './dialog-context';
6
6
  export const DialogBackdrop = (props) => {
7
7
  const api = useDialogContext();
8
- const presenceApi = usePresenceContext();
9
- const mergedProps = mergeProps(() => api().backdropProps, props);
8
+ const presenceProps = usePresencePropsContext();
9
+ const presenceApi = usePresence(mergeProps(presenceProps, () => ({ present: api().isOpen })));
10
+ const mergedProps = mergeProps(() => api().backdropProps, () => presenceApi().presenceProps, props);
10
11
  return (<Show when={!presenceApi().isUnmounted}>
11
12
  <ark.div {...mergedProps}/>
12
13
  </Show>);
@@ -1,6 +1,6 @@
1
1
  import { mergeProps } from '@zag-js/solid';
2
2
  import { createSplitProps } from '../create-split-props';
3
- import { PresenceProvider, splitPresenceProps, usePresence, } from '../presence';
3
+ import { PresencePropsProvider, PresenceProvider, splitPresenceProps, usePresence, } from '../presence';
4
4
  import { runIfFn } from '../run-if-fn';
5
5
  import { DialogProvider } from './dialog-context';
6
6
  import { useDialog } from './use-dialog';
@@ -32,6 +32,8 @@ export const Dialog = (props) => {
32
32
  const apiPresence = usePresence(mergeProps(presenceProps, () => ({ present: api().isOpen })));
33
33
  const getChildren = () => runIfFn(localProps.children, api);
34
34
  return (<DialogProvider value={api}>
35
- <PresenceProvider value={apiPresence}>{getChildren()}</PresenceProvider>
35
+ <PresencePropsProvider value={presenceProps}>
36
+ <PresenceProvider value={apiPresence}>{getChildren()}</PresenceProvider>
37
+ </PresencePropsProvider>
36
38
  </DialogProvider>);
37
39
  };
@@ -1,8 +1,11 @@
1
1
  import { mergeProps } from '@zag-js/solid';
2
2
  import { ark } from '../factory';
3
+ import { usePresenceContext } from '../presence';
3
4
  import { useMenuContext } from './menu-context';
4
5
  export const MenuTrigger = (props) => {
5
- const menu = useMenuContext();
6
- const mergedProps = mergeProps(() => menu?.().triggerProps, props);
6
+ const api = useMenuContext();
7
+ const presenceApi = usePresenceContext();
8
+ const mergedProps = mergeProps(() => api().triggerProps, () => ({ 'aria-controls': presenceApi().isUnmounted && null }), props);
9
+ // @ts-expect-error we want aria-controls to be null to remove them if the popover if lazy mounted
7
10
  return <ark.button {...mergedProps}/>;
8
11
  };