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

chore: components d to h type docs #3502

Merged
merged 11 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 10 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/flat-worms-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/heading': patch
'@twilio-paste/core': patch
---

[Heading]: Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/giant-gorillas-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/data-grid': patch
'@twilio-paste/core': patch
---

[Data Grid]: Improved TsDoc type annotation
6 changes: 6 additions & 0 deletions .changeset/green-deers-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/editable-code-block': patch
'@twilio-paste/core': patch
---

[Editable Code Block]: Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/healthy-laws-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/form': patch
'@twilio-paste/core': patch
---

[Form]: Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/lazy-hats-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/display-heading': patch
'@twilio-paste/core': patch
---

[Display Heading]: Improved TsDoc type annotations
1 change: 1 addition & 0 deletions .changeset/light-buttons-type.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
'@twilio-paste/codemods': minor
'@twilio-paste/core': minor
---

[Codemods] New exports from icons package
6 changes: 6 additions & 0 deletions .changeset/mean-pugs-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/display-pill-group': patch
'@twilio-paste/core': patch
---

[Display Pill Group]: Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/perfect-shoes-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/description-list': patch
'@twilio-paste/core': patch
---

[Description List] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/purple-oranges-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/date-picker': patch
'@twilio-paste/core': patch
---

[Date Picker]: Improved TsDoc type annotation
6 changes: 6 additions & 0 deletions .changeset/purple-stingrays-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/codemods': patch
'@twilio-paste/core': patch
---

[Codemods] updated pacakge exports
6 changes: 6 additions & 0 deletions .changeset/rare-pillows-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/help-text': patch
'@twilio-paste/core': patch
---

[Healp Text]: Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/shaggy-flies-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/file-picker': patch
'@twilio-paste/core': patch
---

[File Picker]: Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/short-mirrors-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/form-pill-group': patch
'@twilio-paste/core': patch
---

[Form Pill Group]: Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/six-pots-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/disclosure': patch
'@twilio-paste/core': patch
---

[Disclosure]: Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/tender-parrots-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@twilio-paste/table": patch
"@twilio-paste/core": patch
---

[Table] Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/warm-bears-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/file-uploader': patch
'@twilio-paste/core': patch
---

[File Uploader]: Improved TsDoc type annotations
6 changes: 6 additions & 0 deletions .changeset/wicked-mice-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/detail-text': patch
'@twilio-paste/core': patch
---

[Detail Text]: Improved TsDoc type annotations
17 changes: 9 additions & 8 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,15 @@ jobs:
- name: Build packages
run: yarn build

- name: Run type checker
run: yarn type-check
- run: yarn build:typedocs
- name: Verify generated types are checked in for website
run: yarn check:type-docs

eslint:
name: Lint repository
runs-on: ubuntu-latest
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand Down Expand Up @@ -100,8 +103,6 @@ jobs:

- name: Build packages
run: yarn build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

- name: Run eslint
run: yarn lint
Expand Down Expand Up @@ -159,6 +160,8 @@ jobs:
react17_tests:
name: Test repository using React 17
runs-on: ubuntu-latest
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand Down Expand Up @@ -193,8 +196,6 @@ jobs:
# Note: Build first before we change the react version installed.
- name: Build packages
run: yarn build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

- name: Install React 17
run: |
Expand All @@ -210,6 +211,8 @@ jobs:
react16_tests:
name: Test repository using React 16
runs-on: ubuntu-latest
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand Down Expand Up @@ -244,8 +247,6 @@ jobs:
# Note: Build first before we change the react version installed.
- name: Build packages
run: yarn build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

- name: Install React 16
run: |
Expand Down
28 changes: 27 additions & 1 deletion cypress/integration/sitemap-vrt/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,23 @@ export const SITEMAP = [
"/components/checkbox/api",
"/components/checkbox/changelog",
"/components/data-grid/",
"/components/data-grid/api",
"/components/data-grid/changelog",
"/components/detail-text",
"/components/detail-text/api",
"/components/detail-text/changelog",
"/components/description-list/",
"/components/description-list/api",
"/components/description-list/changelog",
"/components/display-heading/",
"/components/display-heading/api",
"/components/display-heading/changelog",
"/components/display-pill-group/",
"/components/display-pill-group/api",
"/components/display-pill-group/changelog",
"/components/disclosure/",
"/components/disclosure/api",
"/components/disclosure/changelog",
"/components/button/",
"/components/button/api",
"/components/button/changelog",
Expand All @@ -71,17 +83,31 @@ export const SITEMAP = [
"/components/flex/api",
"/components/flex/changelog",
"/components/file-picker/",
"/components/file-picker/api",
"/components/file-picker/changelog",
"/components/file-uploader/",
"/components/file-uploader/api",
"/components/file-uploader/changelog",
"/components/form/",
"/components/form/api",
"/components/form/changelog",
"/components/combobox/",
"/components/date-picker/",
"/components/date-picker/api",
"/components/date-picker/changelog",
"/components/grid/",
"/components/grid/api",
"/components/grid/changelog",
"/components/heading/",
"/components/heading/api",
"/components/heading/changelog",
"/components/form-pill-group/",
"/components/form-pill-group/api",
"/components/form-pill-group/changelog",
"/components/alert/",
"/components/help-text/",
"/components/help-text/api",
"/components/help-text/changelog",
"/components/icon/",
"/components/icon/usage-guidelines/",
"/components/",
Expand Down Expand Up @@ -201,7 +227,7 @@ export const SITEMAP = [
const SITEMAP_CHUNKS: string[][] = [];
const CHUNK_SIZE = 25;

for (var i = 0, len = SITEMAP.length; i < len; i += CHUNK_SIZE) {
for (let i = 0, len = SITEMAP.length; i < len; i += CHUNK_SIZE) {
SITEMAP_CHUNKS.push(SITEMAP.slice(i, i + CHUNK_SIZE));
}

Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"author": "Twilio Inc.",
"license": "MIT",
"workspaces": {
"packages": ["apps/**/*", "packages/**/*", "templates/**/*", "!packages/paste-core/core-bundle/**/*"]
"packages": [
"apps/**/*",
"packages/**/*",
"templates/**/*",
"!packages/paste-core/core-bundle/**/*"
]
},
"types": "./types/index.d.ts",
"engines": {
Expand Down Expand Up @@ -38,6 +43,7 @@
"build:theme-designer": "yarn nx run @twilio-paste/theme-designer:build",
"build:nextjs-template": "yarn nx run @twilio-paste/nextjs-template:build",
"build:contrast-checking": "yarn nx run @twilio-paste/token-contrast-checker:build",
"check:type-docs": "bash ./tools/build/generate-type-docs/check-uncommited-type.sh",
"pre-push": "concurrently \"yarn:lint\" \"yarn:test\" \"yarn:format\" \"yarn:type-check\"",
"prerelease": "yarn build && yarn lint && yarn test",
"release": "yarn changeset publish",
Expand Down Expand Up @@ -221,5 +227,9 @@
}
},
"packageManager": "yarn@3.6.3",
"browserslist": ["last 2 versions", "not dead", "not IE 11"]
"browserslist": [
"last 2 versions",
"not dead",
"not IE 11"
]
}
3 changes: 0 additions & 3 deletions packages/paste-codemods/tools/.cache/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@
"DescriptionListDetails": "@twilio-paste/core/description-list",
"DescriptionListSet": "@twilio-paste/core/description-list",
"DescriptionListTerm": "@twilio-paste/core/description-list",
"StyledDescriptionListSet": "@twilio-paste/core/description-list",
"DetailText": "@twilio-paste/core/detail-text",
"AnimatedDisclosureContent": "@twilio-paste/core/disclosure",
"Disclosure": "@twilio-paste/core/disclosure",
"DisclosureContent": "@twilio-paste/core/disclosure",
"DisclosureHeading": "@twilio-paste/core/disclosure",
Expand Down Expand Up @@ -120,7 +118,6 @@
"useFormPillState": "@twilio-paste/core/form-pill-group",
"Heading": "@twilio-paste/core/heading",
"HelpText": "@twilio-paste/core/help-text",
"HelpTextVariants": "@twilio-paste/core/help-text",
"InPageNavigation": "@twilio-paste/core/in-page-navigation",
"InPageNavigationItem": "@twilio-paste/core/in-page-navigation",
"InlineCode": "@twilio-paste/core/inline-code",
Expand Down
2 changes: 2 additions & 0 deletions packages/paste-core/components/data-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"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 @@ -75,6 +76,7 @@
"@types/react-dom": "^18.0.10",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"tsx": "^3.12.10",
"typescript": "^4.9.4"
}
}
8 changes: 8 additions & 0 deletions packages/paste-core/components/data-grid/src/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ import {
} from "./utils";

export interface DataGridProps extends TableProps {
/**
* Overrides the default element name to apply unique styles with the Customization Provider
*
* @default 'DATA_GRID'
* @type {TableProps['element']}
* @memberof DataGridProps
*/
element?: TableProps["element"];
"aria-label": string;
}

Expand Down
12 changes: 11 additions & 1 deletion packages/paste-core/components/data-grid/src/DataGridBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@ import { TBody } from "@twilio-paste/table";
import type { TBodyProps } from "@twilio-paste/table";
import * as React from "react";

export type DataGridBodyProps = TBodyProps & {
/**
* Overrides the default element name to apply unique styles with the Customization Provider
*
* @default 'DATA_GRID_BODY'
* @type {TBodyProps['element']}
*/
element?: TBodyProps["element"];
};

/**
* DataGrid body wrapper component.
*
* @param {string} element - customization element
*/
export const DataGridBody = React.forwardRef<HTMLTableSectionElement, TBodyProps>(
export const DataGridBody = React.forwardRef<HTMLTableSectionElement, DataGridBodyProps>(
({ element = "DATA_GRID_BODY", ...props }, ref) => {
return <TBody {...props} element={element} ref={ref} />;
},
Expand Down
30 changes: 26 additions & 4 deletions packages/paste-core/components/data-grid/src/DataGridCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,38 @@ import { DataGridContext } from "./DataGridContext";
import { Td } from "./table/Td";
import type { TdProps } from "./table/Td";
import { Th } from "./table/Th";
import type { ThProps } from "./table/Th";
import { ensureFocus, isCell, updateTabIndexForActionable } from "./utils";

// This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export

type CellType = "th" | "td";
export interface DataGridCellProps extends Pick<TdProps, "textAlign"> {
as?: CellType;
export type DataGridCellBasePropsProps = {
/**
* Overrides the default element name to apply unique styles with the Customization Provider
*
* @default 'DATA_GRID_CELL'
* @type {BoxElementProps['element']}
* @memberof DataGridCellProps
*/
element?: BoxElementProps["element"];
/**
* How many columns the cell spans across
*
* @type {number}
* @memberof DataGridCellProps
*/
colSpan?: number;
}
};
type DataGridCellAsThProps = ThProps &
DataGridCellBasePropsProps & {
as?: "th";
};
type DataGridCellAsTdProps = TdProps &
DataGridCellBasePropsProps & {
as?: "td";
};

export type DataGridCellProps = DataGridCellAsThProps | DataGridCellAsTdProps;

/**
* DataGrid cell component. Every visible box in a data grid is powered by the cell.
Expand Down