diff --git a/.vscode/settings.json b/.vscode/settings.json index b72afc2..3249031 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -42,7 +42,7 @@ "package-lock.json": true }, "typescript.preferences.importModuleSpecifier": "relative", - "typescript.preferences.importModuleSpecifierEnding": "minimal", + "typescript.preferences.importModuleSpecifierEnding": "js", "typescript.preferences.quoteStyle": "double", "typescript.tsdk": "node_modules/typescript/lib", "typescript.updateImportsOnFileMove.enabled": "always", diff --git a/api-extractor/react-loading-progress-indicator.api.json b/api-extractor/react-loading-progress-indicator.api.json index f9a5521..4fa7b58 100644 --- a/api-extractor/react-loading-progress-indicator.api.json +++ b/api-extractor/react-loading-progress-indicator.api.json @@ -172,6 +172,30 @@ "name": "", "preserveMemberOrder": false, "members": [ + { + "kind": "Variable", + "canonicalReference": "@asl-19/react-loading-progress-indicator!getDefaultStyle:var", + "docComment": "/**\n * Get default styles for loading progress indicator.\n *\n * @remarks\n *\n * Use this to augment the default styles in your own `getStyle` function.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "getDefaultStyle: " + }, + { + "kind": "Reference", + "text": "LoadingProgressIndicatorGetStyleFunction", + "canonicalReference": "@asl-19/react-loading-progress-indicator!LoadingProgressIndicatorGetStyleFunction:type" + } + ], + "fileUrlPath": "dist/getDefaultStyle.d.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "getDefaultStyle", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, { "kind": "Variable", "canonicalReference": "@asl-19/react-loading-progress-indicator!LoadingProgressIndicator:var", @@ -200,7 +224,7 @@ "text": ">" } ], - "fileUrlPath": "dist/components/LoadingProgressIndicator.d.ts", + "fileUrlPath": "dist/LoadingProgressIndicator.d.ts", "isReadonly": true, "releaseTag": "Public", "name": "LoadingProgressIndicator", @@ -232,7 +256,7 @@ "text": ";" } ], - "fileUrlPath": "dist/types/LoadingProgressIndicatorGetStyleFunction.d.ts", + "fileUrlPath": "dist/LoadingProgressIndicatorGetStyleFunction.d.ts", "releaseTag": "Public", "name": "LoadingProgressIndicatorGetStyleFunction", "typeTokenRange": { @@ -250,7 +274,7 @@ "text": "interface LoadingProgressIndicatorProps " } ], - "fileUrlPath": "dist/types/LoadingProgressIndicatorProps.d.ts", + "fileUrlPath": "dist/LoadingProgressIndicatorProps.d.ts", "releaseTag": "Public", "name": "LoadingProgressIndicatorProps", "preserveMemberOrder": false, diff --git a/api-extractor/react-loading-progress-indicator.api.md b/api-extractor/react-loading-progress-indicator.api.md index 72c0549..e402264 100644 --- a/api-extractor/react-loading-progress-indicator.api.md +++ b/api-extractor/react-loading-progress-indicator.api.md @@ -4,8 +4,11 @@ ```ts -import { CSSProperties } from 'react'; -import { FC } from 'react'; +import type { CSSProperties } from 'react'; +import type { FC } from 'react'; + +// @public +export const getDefaultStyle: LoadingProgressIndicatorGetStyleFunction; // @public const LoadingProgressIndicator: FC; diff --git a/docs/react-loading-progress-indicator.getdefaultstyle.md b/docs/react-loading-progress-indicator.getdefaultstyle.md new file mode 100644 index 0000000..88f09b7 --- /dev/null +++ b/docs/react-loading-progress-indicator.getdefaultstyle.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [@asl-19/react-loading-progress-indicator](./react-loading-progress-indicator.md) > [getDefaultStyle](./react-loading-progress-indicator.getdefaultstyle.md) + +## getDefaultStyle variable + +Get default styles for loading progress indicator. + +**Signature:** + +```typescript +getDefaultStyle: LoadingProgressIndicatorGetStyleFunction +``` + +## Remarks + +Use this to augment the default styles in your own `getStyle` function. + diff --git a/docs/react-loading-progress-indicator.md b/docs/react-loading-progress-indicator.md index 3851dda..008c8cd 100644 --- a/docs/react-loading-progress-indicator.md +++ b/docs/react-loading-progress-indicator.md @@ -47,6 +47,17 @@ Description +[getDefaultStyle](./react-loading-progress-indicator.getdefaultstyle.md) + + + + +Get default styles for loading progress indicator. + + + + + [LoadingProgressIndicator](./react-loading-progress-indicator.loadingprogressindicator.md) diff --git a/package-lock.json b/package-lock.json index 2b090bb..651aa5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,13 +9,13 @@ "version": "1.0.0", "license": "GPL-3.0-or-later", "dependencies": { - "@asl-19/js-dom-utils": "^0.2.1" + "@asl-19/js-dom-utils": "^1.0.0" }, "devDependencies": { "@asl-19/eslint-config": "^0.9.0", "@microsoft/api-documenter": "^7.26.31", "@microsoft/api-extractor": "^7.52.10", - "@types/node": "^24.2.1", + "@types/node": "^22.17.2", "@types/react": "^19.1.10", "@types/react-dom": "^19.1.7", "eslint": "^9.33.0", @@ -68,9 +68,10 @@ } }, "node_modules/@asl-19/js-dom-utils": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@asl-19/js-dom-utils/-/js-dom-utils-0.2.1.tgz", - "integrity": "sha512-+82VGPsa9u6s/k86r02PIMOex1KPzlxrpFBJ4oQ+NCy0+UliXPtsoNdEhag2OpngcdkgXY+7A2bQRJZyVLpZOg==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@asl-19/js-dom-utils/-/js-dom-utils-1.0.0.tgz", + "integrity": "sha512-rxSP0uG04N0iigjSB8ZBp3kZSJ9BdJUzplR7ubExLMx7b/9jOVeUMeXp0YCFvOH4NUr7rZMtB9RCgue77AfSBg==", + "license": "GPL-3.0-or-later" }, "node_modules/@eslint-community/eslint-utils": { "version": "4.7.0", @@ -646,12 +647,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "24.2.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.2.1.tgz", - "integrity": "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ==", + "version": "22.17.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.17.2.tgz", + "integrity": "sha512-gL6z5N9Jm9mhY+U2KXZpteb+09zyffliRkZyZOHODGATyC5B1Jt/7TzuuiLkFsSUMLbS1OLmlj/E+/3KF4Q/4w==", "dev": true, + "license": "MIT", "dependencies": { - "undici-types": "~7.10.0" + "undici-types": "~6.21.0" } }, "node_modules/@types/react": { @@ -4664,10 +4666,11 @@ } }, "node_modules/undici-types": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", - "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", - "dev": true + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" }, "node_modules/universalify": { "version": "2.0.1", diff --git a/package.json b/package.json index 496ed20..7483f9c 100644 --- a/package.json +++ b/package.json @@ -40,13 +40,13 @@ "tsc-check": "tsc --project tsconfig-dist.json --noEmit" }, "dependencies": { - "@asl-19/js-dom-utils": "^0.2.1" + "@asl-19/js-dom-utils": "^1.0.0" }, "devDependencies": { "@asl-19/eslint-config": "^0.9.0", "@microsoft/api-documenter": "^7.26.31", "@microsoft/api-extractor": "^7.52.10", - "@types/node": "^24.2.1", + "@types/node": "^22.17.2", "@types/react": "^19.1.10", "@types/react-dom": "^19.1.7", "eslint": "^9.33.0", diff --git a/src/components/LoadingProgressIndicator.tsx b/src/LoadingProgressIndicator.tsx similarity index 93% rename from src/components/LoadingProgressIndicator.tsx rename to src/LoadingProgressIndicator.tsx index 012a451..5a1271e 100644 --- a/src/components/LoadingProgressIndicator.tsx +++ b/src/LoadingProgressIndicator.tsx @@ -1,11 +1,13 @@ +import type { FC } from "react"; + import { announce } from "@asl-19/js-dom-utils"; // We need to import React directly to prevent API Extractor from failing with // “Error: The expression contains an import() type, which is not yet supported // by API Extractor:” -import React, { FC, memo, useEffect, useRef, useState } from "react"; +import React, { memo, useEffect, useRef, useState } from "react"; -import LoadingProgressIndicatorProps from "../types/LoadingProgressIndicatorProps"; -import getDefaultStyle from "../utils/getDefaultStyle"; +import getDefaultStyle from "./getDefaultStyle.js"; +import LoadingProgressIndicatorProps from "./LoadingProgressIndicatorProps.js"; const LoadingProgressIndicatorUnmemoized: FC = ({ color, diff --git a/src/types/LoadingProgressIndicatorGetStyleFunction.ts b/src/LoadingProgressIndicatorGetStyleFunction.ts similarity index 95% rename from src/types/LoadingProgressIndicatorGetStyleFunction.ts rename to src/LoadingProgressIndicatorGetStyleFunction.ts index 27dd2a7..69fad27 100644 --- a/src/types/LoadingProgressIndicatorGetStyleFunction.ts +++ b/src/LoadingProgressIndicatorGetStyleFunction.ts @@ -1,4 +1,4 @@ -import { CSSProperties } from "react"; +import type { CSSProperties } from "react"; /** * Function returning loading indicator styles. diff --git a/src/types/LoadingProgressIndicatorProps.ts b/src/LoadingProgressIndicatorProps.ts similarity index 95% rename from src/types/LoadingProgressIndicatorProps.ts rename to src/LoadingProgressIndicatorProps.ts index 89d8bf5..720e7d5 100644 --- a/src/types/LoadingProgressIndicatorProps.ts +++ b/src/LoadingProgressIndicatorProps.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/consistent-type-definitions */ -import LoadingProgressIndicatorGetStyleFunction from "./LoadingProgressIndicatorGetStyleFunction"; + +import type LoadingProgressIndicatorGetStyleFunction from "./LoadingProgressIndicatorGetStyleFunction.js"; /** * LoadingProgressIndicator props diff --git a/src/utils/getDefaultStyle.ts b/src/getDefaultStyle.ts similarity index 66% rename from src/utils/getDefaultStyle.ts rename to src/getDefaultStyle.ts index 6a1b3f9..cb6cb5e 100644 --- a/src/utils/getDefaultStyle.ts +++ b/src/getDefaultStyle.ts @@ -1,5 +1,13 @@ -import LoadingProgressIndicatorGetStyleFunction from "../types/LoadingProgressIndicatorGetStyleFunction"; +import type LoadingProgressIndicatorGetStyleFunction from "./LoadingProgressIndicatorGetStyleFunction.js"; +/** + * Get default styles for loading progress indicator. + * + * @remarks Use this to augment the default styles in your own `getStyle` + * function. + * + * @public + */ const getDefaultStyle: LoadingProgressIndicatorGetStyleFunction = ({ color, direction, diff --git a/src/index.ts b/src/index.ts index aaef85e..b69b279 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,6 +4,7 @@ * @packageDocumentation */ -export { default } from "./components/LoadingProgressIndicator.js"; -export type { default as LoadingProgressIndicatorGetStyleFunction } from "./types/LoadingProgressIndicatorGetStyleFunction.js"; -export type { default as LoadingProgressIndicatorProps } from "./types/LoadingProgressIndicatorProps.js"; +export { default as getDefaultStyle } from "./getDefaultStyle.js"; +export { default } from "./LoadingProgressIndicator.js"; +export type { default as LoadingProgressIndicatorGetStyleFunction } from "./LoadingProgressIndicatorGetStyleFunction.js"; +export type { default as LoadingProgressIndicatorProps } from "./LoadingProgressIndicatorProps.js";