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

Commit

Permalink
Merge pull request #279 from chakra-ui/feat/c-live-region
Browse files Browse the repository at this point in the history
feat: `CLiveRegion`, `CTextarea` `useBreakpoint` and `useBreakpointValue` hooks
  • Loading branch information
codebender828 authored Feb 26, 2023
2 parents 362b362 + 73bd87a commit 4564d8d
Show file tree
Hide file tree
Showing 31 changed files with 696 additions and 94 deletions.
34 changes: 34 additions & 0 deletions .changeset/spicy-doors-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
"@chakra-ui/vue-composables": minor
"@chakra-ui/c-close-button": minor
"@chakra-ui/c-form-control": minor
"@chakra-ui/c-live-region": minor
"@chakra-ui/c-media-query": minor
"@chakra-ui/c-scroll-lock": minor
"@chakra-ui/c-breadcrumb": minor
"@chakra-ui/c-accordion": minor
"@chakra-ui/c-pin-input": minor
"@chakra-ui/c-checkbox": minor
"@chakra-ui/c-skip-nav": minor
"@chakra-ui/c-textarea": minor
"@chakra-ui/c-spinner": minor
"@chakra-ui/c-avatar": minor
"@chakra-ui/c-button": minor
"@chakra-ui/c-motion": minor
"@chakra-ui/vue-accessibilty": minor
"@chakra-ui/c-alert": minor
"@chakra-ui/c-image": minor
"@chakra-ui/c-input": minor
"@chakra-ui/c-modal": minor
"@chakra-ui/c-table": minor
"@chakra-ui/c-code": minor
"@chakra-ui/c-menu": minor
"@chakra-ui/vue-layout": minor
"@chakra-ui/vue-system": minor
"@chakra-ui/c-tag": minor
"@chakra-ui/vue-utils": minor
"@chakra-ui/vue-next": minor
---

Create Live Region, Textarea and useBreakpoint and useBreakpointValue hooks and
components
12 changes: 11 additions & 1 deletion @types/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* This is a generated file. Do not edit it's contents.
*
* This file was generated on 2023-02-26T18:55:26.214Z
* This file was generated on 2023-02-26T20:07:20.175Z
*/

import { ChakraProps, chakra } from "@chakra-ui/vue-system"
Expand Down Expand Up @@ -155,9 +155,19 @@ declare module "@vue/runtime-core" {
CStack: typeof import("@chakra-ui/vue-next")["CStack"]
CStackDivider: typeof import("@chakra-ui/vue-next")["CStackDivider"]
CStackItem: typeof import("@chakra-ui/vue-next")["CStackItem"]
CTable: typeof import("@chakra-ui/vue-next")["CTable"]
CTableCaption: typeof import("@chakra-ui/vue-next")["CTableCaption"]
CTableContainer: typeof import("@chakra-ui/vue-next")["CTableContainer"]
CTbody: typeof import("@chakra-ui/vue-next")["CTbody"]
CTd: typeof import("@chakra-ui/vue-next")["CTd"]
CText: typeof import("@chakra-ui/vue-next")["CText"]
CTextarea: typeof import("@chakra-ui/vue-next")["CTextarea"]
CTfoot: typeof import("@chakra-ui/vue-next")["CTfoot"]
CTh: typeof import("@chakra-ui/vue-next")["CTh"]
CThead: typeof import("@chakra-ui/vue-next")["CThead"]
CThemeProvider: typeof import("@chakra-ui/vue-next")["CThemeProvider"]
CToastContainer: typeof import("@chakra-ui/vue-next")["CToastContainer"]
CTr: typeof import("@chakra-ui/vue-next")["CTr"]
CUnorderedList: typeof import("@chakra-ui/vue-next")["CUnorderedList"]
CVStack: typeof import("@chakra-ui/vue-next")["CVStack"]
CVisuallyHidden: typeof import("@chakra-ui/vue-next")["CVisuallyHidden"]
Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/component/package.json.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
{
"name": "<%= '@chakra-ui/' + h.changeCase.paramCase(name)%>",
"description": "<%= 'Chakra UI Vue | ' + h.changeCase.sentence(description) + ' component'%>",
"version": "0.0.0-next.0",
"version": "0.0.0-beta.0",
"author": "Jonathan Bakebwa <codebender828@gmail.com>",
"homepage": "https://github.com/chakra-ui/chakra-ui-vue-next#readme",
"license": "MIT",
Expand Down
40 changes: 24 additions & 16 deletions _templates/generator/module/package.json.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,37 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json

{
"name": "<%= '@chakra-ui/' + h.changeCase.paramCase(name)%>",
"version": "0.0.0-next.0",
"main": "<%= 'dist/chakra-ui-' + h.changeCase.paramCase(name) + '.cjs.js' %>",
"module": "<%= 'dist/chakra-ui-' + h.changeCase.paramCase(name) + '.esm.js' %>",
"description": "<%= 'Chakra UI Vue | ' + h.changeCase.pascalCase(name) + ' module'%>",
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
"author": "Jonathan Bakebwa [email protected]",
"version": "0.0.0-beta.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
"typings": "dist/index.d.ts",
"files": [
"dist"
],
"exports": {
".": {
"require": "<%= './dist/chakra-ui-' + h.changeCase.paramCase(name) + '.cjs.js' %>",
"default": "<%= './dist/chakra-ui-' + h.changeCase.paramCase(name) + '.esm.js' %>"
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"description": "<%= 'Chakra UI Vue | ' + h.changeCase.pascalCase(name) + ' module'%>",
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
"author": "Jonathan Bakebwa [email protected]",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/chakra-ui/chakra-ui-vue-next.git"
},
"bugs": {
"url": "https://github.com/chakra-ui/chakra-ui-vue-next/issues"
},
"sideEffects": false,
"scripts": {
"build": "rimraf ./dist && concurrently yarn:build:*",
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps",
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps",
"watch": "concurrently yarn:watch:*",
"watch:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps --watch",
"watch:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps --watch",
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch --incremental"
"clean": "rimraf dist .turbo",
"build": "tsup && pnpm build:types",
"build:fast": "tsup",
"build:types": "tsup src --dts-only",
"types:check": "tsc --noEmit",
"dev": "tsup --watch"
}
}
23 changes: 11 additions & 12 deletions _templates/generator/tooling/package.json.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,28 @@ to: tooling/<%=h.changeCase.paramCase(name)%>/package.json
{
"name": "<%= '@chakra-ui/' + h.changeCase.paramCase(name)%>",
"version": "1.0.0",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"main": "dist/index.js",
"module": "dist/index.mjs",
"typings": "dist/index.d.ts",
"files": [
"dist"
],
"exports": {
".": {
"require": "./dist/cjs/index.js",
"default": "./dist/esm/index.js"
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"description": "<%= 'Chakra UI Vue | ' + h.changeCase.pascalCase(name) + ' module'%>",
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next.git",
"author": "Jonathan Bakebwa [email protected]",
"license": "MIT",
"scripts": {
"build": "rimraf ./dist && concurrently yarn:build:*",
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps",
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps",
"build:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
"watch": "concurrently yarn:watch:*",
"watch:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps --watch",
"watch:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps --watch",
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch --incremental"
"clean": "rimraf dist .turbo",
"build": "tsup && pnpm build:types",
"build:fast": "tsup",
"build:types": "tsup src --dts-only",
"types:check": "tsc --noEmit",
"dev": "tsup --watch"
}
}
12 changes: 11 additions & 1 deletion components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* This is a generated file. Do not edit it's contents.
*
* This file was generated on 2023-02-26T18:55:26.214Z
* This file was generated on 2023-02-26T20:07:20.175Z
*/

import { ChakraProps, chakra } from "@chakra-ui/vue-system"
Expand Down Expand Up @@ -155,9 +155,19 @@ declare module "@vue/runtime-core" {
CStack: typeof import("@chakra-ui/vue-next")["CStack"]
CStackDivider: typeof import("@chakra-ui/vue-next")["CStackDivider"]
CStackItem: typeof import("@chakra-ui/vue-next")["CStackItem"]
CTable: typeof import("@chakra-ui/vue-next")["CTable"]
CTableCaption: typeof import("@chakra-ui/vue-next")["CTableCaption"]
CTableContainer: typeof import("@chakra-ui/vue-next")["CTableContainer"]
CTbody: typeof import("@chakra-ui/vue-next")["CTbody"]
CTd: typeof import("@chakra-ui/vue-next")["CTd"]
CText: typeof import("@chakra-ui/vue-next")["CText"]
CTextarea: typeof import("@chakra-ui/vue-next")["CTextarea"]
CTfoot: typeof import("@chakra-ui/vue-next")["CTfoot"]
CTh: typeof import("@chakra-ui/vue-next")["CTh"]
CThead: typeof import("@chakra-ui/vue-next")["CThead"]
CThemeProvider: typeof import("@chakra-ui/vue-next")["CThemeProvider"]
CToastContainer: typeof import("@chakra-ui/vue-next")["CToastContainer"]
CTr: typeof import("@chakra-ui/vue-next")["CTr"]
CUnorderedList: typeof import("@chakra-ui/vue-next")["CUnorderedList"]
CVStack: typeof import("@chakra-ui/vue-next")["CVStack"]
CVisuallyHidden: typeof import("@chakra-ui/vue-next")["CVisuallyHidden"]
Expand Down
14 changes: 14 additions & 0 deletions packages/c-live-region/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# `@chakra-ui/c-live-region`

Creates a hidden live region with dynamic content based on triggered events to be read out by the screen reader on change of the content

## Installation

```sh
# with pnpm
pnpm add @chakra-ui/c-live-region
# or with Yarn
yarn i @chakra-ui/c-live-region
# or with npm
npm i @chakra-ui/c-live-region
```
9 changes: 9 additions & 0 deletions packages/c-live-region/examples/simple-live-region.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<button @click="region.speak('Filtering categories was successful')">
Click Me
</button>
</template>
<script setup lang="ts">
import { useLiveRegion } from "../src/use-live-region"
const region = useLiveRegion()
</script>
1 change: 1 addition & 0 deletions packages/c-live-region/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./src"
48 changes: 48 additions & 0 deletions packages/c-live-region/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "@chakra-ui/c-live-region",
"description": "Chakra UI Vue | Creates a hidden live region with dynamic content based on triggered events to be read out by the screen reader on change of the content component",
"version": "2.0.0-beta.0",
"author": "Jonathan Bakebwa <[email protected]>",
"homepage": "https://github.com/chakra-ui/chakra-ui-vue-next#readme",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
"typings": "dist/index.d.ts",
"files": [
"dist"
],
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/chakra-ui/chakra-ui-vue-next.git"
},
"bugs": {
"url": "https://github.com/chakra-ui/chakra-ui-vue-next/issues"
},
"sideEffects": false,
"scripts": {
"clean": "rimraf dist .turbo",
"build": "tsup && pnpm build:types",
"build:fast": "tsup",
"build:types": "tsup src --dts-only",
"types:check": "tsc --noEmit",
"dev": "tsup --watch"
},
"dependencies": {
"@chakra-ui/vue-system": "workspace:*"
},
"devDependencies": {
"vue": "^3.2.37"
},
"peerDependencies": {
"vue": "^3.1.4"
},
"publishConfig": {
"access": "public"
}
}
3 changes: 3 additions & 0 deletions packages/c-live-region/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { LiveRegion } from "./live-region"

export type { LiveRegionOptions } from "./live-region"
Loading

0 comments on commit 4564d8d

Please sign in to comment.