Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit b771f3d

Browse files
Merge pull request #127 from chakra-ui/develop
release: `@chakra-ui/vue-styled`
2 parents 56ec7b5 + 6f990a1 commit b771f3d

33 files changed

+1952
-57
lines changed

.changeset/pre.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"quiet-bananas-develop",
5656
"rare-ads-impress",
5757
"selfish-mice-lay",
58+
"shy-eels-approve",
5859
"slimy-bugs-give",
5960
"spotty-trains-type",
6061
"sweet-lamps-brake",

.changeset/shy-eels-approve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@chakra-ui/c-modal": patch
3+
---
4+
5+
chore: remove unused logs

.changeset/twelve-poems-scream.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@chakra-ui/c-modal": minor
3+
"@chakra-ui/c-portal": minor
4+
"@chakra-ui/vue-next": minor
5+
"@chakra-ui/vue-styled": minor
6+
"@chakra-ui/vue-utils": minor
7+
"@chakra-ui/vue-a11y": minor
8+
"@chakra-ui/vue-auto-import": minor
9+
---
10+
11+
Create @chakra-ui/vue-styled package"

components.d.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* Typescript support for @@chakra-ui/vue-next1.0.0-alpha.10 auto-imported
2+
* Typescript support for @@chakra-ui/vue-next1.0.0-alpha.13 auto-imported
33
* components using `unplugin-vue-components,`
44
*
55
* @see: https://github.com/antfu/unplugin-vue-components/#typescript
66
*
77
* This is a generated file. Do not edit it's contents.
88
*
9-
* This file was generated on 2022-01-31T09:57:50.931Z
9+
* This file was generated on 2022-02-15T20:12:51.041Z
1010
*/
1111

1212
import { ChakraProps, chakra } from "@chakra-ui/vue-system"
@@ -37,13 +37,15 @@ type JsxComponentCustomProps = {
3737
innerHTML?: JsxNode
3838
}
3939

40+
declare var chakra: typeof import("@chakra-ui/vue-next")["chakra"]
41+
4042
declare module "@vue/runtime-core" {
4143
import { chakra } from "@chakra-ui/vue-next"
4244
export { chakra }
4345

4446
/* Global component types for Volar auto-complete */
4547
export interface GlobalComponents {
46-
// chakra: typeof import("@chakra-ui/vue-next")["chakra"]
48+
chakra: typeof import("@chakra-ui/vue-next")["chakra"]
4749

4850
CAlert: typeof import("@chakra-ui/vue-next")["CAlert"]
4951
CAlertDescription: typeof import("@chakra-ui/vue-next")["CAlertDescription"]

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"@cypress/vue": "^3.0.3",
6666
"@docusaurus/utils": "^2.0.0-beta.3",
6767
"@emotion/css": "^11.1.3",
68+
"@emotion/jest": "^11.7.1",
6869
"@emotion/server": "^11.0.0",
6970
"@manypkg/cli": "^0.17.0",
7071
"@mdx-js/rollup": "^2.0.0-rc.2",

packages/c-modal/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @chakra-ui/c-modal
22

3+
## 1.1.0-alpha.10
4+
5+
### Patch Changes
6+
7+
- chore: remove unused logs
8+
39
## 1.1.0-alpha.9
410

511
### Patch Changes

packages/c-modal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@chakra-ui/c-modal",
33
"description": "Chakra UI Vue | An accessible dialog modal component for chakra ui vue component",
4-
"version": "1.1.0-alpha.9",
4+
"version": "1.1.0-alpha.10",
55
"main": "dist/chakra-ui-c-modal.cjs.js",
66
"module": "dist/chakra-ui-c-modal.esm.js",
77
"author": "Jonathan Bakebwa <[email protected]>",

packages/c-modal/src/c-drawer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ export const CDrawerContent: ComponentWithProps<DrawerContentProps> = defineComp
169169
onInvalidate(() => {
170170
document.documentElement.style.overflow = overflow
171171
document.documentElement.style.paddingRight = paddingRight
172-
console.log("invalidating", document.documentElement.style.overflow)
173172
})
174173
})
175174

packages/c-modal/src/c-modal.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,13 @@ export const CModalContent: ComponentWithProps<
296296
inheritAttrs: false,
297297
emits: ["click", "mousedown", "keydown"],
298298
setup(_, { attrs, slots, emit }) {
299-
const { dialogContainerProps, dialogProps, blockScrollOnMount, modelValue, motionPreset } =
300-
unref(useModalContext())
299+
const {
300+
dialogContainerProps,
301+
dialogProps,
302+
blockScrollOnMount,
303+
modelValue,
304+
motionPreset,
305+
} = unref(useModalContext())
301306
const styles = useStyles()
302307
const transitionId = useId("modal-content")
303308

@@ -317,8 +322,8 @@ export const CModalContent: ComponentWithProps<
317322
})
318323

319324
// Scroll lock
320-
watchEffect((onInvalidate: VoidFunction) => {
321-
if (!blockScrollOnMount.value) return
325+
watchEffect((onInvalidate) => {
326+
if (!blockScrollOnMount!.value) return
322327
if (modelValue.value !== true) return
323328

324329
let overflow = document.documentElement.style.overflow
@@ -333,7 +338,6 @@ export const CModalContent: ComponentWithProps<
333338
onInvalidate(() => {
334339
document.documentElement.style.overflow = overflow
335340
document.documentElement.style.paddingRight = paddingRight
336-
console.log("invalidating", document.documentElement.style.overflow)
337341
})
338342
})
339343

packages/c-modal/src/use-modal.ts

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import {
22
computed,
33
getCurrentInstance,
4-
onBeforeMount,
5-
onBeforeUnmount,
64
ref,
75
Ref,
86
ToRefs,
9-
toRefs,
107
unref,
118
VNodeProps,
129
watch,
@@ -24,7 +21,7 @@ import {
2421
getSelector,
2522
TemplateRef,
2623
} from "@chakra-ui/vue-utils"
27-
import { hideOthers, Undo, useInertOthers } from "@chakra-ui/vue-a11y"
24+
import { useInertOthers } from "@chakra-ui/vue-a11y"
2825
import { focus, FocusableElement, isFunction } from "@chakra-ui/utils"
2926

3027
export interface UseModalOptions {
@@ -99,8 +96,7 @@ export function useModal(options: UseModalOptions) {
9996
initialFocusRef,
10097
finalFocusRef,
10198
useInert,
102-
blockScrollOnMount,
103-
} = toRefs(options)
99+
} = options
104100

105101
const instance = getCurrentInstance()
106102

@@ -301,33 +297,3 @@ export type UseModalReturn = Omit<
301297
ToRefs<ReturnType<typeof useModal>>,
302298
"dialogRef" | "overlayRef" | "closeModal"
303299
>
304-
305-
/**
306-
* Modal hook to polyfill `aria-modal`.
307-
*
308-
* It applies `aria-hidden` to elements behind the modal
309-
* to indicate that they're `inert`.
310-
*
311-
* @param ref ref of the node to be excluded from aria-hidden
312-
* @param shouldHide whether `aria-hidden` should be applied
313-
*/
314-
export function useAriaHidden(
315-
node: Ref<HTMLElement | undefined | null>,
316-
shouldHide: Ref<boolean>
317-
) {
318-
let undo: Undo | null = null
319-
320-
watchEffect(
321-
() => {
322-
// await nextTick()
323-
if (shouldHide.value && node.value) {
324-
undo = hideOthers(node.value)
325-
} else {
326-
undo?.()
327-
}
328-
},
329-
{
330-
flush: "post",
331-
}
332-
)
333-
}

0 commit comments

Comments
 (0)