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

Commit 529b8ad

Browse files
feat(CSelect): build component (#305)
Co-authored-by: codebender828 <[email protected]>
1 parent be427bc commit 529b8ad

31 files changed

+1309
-25
lines changed

.changeset/hungry-cooks-cross.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
"@chakra-ui/c-visually-hidden": minor
3+
"@chakra-ui/c-theme-provider": minor
4+
"@chakra-ui/vue-composables": minor
5+
"@chakra-ui/c-close-button": minor
6+
"@chakra-ui/c-form-control": minor
7+
"@chakra-ui/c-live-region": minor
8+
"@chakra-ui/c-media-query": minor
9+
"@chakra-ui/c-scroll-lock": minor
10+
"@chakra-ui/c-breadcrumb": minor
11+
"@chakra-ui/c-color-mode": minor
12+
"@chakra-ui/c-focus-lock": minor
13+
"@chakra-ui/c-accordion": minor
14+
"@chakra-ui/c-pin-input": minor
15+
"@chakra-ui/c-checkbox": minor
16+
"@chakra-ui/c-skip-nav": minor
17+
"@chakra-ui/c-textarea": minor
18+
"@chakra-ui/vue-test-utils": minor
19+
"@chakra-ui/vue-auto-import": minor
20+
"@chakra-ui/c-popover": minor
21+
"@chakra-ui/c-spinner": minor
22+
"@chakra-ui/c-tooltip": minor
23+
"@chakra-ui/c-avatar": minor
24+
"@chakra-ui/c-button": minor
25+
"@chakra-ui/c-motion": minor
26+
"@chakra-ui/c-popper": minor
27+
"@chakra-ui/c-portal": minor
28+
"@chakra-ui/c-select": minor
29+
"@chakra-ui/vue-accessibilty": minor
30+
"@chakra-ui/c-alert": minor
31+
"@chakra-ui/c-image": minor
32+
"@chakra-ui/c-input": minor
33+
"@chakra-ui/c-modal": minor
34+
"@chakra-ui/c-reset": minor
35+
"@chakra-ui/c-table": minor
36+
"@chakra-ui/c-toast": minor
37+
"@chakra-ui/c-code": minor
38+
"@chakra-ui/c-icon": minor
39+
"@chakra-ui/c-menu": minor
40+
"@chakra-ui/c-tabs": minor
41+
"@chakra-ui/vue-layout": minor
42+
"@chakra-ui/vue-styled": minor
43+
"@chakra-ui/vue-system": minor
44+
"@chakra-ui/c-tag": minor
45+
"@chakra-ui/vue-utils": minor
46+
"@chakra-ui/vue-next": minor
47+
---
48+
49+
Add `CSelect` component

.github/workflows/quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: Run Component Tests
3030
run:
31-
pnpm test:ci && pnpm cy:run --component --record --key
31+
pnpm test:ci && pnpm cy:run --component --key
3232
$CYPRESS_COMPONENT_TESTING_KEY
3333
env:
3434
CYPRESS_COMPONENT_TESTING_KEY:

@types/components.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* This is a generated file. Do not edit it's contents.
88
*
9-
* This file was generated on 2023-04-22T14:04:49.473Z
9+
* This file was generated on 2023-04-23T09:31:15.297Z
1010
*/
1111

1212
import { ChakraProps, chakra } from "@chakra-ui/vue-system"
@@ -103,6 +103,7 @@ declare module "@vue/runtime-core" {
103103
CDrawerOverlay: typeof import("@chakra-ui/vue-next")["CDrawerOverlay"]
104104
CFlex: typeof import("@chakra-ui/vue-next")["CFlex"]
105105
CFocusLock: typeof import("@chakra-ui/vue-next")["CFocusLock"]
106+
CFormControl: typeof import("@chakra-ui/vue-next")["CFormControl"]
106107
CFormErrorIcon: typeof import("@chakra-ui/vue-next")["CFormErrorIcon"]
107108
CFormErrorMessage: typeof import("@chakra-ui/vue-next")["CFormErrorMessage"]
108109
CFormHelperText: typeof import("@chakra-ui/vue-next")["CFormHelperText"]

components.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* This is a generated file. Do not edit it's contents.
88
*
9-
* This file was generated on 2023-04-22T14:04:49.473Z
9+
* This file was generated on 2023-04-23T09:31:15.297Z
1010
*/
1111

1212
import { ChakraProps, chakra } from "@chakra-ui/vue-system"
@@ -103,6 +103,7 @@ declare module "@vue/runtime-core" {
103103
CDrawerOverlay: typeof import("@chakra-ui/vue-next")["CDrawerOverlay"]
104104
CFlex: typeof import("@chakra-ui/vue-next")["CFlex"]
105105
CFocusLock: typeof import("@chakra-ui/vue-next")["CFocusLock"]
106+
CFormControl: typeof import("@chakra-ui/vue-next")["CFormControl"]
106107
CFormErrorIcon: typeof import("@chakra-ui/vue-next")["CFormErrorIcon"]
107108
CFormErrorMessage: typeof import("@chakra-ui/vue-next")["CFormErrorMessage"]
108109
CFormHelperText: typeof import("@chakra-ui/vue-next")["CFormHelperText"]

cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "cypress"
22

33
export default defineConfig({
4-
projectId: 'rb8e7m',
4+
projectId: "rb8e7m",
55
video: false,
66
fixturesFolder: false,
77
reporter: "spec",

packages/c-breadcrumb/src/c-breadcrumb.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ import {
2626
ChakraProps,
2727
ComponentWithProps,
2828
} from "@chakra-ui/vue-system"
29-
import { SystemProps, ThemingProps, SystemStyleObject } from "@chakra-ui/styled-system"
29+
import {
30+
SystemProps,
31+
ThemingProps,
32+
SystemStyleObject,
33+
} from "@chakra-ui/styled-system"
3034
import { filterUndefined } from "@chakra-ui/utils"
3135
import {
3236
getValidChildren,
@@ -56,8 +60,8 @@ export interface BreadcrumbOptions {
5660

5761
export interface BreadcrumbProps
5862
extends ChakraProps,
59-
BreadcrumbOptions,
60-
ThemingProps<"Breadcrumb"> { }
63+
BreadcrumbOptions,
64+
ThemingProps<"Breadcrumb"> {}
6165

6266
/**
6367
* CBreadcrumb is used to render a breadcrumb navigation landmark.
@@ -86,14 +90,14 @@ export const CBreadcrumb = defineComponent(
8690
return typeof props.separator === "string"
8791
? props.separator
8892
: isObjectComponent(props.separator!)
89-
? // TODO:
93+
? // TODO:
9094
// Add support for
9195
// object components. ATM,
9296
// This computed property will only
9397
// work for functional components provided as
9498
// separators
9599
h(() => props.separator!)
96-
: h(props.separator!)
100+
: h(props.separator!)
97101
}
98102
})
99103

@@ -197,7 +201,7 @@ interface BreadcrumbItemOptions extends BreadcrumbOptions {
197201

198202
export interface BreadcrumbItemProps
199203
extends BreadcrumbItemOptions,
200-
ChakraProps { }
204+
ChakraProps {}
201205

202206
export const CBreadcrumbItem = defineComponent(
203207
(props: BreadcrumbItemOptions, { attrs, slots }) => {

packages/c-checkbox/examples/disabled-checkbox.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
22
<c-checkbox is-disabled> Disabled checkbox </c-checkbox>
3-
<c-checkbox is-disabled default-checked> Disabled checked checkbox </c-checkbox>
3+
<c-checkbox is-disabled default-checked>
4+
Disabled checked checkbox
5+
</c-checkbox>
46
</template>
57

68
<script lang="ts" setup>

packages/c-form-control/examples/input-example.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<c-form-control id="name" is-required w="400px">
33
<c-form-label> First name </c-form-label>
4-
<c-input :p="-2" id="name" placeholder="First Name" />
4+
<c-input id="name" placeholder="First Name" />
55
<c-form-helper-text> Keep it very short and sweet! </c-form-helper-text>
66
<c-form-error-message bg="unset">
77
<c-form-error-icon />

packages/c-form-control/src/c-form-control.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const formControlProps = {
4343
}
4444

4545
export const CFormControl = defineComponent({
46+
name: "CFormControl",
4647
props: {
4748
as: {
4849
type: [Object, String] as PropType<DOMElements>,
@@ -75,7 +76,7 @@ export const CFormControl = defineComponent({
7576
},
7677
})
7778

78-
export interface CHelpTextProps extends HTMLChakraProps<"div"> {}
79+
export interface CHelpTextProps extends HTMLChakraProps<"div"> { }
7980
/**
8081
* CFormHelperText
8182
*

packages/c-form-control/src/use-form-control.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ export { FormControlProvider, useFormControlContext }
160160

161161
export interface CFormControlProps
162162
extends HTMLChakraProps<"div">,
163-
ThemingProps<"FormControl">,
164-
FormControlContext {}
163+
ThemingProps<"FormControl">,
164+
FormControlContext { }
165165

166166
export interface UseFormControlProps<T extends VNodeProps>
167167
extends FormControlOptions {
@@ -251,10 +251,10 @@ export function useFormControlProps<T extends VNodeProps>(
251251
...rest,
252252
"aria-describedby": computed(() => labelIds.value.join(" ") || undefined),
253253
id: id ?? field?.value.id,
254-
isDisabled: disabled ?? isDisabled ?? field?.value?.isDisabled,
255-
isReadOnly: readOnly ?? isReadOnly ?? field?.value?.isReadOnly,
256-
isRequired: required ?? isRequired ?? field?.value?.isRequired,
257-
isInvalid: isInvalid ?? field?.value?.isInvalid,
254+
isDisabled: disabled ?? isDisabled?.value ? isDisabled : field?.value?.isDisabled ?? field?.value?.isDisabled,
255+
isReadOnly: readOnly ?? isReadOnly?.value ? isReadOnly : field?.value?.isReadOnly ?? field?.value?.isReadOnly,
256+
isRequired: required ?? isRequired?.value ? isRequired : field?.value?.isRequired ?? field?.value?.isRequired,
257+
isInvalid: isInvalid?.value ? isInvalid : field?.value?.isInvalid ?? field?.value?.isInvalid,
258258
onFocus: callAllHandlers(field?.value?.onFocus, onFocus?.value),
259259
onBlur: callAllHandlers(field?.value?.onBlur, onBlur?.value),
260260
}

0 commit comments

Comments
 (0)