Skip to content

Commit

Permalink
chore: component types a-c (#3505)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrantz committed Oct 3, 2023
1 parent 2a6b26a commit dc8deca
Show file tree
Hide file tree
Showing 163 changed files with 67,730 additions and 1,946 deletions.
6 changes: 6 additions & 0 deletions .changeset/blue-garlics-love.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/alert-dialog': patch
'@twilio-paste/core': patch
---

[Alert Dialog] Improved TsDoc annotations
6 changes: 6 additions & 0 deletions .changeset/cyan-onions-kneel.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/breadcrumb': patch
'@twilio-paste/core': patch
---

[Breadcrumb] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/great-bottles-hear.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/card': patch
'@twilio-paste/core': patch
---

[Card] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/great-turtles-tan.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/chat-composer': patch
'@twilio-paste/core': patch
---

[Chat Composer] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/hip-jokes-trade.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/combobox': patch
'@twilio-paste/core': patch
---

[Combobox] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/honest-bulldogs-cheat.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/base-radio-checkbox': patch
'@twilio-paste/core': patch
---

[Base-radio-checkbox] Specify exports for clarity in index.js file
6 changes: 6 additions & 0 deletions .changeset/kind-parents-pretend.md
@@ -0,0 +1,6 @@
---
"@twilio-paste/core": minor
"@twilio-paste/reakit-library": minor
---

[Reakit library] export menu state return and menu initial state
6 changes: 6 additions & 0 deletions .changeset/metal-buckets-hammer.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/alert': patch
'@twilio-paste/core': patch
---

[Alert] Improved TsDoc annotations
5 changes: 5 additions & 0 deletions .changeset/moody-snails-listen.md
@@ -0,0 +1,5 @@
---
'@twilio-paste/codemods': patch
---

Updated exports for tsdoc additions
6 changes: 6 additions & 0 deletions .changeset/nasty-turtles-refuse.md
@@ -0,0 +1,6 @@
---
"@twilio-paste/core": minor
"@twilio-paste/menu-primitive": minor
---

[Menu Primitive] new exports for use in the Account Switcher package: MenuPrimitiveInitialState and MenuPrimitiveStateReturn
6 changes: 6 additions & 0 deletions .changeset/rotten-snakes-lick.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/checkbox': patch
'@twilio-paste/core': patch
---

[Checkbox] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/stale-mangos-buy.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/code-block': patch
'@twilio-paste/core': patch
---

[Combobox] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/strange-nails-push.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/chat-log': patch
'@twilio-paste/core': patch
---

[Chat Log] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/strong-tools-reply.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/callout': patch
'@twilio-paste/core': patch
---

[Callout] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/tame-mice-care.md
@@ -0,0 +1,6 @@
---
"@twilio-paste/menu": minor
"@twilio-paste/core": minor
---

[Menu] Add all inherited props from "div" element to MenuGroupProps, add new exports: MenuInitialState and MenuStateReturn
6 changes: 6 additions & 0 deletions .changeset/three-avocados-repair.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/avatar': patch
'@twilio-paste/core': patch
---

[Avatar] Improved TsDoc annotations
6 changes: 6 additions & 0 deletions .changeset/tough-jokes-invent.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/button-group': patch
'@twilio-paste/core': patch
---

[Button Group] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/twenty-drinks-smile.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/account-switcher': patch
'@twilio-paste/core': patch
---

[Account Switcher] Improved TsDoc annotations
6 changes: 6 additions & 0 deletions .changeset/twenty-grapes-report.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/badge': patch
'@twilio-paste/core': patch
---

[Badge] Improved TsDoc type annotations
3 changes: 3 additions & 0 deletions .vscode/settings.json
Expand Up @@ -22,6 +22,9 @@
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"search.exclude": {
"**/dist": true,
"**/docs": true
Expand Down
1 change: 0 additions & 1 deletion cypress/integration/e2e/components/alert-dialog.spec.ts
Expand Up @@ -14,6 +14,5 @@ describe("Alert-dialog component documentation page", function () {
cy.checkInPageNavigationLinks();
cy.checkPageAside();
cy.checkLivePreviews();
cy.checkChangelogRevealer();
});
});
22 changes: 22 additions & 0 deletions cypress/integration/sitemap-vrt/constants.ts
Expand Up @@ -19,22 +19,44 @@ export const SITEMAP = [
"/blog/2023-08-01-bringing-cohesion-to-the-twilio-product-suite-part-ii/",
"/blog/2023-08-02-paste-newsletter/",
"/components/account-switcher/",
"/components/account-switcher/api",
"/components/account-switcher/changelog",
"/components/aspect-ratio/",
"/components/aspect-ratio/api",
"/components/aspect-ratio/changelog",
"/components/anchor/",
"/components/anchor/api",
"/components/anchor/changelog",
"/components/alert-dialog/",
"/components/alert-dialog/api",
"/components/alert-dialog/changelog",
"/components/avatar/",
"/components/avatar/api",
"/components/avatar/changelog",
"/components/breadcrumb/",
"/components/breadcrumb/api",
"/components/breadcrumb/changelog",
"/components/badge/",
"/components/badge/api",
"/components/badge/changelog",
"/components/callout/",
"/components/callout/api",
"/components/callout/changelog",
"/components/code-block/",
"/components/code-block/api",
"/components/code-block/changelog",
"/components/card/",
"/components/card/api",
"/components/card/changelog",
"/components/chat-composer/",
"/components/chat-composer/api",
"/components/chat-composer/changelog",
"/components/chat-log/",
"/components/chat-log/api",
"/components/chat-log/changelog",
"/components/checkbox/",
"/components/checkbox/api",
"/components/checkbox/changelog",
"/components/data-grid/",
"/components/detail-text",
"/components/description-list/",
Expand Down
6 changes: 0 additions & 6 deletions packages/paste-codemods/tools/.cache/mappings.json
Expand Up @@ -7,10 +7,6 @@
"AccountSwitcherSeparator": "@twilio-paste/core/account-switcher",
"useAccountSwitcherState": "@twilio-paste/core/account-switcher",
"Alert": "@twilio-paste/core/alert",
"AlertBackgroundColors": "@twilio-paste/core/alert",
"AlertRoles": "@twilio-paste/core/alert",
"AlertTextColors": "@twilio-paste/core/alert",
"AlertVariants": "@twilio-paste/core/alert",
"AlertDialog": "@twilio-paste/core/alert-dialog",
"Anchor": "@twilio-paste/core/anchor",
"isExternalUrl": "@twilio-paste/core/anchor",
Expand All @@ -19,7 +15,6 @@
"AvatarGroup": "@twilio-paste/core/avatar",
"Badge": "@twilio-paste/core/badge",
"BadgeVariants": "@twilio-paste/core/badge",
"badgeAnchorStyles": "@twilio-paste/core/badge",
"badgeBaseStyles": "@twilio-paste/core/badge",
"badgeButtonStyles": "@twilio-paste/core/badge",
"badgeVariantStyles": "@twilio-paste/core/badge",
Expand Down Expand Up @@ -68,7 +63,6 @@
"CodeBlockTabPanel": "@twilio-paste/core/code-block",
"CodeBlockWrapper": "@twilio-paste/core/code-block",
"Combobox": "@twilio-paste/core/combobox",
"ComboboxInputWrapper": "@twilio-paste/core/combobox",
"ComboboxListbox": "@twilio-paste/core/combobox",
"ComboboxListboxGroup": "@twilio-paste/core/combobox",
"ComboboxListboxOption": "@twilio-paste/core/combobox",
Expand Down
6 changes: 3 additions & 3 deletions packages/paste-core/components/account-switcher/package.json
Expand Up @@ -14,12 +14,11 @@
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "yarn clean && NODE_ENV=production node build.js && tsc",
"build:js": "NODE_ENV=development node build.js",
"build:typedocs": "tsx ../../../../tools/build/generate-type-docs",
"clean": "rm -rf ./dist",
"tsc": "tsc"
},
Expand Down Expand Up @@ -80,6 +79,7 @@
"@types/react-dom": "^18.0.10",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"tsx": "^3.12.10",
"typescript": "^4.9.4"
}
}
@@ -1,9 +1,18 @@
import type { BoxProps } from "@twilio-paste/box";
import { Menu } from "@twilio-paste/menu";
import type { MenuProps } from "@twilio-paste/menu";
import * as React from "react";

export interface AccountSwitcherProps extends MenuProps {
children: NonNullable<React.ReactNode>;
/**
* Overrides the default element name to apply unique styles with the Customization Provider
*
* @default 'ACCOUNT_SWITCHER'
* @type {BoxProps['element']}
* @memberof AccountSwitcherProps
*/
element?: BoxProps["element"];
}

const AccountSwitcher = React.forwardRef<HTMLDivElement, AccountSwitcherProps>(
Expand Down
@@ -1,9 +1,18 @@
import type { BoxProps } from "@twilio-paste/box";
import { MenuBadge } from "@twilio-paste/menu";
import type { MenuBadgeProps } from "@twilio-paste/menu";
import * as React from "react";

export interface AccountSwitcherBadgeProps extends Omit<MenuBadgeProps, "variant"> {
children: NonNullable<React.ReactNode>;
/**
* Overrides the default element name to apply unique styles with the Customization Provider
*
* @default 'ACCOUNT_SWITCHER_BADGE'
* @type {BoxProps['element']}
* @memberof AccountSwitcherBadgeProps
*/
element?: BoxProps["element"];
}

const AccountSwitcherBadge = React.forwardRef<HTMLButtonElement, AccountSwitcherBadgeProps>(
Expand Down
@@ -1,8 +1,18 @@
import type { BoxProps } from "@twilio-paste/box";
import { MenuGroup } from "@twilio-paste/menu";
import type { MenuGroupProps } from "@twilio-paste/menu";
import * as React from "react";

export type AccountSwitcherGroupProps = MenuGroupProps;
export interface AccountSwitcherGroupProps extends MenuGroupProps {
/**
* Overrides the default element name to apply unique styles with the Customization Provider
*
* @default 'ACCOUNT_SWITCHER_GROUP'
* @type {BoxProps['element']}
* @memberof AccountSwitcherGroupProps
*/
element?: BoxProps["element"];
}

const AccountSwitcherGroup = React.forwardRef<HTMLDivElement, AccountSwitcherGroupProps>(
({ children, element = "ACCOUNT_SWITCHER_GROUP", label, ...props }, ref) => {
Expand Down
@@ -1,9 +1,18 @@
import type { BoxProps } from "@twilio-paste/box";
import { MenuItem } from "@twilio-paste/menu";
import type { MenuItemProps } from "@twilio-paste/menu";
import * as React from "react";

export interface AccountSwitcherItemProps extends MenuItemProps {
children: NonNullable<React.ReactNode>;
/**
* Overrides the default element name to apply unique styles with the Customization Provider
*
* @default 'ACCOUNT_SWITCHER_ITEM'
* @type {BoxProps['element']}
* @memberof AccountSwitcherItemProps
*/
element?: BoxProps["element"];
}

const AccountSwitcherItem = React.forwardRef<HTMLDivElement, AccountSwitcherItemProps>(
Expand Down
@@ -1,9 +1,18 @@
import type { BoxProps } from "@twilio-paste/box";
import { MenuItemRadio } from "@twilio-paste/menu";
import type { MenuItemRadioProps } from "@twilio-paste/menu";
import * as React from "react";

export interface AccountSwitcherItemRadioProps extends MenuItemRadioProps {
children: NonNullable<React.ReactNode>;
/**
* Overrides the default element name to apply unique styles with the Customization Provider
*
* @default 'ACCOUNT_SWITCHER_ITEM_RADIO'
* @type {BoxProps['element']}
* @memberof AccountSwitcherItemRadioProps
*/
element?: BoxProps["element"];
}

const AccountSwitcherItemRadio = React.forwardRef<HTMLDivElement, AccountSwitcherItemRadioProps>(
Expand Down
@@ -1,8 +1,18 @@
import type { BoxProps } from "@twilio-paste/box";
import { MenuSeparator } from "@twilio-paste/menu";
import type { MenuSeparatorProps } from "@twilio-paste/menu";
import * as React from "react";

export type AccountSwitcherSeparatorProps = MenuSeparatorProps;
export interface AccountSwitcherSeparatorProps extends MenuSeparatorProps {
/**
* Overrides the default element name to apply unique styles with the Customization Provider
*
* @default 'ACCOUNT_SWITCHER_SEPARATOR'
* @type {BoxProps['element']}
* @memberof AccountSwitcherSeparatorProps
*/
element?: BoxProps["element"];
}

const AccountSwitcherSeparator = React.forwardRef<HTMLHRElement, AccountSwitcherSeparatorProps>(
({ children, element = "ACCOUNT_SWITCHER_SEPARATOR", ...props }, ref) => {
Expand Down
27 changes: 20 additions & 7 deletions packages/paste-core/components/account-switcher/src/index.tsx
@@ -1,7 +1,20 @@
export * from "./AccountSwitcher";
export * from "./AccountSwitcherGroup";
export * from "./AccountSwitcherSeparator";
export * from "./AccountSwitcherItem";
export * from "./AccountSwitcherItemRadio";
export * from "./AccountSwitcherBadge";
export * from "./useAccountSwitcher";
import type { AccountSwitcherInitialState, AccountSwitcherStateReturn } from "./useAccountSwitcher";

// for the sake of documenting the types we rename the state hook types to append Props to the name, so we can docuemnt them and not cause a breaking change.
type AccountSwitcherStateReturnProps = AccountSwitcherStateReturn;
type AccountSwitcherInitialStateProps = AccountSwitcherInitialState;

export type { AccountSwitcherStateReturnProps, AccountSwitcherInitialStateProps };
export { AccountSwitcherBadge } from "./AccountSwitcherBadge";
export type { AccountSwitcherBadgeProps } from "./AccountSwitcherBadge";
export { AccountSwitcher } from "./AccountSwitcher";
export type { AccountSwitcherProps } from "./AccountSwitcher";
export { AccountSwitcherItem } from "./AccountSwitcherItem";
export type { AccountSwitcherItemProps } from "./AccountSwitcherItem";
export { AccountSwitcherItemRadio } from "./AccountSwitcherItemRadio";
export type { AccountSwitcherItemRadioProps } from "./AccountSwitcherItemRadio";
export { AccountSwitcherGroup } from "./AccountSwitcherGroup";
export type { AccountSwitcherGroupProps } from "./AccountSwitcherGroup";
export { AccountSwitcherSeparator } from "./AccountSwitcherSeparator";
export type { AccountSwitcherSeparatorProps } from "./AccountSwitcherSeparator";
export { useAccountSwitcherState } from "./useAccountSwitcher";
@@ -1 +1,6 @@
export { useMenuState as useAccountSwitcherState } from "@twilio-paste/menu";

export type {
MenuInitialState as AccountSwitcherInitialState,
MenuStateReturn as AccountSwitcherStateReturn,
} from "@twilio-paste/menu";

0 comments on commit dc8deca

Please sign in to comment.