Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: component type docs (a-c) #3505

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/blue-garlics-love.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@twilio-paste/codemods': patch
---

Updated exports for tsdoc additions
6 changes: 6 additions & 0 deletions .changeset/nasty-turtles-refuse.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/code-block': patch
'@twilio-paste/core': patch
Comment on lines +2 to +3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can merge a lot of these changesets into a single one, with the same message:

ie:

---
'@twilio-paste/code-block': patch
'@twilio-paste/chat-log': patch
'@twilio-paste/core': patch
---

Improved TsDoc type annotations

The benefit is, I suspect, it wont bump core 10+ times

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll only bump it once, it rolls core up into a single minor or patch. The advantage here is that you get a package level dedicated changelog entry. So you're not sharing a single changelog entry for multiple packages, making the package changelog much more isolated and specific to that package only.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know

---

[Combobox] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/strange-nails-push.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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",
nkrantz marked this conversation as resolved.
Show resolved Hide resolved
"/components/data-grid/",
"/components/detail-text",
"/components/description-list/",
Expand Down
6 changes: 0 additions & 6 deletions packages/paste-codemods/tools/.cache/mappings.json
Original file line number Diff line number Diff line change
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",
TheSisb marked this conversation as resolved.
Show resolved Hide resolved
"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
Original file line number Diff line number Diff line change
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"
}
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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";
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
export { useMenuState as useAccountSwitcherState } from "@twilio-paste/menu";

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