diff --git a/types/govuk-frontend/dist/govuk/all.bundle.d.mts b/types/govuk-frontend/dist/govuk/all.bundle.d.mts index 4ec1b9b3faf932..0e28a4c85f9430 100644 --- a/types/govuk-frontend/dist/govuk/all.bundle.d.mts +++ b/types/govuk-frontend/dist/govuk/all.bundle.d.mts @@ -9,7 +9,6 @@ export { Checkboxes } from "./components/checkboxes/checkboxes.mjs"; export { ErrorSummary } from "./components/error-summary/error-summary.mjs"; export { ExitThisPage } from "./components/exit-this-page/exit-this-page.mjs"; export { FileUpload } from "./components/file-upload/file-upload.mjs"; -export { Header } from "./components/header/header.mjs"; export { NotificationBanner } from "./components/notification-banner/notification-banner.mjs"; export { PasswordInput } from "./components/password-input/password-input.mjs"; export { Radios } from "./components/radios/radios.mjs"; diff --git a/types/govuk-frontend/dist/govuk/all.bundle.d.ts b/types/govuk-frontend/dist/govuk/all.bundle.d.ts index ee7326dfc6d394..4ff5890662d5b9 100644 --- a/types/govuk-frontend/dist/govuk/all.bundle.d.ts +++ b/types/govuk-frontend/dist/govuk/all.bundle.d.ts @@ -9,7 +9,6 @@ import { Checkboxes } from "./components/checkboxes/checkboxes.js"; import { ErrorSummary } from "./components/error-summary/error-summary.js"; import { ExitThisPage } from "./components/exit-this-page/exit-this-page.js"; import { FileUpload } from "./components/file-upload/file-upload.js"; -import { Header } from "./components/header/header.js"; import { NotificationBanner } from "./components/notification-banner/notification-banner.js"; import { PasswordInput } from "./components/password-input/password-input.js"; import { Radios } from "./components/radios/radios.js"; @@ -33,7 +32,6 @@ declare const GOVUKFrontend: { ErrorSummary: typeof ErrorSummary; ExitThisPage: typeof ExitThisPage; FileUpload: typeof FileUpload; - Header: typeof Header; NotificationBanner: typeof NotificationBanner; PasswordInput: typeof PasswordInput; Radios: typeof Radios; diff --git a/types/govuk-frontend/dist/govuk/common/configuration.d.ts b/types/govuk-frontend/dist/govuk/common/configuration.d.ts index 61c8f3f893347c..a96b2ca57881ac 100644 --- a/types/govuk-frontend/dist/govuk/common/configuration.d.ts +++ b/types/govuk-frontend/dist/govuk/common/configuration.d.ts @@ -30,7 +30,6 @@ export function normaliseString( * * @internal * @template {Partial>} ConfigurationType - * @template {[keyof ConfigurationType, SchemaProperty | undefined][]} SchemaEntryType * @param {{ schema?: Schema, moduleName: string }} Component - Component class * @param {DOMStringMap} dataset - HTML element dataset * @returns {ObjectNested} Normalised dataset @@ -53,9 +52,7 @@ export function normaliseDataset< * @param {Config | CreateAllOptions | OnErrorCallback | Element | Document | null} [scopeOrOptions] - Scope of the document to search within, initialisation options or error callback function * @returns {CreateAllOptions} Normalised options */ -export function normaliseOptions< - ComponentClass extends CompatibleClass, ->( +export function normaliseOptions( scopeOrOptions?: | Config | CreateAllOptions @@ -126,13 +123,11 @@ export const configOverride: unique symbol; * * Centralises the behaviours shared by our components * - * @template {Partial>} ConfigurationType - * @template {Element & { dataset: DOMStringMap }} RootElementType + * @template {Partial>} [ConfigurationType=ObjectNested] + * @template {Element & { dataset: DOMStringMap }} [RootElementType=HTMLElement] */ export abstract class ConfigurableComponent< - ConfigurationType extends Partial< - Record - > = ObjectNested, + ConfigurationType extends Partial> = ObjectNested, RootElementType extends Element & { dataset: DOMStringMap; } = HTMLElement, @@ -153,7 +148,6 @@ export abstract class ConfigurableComponent< */ protected get config(): ConfigurationType; - /** */ _config: ConfigurationType; /** diff --git a/types/govuk-frontend/dist/govuk/components/header/header.d.mts b/types/govuk-frontend/dist/govuk/components/header/header.d.mts deleted file mode 100644 index 14d97fbd19d4f0..00000000000000 --- a/types/govuk-frontend/dist/govuk/components/header/header.d.mts +++ /dev/null @@ -1 +0,0 @@ -export * from "./header.js"; diff --git a/types/govuk-frontend/dist/govuk/components/header/header.d.ts b/types/govuk-frontend/dist/govuk/components/header/header.d.ts deleted file mode 100644 index 2922556d7c4e9c..00000000000000 --- a/types/govuk-frontend/dist/govuk/components/header/header.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component } from "../../component.js"; - -/** - * Header component - */ -export class Header extends Component { - /** - * Name for the component used when initialising using data-module attributes. - */ - static moduleName: string; - - /** - * Apply a matchMedia for desktop which will trigger a state sync if the - * browser viewport moves between states. - * - * @param {Element | null} $root - HTML element to use for header - */ - constructor($root: Element | null); -} diff --git a/types/govuk-frontend/dist/govuk/i18n.d.ts b/types/govuk-frontend/dist/govuk/i18n.d.ts index 4dd177098661ea..ccde0192ccb434 100644 --- a/types/govuk-frontend/dist/govuk/i18n.d.ts +++ b/types/govuk-frontend/dist/govuk/i18n.d.ts @@ -5,59 +5,6 @@ * @internal */ export class I18n { - /** - * Map of plural rules to languages where those rules apply. - * - * Note: These groups are named for the most dominant or recognisable language - * that uses each system. The groupings do not imply that the languages are - * related to one another. Many languages have evolved the same systems - * independently of one another. - * - * Code to support more languages can be found in the i18n spike: - * {@link https://github.com/alphagov/govuk-frontend/blob/spike-i18n-support/src/govuk/i18n.mjs} - * - * Languages currently supported: - * - * Arabic: Arabic (ar) - * Chinese: Burmese (my), Chinese (zh), Indonesian (id), Japanese (ja), - * Javanese (jv), Korean (ko), Malay (ms), Thai (th), Vietnamese (vi) - * French: Armenian (hy), Bangla (bn), French (fr), Gujarati (gu), Hindi (hi), - * Persian Farsi (fa), Punjabi (pa), Zulu (zu) - * German: Afrikaans (af), Albanian (sq), Azerbaijani (az), Basque (eu), - * Bulgarian (bg), Catalan (ca), Danish (da), Dutch (nl), English (en), - * Estonian (et), Finnish (fi), Georgian (ka), German (de), Greek (el), - * Hungarian (hu), Luxembourgish (lb), Norwegian (no), Somali (so), - * Swahili (sw), Swedish (sv), Tamil (ta), Telugu (te), Turkish (tr), - * Urdu (ur) - * Irish: Irish Gaelic (ga) - * Russian: Russian (ru), Ukrainian (uk) - * Scottish: Scottish Gaelic (gd) - * Spanish: European Portuguese (pt-PT), Italian (it), Spanish (es) - * Welsh: Welsh (cy) - * - * @internal - */ - static pluralRulesMap: { - [key: string]: string[]; - }; - - /** - * Different pluralisation rule sets - * - * Returns the appropriate suffix for the plural form associated with `n`. - * Possible suffixes: 'zero', 'one', 'two', 'few', 'many', 'other' (the actual - * meaning of each differs per locale). 'other' should always exist, even in - * languages without plurals, such as Chinese. - * {@link https://cldr.unicode.org/index/cldr-spec/plural-rules} - * - * The count must be a positive integer. Negative numbers and decimals aren't accounted for - * - * @internal - */ - static pluralRules: { - [key: string]: (count: number) => PluralRule; - }; - /** * @internal * @param {{ [key: string]: string | TranslationPluralForms }} translations - Key-value pairs of the translation strings to use. @@ -142,32 +89,6 @@ export class I18n { * @throws {Error} Plural form `.other` required when preferred plural form is missing */ getPluralSuffix(lookupKey: string, count: number): PluralRule; - - /** - * Get the plural form using our fallback implementation - * - * This is split out into a separate function to make it easier to test the - * fallback behaviour in an environment where Intl.PluralRules exists. - * - * @internal - * @param {number} count - Number used to determine which pluralisation to use. - * @returns {PluralRule} The pluralisation form for count in this locale. - */ - selectPluralFormUsingFallbackRules(count: number): PluralRule; - - /** - * Work out which pluralisation rules to use for the current locale - * - * The locale may include a regional indicator (such as en-GB), but we don't - * usually care about this part, as pluralisation rules are usually the same - * regardless of region. There are exceptions, however, (e.g. Portuguese) so - * this searches by both the full and shortened locale codes, just to be sure. - * - * @internal - * @returns {string | undefined} The name of the pluralisation rule to use (a key for one - * of the functions in this.pluralRules) - */ - getPluralRulesForLocale(): string | undefined; } /** diff --git a/types/govuk-frontend/govuk-frontend-tests.mts b/types/govuk-frontend/govuk-frontend-tests.mts index 53c0ca615a6ae3..5bba56dba00016 100644 --- a/types/govuk-frontend/govuk-frontend-tests.mts +++ b/types/govuk-frontend/govuk-frontend-tests.mts @@ -11,7 +11,6 @@ import { ErrorSummary, ExitThisPage, FileUpload, - Header, initAll, isSupported, NotificationBanner, @@ -21,9 +20,14 @@ import { SkipLink, Tabs, } from "govuk-frontend"; +import { I18n } from "govuk-frontend/dist/govuk/i18n.mjs"; const $root = document.createElement("div"); +const i18n = new I18n({ age: "I am %{age} years old" }, { locale: "en" }); + +i18n.t("age", { age: 2000 }); + new Accordion($root); new Accordion($root, Accordion.defaults); @@ -34,7 +38,6 @@ new CharacterCount($root); new CharacterCount($root, CharacterCount.defaults); new Checkboxes($root); -new Header($root); new ErrorSummary($root); new ErrorSummary($root, ErrorSummary.defaults); @@ -199,24 +202,6 @@ createAll(Checkboxes, undefined, { }, }); -createAll(Header); -createAll(Header, undefined); -createAll(Header, undefined, null); -createAll(Header, undefined, undefined); -createAll(Header, undefined, document); -createAll(Header, undefined, document.body); -createAll(Header, undefined, console.error); -createAll(Header, undefined, { - scope: document.body, - onError(error, context) { - error instanceof Error; - context.element; - context.component?.moduleName; - context.component instanceof Header; - context.config === undefined; - }, -}); - createAll(ErrorSummary); createAll(ErrorSummary, ErrorSummary.defaults); createAll(ErrorSummary, ErrorSummary.defaults, null); diff --git a/types/govuk-frontend/govuk-frontend-tests.ts b/types/govuk-frontend/govuk-frontend-tests.ts index 92ae69007d922a..39160ab361ab00 100644 --- a/types/govuk-frontend/govuk-frontend-tests.ts +++ b/types/govuk-frontend/govuk-frontend-tests.ts @@ -1,4 +1,5 @@ import { type Config, type ConfigKey } from "govuk-frontend"; +import { I18n } from "govuk-frontend/dist/govuk/i18n.js"; import GOVUKFrontend = require("govuk-frontend"); const { @@ -12,9 +13,8 @@ const { ErrorSummary, ExitThisPage, FileUpload, - Header, - isSupported, initAll, + isSupported, NotificationBanner, PasswordInput, Radios, @@ -25,6 +25,10 @@ const { const $root = document.createElement("div"); +const i18n = new I18n({ age: "I am %{age} years old" }, { locale: "en" }); + +i18n.t("age", { age: 2000 }); + new Accordion($root); new Accordion($root, Accordion.defaults); @@ -35,7 +39,6 @@ new CharacterCount($root); new CharacterCount($root, CharacterCount.defaults); new Checkboxes($root); -new Header($root); new ErrorSummary($root); new ErrorSummary($root, ErrorSummary.defaults); @@ -200,24 +203,6 @@ createAll(Checkboxes, undefined, { }, }); -createAll(Header); -createAll(Header, undefined); -createAll(Header, undefined, null); -createAll(Header, undefined, undefined); -createAll(Header, undefined, document); -createAll(Header, undefined, document.body); -createAll(Header, undefined, console.error); -createAll(Header, undefined, { - scope: document.body, - onError(error, context) { - error instanceof Error; - context.element; - context.component?.moduleName; - context.component instanceof Header; - context.config === undefined; - }, -}); - createAll(ErrorSummary); createAll(ErrorSummary, ErrorSummary.defaults); createAll(ErrorSummary, ErrorSummary.defaults, null); diff --git a/types/govuk-frontend/package.json b/types/govuk-frontend/package.json index 4ac4016056454a..e3e680a21298d8 100644 --- a/types/govuk-frontend/package.json +++ b/types/govuk-frontend/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/govuk-frontend", - "version": "5.11.9999", + "version": "6.0.9999", "projects": [ "https://github.com/alphagov/govuk-frontend", "https://frontend.design-system.service.gov.uk" @@ -10,6 +10,10 @@ ".": { "import": "./dist/govuk/all.d.mts", "require": "./dist/govuk/all.bundle.d.ts" + }, + "./*": { + "require": "./*", + "import": "./*" } }, "devDependencies": { diff --git a/types/govuk-frontend/tsconfig.json b/types/govuk-frontend/tsconfig.json index 10ac16d9703885..1bdecf218dfa16 100644 --- a/types/govuk-frontend/tsconfig.json +++ b/types/govuk-frontend/tsconfig.json @@ -42,14 +42,14 @@ "dist/govuk/components/exit-this-page/exit-this-page.d.ts", "dist/govuk/components/file-upload/file-upload.d.mts", "dist/govuk/components/file-upload/file-upload.d.ts", - "dist/govuk/components/header/header.d.mts", - "dist/govuk/components/header/header.d.ts", "dist/govuk/components/notification-banner/notification-banner.d.mts", "dist/govuk/components/notification-banner/notification-banner.d.ts", "dist/govuk/components/password-input/password-input.d.mts", "dist/govuk/components/password-input/password-input.d.ts", "dist/govuk/components/radios/radios.d.mts", "dist/govuk/components/radios/radios.d.ts", + "dist/govuk/components/service-navigation/service-navigation.d.mts", + "dist/govuk/components/service-navigation/service-navigation.d.ts", "dist/govuk/components/skip-link/skip-link.d.mts", "dist/govuk/components/skip-link/skip-link.d.ts", "dist/govuk/components/tabs/tabs.d.mts", diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 4402b1f1f05efe..7979a2332e6061 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -1536,6 +1536,10 @@ export interface PlotData { x: Datum[] | Datum[][] | TypedArray; y: Datum[] | Datum[][] | TypedArray; z: Datum[] | Datum[][] | Datum[][][] | TypedArray; + x0: string | number; + y0: string | number; + dx: number; + dy: number; i: TypedArray; j: TypedArray; k: TypedArray; diff --git a/types/plotly.js/test/core-tests.ts b/types/plotly.js/test/core-tests.ts index 42bda171f48872..d8f7c150b80345 100644 --- a/types/plotly.js/test/core-tests.ts +++ b/types/plotly.js/test/core-tests.ts @@ -28,7 +28,15 @@ const trace2 = { ], type: "scatter", } as ScatterData; -const data = [trace1, trace2]; +const trace3 = { + x0: 1999, + dx: 1, + y0: 0, + dy: 5, + z: [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]], + type: "heatmap", +} as PlotData; +const data = [trace1, trace2, trace3]; const tickangle: "auto" = "auto"; const layout = { title: { diff --git a/types/plotly.js/v2/index.d.ts b/types/plotly.js/v2/index.d.ts index ce880957bb5dd5..8270b3b79a3fbf 100644 --- a/types/plotly.js/v2/index.d.ts +++ b/types/plotly.js/v2/index.d.ts @@ -1542,6 +1542,10 @@ export interface PlotData { x: Datum[] | Datum[][] | TypedArray; y: Datum[] | Datum[][] | TypedArray; z: Datum[] | Datum[][] | Datum[][][] | TypedArray; + x0: string | number; + y0: string | number; + dx: number; + dy: number; i: TypedArray; j: TypedArray; k: TypedArray; diff --git a/types/plotly.js/v2/test/core-tests.ts b/types/plotly.js/v2/test/core-tests.ts index 3c72675686f4a8..01ac11eb301e0f 100644 --- a/types/plotly.js/v2/test/core-tests.ts +++ b/types/plotly.js/v2/test/core-tests.ts @@ -28,7 +28,15 @@ const trace2 = { ], type: "scatter", } as ScatterData; -const data = [trace1, trace2]; +const trace3 = { + x0: 1999, + dx: 1, + y0: 0, + dy: 5, + z: [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]], + type: "heatmap", +} as PlotData; +const data = [trace1, trace2, trace3]; const tickangle: "auto" = "auto"; const layout = { title: {