diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 46253e12..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: metonym diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 2c0a64f0..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,8 +0,0 @@ -blank_issues_enabled: true -contact_links: - - name: Ask a question - url: https://github.com/carbon-design-system/carbon-components-svelte/discussions - about: Please ask and answer questions here. - - name: Carbon Design System Discord - url: https://discord.gg/J7JEUEkTRX - about: Chat with us on Discord. diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 4bfc879a..00000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,60 +0,0 @@ -on: - pull_request: - paths-ignore: - - "**.md" - - "docs/**" - - "examples/**" - push: - branches: [master] - paths-ignore: - - "**.md" - - "docs/**" - - "examples/**" - -permissions: - contents: read - -jobs: - lint: - runs-on: macos-15-xlarge - steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 - with: - node-version: 22 - cache: "npm" - - run: npm ci - - run: npm run lint - - test: - runs-on: macos-15-xlarge - steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 - with: - node-version: 22 - cache: "npm" - - run: npm ci - - run: npm run test - - types: - runs-on: macos-15-xlarge - steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 - with: - node-version: 22 - cache: "npm" - - run: npm ci - - run: npm run test:src-types - - run: npm run test:types - - deploy-docs: - if: github.ref == 'refs/heads/master' - needs: [lint, test, types] - runs-on: macos-15-xlarge - steps: - - name: Trigger deploy - env: - deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }} - run: curl -f "$deploy_url" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index c98236e1..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,40 +0,0 @@ -on: - push: - tags: - - "v*" - -jobs: - release: - runs-on: macos-latest-xlarge - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 - with: - node-version: 22 - registry-url: "https://registry.npmjs.org" - - - name: Install dependencies - run: npm install - - - name: Build docs - run: npm run build:docs - - - name: Prune package.json - run: npx culls --preserve=svelte - - - name: Publish package (stable) - if: ${{ ! contains(github.ref, '-next') }} - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - run: | - npm publish --provenance --access public - - - name: Publish package (next) - if: ${{ contains(github.ref, '-next') }} - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - run: | - npm publish --provenance --access public --tag next diff --git a/.gitignore b/.gitignore index 5247532c..2fa5e32b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ -node_modules +/coverage +/lib +/node_modules +/css/*.css .DS_Store +yarn-debug.log* +yarn-error.log* +*.tgz .vscode -.idea \ No newline at end of file +.idea diff --git a/.prettierignore b/.prettierignore index ce337c7f..89e9c684 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,9 +1,9 @@ +/coverage +/lib /css -/types -.svelte-kit -.routify -dist -client -build -*.svx -COMPONENT_API.json \ No newline at end of file +/**/__sapper__ +/**/.routify +/**/dist +/**/client +/**/build +*.svx \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..bad68449 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: 12 +cache: yarn +script: + - yarn prepack + - yarn test diff --git a/CHANGELOG.md b/CHANGELOG.md index 6adc2484..7a6fe9cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,1972 +1,13 @@ # Changelog -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +All notable changes to this project will be documented in this file. -### [0.89.7](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.89.6...v0.89.7) (2025-09-05) +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -### Bug Fixes + -- **combo-box:** address accessibility issues ([#2186](https://github.com/carbon-design-system/carbon-components-svelte/issues/2186)) ([2fc884c](https://github.com/carbon-design-system/carbon-components-svelte/commit/2fc884cacabfffcf7779d6ef9ba01dece0bf5d86)), closes [#2172](https://github.com/carbon-design-system/carbon-components-svelte/issues/2172) -- **data-table:** handle dynamic `headers` gracefully ([#2195](https://github.com/carbon-design-system/carbon-components-svelte/issues/2195)) ([6d0d3b1](https://github.com/carbon-design-system/carbon-components-svelte/commit/6d0d3b108bb4595d878fda20736c40b9656d14d7)), closes [#2193](https://github.com/carbon-design-system/carbon-components-svelte/issues/2193) -- **overflow-menu:** avoid dynamic style injection for performance ([#2198](https://github.com/carbon-design-system/carbon-components-svelte/issues/2198)) ([14edf41](https://github.com/carbon-design-system/carbon-components-svelte/commit/14edf41e57fea1ddbb2cf24c37e79475849bdea1)), closes [#2197](https://github.com/carbon-design-system/carbon-components-svelte/issues/2197) -- **pagination:** `on:change` dispatches with correct value ([#2194](https://github.com/carbon-design-system/carbon-components-svelte/issues/2194)) ([44a6cc0](https://github.com/carbon-design-system/carbon-components-svelte/commit/44a6cc0dfcbd3cdad1b442a760c9f604e58d56e6)) - -### [0.89.6](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.89.5...v0.89.6) (2025-08-16) - -### Bug Fixes - -- **toggle:** avoid dispatching `toggle` event on state change ([#2184](https://github.com/carbon-design-system/carbon-components-svelte/issues/2184)) ([0df727b](https://github.com/carbon-design-system/carbon-components-svelte/commit/0df727b704d6cc577681dc682269a6e224ddbb6e)) - -### [0.89.5](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.89.4...v0.89.5) (2025-08-05) - -### Bug Fixes - -- **checkbox:** prevent infinite effect loop when binding to same object ([#2178](https://github.com/carbon-design-system/carbon-components-svelte/issues/2178)) ([c7ad1eb](https://github.com/carbon-design-system/carbon-components-svelte/commit/c7ad1ebdd3764235f460abd95cdb7d1d389983d9)), closes [#2177](https://github.com/carbon-design-system/carbon-components-svelte/issues/2177) - -### [0.89.4](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.89.3...v0.89.4) (2025-06-10) - -### Bug Fixes - -- **multi-select:** forward `on:input` for filterable variant ([#2170](https://github.com/carbon-design-system/carbon-components-svelte/issues/2170)) ([aecc4e8](https://github.com/carbon-design-system/carbon-components-svelte/commit/aecc4e8eec6571515233ec76ca06218814a279a7)) - -### [0.89.3](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.89.2...v0.89.3) (2025-06-07) - -### Bug Fixes - -- **combo-box:** "Escape" key clears input value ([#2169](https://github.com/carbon-design-system/carbon-components-svelte/issues/2169)) ([632320a](https://github.com/carbon-design-system/carbon-components-svelte/commit/632320ae3b8d9c602add0f4f7c708fc643cb7ffc)), closes [#2167](https://github.com/carbon-design-system/carbon-components-svelte/issues/2167) -- **combo-box:** clear button supports "Space" key ([#2168](https://github.com/carbon-design-system/carbon-components-svelte/issues/2168)) ([95c06a8](https://github.com/carbon-design-system/carbon-components-svelte/commit/95c06a83b3afcbb76acfc0a5efe2f178d333ff19)), closes [#2166](https://github.com/carbon-design-system/carbon-components-svelte/issues/2166) - -### [0.89.2](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.89.1...v0.89.2) (2025-04-28) - -### Bug Fixes - -- **composed-modal:** ignore a11y warning in Svelte 5 ([#2159](https://github.com/carbon-design-system/carbon-components-svelte/issues/2159)) ([024d774](https://github.com/carbon-design-system/carbon-components-svelte/commit/024d77493c93e7823e4781a1a60aaf350d289d52)) -- **pagination:** use `toLocaleString` for default text formatting ([#2161](https://github.com/carbon-design-system/carbon-components-svelte/issues/2161)) ([cdf5659](https://github.com/carbon-design-system/carbon-components-svelte/commit/cdf5659fa0177da77dc8ea1ccffdec54b746954b)) -- **pagination:** window `totalItems` for performance ([#2160](https://github.com/carbon-design-system/carbon-components-svelte/issues/2160)) ([ed3928b](https://github.com/carbon-design-system/carbon-components-svelte/commit/ed3928bb01ecca2fa63f551938dbee1c1829a978)), closes [#2156](https://github.com/carbon-design-system/carbon-components-svelte/issues/2156) -- **to-hierarchy:** revert to previous implementation ([96d37cc](https://github.com/carbon-design-system/carbon-components-svelte/commit/96d37cc490f28830264c35c84447ee4526256314)) - -### [0.89.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.89.0...v0.89.1) (2025-04-21) - -### Bug Fixes - -- **toolbar-search:** re-filter rows if `DataTable` rows change ([#2154](https://github.com/carbon-design-system/carbon-components-svelte/issues/2154)) ([f09c2e2](https://github.com/carbon-design-system/carbon-components-svelte/commit/f09c2e2c311c15f633db8dc45930d8e58a4b362d)), closes [#2143](https://github.com/carbon-design-system/carbon-components-svelte/issues/2143) - -### [0.89.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.88.4...v0.89.0) (2025-04-18) - -### Features - -- **combo-box:** add `hideLabel` prop ([#2153](https://github.com/carbon-design-system/carbon-components-svelte/issues/2153)) ([436dea4](https://github.com/carbon-design-system/carbon-components-svelte/commit/436dea47e8da35753a257c9b2bd6f33338e95ba5)) - -### Bug Fixes - -- **select:** falsy item `text` should fallback to `value` ([#2152](https://github.com/carbon-design-system/carbon-components-svelte/issues/2152)) ([61ea8dd](https://github.com/carbon-design-system/carbon-components-svelte/commit/61ea8dd82c2f9863dfe5f8a882e73624b994d9e5)) - -### [0.88.4](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.88.3...v0.88.4) (2025-03-24) - -### Bug Fixes - -- **list-box-selection:** fix `aria-label` for clear button ([#2134](https://github.com/carbon-design-system/carbon-components-svelte/issues/2134)) ([dd1338f](https://github.com/carbon-design-system/carbon-components-svelte/commit/dd1338ffc47926a13e231d4a0f724e923f2219e2)) -- **list-box:** correct button/description translations based on selection count ([#2139](https://github.com/carbon-design-system/carbon-components-svelte/issues/2139)) ([1a5f2d8](https://github.com/carbon-design-system/carbon-components-svelte/commit/1a5f2d8e67734bfda20272ae6a77d13b3837416d)) -- **list-box:** set `aria-disabled` if `disabled` ([#2125](https://github.com/carbon-design-system/carbon-components-svelte/issues/2125)) ([#2138](https://github.com/carbon-design-system/carbon-components-svelte/issues/2138)) ([9b61af0](https://github.com/carbon-design-system/carbon-components-svelte/commit/9b61af0306b422acf1e7cdde278e517740f667c5)), closes [#2130](https://github.com/carbon-design-system/carbon-components-svelte/issues/2130) -- **radio-button:** forward `focus`, `blur` events ([#2135](https://github.com/carbon-design-system/carbon-components-svelte/issues/2135)) ([1462e30](https://github.com/carbon-design-system/carbon-components-svelte/commit/1462e300d69f0cd7ee5476dfe3a7ea892ac8f4ad)), closes [#2131](https://github.com/carbon-design-system/carbon-components-svelte/issues/2131) -- **radio-tile:** allow standalone `RadioTile` usage ([#2136](https://github.com/carbon-design-system/carbon-components-svelte/issues/2136)) ([ca9beeb](https://github.com/carbon-design-system/carbon-components-svelte/commit/ca9beebaeac7eaed8079c010a86a78926b00147f)) -- **text-area:** allow visually hidden label ([#2137](https://github.com/carbon-design-system/carbon-components-svelte/issues/2137)) ([43511e0](https://github.com/carbon-design-system/carbon-components-svelte/commit/43511e09ecf312c1b8e9339856b9d7d0785036de)) - -### [0.88.3](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.88.2...v0.88.3) (2025-03-19) - -### Bug Fixes - -- Revert **list-box:** use `aria-disabled` instead of invalid `disabled` attribute ([#2125](https://github.com/carbon-design-system/carbon-components-svelte/issues/2125)) ([e1b3ef2](https://github.com/carbon-design-system/carbon-components-svelte/commit/e1b3ef22c9ee09474bacadbb0b22b41326566bab)) - -### [0.88.2](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.88.1...v0.88.2) (2025-03-19) - -### Bug Fixes - -- **combo-box:** fix typing when refocusing input ([9e3d830](https://github.com/carbon-design-system/carbon-components-svelte/commit/9e3d83031e69889472c4e84be256ea242854cf81)) -- **list-box:** use `aria-disabled` instead of invalid `disabled` attribute ([#2125](https://github.com/carbon-design-system/carbon-components-svelte/issues/2125)) ([e1b3ef2](https://github.com/carbon-design-system/carbon-components-svelte/commit/e1b3ef22c9ee09474bacadbb0b22b41326566bab)) -- **multi-select:** fix keyboard navigation for disabled items ([#2129](https://github.com/carbon-design-system/carbon-components-svelte/issues/2129)) ([e7939ff](https://github.com/carbon-design-system/carbon-components-svelte/commit/e7939ff0e21c3430c9eea74c503b7c35f6823445)), closes [#2128](https://github.com/carbon-design-system/carbon-components-svelte/issues/2128) -- **notification:** remove invalid `kind` prop from markup ([#2126](https://github.com/carbon-design-system/carbon-components-svelte/issues/2126)) ([e85d7ef](https://github.com/carbon-design-system/carbon-components-svelte/commit/e85d7efc5ed15f5236d074fd7981ae527d9e5ab5)) -- **theme:** remove invalid `themes` prop from markup ([#2127](https://github.com/carbon-design-system/carbon-components-svelte/issues/2127)) ([5987b61](https://github.com/carbon-design-system/carbon-components-svelte/commit/5987b61a5522fff09468bddd586eed4a537edcc8)) - -### [0.88.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.88.0...v0.88.1) (2025-03-12) - -### Bug Fixes - -- **select:** falsy item `text` should not override `value` ([#2118](https://github.com/carbon-design-system/carbon-components-svelte/issues/2118)) ([663b79a](https://github.com/carbon-design-system/carbon-components-svelte/commit/663b79ad054d14a91a8bf700feb62dcf50976eb8)), closes [#2117](https://github.com/carbon-design-system/carbon-components-svelte/issues/2117) -- **ui-shell:** `HeaderAction` uses dark color scheme ([#2119](https://github.com/carbon-design-system/carbon-components-svelte/issues/2119)) ([7ff93ad](https://github.com/carbon-design-system/carbon-components-svelte/commit/7ff93ad2dac489859d5b4a83c1e359a6507718b4)) - -### [0.88.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.87.7...v0.88.0) (2025-03-09) - -### Features - -- **data-table:** allow custom `inputName` for radio/checkbox ([#2087](https://github.com/carbon-design-system/carbon-components-svelte/issues/2087)) ([7481b9a](https://github.com/carbon-design-system/carbon-components-svelte/commit/7481b9a995dfbc8c2fbaeaae143c8372cf5fce66)), closes [#2085](https://github.com/carbon-design-system/carbon-components-svelte/issues/2085) -- **ui-shell:** `HeaderAction` supports tooltip ([#2111](https://github.com/carbon-design-system/carbon-components-svelte/issues/2111)) ([24b9cbc](https://github.com/carbon-design-system/carbon-components-svelte/commit/24b9cbc9c343537e5e74799ef8289bd29396cf04)), closes [#2110](https://github.com/carbon-design-system/carbon-components-svelte/issues/2110) - -### [0.87.7](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.87.6...v0.87.7) (2025-03-07) - -### Bug Fixes - -- **select:** avoid infinite update loop in Svelte 5 ([#2108](https://github.com/carbon-design-system/carbon-components-svelte/issues/2108)) ([9b4bfa6](https://github.com/carbon-design-system/carbon-components-svelte/commit/9b4bfa6f86e23155516db156cbe1c980f3c699e8)), closes [#2107](https://github.com/carbon-design-system/carbon-components-svelte/issues/2107) - -### [0.87.6](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.87.5...v0.87.6) (2025-02-24) - -### Bug Fixes - -- **overflow-menu:** add `aria-controls` to trigger button ([#2100](https://github.com/carbon-design-system/carbon-components-svelte/issues/2100)) ([b7297d4](https://github.com/carbon-design-system/carbon-components-svelte/commit/b7297d452a7813c02f3c89280787292b1c46acec)) - -### [0.87.5](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.87.4...v0.87.5) (2025-02-04) - -### Bug Fixes - -- **tag:** allow `on:close` to work with Svelte 5 ([#2097](https://github.com/carbon-design-system/carbon-components-svelte/issues/2097)) ([6e65ef3](https://github.com/carbon-design-system/carbon-components-svelte/commit/6e65ef39e7ff9a3c0ee25b7945a62584e9b7441e)), closes [#2096](https://github.com/carbon-design-system/carbon-components-svelte/issues/2096) - -### [0.87.4](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.87.3...v0.87.4) (2025-02-02) - -### Bug Fixes - -- **types:** loosen `icon` prop type to `any` ([#2095](https://github.com/carbon-design-system/carbon-components-svelte/issues/2095)) ([6bf72d4](https://github.com/carbon-design-system/carbon-components-svelte/commit/6bf72d46024ad2ce03651f28fc1a2a95ec03385d)) - -### [0.87.3](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.87.2...v0.87.3) (2025-01-30) - -### Bug Fixes - -- **overflow-menu:** support Svelte 5 ([88f4304](https://github.com/carbon-design-system/carbon-components-svelte/commit/88f4304d5a7c9b38b3cabda677233bef48fb9e3a)), closes [#2092](https://github.com/carbon-design-system/carbon-components-svelte/issues/2092) - -### [0.87.2](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.87.1...v0.87.2) (2025-01-22) - -### Bug Fixes - -- **text-area:** counter supports null `value` ([#2089](https://github.com/carbon-design-system/carbon-components-svelte/issues/2089)) ([76eec84](https://github.com/carbon-design-system/carbon-components-svelte/commit/76eec84c5458d07d61d057d9ff06938e244dbb2c)) - -### [0.87.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.87.0...v0.87.1) (2025-01-19) - -### Bug Fixes - -- **data-table:** improve `expandable` accessibility ([#2086](https://github.com/carbon-design-system/carbon-components-svelte/issues/2086)) ([e874ac1](https://github.com/carbon-design-system/carbon-components-svelte/commit/e874ac19d778a00c0bba9be65d10be7e6c9104dd)) -- **data-table:** prefix internal ID for radio button, checkbox ([#2082](https://github.com/carbon-design-system/carbon-components-svelte/issues/2082)) ([dd6cbac](https://github.com/carbon-design-system/carbon-components-svelte/commit/dd6cbac3ee1728dbcba5cd1d8faa43941e2a198e)), closes [#2081](https://github.com/carbon-design-system/carbon-components-svelte/issues/2081) -- **dropdown:** avoid manual field `blur` ([c194c80](https://github.com/carbon-design-system/carbon-components-svelte/commit/c194c80e29ab36935af71adb9e166e9a16b70910)), closes [#2083](https://github.com/carbon-design-system/carbon-components-svelte/issues/2083) -- **multi-select:** avoid manual field `blur` ([fb6719b](https://github.com/carbon-design-system/carbon-components-svelte/commit/fb6719b1aee35aa45004d82e3b923b4ad45dff5d)), closes [#2083](https://github.com/carbon-design-system/carbon-components-svelte/issues/2083) - -### [0.87.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.86.2...v0.87.0) (2024-12-09) - -### Features - -- add `toHierarchy` utility to normalize flat data into `nodes` for `TreeView`, `RecursiveList` ([#2072](https://github.com/carbon-design-system/carbon-components-svelte/issues/2072)) ([48afd18](https://github.com/carbon-design-system/carbon-components-svelte/commit/48afd18e5e01c2839024b8ddb31038267bcedeb8)) - -### Bug Fixes - -- **tooltip-icon:** `button` should have explicit `type` ([#2071](https://github.com/carbon-design-system/carbon-components-svelte/issues/2071)) ([18c964e](https://github.com/carbon-design-system/carbon-components-svelte/commit/18c964e579a3762b8022751bf0ed5313b78b22ba)) - -### [0.86.2](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.86.1...v0.86.2) (2024-11-30) - -### Bug Fixes - -- **multi-select:** fix sorting behavior ([c3a390f](https://github.com/carbon-design-system/carbon-components-svelte/commit/c3a390f3fef072c6b736e33a85a2ae772df12e52)), closes [#2066](https://github.com/carbon-design-system/carbon-components-svelte/issues/2066) - -## [0.86.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.86.0...v0.86.1) (2024-11-22) - -### Bug Fixes - -- **tree-view:** do not flatten original `nodes` ([#2056](https://github.com/carbon-design-system/carbon-components-svelte/issues/2056)) ([e488c88](https://github.com/carbon-design-system/carbon-components-svelte/commit/e488c8837146432330ebbf2f9182a8a69eab6b70)) - -## [0.86.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.85.4...v0.86.0) (2024-11-20) - -### ⚠ BREAKING CHANGES - -- **package:** set `type="module"` in `package.json` -- **package:** remove bundled ESM/UMD support -- **treeview:** rename `children` prop to `nodes` for Svelte 5 compatibility -- **recursive-list:** rename `children` prop to `nodes` for Svelte 5 compatibility -- **types:** use type alias instead of interface for exported component props ([6fbd8ae](https://github.com/carbon-design-system/carbon-components-svelte/commit/6fbd8ae6a90eabde74fb5481c980716eba477c31)) - -### Features - -- **data-table:** support TypeScript generics ([#1954](https://github.com/carbon-design-system/carbon-components-svelte/issues/1954)) ([dd43224](https://github.com/carbon-design-system/carbon-components-svelte/commit/dd43224119905c3a26a2369f836338c18fcbafba)) - -### Bug Fixes - -- **data-table:** (Svelte 5 compatibility) handle `ToolbarSearch` filtering in `DataTable` ([#2037](https://github.com/carbon-design-system/carbon-components-svelte/issues/2037)) ([3192824](https://github.com/carbon-design-system/carbon-components-svelte/commit/3192824322faef7c0c012eb246bb6ef9da7f78dc)) -- **multi-select:** (Svelte 5 compatibility) avoid cyclic dependency ([#2034](https://github.com/carbon-design-system/carbon-components-svelte/issues/2034)) ([1acd713](https://github.com/carbon-design-system/carbon-components-svelte/commit/1acd7135372eeabf002dacc80e39162989427140)) -- **toolbar-menu:** (Svelte 5 compatibility) remove redundant menu offset ([#2047](https://github.com/carbon-design-system/carbon-components-svelte/issues/2047)) ([7e17394](https://github.com/carbon-design-system/carbon-components-svelte/commit/7e173943ac783756521c4957a1c24b5288ab45b7)), closes [#2040](https://github.com/carbon-design-system/carbon-components-svelte/issues/2040) -- **checkbox:** (Svelte 5 compatibility) bind `indeterminate` ([#2044](https://github.com/carbon-design-system/carbon-components-svelte/issues/2044)) ([9d5e7e3](https://github.com/carbon-design-system/carbon-components-svelte/commit/9d5e7e31efb2d439b18ba0bf350b712377e160a7)), closes [#2039](https://github.com/carbon-design-system/carbon-components-svelte/issues/2039) - -### [0.85.4](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.85.3...v0.85.4) (2024-11-09) - -### Bug Fixes - -- **combo-box:** fix types for `on:clear` ([#2020](https://github.com/carbon-design-system/carbon-components-svelte/issues/2020)) ([0831e87](https://github.com/carbon-design-system/carbon-components-svelte/commit/0831e871358fe012e9907699f1423b7e36dba0da)) -- **data-table:** fix `DataTableValue` type reference in `DataTable` ([#2023](https://github.com/carbon-design-system/carbon-components-svelte/issues/2023)) ([44daa77](https://github.com/carbon-design-system/carbon-components-svelte/commit/44daa775d5e4dc9aef66eae0e661f14fb5b41354)) -- **theme:** `Theme` correctly imports `toggle`, `select` props ([#2019](https://github.com/carbon-design-system/carbon-components-svelte/issues/2019)) ([49b5def](https://github.com/carbon-design-system/carbon-components-svelte/commit/49b5def8153f5eec523d56e2a2c6d4cc3a36dcb5)), closes [#2018](https://github.com/carbon-design-system/carbon-components-svelte/issues/2018) -- **toolbar-search:** fix types for `on:clear` ([#2022](https://github.com/carbon-design-system/carbon-components-svelte/issues/2022)) ([58e6021](https://github.com/carbon-design-system/carbon-components-svelte/commit/58e6021b08f311a5bb3cc7c7f181443cc633c8e4)) -- **types:** delete extraneous `icons/Search.svelte.d.ts` ([#2025](https://github.com/carbon-design-system/carbon-components-svelte/issues/2025)) ([951d686](https://github.com/carbon-design-system/carbon-components-svelte/commit/951d6860423fc05df9f46e29fb19916b89c48466)) -- **types:** fix types for `on:paste` event ([3167e44](https://github.com/carbon-design-system/carbon-components-svelte/commit/3167e449fdaf19abb4cdf1e2bf3f5bec24865f89)) - -### [0.85.3](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.85.2...v0.85.3) (2024-10-25) - -### Bug Fixes - -- address Svelte 5 warnings ([#2011](https://github.com/carbon-design-system/carbon-components-svelte/issues/2011)) ([43fccac](https://github.com/carbon-design-system/carbon-components-svelte/commit/43fccac1c6273d9aa83b8c26a5f8cecec667db59)) - -### [0.85.2](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.85.1...v0.85.2) (2024-08-14) - -### Bug Fixes - -- **header-action:** allow vertical scroll when expanded ([#1992](https://github.com/carbon-design-system/carbon-components-svelte/issues/1992)) ([61eceb0](https://github.com/carbon-design-system/carbon-components-svelte/commit/61eceb0caac20d92ce58c23d26908530a7e32dbe)) - -### [0.85.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.85.0...v0.85.1) (2024-08-09) - -### Bug Fixes - -- **multi-select:** fix `filterItem` return type ([#1972](https://github.com/carbon-design-system/carbon-components-svelte/issues/1972)) ([6140c3c](https://github.com/carbon-design-system/carbon-components-svelte/commit/6140c3c5a91a879889be33080e1aa8b9183982d4)) -- **search:** collapse expandable search if value is falsy ([#1987](https://github.com/carbon-design-system/carbon-components-svelte/issues/1987)) ([216d5a3](https://github.com/carbon-design-system/carbon-components-svelte/commit/216d5a39b14ddad600159c1159b6a2d38095cfaf)), closes [#1981](https://github.com/carbon-design-system/carbon-components-svelte/issues/1981) -- **text-area:** type `value` prop as nullable ([#1933](https://github.com/carbon-design-system/carbon-components-svelte/issues/1933)) ([47860ce](https://github.com/carbon-design-system/carbon-components-svelte/commit/47860ce1d7cc5f3b0363ab619dcfd74b3276eda7)) - -## [0.85.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.84.1...v0.85.0) (2024-03-23) - -### ⚠ BREAKING CHANGES - -- use `:global()` for custom UI Shell styles ([#1940](https://github.com/carbon-design-system/carbon-components-svelte/issues/1940)) ([d5a1148](https://github.com/carbon-design-system/carbon-components-svelte/commit/d5a11489f8ab9dc05751aa20c420ea4dc6249567)) - -### [0.84.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.84.0...v0.84.1) (2024-03-16) - -### Bug Fixes - -- **checkbox:** forward `on:focus`, `on:blur` to `Checkbox` and `InlineCheckbox` ([#1937](https://github.com/carbon-design-system/carbon-components-svelte/issues/1937)) ([6364b23](https://github.com/carbon-design-system/carbon-components-svelte/commit/6364b23030cc0761aa6a0561a1673e89dde47868)) -- **data-table:** loosen `sort` return type to be a `number` ([#1935](https://github.com/carbon-design-system/carbon-components-svelte/issues/1935)) ([9132bf8](https://github.com/carbon-design-system/carbon-components-svelte/commit/9132bf8e5a2d6ba70d17a0b4fcdea29d0785492c)), closes [#1934](https://github.com/carbon-design-system/carbon-components-svelte/issues/1934) - -### [0.84.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.83.0...v0.84.0) (2024-03-08) - -### Features - -- **ui-shell:** support button tooltip in `HeaderGlobalAction` ([#1894](https://github.com/carbon-design-system/carbon-components-svelte/issues/1894)) ([d8bc651](https://github.com/carbon-design-system/carbon-components-svelte/commit/d8bc65163eabacfee348d6248e90f683ac488aef)), closes [#1893](https://github.com/carbon-design-system/carbon-components-svelte/issues/1893) - -### Bug Fixes - -- **exports:** resolve imports with explicit \*.js extension ([#1927](https://github.com/carbon-design-system/carbon-components-svelte/issues/1927)) ([0405ede](https://github.com/carbon-design-system/carbon-components-svelte/commit/0405edee7d1696a157acab941488f8d3a750187f)), closes [#1925](https://github.com/carbon-design-system/carbon-components-svelte/issues/1925) - -## [0.83.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.11...v0.83.0) (2024-03-07) - -### ⚠ BREAKING CHANGES - -- **link:** do not render `p` for disabled link - -### Bug Fixes - -- avoid using reserved `$` for Svelte 5 compat ([a0d5028](https://github.com/carbon-design-system/carbon-components-svelte/commit/a0d5028540e1bcbb3b37bf488c11ea94f97b5fa7)) -- **link:** do not render `p` for disabled link ([8bffc17](https://github.com/carbon-design-system/carbon-components-svelte/commit/8bffc17d650144ed0d5b778766f79c33334f0275)), closes [#1924](https://github.com/carbon-design-system/carbon-components-svelte/issues/1924) -- **search:** hoist ignore `a11y autofocus` comment ([6152b78](https://github.com/carbon-design-system/carbon-components-svelte/commit/6152b784c1e6b19ff242524e6b0c8c98b0107788)) - -### [0.82.11](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.10...v0.82.11) (2024-02-26) - -### Bug Fixes - -- **code-snippet:** `showMoreLess={false}` should hide button ([4085536](https://github.com/carbon-design-system/carbon-components-svelte/commit/40855361891c2388c2b775803bcac937fbd6c1d6)), closes [#1536](https://github.com/carbon-design-system/carbon-components-svelte/issues/1536) -- **image-loader:** updated `src` should update the image ([0f318aa](https://github.com/carbon-design-system/carbon-components-svelte/commit/0f318aac7732c2b94ec0729d54416611fbd0d493)), closes [#1677](https://github.com/carbon-design-system/carbon-components-svelte/issues/1677) -- **overflow-menu:** use `offsetWidth`, `offsetHeight` to compute menu dimensions ([#1913](https://github.com/carbon-design-system/carbon-components-svelte/issues/1913)) ([2404244](https://github.com/carbon-design-system/carbon-components-svelte/commit/24042442213ca9daa0cf663aabf37b3544e9c364)) -- **toast-notification:** fire `on:clear` from timeout correctly ([9aabe3c](https://github.com/carbon-design-system/carbon-components-svelte/commit/9aabe3cbbb05712b71f5cad7c571b170c1f3a439)), closes [#1914](https://github.com/carbon-design-system/carbon-components-svelte/issues/1914) - -### [0.82.10](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.9...v0.82.10) (2024-02-12) - -### Bug Fixes - -- **slider:** dispatch `on:input` event ([#1906](https://github.com/carbon-design-system/carbon-components-svelte/issues/1906)) ([90dbd15](https://github.com/carbon-design-system/carbon-components-svelte/commit/90dbd1562b04df3cf4de28874b6e790ddca1db81)), closes [#1643](https://github.com/carbon-design-system/carbon-components-svelte/issues/1643) - -### [0.82.9](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.8...v0.82.9) (2024-02-07) - -### Bug Fixes - -- **context-menu:** prevent `on:contextmenu` default behavior only when opening menu ([#1911](https://github.com/carbon-design-system/carbon-components-svelte/issues/1911)) ([4ad522c](https://github.com/carbon-design-system/carbon-components-svelte/commit/4ad522c197d4a389a6187a499e9e54d5d8b3994a)), closes [#1909](https://github.com/carbon-design-system/carbon-components-svelte/issues/1909) -- **types:** improve `e.detail` type for dispatched events ([#1907](https://github.com/carbon-design-system/carbon-components-svelte/issues/1907)) ([6590457](https://github.com/carbon-design-system/carbon-components-svelte/commit/65904575743ba06344fb75e14685e42494c13cde)) - -### [0.82.8](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.7...v0.82.8) (2024-01-10) - -### Bug Fixes - -- **button:** forward `on:focus` event ([#1878](https://github.com/carbon-design-system/carbon-components-svelte/issues/1878)) ([5901872](https://github.com/carbon-design-system/carbon-components-svelte/commit/59018728df08db18ba85609e6db1c6dd8701d8bb)), closes [#1830](https://github.com/carbon-design-system/carbon-components-svelte/issues/1830) - -### [0.82.7](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.6...v0.82.7) (2023-12-17) - -### Bug Fixes - -- **radio-button:** allow `value` type to be a number ([#1868](https://github.com/carbon-design-system/carbon-components-svelte/issues/1868)) ([4792257](https://github.com/carbon-design-system/carbon-components-svelte/commit/479225711a1e304df74f0cfc585e32b5454afd66)) - -### [0.82.6](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.5...v0.82.6) (2023-12-17) - -### Bug Fixes - -- **package:** include types in exports map ([#1865](https://github.com/carbon-design-system/carbon-components-svelte/issues/1865)) ([053beee](https://github.com/carbon-design-system/carbon-components-svelte/commit/053beeef7cbb1031f09798ffc360f8c87d17e3e1)), closes [#1863](https://github.com/carbon-design-system/carbon-components-svelte/issues/1863) - -### [0.82.5](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.4...v0.82.5) (2023-12-16) - -### Bug Fixes - -- **header-search:** blur input when `active` is false ([#1857](https://github.com/carbon-design-system/carbon-components-svelte/issues/1857)) ([6c9cf9e](https://github.com/carbon-design-system/carbon-components-svelte/commit/6c9cf9e043b3c963a257a28fa8dd29c8acd4b2ce)) -- **package.json:** add `exports` field to package.json to address Vite development warnings ([#1864](https://github.com/carbon-design-system/carbon-components-svelte/issues/1864)) ([7bef3fa](https://github.com/carbon-design-system/carbon-components-svelte/commit/7bef3fae6250607337306e95440b8a472638476f)) - -### [0.82.4](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.3...v0.82.4) (2023-11-21) - -### Bug Fixes - -- **header-search:** blur input when deactivating ([#1855](https://github.com/carbon-design-system/carbon-components-svelte/issues/1855)) ([192f6a7](https://github.com/carbon-design-system/carbon-components-svelte/commit/192f6a775c2a7da25e7fc4893efdc5a80b83928c)) - -### [0.82.3](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.2...v0.82.3) (2023-11-21) - -### Bug Fixes - -- **header-search:** "Escape" should close empty search bar ([#1853](https://github.com/carbon-design-system/carbon-components-svelte/issues/1853)) ([e667352](https://github.com/carbon-design-system/carbon-components-svelte/commit/e667352329651c25dc2d283eaa6cc8ca872040f6)) - -### [0.82.2](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.1...v0.82.2) (2023-11-20) - -### Bug Fixes - -- **header-search:** "Escape" should clear search query ([#1851](https://github.com/carbon-design-system/carbon-components-svelte/issues/1851)) ([6da4572](https://github.com/carbon-design-system/carbon-components-svelte/commit/6da4572c2672e02a6463ee8374fd341868512034)) -- **header-search:** vertically center button icons ([#1850](https://github.com/carbon-design-system/carbon-components-svelte/issues/1850)) ([d68dc18](https://github.com/carbon-design-system/carbon-components-svelte/commit/d68dc182668dc0b56481d4646d672591cd7fc3e3)) - -### [0.82.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.82.0...v0.82.1) (2023-11-18) - -### Bug Fixes - -- **pagination-nav:** set `button type="button"` to prevent form submission ([#1846](https://github.com/carbon-design-system/carbon-components-svelte/issues/1846)) ([bed073c](https://github.com/carbon-design-system/carbon-components-svelte/commit/bed073c2f707392d3fe7d75fbf4550e723b93605)) - -### [0.82.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.81.3...v0.82.0) (2023-11-13) - -### Features - -- **tree-view:** add `showNode` accessor ([#1844](https://github.com/carbon-design-system/carbon-components-svelte/issues/1844)) ([1ad4e3d](https://github.com/carbon-design-system/carbon-components-svelte/commit/1ad4e3d3856e07fb1808f34b8c48dfc6a8a5e7d8)), closes [#1377](https://github.com/carbon-design-system/carbon-components-svelte/issues/1377) -- **tree-view:** make `node` slottable ([#1843](https://github.com/carbon-design-system/carbon-components-svelte/issues/1843)) ([6a55fef](https://github.com/carbon-design-system/carbon-components-svelte/commit/6a55fef62e095114a1782d1079501e9e940cca94)), closes [#1660](https://github.com/carbon-design-system/carbon-components-svelte/issues/1660) - -### [0.81.3](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.81.2...v0.81.3) (2023-11-08) - -### Bug Fixes - -- **select-item:** export `class` and `style` props ([#1840](https://github.com/carbon-design-system/carbon-components-svelte/issues/1840)) ([a9460e9](https://github.com/carbon-design-system/carbon-components-svelte/commit/a9460e944de9ae967664a75df842f4bdc909067f)), closes [#1839](https://github.com/carbon-design-system/carbon-components-svelte/issues/1839) - -### [0.81.2](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.81.1...v0.81.2) (2023-10-27) - -### Bug Fixes - -- **multi-select:** render checkboxes for form data ([#1835](https://github.com/carbon-design-system/carbon-components-svelte/issues/1835)) ([7ba52df](https://github.com/carbon-design-system/carbon-components-svelte/commit/7ba52df3a1ee89b06377a0b4888cce27cc89196f)), closes [#1742](https://github.com/carbon-design-system/carbon-components-svelte/issues/1742) - -### [0.81.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.81.0...v0.81.1) (2023-10-23) - -### Bug Fixes - -- **multi-select:** reset `selectedIds` when clearing selection ([#1832](https://github.com/carbon-design-system/carbon-components-svelte/issues/1832)) ([e3ab471](https://github.com/carbon-design-system/carbon-components-svelte/commit/e3ab471018b9ac94ff9de2284284dc61ba69c881)), closes [#1831](https://github.com/carbon-design-system/carbon-components-svelte/issues/1831) - -### [0.81.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.80.0...v0.81.0) (2023-10-13) - -### Features - -- **data-table:** pass `row` to `display` function ([#1810](https://github.com/carbon-design-system/carbon-components-svelte/issues/1810)) ([9456eaa](https://github.com/carbon-design-system/carbon-components-svelte/commit/9456eaab3ce5259d8f6dcaa7b3db9058d3555aa6)) -- **deps-dev:** upgrade `carbon-components` to 10.58 ([#1828](https://github.com/carbon-design-system/carbon-components-svelte/issues/1828)) ([519bd86](https://github.com/carbon-design-system/carbon-components-svelte/commit/519bd8616a4fe16af4befb6a1159e62f42d9651c)) - -### Bug Fixes - -- **file-uploader-button:** clear value by setting to `""` instead of `null` ([#1812](https://github.com/carbon-design-system/carbon-components-svelte/issues/1812)) ([108eb52](https://github.com/carbon-design-system/carbon-components-svelte/commit/108eb5286c46bd17a54ccbda31ee95f16a16763e)) -- **radio-button-group:** add `name` and `required` props ([#1037](https://github.com/carbon-design-system/carbon-components-svelte/issues/1037)) ([24e2a88](https://github.com/carbon-design-system/carbon-components-svelte/commit/24e2a8874f5d0c39f88761c3f118ba71aab27c1d)), closes [#1036](https://github.com/carbon-design-system/carbon-components-svelte/issues/1036) -- **radio-button-group:** strongly type dispatched change/select events ([#1819](https://github.com/carbon-design-system/carbon-components-svelte/issues/1819)) ([06d81dd](https://github.com/carbon-design-system/carbon-components-svelte/commit/06d81ddbff8a6170d34ca1e94a41c16d318ec7ca)) -- **tile-group:** add `name` and `required` props ([#1818](https://github.com/carbon-design-system/carbon-components-svelte/issues/1818)) ([836b360](https://github.com/carbon-design-system/carbon-components-svelte/commit/836b360b9b7402cb3cd44489fd5f14b8c901f9f2)) - -### [0.80.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.79.0...v0.80.0) (2023-08-26) - -### Features - -- **ui-shell:** forward `click` event to `HeaderActionLink` ([#1797](https://github.com/carbon-design-system/carbon-components-svelte/issues/1797)) ([e5675eb](https://github.com/carbon-design-system/carbon-components-svelte/commit/e5675eb203db51de736b24f41694f5b020f9aafc)), closes [#1796](https://github.com/carbon-design-system/carbon-components-svelte/issues/1796) - -### Bug Fixes - -- **skeleton-text:** fix reactivity in `paragraph` variant ([#1794](https://github.com/carbon-design-system/carbon-components-svelte/issues/1794)) ([bc97ce5](https://github.com/carbon-design-system/carbon-components-svelte/commit/bc97ce5e1b69669d17f3ad13aaeb774b05c09c80)), closes [#1793](https://github.com/carbon-design-system/carbon-components-svelte/issues/1793) - -## [0.79.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.78.0...v0.79.0) (2023-07-24) - -### ⚠ BREAKING CHANGES - -- **loading:** remove `id` prop from `Loading` (#1783) - -### Features - -- **file-uploader-button:** support `danger-tertiary`, `danger-ghost` button variants ([#1784](https://github.com/carbon-design-system/carbon-components-svelte/issues/1784)) ([709322c](https://github.com/carbon-design-system/carbon-components-svelte/commit/709322c2819e3123ade4a13e3fd7d05035154d6b)) -- **file-uploader:** add `size` prop to `FileUploaderButton` ([#1786](https://github.com/carbon-design-system/carbon-components-svelte/issues/1786)) ([51c281d](https://github.com/carbon-design-system/carbon-components-svelte/commit/51c281de4a29b99e61952959a8cbfdba0b49e786)) -- **file-uploader:** make `labelTitle`, `labelDescription` slottable ([#1780](https://github.com/carbon-design-system/carbon-components-svelte/issues/1780)) ([239f1b1](https://github.com/carbon-design-system/carbon-components-svelte/commit/239f1b10e562507f66e3cd318084ed1de30f0c25)) -- **slider:** add `hideLabel` prop ([#1777](https://github.com/carbon-design-system/carbon-components-svelte/issues/1777)) ([baff07e](https://github.com/carbon-design-system/carbon-components-svelte/commit/baff07e012b43e1a24b2e574a57509f711a463f6)), closes [#1682](https://github.com/carbon-design-system/carbon-components-svelte/issues/1682) - -### Bug Fixes - -- **file-uploader:** do not render empty element if `labelTitle`, `labelDescription` not provided ([#1778](https://github.com/carbon-design-system/carbon-components-svelte/issues/1778)) ([7ef8b73](https://github.com/carbon-design-system/carbon-components-svelte/commit/7ef8b73252709130c8e269b83b2936e1631c96fa)), closes [#1775](https://github.com/carbon-design-system/carbon-components-svelte/issues/1775) -- **loading:** remove redundant `description` label ([#1783](https://github.com/carbon-design-system/carbon-components-svelte/issues/1783)) ([d6804b4](https://github.com/carbon-design-system/carbon-components-svelte/commit/d6804b44fea0d4fc23574e63e7d4c64fa18e8f42)), closes [#1670](https://github.com/carbon-design-system/carbon-components-svelte/issues/1670) -- **types:** correctly type `kind` prop in `FileUploader`, `FileUploaderButton` ([#1781](https://github.com/carbon-design-system/carbon-components-svelte/issues/1781)) ([a7443c2](https://github.com/carbon-design-system/carbon-components-svelte/commit/a7443c2dca396f79e06fed695374c0a15bda14ed)) -- **types:** improve formatting of prop comments ([#1779](https://github.com/carbon-design-system/carbon-components-svelte/issues/1779)) ([be76370](https://github.com/carbon-design-system/carbon-components-svelte/commit/be763706ca7ab0182bc0f8171e74043ccbadf461)) - -## [0.78.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.77.0...v0.78.0) (2023-07-19) - -### ⚠ BREAKING CHANGES - -- **typescript:** minimum Svelte version for TypeScript users is 3.55 - -### Features - -- **typescript:** support svelte 4 ([#1773](https://github.com/carbon-design-system/carbon-components-svelte/issues/1773)) ([2f026f7](https://github.com/carbon-design-system/carbon-components-svelte/commit/2f026f792ad94f468b890a6d5ab36cc2642dacf2)), closes [#1753](https://github.com/carbon-design-system/carbon-components-svelte/issues/1753) - -## [0.77.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.76.1...v0.77.0) (2023-07-13) - -### Features - -- **ui-shell:** add `preventCloseOnClickOutside` to `HeaderAction` ([#1625](https://github.com/carbon-design-system/carbon-components-svelte/issues/1625)) ([ea9b261](https://github.com/carbon-design-system/carbon-components-svelte/commit/ea9b261b60698f9314e0aae4d61025bae215cccf)), closes [#1624](https://github.com/carbon-design-system/carbon-components-svelte/issues/1624) -- **ui-shell:** make `company` in `Header` slottable ([#1764](https://github.com/carbon-design-system/carbon-components-svelte/issues/1764)) ([9b3f014](https://github.com/carbon-design-system/carbon-components-svelte/commit/9b3f014a0ba43abb5a36be4a6156910b5d7644d7)) - -### [0.76.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.76.0...v0.76.1) (2023-07-08) - -### Bug Fixes - -- **date-picker:** hide `helperText` if invalid or warning state ([#1759](https://github.com/carbon-design-system/carbon-components-svelte/issues/1759)) ([d5a4a8b](https://github.com/carbon-design-system/carbon-components-svelte/commit/d5a4a8b94a8753545a54f7e43f1773e49a1ff208)) -- **select:** hide `helperText` if invalid or warning state ([#1761](https://github.com/carbon-design-system/carbon-components-svelte/issues/1761)) ([7579c03](https://github.com/carbon-design-system/carbon-components-svelte/commit/7579c032faa3f1b9ad9d42f76da876f38725141e)) -- **slider:** `disabled` Slider should not submit a form ([#1758](https://github.com/carbon-design-system/carbon-components-svelte/issues/1758)) ([ab21c89](https://github.com/carbon-design-system/carbon-components-svelte/commit/ab21c89ab9240f61bd15d8c20bad65b3b469a29c)) -- **types:** allow `data-*` attributes for props forwarded to HTML elements ([#1741](https://github.com/carbon-design-system/carbon-components-svelte/issues/1741)) ([7fdc2ef](https://github.com/carbon-design-system/carbon-components-svelte/commit/7fdc2ef7f072382842cbb6bfc8e12e083aef1a1e)) - -### [0.76.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.75.1...v0.75.2) (2023-06-21) - -### Features - -- make `titleText` slottable in `MultiSelect`, `ComboBox` ([#1750](https://github.com/carbon-design-system/carbon-components-svelte/issues/1750)) ([0b4f19c](https://github.com/carbon-design-system/carbon-components-svelte/commit/0b4f19c87e8479f0649fa2c5dc84beb4c1a1e302)), closes [#1747](https://github.com/carbon-design-system/carbon-components-svelte/issues/1747) - -### [0.75.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.75.0...v0.75.1) (2023-06-02) - -### Bug Fixes - -- **expandable-tile:** set tile height using resize observer ([#1738](https://github.com/carbon-design-system/carbon-components-svelte/issues/1738)) ([a369962](https://github.com/carbon-design-system/carbon-components-svelte/commit/a369962fdf96f95bbdcc2f8f9f84c5d900ec4087)) - -### [0.75.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.74.0...v0.74.1) (2023-05-21) - -### Features - -- **pagination-nav:** add `tooltipPosition` prop ([#1733](https://github.com/carbon-design-system/carbon-components-svelte/issues/1733)) ([60a796e](https://github.com/carbon-design-system/carbon-components-svelte/commit/60a796ea48b17a4e8829b8782aaddb569534c7c4)), closes [#1656](https://github.com/carbon-design-system/carbon-components-svelte/issues/1656) - -### [0.74.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.73.5...v0.74.0) (2023-05-18) - -### Features - -- **ui-shell:** make `HeaderNavItem` slottable ([#1693](https://github.com/carbon-design-system/carbon-components-svelte/issues/1693)) ([b9aaa3a](https://github.com/carbon-design-system/carbon-components-svelte/commit/b9aaa3adcaf87e34ac3d45a2e39f1db92ebe1b33)) - -### Bug Fixes - -- resolve `a11y` warnings from Svelte version 3.58 ([#1732](https://github.com/carbon-design-system/carbon-components-svelte/issues/1732)) ([c02b473](https://github.com/carbon-design-system/carbon-components-svelte/commit/c02b4738bce612359148267c79450c6650bf68d3)) - -### [0.73.5](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.73.4...v0.73.5) (2023-03-26) - -### [0.73.4](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.73.3...v0.73.4) (2023-03-21) - -### Bug Fixes - -- **selectable-tile:** include dispatched events in types ([#1695](https://github.com/carbon-design-system/carbon-components-svelte/issues/1695)) ([ca40dd1](https://github.com/carbon-design-system/carbon-components-svelte/commit/ca40dd18c2af1bc755b857c39469427038f20ece)), closes [#1694](https://github.com/carbon-design-system/carbon-components-svelte/issues/1694) -- **text-input:** correctly set input padding for warning state ([#1688](https://github.com/carbon-design-system/carbon-components-svelte/issues/1688)) ([821233a](https://github.com/carbon-design-system/carbon-components-svelte/commit/821233ab4f0bf247dea6a8aa32b79d15424ff059)), closes [#1687](https://github.com/carbon-design-system/carbon-components-svelte/issues/1687) - -### [0.73.3](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.73.2...v0.73.3) (2023-03-11) - -### Bug Fixes - -- **1684:** hide helper text container in password input when not used ([#1685](https://github.com/carbon-design-system/carbon-components-svelte/issues/1685)) ([42349eb](https://github.com/carbon-design-system/carbon-components-svelte/commit/42349ebc61fdc8756fc5209d4cb63f4f9a63dce9)) - -### [0.73.2](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.73.1...v0.73.2) (2023-02-27) - -### Bug Fixes - -- `readonly` should override `error` behavior in `TextInput`, `NumberInput` ([#1666](https://github.com/carbon-design-system/carbon-components-svelte/issues/1666)) ([6386c33](https://github.com/carbon-design-system/carbon-components-svelte/commit/6386c33f939b5fa310e8eb5a51412c6151de75d2)), closes [/github.com/carbon-design-system/carbon-components-svelte/pull/1666#pullrequestreview-1314558645](https://github.com/carbon-design-system//github.com/carbon-design-system/carbon-components-svelte/pull/1666/issues/pullrequestreview-1314558645) - -### [0.73.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.73.0...v0.73.1) (2023-02-19) - -### Bug Fixes - -- **textinput/passwordinput:** apply aria-describedby to hint text ([b435be4](https://github.com/carbon-design-system/carbon-components-svelte/commit/b435be4f1221b30c9afd7a9e1c6867b38eeadeaa)), closes [#1633](https://github.com/carbon-design-system/carbon-components-svelte/issues/1633) - -### [0.73.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.72.3...v0.73.0) (2023-02-19) - -### Features - -- **progress-bar:** add `status` prop ([#1560](https://github.com/carbon-design-system/carbon-components-svelte/issues/1560)) ([7ddbf17](https://github.com/carbon-design-system/carbon-components-svelte/commit/7ddbf17cbb82bd78256037af8028ea20b9c35d5a)) - -### [0.72.3](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.72.2...v0.72.3) (2023-02-11) - -### Bug Fixes - -- **types:** add missing `$$restProps` for `Checkbox`, `Filename`, `FluidForm` ([#1655](https://github.com/carbon-design-system/carbon-components-svelte/issues/1655)) ([6450e8b](https://github.com/carbon-design-system/carbon-components-svelte/commit/6450e8b0b17e1538043f131d64e2d1fc667c95a8)) - -### [0.72.2](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.72.1...v0.72.2) (2023-02-05) - -### Bug Fixes - -- **dropdown:** dispatch correct `selectedItem` in `select` event ([#1646](https://github.com/carbon-design-system/carbon-components-svelte/issues/1646)) ([d897484](https://github.com/carbon-design-system/carbon-components-svelte/commit/d897484abfcc8be351ac87b0f0bb49900f4b4b1d)), closes [#1645](https://github.com/carbon-design-system/carbon-components-svelte/issues/1645) - -### [0.72.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.72.0...v0.72.1) (2023-01-25) - -### Bug Fixes - -- **dropdown:** fix ssr issue ([#1639](https://github.com/carbon-design-system/carbon-components-svelte/issues/1639)) ([8cb5d53](https://github.com/carbon-design-system/carbon-components-svelte/commit/8cb5d538f7ad10d7c93e10c04f01d2c77b4eba44)), closes [#1638](https://github.com/carbon-design-system/carbon-components-svelte/issues/1638) - -## [0.72.0](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.71.0...v0.72.0) (2023-01-18) - -### ⚠ BREAKING CHANGES - -- **tree-view:** remove `expanded` property from `TreeNode` interface (#1631) - -### Bug Fixes - -- **dropdown:** close when user clicks outside iframe ([#1596](https://github.com/carbon-design-system/carbon-components-svelte/issues/1596)) ([73aa6e2](https://github.com/carbon-design-system/carbon-components-svelte/commit/73aa6e216aa99df3b0b3186398e6466db523cf88)), closes [#1595](https://github.com/carbon-design-system/carbon-components-svelte/issues/1595) -- **tree-view:** remove `expanded` property from `TreeNode` interface ([#1631](https://github.com/carbon-design-system/carbon-components-svelte/issues/1631)) ([ec867c4](https://github.com/carbon-design-system/carbon-components-svelte/commit/ec867c46ba7adce02938d6516557d3312591fa5f)), closes [#1630](https://github.com/carbon-design-system/carbon-components-svelte/issues/1630) - -## [0.71.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.71.0) - 2022-12-31 - -**Breaking Changes** - -- `Select`: rename dispatched `change` event to `update` -- `Select`: forward `change` event -- `PaginationNav`: use 1-indexing to be consistent with `Pagination` -- `InlineNotification`: remove `iconDescription` prop (replaced with `closeButtonDescription` and `statusIconDescription`) - -**Features** - -- `Pagination`: dispatch `change` event when user interacts with previous/next buttons, or page/page size dropdowns -- `InlineNotification`: add `iconDescription` and `closeButtonDescription` props - -**Documentation** - -- link 'source code' to folder for multiple components -- `PaginationNav`: add description for `change` event - -## [0.70.13](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.13) - 2022-12-08 - -**Fixes** - -- support `NumberInput` incrementing/decrementing floating point values -- allow arrow keys to open and navigate `Dropdown` menu -- only fire `Dropdown` "select" event on interaction -- avoid runtime error if `Dropdown` items is an empty array -- avoid runtime error if `MultiSelect` items is an empty array -- avoid runtime error if `ComboBox` items is an empty array -- fire `OverflowMenu` "close" event when clicking outside menu -- fire `Popover` "click:outside" event when clicking sibling elements -- forward `Toggle` "change" and "keyup" events after `toggled` updates -- fix `ProgressStep` label text if `vertical` -- make `ProgressStep` inherit unclickable styles if `preventChangeOnClick` -- add explicit `type="button"` to `TableHeader` button -- add explicit `type="button"` to `ProgressStep` button -- loosen `TreeView` text prop type from `string` to `any` -- make `TreeView` children prop type work recursively -- remove unused `derived` import from `DataTable` - -## [0.70.12](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.12) - 2022-10-13 - -**Fixes** - -- `Search` prop types should extend `input` attributes - -## [0.70.11](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.11) - 2022-10-13 - -**Fixes** - -- ignore false positive a11y warnings from Svelte version 3.51 -- `NumberInput` with `allowInput` should not be invalid if `value` is `null` - -## [0.70.10](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.10) - 2022-10-04 - -**Fixes** - -- avoid element reference error in `ListBoxMenuItem` -- display warn/invalid icons in `DatePickerInput` with calendar -- fix layout regression in `HeaderSearch` -- localize `HeaderAction`, `ImageLoader` transitions - -## [0.70.9](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.9) - 2022-09-23 - -**Fixes** - -- fix visual regression in next/previous buttons in `Pagination`, `PaginationNav` - -## [0.70.8](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.8) - 2022-09-21 - -**Fixes** - -- forward keyup, keydown, paste events in `ToolbarSearch` to `Search` - -## [0.70.7](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.7) - 2022-09-17 - -**Fixes** - -- prevent `submit` event on `Modal` if primary button is disabled - -## [0.70.6](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.6) - 2022-09-05 - -**Fixes** - -- resolve `Toggle`, `HeaderSearch` accessibility warnings in Svelte >=v3.50 - -## [0.70.5](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.5) - 2022-09-02 - -**Fixes** - -- avoid left margin style if `Button` is icon-only - -## [0.70.4](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.4) - 2022-08-31 - -**Fixes** - -- correctly scroll item into view when keyboard navigating `Dropdown`, `ComboBox`, `MultiSelect` - -## [0.70.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.3) - 2022-08-31 - -**Fixes** - -- close menu in `Dropdown`, `MultiSelect` when pressing "Escape" -- prevent default behavior in `ComboBox` when pressing "Enter," "ArrowUp," or "ArrowDown" -- scroll item into view when keyboard navigating `Dropdown`, `ComboBox`, `MultiSelect` - -## [0.70.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.2) - 2022-08-29 - -**Fixes** - -- allow `$$restProps.style` to be correctly set on `Content` - -## [0.70.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.1) - 2022-08-23 - -**Fixes** - -- do not unset `Content` left margin for rail `SideNav` -- set `role`, `aria-label` attributes on `DatePicker` calendar container - -## [0.70.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.70.0) - 2022-08-18 - -**Features** - -- add `filteredRowIds` prop to `ToolbarSearch` to support pagination - -## [0.69.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.69.0) - 2022-08-17 - -**Features** - -- dispatch `on:click:header--select` event in `DataTable` -- dispatch `on:click:row--select` event in `DataTable` - -## [0.68.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.68.0) - 2022-08-15 - -**Features** - -- add `fullWidth` prop to `ToastNotification` -- dispatch cancelable `on:cancel` event in `ToolbarBatchActions` -- add `active` prop to `ToolbarBatchActions` - -**Documentation** - -- add `ToastNotification` example "Full width" -- add `DataTable` example "Batch selection with controlled toolbar" - -## [0.67.9](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.67.9) - 2022-08-11 - -**Fixes** - -- `NotificationActionButton` types should extend `Button` props - -## [0.67.8](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.67.8) - 2022-08-10 - -**Fixes** - -- remove `aria-checked="mixed"` if `InlineCheckbox` is indeterminate -- add `aria-labelledby` to `Slider` thumb -- add `role="switch"` to `Toggle` input - -## [0.67.7](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.67.7) - 2022-08-07 - -**Fixes** - -- remove UI Shell `Content` left margin if `SideNav` is collapsed - -## [0.67.6](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.67.6) - 2022-08-05 - -**Refactor** - -- use class directive in `TextInput`, `DatePickerInput` - -**Fixes** - -- avoid dynamic class names in `NotificationButton`, `NotificationIcon` -- forward keydown, keyup events to `NumberInput` - -## [0.67.5](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.67.5) - 2022-08-04 - -**Fixes** - -- correctly select a `ComboBox` item when pressing "Enter" - -## [0.67.4](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.67.4) - 2022-07-26 - -**Fixes** - -- override `Toggle` margin-top style if `hideLabel` is true - -## [0.67.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.67.3) - 2022-07-26 - -**Fixes** - -- correctly pluralize `Pagination` items display text -- prevent label text selection in `Toggle` -- add missing `hideLabel` prop to `Toggle` - -## [0.67.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.67.2) - 2022-07-23 - -**Fixes** - -- display correct `ComboBox` value if using `itemToString` and `shouldFilterItem` props - -## [0.67.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.67.1) - 2022-07-12 - -**Fixes** - -- set a high `z-index` on the `SideNav` overlay to avoid it being covered by other elements - -## [0.67.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.67.0) - 2022-06-29 - -**Breaking Changes** - -Svelte version >=3.48.0 is required. - -- re-revert [924b6d35](924b6d352eebf5c82da63f0ead450dc59e80ca30) to allow close event in `ToastNotification`, `InlineNotification` to be cancellable - -## [0.66.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.66.3) - 2022-06-29 - -**Fixes** - -- revert [924b6d35](924b6d352eebf5c82da63f0ead450dc59e80ca30) and re-publish since v0.66.2 contains breaking changes - -## [0.66.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.66.2) - 2022-06-29 - -**Fixes** - -- allow close event in `ToastNotification`, `InlineNotification` to be cancellable - -**Documentation** - -- add `ToastNotification` example "Prevent default close behavior" -- add `InlineNotification` example "Prevent default close behavior" - -## [0.66.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.66.1) - 2022-06-27 - -**Fixes** - -- support `PasswordInput` invalid state when used in a `FluidForm` -- remove title attribute from `SideNavMenu` icon -- remove tabindex attribute from `SideNavMenu` icon -- override max-height in an expanded `SideNavMenu` -- fix `ComposedModal` type error where the focus node is possibly `null` - -**Refactor** - -- pass required `text` prop from `CodeSnippet` to `CopyButton` to prevent development warning - -**Documentation** - -- add `PasswordInput` example "Invalid state" -- rename `ComboBox` example "Selected id" to "Initial selected id" -- revise `DatePicker` example "DatePicker in a modal" to prevent iframe from stealing focus - -## [0.66.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.66.0) - 2022-06-18 - -**Features** - -- add `fullWidth` prop to `Slider` -- support number type for `selected` prop in `Select` - -**Fixes** - -- only dispatch "change" in `Select` if `selected` value has changed -- use first `SelectItem` value as default `selected` value in `Select` if `undefined` - -**Documentation** - -- add `Slider` example "Full width" -- revise `Select` example "Default" to demo usage without `selected` prop - -## [0.65.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.65.3) - 2022-06-15 - -**Fixes** - -- fix `TreeView` type error when keyboard navigating an expanded node - -## [0.65.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.65.2) - 2022-06-12 - -**Fixes** - -- `DataTable` header keys should be reactive -- use native binding for value prop in `TimePicker` -- use native binding for value prop in `ComboBox`, `MultiSelect` - -## [0.65.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.65.1) - 2022-06-09 - -**Fixes** - -- `DataTable` column sort direction order should be independent - -## [0.65.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.65.0) - 2022-06-07 - -**Breaking Changes** - -- mark array-type props as read-only - -**Features** - -- add `sortKey`, `sortDirection` props to `DataTable` for programmatic sorting -- forward `paste` event to `ComboBox`, `DatePicker`, `MultiSelect`, `NumberInput`, `Search`, `TextArea`, `TextInput`, `PasswordInput`, `TimePicker`, `HeaderSearch` -- support disabled items in `Dropdown`, `MultiSelect`, `ComboBox` - -**Fixes** - -- do not overwrite `cells` property in `rows` object in `DataTable` -- correctly toggle the body class if using nested modals -- remove useless `inline` prop from `Dropdown` -- remove redundant `Dropdown` list box role and id -- add missing `role="option"` and `aria-selected` attributes to `ListBoxMenuItem` - -**Refactor** - -- set alert `Modal` attributes in markup instead of script - -**Documentation** - -- add `DataTable` example "Programmatic sorting" -- add `Modal` example "Has scrolling content" -- add `Modal` example "Custom focus" -- add `Dropdown` example "Disabled items" -- add `MultiSelect` example "Disabled items" -- add `ComboBox` example "Disabled items" - -## [0.64.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.64.3) - 2022-05-29 - -**Fixes** - -- active tab in `Tabs` should not steal focus if programmatically selected -- set title attribute in `CheckBox`, `MultiSelect`, `Dropdown`, `ComboBox` if label is truncated - -**Refactor** - -- refactor components to use `class:` directive instead of the class attribute - -**Documentation** - -- add `Tabs` example "Disabled tabs" - -## [0.64.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.64.2) - 2022-05-25 - -**Fixes** - -- apply custom `DataTable` widths to empty columns - -## [0.64.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.64.1) - 2022-05-23 - -**Fixes** - -- mark `CopyButton` text prop as required -- mark `Dropdown` selectedId prop as required -- use `@see` tag in `Theme` tokens prop description -- remove `title` attribute from `Modal`, `ModalHeader` close button -- remove redundant `aria-label` from `Modal` close button icon -- add `aria-hidden="true"` to `Modal`, `ModalHeader` close button icon - -**Documentation** - -- update `Theme` docs to specify that it must be used with `all.css` -- update `DataTable` docs to note that custom widths do not work with `stickyHeader` - -## [0.64.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.64.0) - 2022-05-14 - -**Breaking Changes** - -- set `flatpickrProps.static` in `DatePicker` to be true by default -- use data attribute instead of id for `DataTable` headers/rows - -**Features** - -- support custom column widths in `DataTable` -- dispatch "expand" and "collapse" events in `CodeSnippet` - -**Fixes** - -- use `@see` tag for flatpickr options link in `DatePicker` -- pressing "Enter" in `DatePicker` should update the value -- dispatched event type without detail should be `null`, not `any` -- type missing "open" event in `HeaderAction` -- use small button in multi-line `CodeSnippet` - -**Documentation** - -- make calendar variants of `DatePicker` more prominent -- add `DataTable` example "Custom column widths" -- add `CodeSnippet` examples "Expanded by default" and "Reactive example" - -## [0.63.8](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.63.8) - 2022-05-07 - -**Fixes** - -- elevate `Toolbar` z-index so overflow menu is not clipped by the table - -## [0.63.7](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.63.7) - 2022-05-04 - -**Fixes** - -- strongly type `translateWithId` prop in `Dropdown` - -## [0.63.6](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.63.6) - 2022-05-04 - -**Fixes** - -- add `translateWithIdsSelection` prop to `ComboBox`, `MultiSelect` to customize clear selection description -- use default values in `ListBoxMenuIcon` if `translateWithIds` is undefined -- use default values in `ListBoxSelection` if `translateWithIds` is undefined - -## [0.63.5](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.63.5) - 2022-05-02 - -**Fixes** - -- dispatch "change" event in `Tabs` only if selected index has changed - -## [0.63.4](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.63.4) - 2022-04-30 - -**Fixes** - -- add missing `"2x3"` ratio value to `AspectRatio` -- fix typo in `ToolbarSearch` shouldFilterRows type annotation - -**Documentation** - -- correctly generate icon, action imports in examples -- remove unnecessary `tooltipBodyId` in `Tooltip` examples -- add `DataTable` "Expandable and selectable" example -- add `DataTable` "Batch selection" example - -## [0.63.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.63.3) - 2022-04-28 - -**Fixes** - -- fix `FileUploaderItem` regression where `delete` event should be dispatched if status is "edit" - -**Documentation** - -- add `FileUploader` "Item (edit)" example -- revise `FileUploader` "Item (edit status, invalid state)" example to include `on:delete` usage -- add `FileUploader` "Item (edit status, invalid state with subject, body)" example - -## [0.63.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.63.2) - 2022-04-23 - -**Fixes** - -- set `type="button"` on `Dropdown` to fix usage in a form -- re-focus search bar when clearing `ToolbarSearch` value - -## [0.63.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.63.1) - 2022-04-18 - -**Fixes** - -- `HeaderGlobalAction` icon size should be `20` by default -- fix `rows` reactivity in `DataTable` - -## [0.63.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.63.0) - 2022-04-17 - -**Breaking Changes** - -- remove deprecated components: `Icon`, `IconSkeleton`, `NotificationTextDetails`, `ToggleSmall`, `ToggleSmallSkeleton`, `HeaderActionSearch` -- remove deprecated component props -- remove `optimizeCarbonImports` preprocessor -- remove `GlobalHeader` and `SideNav` subfolders -- move `truncate` action from `actions` to `src/Truncate` - -**Features** - -- add `breakpointObserver`, `breakpoints` to base exports -- add `ProgressBar` `kind` prop to support inline, indented variants - -**Fixes** - -- add explicit `type="button"` attribute to interactive, filterable tag variants -- add TypeScript support for `sveltekit:` attributes for anchor elements -- `Link` types should extend `a` or `p` attributes -- prevent selectable `DataTable` with sticky header from jumping - -**Refactor** - -- use icons from `carbon-icons-svelte` v11 - -**Documentation** - -- add `DataTable` "Sticky header" example -- refactor `Grid` examples -- add note to `UIShell` that theming is not supported -- add `ProgressBar` examples "Inline variant" and "Indented variant" - -**Housekeeping** - -- upgrade `carbon-components` to v10.56.0 - -## [0.62.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.62.3) - 2022-03-26 - -**Fixes** - -- fix `TreeView` filter logic in expandNodes/collapseNodes -- correctly render slotted label in `NumberInput` -- only render expandable `DataTable` row content when expanded - -## [0.62.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.62.2) - 2022-03-23 - -**Fixes** - -- `DataTable` expandable variant should work with zebra styles -- `DatePicker` `flatpickrProps` should override default `flatpickr` options - -**Documentation** - -- add `DataTable` "Expandable (zebra styles)" example - -## [0.62.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.62.1) - 2022-03-20 - -**Fixes** - -- fix `ToolbarSearch` standalone usage where "DataTable" context can be undefined - -## [0.62.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.62.0) - 2022-03-19 - -**Breaking Changes** - -- remove `Copy` component -- do not prevent default submit behavior in `Form` - -**Features** - -- add `shouldFilterRows` prop to `ToolbarSearch` to support auto-filterable `DataTable` rows -- make `SideNavLink` text slottable -- make `icon` prop slottable in `ContextMenuOption`, `Link`, `Tag`, `HeaderAction`, `HeaderActionLink`, `SideNavLink`, `SideNavMenu` -- make `MultiSelect` slottable -- make `Dropdown` slottable -- make `ComboBox` slottable - -**Fixes** - -- stop click propagation on `HeaderAction` button - -**Refactor** - -- inline `Copy` component in `CopyButton`, `CodeSnippet` -- use native `bind:value` in `Search` -- use native `bind:value` in `TextArea` - -**Documentation** - -- add `DataTable` "Filterable" and "Filterable (custom)" examples -- add `MultiSelect` "Custom slot" example -- add `Dropdown` "Custom slot" example -- add `ComboBox` "Custom slot" example -- add note that `items` object in `ComboBox`, `Dropdown`, `MultiSelect` requires a unique `id` -- add `ClickableTile` "Prevent default behavior" example -- add `Form` "Prevent default behavior" example -- fix broken link in `Checkbox` docs - -## [0.61.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.61.1) - 2022-03-13 - -**Fixes** - -- do not generate CSS file from `css/_popover.scss` - -## [0.61.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.61.0) - 2022-03-13 - -**Breaking Changes** - -- remove `HeaderActionSlideTransition` interface from `HeaderAction`; type transition prop as `SlideParams` -- rename `Breakpoint` "on:match" event to "on:change" -- move `Breakpoint` breakpoints to `carbon-components-svelte/src/Breakpoint/breakpoints` - -**Features** - -- support `DataTable` non-selectable rows -- expose `MultiSelect` highlightedId as a prop -- add `breakpointObserver` store as an alternative to `Breakpoint` - -**Fixes** - -- audit `HeaderAction` text styles -- visually align `HeaderActionLink` icon with `HeaderAction` icon -- fix `MultiSelect` filterable selection error -- correctly type `FileUploaderDropContainer` validateFiles prop -- inline `Popover` SCSS from `carbon-components@10.47` - -**Refactor** - -- remove usage of deprecated `Icon` component -- use direct component imports where possible - -**Documentation** - -- add `DataTable` "Non-selectable rows" example -- add `OverflowMenu` "Disabled items" example -- add `Breakpoint` "Store and Breakpoint Values" example - -## [0.60.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.60.0) - 2022-02-26 - -**Features** - -- add `RadioButtonGroup` `hiddenLegend` prop to visually hide the legend -- add `ProgressBar` `size` prop to support small size variant - -**Fixes** - -- update `DatePicker` calendar instance if options change - -**Refactor** - -- remove `StructuredList` `overflow-y` style monkey patch - -**Documentation** - -- add `RadioButton` "Hidden legend" example -- add `ProgressBar` "Small size" example - -**Housekeeping** - -- upgrade `carbon-components` to v10.54.0 - -## [0.59.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.59.0) - 2022-02-21 - -**Features** - -- add `maxCount` prop to `TextArea` -- add `disabled` prop to `FileUploader` -- add `files` prop to `FileUploaderDropContainer` -- add `files` prop to `FileUploaderButton` - -**Fixes** - -- change `add`, `change` events in `FileUploaderDropContainer` to dispatch `File[]` instead of `FileList` -- update `files` prop description in `FileUploader` - -**Documentation** - -- add `TextArea` "Maximum character count" example -- add `FileUploader` disabled state example -- add `FileUploader` "Clear files" example -- document `validateFiles` prop for `FileUploaderDropContainer` -- add descriptions for `FileUploaderButton`, `FileUploader` examples - -**Housekeeping** - -- upgrade `carbon-components` to v10.53.0 - -## [0.58.4](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.58.4) - 2022-02-21 - -**Fixes** - -- dispatched events without a `detail` type should be `null` instead of `any` -- `FileUploader` `clearFiles` description should reflect that it's an accessor, not a prop -- `FileUploader` should correctly fire `add` and `remove` events -- `FileUploader` files should not be keyed by file name -- `FileUploader` change event detail signature should be `File[]` -- fix `DataTable` regression where sort icon indicators don't update - -**Refactor** - -- remove unnecessary JSDoc default type notation - -## [0.58.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.58.3) - 2022-02-20 - -**Fixes** - -- correctly set deprecation comments for deprecated components -- `TextInput` and `PasswordInput` should render label if "labelText" slot is used -- `PasswordInput` should not render `label` if no `labelText` is provided -- `StructuredList` overflow-y should not be "hidden" -- `MultiSelect` should not prevent default key behavior when open -- `Switch` should have `type="button"` - -## [0.58.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.58.2) - 2022-02-12 - -**Fixes** - -- `Tooltip` `aria-label` should use `iconDescription` if `triggerText` is falsy -- `OverflowMenu` keyboard navigation should skip disabled items -- UI Shell `HeaderPanelDivider` should use `hr` element to represent divider -- `Button` should not set `aria-pressed` on icon-only, link buttons - -## [0.58.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.58.1) - 2022-02-11 - -**Fixes** - -- remove whitespace from `pre` tag in `CodeSnippet` (Svelte v3.46.4 preserves `pre` whitespace by default) - -## [0.58.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.58.0) - 2022-02-11 - -**Breaking Changes** - -- if `TextInput` is `type="number"`, value can be a `number` or `null` to signify "no value" -- `TextInput` dispatches instead of forwards `input`, `change` events (detail: `null | number | string`) - -**Features** - -- pass `rowIndex`, `cellIndex` to `DataTable` "cell" slot -- add `itemToInput` prop to `MultiSelect` to customize name, title, labelText values -- add `open` prop to `TooltipDefinition`; dispatch `open`, `close` events - -**Fixes** - -- `DataTable` headers should be reactive -- `DataTable` batch selection checkbox should be reactive -- `MultiSelect` should correctly lose focus -- non-filterable `MultiSelect` should dispatch a `blur` event -- resolve `MultiSelect` accessibility issues -- toggle `HeaderNavMenu` when pressing "Enter" or "Space" -- close `HeaderNavMenu` menu when pressing "Enter" on an item -- resolve `HeaderNavMenu` accessibility issues -- fix `TextInput` reactivity by using native `bind:value` - -**Documentation** - -- remove duplicate "Heading variant" example - -**Housekeeping** - -- upgrade `carbon-components` to v10.52.0 - -## [0.57.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.57.1) - 2022-02-01 - -**Fixes** - -- `Tooltip` definition is missing open, close events -- `TooltipDefinition` button should have `type="button"` - -## [0.57.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.57.0) - 2022-01-30 - -**Breaking Changes** - -- make `NumberInput` "input" event type consistent with "change" (`null | number`) - -**Features** - -- dispatch `NumberInput` input, change events when clicking the steppers -- add `primaryButtonIcon` prop to `Modal`, `ModalFooter` - -**Fixes** - -- prevent `NumberInput` from coercing empty string to `0` - -## [0.56.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.56.1) - 2022-01-27 - -**Fixes** - -- `NumberInput` with value `0` should not be converted to `null` - -## [0.56.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.56.0) - 2022-01-27 - -**Breaking Changes** - -- type `NumberInput` value as `null | number` instead of `string | number` (`null` signifies "no value") - -**Fixes** - -- export `readonly` as a prop in `TextArea` -- fix `Checkbox` two-way binding for `checked`, `group` props - -**Documentation** - -- add `Checkbox` reactive example for `bind:checked` -- update `Checkbox` reactive example for `bind:group` to demo two-way binding -- simplify `Tabs` reactive example -- add `NumberInput` "No value" example - -## [0.55.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.55.0) - 2022-01-22 - -**Features** - -- forward `focus`, `blur` events to `NumberInput` -- update `ProgressStep` icons for current, incomplete steps -- type `id` as `any` instead of `string` in `ComboBox`, `Dropdown`, `MultiSelect` - -**Fixes** - -- do not coerce empty value to `0` in `NumberInput` if `allowEmpty` is true -- label `Slider` input if `aria-label` not explicitly defined -- add missing `required` prop to `RadioButton` -- add missing `required` prop to `Checkbox` -- include `@default undefined` annotations for props that are `undefined` by default - -**Refactor** - -- remove hotfix in `DatePicker` to prevent disabled icon from being clickable - -**Housekeeping** - -- upgrade `carbon-components` to v10.51.0 - -## [0.54.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.54.0) - 2022-01-19 - -**Features** - -- support paginated `DataTable` - -## [0.53.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.53.0) - 2022-01-18 - -**Breaking Changes** - -- replace `selectedIndex` with `selectedId` in `Dropdown` -- replace `selectedIndex` with `selectedId` in `ComboBox` - -**Fixes** - -- prevent `Dropdown` icon from being clickable when disabled - -## [0.52.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.52.0) - 2022-01-17 - -**Features** - -- make `Toggle` labels slottable -- add option to `ComboBox.clear` to not re-focus input (`clear({ focus: false })`) - -**Fixes** - -- break out of trap focus in `Tooltip` when pressing "Escape" -- pass "name" prop in `ComboBox` to input element -- emit `change` event in `Checkbox` after modifying state -- restore explicit typing of `null | HTMLElement` for TypeScript strict mode -- dispatch `click:button--primary` in `Modal` if `shouldSubmitOnEnter` is true - -**Documentation** - -- simplify reactive `RadioButton` example -- add reactive `Select` example for `Select` -- fix grammar in `TreeView` "Expand all nodes" example -- note that `Search` clear event is also dispatched when pressing "Escape" -- demo reactivity in expandable `Search` example - -## [0.51.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.51.3) - 2022-01-12 - -**Fixes** - -- fix `selectedIndex` reactivity in `ComboBox` - -**Refactor** - -- remove redundant `null` in `null | HTMLElement` prop types - -## [0.51.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.51.2) - 2022-01-10 - -**Fixes** - -- correctly reset values in `ComboBox` when manually clearing selection -- fix filterable `ComboBox` keyboard selection -- remove redundant role attributes from `Dropdown`, `Header` to fix a11y warnings -- fix `TileGroup` two-way binding on the `selected` prop - -**Documentation** - -- document `DatePicker` usage with a Rollup set-up -- add multiple modals example for `Modal` -- add reactive examples for `RadioTile` - -## [0.51.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.51.1) - 2022-01-03 - -**Fixes** - -- add missing `required` prop to `Select` -- set global theme variable first in SCSS files - -## [0.51.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.51.0) - 2021-12-30 - -**Features** - -- enhance `Checkbox` to support `bind:group` - -## [0.50.5](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.50.5) - 2021-12-30 - -**Fixes** - -- filterable `MultiSelect` should blur when pressing "Tab" -- filterable `MultiSelect` menu should close when pressing "Escape" -- filterable `MultiSelect` menu should open when pressing "Space" -- `DatePicker` input should not lose focus when pressing "Enter" -- `ToolbarSearch` should expand if `value` is programmatically set - -## [0.50.4](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.50.4) - 2021-12-30 - -**Fixes** - -- pressing "Escape" in a `DatePicker` should not propagate past the open calendar -- prevent menu icon in filterable `MultiSelect` from triggering twice - -## [0.50.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.50.3) - 2021-12-28 - -**Fixes** - -- do not dispatch "click", "click:row" `DataTable` events when selecting a checkbox or radio button -- render "labelText" slot if `labelText` prop or `$$slots.labelText` is truthy -- prevent default behavior in `Tabs` mobile variant when clicking a menu option -- coalesce nullish values to `""` for `TextInput`, `PasswordInput`, `TextArea` - -## [0.50.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.50.2) - 2021-11-27 - -**Fixes** - -- select correct item in filterable `MultiSelect` using keyboard navigation -- do not mutate `sortedItems` in `MultiSelect` - -## [0.50.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.50.1) - 2021-11-19 - -**Fixes** - -- do not dispatch `DataTable` "click", "click:row" events if target is an `OverflowMenu` - -## [0.50.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.50.0) - 2021-11-18 - -**Features** - -- add `target` prop to `ContextMenu` to support custom trigger element(s) -- pass clicked element as `event.detail` in `ContextMenu` "open" event - -## [0.49.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.49.2) - 2021-11-18 - -**Fixes** - -- `Tabs` should not dispatch an initial "change" event when no change has occurred -- `Pagination` page value should not exceed total pages -- fix `Popover` relative prop by inlining style -- replace `onDestroy` with `onMount` return function to avoid running code server-side - -## [0.49.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.49.1) - 2021-11-17 - -**Fixes** - -- include missing `Popover` styles from `carbon-components@10.47` - -## [0.49.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.49.0) - 2021-11-12 - -**Features** - -- support `UIShell` HeaderNavMenu with current item -- make `InlineNotification` title, subtitle props slottable -- make `ToastNotification` title, subtitle, and caption props slottable - -**Refactor** - -- remove unnecessary "position: relative" style in `ExpandableTile` -- remove unused `refContent` in `ExpandableTile` - -**Housekeeping** - -- upgrade `carbon-components` to v10.48.0 - -## [0.48.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.48.1) - 2021-11-12 - -**Fixes** - -- type `DatePicker` locale prop as flatpickr `CustomLocale` or `key` -- update remaining `carbon-icons-svelte` imports to use inlined icons - -## [0.48.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.48.0) - 2021-11-11 - -**Breaking Changes** - -- remove `carbon-icons-svelte` from direct dependencies - -**Features** - -- support auto-width `Tabs` -- add ref prop to `Form` - -**Fixes** - -- set calendar instance to `null` when destroying `DatePicker` - -## [0.47.6](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.47.6) - 2021-11-10 - -**Fixes** - -- fix `Tooltip` two way binding when icon is in focus -- coerce `TextInput` value to a number if `type="number"` - -## [0.47.5](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.47.5) - 2021-11-07 - -**Fixes** - -- fix `Tooltip` open/close logic to allow two way binding of the `open` prop -- inline `position: relative` style in `ExpandableTile` - -## [0.47.4](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.47.4) - 2021-11-06 - -**Fixes** - -- only dispatch `click:row--expand` when clicking an expandable `DataTable` row chevron - -## [0.47.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.47.3) - 2021-10-22 - -**Fixes** - -- correctly toggle batch expansion button in `DataTable` - -## [0.47.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.47.2) - 2021-10-21 - -**Fixes** - -- close the open `Tooltip` when using multiple tooltips -- collapse batch expansion button in `DataTable` if one or more rows is collapsed -- omit explicit reference to "carbon-icons-svelte" from `icon` prop descriptions - -## [0.47.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.47.1) - 2021-10-20 - -**Fixes** - -- include border style for non-expandable rows in a batch expandable `DataTable` - -## [0.47.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.47.0) - 2021-10-19 - -**Features** - -- add `nonExpandableRowIds` prop to `DataTable` to specify rows that should not be expandable - -## [0.46.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.46.0) - 2021-10-17 - -**Breaking Changes** - -- use `.svelte.d.ts` extension instead of `.d.ts` for Svelte component TypeScript definitions - -**Features** - -- support `Tag` outline type -- add `hideLabel` prop to `MultiSelect` -- allow any Svelte component to be used for `icon` props, not just `CarbonIcon` -- add `closeIcon` prop to `HeaderAction` to override the default `Close20` icon - -**Fixes** - -- avoid opening the calendar if `DatePickerInput` is a disabled `fieldset` descendant -- remove `stopPropagation` modifier from `HeaderAction` to allow multiple UI Shell app switchers - -**Housekeeping** - -- upgrade `carbon-components` to v10.46.0 - -## [0.45.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.45.1) - 2021-10-15 - -**Fixes** - -- prevent space/enter keys from selecting incomplete `ProgressIndicator` steps - -## [0.45.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.45.0) - 2021-10-13 - -**Features** - -- add `TreeView` component accessors to programmatically expand/collapse nodes - -## [0.44.7](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.44.7) - 2021-10-13 - -**Fixes** - -- add missing `value` prop to `Checkbox` - -## [0.44.6](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.44.6) - 2021-10-11 - -**Fixes** - -- fix `DataTable` sorting to tolerate `null`, `undefined` values - -## [0.44.5](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.44.5) - 2021-10-04 - -**Fixes** - -- correctly apply `menuOptionsClass` in `OverflowMenu` - -## [0.44.4](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.44.4) - 2021-09-28 - -**Fixes** - -- `ClickableTile` TypeScript definition restProps should extend attributes of either `a` or `p` tags - -## [0.44.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.44.3) - 2021-09-23 - -**Fixes** - -- correctly apply styles when using a static width `DataTable` with a title and description - -## [0.44.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.44.2) - 2021-09-14 - -**Fixes** - -- prevent redundant `clear` events in `ComboBox` - -## [0.44.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.44.1) - 2021-09-11 - -**Fixes** - -- if `ComboBox` is disabled, clicking the chevron icon should not toggle the dropdown -- `ToolbarBatchActions` cancel button text should be slottable - -## [0.44.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.44.0) - 2021-09-07 - -**Features** - -- add ability to override or customize `DatePicker` calendar options using the `flatpickrProps` prop - -## [0.43.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.43.0) - 2021-09-06 - -**Features** - -- add ability to programmatically clear a `ComboBox` using the `clear` component accessor - -## [0.42.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.42.3) - 2021-09-05 - -**Fixes** - -- `RadioButton` "labelText" slot should render even if `labelText` is falsy -- only render `FormGroup` `legend` element if `legendText` is truthy - -## [0.42.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.42.2) - 2021-07-29 - -**Fixes** - -- fix reactivity regression in `ComboBox` - -**Documentation** - -- update example set-ups -- document styling instructions, `carbon-preprocess-svelte` in README.md - -## [0.42.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.42.1) - 2021-07-26 - -**Fixes** - -- disable `a11y-mouse-events-have-key-events` warnings -- upgrade `carbon-icons-svelte` to v10.36.0 to quell `a11y-mouse...` warnings - -**Refactor** - -- remove `formatStyle` utility in `OverflowMenu` - -**Documentation** - -- add `svelte:head` example usage for loading CDN styles -- add instructions for dynamic theming -- update number of available Carbon icons - -## [0.42.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.42.0) - 2021-07-22 - -**Features** - -- add `helperText` prop to `DatePickerInput` - -**Fixes** - -- replace `svelte:body` with `svelte:window` when listening for an outside click - -**Documentation** - -- fix typos in styling instructions -- update expanded nodes guidance -- add `DatePicker` example "With helper text" - -**Refactor** - -- omit explicit `treeview.scss` import in `css/*.scss` files as it is included by default in `carbon-components@10.40` - -**Housekeeping** - -- upgrade `carbon-components` to v10.40.0 - -## [0.41.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.41.0) - 2021-07-18 - -**Features** - -- add expandedIds to `TreeView` - -**Fixes** - -- do not fall back to an empty string for a `DataTable` value if falsy -- omit disabled attribute in `Button` if value is falsy - -**Documentation** - -- add styling instructions to the home page - -## [0.40.1](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.40.1) - 2021-07-14 - -**Fixes** - -- focus first, non-disabled `TreeView` node if active id does not match the selected id -- set `type="button"` on `OverflowMenu` to prevent submit behavior when pressing "Enter" -- update semantic attributes in `OverflowMenuItem` -- do not render `OverflowMenuItem` title attribute if using a slot -- do not dispatch `NumberInput` on:change event on initialization -- dynamically load ESM `flatpickr` rangePlugin -- forward input, focus events to `Select` -- type `DataTableRowId` as `any`, fixes - -## [0.40.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.40.0) - 2021-07-11 - -**Breaking Changes** - -- remove `appendTo` prop in `DatePicker` for server-side rendering (SSR) compatibility - -**Features** - -- add `Breakpoint` component to detect the current Carbon grid size based on browser width -- add `Theme` component to dynamically update the current theme client-side -- add `valueFrom`, `valueTo` props for range `DatePicker` -- export `multiSelectRef`, `fieldRef`, `selectionRef` in `MultiSelect` -- add clearItem, clearAll instance methods to `LocalStorage` -- support `NumberInput` readonly variant - -**Fixes** - -- append `DatePicker` instance to local reference to prevent arrow key locking -- fix `on:change` type signature in `DatePicker` -- export id prop in `ProgressBar` -- add skeleton text for every row and column in `DataTableSkeleton` -- deprecate `shouldShowBorder` prop in `Table` -- correctly type exported constant props and function declarations as accessors in `SvelteComponentTyped` interface - -**Documentation** - -- document Breakpoint component -- document Theme component -- add ProgressBar "UX example" -- add DatePicker example "Range" -- add NumberInput example "Read-only variant" - -**Housekeeping** - -- upgrade `carbon-components` to v10.39.0 - -## [0.39.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.39.0) - 2021-07-05 - -**Breaking Changes** - -- remove `clipboard-copy` direct dependency; use native Clipboard API instead of `clipboard-copy` to copy text in `CopyButton`, `CodeSnippet` - -**Features** - -- add `TreeView` component -- add `RecursiveList` component -- support 3 buttons in `Modal`, `ComposedModal` via `secondaryButtons` -- make `DataTable` title/description slottable -- allow custom `expansionBreakpoint` in UI Shell `Header`, `SideNav` -- dispatch "click:button--primary" as an alias to "submit" in `Modal`, `ComposedModal` - -**Fixes** - -- export `useStaticWidth` prop in `DataTable` -- do not render `DataTable` table header if title/description not provided - -**Documentation** - -- add TreeView documentation -- add RecursiveList documentation -- add CopyButton examples "Overriding copy functionality", "Preventing copy functionality" -- add CodeSnippet examples "Overriding copy functionality", "Preventing copy functionality" -- add DataTable example "Static width" -- include typedefs in Component API section - -## [0.38.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.38.2) - 2021-07-03 - -**Fixes** - -- prevent ` + on:blur> {#if !invalid && helperText}
{helperText}
{/if} {#if invalid} -
{invalidText}
+
{invalidText}
{/if} diff --git a/src/TextArea/TextAreaSkeleton.svelte b/src/TextArea/TextAreaSkeleton.svelte index 4541059e..036fa7d4 100644 --- a/src/TextArea/TextAreaSkeleton.svelte +++ b/src/TextArea/TextAreaSkeleton.svelte @@ -3,10 +3,8 @@ export let hideLabel = false; - -
{#if !hideLabel} - + {/if} -
+
diff --git a/src/TextInput/PasswordInput.svelte b/src/TextInput/PasswordInput.svelte index a660ac2d..a5c0ef4f 100644 --- a/src/TextInput/PasswordInput.svelte +++ b/src/TextInput/PasswordInput.svelte @@ -59,15 +59,6 @@ /** Specify the text for the invalid state */ export let invalidText = ""; - /** Set to `true` to indicate an warning state */ - export let warn = false; - - /** Specify the warning state text */ - export let warnText = ""; - - /** Set to `true` to use inline version */ - export let inline = false; - /** Set an id for the input element */ export let id = "ccs-" + Math.random().toString(36); @@ -81,185 +72,108 @@ export let ref = null; import { getContext } from "svelte"; - import WarningFilled from "../icons/WarningFilled.svelte"; - import WarningAltFilled from "../icons/WarningAltFilled.svelte"; - import View from "../icons/View.svelte"; - import ViewOff from "../icons/ViewOff.svelte"; + import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16/WarningFilled16.svelte"; + import View16 from "carbon-icons-svelte/lib/View16/View16.svelte"; + import ViewOff16 from "carbon-icons-svelte/lib/ViewOff16/ViewOff16.svelte"; const ctx = getContext("Form"); - const isFluid = !!ctx && ctx.isFluid; - $: helperId = `helper-${id}`; + $: isFluid = !!ctx && ctx.isFluid; $: errorId = `error-${id}`; - $: warnId = `warn-${id}`; - - -
- {#if inline} + {#if labelText} - {#if !isFluid && helperText} -
- {helperText} -
- {/if} - {/if} - {#if !inline && (labelText || $$slots.labelText)} - {/if}
-
+ {/if} + + + {hidePasswordLabel} + {:else}{showPasswordLabel}{/if} + {/if} -
- {#if !isFluid && invalid} -
- {invalidText} -
- {/if} - {#if !invalid && !warn && !isFluid && !inline && helperText} -
- {helperText} -
- {/if} - {#if !isFluid && !invalid && warn} -
{warnText}
- {/if} + {#if type === "text"} + + {:else} + + {/if} +
+ {#if !invalid && helperText} +
+ {helperText} +
+ {/if} + {#if invalid} +
{invalidText}
+ {/if}
diff --git a/src/TextInput/TextInput.svelte b/src/TextInput/TextInput.svelte index c2cfb319..0a4b0114 100644 --- a/src/TextInput/TextInput.svelte +++ b/src/TextInput/TextInput.svelte @@ -1,9 +1,4 @@ - - -
{#if inline} -
+
{#if labelText} {/if} {#if !isFluid && helperText}
{helperText}
{/if}
{/if} - {#if !inline && (labelText || $$slots.labelText)} + {#if !inline && labelText} {/if}
- {#if readonly} - - {:else} - {#if invalid} - - {/if} - {#if !invalid && warn} - + {/if} + {#if !invalid && warn} + - {/if} + /> {/if} {#if isFluid} -
+
{/if} {#if isFluid && !inline && invalid} -
+
{invalidText}
{/if} {#if isFluid && !inline && warn} -
{warnText}
+
{warnText}
{/if}
{#if !invalid && !warn && !isFluid && !inline && helperText}
{helperText}
{/if} {#if !isFluid && invalid} -
+
{invalidText}
{/if} {#if !isFluid && !invalid && warn} -
{warnText}
+
{warnText}
{/if}
diff --git a/src/TextInput/TextInputSkeleton.svelte b/src/TextInput/TextInputSkeleton.svelte index 23da8b95..4a54ca07 100644 --- a/src/TextInput/TextInputSkeleton.svelte +++ b/src/TextInput/TextInputSkeleton.svelte @@ -3,10 +3,8 @@ export let hideLabel = false; - -
{#if !hideLabel} - + {/if} -
+
diff --git a/src/Theme/Theme.svelte b/src/Theme/Theme.svelte deleted file mode 100644 index e3ae9eda..00000000 --- a/src/Theme/Theme.svelte +++ /dev/null @@ -1,120 +0,0 @@ - - -{#if persist} - -{/if} - -{#if render === "toggle"} - {@const { themes: toggleThemes, ...toggleProps } = toggle} - { - theme = detail.toggled ? toggleThemes[1] : toggleThemes[0]; - }} - /> -{:else if render === "select"} - {@const { themes: selectThemes, ...selectProps } = select} - -{/if} - - diff --git a/src/Theme/index.js b/src/Theme/index.js deleted file mode 100644 index 79f7e13d..00000000 --- a/src/Theme/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default as Theme } from "./Theme.svelte"; diff --git a/src/Tile/ClickableTile.svelte b/src/Tile/ClickableTile.svelte index 8dbd2e96..980216c4 100644 --- a/src/Tile/ClickableTile.svelte +++ b/src/Tile/ClickableTile.svelte @@ -1,43 +1,39 @@ - + { + on:click="{() => { clicked = !clicked; - }} + }}" on:keydown - on:keydown={({ key }) => { - if (key === " " || key === "Enter") { + on:keydown="{({ key }) => { + if (key === ' ' || key === 'Enter') { clicked = !clicked; } - }} + }}" on:mouseover on:mouseenter on:mouseleave > - + diff --git a/src/Tile/ExpandableTile.svelte b/src/Tile/ExpandableTile.svelte index 5f8f9f6e..08d8cbe4 100644 --- a/src/Tile/ExpandableTile.svelte +++ b/src/Tile/ExpandableTile.svelte @@ -32,23 +32,12 @@ /** Obtain a reference to the top-level element */ export let ref = null; - import { afterUpdate, onMount } from "svelte"; - import ChevronDown from "../icons/ChevronDown.svelte"; + import { afterUpdate } from "svelte"; + import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16/ChevronDown16.svelte"; + let refContent = null; let refAbove = null; - onMount(() => { - const resizeObserver = new ResizeObserver(([elem]) => { - tileMaxHeight = elem.contentRect.height; - }); - - resizeObserver.observe(refAbove); - - return () => { - resizeObserver.disconnect(); - }; - }); - afterUpdate(() => { if (tileMaxHeight === 0) { tileMaxHeight = refAbove.getBoundingClientRect().height; @@ -62,41 +51,42 @@ }); - -
+ - +
diff --git a/src/TooltipIcon/TooltipIcon.svelte b/src/TooltipIcon/TooltipIcon.svelte index a9ba4e9e..5bffcebb 100644 --- a/src/TooltipIcon/TooltipIcon.svelte +++ b/src/TooltipIcon/TooltipIcon.svelte @@ -5,15 +5,6 @@ */ export let tooltipText = ""; - /** - * Specify the icon to render - * @type {any} - */ - export let icon = undefined; - - /** Set to `true` to disable the tooltip icon */ - export let disabled = false; - /** * Set the alignment of the tooltip relative to the icon * @type {"start" | "center" | "end"} @@ -35,49 +26,41 @@ let hidden = false; - { - if (key === "Escape") { + diff --git a/src/TreeView/TreeView.svelte b/src/TreeView/TreeView.svelte deleted file mode 100644 index d8239ebd..00000000 --- a/src/TreeView/TreeView.svelte +++ /dev/null @@ -1,266 +0,0 @@ - - - - -{#if !hideLabel} - - -{/if} - - -
    1 || undefined} - on:keydown - on:keydown|stopPropagation={handleKeyDown} -> - - - {node.text} - - -
diff --git a/src/TreeView/TreeViewNode.svelte b/src/TreeView/TreeViewNode.svelte deleted file mode 100644 index 0682b4ce..00000000 --- a/src/TreeView/TreeViewNode.svelte +++ /dev/null @@ -1,133 +0,0 @@ - - - - - -
  • { - if (disabled) return; - clickNode(node); - }} - on:keydown={(e) => { - if (e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Enter") { - e.stopPropagation(); - } - - if (e.key === "ArrowLeft") { - const parentNode = findParentTreeNode(ref.parentNode); - if (parentNode) parentNode.focus(); - } - - if (e.key === "Enter" || e.key === " ") { - e.preventDefault(); - if (disabled) return; - clickNode(node); - } - }} - on:focus={() => { - focusNode(node); - }} -> -
    - - - {text} - -
    -
  • diff --git a/src/TreeView/TreeViewNodeList.svelte b/src/TreeView/TreeViewNodeList.svelte deleted file mode 100644 index 72fe380c..00000000 --- a/src/TreeView/TreeViewNodeList.svelte +++ /dev/null @@ -1,179 +0,0 @@ - - -{#if root} - {#each nodes as child (child.id)} - {#if Array.isArray(child.nodes)} - - - - {:else} - - - - {/if} - {/each} -{:else} - {@const selected = $selectedNodeIds.includes(id)} - -
  • { - if (disabled) return; - clickNode(node); - }} - on:keydown={(e) => { - if ( - e.key === "ArrowLeft" || - e.key === "ArrowRight" || - e.key === "Enter" - ) { - e.stopPropagation(); - } - - if (parent && e.key === "ArrowLeft") { - expanded = false; - expandNode(node, false); - toggleNode(node); - } - - if (parent && e.key === "ArrowRight") { - if (expanded) { - ref.lastChild.firstElementChild?.focus(); - } else { - expanded = true; - expandNode(node, true); - toggleNode(node); - } - } - - if (e.key === "Enter" || e.key === " ") { - e.preventDefault(); - if (disabled) return; - expanded = !expanded; - toggleNode(node); - clickNode(node); - expandNode(node, expanded); - ref.focus(); - } - }} - on:focus={() => { - focusNode(node); - }} - > -
    - - - { - if (disabled) return; - expanded = !expanded; - expandNode(node, expanded); - toggleNode(node); - }} - > - - - - - - -
    - {#if expanded} -
      - {#each nodes as child (child.id)} - {#if Array.isArray(child.nodes)} - - - - {:else} - - {node.text} - - {/if} - {/each} -
    - {/if} -
  • -{/if} diff --git a/src/TreeView/index.d.ts b/src/TreeView/index.d.ts deleted file mode 100644 index 59f96be0..00000000 --- a/src/TreeView/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as TreeView } from "./TreeView.svelte"; diff --git a/src/TreeView/index.js b/src/TreeView/index.js deleted file mode 100644 index 59f96be0..00000000 --- a/src/TreeView/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default as TreeView } from "./TreeView.svelte"; diff --git a/src/Truncate/Truncate.svelte b/src/Truncate/Truncate.svelte index 432be1a5..465d66d8 100644 --- a/src/Truncate/Truncate.svelte +++ b/src/Truncate/Truncate.svelte @@ -4,8 +4,8 @@

    diff --git a/src/Truncate/index.js b/src/Truncate/index.js index 803c92f2..ae315be0 100644 --- a/src/Truncate/index.js +++ b/src/Truncate/index.js @@ -1,2 +1 @@ export { default as Truncate } from "./Truncate.svelte"; -export { truncate } from "./truncate"; diff --git a/src/Truncate/truncate.d.ts b/src/Truncate/truncate.d.ts deleted file mode 100644 index f0fa9967..00000000 --- a/src/Truncate/truncate.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -interface TruncateOptions { - clamp?: "end" | "front"; -} - -export function TruncateAction( - node: HTMLElement, - options?: TruncateOptions, -): { - update: (options?: TruncateOptions) => void; -}; - -export default TruncateAction; diff --git a/src/UIShell/Content.svelte b/src/UIShell/Content.svelte index 0b504265..cda23db3 100644 --- a/src/UIShell/Content.svelte +++ b/src/UIShell/Content.svelte @@ -1,24 +1,8 @@ -

    +
    diff --git a/src/UIShell/GlobalHeader/Header.svelte b/src/UIShell/GlobalHeader/Header.svelte new file mode 100644 index 00000000..c106e746 --- /dev/null +++ b/src/UIShell/GlobalHeader/Header.svelte @@ -0,0 +1,70 @@ + + + + +
    + + {#if ($shouldRenderHamburgerMenu && winWidth < 1056) || persistentHamburgerMenu} + + {/if} + + {#if company} + {company}  + {/if} + {platformName} + + +
    diff --git a/src/UIShell/GlobalHeader/HeaderAction.svelte b/src/UIShell/GlobalHeader/HeaderAction.svelte new file mode 100644 index 00000000..4989ce9c --- /dev/null +++ b/src/UIShell/GlobalHeader/HeaderAction.svelte @@ -0,0 +1,100 @@ + + + + +
    + + {#if isOpen} +
    + +
    + {/if} +
    + + diff --git a/src/UIShell/GlobalHeader/HeaderActionLink.svelte b/src/UIShell/GlobalHeader/HeaderActionLink.svelte new file mode 100644 index 00000000..d4530519 --- /dev/null +++ b/src/UIShell/GlobalHeader/HeaderActionLink.svelte @@ -0,0 +1,43 @@ + + + + + + + diff --git a/src/UIShell/GlobalHeader/HeaderActionSearch.svelte b/src/UIShell/GlobalHeader/HeaderActionSearch.svelte new file mode 100644 index 00000000..b296cb13 --- /dev/null +++ b/src/UIShell/GlobalHeader/HeaderActionSearch.svelte @@ -0,0 +1,223 @@ + + + + + + + diff --git a/src/UIShell/GlobalHeader/HeaderNav.svelte b/src/UIShell/GlobalHeader/HeaderNav.svelte new file mode 100644 index 00000000..d7dd5e98 --- /dev/null +++ b/src/UIShell/GlobalHeader/HeaderNav.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/UIShell/GlobalHeader/HeaderNavItem.svelte b/src/UIShell/GlobalHeader/HeaderNavItem.svelte new file mode 100644 index 00000000..3d8c752e --- /dev/null +++ b/src/UIShell/GlobalHeader/HeaderNavItem.svelte @@ -0,0 +1,38 @@ + + +
  • + + {text} + +
  • diff --git a/src/UIShell/GlobalHeader/HeaderNavMenu.svelte b/src/UIShell/GlobalHeader/HeaderNavMenu.svelte new file mode 100644 index 00000000..5c351aaa --- /dev/null +++ b/src/UIShell/GlobalHeader/HeaderNavMenu.svelte @@ -0,0 +1,64 @@ + + + + +
  • + + {text} + + +
      + +
    +
  • diff --git a/src/UIShell/GlobalHeader/HeaderPanelDivider.svelte b/src/UIShell/GlobalHeader/HeaderPanelDivider.svelte new file mode 100644 index 00000000..c6a0c0d2 --- /dev/null +++ b/src/UIShell/GlobalHeader/HeaderPanelDivider.svelte @@ -0,0 +1,22 @@ +
  • + + + +
  • + + diff --git a/src/UIShell/HeaderPanelLink.svelte b/src/UIShell/GlobalHeader/HeaderPanelLink.svelte similarity index 56% rename from src/UIShell/HeaderPanelLink.svelte rename to src/UIShell/GlobalHeader/HeaderPanelLink.svelte index 7cbbcc95..e2dc9584 100644 --- a/src/UIShell/HeaderPanelLink.svelte +++ b/src/UIShell/GlobalHeader/HeaderPanelLink.svelte @@ -9,12 +9,12 @@ export let ref = null; -
  • +
  • diff --git a/src/UIShell/GlobalHeader/HeaderPanelLinks.svelte b/src/UIShell/GlobalHeader/HeaderPanelLinks.svelte new file mode 100644 index 00000000..59859153 --- /dev/null +++ b/src/UIShell/GlobalHeader/HeaderPanelLinks.svelte @@ -0,0 +1,3 @@ +
      + +
    diff --git a/src/UIShell/GlobalHeader/HeaderUtilities.svelte b/src/UIShell/GlobalHeader/HeaderUtilities.svelte new file mode 100644 index 00000000..c9942f4e --- /dev/null +++ b/src/UIShell/GlobalHeader/HeaderUtilities.svelte @@ -0,0 +1,3 @@ +
    + +
    diff --git a/src/UIShell/HamburgerMenu.svelte b/src/UIShell/HamburgerMenu.svelte deleted file mode 100644 index 37fc145e..00000000 --- a/src/UIShell/HamburgerMenu.svelte +++ /dev/null @@ -1,45 +0,0 @@ - - - diff --git a/src/UIShell/Header.svelte b/src/UIShell/Header.svelte deleted file mode 100644 index 30aa1eb2..00000000 --- a/src/UIShell/Header.svelte +++ /dev/null @@ -1,103 +0,0 @@ - - - - -
    - - {#if ($shouldRenderHamburgerMenu && winWidth < expansionBreakpoint) || persistentHamburgerMenu} - - {/if} - - {#if company || $$slots.company} - {company}  - {/if} - {platformName} - - -
    diff --git a/src/UIShell/HeaderAction.svelte b/src/UIShell/HeaderAction.svelte deleted file mode 100644 index ce6f3932..00000000 --- a/src/UIShell/HeaderAction.svelte +++ /dev/null @@ -1,160 +0,0 @@ - - - { - if ( - isOpen && - !ref.contains(target) && - !refPanel.contains(target) && - !preventCloseOnClickOutside - ) { - isOpen = false; - dispatch("close"); - } - }} -/> - - -{#if isOpen} -
    - -
    -{/if} - - diff --git a/src/UIShell/HeaderActionLink.svelte b/src/UIShell/HeaderActionLink.svelte deleted file mode 100644 index 64db7923..00000000 --- a/src/UIShell/HeaderActionLink.svelte +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - diff --git a/src/UIShell/HeaderGlobalAction.svelte b/src/UIShell/HeaderGlobalAction.svelte index 38fa48a3..6f574918 100644 --- a/src/UIShell/HeaderGlobalAction.svelte +++ b/src/UIShell/HeaderGlobalAction.svelte @@ -1,33 +1,26 @@ - + diff --git a/src/UIShell/HeaderNav.svelte b/src/UIShell/HeaderNav.svelte deleted file mode 100644 index 0c2dc451..00000000 --- a/src/UIShell/HeaderNav.svelte +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/src/UIShell/HeaderNavItem.svelte b/src/UIShell/HeaderNavItem.svelte deleted file mode 100644 index 9d37f9fb..00000000 --- a/src/UIShell/HeaderNavItem.svelte +++ /dev/null @@ -1,66 +0,0 @@ - - -
  • - { - if (selectedItemIds.indexOf(id) === selectedItemIds.length - 1) { - ctx?.closeMenu(); - } - }} - > - {text} - -
  • diff --git a/src/UIShell/HeaderNavMenu.svelte b/src/UIShell/HeaderNavMenu.svelte deleted file mode 100644 index a395a2e8..00000000 --- a/src/UIShell/HeaderNavMenu.svelte +++ /dev/null @@ -1,106 +0,0 @@ - - - { - if (!ref.contains(target)) { - expanded = false; - } - }} -/> - -
  • { - if (!menuRef.contains(e.target)) { - e.preventDefault(); - } - expanded = !expanded; - }} - on:keydown={(e) => { - if (e.key === "Enter") { - e.stopPropagation(); - expanded = !expanded; - } - }} -> - { - if (e.key === " ") e.preventDefault(); - if (e.key === "Enter" || e.key === " ") { - expanded = !expanded; - } - }} - on:click|preventDefault - on:mouseover - on:mouseenter - on:mouseleave - on:keyup - on:focus - on:blur - > - {text} - - - -
      - -
    -
  • diff --git a/src/UIShell/HeaderPanelDivider.svelte b/src/UIShell/HeaderPanelDivider.svelte deleted file mode 100644 index 6e2d33e2..00000000 --- a/src/UIShell/HeaderPanelDivider.svelte +++ /dev/null @@ -1,22 +0,0 @@ -{#if $$slots.default} -
  • - -
  • -{/if} -
    - - diff --git a/src/UIShell/HeaderPanelLinks.svelte b/src/UIShell/HeaderPanelLinks.svelte deleted file mode 100644 index 1f10ab39..00000000 --- a/src/UIShell/HeaderPanelLinks.svelte +++ /dev/null @@ -1,3 +0,0 @@ -
      - -
    diff --git a/src/UIShell/HeaderSearch.svelte b/src/UIShell/HeaderSearch.svelte index 5057e149..9306e3aa 100644 --- a/src/UIShell/HeaderSearch.svelte +++ b/src/UIShell/HeaderSearch.svelte @@ -1,9 +1,9 @@ { + on:mouseup="{({ target }) => { if (active && !refSearch.contains(target)) active = false; - }} + }}" /> -
    - -
    +
    + +
    { + on:keydown="{(e) => { switch (e.key) { - case "Enter": + case 'Enter': selectResult(); break; - case "ArrowDown": + case 'ArrowDown': e.preventDefault(); if (selectedResultIndex === results.length - 1) { selectedResultIndex = 0; @@ -122,7 +103,7 @@ selectedResultIndex += 1; } break; - case "ArrowUp": + case 'ArrowUp': e.preventDefault(); if (selectedResultIndex === 0) { selectedResultIndex = results.length - 1; @@ -130,67 +111,43 @@ selectedResultIndex -= 1; } break; - case "Escape": - if (value === "") { - // If the search bar is empty, deactivate the input. - active = false; - } - - // Reset the search query but keep the search bar active. - // Do not dispatch "clear" event as that should fire only on the "x" button. - value = ""; - selectedResultIndex = 0; - break; } - }} - on:paste + }}" />
    {#if active && results.length > 0} - -
    diff --git a/tests/Icon.test.svelte b/tests/Icon.test.svelte new file mode 100644 index 00000000..a666056e --- /dev/null +++ b/tests/Icon.test.svelte @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + diff --git a/tests/ImageLoader.test.svelte b/tests/ImageLoader.test.svelte new file mode 100644 index 00000000..8af6d330 --- /dev/null +++ b/tests/ImageLoader.test.svelte @@ -0,0 +1,18 @@ + + + diff --git a/tests/ImageLoader/ImageLoader.test.svelte b/tests/ImageLoader/ImageLoader.test.svelte deleted file mode 100644 index 1a805651..00000000 --- a/tests/ImageLoader/ImageLoader.test.svelte +++ /dev/null @@ -1,64 +0,0 @@ - - - - - -
    - -
    - - -
    - - -
    - -
    -
    - -
    An error occurred.
    -
    -
    -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - - -
    Failed to load image
    -
    -
    -
    diff --git a/tests/ImageLoader/ImageLoader.test.ts b/tests/ImageLoader/ImageLoader.test.ts deleted file mode 100644 index 86640905..00000000 --- a/tests/ImageLoader/ImageLoader.test.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import ImageLoader from "./ImageLoader.test.svelte"; - -describe("ImageLoader", () => { - beforeEach(() => { - vi.useFakeTimers(); - }); - - afterEach(() => { - vi.useRealTimers(); - vi.restoreAllMocks(); - }); - - it("renders with default props", () => { - render(ImageLoader); - const wrapper = screen.getByTestId("default-loader"); - const img = wrapper.querySelector("img"); - expect(img).toBeDefined(); - }); - - it("shows loading state and transitions to loaded state", async () => { - render(ImageLoader); - - const loadingIndicator = screen.getByTestId("loading-state"); - expect(loadingIndicator).toBeInTheDocument(); - - const wrapper = screen.getByTestId("loader-with-slots"); - const img = wrapper.querySelector("img"); - expect(img).toBeDefined(); - if (img) { - const loadEvent = new Event("load"); - img.dispatchEvent(loadEvent); - - expect(screen.queryByTestId("loading-state")).not.toBeInTheDocument(); - expect(img).toBeVisible(); - } - }); - - it("handles error state correctly", async () => { - render(ImageLoader); - - const wrapper = screen.getByTestId("error-loader"); - const img = wrapper.querySelector("img"); - expect(img).toBeDefined(); - - if (img) { - const errorEvent = new Event("error"); - img.dispatchEvent(errorEvent); - - const errorMessage = screen.getByTestId("error-message"); - expect(errorMessage).toBeInTheDocument(); - expect(errorMessage).toHaveTextContent("Failed to load image"); - } - }); - - it("supports aspect ratio", () => { - render(ImageLoader); - - const wrapper = screen.getByTestId("loader-with-ratio"); - const aspectRatioWrapper = wrapper.querySelector( - "[class*='bx--aspect-ratio']", - ); - - expect(aspectRatioWrapper).toHaveClass("bx--aspect-ratio--16x9"); - }); - - it("supports fade in animation", async () => { - render(ImageLoader); - - const wrapper = screen.getByTestId("loader-with-fade"); - const img = wrapper.querySelector("img"); - expect(img).toBeDefined(); - - if (img) { - const loadEvent = new Event("load"); - img.dispatchEvent(loadEvent); - - expect(img).toHaveStyle({ - transition: expect.stringContaining("opacity"), - }); - } - }); - - it("supports programmatic image loading", async () => { - const { component } = render(ImageLoader); - - const wrapper = screen.getByTestId("programmatic-loader"); - const img = wrapper.querySelector("img"); - expect(img).toBeDefined(); - - const imageLoaderComponent = component.imageLoader; - expect(imageLoaderComponent).toBeDefined(); - - const newSrc = "https://example.com/new-image.jpg"; - - imageLoaderComponent.loadImage(newSrc); - if (img) { - expect(img.getAttribute("src")).toBe(newSrc); - } - }); - - it("dispatches load and error events", async () => { - const { component } = render(ImageLoader); - - const load = vi.fn(); - const error = vi.fn(); - - component.$on("load", load); - component.$on("error", error); - - const defaultWrapper = screen.getByTestId("default-loader"); - const defaultImg = defaultWrapper.querySelector("img"); - expect(defaultImg).toBeDefined(); - - if (defaultImg) { - defaultImg.dispatchEvent(new Event("load")); - expect(load).toHaveBeenCalled(); - } - - const errorWrapper = screen.getByTestId("error-loader"); - const errorImg = errorWrapper.querySelector("img"); - expect(errorImg).toBeDefined(); - - if (errorImg) { - errorImg.dispatchEvent(new Event("error")); - expect(error).toHaveBeenCalled(); - } - }); -}); diff --git a/tests/InlineLoading.test.svelte b/tests/InlineLoading.test.svelte new file mode 100644 index 00000000..134fb679 --- /dev/null +++ b/tests/InlineLoading.test.svelte @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/tests/InlineLoading/InlineLoading.test.svelte b/tests/InlineLoading/InlineLoading.test.svelte deleted file mode 100644 index fdf2612a..00000000 --- a/tests/InlineLoading/InlineLoading.test.svelte +++ /dev/null @@ -1,57 +0,0 @@ - - - -
    - -
    - - -
    - -
    - - -
    - -
    - -
    - -
    - -
    - { - console.log("success"); - }} - /> -
    - - -
    - { - console.log("success custom delay"); - }} - /> -
    - -
    - -
    - - -
    - -
    diff --git a/tests/InlineLoading/InlineLoading.test.ts b/tests/InlineLoading/InlineLoading.test.ts deleted file mode 100644 index f5755e9f..00000000 --- a/tests/InlineLoading/InlineLoading.test.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import InlineLoading from "./InlineLoading.test.svelte"; - -describe("InlineLoading", () => { - beforeEach(() => { - vi.useFakeTimers(); - }); - - afterEach(() => { - vi.useRealTimers(); - vi.restoreAllMocks(); - }); - - it("renders with default props", () => { - render(InlineLoading); - const wrapper = screen.getByTestId("default-loader"); - - expect(wrapper.querySelector(".bx--inline-loading")).toBeInTheDocument(); - expect(wrapper.querySelector(".bx--loading")).toBeInTheDocument(); - }); - - it("renders with description", () => { - render(InlineLoading); - const wrapper = screen.getByTestId("loader-with-description"); - - const description = wrapper.querySelector(".bx--inline-loading__text"); - expect(description).toHaveTextContent("Loading metrics..."); - }); - - it("supports active state", () => { - render(InlineLoading); - const wrapper = screen.getByTestId("loader-active"); - - expect(wrapper.querySelector(".bx--loading")).toHaveClass( - "bx--loading--small", - ); - expect(wrapper.querySelector(".bx--loading--small")).toBeVisible(); - expect( - wrapper.querySelector(".bx--inline-loading__text"), - ).toHaveTextContent("Submitting..."); - }); - - it("supports inactive state", () => { - render(InlineLoading); - const wrapper = screen.getByTestId("loader-inactive"); - - expect(wrapper.querySelector(".bx--loading")).toHaveClass( - "bx--loading--small", - ); - expect(wrapper.querySelector(".bx--loading--stop")).toBeInTheDocument(); - expect( - wrapper.querySelector(".bx--inline-loading__text"), - ).toHaveTextContent("Cancelling..."); - }); - - it("supports finished state", () => { - render(InlineLoading); - const wrapper = screen.getByTestId("loader-finished"); - - expect( - wrapper.querySelector(".bx--inline-loading__checkmark-container"), - ).toBeInTheDocument(); - expect( - wrapper.querySelector(".bx--inline-loading__text"), - ).toHaveTextContent("Success"); - }); - - it("supports error state", () => { - render(InlineLoading); - const wrapper = screen.getByTestId("loader-error"); - - expect( - wrapper.querySelector(".bx--inline-loading--error"), - ).toBeInTheDocument(); - expect( - wrapper.querySelector(".bx--inline-loading__text"), - ).toHaveTextContent("An error occurred"); - }); - - it("supports custom icon description", () => { - render(InlineLoading); - const wrapper = screen.getByTestId("loader-custom-icon"); - - const icon = wrapper.querySelector( - ".bx--inline-loading__checkmark-container", - ); - assert(icon); - expect(icon).toHaveTextContent("Operation completed successfully"); - }); - - it("dispatches success event after delay when finished", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(InlineLoading); - - const wrapper = screen.getByTestId("loader-finished"); - expect( - wrapper.querySelector(".bx--inline-loading__checkmark-container"), - ).toBeInTheDocument(); - - vi.advanceTimersByTime(1500); - expect(consoleLog).toHaveBeenCalledWith("success"); - }); - - it("supports custom success delay", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(InlineLoading); - - vi.advanceTimersByTime(400); - expect(consoleLog).not.toHaveBeenCalled(); - - vi.advanceTimersByTime(100); - expect(consoleLog).toHaveBeenCalledWith("success custom delay"); - }); - - it("cleans up timeout on unmount", () => { - const { unmount } = render(InlineLoading); - const wrapper = screen.getByTestId("loader-finished"); - expect(wrapper).toBeInTheDocument(); - - unmount(); - - // Advance timers to ensure no lingering timeouts - vi.advanceTimersByTime(2000); - // If cleanup wasn't working, this would throw an error about setState after unmount - }); -}); diff --git a/tests/InlineLoadingUx.test.svelte b/tests/InlineLoadingUx.test.svelte new file mode 100644 index 00000000..4192857e --- /dev/null +++ b/tests/InlineLoadingUx.test.svelte @@ -0,0 +1,52 @@ + + + + + {#if state !== "dormant"} + + {:else} + + {/if} + diff --git a/tests/InlineNotification.test.svelte b/tests/InlineNotification.test.svelte new file mode 100644 index 00000000..6eacee66 --- /dev/null +++ b/tests/InlineNotification.test.svelte @@ -0,0 +1,46 @@ + + + + + + + +
    + Learn more +
    +
    + +Learn more + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/InlineNotification/InlineNotification.close.test.svelte b/tests/InlineNotification/InlineNotification.close.test.svelte deleted file mode 100644 index 6f66810c..00000000 --- a/tests/InlineNotification/InlineNotification.close.test.svelte +++ /dev/null @@ -1,12 +0,0 @@ - - - { - e.preventDefault(); - console.log("close", e.detail); - }} -/> diff --git a/tests/InlineNotification/InlineNotification.test.svelte b/tests/InlineNotification/InlineNotification.test.svelte deleted file mode 100644 index 320683d2..00000000 --- a/tests/InlineNotification/InlineNotification.test.svelte +++ /dev/null @@ -1,29 +0,0 @@ - - - { - console.log("close", e.detail); - }} -/> diff --git a/tests/InlineNotification/InlineNotification.test.ts b/tests/InlineNotification/InlineNotification.test.ts deleted file mode 100644 index d7d3b6de..00000000 --- a/tests/InlineNotification/InlineNotification.test.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import InlineNotification from "./InlineNotification.test.svelte"; -import InlineNotificationCustom from "./InlineNotificationCustom.test.svelte"; -import InlineNotificationClose from "./InlineNotification.close.test.svelte"; - -describe("InlineNotification", () => { - beforeEach(() => { - vi.restoreAllMocks(); - }); - - it("should render with default props", () => { - render(InlineNotification); - - expect(screen.getByRole("alert")).toHaveClass( - "bx--inline-notification--error", - ); - expect(screen.getByText("Error:")).toBeInTheDocument(); - expect( - screen.getByText("An internal server error occurred."), - ).toBeInTheDocument(); - }); - - it("should handle different kinds", () => { - ( - [ - "error", - "info", - "info-square", - "success", - "warning", - "warning-alt", - ] as const - ).forEach((kind) => { - const { container } = render(InlineNotification, { - props: { kind }, - }); - - expect( - container.querySelector(`.bx--inline-notification--${kind}`), - ).toBeInTheDocument(); - container.remove(); - }); - }); - - it("should handle low contrast variant", () => { - render(InlineNotification, { - props: { lowContrast: true }, - }); - - expect(screen.getByRole("alert")).toHaveClass( - "bx--inline-notification--low-contrast", - ); - }); - - it("should handle close button click", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(InlineNotification); - - await user.click(screen.getByRole("button")); - - expect(consoleLog).toHaveBeenCalledWith("close", { timeout: false }); - expect(screen.queryByRole("alert")).not.toBeInTheDocument(); - }); - - it("should hide close button", () => { - render(InlineNotification, { - props: { hideCloseButton: true }, - }); - - expect( - screen.queryByLabelText("Close notification"), - ).not.toBeInTheDocument(); - expect(screen.getByRole("alert")).toHaveClass( - "bx--inline-notification--hide-close-button", - ); - }); - - it("should handle custom icon descriptions", () => { - render(InlineNotification, { - props: { - statusIconDescription: "Custom status", - closeButtonDescription: "Custom close", - }, - }); - - expect(screen.getByText("Custom status")).toBeInTheDocument(); - expect(screen.getByRole("button")).toHaveAttribute( - "aria-label", - "Custom close", - ); - }); - - it("should handle custom role", () => { - render(InlineNotification, { - props: { role: "status" }, - }); - - expect(screen.getByRole("status")).toBeInTheDocument(); - }); - - it("should handle timeout", async () => { - vi.useFakeTimers(); - const consoleLog = vi.spyOn(console, "log"); - render(InlineNotification, { props: { timeout: 1000 } }); - - expect(screen.getByRole("alert")).toBeInTheDocument(); - await vi.advanceTimersByTimeAsync(1000); - - expect(consoleLog).toHaveBeenCalledWith("close", { timeout: true }); - expect(screen.queryByRole("alert")).not.toBeInTheDocument(); - vi.useRealTimers(); - }); - - it("should handle custom slots", () => { - render(InlineNotificationCustom); - - const title = screen.getByText("Custom Title:"); - expect(title).not.toHaveClass("bx--inline-notification__title"); - expect(title.tagName).toBe("STRONG"); - - const subtitle = screen.getByText("Custom subtitle content."); - expect(subtitle).not.toHaveClass("bx--inline-notification__subtitle"); - expect(subtitle.tagName).toBe("STRONG"); - }); - - it("should render action button", () => { - render(InlineNotificationCustom); - - expect( - screen.getByRole("button", { name: "Learn more" }), - ).toBeInTheDocument(); - }); - - it("should cleanup timeout on unmount", () => { - vi.useFakeTimers(); - const clearTimeoutSpy = vi.spyOn(window, "clearTimeout"); - - const { unmount } = render(InlineNotification, { - props: { timeout: 1_000 }, - }); - - unmount(); - expect(clearTimeoutSpy).toHaveBeenCalled(); - vi.useRealTimers(); - }); - - it("should prevent default close behavior", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(InlineNotificationClose); - - await user.click(screen.getByRole("button")); - expect(consoleLog).toHaveBeenCalledWith("close", { timeout: false }); - expect(screen.getByRole("alert")).toBeInTheDocument(); - }); -}); diff --git a/tests/InlineNotification/InlineNotificationCustom.test.svelte b/tests/InlineNotification/InlineNotificationCustom.test.svelte deleted file mode 100644 index 4186595f..00000000 --- a/tests/InlineNotification/InlineNotificationCustom.test.svelte +++ /dev/null @@ -1,14 +0,0 @@ - - - - Custom Title: - Custom subtitle content. - - Learn more - - diff --git a/tests/Link.test.svelte b/tests/Link.test.svelte new file mode 100644 index 00000000..1ebfe6d7 --- /dev/null +++ b/tests/Link.test.svelte @@ -0,0 +1,29 @@ + + +Carbon Design System + + + Carbon Design System + + + + Carbon Design System + + + + Carbon Design System + + + + Carbon Design System + + + + Carbon Design System + + + + Carbon Design System + diff --git a/tests/Link/Link.test.svelte b/tests/Link/Link.test.svelte deleted file mode 100644 index 61f98609..00000000 --- a/tests/Link/Link.test.svelte +++ /dev/null @@ -1,87 +0,0 @@ - - - - - -
    - { - e.preventDefault(); - console.log("click"); - }} - on:mouseover={() => { - console.log("mouseover"); - }} - on:mouseenter={() => { - console.log("mouseenter"); - }} - on:mouseleave={() => { - console.log("mouseleave"); - }} - > - Carbon Design System - -
    - - -
    - - Carbon Design System - -
    - - -
    - - Carbon Design System - -
    - - -
    - - Carbon Design System - -
    - - -
    - - Carbon Design System - - - - -
    - - -
    - - Carbon Design System - -
    - - -
    - - Carbon Design System - -
    - - -
    - - Carbon Design System - -
    - - -
    - - Carbon Design System - -
    diff --git a/tests/Link/Link.test.ts b/tests/Link/Link.test.ts deleted file mode 100644 index 014b1383..00000000 --- a/tests/Link/Link.test.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import Link from "./Link.test.svelte"; - -describe("Link", () => { - afterEach(() => { - vi.restoreAllMocks(); - }); - - it("renders with default props", () => { - render(Link); - const wrapper = screen.getByTestId("default-link"); - const link = wrapper.querySelector("a"); - - expect(link).toHaveClass("bx--link"); - expect(link).toHaveAttribute("href", "https://www.carbondesignsystem.com/"); - expect(link).toHaveTextContent("Carbon Design System"); - }); - - it("adds noopener noreferrer when target is _blank", () => { - render(Link); - const wrapper = screen.getByTestId("link-blank"); - const link = wrapper.querySelector("a"); - - expect(link).toHaveAttribute("target", "_blank"); - expect(link).toHaveAttribute("rel", "noopener noreferrer"); - }); - - it("supports inline variant", () => { - render(Link); - const wrapper = screen.getByTestId("link-inline"); - const link = wrapper.querySelector("a"); - - expect(link).toHaveClass("bx--link--inline"); - }); - - it("supports icon prop", () => { - render(Link); - const wrapper = screen.getByTestId("link-with-icon"); - const link = wrapper.querySelector("a"); - const iconWrapper = link?.querySelector(".bx--link__icon"); - - expect(iconWrapper).toBeInTheDocument(); - expect(iconWrapper?.querySelector("svg")).toBeInTheDocument(); - }); - - it("supports icon slot", () => { - render(Link); - const wrapper = screen.getByTestId("link-with-icon-slot"); - const link = wrapper.querySelector("a"); - const iconWrapper = link?.querySelector(".bx--link__icon"); - - expect(iconWrapper).toBeInTheDocument(); - expect(iconWrapper?.querySelector("svg")).toBeInTheDocument(); - }); - - it("supports large size variant", () => { - render(Link); - const wrapper = screen.getByTestId("link-large"); - const link = wrapper.querySelector("a"); - - expect(link).toHaveClass("bx--link--lg"); - }); - - it("supports small size variant", () => { - render(Link); - const wrapper = screen.getByTestId("link-small"); - const link = wrapper.querySelector("a"); - - expect(link).toHaveClass("bx--link--sm"); - }); - - it("supports disabled state", () => { - render(Link); - const wrapper = screen.getByTestId("link-disabled"); - const link = wrapper.querySelector("a"); - - expect(link).toHaveClass("bx--link--disabled"); - expect(link).toHaveAttribute("aria-disabled", "true"); - expect(link).toHaveAttribute("role", "link"); - }); - - it("supports visited state", () => { - render(Link); - const wrapper = screen.getByTestId("link-visited"); - const link = wrapper.querySelector("a"); - - expect(link).toHaveClass("bx--link--visited"); - }); - - it("supports click and mouse events", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Link); - - const wrapper = screen.getByTestId("default-link"); - const link = wrapper.querySelector("a"); - assert(link); - - await user.click(link); - expect(consoleLog).toHaveBeenCalledWith("click"); - - await user.hover(link); - expect(consoleLog).toHaveBeenCalledWith("mouseover"); - - await user.hover(link); - expect(consoleLog).toHaveBeenCalledWith("mouseenter"); - - await user.unhover(link); - expect(consoleLog).toHaveBeenCalledWith("mouseleave"); - expect(consoleLog).toHaveBeenCalledTimes(4); - }); - - it("prevents icon rendering when inline is true", () => { - render(Link); - const wrapper = screen.getByTestId("link-inline"); - const link = wrapper.querySelector("a"); - - expect(link).toHaveClass("bx--link--inline"); - expect(link?.querySelector(".bx--link__icon")).not.toBeInTheDocument(); - }); -}); diff --git a/tests/Loading.test.svelte b/tests/Loading.test.svelte new file mode 100644 index 00000000..6889445e --- /dev/null +++ b/tests/Loading.test.svelte @@ -0,0 +1,7 @@ + + + + + diff --git a/tests/Loading/Loading.test.svelte b/tests/Loading/Loading.test.svelte deleted file mode 100644 index aa152744..00000000 --- a/tests/Loading/Loading.test.svelte +++ /dev/null @@ -1,28 +0,0 @@ - - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    diff --git a/tests/Loading/Loading.test.ts b/tests/Loading/Loading.test.ts deleted file mode 100644 index 68d4f561..00000000 --- a/tests/Loading/Loading.test.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import Loading from "./Loading.test.svelte"; - -describe("Loading", () => { - it("renders with default props", () => { - render(Loading); - const wrapper = screen.getByTestId("default-loader"); - - // Should have overlay by default - expect(wrapper.querySelector(".bx--loading-overlay")).toBeInTheDocument(); - - // Should be active by default - const loader = wrapper.querySelector(".bx--loading"); - expect(loader).toBeInTheDocument(); - expect(loader).not.toHaveClass("bx--loading--stop"); - - // Should have correct ARIA attributes - expect(loader).toHaveAttribute("aria-atomic", "true"); - expect(loader).toHaveAttribute("aria-live", "assertive"); - - // Should have default description - const title = wrapper.querySelector("title"); - expect(title).toHaveTextContent("loading"); - }); - - it("renders without overlay", () => { - render(Loading); - const wrapper = screen.getByTestId("loader-no-overlay"); - - // Should not have overlay - expect( - wrapper.querySelector(".bx--loading-overlay"), - ).not.toBeInTheDocument(); - - // Should still have loader - expect(wrapper.querySelector(".bx--loading")).toBeInTheDocument(); - }); - - it("supports small variant", () => { - render(Loading); - const wrapper = screen.getByTestId("loader-small"); - - const loader = wrapper.querySelector(".bx--loading"); - expect(loader).toHaveClass("bx--loading--small"); - - // Small variant should have background circle - const backgroundCircle = wrapper.querySelector(".bx--loading__background"); - expect(backgroundCircle).toBeInTheDocument(); - expect(backgroundCircle).toHaveAttribute("r", "42"); - - // Should have stroke circle with correct radius - const strokeCircle = wrapper.querySelector(".bx--loading__stroke"); - expect(strokeCircle).toHaveAttribute("r", "42"); - }); - - it("supports inactive state", () => { - render(Loading); - const wrapper = screen.getByTestId("loader-inactive"); - - // Overlay should have stop class - const overlay = wrapper.querySelector(".bx--loading-overlay"); - expect(overlay).toHaveClass("bx--loading-overlay--stop"); - - // Loader should have stop class - const loader = wrapper.querySelector(".bx--loading"); - expect(loader).toHaveClass("bx--loading--stop"); - - // ARIA live should be off when inactive - expect(loader).toHaveAttribute("aria-live", "off"); - }); - - it("supports custom description", () => { - render(Loading); - const wrapper = screen.getByTestId("loader-description"); - - const title = wrapper.querySelector("title"); - expect(title).toHaveTextContent("Processing data..."); - }); - - it("renders with correct spinner radius", () => { - render(Loading); - - // Default (large) spinner - const defaultWrapper = screen.getByTestId("default-loader"); - const defaultStroke = defaultWrapper.querySelector(".bx--loading__stroke"); - expect(defaultStroke).toHaveAttribute("r", "44"); - - // Small spinner - const smallWrapper = screen.getByTestId("loader-small"); - const smallStroke = smallWrapper.querySelector(".bx--loading__stroke"); - expect(smallStroke).toHaveAttribute("r", "42"); - }); -}); diff --git a/tests/LocalStorage.test.svelte b/tests/LocalStorage.test.svelte new file mode 100644 index 00000000..b3268fd8 --- /dev/null +++ b/tests/LocalStorage.test.svelte @@ -0,0 +1,19 @@ + + + diff --git a/tests/LocalStorage/LocalStorage.test.svelte b/tests/LocalStorage/LocalStorage.test.svelte deleted file mode 100644 index 432f136f..00000000 --- a/tests/LocalStorage/LocalStorage.test.svelte +++ /dev/null @@ -1,19 +0,0 @@ - - - - - -
    - -
    - - -
    - -
    diff --git a/tests/LocalStorage/LocalStorage.test.ts b/tests/LocalStorage/LocalStorage.test.ts deleted file mode 100644 index d20aaaae..00000000 --- a/tests/LocalStorage/LocalStorage.test.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { render } from "@testing-library/svelte"; -import { setupLocalStorageMock } from "../setup-tests"; -import LocalStorage from "./LocalStorage.test.svelte"; - -describe("LocalStorage", () => { - const { setMockItem } = setupLocalStorageMock(); - - it("saves primitive value to localStorage on mount", () => { - render(LocalStorage); - - expect(localStorage.setItem).toHaveBeenCalledWith( - "local-storage-key", - "test-value", - ); - }); - - it("saves object value as JSON string", () => { - render(LocalStorage); - - expect(localStorage.setItem).toHaveBeenCalledWith( - "theme-settings", - JSON.stringify({ theme: "dark", fontSize: 16 }), - ); - }); - - it("loads existing primitive value from localStorage", () => { - setMockItem("local-storage-key", "existing-value"); - - render(LocalStorage); - expect(localStorage.getItem).toHaveBeenCalledWith("local-storage-key"); - }); - - it("loads existing object value from localStorage", () => { - // Set up existing value - const existingSettings = { theme: "light", fontSize: 14 }; - setMockItem("theme-settings", JSON.stringify(existingSettings)); - - render(LocalStorage); - expect(localStorage.getItem).toHaveBeenCalledWith("theme-settings"); - }); - - it("clears specific item from localStorage", () => { - const { component } = render(LocalStorage); - const storage = component.storage; - - if (storage) { - storage.clearItem(); - expect(localStorage.removeItem).toHaveBeenCalledWith("programmatic-key"); - } - }); - - it("clears all items from localStorage", () => { - const { component } = render(LocalStorage); - const storage = component.storage; - - if (storage) { - storage.clearAll(); - expect(localStorage.clear).toHaveBeenCalled(); - } - }); - - it("handles JSON parse errors gracefully", () => { - // Set up invalid JSON - setMockItem("local-storage-key", "{invalid-json}"); - - render(LocalStorage); - expect(localStorage.getItem).toHaveBeenCalledWith("local-storage-key"); - }); - - it("uses default key if none provided", () => { - render(LocalStorage); - - expect(localStorage.getItem).toHaveBeenCalledWith( - expect.stringContaining("local-storage-key"), - ); - }); -}); diff --git a/tests/LocalStorage/LocalStorageObject.test.svelte b/tests/LocalStorage/LocalStorageObject.test.svelte deleted file mode 100644 index 23a78c17..00000000 --- a/tests/LocalStorage/LocalStorageObject.test.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - -
    - { - console.log("update event", detail); - }} - /> -
    diff --git a/tests/LocalStorage/LocalStorageObject.test.ts b/tests/LocalStorage/LocalStorageObject.test.ts deleted file mode 100644 index d7228aac..00000000 --- a/tests/LocalStorage/LocalStorageObject.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { render } from "@testing-library/svelte"; -import LocalStorageObject from "./LocalStorageObject.test.svelte"; - -describe("LocalStorage - Object Values", () => { - let localStorageMock: { [key: string]: string }; - let originalLocalStorage: Storage; - - beforeEach(() => { - originalLocalStorage = global.localStorage; - localStorageMock = {}; - - global.localStorage = { - getItem: vi.fn((key) => localStorageMock[key] || null), - setItem: vi.fn((key, value) => { - localStorageMock[key] = value; - }), - removeItem: vi.fn((key) => { - delete localStorageMock[key]; - }), - clear: vi.fn(() => { - localStorageMock = {}; - }), - length: 0, - key: vi.fn(), - }; - }); - - afterEach(() => { - global.localStorage = originalLocalStorage; - localStorage.clear(); - vi.restoreAllMocks(); - localStorageMock = {}; - }); - - it("saves object value as JSON string", () => { - render(LocalStorageObject); - - expect(localStorage.setItem).toHaveBeenCalledWith( - "theme-settings", - JSON.stringify({ theme: "dark", fontSize: 16 }), - ); - }); - - it("loads existing object value from localStorage", () => { - const existingSettings = { theme: "light", fontSize: 14 }; - localStorageMock["theme-settings"] = JSON.stringify(existingSettings); - - render(LocalStorageObject); - expect(localStorage.getItem).toHaveBeenCalledWith("theme-settings"); - }); - - it("handles malformed JSON gracefully", () => { - localStorageMock["theme-settings"] = "{malformed-json}"; - - render(LocalStorageObject); - expect(localStorage.getItem).toHaveBeenCalledWith("theme-settings"); - }); -}); diff --git a/tests/LocalStorage/LocalStoragePrimitive.test.svelte b/tests/LocalStorage/LocalStoragePrimitive.test.svelte deleted file mode 100644 index 60d6a598..00000000 --- a/tests/LocalStorage/LocalStoragePrimitive.test.svelte +++ /dev/null @@ -1,18 +0,0 @@ - - -
    - { - console.log("save event"); - }} - on:update={({ detail }) => { - console.log("update event", detail); - }} - /> -
    diff --git a/tests/LocalStorage/LocalStoragePrimitive.test.ts b/tests/LocalStorage/LocalStoragePrimitive.test.ts deleted file mode 100644 index f20a32df..00000000 --- a/tests/LocalStorage/LocalStoragePrimitive.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { render } from "@testing-library/svelte"; -import { setupLocalStorageMock } from "../setup-tests"; -import LocalStoragePrimitive from "./LocalStoragePrimitive.test.svelte"; - -describe("LocalStorage - Primitive Values", () => { - const { setMockItem } = setupLocalStorageMock(); - let consoleLog: ReturnType; - - beforeEach(() => { - consoleLog = vi.spyOn(console, "log"); - }); - - it("saves primitive value to localStorage on mount", () => { - render(LocalStoragePrimitive); - expect(localStorage.setItem).toHaveBeenCalledWith("test-key", "test-value"); - }); - - it("loads existing primitive value from localStorage", () => { - setMockItem("test-key", "existing-value"); - - render(LocalStoragePrimitive); - expect(localStorage.getItem).toHaveBeenCalledWith("test-key"); - }); - - it("dispatches save event when setting initial value", () => { - render(LocalStoragePrimitive); - expect(consoleLog).toHaveBeenCalledWith("save event"); - }); - - it("handles invalid values gracefully", () => { - setMockItem("test-key", "{invalid-value}"); - - render(LocalStoragePrimitive); - expect(localStorage.getItem).toHaveBeenCalledWith("test-key"); - }); -}); diff --git a/tests/Modal.test.svelte b/tests/Modal.test.svelte new file mode 100644 index 00000000..bb5b5d80 --- /dev/null +++ b/tests/Modal.test.svelte @@ -0,0 +1,20 @@ + + + + + +

    Create a new Cloudant database in the US South region.

    +
    diff --git a/tests/Modal/Modal.test.svelte b/tests/Modal/Modal.test.svelte deleted file mode 100644 index d6ac5f26..00000000 --- a/tests/Modal/Modal.test.svelte +++ /dev/null @@ -1,57 +0,0 @@ - - - console.log("open")} - on:close={() => console.log("close")} - on:submit={() => console.log("submit")} - on:click:button--primary={() => console.log("click:button--primary")} - on:click:button--secondary={(e) => - console.log("click:button--secondary", e.detail)} - on:transitionend={(e) => console.log("transitionend", e.detail)} -> - - - diff --git a/tests/Modal/Modal.test.ts b/tests/Modal/Modal.test.ts deleted file mode 100644 index 10268226..00000000 --- a/tests/Modal/Modal.test.ts +++ /dev/null @@ -1,284 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { tick } from "svelte"; -import { user } from "../setup-tests"; -import ModalTest from "./Modal.test.svelte"; - -describe("Modal", () => { - beforeEach(() => { - vi.clearAllMocks(); - }); - - it("renders with default props", async () => { - const { container } = render(ModalTest, { - props: { - open: true, - modalHeading: "Test Modal", - primaryButtonText: "Save", - secondaryButtonText: "Cancel", - }, - }); - - // Check if modal container is rendered - const modalContainer = container.querySelector(".bx--modal-container"); - expect(modalContainer).toBeInTheDocument(); - - // Check if modal heading is rendered - expect(screen.getByText("Test Modal")).toBeInTheDocument(); - - // Check if buttons are rendered - expect(screen.getByText("Save")).toBeInTheDocument(); - expect(screen.getByText("Cancel")).toBeInTheDocument(); - - // Check if close button is rendered - const closeButton = screen.getByLabelText("Close the modal"); - expect(closeButton).toBeInTheDocument(); - - // Check if modal has correct ARIA attributes - expect(modalContainer).toHaveAttribute("role", "dialog"); - expect(modalContainer).toHaveAttribute("aria-modal", "true"); - expect(modalContainer).toHaveAttribute("aria-label", "Test Modal"); - }); - - it("renders with basic structure", () => { - render(ModalTest, { - props: { - open: true, - modalHeading: "Test Modal", - primaryButtonText: "Save", - secondaryButtonText: "Cancel", - }, - }); - - expect(screen.getByRole("dialog")).toBeInTheDocument(); - expect(screen.getByText("Test Modal")).toBeInTheDocument(); - expect(screen.getByText("Save")).toBeInTheDocument(); - expect(screen.getByText("Cancel")).toBeInTheDocument(); - expect(screen.getByLabelText("Close the modal")).toBeInTheDocument(); - expect(screen.getByRole("dialog")).toHaveAttribute("aria-modal", "true"); - }); - - it("opens and closes properly", async () => { - const consoleLog = vi.spyOn(console, "log"); - const { component } = render(ModalTest, { - props: { - open: false, - modalHeading: "Test Modal", - }, - }); - - // Open the modal - component.$set({ open: true }); - await tick(); - expect(screen.getByRole("dialog")).toBeInTheDocument(); - expect(consoleLog).toHaveBeenCalledWith("open"); - - // Close the modal - component.$set({ open: false }); - await tick(); - expect(consoleLog).toHaveBeenCalledWith("close"); - }); - - it("handles form submission", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(ModalTest, { - props: { - open: true, - hasForm: true, - modalHeading: "Form Modal", - primaryButtonText: "Save", - }, - }); - - const primaryButton = screen.getByRole("button", { name: "Save" }); - await user.click(primaryButton); - expect(consoleLog).toHaveBeenCalledWith("submit"); - expect(consoleLog).toHaveBeenCalledWith("click:button--primary"); - }); - - it("handles button clicks", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(ModalTest, { - props: { - open: true, - primaryButtonText: "Save", - secondaryButtonText: "Cancel", - }, - }); - - await user.click(screen.getByText("Save")); - expect(consoleLog).toHaveBeenCalledWith("click:button--primary"); - - await user.click(screen.getByText("Cancel")); - expect(consoleLog).toHaveBeenCalledWith("click:button--secondary", { - text: "Cancel", - }); - }); - - it("supports different modal sizes", () => { - type Size = "xs" | "sm" | "lg"; - const sizeMappings = { - xs: "bx--modal-container--xs", - sm: "bx--modal-container--sm", - lg: "bx--modal-container--lg", - } as const; - - // Test specific sizes - (Object.keys(sizeMappings) as Size[]).forEach((size) => { - const { unmount } = render(ModalTest, { - props: { - open: true, - size, - modalHeading: `${size} Modal`, - }, - }); - - const modal = screen.getByRole("dialog"); - expect(modal).toHaveClass(sizeMappings[size]); - unmount(); - }); - - // Test default (medium) size - const { unmount } = render(ModalTest, { - props: { - open: true, - modalHeading: "Medium Modal", - }, - }); - - const modal = screen.getByRole("dialog"); - expect(modal).toHaveClass("bx--modal-container"); - expect(modal).not.toHaveClass("bx--modal-container--xs"); - expect(modal).not.toHaveClass("bx--modal-container--sm"); - expect(modal).not.toHaveClass("bx--modal-container--lg"); - unmount(); - }); - - it("supports danger and alert variants", () => { - render(ModalTest, { - props: { - open: true, - danger: true, - alert: true, - modalHeading: "Danger Alert Modal", - primaryButtonText: "Delete", - }, - }); - - const primaryButton = screen.getByRole("button", { name: "Delete" }); - expect(primaryButton).toHaveClass("bx--btn--danger"); - - const modal = screen.getByRole("alertdialog"); - expect(modal).toHaveAttribute("aria-label", "Danger Alert Modal"); - }); - - it("handles scrolling content", () => { - render(ModalTest, { - props: { - open: true, - hasScrollingContent: true, - modalHeading: "Scrolling Modal", - }, - }); - - const modalBody = screen.getByRole("region"); - expect(modalBody).toHaveClass("bx--modal-scroll-content"); - }); - - it("should focus close button when open", async () => { - render(ModalTest, { - props: { - open: true, - }, - }); - - const closeButton = screen.getByLabelText("Close the modal"); - expect(closeButton).toHaveFocus(); - }); - - it("respects the selectorPrimaryFocus prop", async () => { - render(ModalTest, { - props: { - open: true, - modalHeading: "Focus Test", - selectorPrimaryFocus: "#test-focus", - }, - }); - - expect(screen.getByTestId("test-focus")).toHaveFocus(); - }); - - it("prevents closing when clicking outside if configured", async () => { - const { component } = render(ModalTest, { - props: { - open: true, - preventCloseOnClickOutside: true, - modalHeading: "Prevent Close Test", - }, - }); - - const closeHandler = vi.fn(); - component.$on("close", closeHandler); - - // Click outside the modal - await user.click(document.body); - expect(closeHandler).not.toHaveBeenCalled(); - }); - - it("supports passive modal variant", () => { - render(ModalTest, { - props: { - open: true, - passiveModal: true, - modalHeading: "Passive Modal", - primaryButtonText: "Save", - secondaryButtonText: "Cancel", - }, - }); - - // Verify close button is in header - const closeButton = screen.getByLabelText("Close the modal"); - expect(closeButton.closest(".bx--modal-header")).toBeInTheDocument(); - - // Verify no footer is present - expect( - screen.queryByRole("button", { name: "Save" }), - ).not.toBeInTheDocument(); - expect( - screen.queryByRole("button", { name: "Cancel" }), - ).not.toBeInTheDocument(); - expect( - screen.queryByRole("button", { name: "Close the modal" }), - ).toBeInTheDocument(); - }); - - it("handles closing through various methods", async () => { - const consoleLog = vi.spyOn(console, "log"); - const { component } = render(ModalTest, { - props: { - open: true, - modalHeading: "Close Test Modal", - }, - }); - - // Close via escape key - await user.keyboard("{Escape}"); - expect(consoleLog).toHaveBeenCalledWith("close"); - - component.$set({ open: true }); - await tick(); - - expect(consoleLog).toHaveBeenCalledWith("open"); - - // Close via clicking outside - await user.click(document.body); - expect(consoleLog).toHaveBeenCalledWith("close"); - - component.$set({ open: true }); - await tick(); - - // Close via close button - const closeButton = screen.getByLabelText("Close the modal"); - await user.click(closeButton); - expect(consoleLog).toHaveBeenCalledWith("close"); - }); -}); diff --git a/tests/ModalExtraSmall.test.svelte b/tests/ModalExtraSmall.test.svelte new file mode 100644 index 00000000..761c4dbf --- /dev/null +++ b/tests/ModalExtraSmall.test.svelte @@ -0,0 +1,17 @@ + + + +

    Create a new Cloudant database in the US South region.

    +
    diff --git a/tests/ModalLarge.test.svelte b/tests/ModalLarge.test.svelte new file mode 100644 index 00000000..1b9474d9 --- /dev/null +++ b/tests/ModalLarge.test.svelte @@ -0,0 +1,17 @@ + + + +

    Create a new Cloudant database in the US South region.

    +
    diff --git a/tests/ModalPreventOutsideClick.test.svelte b/tests/ModalPreventOutsideClick.test.svelte new file mode 100644 index 00000000..6bb89681 --- /dev/null +++ b/tests/ModalPreventOutsideClick.test.svelte @@ -0,0 +1,17 @@ + + + +

    Create a new Cloudant database in the US South region.

    +
    diff --git a/tests/ModalSmall.test.svelte b/tests/ModalSmall.test.svelte new file mode 100644 index 00000000..7d4c935f --- /dev/null +++ b/tests/ModalSmall.test.svelte @@ -0,0 +1,17 @@ + + + +

    Create a new Cloudant database in the US South region.

    +
    diff --git a/tests/MultiSelect.test.svelte b/tests/MultiSelect.test.svelte new file mode 100644 index 00000000..bb632fc5 --- /dev/null +++ b/tests/MultiSelect.test.svelte @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tests/MultiSelect/MultiSelect.test.svelte b/tests/MultiSelect/MultiSelect.test.svelte deleted file mode 100644 index 3c35ba17..00000000 --- a/tests/MultiSelect/MultiSelect.test.svelte +++ /dev/null @@ -1,57 +0,0 @@ - - - { - console.log("select", e.detail); - }} - on:clear={(e) => { - console.log("clear", e.detail); - }} -/> diff --git a/tests/MultiSelect/MultiSelect.test.ts b/tests/MultiSelect/MultiSelect.test.ts deleted file mode 100644 index 6beb697f..00000000 --- a/tests/MultiSelect/MultiSelect.test.ts +++ /dev/null @@ -1,537 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import MultiSelect from "./MultiSelect.test.svelte"; -import MultiSelectSlot from "./MultiSelectSlot.test.svelte"; - -const items = [ - { id: "0", text: "Slack" }, - { id: "1", text: "Email" }, - { id: "2", text: "Fax" }, -] as const; - -describe("MultiSelect", () => { - const openMenu = async () => - await user.click( - await screen.findByLabelText("Open menu", { - selector: `[role="button"]`, - }), - ); - - const closeMenu = async () => - await user.click( - await screen.findByLabelText("Close menu", { - selector: `[role="button"]`, - }), - ); - - const toggleOption = async (optionText: string) => - await user.click( - await screen.findByText((text) => text.trim() === optionText), - ); - - const nthRenderedOptionText = (index: number) => - screen.queryAllByRole("option").at(index)?.textContent?.trim(); - - it("renders with default props", () => { - render(MultiSelect, { - props: { - items, - titleText: "Contact methods", - }, - }); - - expect(screen.getByText("Contact methods")).toBeInTheDocument(); - expect(screen.getByRole("button")).toBeInTheDocument(); - expect(screen.getByRole("button")).toHaveAttribute( - "aria-expanded", - "false", - ); - }); - - it("renders default slot", () => { - render(MultiSelectSlot, { items }); - expect(screen.getByText("1 Email 0")).toBeInTheDocument(); - expect(screen.getByText("2 Fax 1")).toBeInTheDocument(); - expect(screen.getByText("0 Slack 2")).toBeInTheDocument(); - }); - - describe("selection behavior", () => { - it("handles item selection", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(MultiSelect, { - props: { items }, - }); - - await openMenu(); - await toggleOption("Slack"); - expect(consoleLog).toHaveBeenCalledWith("select", { - selectedIds: ["0"], - selected: [{ id: "0", text: "Slack", checked: true }], - unselected: [ - { id: "1", text: "Email", checked: false }, - { id: "2", text: "Fax", checked: false }, - ], - }); - }); - - it("handles multiple selections", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(MultiSelect, { - props: { items }, - }); - - await openMenu(); - await toggleOption("Slack"); - await toggleOption("Email"); - expect(consoleLog).toHaveBeenCalledWith("select", { - selectedIds: ["0"], - selected: [{ id: "0", text: "Slack", checked: true }], - unselected: [ - { id: "1", text: "Email", checked: false }, - { id: "2", text: "Fax", checked: false }, - ], - }); - expect(consoleLog).toHaveBeenCalledWith("select", { - selectedIds: ["1", "0"], - selected: [ - { id: "1", text: "Email", checked: true }, - { id: "0", text: "Slack", checked: true }, - ], - unselected: [{ id: "2", text: "Fax", checked: false }], - }); - }); - - it("handles item deselection", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(MultiSelect, { - props: { - items, - selectedIds: ["0"], - }, - }); - - await openMenu(); - await toggleOption("Slack"); - expect(consoleLog).toHaveBeenCalledWith("select", { - selectedIds: [], - selected: [], - unselected: [ - { id: "0", text: "Slack", checked: false }, - { id: "1", text: "Email", checked: false }, - { id: "2", text: "Fax", checked: false }, - ], - }); - - await toggleOption("Slack"); - expect(consoleLog).toHaveBeenCalledWith("select", { - selectedIds: [], - selected: [], - unselected: [ - { id: "0", text: "Slack", checked: false }, - { id: "1", text: "Email", checked: false }, - { id: "2", text: "Fax", checked: false }, - ], - }); - }); - }); - - describe("filtering behavior", () => { - it("filters items based on input", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(MultiSelect, { - props: { - items, - filterable: true, - placeholder: "Filter items...", - }, - }); - - await openMenu(); - const input = screen.getByPlaceholderText("Filter items..."); - await user.type(input, "em"); - - expect(screen.queryByText("Slack")).not.toBeInTheDocument(); - expect(screen.getByText("Email")).toBeInTheDocument(); - expect(screen.queryByText("Fax")).not.toBeInTheDocument(); - - await user.keyboard("{ArrowDown}{Enter}"); - expect(consoleLog).toHaveBeenCalledWith("select", { - selectedIds: ["1"], - selected: [{ id: "1", text: "Email", checked: true }], - unselected: [ - { id: "2", text: "Fax", checked: false }, - { id: "0", text: "Slack", checked: false }, - ], - }); - }); - - it("uses custom filter function", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(MultiSelect, { - props: { - items, - filterable: true, - filterItem: (item, value) => { - return item.text.toLowerCase().startsWith(value.toLowerCase()); - }, - }, - }); - - await openMenu(); - const input = screen.getByRole("combobox"); - await user.type(input, "e"); - - expect(screen.queryByText("Slack")).not.toBeInTheDocument(); - expect(screen.getByText("Email")).toBeInTheDocument(); - expect(screen.queryByText("Fax")).not.toBeInTheDocument(); - - await user.keyboard("{ArrowDown}{Enter}"); - expect(consoleLog).toHaveBeenCalledWith("select", { - selectedIds: ["1"], - selected: [{ id: "1", text: "Email", checked: true }], - unselected: [ - { id: "2", text: "Fax", checked: false }, - { id: "0", text: "Slack", checked: false }, - ], - }); - }); - }); - - describe("sorting behavior", () => { - it("initially sorts items alphabetically", async () => { - render(MultiSelect, { - props: { - items: [ - { id: "1", text: "C" }, - { id: "3", text: "A" }, - { id: "2", text: "B" }, - ], - }, - }); - - await openMenu(); - expect(nthRenderedOptionText(0)).toBe("A"); - expect(nthRenderedOptionText(1)).toBe("B"); - expect(nthRenderedOptionText(2)).toBe("C"); - }); - - it("moves selected items to top with selectionFeedback: top", async () => { - render(MultiSelect, { - props: { - items: [ - { id: "3", text: "C" }, - { id: "1", text: "A" }, - { id: "2", text: "B" }, - ], - selectionFeedback: "top", - }, - }); - - await openMenu(); - expect(nthRenderedOptionText(0)).toBe("A"); - - await toggleOption("C"); - expect(nthRenderedOptionText(0)).toBe("C"); - - await toggleOption("C"); - expect(nthRenderedOptionText(0)).toBe("A"); - }); - - it("sorts after reopen with selectionFeedback: top-after-reopen", async () => { - render(MultiSelect, { - props: { - items: [ - { id: "3", text: "C" }, - { id: "1", text: "A" }, - { id: "2", text: "B" }, - ], - }, - }); - - await openMenu(); - expect(nthRenderedOptionText(0)).toBe("A"); - - await toggleOption("C"); - expect(nthRenderedOptionText(0)).toBe("A"); - - await closeMenu(); - await openMenu(); - expect(nthRenderedOptionText(0)).toBe("C"); - }); - - it("maintains order with selectionFeedback: fixed", async () => { - render(MultiSelect, { - props: { - items: [ - { id: "3", text: "C" }, - { id: "1", text: "A" }, - { id: "2", text: "B" }, - ], - selectionFeedback: "fixed", - }, - }); - - await openMenu(); - expect(nthRenderedOptionText(0)).toBe("A"); - - await toggleOption("C"); - expect(nthRenderedOptionText(0)).toBe("A"); - - await closeMenu(); - await openMenu(); - expect(nthRenderedOptionText(0)).toBe("A"); - }); - }); - - describe("variants and states", () => { - it("renders in light variant", async () => { - render(MultiSelect, { - props: { - items, - light: true, - }, - }); - - await openMenu(); - const listBox = screen.getByRole("listbox").closest(".bx--list-box"); - expect(listBox).toHaveClass("bx--list-box--light"); - }); - - it("renders in inline variant", () => { - render(MultiSelect, { - props: { - items, - type: "inline", - }, - }); - - const wrapper = screen - .getByRole("button") - .closest(".bx--multi-select__wrapper"); - expect(wrapper).toHaveClass("bx--multi-select__wrapper--inline"); - }); - - it("handles invalid state", () => { - render(MultiSelect, { - props: { - items, - invalid: true, - invalidText: "Invalid selection", - }, - }); - - expect(screen.getByText("Invalid selection")).toBeInTheDocument(); - const wrapper = screen.getByRole("button").closest(".bx--list-box"); - expect(wrapper).toHaveClass("bx--multi-select--invalid"); - }); - - it("handles warning state", () => { - render(MultiSelect, { - props: { - items, - warn: true, - warnText: "Warning message", - }, - }); - - expect(screen.getByText("Warning message")).toBeInTheDocument(); - const wrapper = screen.getByRole("button").closest(".bx--list-box"); - expect(wrapper).toHaveClass("bx--list-box--warning"); - }); - - it("handles disabled state", () => { - render(MultiSelect, { - props: { - items, - disabled: true, - }, - }); - - const field = screen.getByRole("button"); - expect(field).toHaveAttribute("aria-disabled", "true"); - expect(field).toHaveAttribute("tabindex", "-1"); - expect(field.closest(".bx--multi-select")).toHaveAttribute( - "tabindex", - "-1", - ); - }); - - it("handles disabled items", async () => { - const itemsWithDisabled = [ - { id: "0", text: "Slack" }, - { id: "1", text: "Email", disabled: true }, - { id: "2", text: "Fax" }, - ]; - - render(MultiSelect, { - props: { - items: itemsWithDisabled, - }, - }); - - await openMenu(); - const emailOption = screen - .getByText("Email") - .closest(".bx--list-box__menu-item"); - expect(emailOption).toHaveAttribute("disabled"); - }); - }); - - describe("accessibility", () => { - it("handles hidden label", () => { - render(MultiSelect, { - props: { - items, - titleText: "Contact methods", - hideLabel: true, - }, - }); - - const label = screen.getByText("Contact methods"); - expect(label).toHaveClass("bx--visually-hidden"); - }); - }); - - describe("custom formatting", () => { - it("handles custom itemToString", () => { - render(MultiSelect, { - props: { - items, - selectedIds: ["0"], - itemToString: (item) => `${item.text} (${item.id})`, - }, - }); - - expect(screen.getByText("Slack (0)")).toBeInTheDocument(); - }); - - it("handles custom itemToInput", async () => { - render(MultiSelect, { - props: { - items, - itemToInput: (item) => ({ - name: `contact_${item.id}`, - value: item.text.toLowerCase(), - }), - }, - }); - - await openMenu(); - const checkbox = screen.getByText("Slack"); - const checkboxWrapper = checkbox.closest(".bx--checkbox-wrapper"); - const checkboxInput = checkboxWrapper?.querySelector("input"); - expect(checkboxInput).toHaveAttribute("name", "contact_0"); - expect(checkboxInput).toHaveAttribute("value", "slack"); - }); - }); - - it("does not show helper text if warn is true", () => { - render(MultiSelect, { - props: { - items, - helperText: "Help", - warn: true, - }, - }); - expect(screen.queryByText("Help")).not.toBeInTheDocument(); - }); - - it("does not show helper text if invalid is true", () => { - render(MultiSelect, { - props: { - items, - helperText: "Help", - invalid: true, - }, - }); - expect(screen.queryByText("Help")).not.toBeInTheDocument(); - }); - - it("does not show helper text if inline is true", () => { - render(MultiSelect, { - props: { - items, - helperText: "Help", - type: "inline", - }, - }); - expect(screen.queryByText("Help")).not.toBeInTheDocument(); - }); - - it("clears all selections when clear button is clicked", async () => { - render(MultiSelect, { - props: { - items, - selectedIds: ["0", "1"], - }, - }); - await openMenu(); - - const options = screen.getAllByRole("option"); - expect(options[0]).toHaveAttribute("aria-selected", "true"); - expect(options[1]).toHaveAttribute("aria-selected", "true"); - expect(options[2]).toHaveAttribute("aria-selected", "false"); - - const clearButton = screen.getByRole("button", { name: /clear/i }); - await user.click(clearButton); - await closeMenu(); - - expect(options[0]).toHaveAttribute("aria-selected", "false"); - expect(options[1]).toHaveAttribute("aria-selected", "false"); - expect(options[2]).toHaveAttribute("aria-selected", "false"); - }); - - it("skips disabled items during keyboard navigation", async () => { - render(MultiSelect, { - props: { - items: [ - { id: "1", text: "Aa" }, - { id: "2", text: "Ba", disabled: true }, - { id: "3", text: "Ca" }, - ], - filterable: true, - placeholder: "Filter...", - }, - }); - await openMenu(); - const input = screen.getByPlaceholderText("Filter..."); - - await user.type(input, "a"); - await user.keyboard("{ArrowDown}"); - await user.keyboard("{ArrowDown}"); - await user.keyboard("{Enter}"); - - const options = screen.getAllByRole("option"); - expect(options[2]).toHaveAttribute("aria-selected", "true"); - }); - - it("focuses input when filterable and menu is opened", async () => { - render(MultiSelect, { - props: { - items, - filterable: true, - placeholder: "Filter...", - }, - }); - await openMenu(); - const input = screen.getByPlaceholderText("Filter..."); - expect(input).toHaveFocus(); - }); - - it("does not select disabled items when clicked", async () => { - render(MultiSelect, { - props: { - items: [ - { id: "1", text: "A" }, - { id: "2", text: "B", disabled: true }, - { id: "3", text: "C" }, - ], - }, - }); - await openMenu(); - const disabledOption = screen.getByText("B").closest("[role='option']"); - - await user.click(disabledOption!); - expect(disabledOption).toHaveAttribute("aria-selected", "false"); - }); -}); diff --git a/tests/MultiSelect/MultiSelectSlot.test.svelte b/tests/MultiSelect/MultiSelectSlot.test.svelte deleted file mode 100644 index a4fbfec1..00000000 --- a/tests/MultiSelect/MultiSelectSlot.test.svelte +++ /dev/null @@ -1,12 +0,0 @@ - - - -
    - {item.id} {item.text} {index} -
    -
    diff --git a/tests/NarrowGrid.test.svelte b/tests/NarrowGrid.test.svelte new file mode 100644 index 00000000..a39cd612 --- /dev/null +++ b/tests/NarrowGrid.test.svelte @@ -0,0 +1,12 @@ + + + + + Column + Column + Column + Column + + diff --git a/tests/NumberInput.test.svelte b/tests/NumberInput.test.svelte new file mode 100644 index 00000000..61a2a589 --- /dev/null +++ b/tests/NumberInput.test.svelte @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/NumberInput/NumberInput.test.svelte b/tests/NumberInput/NumberInput.test.svelte deleted file mode 100644 index 9794540c..00000000 --- a/tests/NumberInput/NumberInput.test.svelte +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
    {value}
    diff --git a/tests/NumberInput/NumberInput.test.ts b/tests/NumberInput/NumberInput.test.ts deleted file mode 100644 index 769a9f7c..00000000 --- a/tests/NumberInput/NumberInput.test.ts +++ /dev/null @@ -1,237 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import NumberInput from "./NumberInput.test.svelte"; -import NumberInputCustom from "./NumberInputCustom.test.svelte"; - -describe("NumberInput", () => { - it("should render with default props", () => { - render(NumberInput); - - expect(screen.getByLabelText("Clusters")).toBeInTheDocument(); - expect(screen.getByRole("spinbutton")).toHaveValue(0); - }); - - it("should handle step value", () => { - render(NumberInput, { props: { step: 0.1 } }); - - expect(screen.getByRole("spinbutton")).toHaveAttribute("step", "0.1"); - }); - - it("should handle min and max values", () => { - render(NumberInput, { props: { min: 4, max: 20 } }); - - const input = screen.getByRole("spinbutton"); - expect(input).toHaveAttribute("min", "4"); - expect(input).toHaveAttribute("max", "20"); - }); - - it("should handle different sizes", () => { - (["sm", "xl"] as const).forEach((size) => { - const { container } = render(NumberInput, { - props: { size }, - }); - - const input = container.querySelector("input"); - expect(input?.closest(".bx--number")).toHaveClass(`bx--number--${size}`); - container.remove(); - }); - }); - - it("should handle light variant", () => { - render(NumberInput, { props: { light: true } }); - - expect(screen.getByRole("spinbutton").closest(".bx--number")).toHaveClass( - "bx--number--light", - ); - }); - - it("should handle disabled state", () => { - render(NumberInput, { - props: { disabled: true }, - }); - - const input = screen.getByRole("spinbutton"); - expect(input).toBeDisabled(); - expect(screen.getByText("Clusters")).toHaveClass("bx--label--disabled"); - }); - - it("should handle helper text", () => { - render(NumberInput, { - props: { helperText: "Helper text" }, - }); - - expect(screen.getByText("Helper text")).toHaveClass( - "bx--form__helper-text", - ); - }); - - it("should handle invalid state", () => { - render(NumberInput, { - props: { invalid: true, invalidText: "Invalid input" }, - }); - - const input = screen.getByRole("spinbutton"); - expect(input).toHaveAttribute("aria-invalid", "true"); - expect(screen.getByText("Invalid input")).toBeInTheDocument(); - - expect(input.closest(".bx--number")).toHaveAttribute( - "data-invalid", - "true", - ); - }); - - it("should handle warning state", () => { - render(NumberInput, { - props: { warn: true, warnText: "Warning message" }, - }); - - const input = screen.getByRole("spinbutton"); - expect(input.closest(".bx--number__input-wrapper")).toHaveClass( - "bx--number__input-wrapper--warning", - ); - expect(screen.getByText("Warning message")).toBeInTheDocument(); - }); - - it("should handle hidden label", () => { - render(NumberInput, { props: { hideLabel: true } }); - - expect(screen.getByText("Clusters")).toHaveClass("bx--visually-hidden"); - }); - - it("should handle custom id", () => { - render(NumberInput, { props: { id: "custom-id" } }); - - const input = screen.getByRole("spinbutton"); - expect(input).toHaveAttribute("id", "custom-id"); - expect(screen.getByText("Clusters")).toHaveAttribute("for", "custom-id"); - }); - - it("should handle custom name", () => { - render(NumberInput, { props: { name: "custom-name" } }); - - expect(screen.getByRole("spinbutton")).toHaveAttribute( - "name", - "custom-name", - ); - }); - - it("should handle readonly state", () => { - render(NumberInput, { props: { readonly: true } }); - - expect(screen.getByRole("spinbutton")).toHaveAttribute("readonly"); - }); - - it("should handle hidden steppers", () => { - render(NumberInput, { props: { hideSteppers: true } }); - - expect( - screen.queryByRole("button", { name: "Increment number" }), - ).not.toBeInTheDocument(); - expect( - screen.queryByRole("button", { name: "Decrement number" }), - ).not.toBeInTheDocument(); - }); - - // TODO(bug): The icon descriptions are not being applied. - it.skip("should handle custom icon descriptions", () => { - render(NumberInput, { - props: { iconDescription: "Custom description" }, - }); - - screen.getAllByRole("button").forEach((button) => { - expect(button).toHaveAttribute("title", "Custom description"); - }); - }); - - it("should handle custom slots", () => { - render(NumberInputCustom); - - expect(screen.getByText("Custom Label Text")).toBeInTheDocument(); - }); - - it("should handle value binding", async () => { - render(NumberInput); - - const input = screen.getByRole("spinbutton"); - await user.type(input, "5"); - expect(screen.getByTestId("value").textContent).toBe("5"); - }); - - it("should handle increment/decrement buttons", async () => { - render(NumberInput); - - const incrementButton = screen.getByRole("button", { - name: "Increment number", - }); - const decrementButton = screen.getByRole("button", { - name: "Decrement number", - }); - - await user.click(incrementButton); - expect(screen.getByTestId("value").textContent).toBe("1"); - - await user.click(decrementButton); - expect(screen.getByTestId("value").textContent).toBe("0"); - }); - - it("should handle empty value when allowEmpty is true", async () => { - render(NumberInput, { - props: { allowEmpty: true }, - }); - - const input = screen.getByRole("spinbutton"); - await user.clear(input); - expect(input).toHaveValue(null); - }); - - it("should handle min/max validation", async () => { - render(NumberInput, { props: { min: 4, max: 20 } }); - - const input = screen.getByRole("spinbutton"); - await user.type(input, "25"); - expect(screen.getByTestId("value").textContent).toBe("25"); - expect(screen.getByRole("spinbutton")).toHaveAttribute( - "aria-invalid", - "true", - ); - }); - - it("should not show helper text when invalid", () => { - render(NumberInput, { - props: { - invalid: true, - invalidText: "Invalid input", - helperText: "Helper text", - }, - }); - - expect(screen.queryByText("Helper text")).not.toBeInTheDocument(); - expect(screen.getByText("Invalid input")).toBeInTheDocument(); - }); - - it("should not show helper text when warning", () => { - render(NumberInput, { - props: { - warn: true, - warnText: "Warning message", - helperText: "Helper text", - }, - }); - - expect(screen.queryByText("Helper text")).not.toBeInTheDocument(); - expect(screen.getByText("Warning message")).toBeInTheDocument(); - }); - - it("should handle disabled helper text", () => { - render(NumberInput, { - props: { - disabled: true, - helperText: "Helper text", - }, - }); - - expect(screen.getByText("Helper text")).toHaveClass( - "bx--form__helper-text--disabled", - ); - }); -}); diff --git a/tests/NumberInput/NumberInputCustom.test.svelte b/tests/NumberInput/NumberInputCustom.test.svelte deleted file mode 100644 index 4fa329a9..00000000 --- a/tests/NumberInput/NumberInputCustom.test.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - - Custom Label Text - diff --git a/tests/OffsetColumns.test.svelte b/tests/OffsetColumns.test.svelte new file mode 100644 index 00000000..085ec706 --- /dev/null +++ b/tests/OffsetColumns.test.svelte @@ -0,0 +1,32 @@ + + + + + + Offset 3 + + + Offset 2 + + + Offset 1 + + + Offset 0 + + + diff --git a/tests/OrderedList.test.svelte b/tests/OrderedList.test.svelte new file mode 100644 index 00000000..46856519 --- /dev/null +++ b/tests/OrderedList.test.svelte @@ -0,0 +1,57 @@ + + + + Ordered list item + Ordered list item + Ordered list item + + + + + Ordered list item + + + Ordered list item + + + Ordered list item + + + + + + Ordered list level 1 + + Ordered list level 2 + + Ordered list level 3 + + Ordered list level 3 + Ordered list level 3 + + + + + Ordered list level 1 + Ordered list level 1 + + + + + Ordered list level 1 + + Ordered list level 2 + + Ordered list level 3 + + Ordered list level 3 + Ordered list level 3 + + + + + Ordered list level 1 + Ordered list level 1 + diff --git a/tests/OrderedList/OrderedList.test.svelte b/tests/OrderedList/OrderedList.test.svelte deleted file mode 100644 index 07e2a41c..00000000 --- a/tests/OrderedList/OrderedList.test.svelte +++ /dev/null @@ -1,36 +0,0 @@ - - - - -
    - - {#each items as item} - - {item} - {#if nested && nestedItems.length > 0} - - {#each nestedItems as nestedItem} - {nestedItem} - {/each} - - {/if} - - {/each} - -
    diff --git a/tests/OrderedList/OrderedList.test.ts b/tests/OrderedList/OrderedList.test.ts deleted file mode 100644 index 56357e5c..00000000 --- a/tests/OrderedList/OrderedList.test.ts +++ /dev/null @@ -1,172 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import OrderedList from "./OrderedList.test.svelte"; - -describe("OrderedList", () => { - it("should render with default props", () => { - render(OrderedList); - - const list = screen.getByRole("list"); - expect(list).toHaveClass("bx--list--ordered"); - expect(list).not.toHaveClass("bx--list--ordered--native"); - expect(list).not.toHaveClass("bx--list--nested"); - expect(list).not.toHaveClass("bx--list--expressive"); - - const items = screen.getAllByRole("listitem"); - expect(items).toHaveLength(3); - expect(items[0]).toHaveTextContent("Item 1"); - expect(items[1]).toHaveTextContent("Item 2"); - expect(items[2]).toHaveTextContent("Item 3"); - }); - - it("should support nested lists", () => { - render(OrderedList, { - props: { - nested: true, - nestedItems: ["Nested 1", "Nested 2"], - }, - }); - - const lists = screen.getAllByRole("list"); - expect(lists).toHaveLength(4); // Main list + 3 nested lists (one for each main item) - - const mainList = lists[0]; - expect(mainList).toHaveClass("bx--list--ordered"); - expect(mainList).toHaveClass("bx--list--nested"); - - const nestedLists = lists.slice(1); - nestedLists.forEach((list) => { - expect(list).toHaveClass("bx--list--ordered"); - expect(list).toHaveClass("bx--list--nested"); - }); - - const items = screen.getAllByRole("listitem"); - expect(items).toHaveLength(9); // 3 main items + (2 nested items × 3) - }); - - it("should support native list styles", () => { - render(OrderedList, { - props: { native: true }, - }); - - const list = screen.getByRole("list"); - expect(list).toHaveClass("bx--list--ordered--native"); - expect(list).not.toHaveClass("bx--list--ordered"); - }); - - it("should support native list styles with nesting", () => { - render(OrderedList, { - props: { - native: true, - nested: true, - nestedItems: ["Nested 1", "Nested 2"], - }, - }); - - const lists = screen.getAllByRole("list"); - - // Only the top-level list has the native class - expect(lists[0]).toHaveClass("bx--list--ordered--native"); - expect(lists[0]).not.toHaveClass("bx--list--ordered"); - - lists.slice(1).forEach((list) => { - expect(list).toHaveClass("bx--list--ordered bx--list--nested"); - expect(list).not.toHaveClass("bx--list--ordered--native"); - }); - }); - - it("should support expressive styles", () => { - render(OrderedList, { - props: { expressive: true }, - }); - - const list = screen.getByRole("list"); - expect(list).toHaveClass("bx--list--expressive"); - }); - - it("should support custom items", () => { - const customItems = ["Custom 1", "Custom 2", "Custom 3", "Custom 4"]; - render(OrderedList, { - props: { items: customItems }, - }); - - const items = screen.getAllByRole("listitem"); - expect(items).toHaveLength(customItems.length); - items.forEach((item, index) => { - expect(item).toHaveTextContent(customItems[index]); - }); - }); - - describe("events", () => { - it("should emit click event", async () => { - const { component } = render(OrderedList); - const list = screen.getByRole("list"); - - const mock = vi.fn(); - component.$on("click", mock); - - await user.click(list); - expect(mock).toHaveBeenCalled(); - }); - - test.each(["mouseover", "mouseenter", "mouseleave"])( - "should emit %s event", - (eventName) => { - const { component } = render(OrderedList); - const list = screen.getByRole("list"); - - const mock = vi.fn(); - component.$on(eventName, mock); - - const event = new MouseEvent(eventName); - list.dispatchEvent(event); - - expect(mock).toHaveBeenCalled(); - }, - ); - }); - - describe("accessibility", () => { - it("should have correct ARIA role", () => { - render(OrderedList); - - const list = screen.getByRole("list"); - expect(list.tagName).toBe("OL"); - - const items = screen.getAllByRole("listitem"); - items.forEach((item) => { - expect(item.tagName).toBe("LI"); - }); - }); - - it("should maintain list structure with nested items", () => { - render(OrderedList, { - props: { - nested: true, - nestedItems: ["Nested 1", "Nested 2"], - }, - }); - - const lists = screen.getAllByRole("list"); - lists.forEach((list) => { - expect(list.tagName).toBe("OL"); - expect(list.children).toBeTruthy(); - Array.from(list.children).forEach((child) => { - expect(child.tagName).toBe("LI"); - }); - }); - }); - - it("should maintain correct order with native styles", () => { - const items = ["First", "Second", "Third", "Fourth", "Fifth"]; - render(OrderedList, { - props: { native: true, items }, - }); - - const listItems = screen.getAllByRole("listitem"); - items.forEach((text, index) => { - expect(listItems[index]).toHaveTextContent(text); - }); - }); - }); -}); diff --git a/tests/OverflowMenu.test.svelte b/tests/OverflowMenu.test.svelte new file mode 100644 index 00000000..f23f19ea --- /dev/null +++ b/tests/OverflowMenu.test.svelte @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Custom trigger
    + + + +
    diff --git a/tests/OverflowMenu/OverflowMenu.test.svelte b/tests/OverflowMenu/OverflowMenu.test.svelte deleted file mode 100644 index 18d23727..00000000 --- a/tests/OverflowMenu/OverflowMenu.test.svelte +++ /dev/null @@ -1,47 +0,0 @@ - - - { - console.log("close", e.detail); // { index: number; text: string; } - }} -> - { - console.log("click", "Manage credentials"); - }} - /> - { - console.log("click", "API documentation"); - }} - /> - { - console.log("click", "Delete service"); - }} - /> - diff --git a/tests/OverflowMenu/OverflowMenu.test.ts b/tests/OverflowMenu/OverflowMenu.test.ts deleted file mode 100644 index 49ff18ef..00000000 --- a/tests/OverflowMenu/OverflowMenu.test.ts +++ /dev/null @@ -1,290 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import OverflowMenu from "./OverflowMenu.test.svelte"; - -describe("OverflowMenu", () => { - it("renders and functions correctly", async () => { - render(OverflowMenu); - - const menuButton = screen.getByRole("button"); - expect(menuButton).toHaveAttribute("aria-haspopup", "true"); - expect(menuButton).toHaveAttribute("aria-expanded", "false"); - - await user.click(menuButton); - expect(menuButton).toHaveAttribute("aria-expanded", "true"); - - const menuItems = screen.getAllByRole("menuitem"); - expect(menuItems).toHaveLength(3); - expect(menuItems[0]).toHaveFocus(); - - expect(menuItems[0]).toHaveTextContent("Manage credentials"); - expect(menuItems[1]).toHaveTextContent("API documentation"); - expect(menuItems[2]).toHaveTextContent("Delete service"); - - expect(menuItems[1]).toHaveAttribute( - "href", - "https://cloud.ibm.com/docs/api-gateway/", - ); - - expect(menuItems[2].parentElement).toHaveClass( - "bx--overflow-menu-options__option--danger", - ); - - const spy = vi.spyOn(console, "log"); - await user.click(menuItems[0]); - expect(spy).toHaveBeenCalledWith("click", "Manage credentials"); - - expect(menuButton).toHaveAttribute("aria-expanded", "false"); - expect(spy).toHaveBeenCalledWith("close", { - index: 0, - text: "Manage credentials", - }); - }); - - it("handles keyboard navigation", async () => { - render(OverflowMenu); - - const spy = vi.spyOn(console, "log"); - - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - expect(menuButton).toHaveAttribute("aria-expanded", "true"); - - let menuItems = screen.getAllByRole("menuitem"); - expect(menuItems[0]).toHaveFocus(); - - await user.keyboard("{ArrowDown}"); - expect(menuItems[1]).toHaveFocus(); - - await user.keyboard("{Enter}"); - expect(spy).toHaveBeenCalledWith("click", "API documentation"); - - await user.click(menuButton); - menuItems = screen.getAllByRole("menuitem"); - expect(menuItems[0]).toHaveFocus(); - - await user.keyboard("{ArrowUp}"); - expect(menuItems[2]).toHaveFocus(); - - await user.keyboard("{Escape}"); - expect(menuButton).toHaveAttribute("aria-expanded", "false"); - expect(spy).toHaveBeenCalledWith("close", null); - }); - - it("closes when clicking outside", async () => { - render(OverflowMenu); - - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - expect(menuButton).toHaveAttribute("aria-expanded", "true"); - - await user.click(document.body); - expect(menuButton).toHaveAttribute("aria-expanded", "false"); - }); - - it("uses CSS custom properties for performance optimization", async () => { - const { container } = render(OverflowMenu); - - const styleTags = document.querySelectorAll("style"); - const initialStyleCount = styleTags.length; - expect(styleTags.length).toBe(initialStyleCount); - - await user.click(screen.getByRole("button")); - expect(container.querySelector(".bx--overflow-menu-options")).toHaveStyle( - "--overflow-menu-options-after-width: 2rem", - ); - expect(styleTags.length).toBe(initialStyleCount); - }); - - it("stress test: multiple instances don't create individual style tags", async () => { - const { container: container1 } = render(OverflowMenu); - const { container: container2 } = render(OverflowMenu); - const { container: container3 } = render(OverflowMenu); - - const styleTagsBefore = document.querySelectorAll("style").length; - const menuButtons1 = container1.querySelectorAll("button"); - const menuButtons2 = container2.querySelectorAll("button"); - const menuButtons3 = container3.querySelectorAll("button"); - - await user.click(menuButtons1[0]); - await user.click(menuButtons2[0]); - await user.click(menuButtons3[0]); - - const styleTagsAfter = document.querySelectorAll("style").length; - - // Verify no additional style tags created (old approach would create 3+) - expect(styleTagsAfter).toBe(styleTagsBefore); - - // Verify all menus have CSS custom property set. - const allMenus = [ - ...container1.querySelectorAll(".bx--overflow-menu-options"), - ...container2.querySelectorAll(".bx--overflow-menu-options"), - ...container3.querySelectorAll(".bx--overflow-menu-options"), - ]; - - expect(allMenus.length).toBeGreaterThan(0); - allMenus.forEach((menu) => { - expect(menu).toHaveStyle("--overflow-menu-options-after-width: 2rem"); - }); - }); - - test.each([ - ["sm", "bx--overflow-menu--sm"], - ["xl", "bx--overflow-menu--xl"], - ] as const)("should support %s size", (size, expectedClass) => { - render(OverflowMenu, { props: { size } }); - - const menuButton = screen.getByRole("button"); - expect(menuButton).toHaveClass(expectedClass); - }); - - it("should not apply size classes when size is undefined", () => { - render(OverflowMenu, { props: { size: undefined } }); - - const menuButton = screen.getByRole("button"); - expect(menuButton).not.toHaveClass("bx--overflow-menu--sm"); - expect(menuButton).not.toHaveClass("bx--overflow-menu--xl"); - }); - - it("applies light variant styling", () => { - render(OverflowMenu, { props: { light: true } }); - - const menuButton = screen.getByRole("button"); - expect(menuButton).toHaveClass("bx--overflow-menu--light"); - }); - - it("applies flipped styling", async () => { - render(OverflowMenu, { props: { flipped: true } }); - - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - - const menu = screen.getByRole("menu"); - expect(menu).toHaveClass("bx--overflow-menu--flip"); - }); - - it("applies direction attribute", async () => { - render(OverflowMenu, { props: { direction: "top" } }); - - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - - const menu = screen.getByRole("menu"); - expect(menu).toHaveAttribute("data-floating-menu-direction", "top"); - }); - - it("applies custom menu options class", async () => { - render(OverflowMenu, { props: { menuOptionsClass: "custom-class" } }); - - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - - const menu = screen.getByRole("menu"); - expect(menu).toHaveClass("custom-class"); - }); - - it("applies custom icon class", () => { - render(OverflowMenu, { props: { iconClass: "custom-icon-class" } }); - - const icon = screen.getByRole("button").querySelector("svg"); - expect(icon).toHaveClass("custom-icon-class"); - }); - - it("uses custom icon description", () => { - render(OverflowMenu, { props: { iconDescription: "Custom description" } }); - - const icon = screen.getByRole("button").querySelector("svg"); - expect(icon).toHaveAttribute("aria-label", "Custom description"); - }); - - it("uses custom id", () => { - render(OverflowMenu, { props: { id: "custom-id" } }); - - const menuButton = screen.getByRole("button"); - expect(menuButton).toHaveAttribute("id", "custom-id"); - }); - - it("applies danger styling to menu items", async () => { - render(OverflowMenu); - - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - - const menuItems = screen.getAllByRole("menuitem"); - const dangerItem = menuItems.find( - (item) => item.textContent === "Delete service", - ); - expect(dangerItem?.parentElement).toHaveClass( - "bx--overflow-menu-options__option--danger", - ); - }); - - it("handles link menu items correctly", async () => { - render(OverflowMenu); - - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - - const menuItems = screen.getAllByRole("menuitem"); - const linkItem = menuItems.find( - (item) => item.textContent === "API documentation", - ); - expect(linkItem).toHaveAttribute( - "href", - "https://cloud.ibm.com/docs/api-gateway/", - ); - }); - - it("returns focus to button after menu closes", async () => { - render(OverflowMenu); - - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - - const menuItems = screen.getAllByRole("menuitem"); - expect(menuItems[0]).toHaveFocus(); - - await user.keyboard("{Escape}"); - expect(menuButton).toHaveFocus(); - }); - - it("handles close event with item click", async () => { - render(OverflowMenu); - - const spy = vi.spyOn(console, "log"); - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - - const menuItems = screen.getAllByRole("menuitem"); - await user.click(menuItems[0]); - - expect(spy).toHaveBeenCalledWith("close", { - index: 0, - text: "Manage credentials", - }); - }); - - it("handles close event with escape key", async () => { - render(OverflowMenu); - - const spy = vi.spyOn(console, "log"); - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - - await user.keyboard("{Escape}"); - - expect(spy).toHaveBeenCalledWith("close", null); - }); - - it("handles close event with outside click", async () => { - render(OverflowMenu); - - const spy = vi.spyOn(console, "log"); - const menuButton = screen.getByRole("button"); - await user.click(menuButton); - - await user.click(document.body); - - expect(spy).toHaveBeenCalledWith("close", null); - }); -}); diff --git a/tests/PaddedGrid.test.svelte b/tests/PaddedGrid.test.svelte new file mode 100644 index 00000000..5b7a7c74 --- /dev/null +++ b/tests/PaddedGrid.test.svelte @@ -0,0 +1,20 @@ + + + + + + Column + + + Column + + + Column + + + Column + + + diff --git a/tests/Pagination.test.svelte b/tests/Pagination.test.svelte new file mode 100644 index 00000000..e1e29e89 --- /dev/null +++ b/tests/Pagination.test.svelte @@ -0,0 +1,21 @@ + + + + + + + + + + + + + diff --git a/tests/Pagination/Pagination.test.svelte b/tests/Pagination/Pagination.test.svelte deleted file mode 100644 index 8648a268..00000000 --- a/tests/Pagination/Pagination.test.svelte +++ /dev/null @@ -1,52 +0,0 @@ - - - { - console.log("change", e.detail); - }} - on:click:button--previous={(e) => { - console.log("previous", e.detail); - }} - on:click:button--next={(e) => { - console.log("next", e.detail); - }} - on:update={(e) => { - console.log("update", e.detail); - }} -/> diff --git a/tests/Pagination/Pagination.test.ts b/tests/Pagination/Pagination.test.ts deleted file mode 100644 index 6ce54289..00000000 --- a/tests/Pagination/Pagination.test.ts +++ /dev/null @@ -1,279 +0,0 @@ -import { render, screen, within } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import Pagination from "./Pagination.test.svelte"; - -describe("Pagination", () => { - beforeEach(() => { - vi.clearAllMocks(); - }); - - it("should render with default props", () => { - render(Pagination); - - expect(screen.getByText("Items per page:")).toBeInTheDocument(); - expect( - screen.getByRole("button", { name: "Next page" }), - ).toBeInTheDocument(); - expect( - screen.getByRole("button", { name: "Previous page" }), - ).toBeInTheDocument(); - }); - - it("should render with custom total items", () => { - render(Pagination, { - props: { totalItems: 102 }, - }); - - expect(screen.getByText("1–10 of 102 items")).toBeInTheDocument(); - }); - - it("should handle custom page sizes", () => { - render(Pagination, { - props: { - totalItems: 102, - pageSizes: [10, 15, 20], - pageSize: 15, - }, - }); - - const select = screen.getByRole("combobox", { name: "Items per page:" }); - expect(select).toHaveValue("15"); - - const options = within(select).getAllByRole("option"); - expect(options).toHaveLength(3); - expect(options[0]).toHaveTextContent("10"); - expect(options[1]).toHaveTextContent("15"); - expect(options[2]).toHaveTextContent("20"); - }); - - it("should handle page navigation", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Pagination, { - props: { totalItems: 102, page: 1 }, - }); - - const nextButton = screen.getByRole("button", { name: "Next page" }); - await user.click(nextButton); - expect(consoleLog).toHaveBeenCalledWith("next", { page: 2 }); - expect(consoleLog).toHaveBeenCalledWith("change", { page: 2 }); - - const prevButton = screen.getByRole("button", { name: "Previous page" }); - await user.click(prevButton); - expect(consoleLog).toHaveBeenCalledWith("previous", { page: 1 }); - expect(consoleLog).toHaveBeenCalledWith("change", { page: 1 }); - }); - - it("should handle page size changes", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Pagination, { - props: { - totalItems: 102, - pageSizes: [10, 15, 20], - }, - }); - - const select = screen.getByRole("combobox", { name: "Items per page:" }); - await user.selectOptions(select, "15"); - - expect(consoleLog).toHaveBeenCalledWith("change", { pageSize: 15 }); - expect(consoleLog).toHaveBeenCalledWith("update", { - pageSize: 15, - page: 1, - }); - }); - - it("should handle page selection", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Pagination, { - props: { totalItems: 102, pageSizes: [5, 10, 15] }, - }); - - const pageSelect = screen.getAllByRole("combobox"); - await user.selectOptions(pageSelect[0], "5"); - - expect(consoleLog).toHaveBeenCalledWith("change", { pageSize: 5 }); - expect(consoleLog).toHaveBeenCalledWith("update", { pageSize: 5, page: 1 }); - }); - - it("should disable navigation buttons when disabled", () => { - render(Pagination, { - props: { disabled: true }, - }); - - const prevButton = screen.getByRole("button", { name: "Previous page" }); - const nextButton = screen.getByRole("button", { name: "Next page" }); - - expect(prevButton).toBeDisabled(); - expect(nextButton).toBeDisabled(); - }); - - it("should handle custom button text", () => { - render(Pagination, { - props: { - forwardText: "Next", - backwardText: "Previous", - }, - }); - - expect( - screen.getByRole("button", { name: "Previous" }), - ).toBeInTheDocument(); - expect(screen.getByRole("button", { name: "Next" })).toBeInTheDocument(); - }); - - it("should handle custom items per page text", () => { - render(Pagination, { - props: { - itemsPerPageText: "Show:", - }, - }); - - expect(screen.getByText("Show:")).toBeInTheDocument(); - }); - - it("should handle disabled page input", () => { - render(Pagination, { - props: { pageInputDisabled: true }, - }); - - expect( - screen.queryByRole("combobox", { name: "Page number" }), - ).not.toBeInTheDocument(); - }); - - it("should handle disabled page size input", () => { - render(Pagination, { - props: { pageSizeInputDisabled: true }, - }); - - expect( - screen.queryByRole("combobox", { name: "Items per page:" }), - ).not.toBeInTheDocument(); - }); - - it("should handle unknown pages", () => { - render(Pagination, { - props: { pagesUnknown: true }, - }); - - expect(screen.getByText("1–10 items")).toBeInTheDocument(); - expect(screen.getByText("page 1")).toBeInTheDocument(); - }); - - it("should update when page or pageSize changes", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Pagination, { - props: { totalItems: 102, pageSizes: [5, 10, 15] }, - }); - - // Change page size - const pageSizeSelect = screen.getAllByRole("combobox"); - await user.selectOptions(pageSizeSelect[0], "15"); - expect(consoleLog).toHaveBeenCalledWith("change", { pageSize: 15 }); - expect(consoleLog).toHaveBeenCalledWith("update", { - pageSize: 15, - page: 1, - }); - - // Change page - const pageSelect = screen.getAllByRole("combobox"); - await user.selectOptions(pageSelect[1], "2"); - expect(consoleLog).toHaveBeenCalledWith("change", { page: 2 }); - expect(consoleLog).toHaveBeenCalledWith("update", { - pageSize: 15, - page: 2, - }); - }); - - it("should handle edge cases", () => { - render(Pagination, { - props: { - totalItems: 0, - page: 1, - pageSize: 10, - }, - }); - - expect(screen.getByText("0–0 of 0 items")).toBeInTheDocument(); - }); - - it("renders a cap of 1000 page numbers by default", () => { - render(Pagination, { - props: { totalItems: 100_000 }, - }); - - const pageNumbers = screen.getByLabelText(/Page number, of 10000 pages/); - expect(pageNumbers).toHaveLength(1_000 + 1); - }); - - it("renders a custom page window", () => { - render(Pagination, { - props: { totalItems: 100_000, pageWindow: 100 }, - }); - - const pageNumbers = screen.getByLabelText(/Page number, of 10000 pages/); - expect(pageNumbers).toHaveLength(100 + 1); - }); - - it("formats larger numbers using `toLocaleString`", () => { - render(Pagination, { - props: { totalItems: 100_000 }, - }); - - expect(screen.getByText(/1–10 of 100,000 items/)).toBeInTheDocument(); - expect(screen.getByText(/of 10,000 pages/)).toBeInTheDocument(); - }); - - it("handles custom page text", () => { - render(Pagination, { - props: { - pagesUnknown: true, - totalItems: 100_000, - pageText: (page) => `Current page ${page}`, - }, - }); - - expect(screen.getByText(/Current page 1/)).toBeInTheDocument(); - }); - - it("handles custom page range text", () => { - render(Pagination, { - props: { - totalItems: 100_000, - pageRangeText: (current, total) => `${current} of ${total}`, - }, - }); - - expect(screen.getByText(/1 of 10000/)).toBeInTheDocument(); - }); - - it("handles custom item range text", () => { - render(Pagination, { - props: { - totalItems: 100_000, - itemRangeText: (min, max, total) => `${min}–${max} of ${total}`, - }, - }); - - expect(screen.getByText(/1–10 of 100000/)).toBeInTheDocument(); - }); - - it("should dispatch change event with new value, not previous value", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Pagination, { - props: { totalItems: 102, pageSizes: [10, 15, 20] }, - }); - - const pageSizeSelect = screen.getByRole("combobox", { - name: "Items per page:", - }); - await user.selectOptions(pageSizeSelect, "15"); - - expect(consoleLog).toHaveBeenCalledWith("change", { pageSize: 15 }); - - const pageSelect = screen.getAllByRole("combobox")[1]; - await user.selectOptions(pageSelect, "2"); - - expect(consoleLog).toHaveBeenCalledWith("change", { page: 2 }); - }); -}); diff --git a/tests/PaginationNav.test.svelte b/tests/PaginationNav.test.svelte new file mode 100644 index 00000000..d7e65fdb --- /dev/null +++ b/tests/PaginationNav.test.svelte @@ -0,0 +1,19 @@ + + + + + diff --git a/tests/PaginationNav/PaginationNav.test.svelte b/tests/PaginationNav/PaginationNav.test.svelte deleted file mode 100644 index 42b4e28d..00000000 --- a/tests/PaginationNav/PaginationNav.test.svelte +++ /dev/null @@ -1,36 +0,0 @@ - - - { - console.log("change", e.detail); - }} - on:click:button--previous={(e) => { - console.log("previous", e.detail); - }} - on:click:button--next={(e) => { - console.log("next", e.detail); - }} -/> diff --git a/tests/PaginationNav/PaginationNav.test.ts b/tests/PaginationNav/PaginationNav.test.ts deleted file mode 100644 index 7c4a5bd6..00000000 --- a/tests/PaginationNav/PaginationNav.test.ts +++ /dev/null @@ -1,159 +0,0 @@ -import { render, screen, within } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import PaginationNav from "./PaginationNav.test.svelte"; - -describe("PaginationNav", () => { - beforeEach(() => { - vi.clearAllMocks(); - }); - - it("should render with default props", () => { - render(PaginationNav); - - const nav = screen.getByRole("navigation"); - expect(nav).toHaveClass("bx--pagination-nav"); - expect(nav).toHaveAttribute("aria-label", "pagination"); - - const list = screen.getByRole("list"); - expect(list).toHaveClass("bx--pagination-nav__list"); - - expect(screen.getByText("Previous page")).toBeInTheDocument(); - expect(screen.getByText("Next page")).toBeInTheDocument(); - - const pageItems = screen.getAllByRole("listitem"); - expect(pageItems.length).toBeGreaterThan(0); - }); - - it("should render correct number of pages", () => { - render(PaginationNav, { - props: { total: 5 }, - }); - - const pageItems = screen.getAllByRole("listitem"); - expect(pageItems.length).toBe(7); // 5 pages + 2 navigation buttons - }); - - it("should show correct active page", () => { - render(PaginationNav, { - props: { page: 3 }, - }); - - const listItems = screen.getAllByRole("listitem"); - expect(within(listItems[3]).getByRole("button")).toHaveAttribute( - "aria-current", - "page", - ); - }); - - it("should handle custom shown pages", () => { - render(PaginationNav, { - props: { total: 20, shown: 5 }, - }); - - const pageItems = screen.getAllByRole("listitem"); - // Should show 5 pages + 2 navigation buttons - expect(pageItems.length).toBe(7); - }); - - it("should disable previous button on first page", () => { - render(PaginationNav, { - props: { page: 1 }, - }); - - const prevButton = screen.getByRole("button", { name: "Previous page" }); - expect(prevButton).toBeDisabled(); - }); - - it("should disable next button on last page", () => { - render(PaginationNav, { - props: { page: 10, total: 10 }, - }); - - const nextButton = screen.getByRole("button", { name: "Next page" }); - expect(nextButton).toBeDisabled(); - }); - - it("should enable navigation buttons when looping", () => { - render(PaginationNav, { - props: { loop: true, page: 1, total: 10 }, - }); - - const prevButton = screen.getByRole("button", { name: "Previous page" }); - const nextButton = screen.getByRole("button", { name: "Next page" }); - - expect(prevButton).not.toBeDisabled(); - expect(nextButton).not.toBeDisabled(); - }); - - it("should support custom button text", () => { - render(PaginationNav, { - props: { - backwardText: "Previous", - forwardText: "Next", - }, - }); - - expect( - screen.getByRole("button", { name: "Previous" }), - ).toBeInTheDocument(); - expect(screen.getByRole("button", { name: "Next" })).toBeInTheDocument(); - }); - - test.each([ - ["top", ["bx--btn--icon-only--top", "bx--btn--icon-only--top"]], - ["right", ["bx--btn--icon-only--right", "bx--btn--icon-only--right"]], - ["bottom", ["bx--btn--icon-only--bottom", "bx--btn--icon-only--bottom"]], - ["left", ["bx--btn--icon-only--left", "bx--btn--icon-only--left"]], - ["outside", ["bx--btn--icon-only--left", "bx--btn--icon-only--right"]], - ["inside", ["bx--btn--icon-only--right", "bx--btn--icon-only--left"]], - ] as const)("should support %s position", (position, [prev, next]) => { - render(PaginationNav, { - props: { tooltipPosition: position }, - }); - - const prevButton = screen.getByRole("button", { name: "Previous page" }); - const nextButton = screen.getByRole("button", { name: "Next page" }); - - expect(prevButton).toHaveClass("bx--tooltip--align-center"); - expect(prevButton).toHaveClass(prev); - - expect(nextButton).toHaveClass("bx--tooltip--align-center"); - expect(nextButton).toHaveClass(next); - }); - - it("should emit change event when clicking a page", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(PaginationNav); - - const pageButton = screen.getByRole("button", { name: /2/ }); - await user.click(pageButton); - expect(consoleLog).toHaveBeenCalledWith("change", { page: 2 }); - - const nextButton = screen.getByRole("button", { name: "Next page" }); - await user.click(nextButton); - expect(consoleLog).toHaveBeenCalledWith("change", { page: 3 }); - - const prevButton = screen.getByRole("button", { name: "Previous page" }); - await user.click(prevButton); - expect(consoleLog).toHaveBeenCalledWith("change", { page: 2 }); - }); - - it("should handle overflow selection", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(PaginationNav, { - props: { total: 100, shown: 5 }, - }); - - const overflowIndicator = screen.getByLabelText("Select Page number"); - expect(overflowIndicator).toBeInTheDocument(); - - await user.selectOptions(overflowIndicator, "4"); - - expect(consoleLog).toHaveBeenCalledWith("change", { page: 4 }); - expect(consoleLog).toHaveBeenCalledTimes(1); - - await user.selectOptions(overflowIndicator, "50"); - expect(consoleLog).toHaveBeenCalledWith("change", { page: 50 }); - expect(consoleLog).toHaveBeenCalledTimes(2); - }); -}); diff --git a/tests/PassiveModal.test.svelte b/tests/PassiveModal.test.svelte new file mode 100644 index 00000000..2b122c29 --- /dev/null +++ b/tests/PassiveModal.test.svelte @@ -0,0 +1,14 @@ + + + + + +

    + IBM Cloudant is a distributed, secure database with global availability and + zero vendor lock-in used to build web and mobile apps at scale. +

    +
    diff --git a/tests/PasswordInput.test.svelte b/tests/PasswordInput.test.svelte new file mode 100644 index 00000000..6d9f5ce9 --- /dev/null +++ b/tests/PasswordInput.test.svelte @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + diff --git a/tests/PasswordInput/PasswordInput.test.svelte b/tests/PasswordInput/PasswordInput.test.svelte deleted file mode 100644 index 2f451be2..00000000 --- a/tests/PasswordInput/PasswordInput.test.svelte +++ /dev/null @@ -1,66 +0,0 @@ - - - { - console.log("focus"); - }} - on:blur={() => { - console.log("blur"); - }} - on:paste -/> - -
    {value}
    diff --git a/tests/PasswordInput/PasswordInput.test.ts b/tests/PasswordInput/PasswordInput.test.ts deleted file mode 100644 index 33605239..00000000 --- a/tests/PasswordInput/PasswordInput.test.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import PasswordInput from "./PasswordInput.test.svelte"; -import { user } from "../setup-tests"; - -describe("PasswordInput", () => { - describe("Default", () => { - it("should render with a label", () => { - render(PasswordInput, { - labelText: "Password", - placeholder: "Enter password...", - }); - - expect(screen.getByLabelText("Password")).toBeInTheDocument(); - expect( - screen.getByPlaceholderText("Enter password..."), - ).toBeInTheDocument(); - }); - - it("should toggle password visibility", async () => { - render(PasswordInput, { labelText: "Password", value: "secret123" }); - - const input = screen.getByLabelText("Password"); - expect(input).toHaveAttribute("type", "password"); - - await user.click(screen.getByText("Show password")); - expect(input).toHaveAttribute("type", "text"); - - await user.click(screen.getByText("Hide password")); - expect(input).toHaveAttribute("type", "password"); - }); - - it("should handle custom visibility labels", async () => { - render(PasswordInput, { - labelText: "Password", - hidePasswordLabel: "Custom hide", - showPasswordLabel: "Custom show", - }); - - expect(screen.getByLabelText("Password")).toBeInTheDocument(); - await user.click(screen.getByText("Custom show")); - expect(screen.getByText("Custom hide")).toBeInTheDocument(); - await user.click(screen.getByText("Custom hide")); - expect(screen.getByText("Custom show")).toBeInTheDocument(); - }); - }); - - describe("Tooltip", () => { - it("should handle custom tooltip alignment", () => { - render(PasswordInput, { - labelText: "Password", - tooltipAlignment: "start", - tooltipPosition: "left", - }); - - const button = screen.getByRole("button"); - expect(button).toHaveClass("bx--tooltip--align-start"); - expect(button).toHaveClass("bx--tooltip--left"); - }); - }); - - describe("States", () => { - it("should handle invalid state", () => { - render(PasswordInput, { - labelText: "Password", - invalid: true, - invalidText: "Password must be at least 8 characters", - }); - - expect( - screen.getByText("Password must be at least 8 characters"), - ).toBeInTheDocument(); - const wrapper = screen - .getByLabelText("Password") - .closest(".bx--text-input__field-wrapper"); - expect(wrapper).toHaveAttribute("data-invalid"); - }); - - it("should handle warning state", () => { - render(PasswordInput, { - labelText: "Password", - warn: true, - warnText: "Password will expire soon", - }); - - expect(screen.getByText("Password will expire soon")).toBeInTheDocument(); - const input = screen.getByLabelText("Password"); - expect(input).toHaveClass("bx--text-input--warning"); - }); - - it("should handle disabled state", () => { - render(PasswordInput, { - labelText: "Password", - disabled: true, - value: "disabled-password", - }); - - const input = screen.getByLabelText("Password"); - expect(input).toBeDisabled(); - expect(input).toHaveValue("disabled-password"); - - const toggleButton = screen.getByRole("button"); - expect(toggleButton).toBeDisabled(); - expect(toggleButton).toHaveClass("bx--btn--disabled"); - }); - - it("should handle helper text", () => { - render(PasswordInput, { - labelText: "Password", - helperText: "Your password should be hard to guess", - }); - - expect( - screen.getByText("Your password should be hard to guess"), - ).toBeInTheDocument(); - }); - }); - - describe("Variants", () => { - it("should render light variant", () => { - render(PasswordInput, { labelText: "Password", light: true }); - - const wrapper = screen - .getByLabelText("Password") - .closest(".bx--text-input-wrapper"); - expect(wrapper).toHaveClass("bx--text-input-wrapper--light"); - }); - - it("should render inline variant", () => { - render(PasswordInput, { - labelText: "Password", - inline: true, - }); - - const wrapper = screen - .getByLabelText("Password") - .closest(".bx--text-input-wrapper"); - expect(wrapper).toHaveClass("bx--text-input-wrapper--inline"); - }); - - it("should render in small size", () => { - render(PasswordInput, { labelText: "Password", size: "sm" }); - - const input = screen.getByLabelText("Password"); - expect(input).toHaveClass("bx--text-input--sm"); - }); - - it("should render in extra-large size", () => { - render(PasswordInput, { - labelText: "Password", - size: "xl", - }); - - const input = screen.getByLabelText("Password"); - expect(input).toHaveClass("bx--text-input--xl"); - }); - }); - - describe("Label handling", () => { - it("should handle hidden label", () => { - render(PasswordInput, { labelText: "Password", hideLabel: true }); - - const label = screen.getByText("Password"); - expect(label).toHaveClass("bx--visually-hidden"); - }); - - it("should handle custom id", () => { - render(PasswordInput, { labelText: "Password", id: "custom-id" }); - - const input = screen.getByLabelText("Password"); - expect(input).toHaveAttribute("id", "custom-id"); - }); - }); - - describe("Events", () => { - it("should handle input events", async () => { - render(PasswordInput, { labelText: "Password" }); - - const input = screen.getByLabelText("Password"); - await user.type(input, "test123"); - expect(screen.getByTestId("value")).toHaveTextContent("test123"); - }); - - it("should handle focus and blur events", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(PasswordInput, { labelText: "Password" }); - - expect(consoleLog).not.toHaveBeenCalled(); - const input = screen.getByLabelText("Password"); - await user.click(input); - expect(consoleLog).toHaveBeenCalledWith("focus"); - - await user.tab(); - expect(consoleLog).toHaveBeenCalledWith("blur"); - }); - }); -}); diff --git a/tests/PersistedHamburgerMenu.test.svelte b/tests/PersistedHamburgerMenu.test.svelte index 5992d0f8..986f4b1d 100644 --- a/tests/PersistedHamburgerMenu.test.svelte +++ b/tests/PersistedHamburgerMenu.test.svelte @@ -14,13 +14,13 @@ Grid, Row, Column, - } from "carbon-components-svelte"; + } from "../types"; let isSideNavOpen = false;
    - + diff --git a/tests/Popover.test.svelte b/tests/Popover.test.svelte new file mode 100644 index 00000000..ea2c42d2 --- /dev/null +++ b/tests/Popover.test.svelte @@ -0,0 +1,20 @@ + + + +
    Content
    +
    diff --git a/tests/Popover/Popover.test.svelte b/tests/Popover/Popover.test.svelte deleted file mode 100644 index b21cc440..00000000 --- a/tests/Popover/Popover.test.svelte +++ /dev/null @@ -1,41 +0,0 @@ - - -
    - Parent - { - console.log("click:outside", e.detail); - }} - > -
    Content
    -
    -
    diff --git a/tests/Popover/Popover.test.ts b/tests/Popover/Popover.test.ts deleted file mode 100644 index 686cce18..00000000 --- a/tests/Popover/Popover.test.ts +++ /dev/null @@ -1,154 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import Popover from "./Popover.test.svelte"; - -describe("Popover", () => { - beforeEach(() => { - vi.clearAllMocks(); - }); - - it("should render when open", () => { - render(Popover, { props: { open: true } }); - - expect(screen.getByTestId("content")).toBeVisible(); - expect(screen.getByTestId("parent").firstElementChild).toHaveClass( - "bx--popover--open", - ); - }); - - it("should not render when closed", () => { - render(Popover, { props: { open: false } }); - - const popover = screen.getByTestId("parent").firstElementChild; - expect(popover).not.toHaveClass("bx--popover--open"); - }); - - it("should handle outside clicks", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Popover, { - props: { - open: true, - closeOnOutsideClick: true, - }, - }); - - await user.click(document.body); - expect(consoleLog).toHaveBeenCalledWith( - "click:outside", - expect.any(Object), - ); - }); - - it("should not close on outside click when closeOnOutsideClick is false", async () => { - render(Popover, { - props: { - open: true, - closeOnOutsideClick: false, - }, - }); - - const popover = screen.getByTestId("parent").firstElementChild; - - await user.click(document.body); - expect(popover).toHaveClass("bx--popover--open"); - }); - - test.each([ - "top", - "top-left", - "top-right", - "bottom", - "bottom-left", - "bottom-right", - "left", - "left-bottom", - "left-top", - "right", - "right-bottom", - "right-top", - ] as const)("should handle %s alignment", (align) => { - render(Popover, { - props: { open: true, align }, - }); - - expect(screen.getByTestId("parent").firstElementChild).toHaveClass( - `bx--popover--${align}`, - ); - }); - - it("should render with caret", () => { - render(Popover, { - props: { open: true, caret: true }, - }); - - expect(screen.getByTestId("parent").firstElementChild).toHaveClass( - "bx--popover--caret", - ); - }); - - it("should handle light variant", () => { - render(Popover, { - props: { open: true, light: true }, - }); - - expect(screen.getByTestId("parent").firstElementChild).toHaveClass( - "bx--popover--light", - ); - }); - - it("should handle high contrast variant", () => { - render(Popover, { - props: { open: true, highContrast: true }, - }); - - expect(screen.getByTestId("parent").firstElementChild).toHaveClass( - "bx--popover--high-contrast", - ); - }); - - it("should handle relative positioning", () => { - render(Popover, { - props: { open: true, relative: true }, - }); - - const popover = screen.getByTestId("parent").firstElementChild; - expect(popover).toHaveClass("bx--popover--relative"); - expect(popover).toHaveStyle({ position: "relative" }); - }); - - it("should not dispatch click:outside event when clicking inside", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Popover, { - props: { open: true, closeOnOutsideClick: true }, - }); - - await user.click(screen.getByTestId("content")); - expect(consoleLog).not.toHaveBeenCalled(); - }); - - it("should not handle outside clicks when closed", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Popover, { - props: { open: false, closeOnOutsideClick: true }, - }); - - await user.click(document.body); - expect(consoleLog).not.toHaveBeenCalled(); - }); - - it("should handle multiple variants simultaneously", () => { - render(Popover, { - props: { - open: true, - caret: true, - light: true, - align: "bottom-right", - }, - }); - - const popover = screen.getByTestId("parent").firstElementChild; - expect(popover).toHaveClass("bx--popover--caret"); - expect(popover).toHaveClass("bx--popover--light"); - expect(popover).toHaveClass("bx--popover--bottom-right"); - }); -}); diff --git a/tests/ProgressBar/ProgressBar.test.svelte b/tests/ProgressBar/ProgressBar.test.svelte deleted file mode 100644 index cb5f46ed..00000000 --- a/tests/ProgressBar/ProgressBar.test.svelte +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/ProgressBar/ProgressBar.test.ts b/tests/ProgressBar/ProgressBar.test.ts deleted file mode 100644 index 5be9ae76..00000000 --- a/tests/ProgressBar/ProgressBar.test.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { render, screen, within } from "@testing-library/svelte"; -import ProgressBar from "./ProgressBar.test.svelte"; - -describe("ProgressBar", () => { - it("should render indeterminate if status is active", () => { - render(ProgressBar); - - const progressBar = screen.getByTestId("indeterminate-progress"); - expect(progressBar.closest("div")).toHaveClass( - "bx--progress-bar--indeterminate", - ); - expect(progressBar).not.toHaveAttribute("aria-valuenow"); - expect(progressBar).not.toHaveAttribute("aria-valuemin"); - expect(progressBar).not.toHaveAttribute("aria-valuemax"); - }); - - it("should render with helper text", () => { - render(ProgressBar); - - const helperText = screen.getByText("Loading..."); - expect(helperText).toHaveClass("bx--progress-bar__helper-text"); - }); - - it("should render with specified value and max", () => { - render(ProgressBar); - - const progressBar = within(screen.getByTestId("progress-40%")).getByRole( - "progressbar", - ); - expect(progressBar).toHaveAttribute("aria-valuenow", "40"); - expect(progressBar).toHaveAttribute("aria-valuemin", "0"); - expect(progressBar).toHaveAttribute("aria-valuemax", "100"); - }); - - it("should render different sizes", () => { - render(ProgressBar); - - const smallBar = screen.getByTestId("small-progress"); - const mediumBar = screen.getByTestId("medium-progress"); - - expect(smallBar).toHaveClass("bx--progress-bar--small"); - expect(mediumBar).toHaveClass("bx--progress-bar--big"); - }); - - it("should render different kinds", () => { - render(ProgressBar); - - const inlineBar = screen.getByTestId("inline-progress"); - const indentedBar = screen.getByTestId("indented-progress"); - - expect(inlineBar).toHaveClass("bx--progress-bar--inline"); - expect(indentedBar).toHaveClass("bx--progress-bar--indented"); - }); - - it("should handle different statuses", () => { - render(ProgressBar); - - const errorBar = screen.getByTestId("error-progress"); - const finishedBar = screen.getByTestId("finished-progress"); - - expect(errorBar).toHaveClass("bx--progress-bar--error"); - expect(finishedBar).toHaveClass("bx--progress-bar--finished"); - }); - - it("should handle hidden label", () => { - render(ProgressBar); - - const label = screen.getByText("Hidden label"); - expect(label).toHaveClass("bx--visually-hidden"); - }); - - it("should cap values appropriately", () => { - render(ProgressBar); - - const overMax = within(screen.getByTestId("over-max")).getByRole( - "progressbar", - ); - expect(overMax).toHaveAttribute("aria-valuenow", "100"); - - const underZero = within(screen.getByTestId("under-zero")).getByRole( - "progressbar", - ); - expect(underZero).toHaveAttribute("aria-valuenow", "0"); - }); -}); diff --git a/tests/ProgressIndicator.test.svelte b/tests/ProgressIndicator.test.svelte new file mode 100644 index 00000000..ccda25af --- /dev/null +++ b/tests/ProgressIndicator.test.svelte @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/ProgressIndicator/ProgressIndicator.test.svelte b/tests/ProgressIndicator/ProgressIndicator.test.svelte deleted file mode 100644 index 4f8a4d06..00000000 --- a/tests/ProgressIndicator/ProgressIndicator.test.svelte +++ /dev/null @@ -1,35 +0,0 @@ - - - { - console.log("change", e.detail); - }} -> - {#each steps as step} - - {/each} - diff --git a/tests/ProgressIndicator/ProgressIndicator.test.ts b/tests/ProgressIndicator/ProgressIndicator.test.ts deleted file mode 100644 index 649d37cb..00000000 --- a/tests/ProgressIndicator/ProgressIndicator.test.ts +++ /dev/null @@ -1,247 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import ProgressIndicator from "./ProgressIndicator.test.svelte"; -import { user } from "../setup-tests"; - -describe("ProgressIndicator", () => { - describe("Default (horizontal)", () => { - it("should render steps with correct states", () => { - render(ProgressIndicator, { - currentIndex: 2, - steps: [ - { label: "Step 1", description: "First step", complete: true }, - { label: "Step 2", description: "Second step", complete: true }, - { label: "Step 3", description: "Third step", complete: true }, - { label: "Step 4", description: "Fourth step", complete: false }, - ], - }); - - const listItems = screen.getAllByRole("listitem"); - - // Check if all steps are rendered - expect(listItems).toHaveLength(4); - - // Check completed steps - const completedSteps = listItems.filter((step) => - step.classList.contains("bx--progress-step--complete"), - ); - expect(completedSteps).toHaveLength(3); - - // Check current step - expect(listItems[2]).toHaveTextContent("Step 3"); - - // Check incomplete step - const incompleteStep = screen.getByText("Step 4"); - expect(incompleteStep).toBeInTheDocument(); - expect(incompleteStep.closest("li")).not.toHaveClass( - "bx--progress-step--complete", - ); - }); - - it("should update currentIndex when clicking on completed steps", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(ProgressIndicator, { - currentIndex: 2, - steps: [ - { label: "Step 1", description: "First step", complete: true }, - { label: "Step 2", description: "Second step", complete: true }, - { label: "Step 3", description: "Third step", complete: true }, - { label: "Step 4", description: "Fourth step", complete: false }, - ], - }); - - expect(consoleLog).not.toHaveBeenCalled(); - - // Click on a completed step - await user.click(screen.getByText("Step 1")); - expect(consoleLog).toHaveBeenCalledWith("change", 0); - }); - - it("should not update currentIndex when preventChangeOnClick is true", async () => { - const { component } = render(ProgressIndicator, { - currentIndex: 2, - preventChangeOnClick: true, - steps: [ - { label: "Step 1", description: "First step", complete: true }, - { label: "Step 2", description: "Second step", complete: true }, - { label: "Step 3", description: "Third step", complete: true }, - { label: "Step 4", description: "Fourth step", complete: false }, - ], - }); - - const changeHandler = vi.fn(); - component.$on("change", changeHandler); - - // Click on a completed step - await user.click(screen.getByText("Step 1")); - expect(changeHandler).not.toHaveBeenCalled(); - }); - }); - - describe("Invalid and disabled states", () => { - it("should render invalid step", () => { - render(ProgressIndicator, { - steps: [ - { label: "Step 1", description: "First step", complete: true }, - { - label: "Step 2", - description: "Second step", - complete: false, - invalid: true, - disabled: false, - }, - { label: "Step 3", description: "Third step", complete: false }, - ], - }); - - const invalidStep = screen.getByText("Step 2").closest("li"); - expect(invalidStep).toHaveClass("bx--progress-step--incomplete"); - }); - - it("should render disabled steps", () => { - render(ProgressIndicator, { - steps: [ - { label: "Step 1", description: "First step", complete: true }, - { - label: "Step 2", - description: "Second step", - complete: false, - invalid: false, - disabled: true, - }, - { - label: "Step 3", - description: "Third step", - complete: false, - invalid: false, - disabled: true, - }, - ], - }); - - const disabledSteps = screen.getAllByRole("listitem").slice(1); - disabledSteps.forEach((step) => { - expect(step).toHaveClass("bx--progress-step--disabled"); - }); - }); - }); - - describe("Variants", () => { - it("should render vertical variant", () => { - render(ProgressIndicator, { - vertical: true, - steps: [ - { label: "Step 1", description: "First step", complete: false }, - { label: "Step 2", description: "Second step", complete: false }, - { label: "Step 3", description: "Third step", complete: false }, - ], - }); - - const progressIndicator = screen.getByRole("list"); - expect(progressIndicator).toHaveClass("bx--progress--vertical"); - }); - - it("should render with equal spacing", () => { - render(ProgressIndicator, { - spaceEqually: true, - steps: [ - { label: "Step 1", description: "First step", complete: false }, - { label: "Step 2", description: "Second step", complete: false }, - { label: "Step 3", description: "Third step", complete: false }, - ], - }); - - const progressIndicator = screen.getByRole("list"); - expect(progressIndicator).toHaveClass("bx--progress--space-equal"); - }); - - it("should not apply equal spacing in vertical variant", () => { - render(ProgressIndicator, { - vertical: true, - spaceEqually: true, - steps: [ - { label: "Step 1", description: "First step", complete: false }, - { label: "Step 2", description: "Second step", complete: false }, - { label: "Step 3", description: "Third step", complete: false }, - ], - }); - - const progressIndicator = screen.getByRole("list"); - expect(progressIndicator).not.toHaveClass("bx--progress--space-equal"); - }); - }); - - describe("Accessibility", () => { - it("should have correct button attributes for different states", () => { - render(ProgressIndicator, { - currentIndex: 1, - steps: [ - { label: "Step 1", description: "First step", complete: true }, - { label: "Step 2", description: "Second step", complete: false }, - { label: "Step 3", description: "Third step", complete: false }, - ], - }); - - const buttons = screen.getAllByRole("button"); - - // Complete step button should be clickable - expect(buttons[0]).toHaveAttribute("tabindex", "0"); - expect(buttons[0]).toHaveAttribute("aria-disabled", "false"); - expect(buttons[0]).not.toHaveClass( - "bx--progress-step-button--unclickable", - ); - - // Current step button should be unclickable - expect(buttons[1]).toHaveAttribute("tabindex", "-1"); - expect(buttons[1]).toHaveAttribute("aria-disabled", "false"); - expect(buttons[1]).toHaveClass("bx--progress-step-button--unclickable"); - - // Incomplete step button should be unclickable - expect(buttons[2]).toHaveAttribute("tabindex", "0"); - expect(buttons[2]).toHaveAttribute("aria-disabled", "false"); - expect(buttons[2]).not.toHaveClass( - "bx--progress-step-button--unclickable", - ); - }); - - it("should have correct button attributes for disabled state", () => { - render(ProgressIndicator, { - steps: [ - { label: "Step 1", description: "First step", complete: true }, - { - label: "Step 2", - description: "Second step", - complete: false, - disabled: true, - }, - ], - }); - - const disabledButton = screen.getAllByRole("button")[1]; - expect(disabledButton).toHaveAttribute("disabled"); - expect(disabledButton).toHaveAttribute("aria-disabled", "true"); - expect(disabledButton).toHaveAttribute("tabindex", "-1"); - }); - - it("should support keyboard navigation for complete steps", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(ProgressIndicator, { - currentIndex: 1, - steps: [ - { label: "Step 1", description: "First step", complete: true }, - { label: "Step 2", description: "Second step", complete: false }, - ], - }); - - expect(consoleLog).not.toHaveBeenCalled(); - const completeStepButton = screen.getAllByRole("button")[0]; - await user.tab(); - expect(completeStepButton).toHaveFocus(); - - await user.keyboard("{Enter}"); - expect(consoleLog).toHaveBeenCalledWith("change", 0); - - await user.keyboard(" "); - expect(consoleLog).toHaveBeenCalledWith("change", 0); - }); - }); -}); diff --git a/tests/RadioButton.test.svelte b/tests/RadioButton.test.svelte new file mode 100644 index 00000000..7060aad1 --- /dev/null +++ b/tests/RadioButton.test.svelte @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tests/RadioButton/RadioButton.test.svelte b/tests/RadioButton/RadioButton.test.svelte deleted file mode 100644 index 59282887..00000000 --- a/tests/RadioButton/RadioButton.test.svelte +++ /dev/null @@ -1,38 +0,0 @@ - - - { - console.log("focus"); - }} - on:blur={() => { - console.log("blur"); - }} - on:change={() => { - console.log("change"); - }} -/> diff --git a/tests/RadioButton/RadioButton.test.ts b/tests/RadioButton/RadioButton.test.ts deleted file mode 100644 index 3b321c57..00000000 --- a/tests/RadioButton/RadioButton.test.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import RadioButton from "./RadioButton.test.svelte"; -import RadioButtonCustom from "./RadioButtonCustom.test.svelte"; - -describe("RadioButton", () => { - it("should render with default props", () => { - render(RadioButton); - - const input = screen.getByRole("radio"); - expect(input).toBeInTheDocument(); - expect(input).toHaveAttribute("name", "test-group"); - expect(input).toHaveAttribute("value", ""); - expect(input).not.toBeChecked(); - expect(screen.getByText("Option 1")).toBeInTheDocument(); - }); - - it("should handle checked state", () => { - render(RadioButton, { props: { checked: true } }); - - expect(screen.getByRole("radio")).toBeChecked(); - }); - - it("should handle disabled state", () => { - render(RadioButton, { props: { disabled: true } }); - - expect(screen.getByRole("radio")).toBeDisabled(); - }); - - it("should handle required state", () => { - render(RadioButton, { props: { required: true } }); - - expect(screen.getByRole("radio")).toHaveAttribute("required"); - }); - - it("should handle label position", () => { - render(RadioButton, { props: { labelPosition: "left" } }); - - expect( - screen.getByText("Option 1").closest(".bx--radio-button-wrapper"), - ).toHaveClass("bx--radio-button-wrapper--label-left"); - }); - - it("should handle hidden label", () => { - render(RadioButton, { props: { hideLabel: true } }); - - expect(screen.getByText("Option 1")).toHaveClass("bx--visually-hidden"); - }); - - it("should handle custom id", () => { - render(RadioButton, { props: { id: "custom-id" } }); - - expect(screen.getByRole("radio")).toHaveAttribute("id", "custom-id"); - - const radioButton = screen - .getByText("Option 1") - .closest(".bx--radio-button-wrapper"); - assert(radioButton); - expect(radioButton.querySelector("label")).toHaveAttribute( - "for", - "custom-id", - ); - }); - - it("should handle custom name", () => { - render(RadioButton, { props: { name: "custom-name" } }); - - expect(screen.getByRole("radio")).toHaveAttribute("name", "custom-name"); - }); - - it("should handle custom value", () => { - render(RadioButton, { props: { value: "custom-value" } }); - - expect(screen.getByRole("radio")).toHaveAttribute("value", "custom-value"); - }); - - it("should handle custom slots", () => { - render(RadioButtonCustom); - - expect(screen.getByText("Custom Label Text")).toBeInTheDocument(); - }); - - it("should handle change event", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(RadioButton); - - const input = screen.getByRole("radio"); - await user.click(input); - - expect(input).toBeChecked(); - expect(consoleLog).toHaveBeenCalledWith("change"); - }); - - it("should handle focus and blur events", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(RadioButton); - - const input = screen.getByRole("radio"); - await user.tab(); - expect(input).toHaveFocus(); - expect(consoleLog).toHaveBeenCalledWith("focus"); - - await user.tab(); - expect(input).not.toHaveFocus(); - expect(consoleLog).toHaveBeenCalledWith("blur"); - }); - - it("should handle disabled state with events", async () => { - render(RadioButton, { props: { disabled: true } }); - - const input = screen.getByRole("radio"); - await user.click(input); - expect(input).not.toBeChecked(); - }); - - it("should handle required state with form validation", () => { - render(RadioButton, { props: { required: true } }); - - expect(screen.getByRole("radio")).toHaveAttribute("required"); - }); - - it("should handle label text slot", () => { - render(RadioButtonCustom); - - expect(screen.getByText("Custom Label Text").tagName).toBe("SPAN"); - }); -}); diff --git a/tests/RadioButton/RadioButtonCustom.test.svelte b/tests/RadioButton/RadioButtonCustom.test.svelte deleted file mode 100644 index 5913e719..00000000 --- a/tests/RadioButton/RadioButtonCustom.test.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - - Custom Label Text - diff --git a/tests/RadioSelectableDataTable.test.svelte b/tests/RadioSelectableDataTable.test.svelte new file mode 100644 index 00000000..07f60d72 --- /dev/null +++ b/tests/RadioSelectableDataTable.test.svelte @@ -0,0 +1,24 @@ + + + diff --git a/tests/RadioTile.test.svelte b/tests/RadioTile.test.svelte new file mode 100644 index 00000000..d22a7b65 --- /dev/null +++ b/tests/RadioTile.test.svelte @@ -0,0 +1,15 @@ + + + + Lite plan + Standard plan + Plus plan + + + + Lite plan + Standard plan + Plus plan + diff --git a/tests/RadioTile/RadioTile.group.test.svelte b/tests/RadioTile/RadioTile.group.test.svelte deleted file mode 100644 index defafb8a..00000000 --- a/tests/RadioTile/RadioTile.group.test.svelte +++ /dev/null @@ -1,25 +0,0 @@ - - - - {#each values as value} - {value} - {/each} - - -
    - Selected: {selected} -
    - - diff --git a/tests/RadioTile/RadioTile.single.test.svelte b/tests/RadioTile/RadioTile.single.test.svelte deleted file mode 100644 index 6a986a02..00000000 --- a/tests/RadioTile/RadioTile.single.test.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - -
    Custom content
    -
    diff --git a/tests/RadioTile/RadioTile.test.svelte b/tests/RadioTile/RadioTile.test.svelte deleted file mode 100644 index 84d734e4..00000000 --- a/tests/RadioTile/RadioTile.test.svelte +++ /dev/null @@ -1,43 +0,0 @@ - - - - { - console.log("change"); - }} - on:keydown - on:click - on:mouseover - on:mouseenter - on:mouseleave - > - Test content - - diff --git a/tests/RadioTile/RadioTile.test.ts b/tests/RadioTile/RadioTile.test.ts deleted file mode 100644 index 9697654a..00000000 --- a/tests/RadioTile/RadioTile.test.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import RadioTile from "./RadioTile.test.svelte"; -import RadioTileCustom from "./RadioTileCustom.test.svelte"; -import RadioTileSingle from "./RadioTile.single.test.svelte"; -import RadioTileGroup from "./RadioTile.group.test.svelte"; - -describe("RadioTile", () => { - it("should render with default props", () => { - render(RadioTile); - - const input = screen.getByRole("radio"); - expect(input).toBeInTheDocument(); - expect(input).toHaveAttribute("name", "test-group"); - expect(input).toHaveAttribute("value", "test"); - expect(input).not.toBeChecked(); - expect(screen.getByText("Test content")).toBeInTheDocument(); - expect(screen.getByTitle("Tile checkmark")).toBeInTheDocument(); - }); - - it("should handle checked state", () => { - render(RadioTile, { - props: { checked: true }, - }); - - const input = screen.getByRole("radio"); - expect(input).toBeChecked(); - expect(screen.getByText("Test content").closest(".bx--tile")).toHaveClass( - "bx--tile--is-selected", - ); - }); - - it("should handle light variant", () => { - render(RadioTile, { - props: { light: true }, - }); - - expect(screen.getByText("Test content").closest(".bx--tile")).toHaveClass( - "bx--tile--light", - ); - }); - - it("should handle disabled state", () => { - render(RadioTile, { - props: { disabled: true }, - }); - - const input = screen.getByRole("radio"); - expect(input).toBeDisabled(); - expect(screen.getByText("Test content").closest(".bx--tile")).toHaveClass( - "bx--tile--disabled", - ); - }); - - it("should handle required state", () => { - render(RadioTile, { - props: { required: true }, - }); - - expect(screen.getByRole("radio")).toHaveAttribute("required"); - }); - - it("should handle custom value", () => { - render(RadioTile, { - props: { value: "custom-value" }, - }); - - expect(screen.getByRole("radio")).toHaveAttribute("value", "custom-value"); - }); - - it("should handle custom tabindex", () => { - render(RadioTile, { - props: { tabindex: "1" }, - }); - - expect(screen.getByRole("radio")).toHaveAttribute("tabindex", "1"); - }); - - it("should handle custom icon description", () => { - render(RadioTile, { - props: { iconDescription: "Custom checkmark" }, - }); - - expect(screen.getByTitle("Custom checkmark")).toBeInTheDocument(); - }); - - it("should handle custom id", () => { - render(RadioTile, { props: { id: "custom-id" } }); - - expect(screen.getByRole("radio")).toHaveAttribute("id", "custom-id"); - - const radioTileLabel = screen.getByText("Test content").closest("label"); - assert(radioTileLabel); - expect(radioTileLabel).toHaveAttribute("for", "custom-id"); - }); - - it("should handle custom name", () => { - render(RadioTileSingle); - - expect(screen.getByRole("radio")).toHaveAttribute("name", "custom-name"); - }); - - it("should handle custom slots", () => { - render(RadioTileCustom); - - expect(screen.getByText("Custom content")).toBeInTheDocument(); - }); - - it("should handle change event", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(RadioTile); - - const input = screen.getByRole("radio"); - await user.click(input); - - expect(input).toBeChecked(); - expect(consoleLog).toHaveBeenCalledWith("change"); - }); - - it("should handle keyboard events", async () => { - render(RadioTileGroup); - - const inputs = screen.getAllByRole("radio"); - - expect(inputs[1]).not.toHaveFocus(); - expect(inputs[1]).toBeChecked(); - - await user.tab(); - expect(inputs[1]).toHaveFocus(); - - await user.keyboard("{ArrowDown}"); - expect(inputs[2]).toHaveFocus(); - expect(inputs[2]).toBeChecked(); - - await user.keyboard("{ArrowDown}"); - expect(inputs[0]).toHaveFocus(); - expect(inputs[0]).toBeChecked(); - }); - - it("supports programmatic selection", async () => { - render(RadioTileGroup); - - const inputs = screen.getAllByRole("radio"); - expect(inputs[1]).not.toHaveFocus(); - expect(inputs[1]).toBeChecked(); - expect(screen.getByText(/Selected: Standard plan/)).toBeInTheDocument(); - - await user.click(inputs[2]); - expect(inputs[2]).toHaveFocus(); - expect(inputs[2]).toBeChecked(); - expect(screen.getByText(/Selected: Plus plan/)).toBeInTheDocument(); - - await user.click(screen.getByRole("button")); - expect(inputs[1]).not.toHaveFocus(); - expect(inputs[1]).toBeChecked(); - expect(screen.getByText(/Selected: Standard plan/)).toBeInTheDocument(); - }); - - it("should handle disabled state with events", async () => { - render(RadioTile, { - props: { disabled: true }, - }); - - const input = screen.getByRole("radio"); - await user.click(input); - expect(input).not.toBeChecked(); - }); - - it("should handle mouse events", async () => { - render(RadioTile); - - const tile = screen.getByText("Test content").closest(".bx--tile"); - assert(tile); - await user.hover(tile); - await user.unhover(tile); - }); - - it("should handle custom content slot", () => { - render(RadioTileCustom); - - const content = screen.getByText("Custom content"); - expect(content).toBeInTheDocument(); - expect(content.tagName).toBe("DIV"); - }); - - it("should handle TileGroup context", () => { - render(RadioTile, { props: { checked: true } }); - - const input = screen.getByRole("radio"); - expect(input).toBeChecked(); - expect(screen.getByText("Test content").closest(".bx--tile")).toHaveClass( - "bx--tile--is-selected", - ); - expect(input).toHaveAttribute("name", "test-group"); - }); -}); diff --git a/tests/RadioTile/RadioTileCustom.test.svelte b/tests/RadioTile/RadioTileCustom.test.svelte deleted file mode 100644 index 9d97ddf9..00000000 --- a/tests/RadioTile/RadioTileCustom.test.svelte +++ /dev/null @@ -1,9 +0,0 @@ - - - - -
    Custom content
    -
    -
    diff --git a/tests/RecursiveList/RecursiveList.hierarchy.test.svelte b/tests/RecursiveList/RecursiveList.hierarchy.test.svelte deleted file mode 100644 index ec44d237..00000000 --- a/tests/RecursiveList/RecursiveList.hierarchy.test.svelte +++ /dev/null @@ -1,24 +0,0 @@ - - - diff --git a/tests/RecursiveList/RecursiveList.test.svelte b/tests/RecursiveList/RecursiveList.test.svelte deleted file mode 100644 index cb1e9f98..00000000 --- a/tests/RecursiveList/RecursiveList.test.svelte +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/tests/RecursiveList/RecursiveList.test.ts b/tests/RecursiveList/RecursiveList.test.ts deleted file mode 100644 index 1614c154..00000000 --- a/tests/RecursiveList/RecursiveList.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import RecursiveListHierarchyTest from "./RecursiveList.hierarchy.test.svelte"; -import RecursiveListTest from "./RecursiveList.test.svelte"; - -const testCases = [ - { name: "RecursiveList", component: RecursiveListTest }, - { name: "RecursiveList hierarchy", component: RecursiveListHierarchyTest }, -]; - -describe.each(testCases)("$name", ({ component }) => { - it("renders all top-level items", () => { - render(component); - - expect(screen.getByText("Item 1")).toBeInTheDocument(); - expect(screen.getByText("Item 2")).toBeInTheDocument(); - expect(screen.getByText("Item 3")).toBeInTheDocument(); - - expect(screen.getAllByRole("list")).toHaveLength(4); - - // Nested items - expect(screen.getByText("Item 1a")).toBeInTheDocument(); - }); - - it("renders HTML content", () => { - render(component); - - const htmlContent = screen.getByText("HTML content"); - expect(htmlContent.tagName).toBe("H5"); - }); - - it("renders links correctly", () => { - render(component); - - const links = screen.getAllByRole("link"); - expect(links).toHaveLength(2); - - // Link with custom text - const customLink = screen.getByText("Link with custom text"); - expect(customLink).toHaveAttribute("href", "https://svelte.dev/"); - - // Plain link - const plainLink = links.find( - (link) => link.textContent === "https://svelte.dev/", - ); - expect(plainLink).toHaveAttribute("href", "https://svelte.dev/"); - }); -}); diff --git a/tests/ResponsiveGrid.test.svelte b/tests/ResponsiveGrid.test.svelte new file mode 100644 index 00000000..b0b3c5b9 --- /dev/null +++ b/tests/ResponsiveGrid.test.svelte @@ -0,0 +1,40 @@ + + + + + + sm: 1, md: 4, lg: 8 + + + sm: 1, md: 2, lg: 2 + + + sm: 1, md: 1, lg: 1 + + + sm: 1, md: 1, lg: 1 + + + diff --git a/tests/Search.test.svelte b/tests/Search.test.svelte new file mode 100644 index 00000000..ac067dbb --- /dev/null +++ b/tests/Search.test.svelte @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tests/Search/Search.test.svelte b/tests/Search/Search.test.svelte deleted file mode 100644 index 635d3f31..00000000 --- a/tests/Search/Search.test.svelte +++ /dev/null @@ -1,17 +0,0 @@ - - - { - console.log("clear"); - }} -/> - - diff --git a/tests/Search/Search.test.ts b/tests/Search/Search.test.ts deleted file mode 100644 index a266b940..00000000 --- a/tests/Search/Search.test.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import Search from "./Search.test.svelte"; -import SearchExpandable from "./SearchExpandable.test.svelte"; -import SearchSkeleton from "./SearchSkeleton.test.svelte"; - -describe("Search", () => { - const getSearchInput = (label?: string | RegExp) => - screen.getByRole("searchbox", { name: label }); - const getClearButton = (label = "Clear search input") => - screen.getByRole("button", { name: label }); - - it("renders and functions correctly", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Search); - - const search = getSearchInput("Default search"); - expect(search).toHaveValue(""); - expect(search).toHaveAttribute("placeholder", "Search"); - - await user.type(search, "test"); - expect(search).toHaveValue("test"); - - const clearButton = getClearButton("Clear value"); - await user.click(clearButton); - expect(search).toHaveValue(""); - expect(consoleLog).toHaveBeenCalledWith("clear"); - expect(consoleLog).toHaveBeenCalledTimes(1); - }); - - it("renders disabled state", async () => { - render(Search); - - const search = getSearchInput("Disabled search"); - expect(search).toBeDisabled(); - }); - - it("handles expandable variant", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(SearchExpandable); - - const search = getSearchInput("Expandable search"); - const searchWrapper = search.closest(".bx--search"); - assert(searchWrapper); - - expect(searchWrapper).toHaveClass("bx--search--expandable"); - expect(searchWrapper).not.toHaveClass("bx--search--expanded"); - - const magnifier = searchWrapper.querySelector(".bx--search-magnifier"); - assert(magnifier); - - await user.click(magnifier); - expect(searchWrapper).toHaveClass("bx--search--expanded"); - expect(consoleLog).toHaveBeenCalledWith("expanded"); - - await user.click(document.body); - expect(searchWrapper).not.toHaveClass("bx--search--expanded"); - expect(consoleLog).toHaveBeenCalledWith("collapsed"); - - // Don't collapse when has value - await user.click(magnifier); - await user.type(search, "test"); - await user.click(document.body); - expect(searchWrapper).toHaveClass("bx--search--expanded"); - }); - - it("renders skeleton states", () => { - render(SearchSkeleton); - - const skeletons = document.querySelectorAll(".bx--skeleton"); - expect(skeletons).toHaveLength(3); - - // Default (xl) skeleton - expect(skeletons[0]).toHaveClass("bx--search--xl"); - - // Large (lg) skeleton - expect(skeletons[1]).toHaveClass("bx--search--lg"); - - // Small (sm) skeleton - expect(skeletons[2]).toHaveClass("bx--search--sm"); - }); -}); diff --git a/tests/Search/SearchExpandable.test.svelte b/tests/Search/SearchExpandable.test.svelte deleted file mode 100644 index 68f2ca88..00000000 --- a/tests/Search/SearchExpandable.test.svelte +++ /dev/null @@ -1,22 +0,0 @@ - - - { - console.log("expanded"); - }} - on:collapse={() => { - console.log("collapsed"); - }} -/> - -
    Status: {expanded ? "expanded" : "collapsed"}
    diff --git a/tests/Search/SearchSkeleton.test.svelte b/tests/Search/SearchSkeleton.test.svelte deleted file mode 100644 index e4c965e6..00000000 --- a/tests/Search/SearchSkeleton.test.svelte +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/tests/Select.test.svelte b/tests/Select.test.svelte new file mode 100644 index 00000000..1874d478 --- /dev/null +++ b/tests/Select.test.svelte @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + diff --git a/tests/Select/Select.falsy.test.svelte b/tests/Select/Select.falsy.test.svelte deleted file mode 100644 index a7614f47..00000000 --- a/tests/Select/Select.falsy.test.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/tests/Select/Select.group.test.svelte b/tests/Select/Select.group.test.svelte deleted file mode 100644 index f9bcab0a..00000000 --- a/tests/Select/Select.group.test.svelte +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/tests/Select/Select.skeleton.test.svelte b/tests/Select/Select.skeleton.test.svelte deleted file mode 100644 index 8020f35a..00000000 --- a/tests/Select/Select.skeleton.test.svelte +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/tests/Select/Select.test.svelte b/tests/Select/Select.test.svelte deleted file mode 100644 index 4af1594d..00000000 --- a/tests/Select/Select.test.svelte +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/tests/Select/Select.test.ts b/tests/Select/Select.test.ts deleted file mode 100644 index 499450f1..00000000 --- a/tests/Select/Select.test.ts +++ /dev/null @@ -1,261 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import SelectFalsy from "./Select.falsy.test.svelte"; -import SelectGroup from "./Select.group.test.svelte"; -import SelectSkeleton from "./Select.skeleton.test.svelte"; -import Select from "./Select.test.svelte"; - -describe("Select", () => { - beforeEach(() => { - vi.clearAllMocks(); - }); - - it("renders with default props", () => { - render(Select); - - const select = screen.getByTestId("select"); - expect(select).toBeInTheDocument(); - - const label = select.querySelector("label"); - assert(label); - expect(label).toHaveTextContent("Select label"); - expect(label).not.toHaveClass("bx--visually-hidden"); - - const selectElement = select.querySelector("select"); - assert(selectElement); - expect(selectElement).not.toBeDisabled(); - expect(selectElement).not.toHaveAttribute("aria-invalid"); - - const options = selectElement.querySelectorAll("option"); - expect(options).toHaveLength(3); - expect(options[0]).toHaveValue("option-1"); - expect(options[0]).toHaveTextContent("Option 1"); - }); - - it("renders with selected value", () => { - render(Select, { selected: "option-2" }); - - const selectElement = screen.getByTestId("select").querySelector("select"); - assert(selectElement); - expect(selectElement).toHaveValue("option-2"); - }); - - it("emits events", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Select); - - const selectElement = screen.getByTestId("select").querySelector("select"); - assert(selectElement); - await user.selectOptions(selectElement, "option-2"); - - expect(consoleLog).toHaveBeenCalledWith("change"); - expect(consoleLog).toHaveBeenCalledWith("input"); - expect(consoleLog).toHaveBeenCalledWith("update", "option-2"); - expect(consoleLog).toHaveBeenCalledTimes(3); - }); - - it("renders default size", () => { - render(Select); - const selectElement = screen.getByTestId("select").querySelector("select"); - assert(selectElement); - expect(selectElement).not.toHaveClass("bx--select-input--sm"); - expect(selectElement).not.toHaveClass("bx--select-input--xl"); - }); - - it("renders small size variant", () => { - render(Select, { size: "sm" }); - const selectElement = screen.getByTestId("select").querySelector("select"); - assert(selectElement); - expect(selectElement).toHaveClass("bx--select-input--sm"); - expect(selectElement).not.toHaveClass("bx--select-input--xl"); - }); - - it("renders extra large size variant", () => { - render(Select, { size: "xl" }); - const selectElement = screen.getByTestId("select").querySelector("select"); - assert(selectElement); - expect(selectElement).not.toHaveClass("bx--select-input--sm"); - expect(selectElement).toHaveClass("bx--select-input--xl"); - }); - - it("renders default variant", () => { - render(Select); - const selectWrapper = screen - .getByTestId("select") - .querySelector(".bx--select"); - assert(selectWrapper); - expect(selectWrapper).not.toHaveClass("bx--select--inline"); - }); - - it("renders inline variant", () => { - render(Select, { inline: true }); - const selectWrapper = screen - .getByTestId("select") - .querySelector(".bx--select"); - assert(selectWrapper); - expect(selectWrapper).toHaveClass("bx--select--inline"); - }); - - it("renders default theme", () => { - render(Select); - const selectWrapper = screen - .getByTestId("select") - .querySelector(".bx--select"); - assert(selectWrapper); - expect(selectWrapper).not.toHaveClass("bx--select--light"); - }); - - it("renders light theme", () => { - render(Select, { light: true }); - const selectWrapper = screen - .getByTestId("select") - .querySelector(".bx--select"); - assert(selectWrapper); - expect(selectWrapper).toHaveClass("bx--select--light"); - }); - - it("renders enabled by default", () => { - render(Select); - const selectElement = screen.getByTestId("select").querySelector("select"); - assert(selectElement); - expect(selectElement).not.toBeDisabled(); - }); - - it("renders disabled state", () => { - render(Select, { disabled: true }); - const selectElement = screen.getByTestId("select").querySelector("select"); - assert(selectElement); - expect(selectElement).toBeDisabled(); - }); - - it("renders valid by default", () => { - render(Select); - const wrapper = screen.getByTestId("select"); - const selectElement = wrapper.querySelector("select"); - const selectWrapper = wrapper.querySelector(".bx--select"); - assert(selectElement); - assert(selectWrapper); - - expect(selectWrapper).not.toHaveClass("bx--select--invalid"); - expect(selectElement).not.toHaveAttribute("aria-invalid"); - expect( - wrapper.querySelector(".bx--form-requirement"), - ).not.toBeInTheDocument(); - }); - - it("renders invalid state", () => { - render(Select, { - invalid: true, - invalidText: "Invalid selection", - }); - - const wrapper = screen.getByTestId("select"); - const selectElement = wrapper.querySelector("select"); - const selectWrapper = wrapper.querySelector(".bx--select"); - assert(selectElement); - assert(selectWrapper); - - expect(selectWrapper).toHaveClass("bx--select--invalid"); - expect(selectElement).toHaveAttribute("aria-invalid", "true"); - expect(wrapper.querySelector(".bx--form-requirement")).toHaveTextContent( - "Invalid selection", - ); - }); - - it("renders without warning by default", () => { - render(Select); - const wrapper = screen.getByTestId("select"); - const selectWrapper = wrapper.querySelector(".bx--select"); - assert(selectWrapper); - - expect(selectWrapper).not.toHaveClass("bx--select--warning"); - expect( - wrapper.querySelector(".bx--form-requirement"), - ).not.toBeInTheDocument(); - }); - - it("renders warning state", () => { - render(Select, { - warn: true, - warnText: "Warning message", - }); - - const wrapper = screen.getByTestId("select"); - const selectWrapper = wrapper.querySelector(".bx--select"); - assert(selectWrapper); - expect(selectWrapper).toHaveClass("bx--select--warning"); - expect(wrapper.querySelector(".bx--form-requirement")).toHaveTextContent( - "Warning message", - ); - }); - - it("renders without helper text by default", () => { - render(Select); - expect( - screen.getByTestId("select").querySelector(".bx--form__helper-text"), - ).not.toBeInTheDocument(); - }); - - it("renders helper text when provided", () => { - render(Select, { helperText: "Helper text" }); - const helperElement = screen - .getByTestId("select") - .querySelector(".bx--form__helper-text"); - assert(helperElement); - expect(helperElement).toHaveTextContent("Helper text"); - }); - - it("renders visible label by default", () => { - render(Select); - const label = screen.getByTestId("select").querySelector("label"); - assert(label); - expect(label).not.toHaveClass("bx--visually-hidden"); - }); - - it("renders with hidden label", () => { - render(Select, { hideLabel: true }); - const label = screen.getByTestId("select").querySelector("label"); - assert(label); - expect(label).toHaveClass("bx--visually-hidden"); - }); - - it("renders with SelectItemGroup", () => { - render(SelectGroup); - - const select = screen.getByTestId("select-group"); - const selectElement = select.querySelector("select"); - assert(selectElement); - const optgroups = selectElement.querySelectorAll("optgroup"); - - expect(optgroups).toHaveLength(2); - expect(optgroups[0]).toHaveAttribute("label", "Category 1"); - expect(optgroups[1]).toHaveAttribute("label", "Category 2"); - - const options = selectElement.querySelectorAll("option"); - expect(options).toHaveLength(5); - expect(options[0]).toHaveAttribute("disabled"); - expect(options[0]).toHaveAttribute("hidden"); - }); - - it("renders skeleton state", () => { - render(SelectSkeleton); - - const skeleton = screen.getByTestId("select-skeleton"); - expect(skeleton).toBeInTheDocument(); - expect(skeleton.children[0]).toHaveClass("bx--skeleton"); - }); - - it("renders `text` instead of `value` if `text` is an empty string", () => { - render(SelectFalsy); - - expect(screen.getByLabelText("Falsy text")).toHaveValue("-1"); - expect(screen.getByRole("option", { name: "" })).toBeInTheDocument(); - }); - - it("renders value if `text` is undefined", () => { - render(SelectFalsy); - - expect(screen.getByLabelText("Undefined text")).toHaveValue("2"); - expect(screen.getByRole("option", { name: "2" })).toBeInTheDocument(); - }); -}); diff --git a/tests/SelectableDataTable.test.svelte b/tests/SelectableDataTable.test.svelte new file mode 100644 index 00000000..953d133e --- /dev/null +++ b/tests/SelectableDataTable.test.svelte @@ -0,0 +1,24 @@ + + + diff --git a/tests/SelectableTile.test.svelte b/tests/SelectableTile.test.svelte new file mode 100644 index 00000000..a4aed03c --- /dev/null +++ b/tests/SelectableTile.test.svelte @@ -0,0 +1,15 @@ + + +Multi-select Tile + +Multi-select Tile + +Multi-select Tile + +Multi-select Tile + +Multi-select Tile + +Multi-select Tile diff --git a/tests/SkeletonPlaceholder.test.svelte b/tests/SkeletonPlaceholder.test.svelte new file mode 100644 index 00000000..aabd46a8 --- /dev/null +++ b/tests/SkeletonPlaceholder.test.svelte @@ -0,0 +1,7 @@ + + + + + diff --git a/tests/SkeletonPlaceholder/SkeletonPlaceholder.test.svelte b/tests/SkeletonPlaceholder/SkeletonPlaceholder.test.svelte deleted file mode 100644 index c79dc33b..00000000 --- a/tests/SkeletonPlaceholder/SkeletonPlaceholder.test.svelte +++ /dev/null @@ -1,20 +0,0 @@ - - - { - console.log("click"); - }} - on:mouseover={() => { - console.log("mouseover"); - }} - on:mouseenter={() => { - console.log("mouseenter"); - }} - on:mouseleave={() => { - console.log("mouseleave"); - }} -/> diff --git a/tests/SkeletonPlaceholder/SkeletonPlaceholder.test.ts b/tests/SkeletonPlaceholder/SkeletonPlaceholder.test.ts deleted file mode 100644 index 0df9df0a..00000000 --- a/tests/SkeletonPlaceholder/SkeletonPlaceholder.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import SkeletonPlaceholder from "./SkeletonPlaceholder.test.svelte"; - -describe("SkeletonPlaceholder", () => { - it("should render with default props", () => { - render(SkeletonPlaceholder); - - const element = screen.getByTestId("skeleton-placeholder"); - expect(element).toHaveClass("bx--skeleton__placeholder"); - }); - - it("should render with custom size", () => { - render(SkeletonPlaceholder, { - props: { style: "height: 12rem; width: 12rem;" }, - }); - - const element = screen.getByTestId("skeleton-placeholder"); - expect(element).toHaveStyle({ height: "12rem", width: "12rem" }); - }); - - it("should handle mouse events", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(SkeletonPlaceholder); - - const element = screen.getByTestId("skeleton-placeholder"); - - await user.click(element); - expect(consoleLog).toHaveBeenCalledWith("click"); - - await user.hover(element); - expect(consoleLog).toHaveBeenCalledWith("mouseover"); - - await user.unhover(element); - expect(consoleLog).toHaveBeenCalledWith("mouseleave"); - }); - - it("should accept additional attributes", () => { - render(SkeletonPlaceholder, { - props: { - "data-testid": "custom-placeholder", - "aria-label": "Loading placeholder", - }, - }); - - const element = screen.getByTestId("custom-placeholder"); - expect(element).toHaveAttribute("aria-label", "Loading placeholder"); - }); - - it("should accept additional classes", () => { - render(SkeletonPlaceholder, { - props: { class: "custom-class" }, - }); - - const element = screen.getByTestId("skeleton-placeholder"); - expect(element).toHaveClass("bx--skeleton__placeholder", "custom-class"); - }); -}); diff --git a/tests/SkeletonText.test.svelte b/tests/SkeletonText.test.svelte new file mode 100644 index 00000000..90bb0252 --- /dev/null +++ b/tests/SkeletonText.test.svelte @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/tests/SkeletonText/SkeletonText.test.svelte b/tests/SkeletonText/SkeletonText.test.svelte deleted file mode 100644 index 1caddcfc..00000000 --- a/tests/SkeletonText/SkeletonText.test.svelte +++ /dev/null @@ -1,27 +0,0 @@ - - - { - console.log("click"); - }} - on:mouseover={() => { - console.log("mouseover"); - }} - on:mouseenter={() => { - console.log("mouseenter"); - }} - on:mouseleave={() => { - console.log("mouseleave"); - }} -/> diff --git a/tests/SkeletonText/SkeletonText.test.ts b/tests/SkeletonText/SkeletonText.test.ts deleted file mode 100644 index 7796b09a..00000000 --- a/tests/SkeletonText/SkeletonText.test.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import SkeletonText from "./SkeletonText.test.svelte"; - -describe("SkeletonText", () => { - it("should render with default props", () => { - render(SkeletonText); - const element = screen.getByRole("paragraph"); - expect(element).toHaveClass("bx--skeleton__text"); - expect(element).toHaveStyle({ width: "100%" }); - }); - - it("should render heading variant", () => { - render(SkeletonText, { props: { heading: true } }); - const element = screen.getByRole("paragraph"); - expect(element).toHaveClass("bx--skeleton__text", "bx--skeleton__heading"); - }); - - it("should render paragraph variant with default lines", () => { - render(SkeletonText, { props: { paragraph: true } }); - - const elements = screen.getAllByRole("paragraph"); - expect(elements).toHaveLength(3); // default lines is 3 - elements.forEach((element) => { - expect(element).toHaveClass("bx--skeleton__text"); - }); - }); - - it("should render paragraph with custom line count", () => { - render(SkeletonText, { props: { paragraph: true, lines: 8 } }); - - const elements = screen.getAllByRole("paragraph"); - expect(elements).toHaveLength(8); - }); - - it("should render with custom width", () => { - render(SkeletonText, { props: { width: "50%" } }); - - const element = screen.getByRole("paragraph"); - expect(element).toHaveStyle({ width: "50%" }); - }); - - it("should render paragraph with pixel width", () => { - render(SkeletonText, { props: { paragraph: true, width: "200px" } }); - - const elements = screen.getAllByRole("paragraph"); - elements.forEach((element) => { - const width = element.style.width; - expect(width).toMatch(/^\d+px$/); - const numWidth = parseInt(width); - expect(numWidth).toBeGreaterThanOrEqual(125); // 200 - 75 - expect(numWidth).toBeLessThanOrEqual(200); - }); - }); - - it("should handle mouse events", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(SkeletonText); - - const element = screen.getByRole("paragraph"); - - await user.click(element); - expect(consoleLog).toHaveBeenCalledWith("click"); - - await user.hover(element); - expect(consoleLog).toHaveBeenCalledWith("mouseover"); - - await user.unhover(element); - expect(consoleLog).toHaveBeenCalledWith("mouseleave"); - }); - - it("should handle paragraph mouse events", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(SkeletonText, { props: { paragraph: true } }); - - const container = screen.getAllByRole("paragraph")[0].parentElement; - expect(container).toBeTruthy(); - - if (container) { - await user.click(container); - expect(consoleLog).toHaveBeenCalledWith("click"); - - await user.hover(container); - expect(consoleLog).toHaveBeenCalledWith("mouseover"); - - await user.unhover(container); - expect(consoleLog).toHaveBeenCalledWith("mouseleave"); - } - }); -}); diff --git a/tests/Slider.test.svelte b/tests/Slider.test.svelte new file mode 100644 index 00000000..c5f5b000 --- /dev/null +++ b/tests/Slider.test.svelte @@ -0,0 +1,36 @@ + + + + + + + + + + + + + diff --git a/tests/Slider/Slider.test.svelte b/tests/Slider/Slider.test.svelte deleted file mode 100644 index efd560f5..00000000 --- a/tests/Slider/Slider.test.svelte +++ /dev/null @@ -1,37 +0,0 @@ - - - { - console.log("change", e.detail); - }} - on:input={(e) => { - console.log("input", e.detail); - }} -/> diff --git a/tests/Slider/Slider.test.ts b/tests/Slider/Slider.test.ts deleted file mode 100644 index 65005860..00000000 --- a/tests/Slider/Slider.test.ts +++ /dev/null @@ -1,177 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import Slider from "./Slider.test.svelte"; - -describe("Slider", () => { - beforeEach(() => { - vi.clearAllMocks(); - }); - - it("should render with default props", () => { - render(Slider); - - expect(screen.getByText("Test Slider")).toBeInTheDocument(); - expect(screen.getByRole("slider")).toBeInTheDocument(); - expect(screen.getByRole("spinbutton")).toHaveValue(0); - }); - - it("should handle value changes through input", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Slider); - - const input = screen.getByRole("spinbutton"); - await user.clear(input); - await user.type(input, "50"); - await user.keyboard("{Tab}"); - - expect(consoleLog).toHaveBeenCalledWith("change", 50); - }); - - it("should handle keyboard navigation", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Slider); - - const slider = screen.getByRole("slider"); - await user.tab(); - expect(slider).toHaveFocus(); - - await user.keyboard("{ArrowRight}"); - expect(consoleLog).toHaveBeenCalledWith("change", 1); - - await user.keyboard("{ArrowLeft}"); - expect(consoleLog).toHaveBeenCalledWith("change", 0); - }); - - it("should handle custom range and step", () => { - render(Slider, { - props: { - min: 10, - max: 990, - minLabel: "10 MB", - maxLabel: "990 MB", - step: 10, - }, - }); - - const slider = screen.getByRole("slider"); - expect(slider).toHaveAttribute("aria-valuemin", "10"); - expect(slider).toHaveAttribute("aria-valuemax", "990"); - expect(screen.getByText("990 MB")).toBeInTheDocument(); - }); - - it("should handle hidden text input", () => { - render(Slider, { - props: { hideTextInput: true }, - }); - - const spinbutton = screen.getByLabelText("Slider number input"); - expect(spinbutton).toHaveAttribute("type", "hidden"); - }); - - it("should handle full width", () => { - render(Slider, { - props: { fullWidth: true }, - }); - - const slider = screen.getByRole("slider").parentElement; - expect(slider).toHaveStyle("max-width: none"); - }); - - it("should handle disabled state", () => { - render(Slider, { - props: { disabled: true }, - }); - - const slider = screen.getByRole("slider"); - const input = screen.getByRole("spinbutton"); - const label = screen.getByText("Test Slider"); - - expect(slider.parentElement).toHaveClass("bx--slider--disabled"); - expect(input).toBeDisabled(); - expect(label).toHaveClass("bx--label--disabled"); - }); - - it("should handle invalid state", () => { - render(Slider, { - props: { invalid: true }, - }); - - const input = screen.getByRole("spinbutton"); - expect(input).toHaveClass("bx--text-input--invalid"); - expect(input).toHaveAttribute("data-invalid", "true"); - expect(input).toHaveAttribute("aria-invalid", "true"); - }); - - it("should handle custom labels", () => { - render(Slider, { - props: { - minLabel: "0 MB", - maxLabel: "100 MB", - }, - }); - - expect(screen.getByText("0 MB")).toBeInTheDocument(); - expect(screen.getByText("100 MB")).toBeInTheDocument(); - }); - - it("should handle required state", () => { - render(Slider, { - props: { required: true }, - }); - - const input = screen.getByRole("spinbutton"); - expect(input).toBeRequired(); - }); - - it("should handle step multiplier with shift key", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Slider); - - const slider = screen.getByRole("slider"); - await user.tab(); - expect(slider).toHaveFocus(); - - await user.keyboard("{Shift>}{ArrowRight}{/Shift}"); - expect(consoleLog).toHaveBeenCalledWith("change", 25); - }); - - it("should clamp values to min and max", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Slider, { - props: { min: 10, max: 990 }, - }); - - const input = screen.getByRole("spinbutton"); - await user.clear(input); - await user.type(input, "5"); - await user.keyboard("{Tab}"); - expect(consoleLog).toHaveBeenCalledWith("change", 10); - - await user.clear(input); - await user.type(input, "1000{Tab}"); - await user.keyboard("{Tab}"); - expect(consoleLog).toHaveBeenCalledWith("change", 990); - }); - - it("should not respond to dragging when disabled", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Slider, { - props: { disabled: true }, - }); - - const slider = screen.getByRole("slider"); - const container = screen.getByRole("presentation"); - - // Simulate mouse down on the slider - await user.pointer({ target: slider, keys: "[MouseLeft]" }); - - // Simulate mouse move - const { left, width } = container.getBoundingClientRect(); - await user.pointer({ target: container, coords: { x: left + width / 2 } }); - - // Simulate mouse up - await user.pointer({ target: container, keys: "[/MouseLeft]" }); - - expect(consoleLog).not.toHaveBeenCalled(); - }); -}); diff --git a/tests/StructuredList.test.svelte b/tests/StructuredList.test.svelte new file mode 100644 index 00000000..d6586019 --- /dev/null +++ b/tests/StructuredList.test.svelte @@ -0,0 +1,94 @@ + + + + + + Column A + Column B + Column C + + + + + Row 1 + Row 1 + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dui magna, + finibus id tortor sed, aliquet bibendum augue. Aenean posuere sem vel + euismod dignissim. Nulla ut cursus dolor. Pellentesque vulputate nisl a + porttitor interdum. + + + + Row 2 + Row 2 + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dui magna, + finibus id tortor sed, aliquet bibendum augue. Aenean posuere sem vel + euismod dignissim. Nulla ut cursus dolor. Pellentesque vulputate nisl a + porttitor interdum. + + + + Row 3 + Row 3 + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dui magna, + finibus id tortor sed, aliquet bibendum augue. Aenean posuere sem vel + euismod dignissim. Nulla ut cursus dolor. Pellentesque vulputate nisl a + porttitor interdum. + + + + + + + + + ColumnA + ColumnB + ColumnC + {""} + + + + {#each [1, 2, 3] as item} + + Row {item} + Row {item} + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dui + magna, finibus id tortor sed, aliquet bibendum augue. Aenean posuere + sem vel euismod dignissim. Nulla ut cursus dolor. Pellentesque + vulputate nisl a porttitor interdum. + + + + + + + {/each} + + + + diff --git a/tests/StructuredList/StructuredList.test.svelte b/tests/StructuredList/StructuredList.test.svelte deleted file mode 100644 index cacf5f64..00000000 --- a/tests/StructuredList/StructuredList.test.svelte +++ /dev/null @@ -1,79 +0,0 @@ - - - { - console.log("click"); - }} - on:mouseover={() => { - console.log("mouseover"); - }} - on:mouseenter={() => { - console.log("mouseenter"); - }} - on:mouseleave={() => { - console.log("mouseleave"); - }} - on:change={(e) => { - console.log("change", e.detail); - }} -> - - - Column A - Column B - Column C - {#if selection} - {""} - {/if} - - - - {#each ["1", "2", "3"] as item} - - Row {item} - Row {item} - Content {item} - {#if selection} - - - - - {/if} - - {/each} - - - -
    {selected}
    diff --git a/tests/StructuredList/StructuredList.test.ts b/tests/StructuredList/StructuredList.test.ts deleted file mode 100644 index c11e7c89..00000000 --- a/tests/StructuredList/StructuredList.test.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import StructuredList from "./StructuredList.test.svelte"; -import StructuredListCustom from "./StructuredListCustom.test.svelte"; - -describe("StructuredList", () => { - it("should render with default props", () => { - render(StructuredList); - - const list = screen.getByRole("table"); - expect(list).toBeInTheDocument(); - expect(list).toHaveClass("bx--structured-list"); - - // Check header cells - const headerCells = screen.getAllByRole("columnheader"); - expect(headerCells).toHaveLength(3); - expect(headerCells[0]).toHaveTextContent("Column A"); - expect(headerCells[1]).toHaveTextContent("Column B"); - expect(headerCells[2]).toHaveTextContent("Column C"); - - // Check body cells - const cells = screen.getAllByRole("cell"); - expect(cells).toHaveLength(9); // 3 rows x 3 columns - expect(cells[0]).toHaveTextContent("Row 1"); - expect(cells[1]).toHaveTextContent("Row 1"); - expect(cells[2]).toHaveTextContent("Content 1"); - }); - - it("should handle condensed variant", () => { - render(StructuredList, { props: { condensed: true } }); - - expect(screen.getByRole("table")).toHaveClass( - "bx--structured-list--condensed", - ); - }); - - it("should handle flush variant", () => { - render(StructuredList, { props: { flush: true } }); - - expect(screen.getByRole("table")).toHaveClass("bx--structured-list--flush"); - }); - - it("should handle selection variant", () => { - render(StructuredList, { props: { selection: true } }); - - const list = screen.getByRole("table"); - expect(list).toHaveClass("bx--structured-list--selection"); - - const inputs = screen.getAllByRole("radio"); - expect(inputs).toHaveLength(3); - - const checkmarks = screen.getAllByTitle("select an option"); - expect(checkmarks).toHaveLength(3); - }); - - it("should handle selected state", async () => { - render(StructuredList, { - props: { selection: true, selected: "row-1-value" }, - }); - - const selectedInput = screen.getByRole("radio", { checked: true }); - expect(selectedInput.closest("label")).toHaveTextContent("Row 1"); - - await user.click(screen.getAllByRole("radio")[1]); - expect( - screen.getByRole("radio", { checked: true }).closest("label"), - ).toHaveTextContent("Row 2"); - }); - - it("should handle selection change", async () => { - render(StructuredList, { props: { selection: true } }); - - const secondInput = screen.getAllByRole("radio")[1]; - await user.click(secondInput); - - expect(screen.getByTestId("value").textContent).toBe("row-2-value"); - }); - - it("should handle custom content", () => { - render(StructuredListCustom); - - expect(screen.getByTestId("custom-header")).toHaveTextContent( - "Custom Header", - ); - expect(screen.getByTestId("custom-content")).toHaveTextContent( - "Custom Content", - ); - }); - - it("should handle mouse events", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(StructuredList); - - const list = screen.getByRole("table"); - - await user.click(list); - expect(consoleLog).toHaveBeenCalledWith("click"); - await user.hover(list); - expect(consoleLog).toHaveBeenCalledWith("mouseover"); - await user.unhover(list); - expect(consoleLog).toHaveBeenCalledWith("mouseleave"); - }); - - it("should handle noWrap cells", () => { - render(StructuredList); - - const noWrapCells = screen - .getAllByRole("cell") - .filter( - (cell) => - cell.textContent?.startsWith("Row") && cell.textContent?.length === 5, - ); - - noWrapCells.forEach((cell) => { - expect(cell).toHaveClass("bx--structured-list-td"); - }); - }); - - it("should emit change event on selection", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(StructuredList, { props: { selection: true } }); - - expect(consoleLog).not.toHaveBeenCalled(); - - await user.click(screen.getAllByRole("radio")[1]); - expect(consoleLog).toHaveBeenCalledWith("change", "row-2-value"); - - await user.click(screen.getAllByRole("radio")[0]); - expect(consoleLog).toHaveBeenCalledWith("change", "row-1-value"); - }); -}); diff --git a/tests/StructuredList/StructuredListCustom.test.svelte b/tests/StructuredList/StructuredListCustom.test.svelte deleted file mode 100644 index 3ef8a400..00000000 --- a/tests/StructuredList/StructuredListCustom.test.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - -
    Custom Header
    -
    -
    -
    - - - -
    Custom Content
    -
    -
    -
    -
    diff --git a/tests/Tabs.test.svelte b/tests/Tabs.test.svelte new file mode 100644 index 00000000..8f1f1b88 --- /dev/null +++ b/tests/Tabs.test.svelte @@ -0,0 +1,39 @@ + + + + + + +
    + Content 1 + Content 2 + Content 3 +
    +
    + +Content 1 + +Content 2 + +Content 3 + + + + + +
    + Content 1 + Content 2 + Content 3 +
    +
    + +Content 1 + +Content 2 + +Content 3 + + diff --git a/tests/Tabs/Tab.test.svelte b/tests/Tabs/Tab.test.svelte deleted file mode 100644 index 2e5174f4..00000000 --- a/tests/Tabs/Tab.test.svelte +++ /dev/null @@ -1,16 +0,0 @@ - - - - - -
    Test Content
    -
    -
    diff --git a/tests/Tabs/Tabs.test.svelte b/tests/Tabs/Tabs.test.svelte deleted file mode 100644 index 27f06ebd..00000000 --- a/tests/Tabs/Tabs.test.svelte +++ /dev/null @@ -1,29 +0,0 @@ - - - { - console.log("change event", detail); - }} -> - - - - - Content 1 - Content 2 - Content 3 - - diff --git a/tests/Tabs/Tabs.test.ts b/tests/Tabs/Tabs.test.ts deleted file mode 100644 index 789d1ed5..00000000 --- a/tests/Tabs/Tabs.test.ts +++ /dev/null @@ -1,300 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import Tabs from "./Tabs.test.svelte"; -import Tab from "./Tab.test.svelte"; -import TabsSkeleton from "./TabsSkeleton.test.svelte"; - -describe("Tabs", () => { - let consoleLog: ReturnType; - - beforeEach(() => { - consoleLog = vi.spyOn(console, "log"); - }); - - afterEach(() => { - vi.restoreAllMocks(); - }); - - it("should render with default props", () => { - render(Tabs); - - expect(screen.getByRole("tab", { name: "Tab 1" })).toBeInTheDocument(); - expect(screen.getByRole("tab", { name: "Tab 2" })).toBeInTheDocument(); - expect(screen.getByRole("tab", { name: "Tab 3" })).toBeInTheDocument(); - expect(screen.getByText("Content 1")).toBeVisible(); - expect(screen.getByText("Content 2")).not.toBeVisible(); - expect(screen.getByText("Content 3")).not.toBeVisible(); - }); - - it("should select initial tab based on selected prop", () => { - render(Tabs, { props: { selected: 2 } }); - - const tab3 = screen.getByRole("tab", { name: "Tab 3" }); - expect(tab3).toHaveAttribute("aria-selected", "true"); - expect(screen.getByText("Content 3")).toBeVisible(); - expect(screen.getByText("Content 1")).not.toBeVisible(); - expect(screen.getByText("Content 2")).not.toBeVisible(); - }); - - it("should change tab on click", async () => { - render(Tabs); - - const tab3 = screen.getByRole("tab", { name: "Tab 3" }); - await user.click(tab3); - - expect(tab3.getAttribute("aria-selected")).toBe("true"); - expect(screen.getByText("Content 3")).toBeVisible(); - expect(consoleLog).toHaveBeenCalledWith("change event", 2); - }); - - it("should not select disabled tabs", async () => { - render(Tabs); - - const tab2 = screen.getByRole("tab", { name: "Tab 2" }); - expect(tab2).toHaveAttribute("aria-disabled", "true"); - await user.click(tab2); - - expect(tab2).toHaveAttribute("aria-selected", "false"); - expect(screen.getByText("Content 1")).toBeVisible(); - }); - - it("should support keyboard navigation", async () => { - render(Tabs); - - const tab1 = screen.getByRole("tab", { name: "Tab 1" }); - await user.click(tab1); - - await user.keyboard("{ArrowRight}"); - expect(screen.getByRole("tab", { name: "Tab 3" })).toHaveFocus(); - expect(consoleLog).toHaveBeenCalledWith("change event", 2); - - await user.keyboard("{ArrowLeft}"); - expect(tab1).toHaveFocus(); - expect(consoleLog).toHaveBeenCalledWith("change event", 0); - }); - - it("should render container type tabs", () => { - const { container } = render(Tabs, { - props: { type: "container" }, - }); - - expect(container.querySelector(".bx--tabs--container")).not.toBeNull(); - }); - - it("should support auto width", () => { - const { container } = render(Tabs, { - props: { autoWidth: true }, - }); - - const tabs = container.querySelectorAll(".bx--tabs__nav-item"); - tabs.forEach((tab) => { - expect(tab).not.toHaveStyle({ width: "10rem" }); - }); - }); - - it("should show dropdown on trigger click", async () => { - const { container } = render(Tabs); - - const trigger = container.querySelector(".bx--tabs-trigger"); - if (!trigger) throw new Error("Trigger element not found"); - - await user.click(trigger); - expect(container.querySelector(".bx--tabs__nav--hidden")).toBeNull(); - }); - - it("should update trigger text when tab changes", async () => { - const { container } = render(Tabs); - - const tab3 = screen.getByText("Tab 3"); - await user.click(tab3); - - const triggerText = container.querySelector(".bx--tabs-trigger-text"); - expect(triggerText).toHaveTextContent("Tab 3"); - }); - - it("should support custom trigger href", () => { - const { container } = render(Tabs, { - props: { triggerHref: "#custom" }, - }); - - const triggerLink = container.querySelector(".bx--tabs-trigger-text"); - expect(triggerLink).toHaveAttribute("href", "#custom"); - }); - - it("should support custom icon description", () => { - render(Tabs, { - props: { iconDescription: "Custom description" }, - }); - - expect(screen.getByTitle("Custom description")).toBeInTheDocument(); - }); -}); - -describe("Tab", () => { - it("should render with default props", () => { - render(Tab); - - const tab = screen.getByRole("tab", { name: "Test Tab" }); - expect(tab).toBeInTheDocument(); - expect(tab).toHaveAttribute("href", "#test"); - expect(tab).toHaveAttribute("tabindex", "0"); - expect(tab).toHaveAttribute("id", "test-tab"); - }); - - it("should render with custom label", () => { - render(Tab, { props: { label: "Custom Label" } }); - - expect( - screen.getByRole("tab", { name: "Custom Label" }), - ).toBeInTheDocument(); - }); - - it("should render with custom href", () => { - render(Tab, { props: { href: "/custom" } }); - - const tab = screen.getByRole("tab"); - expect(tab).toHaveAttribute("href", "/custom"); - }); - - it("should handle disabled state", () => { - render(Tab, { props: { disabled: true } }); - - const tab = screen.getByRole("tab"); - expect(tab).toHaveAttribute("aria-disabled", "true"); - expect(tab).toHaveAttribute("tabindex", "-1"); - }); - - it("should handle custom tabindex", () => { - render(Tab, { props: { tabindex: "1" } }); - - const tab = screen.getByRole("tab"); - expect(tab).toHaveAttribute("tabindex", "1"); - }); - - it("should handle custom id", () => { - render(Tab, { props: { id: "custom-id" } }); - - const tab = screen.getByRole("tab"); - expect(tab).toHaveAttribute("id", "custom-id"); - }); - - it("should be clickable when enabled", async () => { - render(Tab); - - const tab = screen.getByRole("tab"); - await user.click(tab); - - expect(tab).toHaveAttribute("aria-selected", "true"); - }); - - it("should handle keyboard navigation with arrow keys", async () => { - render(Tab); - - const tab = screen.getByRole("tab"); - await user.click(tab); - await user.keyboard("{ArrowRight}"); - - expect(tab).toHaveFocus(); - }); - - it("should handle space key activation", async () => { - render(Tab); - - const tab = screen.getByRole("tab"); - await user.click(tab); - await user.keyboard(" "); - - expect(tab).toHaveAttribute("aria-selected", "true"); - }); - - it("should handle enter key activation", async () => { - render(Tab); - - const tab = screen.getByRole("tab"); - await user.click(tab); - await user.keyboard("{Enter}"); - - expect(tab).toHaveAttribute("aria-selected", "true"); - }); - - it("should render slot content when no label provided", () => { - render(Tab, { props: { label: "" } }); - - const tab = screen.getByRole("tab"); - expect(tab).toHaveTextContent(""); - }); -}); - -describe("TabsSkeleton", () => { - it("should render with default props", () => { - const { container } = render(TabsSkeleton); - - const skeleton = container.querySelector(".bx--tabs"); - expect(skeleton).toBeInTheDocument(); - expect(skeleton).toHaveClass("bx--skeleton"); - expect(skeleton).toHaveClass("bx--tabs--scrollable"); - - const navItems = container.querySelectorAll( - ".bx--tabs--scrollable__nav-item", - ); - expect(navItems).toHaveLength(4); - }); - - it("should render with custom count", () => { - const { container } = render(TabsSkeleton, { props: { count: 6 } }); - - const navItems = container.querySelectorAll( - ".bx--tabs--scrollable__nav-item", - ); - expect(navItems).toHaveLength(6); - }); - - it("should render with container type", () => { - const { container } = render(TabsSkeleton, { - props: { type: "container" }, - }); - - const skeleton = container.querySelector(".bx--tabs"); - expect(skeleton).toHaveClass("bx--tabs--scrollable--container"); - }); - - it("should render with default type", () => { - const { container } = render(TabsSkeleton, { props: { type: "default" } }); - - const skeleton = container.querySelector(".bx--tabs"); - expect(skeleton).not.toHaveClass("bx--tabs--scrollable--container"); - }); - - it("should render skeleton nav items with correct structure", () => { - const { container } = render(TabsSkeleton); - - const navItems = container.querySelectorAll( - ".bx--tabs--scrollable__nav-item", - ); - navItems.forEach((item) => { - const link = item.querySelector(".bx--tabs__nav-link"); - const span = link?.querySelector("span"); - - expect(link).toBeInTheDocument(); - expect(span).toBeInTheDocument(); - }); - }); - - it("should handle zero count", () => { - const { container } = render(TabsSkeleton, { props: { count: 0 } }); - - const navItems = container.querySelectorAll( - ".bx--tabs--scrollable__nav-item", - ); - expect(navItems).toHaveLength(0); - }); - - it("should handle large count", () => { - const { container } = render(TabsSkeleton, { props: { count: 20 } }); - - const navItems = container.querySelectorAll( - ".bx--tabs--scrollable__nav-item", - ); - expect(navItems).toHaveLength(20); - }); -}); diff --git a/tests/Tabs/TabsSkeleton.test.svelte b/tests/Tabs/TabsSkeleton.test.svelte deleted file mode 100644 index 6b4fc96b..00000000 --- a/tests/Tabs/TabsSkeleton.test.svelte +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/tests/Tag/Tag.test.svelte b/tests/Tag.test.svelte similarity index 55% rename from tests/Tag/Tag.test.svelte rename to tests/Tag.test.svelte index 2a5710e1..9396c8b9 100644 --- a/tests/Tag/Tag.test.svelte +++ b/tests/Tag.test.svelte @@ -1,6 +1,6 @@ IBM Cloud @@ -27,25 +27,10 @@ high-contrast -outline +Filterable - { - console.log("click"); - }} - on:close={() => { - console.log("close"); - }}>Filterable +Custom icon -Custom icon - - { - console.log("click"); - }}>Text +Text diff --git a/tests/Tag/Tag.test.ts b/tests/Tag/Tag.test.ts deleted file mode 100644 index 6a2dcce1..00000000 --- a/tests/Tag/Tag.test.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import Tag from "./Tag.test.svelte"; - -describe("Tag", () => { - afterEach(() => { - vi.clearAllMocks(); - }); - - it("renders all tag variants with correct styles", () => { - render(Tag); - - const basicTag = screen.getByText("IBM Cloud"); - expect(basicTag.parentElement).toHaveClass("my-class"); - expect(basicTag.parentElement).toHaveStyle({ margin: "1rem" }); - - [ - "red", - "magenta", - "purple", - "blue", - "cyan", - "teal", - "green", - "gray", - "cool-gray", - "warm-gray", - "high-contrast", - "outline", - ].forEach((color) => { - const tag = screen.getByText(color); - expect(tag.parentElement).toHaveClass(`bx--tag--${color}`); - }); - }); - - it("renders and handles filterable tag correctly", async () => { - const consoleLog = vi.spyOn(console, "log"); - - render(Tag); - - const filterableTag = screen.getByText("Filterable"); - expect(filterableTag).toHaveClass("bx--tag--filter"); - - const closeButton = filterableTag.querySelector("button")!; - expect(closeButton).toHaveClass("bx--tag__close-icon"); - expect(closeButton).toHaveAttribute("title", "Clear filter"); - - await user.click(closeButton); - expect(consoleLog).toHaveBeenCalledWith("close"); - expect(consoleLog).toHaveBeenCalledWith("click"); - }); - - it("renders custom icon tag correctly", () => { - render(Tag); - - const iconTag = screen.getByText("Custom icon"); - const iconContainer = iconTag.parentElement?.querySelector( - ".bx--tag__custom-icon", - ); - expect(iconContainer).toBeInTheDocument(); - }); - - it("renders interactive tag as a button", () => { - render(Tag); - - const interactiveTag = screen.getByRole("button", { name: "Text" }); - expect(interactiveTag).toHaveClass("bx--tag--interactive"); - }); - - it("renders skeleton state", () => { - render(Tag); - - const skeleton = document.querySelector(".bx--skeleton"); - expect(skeleton).toBeInTheDocument(); - }); - - it("handles click events on interactive tag", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Tag); - - const interactiveTag = screen.getByRole("button", { name: "Text" }); - await user.click(interactiveTag); - expect(consoleLog).toHaveBeenCalledWith("click"); - }); -}); diff --git a/tests/TextArea.test.svelte b/tests/TextArea.test.svelte new file mode 100644 index 00000000..d40dd0b6 --- /dev/null +++ b/tests/TextArea.test.svelte @@ -0,0 +1,46 @@ + + + diff --git a/tests/TextInput.test.svelte b/tests/TextInput.test.svelte new file mode 100644 index 00000000..1900a82f --- /dev/null +++ b/tests/TextInput.test.svelte @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/TextInput/TextInput.test.svelte b/tests/TextInput/TextInput.test.svelte deleted file mode 100644 index 5dc88aac..00000000 --- a/tests/TextInput/TextInput.test.svelte +++ /dev/null @@ -1,55 +0,0 @@ - - - - -
    {value}
    diff --git a/tests/TextInput/TextInput.test.ts b/tests/TextInput/TextInput.test.ts deleted file mode 100644 index 74271739..00000000 --- a/tests/TextInput/TextInput.test.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import TextInput from "./TextInput.test.svelte"; -import TextInputCustom from "./TextInputCustom.test.svelte"; - -describe("TextInput", () => { - it("should render with default props", () => { - render(TextInput); - - expect(screen.getByLabelText("User name")).toBeInTheDocument(); - }); - - it("should handle placeholder text", () => { - render(TextInput, { - props: { placeholder: "Enter user name..." }, - }); - - expect( - screen.getByPlaceholderText("Enter user name..."), - ).toBeInTheDocument(); - }); - - it("should handle different sizes", () => { - (["sm", "xl"] as const).forEach((size) => { - const { container } = render(TextInput, { - props: { size }, - }); - - const input = container.querySelector("input"); - expect(input).toHaveClass(`bx--text-input--${size}`); - container.remove(); - }); - }); - - it("should handle light variant", () => { - render(TextInput, { props: { light: true } }); - - expect(screen.getByRole("textbox")).toHaveClass("bx--text-input--light"); - }); - - it("should handle disabled state", () => { - render(TextInput, { props: { disabled: true } }); - - const input = screen.getByRole("textbox"); - expect(input).toBeDisabled(); - expect(screen.getByText("User name")).toHaveClass("bx--label--disabled"); - }); - - it("should handle helper text", () => { - render(TextInput, { props: { helperText: "Helper text" } }); - - expect(screen.getByText("Helper text")).toHaveClass( - "bx--form__helper-text", - ); - }); - - it("should handle invalid state", () => { - render(TextInput, { - props: { invalid: true, invalidText: "Invalid input" }, - }); - - const input = screen.getByRole("textbox"); - expect(input).toHaveClass("bx--text-input--invalid"); - expect(input).toHaveAttribute("aria-invalid", "true"); - expect(screen.getByText("Invalid input")).toHaveClass( - "bx--form-requirement", - ); - }); - - it("should handle warning state", () => { - render(TextInput, { - props: { warn: true, warnText: "Warning message" }, - }); - - const input = screen.getByRole("textbox"); - expect(input).toHaveClass("bx--text-input--warning"); - expect(screen.getByText("Warning message")).toHaveClass( - "bx--form-requirement", - ); - }); - - it("should handle hidden label", () => { - render(TextInput, { props: { hideLabel: true } }); - - expect(screen.getByText("User name")).toHaveClass("bx--visually-hidden"); - }); - - it("should handle custom id", () => { - render(TextInput, { props: { id: "custom-id" } }); - - const input = screen.getByRole("textbox"); - expect(input).toHaveAttribute("id", "custom-id"); - expect(screen.getByText("User name")).toHaveAttribute("for", "custom-id"); - }); - - it("should handle custom name", () => { - render(TextInput, { props: { name: "custom-name" } }); - - expect(screen.getByRole("textbox")).toHaveAttribute("name", "custom-name"); - }); - - it("should handle required state", () => { - render(TextInput, { props: { required: true } }); - - expect(screen.getByRole("textbox")).toHaveAttribute("required"); - }); - - it("should handle inline variant", () => { - render(TextInput, { props: { inline: true } }); - - expect(screen.getByText("User name")).toHaveClass("bx--label--inline"); - }); - - it("should handle readonly state", () => { - render(TextInput, { - props: { readonly: true }, - }); - - expect(screen.getByRole("textbox")).toHaveAttribute("readonly"); - }); - - it("should handle custom slots", () => { - render(TextInputCustom); - - expect(screen.getByText("Custom Label Text").tagName).toBe("SPAN"); - }); - - it("should handle value binding", async () => { - render(TextInput); - - const input = screen.getByRole("textbox"); - await user.type(input, "Test value"); - expect(screen.getByTestId("value").textContent).toBe("Test value"); - }); - - it("should handle number type input", async () => { - render(TextInput, { props: { type: "number" } }); - - const input = screen.getByLabelText("User name"); - await user.type(input, "123"); - expect(input).toHaveValue(123); - - await user.clear(input); - expect(input).toHaveValue(null); - }); - - it("should not show helper text when invalid", () => { - render(TextInput, { - props: { - invalid: true, - invalidText: "Invalid input", - helperText: "Helper text", - }, - }); - - expect(screen.queryByText("Helper text")).not.toBeInTheDocument(); - expect(screen.getByText("Invalid input")).toBeInTheDocument(); - }); - - it("should not show helper text when warning", () => { - render(TextInput, { - props: { - warn: true, - warnText: "Warning message", - helperText: "Helper text", - }, - }); - - expect(screen.queryByText("Helper text")).not.toBeInTheDocument(); - expect(screen.getByText("Warning message")).toBeInTheDocument(); - }); - - it("should handle disabled helper text", () => { - render(TextInput, { - props: { - disabled: true, - helperText: "Helper text", - }, - }); - - expect(screen.getByText("Helper text")).toHaveClass( - "bx--form__helper-text--disabled", - ); - }); - - it("should handle inline helper text", () => { - render(TextInput, { - props: { - inline: true, - helperText: "Helper text", - }, - }); - - expect(screen.getByText("Helper text")).toHaveClass( - "bx--form__helper-text--inline", - ); - }); -}); diff --git a/tests/TextInput/TextInputCustom.test.svelte b/tests/TextInput/TextInputCustom.test.svelte deleted file mode 100644 index 2eea26dc..00000000 --- a/tests/TextInput/TextInputCustom.test.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - - Custom Label Text - diff --git a/tests/Theme/Theme.test.svelte b/tests/Theme/Theme.test.svelte deleted file mode 100644 index 1fadc6b3..00000000 --- a/tests/Theme/Theme.test.svelte +++ /dev/null @@ -1,23 +0,0 @@ - - - - -
    - { - console.log("update", detail); - }} - > - - -
    diff --git a/tests/Theme/Theme.test.ts b/tests/Theme/Theme.test.ts deleted file mode 100644 index 68cc09ba..00000000 --- a/tests/Theme/Theme.test.ts +++ /dev/null @@ -1,186 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { tick } from "svelte"; -import { user } from "../setup-tests"; -import Theme from "./Theme.test.svelte"; -import ThemeSelect from "./ThemeSelect.test.svelte"; -import ThemeSelectCustom from "./ThemeSelectCustom.test.svelte"; -import ThemeToggle from "./ThemeToggle.test.svelte"; -import ThemeToggleCustom from "./ThemeToggleCustom.test.svelte"; - -describe("Theme", () => { - let documentMock: { - setAttribute: ReturnType; - style: { setProperty: ReturnType }; - }; - let consoleLog: ReturnType; - let localStorageMock: Record; - let originalLocalStorage: Storage; - - beforeEach(() => { - documentMock = { - setAttribute: vi.spyOn(document.documentElement, "setAttribute"), - style: { - setProperty: vi.spyOn(document.documentElement.style, "setProperty"), - }, - }; - consoleLog = vi.spyOn(console, "log"); - originalLocalStorage = global.localStorage; - localStorageMock = {}; - - global.localStorage = { - getItem: vi.fn((key) => localStorageMock[key] || null), - setItem: vi.fn((key, value) => { - localStorageMock[key] = value; - }), - removeItem: vi.fn((key) => { - delete localStorageMock[key]; - }), - clear: vi.fn(() => { - localStorageMock = {}; - }), - length: 0, - key: vi.fn(), - }; - }); - - afterEach(() => { - vi.restoreAllMocks(); - global.localStorage = originalLocalStorage; - localStorage.clear(); - localStorageMock = {}; - }); - - it("should set default theme to white", () => { - render(Theme); - expect(documentMock.setAttribute).toHaveBeenCalledWith("theme", "white"); - }); - - it("should update theme attribute when theme changes", async () => { - const { component } = render(Theme); - - component.$set({ theme: "g100" }); - await tick(); - - expect(documentMock.setAttribute).toHaveBeenCalledWith("theme", "g100"); - expect(consoleLog).toHaveBeenCalledWith("update", { theme: "g100" }); - }); - - it("should apply custom tokens", async () => { - const tokens = { - "interactive-01": "#ff0000", - "ui-background": "#ffffff", - }; - - render(Theme, { props: { tokens } }); - await tick(); - - expect(documentMock.style.setProperty).toHaveBeenCalledWith( - "--cds-interactive-01", - "#ff0000", - ); - expect(documentMock.style.setProperty).toHaveBeenCalledWith( - "--cds-ui-background", - "#ffffff", - ); - }); - - it("should persist theme in localStorage when persist is true", async () => { - render(Theme, { props: { persist: true } }); - await tick(); - - expect(localStorage.setItem).toHaveBeenCalledWith("theme", "white"); - }); - - it("should load persisted theme from localStorage", async () => { - localStorageMock["theme"] = "g90"; - - render(Theme, { props: { persist: true } }); - await tick(); - - expect(documentMock.setAttribute).toHaveBeenCalledWith("theme", "g90"); - }); - - it("should warn on invalid theme", async () => { - const consoleWarn = vi.spyOn(console, "warn"); - const { component } = render(Theme); - - // @ts-ignore - Testing invalid theme - component.$set({ theme: "invalid" }); - await tick(); - - expect(consoleWarn).toHaveBeenCalledWith( - expect.stringContaining('invalid theme "invalid"'), - ); - }); - - it("should render toggle when render prop is set to toggle", async () => { - render(ThemeToggle); - - const toggle = screen.getByLabelText("Dark mode"); - expect(toggle).toBeInTheDocument(); - expect(toggle).toHaveAttribute("type", "checkbox"); - - await user.click(toggle); - expect(consoleLog).toHaveBeenCalledWith("update", { theme: "g100" }); - - await user.click(toggle); - expect(consoleLog).toHaveBeenCalledWith("update", { theme: "white" }); - }); - - it("should render custom toggle when render prop is set to toggle and custom toggle options are provided", async () => { - render(ThemeToggleCustom); - - const checkbox = screen.getByRole("switch"); - assert(checkbox); - expect(checkbox).not.toBeChecked(); - - const toggle = screen.getAllByText("Enable dark mode")[0]; - expect(toggle).toBeInTheDocument(); - - await user.click(toggle); - expect(consoleLog).toHaveBeenCalledWith("update", { theme: "g80" }); - expect(checkbox).toBeChecked(); - - await user.click(toggle); - expect(consoleLog).toHaveBeenCalledWith("update", { theme: "g10" }); - expect(checkbox).not.toBeChecked(); - }); - - it("should render select when render prop is set to select", async () => { - render(ThemeSelect); - - const select = screen.getByLabelText("Themes"); - expect(select).toBeInTheDocument(); - expect(select).toHaveTextContent("White"); - expect(select).toHaveValue("white"); - - await user.selectOptions(select, "g100"); - expect(select).toHaveTextContent("Gray 100"); - expect(select).toHaveValue("g100"); - expect(consoleLog).toHaveBeenCalledWith("update", { theme: "g100" }); - - await user.selectOptions(select, "white"); - expect(select).toHaveTextContent("White"); - expect(select).toHaveValue("white"); - expect(consoleLog).toHaveBeenCalledWith("update", { theme: "white" }); - }); - - it("should render custom select when render prop is set to select and custom select options are provided", async () => { - render(ThemeSelectCustom); - - const select = screen.getByLabelText("Select a theme"); - expect(select).toBeInTheDocument(); - expect(select).toHaveTextContent("White"); - expect(select).toHaveValue("white"); - - await user.selectOptions(select, "g100"); - expect(select).toHaveTextContent("Gray 100"); - expect(select).toHaveValue("g100"); - expect(consoleLog).toHaveBeenCalledWith("update", { theme: "g100" }); - - await user.selectOptions(select, "white"); - expect(select).toHaveTextContent("White"); - expect(select).toHaveValue("white"); - expect(consoleLog).toHaveBeenCalledWith("update", { theme: "white" }); - }); -}); diff --git a/tests/Theme/ThemeSelect.test.svelte b/tests/Theme/ThemeSelect.test.svelte deleted file mode 100644 index 3648b3ef..00000000 --- a/tests/Theme/ThemeSelect.test.svelte +++ /dev/null @@ -1,10 +0,0 @@ - - - { - console.log("update", detail); - }} -/> diff --git a/tests/Theme/ThemeSelectCustom.test.svelte b/tests/Theme/ThemeSelectCustom.test.svelte deleted file mode 100644 index 93fbfea3..00000000 --- a/tests/Theme/ThemeSelectCustom.test.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - - { - console.log("update", detail); - }} -/> diff --git a/tests/Theme/ThemeToggle.test.svelte b/tests/Theme/ThemeToggle.test.svelte deleted file mode 100644 index 6512a23d..00000000 --- a/tests/Theme/ThemeToggle.test.svelte +++ /dev/null @@ -1,10 +0,0 @@ - - - { - console.log("update", detail); - }} -/> diff --git a/tests/Theme/ThemeToggleCustom.test.svelte b/tests/Theme/ThemeToggleCustom.test.svelte deleted file mode 100644 index c3f8a01e..00000000 --- a/tests/Theme/ThemeToggleCustom.test.svelte +++ /dev/null @@ -1,17 +0,0 @@ - - - { - console.log("update", detail); - }} -/> diff --git a/tests/Tile.test.svelte b/tests/Tile.test.svelte new file mode 100644 index 00000000..c4c3f567 --- /dev/null +++ b/tests/Tile.test.svelte @@ -0,0 +1,7 @@ + + +Content + +Content diff --git a/tests/Tile/ClickableTile.test.svelte b/tests/Tile/ClickableTile.test.svelte deleted file mode 100644 index 11f69c1e..00000000 --- a/tests/Tile/ClickableTile.test.svelte +++ /dev/null @@ -1,32 +0,0 @@ - - - - Link only - - - - Link with light variant - - - { - console.log("clicked"); - }} -> - Click me - - -Clicked - - - Disabled tile - diff --git a/tests/Tile/ClickableTile.test.ts b/tests/Tile/ClickableTile.test.ts deleted file mode 100644 index 05e0d461..00000000 --- a/tests/Tile/ClickableTile.test.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import ClickableTile from "./ClickableTile.test.svelte"; - -describe("ClickableTile", () => { - it("should render with href", () => { - render(ClickableTile); - - const tile = screen.getByText("Link only"); - expect(tile).toHaveAttribute("href", "https://www.carbondesignsystem.com/"); - expect(tile).toHaveClass("bx--tile", "bx--tile--clickable"); - }); - - it("should render light variant with other attributes", () => { - render(ClickableTile); - - const tile = screen.getByText("Link with light variant"); - expect(tile).toHaveClass("bx--tile--light"); - expect(tile).toHaveAttribute("target", "_blank"); - expect(tile).toHaveAttribute("title", ""); - }); - - it("should toggle clicked state on click", async () => { - render(ClickableTile); - - const tile = screen.getByTestId("click-test"); - expect(tile).not.toHaveClass("bx--tile--is-clicked"); - - await user.click(tile); - expect(tile).toHaveClass("bx--tile--is-clicked"); - - await user.click(tile); - expect(tile).not.toHaveClass("bx--tile--is-clicked"); - }); - - it("should have clicked state", async () => { - render(ClickableTile); - - const tile = screen.getByText("Clicked"); - expect(tile).toHaveClass("bx--tile--is-clicked"); - - await user.type(tile, "{Space}"); - expect(tile).not.toHaveClass("bx--tile--is-clicked"); - }); - - it("should respect disabled state", async () => { - render(ClickableTile); - - const disabledTile = screen.getByTestId("disabled-test"); - expect(disabledTile).toHaveAttribute("aria-disabled", "true"); - expect(disabledTile).toHaveClass("bx--tile--clickable"); - }); -}); diff --git a/tests/Tile/SelectableTile.test.svelte b/tests/Tile/SelectableTile.test.svelte deleted file mode 100644 index 14da7f0e..00000000 --- a/tests/Tile/SelectableTile.test.svelte +++ /dev/null @@ -1,30 +0,0 @@ - - - { - console.log("select", e.detail); - }} - on:deselect={(e) => { - console.log("deselect", e.detail); - }} -> - Test Tile Content - diff --git a/tests/Tile/SelectableTile.test.ts b/tests/Tile/SelectableTile.test.ts deleted file mode 100644 index 377e0cfb..00000000 --- a/tests/Tile/SelectableTile.test.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import SelectableTileTest from "./SelectableTile.test.svelte"; - -describe("SelectableTile", () => { - it("renders with default props", () => { - render(SelectableTileTest); - const tile = screen.getByTestId("selectable-tile"); - expect(tile).toHaveClass("bx--tile"); - expect(tile).toHaveClass("bx--tile--selectable"); - }); - - it("renders with selected state", () => { - render(SelectableTileTest, { selected: true }); - const tile = screen.getByTestId("selectable-tile"); - expect(tile).toHaveClass("bx--tile--is-selected"); - }); - - it("renders with light variant", () => { - render(SelectableTileTest, { light: true }); - const tile = screen.getByTestId("selectable-tile"); - expect(tile).toHaveClass("bx--tile--light"); - }); - - it("renders with disabled state", () => { - render(SelectableTileTest, { disabled: true }); - const tile = screen.getByTestId("selectable-tile"); - expect(tile).toHaveClass("bx--tile--disabled"); - }); - - it("renders with custom title and value", () => { - render(SelectableTileTest, { - title: "Custom Title", - value: "custom-value", - }); - const input = screen.getByRole("checkbox"); - expect(input).toHaveAttribute("title", "Custom Title"); - expect(input).toHaveAttribute("value", "custom-value"); - }); - - it("renders with custom name and icon description", () => { - render(SelectableTileTest, { - name: "custom-name", - iconDescription: "Custom checkmark", - }); - - const input = screen.getByRole("checkbox"); - expect(input).toHaveAttribute("name", "custom-name"); - - const icon = screen.getByTestId("selectable-tile").querySelector("svg"); - expect(icon).toHaveAttribute("aria-label", "Custom checkmark"); - }); - - describe("interaction", () => { - it("handles click selection", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(SelectableTileTest); - - const tile = screen.getByTestId("selectable-tile"); - await user.click(tile); - expect(consoleLog).toHaveBeenCalledWith("select", expect.any(String)); - }); - - it("handles click deselection", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(SelectableTileTest, { selected: true }); - - const tile = screen.getByTestId("selectable-tile"); - await user.click(tile); - expect(consoleLog).toHaveBeenCalledWith("deselect", expect.any(String)); - }); - - it("prevents selection when disabled", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(SelectableTileTest, { disabled: true }); - - const tile = screen.getByTestId("selectable-tile"); - await user.click(tile); - expect(consoleLog).not.toHaveBeenCalled(); - }); - - it("handles keyboard selection", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(SelectableTileTest); - - await user.keyboard("{Tab}"); - await user.keyboard("{Enter}"); - expect(consoleLog).toHaveBeenCalledWith("select", expect.any(String)); - }); - - it("handles keyboard deselection", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(SelectableTileTest, { selected: true }); - - await user.keyboard("{Tab}"); - await user.keyboard("{Enter}"); - expect(consoleLog).toHaveBeenCalledWith("deselect", expect.any(String)); - }); - }); -}); diff --git a/tests/Tile/Tile.test.svelte b/tests/Tile/Tile.test.svelte deleted file mode 100644 index 91a07708..00000000 --- a/tests/Tile/Tile.test.svelte +++ /dev/null @@ -1,20 +0,0 @@ - - -Default tile - -Light variant - - { - console.log("clicked"); - }} -> - Clickable tile - - - - Custom attributes - diff --git a/tests/Tile/Tile.test.ts b/tests/Tile/Tile.test.ts deleted file mode 100644 index 5e596df7..00000000 --- a/tests/Tile/Tile.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import Tile from "./Tile.test.svelte"; - -describe("Tile", () => { - beforeEach(() => { - vi.clearAllMocks(); - }); - - it("should render with default class", () => { - render(Tile); - - const tile = screen.getByText("Default tile"); - expect(tile).toHaveClass("bx--tile"); - }); - - it("should render light variant", () => { - render(Tile); - - const lightTile = screen.getByText("Light variant"); - expect(lightTile).toHaveClass("bx--tile", "bx--tile--light"); - }); - - it("should handle click events", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Tile); - - const tile = screen.getByTestId("click-test"); - await user.click(tile); - expect(consoleLog).toHaveBeenCalledWith("clicked"); - expect(consoleLog).toHaveBeenCalledTimes(1); - }); - - it("should pass through additional attributes", () => { - render(Tile); - - const tile = screen.getByTestId("attr-test"); - expect(tile).toHaveAttribute("title", "Custom title"); - expect(tile).toHaveClass("custom-class"); - }); -}); diff --git a/tests/TimePicker.test.svelte b/tests/TimePicker.test.svelte new file mode 100644 index 00000000..335d9494 --- /dev/null +++ b/tests/TimePicker.test.svelte @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/TimePicker/TimePicker.test.svelte b/tests/TimePicker/TimePicker.test.svelte deleted file mode 100644 index e2b06eb3..00000000 --- a/tests/TimePicker/TimePicker.test.svelte +++ /dev/null @@ -1,68 +0,0 @@ - - - { - console.log("change"); - }} - on:input={() => { - console.log("input"); - }} - on:keydown={() => { - console.log("keydown"); - }} - on:keyup={() => { - console.log("keyup"); - }} - on:focus={() => { - console.log("focus"); - }} - on:blur={() => { - console.log("blur"); - }} -> - - - - - - - - - diff --git a/tests/TimePicker/TimePicker.test.ts b/tests/TimePicker/TimePicker.test.ts deleted file mode 100644 index 43cdbcdf..00000000 --- a/tests/TimePicker/TimePicker.test.ts +++ /dev/null @@ -1,182 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import TimePicker from "./TimePicker.test.svelte"; -import TimePickerCustom from "./TimePickerCustom.test.svelte"; - -describe("TimePicker", () => { - it("should render with default props", () => { - render(TimePicker); - - const input = screen.getByRole("textbox"); - expect(input).toBeInTheDocument(); - expect(input).toHaveAttribute("name", "test-time"); - expect(input).toHaveAttribute("placeholder", "hh:mm"); - expect(input).toHaveAttribute("pattern", "(1[012]|[1-9]):[0-5][0-9](\\s)?"); - expect(input).toHaveAttribute("maxlength", "5"); - expect(screen.getByText("Time")).toBeInTheDocument(); - expect(screen.getByText("AM")).toBeInTheDocument(); - expect(screen.getByText("PM")).toBeInTheDocument(); - expect(screen.getByText("PDT")).toBeInTheDocument(); - expect(screen.getByText("GMT")).toBeInTheDocument(); - }); - - it("should handle different sizes", () => { - (["sm", "xl"] as const).forEach((size) => { - const { container } = render(TimePicker, { - props: { size }, - }); - - expect(container.querySelector(".bx--time-picker")).toHaveClass( - `bx--time-picker--${size}`, - ); - container.remove(); - }); - }); - - it("should handle light variant", () => { - render(TimePicker, { props: { light: true } }); - - const timePicker = screen.getByRole("textbox").closest(".bx--time-picker"); - expect(timePicker).toHaveClass("bx--time-picker--light"); - }); - - it("should handle disabled state", () => { - render(TimePicker, { props: { disabled: true } }); - - const input = screen.getByRole("textbox"); - expect(input).toBeDisabled(); - expect(screen.getByText("Time")).toHaveClass("bx--label--disabled"); - }); - - it("should handle invalid state", () => { - render(TimePicker, { - props: { invalid: true, invalidText: "Invalid time" }, - }); - - const input = screen.getByRole("textbox"); - expect(input).toHaveClass("bx--text-input--invalid"); - expect(input).toHaveAttribute("data-invalid"); - expect(screen.getByText("Invalid time")).toHaveClass( - "bx--form-requirement", - ); - }); - - it("should handle hidden label", () => { - render(TimePicker, { props: { hideLabel: true } }); - - expect(screen.getByText("Time")).toHaveClass("bx--visually-hidden"); - }); - - it("should handle custom id", () => { - render(TimePicker, { props: { id: "custom-id" } }); - - const input = screen.getByRole("textbox"); - expect(input).toHaveAttribute("id", "custom-id"); - expect(screen.getByText("Time")).toHaveAttribute("for", "custom-id"); - }); - - it("should handle custom name", () => { - render(TimePicker, { props: { name: "custom-name" } }); - - expect(screen.getByRole("textbox")).toHaveAttribute("name", "custom-name"); - }); - - it("should handle custom placeholder", () => { - render(TimePicker, { props: { placeholder: "Enter time" } }); - - expect(screen.getByRole("textbox")).toHaveAttribute( - "placeholder", - "Enter time", - ); - }); - - it("should handle custom pattern", () => { - render(TimePicker, { props: { pattern: "custom-pattern" } }); - - expect(screen.getByRole("textbox")).toHaveAttribute( - "pattern", - "custom-pattern", - ); - }); - - it("should handle custom maxlength", () => { - render(TimePicker, { props: { maxlength: 10 } }); - - expect(screen.getByRole("textbox")).toHaveAttribute("maxlength", "10"); - }); - - it("should handle value binding", async () => { - render(TimePicker); - - const input = screen.getByRole("textbox"); - await user.type(input, "10:30"); - expect(input).toHaveValue("10:30"); - }); - - it("should handle change event", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(TimePicker); - - const input = screen.getByRole("textbox"); - await user.type(input, "10:30"); - expect(consoleLog).toHaveBeenCalledWith("focus"); - expect(consoleLog).toHaveBeenCalledWith("input"); - await user.keyboard("{Enter}"); - expect(consoleLog).toHaveBeenCalledWith("keydown"); - expect(consoleLog).toHaveBeenCalledWith("input"); - - expect(input).toHaveValue("10:30"); - await user.keyboard("{Tab}"); - expect(consoleLog).toHaveBeenCalledWith("change"); - }); - - it("should handle focus and blur events", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(TimePicker); - - const input = screen.getByRole("textbox"); - await user.tab(); - expect(input).toHaveFocus(); - expect(consoleLog).toHaveBeenCalledWith("focus"); - - await user.tab(); - expect(input).not.toHaveFocus(); - expect(consoleLog).toHaveBeenCalledWith("blur"); - }); - - it("should handle disabled state with events", async () => { - render(TimePicker, { props: { disabled: true } }); - - const input = screen.getByRole("textbox"); - await user.type(input, "10:30"); - expect(input).toHaveValue(""); - }); - - it("should handle invalid state with helper text", () => { - render(TimePicker, { - props: { - invalid: true, - invalidText: "Invalid time", - }, - }); - - expect(screen.getByText("Invalid time")).toBeInTheDocument(); - }); - - it("should handle label text slot", () => { - render(TimePickerCustom); - - const label = screen.getByText("Custom Label Text"); - expect(label).toBeInTheDocument(); - expect(label.tagName).toBe("SPAN"); - }); - - it("should handle TimePickerSelect components", () => { - render(TimePicker); - - const selects = screen.getAllByRole("combobox"); - expect(selects).toHaveLength(2); - expect(selects[0]).toHaveValue("pm"); - expect(selects[1]).toHaveValue("pdt"); - }); -}); diff --git a/tests/TimePicker/TimePickerCustom.test.svelte b/tests/TimePicker/TimePickerCustom.test.svelte deleted file mode 100644 index 3e9c4867..00000000 --- a/tests/TimePicker/TimePickerCustom.test.svelte +++ /dev/null @@ -1,19 +0,0 @@ - - - - Custom Label Text - - - - - - - - - diff --git a/tests/ToastNotification.test.svelte b/tests/ToastNotification.test.svelte new file mode 100644 index 00000000..17a84883 --- /dev/null +++ b/tests/ToastNotification.test.svelte @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/ToastNotification/ToastNotification.close.test.svelte b/tests/ToastNotification/ToastNotification.close.test.svelte deleted file mode 100644 index 28293b17..00000000 --- a/tests/ToastNotification/ToastNotification.close.test.svelte +++ /dev/null @@ -1,13 +0,0 @@ - - - { - e.preventDefault(); - console.log("close", e.detail); - }} -/> diff --git a/tests/ToastNotification/ToastNotification.test.svelte b/tests/ToastNotification/ToastNotification.test.svelte deleted file mode 100644 index 068e4cd2..00000000 --- a/tests/ToastNotification/ToastNotification.test.svelte +++ /dev/null @@ -1,33 +0,0 @@ - - - { - console.log("close", e.detail); - }} -/> diff --git a/tests/ToastNotification/ToastNotification.test.ts b/tests/ToastNotification/ToastNotification.test.ts deleted file mode 100644 index 2fdb8659..00000000 --- a/tests/ToastNotification/ToastNotification.test.ts +++ /dev/null @@ -1,159 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import ToastNotification from "./ToastNotification.test.svelte"; -import ToastNotificationCustom from "./ToastNotificationCustom.test.svelte"; -import ToastNotificationClose from "./ToastNotification.close.test.svelte"; - -describe("ToastNotification", () => { - beforeEach(() => { - vi.restoreAllMocks(); - }); - - it("should render with default props", () => { - render(ToastNotification); - - expect(screen.getByRole("alert")).toHaveClass( - "bx--toast-notification--error", - ); - expect(screen.getByText("Error")).toBeInTheDocument(); - expect( - screen.getByText("An internal server error occurred."), - ).toBeInTheDocument(); - expect(screen.getByText("2024-03-21 12:00:00")).toBeInTheDocument(); - }); - - it("should handle different kinds", () => { - const kinds = [ - "error", - "info", - "info-square", - "success", - "warning", - "warning-alt", - ] as const; - - kinds.forEach((kind) => { - const { container } = render(ToastNotification, { - props: { kind }, - }); - - expect( - container.querySelector(`.bx--toast-notification--${kind}`), - ).toBeInTheDocument(); - container.remove(); - }); - }); - - it("should handle low contrast variant", () => { - render(ToastNotification, { - props: { lowContrast: true }, - }); - - expect(screen.getByRole("alert")).toHaveClass( - "bx--toast-notification--low-contrast", - ); - }); - - it("should handle close button click", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(ToastNotification); - - await user.click(screen.getByRole("button")); - - expect(consoleLog).toHaveBeenCalledWith("close", { timeout: false }); - expect(screen.queryByRole("alert")).not.toBeInTheDocument(); - }); - - it("should hide close button", () => { - render(ToastNotification, { - props: { hideCloseButton: true }, - }); - - expect( - screen.queryByLabelText("Close notification"), - ).not.toBeInTheDocument(); - }); - - it("should handle custom icon descriptions", () => { - render(ToastNotification, { - props: { - statusIconDescription: "Custom status", - closeButtonDescription: "Custom close", - }, - }); - - expect(screen.getByText("Custom status")).toBeInTheDocument(); - expect(screen.getByRole("button")).toHaveAttribute( - "aria-label", - "Custom close", - ); - }); - - it("should handle custom role", () => { - render(ToastNotification, { - props: { role: "status" }, - }); - - expect(screen.getByRole("status")).toBeInTheDocument(); - }); - - it("should handle timeout", async () => { - vi.useFakeTimers(); - const consoleLog = vi.spyOn(console, "log"); - - render(ToastNotification, { props: { timeout: 1000 } }); - - expect(screen.getByRole("alert")).toBeInTheDocument(); - - await vi.advanceTimersByTimeAsync(1000); - - expect(consoleLog).toHaveBeenCalledWith("close", { timeout: true }); - expect(screen.queryByRole("alert")).not.toBeInTheDocument(); - vi.useRealTimers(); - }); - - it("should handle custom slots", () => { - render(ToastNotificationCustom); - - const title = screen.getByText("Custom Title:"); - expect(title).not.toHaveClass("bx--toast-notification__title"); - expect(title.tagName).toBe("STRONG"); - - const subtitle = screen.getByText("Custom subtitle content."); - expect(subtitle).not.toHaveClass("bx--toast-notification__subtitle"); - expect(subtitle.tagName).toBe("STRONG"); - - const caption = screen.getByText("Custom caption content."); - expect(caption).not.toHaveClass("bx--toast-notification__caption"); - expect(caption.tagName).toBe("STRONG"); - }); - - it("should handle full width", () => { - render(ToastNotification, { props: { fullWidth: true } }); - - const notification = screen.getByRole("alert"); - expect(notification).toHaveStyle({ width: "100%" }); - }); - - it("should cleanup timeout on unmount", () => { - vi.useFakeTimers(); - const clearTimeoutSpy = vi.spyOn(window, "clearTimeout"); - - const { unmount } = render(ToastNotification, { - props: { timeout: 1000 }, - }); - - unmount(); - expect(clearTimeoutSpy).toHaveBeenCalled(); - vi.useRealTimers(); - }); - - it("should prevent default close behavior", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(ToastNotificationClose); - - await user.click(screen.getByRole("button")); - expect(consoleLog).toHaveBeenCalledWith("close", { timeout: false }); - expect(screen.getByRole("alert")).toBeInTheDocument(); - }); -}); diff --git a/tests/ToastNotification/ToastNotificationCustom.test.svelte b/tests/ToastNotification/ToastNotificationCustom.test.svelte deleted file mode 100644 index 9b2b2436..00000000 --- a/tests/ToastNotification/ToastNotificationCustom.test.svelte +++ /dev/null @@ -1,9 +0,0 @@ - - - - Custom Title: - Custom subtitle content. - Custom caption content. - diff --git a/tests/Toggle.test.svelte b/tests/Toggle.test.svelte new file mode 100644 index 00000000..d5af2c9e --- /dev/null +++ b/tests/Toggle.test.svelte @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/tests/Toggle/Toggle.test.svelte b/tests/Toggle/Toggle.test.svelte deleted file mode 100644 index ad178d84..00000000 --- a/tests/Toggle/Toggle.test.svelte +++ /dev/null @@ -1,37 +0,0 @@ - - - { - console.log("toggled:", e.detail.toggled); - }} -/> - - - - - - - - - - { - console.log("initial toggled:", e.detail.toggled); - }} -/> - - diff --git a/tests/Toggle/Toggle.test.ts b/tests/Toggle/Toggle.test.ts deleted file mode 100644 index 962c7ffd..00000000 --- a/tests/Toggle/Toggle.test.ts +++ /dev/null @@ -1,215 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import Toggle from "./Toggle.test.svelte"; - -describe("Toggle", () => { - const getToggle = (label: string) => - screen.getByRole("switch", { name: new RegExp(label, "i") }); - - it("renders and functions correctly", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Toggle); - - const toggle = getToggle("Default toggle"); - expect(toggle).not.toBeChecked(); - - await user.click(toggle); - expect(toggle).toBeChecked(); - expect(consoleLog).toHaveBeenCalledWith("toggled:", true); - - await user.click(toggle); - expect(toggle).not.toBeChecked(); - expect(consoleLog).toHaveBeenCalledWith("toggled:", false); - }); - - it("supports custom labels", () => { - render(Toggle); - - const toggle = getToggle("Custom labels"); - const label = toggle.closest(".bx--form-item"); - expect(label).not.toBeNull(); - - if (label) { - expect(label).toContainElement(screen.getByText("Inactive")); - expect(label).toContainElement(screen.getByText("Active")); - } - }); - - it("supports small size variant", () => { - render(Toggle); - - const toggle = getToggle("Small toggle"); - expect(toggle).toHaveClass("bx--toggle-input--small"); - }); - - it("supports disabled state", () => { - render(Toggle); - - const toggle = getToggle("Disabled toggle"); - expect(toggle).toBeDisabled(); - }); - - it("supports hidden label", () => { - render(Toggle); - - const toggle = getToggle("Hidden label toggle"); - const label = toggle.closest(".bx--form-item"); - expect(label).not.toBeNull(); - - if (label) { - const hiddenText = label.querySelector(".bx--visually-hidden"); - expect(hiddenText).toHaveClass("bx--visually-hidden"); - expect(toggle).toHaveAccessibleName("Hidden label toggle"); - } - }); - - it("handles keyboard interactions (Space)", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Toggle); - - const toggle = getToggle("Default toggle"); - toggle.focus(); - - await user.keyboard(" "); - expect(toggle).toBeChecked(); - expect(consoleLog).toHaveBeenCalledWith("toggled:", true); - - await user.keyboard(" "); - expect(toggle).not.toBeChecked(); - expect(consoleLog).toHaveBeenCalledWith("toggled:", false); - }); - - it("handles keyboard interactions (Enter)", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Toggle); - - const toggle = getToggle("Default toggle"); - toggle.focus(); - - await user.keyboard("{Enter}"); - expect(toggle).toBeChecked(); - expect(consoleLog).toHaveBeenCalledWith("toggled:", true); - - await user.keyboard("{Enter}"); - expect(toggle).not.toBeChecked(); - expect(consoleLog).toHaveBeenCalledWith("toggled:", false); - }); - - it("ignores other key presses", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Toggle); - - const toggle = getToggle("Default toggle"); - toggle.focus(); - - await user.keyboard("a"); - expect(toggle).not.toBeChecked(); - expect(consoleLog).not.toHaveBeenCalled(); - - await user.keyboard("Tab"); - expect(toggle).not.toBeChecked(); - expect(consoleLog).not.toHaveBeenCalled(); - }); - - it("supports custom name attribute", () => { - render(Toggle); - - const toggle = getToggle("Custom name toggle"); - expect(toggle).toHaveAttribute("name", "custom-name-toggle"); - }); - - it("prevents default on space and enter keys", async () => { - render(Toggle); - - const toggle = getToggle("Default toggle"); - toggle.focus(); - - const spaceEvent = new KeyboardEvent("keyup", { key: " " }); - const enterEvent = new KeyboardEvent("keyup", { key: "Enter" }); - - const spacePreventDefault = vi.spyOn(spaceEvent, "preventDefault"); - const enterPreventDefault = vi.spyOn(enterEvent, "preventDefault"); - - toggle.dispatchEvent(spaceEvent); - toggle.dispatchEvent(enterEvent); - - expect(spacePreventDefault).toHaveBeenCalled(); - expect(enterPreventDefault).toHaveBeenCalled(); - }); - - it("handles disabled state interactions", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Toggle); - - const toggle = getToggle("Disabled toggle"); - expect(toggle).toBeDisabled(); - - await user.click(toggle); - expect(toggle).not.toBeChecked(); - expect(consoleLog).not.toHaveBeenCalled(); - - toggle.focus(); - await user.keyboard(" "); - expect(toggle).not.toBeChecked(); - expect(consoleLog).not.toHaveBeenCalled(); - }); - - it("supports initial toggled state", () => { - render(Toggle); - - const defaultToggle = getToggle("Default toggle"); - expect(defaultToggle).not.toBeChecked(); - - const initialToggle = getToggle("Initial toggled state"); - expect(initialToggle).toBeChecked(); - }); - - it("handles rapid clicking", async () => { - const consoleLog = vi.spyOn(console, "log"); - render(Toggle); - - const toggle = getToggle("Default toggle"); - - await user.click(toggle); - await user.click(toggle); - await user.click(toggle); - - expect(toggle).toBeChecked(); - expect(consoleLog).toHaveBeenCalledTimes(3); - }); - - it("visually hides label when hideLabel is true", () => { - render(Toggle); - - const label = screen.getByText("Hidden label toggle"); - expect(label).toHaveClass("bx--visually-hidden"); - }); - - it("handles aria-label fallback correctly", () => { - render(Toggle); - - // Test toggle without labelText but with aria-label. - const toggle = getToggle("Hidden label toggle"); - expect(toggle).toHaveAccessibleName("Hidden label toggle"); - - // Test toggle without labelText and without aria-label (should fallback to "Toggle"). - const defaultToggle = getToggle("Default toggle"); - expect(defaultToggle).toHaveAccessibleName("Default toggle"); - }); - - it("does not dispatch toggle event on mount", () => { - const consoleLog = vi.spyOn(console, "log"); - render(Toggle); - - expect(consoleLog).not.toHaveBeenCalled(); - expect(getToggle("Default toggle")).not.toBeChecked(); - }); - - it("does not dispatch toggle event on mount for initial toggled state", () => { - const consoleLog = vi.spyOn(console, "log"); - render(Toggle); - - expect(consoleLog).not.toHaveBeenCalled(); - expect(getToggle("Initial toggled state")).toBeChecked(); - }); -}); diff --git a/tests/ToggleSmall.test.svelte b/tests/ToggleSmall.test.svelte new file mode 100644 index 00000000..60ca04c4 --- /dev/null +++ b/tests/ToggleSmall.test.svelte @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/tests/Tooltip.test.svelte b/tests/Tooltip.test.svelte new file mode 100644 index 00000000..3da157da --- /dev/null +++ b/tests/Tooltip.test.svelte @@ -0,0 +1,52 @@ + + + +

    Resources are provisioned based on your account's organization.

    +
    + + +

    Resources are provisioned based on your account's organization.

    +
    + + +

    Top

    +
    + + +

    Right

    +
    + + +

    Bottom

    +
    + + +

    Left

    +
    + + +

    Resources are provisioned based on your account's organization.

    + +
    + +Learn more + + + + +

    Resources are provisioned based on your account's organization.

    +
    + + +
    +

    Resources are provisioned based on your account's organization.

    +
    diff --git a/tests/Tooltip/Tooltip.test.ts b/tests/Tooltip/Tooltip.test.ts deleted file mode 100644 index 8dde83e3..00000000 --- a/tests/Tooltip/Tooltip.test.ts +++ /dev/null @@ -1,168 +0,0 @@ -import { render, screen, fireEvent } from "@testing-library/svelte"; -import TooltipDefault from "./TooltipDefault.test.svelte"; -import TooltipHideIcon from "./TooltipHideIcon.test.svelte"; -import TooltipOpen from "./TooltipOpen.test.svelte"; -import TooltipCustomContent from "./TooltipCustomContent.test.svelte"; -import TooltipCustomIcon from "./TooltipCustomIcon.test.svelte"; -import TooltipDirections from "./TooltipDirections.test.svelte"; -import TooltipAlignments from "./TooltipAlignments.test.svelte"; -import TooltipEvents from "./TooltipEvents.test.svelte"; -import { user } from "../setup-tests"; - -describe("Tooltip", () => { - test("should render with default props", () => { - const { container } = render(TooltipDefault); - expect(container.querySelector(".bx--tooltip__label")).toBeInTheDocument(); - expect( - container.querySelector(".bx--tooltip__trigger"), - ).toBeInTheDocument(); - }); - - test("should hide icon when hideIcon is true", async () => { - const { container } = render(TooltipHideIcon); - - expect( - container.querySelector(".bx--tooltip__trigger"), - ).not.toBeInTheDocument(); - expect(screen.getByText("Tooltip trigger")).toBeInTheDocument(); - await user.click(screen.getByText("Tooltip trigger")); - expect( - screen.getByText("This tooltip has its icon hidden"), - ).toBeInTheDocument(); - }); - - test("should show tooltip when open is true", () => { - const { container } = render(TooltipOpen); - - expect(container.querySelector(".bx--tooltip")).toBeInTheDocument(); - expect(container.querySelector(".bx--tooltip--shown")).toBeInTheDocument(); - expect( - screen.getByText("This tooltip is initially open"), - ).toBeInTheDocument(); - }); - - test("should open tooltip on focus", async () => { - const { container } = render(TooltipDefault); - - const trigger = container.querySelector(".bx--tooltip__trigger"); - assert(trigger); - - await fireEvent.focus(trigger); - expect(container.querySelector(".bx--tooltip")).toBeInTheDocument(); - expect(container.querySelector(".bx--tooltip--shown")).toBeInTheDocument(); - }); - - test("should close tooltip on Escape key", async () => { - const { container } = render(TooltipOpen); - - expect(container.querySelector(".bx--tooltip")).toBeInTheDocument(); - - const tooltip = container.querySelector(".bx--tooltip"); - assert(tooltip); - - await fireEvent.keyDown(tooltip, { key: "Escape" }); - expect(container.querySelector(".bx--tooltip")).not.toBeInTheDocument(); - }); - - test("should toggle tooltip on mousedown", async () => { - const { container } = render(TooltipDefault); - - const trigger = container.querySelector(".bx--tooltip__trigger"); - assert(trigger); - - await user.click(trigger); - expect(container.querySelector(".bx--tooltip")).toBeInTheDocument(); - - await user.click(trigger); - expect(container.querySelector(".bx--tooltip")).not.toBeInTheDocument(); - }); - - test("should render custom slot content", () => { - render(TooltipCustomContent); - - expect(screen.getByTestId("tooltip-content")).toBeInTheDocument(); - expect(screen.getByText("Custom tooltip content")).toBeInTheDocument(); - }); - - test("should render custom icon via slot", async () => { - render(TooltipCustomIcon); - - expect(screen.getByTestId("custom-icon")).toBeInTheDocument(); - expect(screen.getByText("🔍")).toBeInTheDocument(); - - await user.click(screen.getByTestId("custom-icon")); - expect(screen.getByText("Custom icon tooltip")).toBeInTheDocument(); - }); - - test("should apply correct direction classes", () => { - const { container } = render(TooltipDirections); - - const tooltips = container.querySelectorAll(".bx--tooltip"); - - expect(tooltips.length).toBe(4); - - expect(container.querySelector(".bx--tooltip--top")).toBeInTheDocument(); - expect(container.querySelector(".bx--tooltip--right")).toBeInTheDocument(); - expect(container.querySelector(".bx--tooltip--bottom")).toBeInTheDocument(); - expect(container.querySelector(".bx--tooltip--left")).toBeInTheDocument(); - - expect(screen.getByText("Tooltip with top direction")).toBeInTheDocument(); - expect( - screen.getByText("Tooltip with right direction"), - ).toBeInTheDocument(); - expect( - screen.getByText("Tooltip with bottom direction"), - ).toBeInTheDocument(); - expect(screen.getByText("Tooltip with left direction")).toBeInTheDocument(); - }); - - test("should apply correct alignment classes", () => { - const { container } = render(TooltipAlignments); - - const tooltips = container.querySelectorAll(".bx--tooltip"); - expect(tooltips.length).toBe(3); - - expect( - container.querySelector(".bx--tooltip--align-start"), - ).toBeInTheDocument(); - expect( - container.querySelector(".bx--tooltip--align-center"), - ).toBeInTheDocument(); - expect( - container.querySelector(".bx--tooltip--align-end"), - ).toBeInTheDocument(); - - expect( - screen.getByText("Tooltip with start alignment"), - ).toBeInTheDocument(); - expect( - screen.getByText("Tooltip with center alignment"), - ).toBeInTheDocument(); - expect(screen.getByText("Tooltip with end alignment")).toBeInTheDocument(); - }); - - test("should dispatch events when tooltip opens and closes", async () => { - const { container } = render(TooltipEvents); - - expect(screen.getByText("Open events: 0")).toBeInTheDocument(); - expect(screen.getByText("Close events: 0")).toBeInTheDocument(); - - const trigger = container.querySelector(".bx--tooltip__trigger"); - assert(trigger); - - await user.click(trigger); - expect(screen.getByText("Open events: 1")).toBeInTheDocument(); - - await user.keyboard("{Escape}"); - expect(screen.getByText("Close events: 1")).toBeInTheDocument(); - }); - - test("should close tooltip when clicking outside", async () => { - const { container } = render(TooltipOpen); - - expect(container.querySelector(".bx--tooltip")).toBeInTheDocument(); - - await user.click(document.body); - expect(container.querySelector(".bx--tooltip")).not.toBeInTheDocument(); - }); -}); diff --git a/tests/Tooltip/TooltipAlignments.test.svelte b/tests/Tooltip/TooltipAlignments.test.svelte deleted file mode 100644 index 73b170e7..00000000 --- a/tests/Tooltip/TooltipAlignments.test.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - -
    - {#each alignments as align} -
    - - Tooltip with {align} alignment - -
    - {/each} -
    diff --git a/tests/Tooltip/TooltipCustomContent.test.svelte b/tests/Tooltip/TooltipCustomContent.test.svelte deleted file mode 100644 index 837681e0..00000000 --- a/tests/Tooltip/TooltipCustomContent.test.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - -

    Custom tooltip content

    -
    diff --git a/tests/Tooltip/TooltipCustomIcon.test.svelte b/tests/Tooltip/TooltipCustomIcon.test.svelte deleted file mode 100644 index 3546ac83..00000000 --- a/tests/Tooltip/TooltipCustomIcon.test.svelte +++ /dev/null @@ -1,8 +0,0 @@ - - - -
    🔍
    - Custom icon tooltip -
    diff --git a/tests/Tooltip/TooltipDefault.test.svelte b/tests/Tooltip/TooltipDefault.test.svelte deleted file mode 100644 index af5a5827..00000000 --- a/tests/Tooltip/TooltipDefault.test.svelte +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/tests/Tooltip/TooltipDirections.test.svelte b/tests/Tooltip/TooltipDirections.test.svelte deleted file mode 100644 index acfe4a26..00000000 --- a/tests/Tooltip/TooltipDirections.test.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - -
    - {#each directions as direction} -
    - - Tooltip with {direction} direction - -
    - {/each} -
    diff --git a/tests/Tooltip/TooltipEvents.test.svelte b/tests/Tooltip/TooltipEvents.test.svelte deleted file mode 100644 index 1d7e6fae..00000000 --- a/tests/Tooltip/TooltipEvents.test.svelte +++ /dev/null @@ -1,27 +0,0 @@ - - -
    -

    Open events: {openCount}

    -

    Close events: {closeCount}

    - - - Interact with this tooltip to trigger events - -
    diff --git a/tests/Tooltip/TooltipHideIcon.test.svelte b/tests/Tooltip/TooltipHideIcon.test.svelte deleted file mode 100644 index f6716d31..00000000 --- a/tests/Tooltip/TooltipHideIcon.test.svelte +++ /dev/null @@ -1,11 +0,0 @@ - - - - This tooltip has its icon hidden - diff --git a/tests/Tooltip/TooltipOpen.test.svelte b/tests/Tooltip/TooltipOpen.test.svelte deleted file mode 100644 index 0468808e..00000000 --- a/tests/Tooltip/TooltipOpen.test.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - - This tooltip is initially open - diff --git a/tests/TooltipDefinition.test.svelte b/tests/TooltipDefinition.test.svelte new file mode 100644 index 00000000..dc942869 --- /dev/null +++ b/tests/TooltipDefinition.test.svelte @@ -0,0 +1,24 @@ + + + + Armonk + + + + Armonk + + + + Armonk + + IBM Corporate Headquarters is based in Armonk, New York. + + diff --git a/tests/TooltipDefinition/TooltipDefinition.test.svelte b/tests/TooltipDefinition/TooltipDefinition.test.svelte deleted file mode 100644 index ce308884..00000000 --- a/tests/TooltipDefinition/TooltipDefinition.test.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - - { - console.log("open"); - }} - on:close={() => { - console.log("close"); - }} -> - {triggerContent} - diff --git a/tests/TooltipDefinition/TooltipDefinition.test.ts b/tests/TooltipDefinition/TooltipDefinition.test.ts deleted file mode 100644 index 0250f0cd..00000000 --- a/tests/TooltipDefinition/TooltipDefinition.test.ts +++ /dev/null @@ -1,158 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import TooltipDefinition from "./TooltipDefinition.test.svelte"; - -describe("TooltipDefinition", () => { - let consoleLog: ReturnType; - - beforeEach(() => { - consoleLog = vi.spyOn(console, "log"); - }); - - afterEach(() => { - vi.restoreAllMocks(); - }); - - it("should render with default props", () => { - render(TooltipDefinition); - - expect(screen.getByText("Tooltip trigger")).toBeInTheDocument(); - expect(screen.getByText("Test tooltip text")).toBeInTheDocument(); - }); - - it("should show tooltip on hover", async () => { - render(TooltipDefinition); - - const trigger = screen.getByText("Tooltip trigger"); - await user.hover(trigger); - - expect(trigger).toHaveClass("bx--tooltip--visible"); - expect(consoleLog).toHaveBeenCalledWith("open"); - }); - - it("should hide tooltip on mouse leave", async () => { - render(TooltipDefinition); - - const trigger = screen.getByText("Tooltip trigger"); - await user.hover(trigger); - await user.unhover(trigger); - - expect(trigger).toHaveClass("bx--tooltip--hidden"); - expect(consoleLog).toHaveBeenCalledWith("close"); - }); - - it("should show tooltip on focus", async () => { - render(TooltipDefinition); - - const trigger = screen.getByText("Tooltip trigger"); - await user.tab(); - - expect(trigger).toHaveClass("bx--tooltip--visible"); - expect(consoleLog).toHaveBeenCalledWith("open"); - }); - - it("should hide tooltip on blur", async () => { - render(TooltipDefinition); - - const trigger = screen.getByText("Tooltip trigger"); - await user.tab(); - await user.tab(); - - expect(trigger).toHaveClass("bx--tooltip--hidden"); - expect(consoleLog).toHaveBeenCalledWith("close"); - }); - - it("should hide tooltip on Escape key", async () => { - render(TooltipDefinition); - - const trigger = screen.getByText("Tooltip trigger"); - await user.hover(trigger); - await user.keyboard("{Escape}"); - - expect(trigger).toHaveClass("bx--tooltip--hidden"); - expect(consoleLog).toHaveBeenCalledWith("close"); - }); - - it("should support top direction", () => { - render(TooltipDefinition, { - props: { direction: "top" }, - }); - - const trigger = screen.getByText("Tooltip trigger"); - expect(trigger).toHaveClass("bx--tooltip--top"); - }); - - it("should support bottom direction", () => { - render(TooltipDefinition, { - props: { direction: "bottom" }, - }); - - const trigger = screen.getByText("Tooltip trigger"); - expect(trigger).toHaveClass("bx--tooltip--bottom"); - }); - - it("should support start alignment", () => { - render(TooltipDefinition, { - props: { align: "start" }, - }); - - const trigger = screen.getByText("Tooltip trigger"); - expect(trigger).toHaveClass("bx--tooltip--align-start"); - }); - - it("should support center alignment", () => { - render(TooltipDefinition, { - props: { align: "center" }, - }); - - const trigger = screen.getByText("Tooltip trigger"); - expect(trigger).toHaveClass("bx--tooltip--align-center"); - }); - - it("should support end alignment", () => { - render(TooltipDefinition, { - props: { align: "end" }, - }); - - const trigger = screen.getByText("Tooltip trigger"); - expect(trigger).toHaveClass("bx--tooltip--align-end"); - }); - - it("should support custom trigger content", () => { - render(TooltipDefinition, { - props: { - triggerContent: "Custom trigger", - }, - }); - - expect(screen.getByText("Custom trigger")).toBeInTheDocument(); - }); - - it("should support controlled open state", () => { - render(TooltipDefinition, { - props: { open: true }, - }); - - const trigger = screen.getByText("Tooltip trigger"); - expect(trigger).toHaveClass("bx--tooltip--visible"); - }); - - it("should use provided id for tooltip", () => { - render(TooltipDefinition, { - props: { id: "custom-id" }, - }); - - const tooltip = screen.getByRole("tooltip"); - expect(tooltip).toHaveAttribute("id", "custom-id"); - }); - - it("should have correct ARIA attributes", () => { - render(TooltipDefinition); - - const trigger = screen.getByText("Tooltip trigger"); - const tooltip = screen.getByRole("tooltip"); - - expect(trigger).toHaveAttribute("aria-describedby", tooltip.id); - expect(tooltip).toHaveClass("bx--assistive-text"); - }); -}); diff --git a/tests/TooltipIcon.test.svelte b/tests/TooltipIcon.test.svelte new file mode 100644 index 00000000..bac010c1 --- /dev/null +++ b/tests/TooltipIcon.test.svelte @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + Carbon is an open source design system by IBM. + + diff --git a/tests/TooltipIcon/TooltipIcon.test.svelte b/tests/TooltipIcon/TooltipIcon.test.svelte deleted file mode 100644 index ca40f41d..00000000 --- a/tests/TooltipIcon/TooltipIcon.test.svelte +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - diff --git a/tests/TooltipIcon/TooltipIcon.test.ts b/tests/TooltipIcon/TooltipIcon.test.ts deleted file mode 100644 index 52e0668b..00000000 --- a/tests/TooltipIcon/TooltipIcon.test.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import TooltipIcon from "./TooltipIcon.test.svelte"; - -describe("TooltipIcon", () => { - it("should render with default props", () => { - render(TooltipIcon); - - expect(screen.getByText("Test tooltip text")).toBeInTheDocument(); - }); - - it("should show and hide the tooltip", async () => { - render(TooltipIcon); - - const trigger = screen.getByRole("button"); - await user.hover(trigger); - - expect(trigger).not.toHaveClass("bx--tooltip--hidden"); - - await user.keyboard("{Escape}"); - expect(screen.getByRole("button")).toHaveClass("bx--tooltip--hidden"); - }); - - it("should show tooltip on focus", async () => { - render(TooltipIcon); - - const trigger = screen.getByRole("button"); - await user.tab(); - - expect(trigger).not.toHaveClass("bx--tooltip--hidden"); - }); - - it("should hide tooltip on Escape key", async () => { - render(TooltipIcon); - - const trigger = screen.getByRole("button"); - await user.hover(trigger); - await user.keyboard("{Escape}"); - - expect(trigger).toHaveClass("bx--tooltip--hidden"); - }); - - describe("tooltip positioning", () => { - test.each([ - ["top", "bx--tooltip--top"], - ["right", "bx--tooltip--right"], - ["bottom", "bx--tooltip--bottom"], - ["left", "bx--tooltip--left"], - ] as const)("should support %s direction", (direction, expectedClass) => { - render(TooltipIcon, { - props: { direction }, - }); - - const trigger = screen.getByRole("button"); - expect(trigger).toHaveClass(expectedClass); - }); - - test.each([ - ["start", "bx--tooltip--align-start"], - ["center", "bx--tooltip--align-center"], - ["end", "bx--tooltip--align-end"], - ] as const)("should support %s alignment", (align, expectedClass) => { - render(TooltipIcon, { - props: { align }, - }); - - const trigger = screen.getByRole("button"); - expect(trigger).toHaveClass(expectedClass); - }); - }); - - it("should support disabled state", () => { - render(TooltipIcon, { - props: { disabled: true }, - }); - - const trigger = screen.getByRole("button"); - expect(trigger).toBeDisabled(); - expect(trigger).toHaveStyle({ cursor: "not-allowed" }); - expect(trigger).toHaveClass("bx--tooltip--hidden"); - }); - - it("should not show tooltip when disabled", async () => { - render(TooltipIcon, { - props: { disabled: true }, - }); - - const trigger = screen.getByRole("button"); - await user.hover(trigger); - - expect(trigger).toHaveClass("bx--tooltip--hidden"); - }); - - it("should support custom tooltip text", () => { - render(TooltipIcon, { - props: { tooltipText: "Custom tooltip" }, - }); - - expect(screen.getByText("Custom tooltip")).toBeInTheDocument(); - }); - - it("should use provided id for tooltip", () => { - render(TooltipIcon, { - props: { id: "custom-id" }, - }); - - const tooltip = screen.getByRole("button"); - expect(tooltip).toHaveAttribute("aria-describedby", "custom-id"); - }); - - it("should have correct ARIA attributes", () => { - render(TooltipIcon); - - const trigger = screen.getByRole("button"); - const tooltip = screen.getByText("Test tooltip text"); - - expect(trigger).toHaveAttribute("aria-describedby", "test-tooltip"); - expect(tooltip).toHaveClass("bx--assistive-text"); - }); -}); diff --git a/tests/TreeView/TreeView.hierarchy.test.svelte b/tests/TreeView/TreeView.hierarchy.test.svelte deleted file mode 100644 index 93229866..00000000 --- a/tests/TreeView/TreeView.hierarchy.test.svelte +++ /dev/null @@ -1,61 +0,0 @@ - - - console.log("select", detail)} - on:toggle={({ detail }) => console.log("toggle", detail)} - on:focus={({ detail }) => console.log("focus", detail)} - let:node -> - {node.text} - - - - diff --git a/tests/TreeView/TreeView.test.svelte b/tests/TreeView/TreeView.test.svelte deleted file mode 100644 index 38873616..00000000 --- a/tests/TreeView/TreeView.test.svelte +++ /dev/null @@ -1,80 +0,0 @@ - - - console.log("select", detail)} - on:toggle={({ detail }) => console.log("toggle", detail)} - on:focus={({ detail }) => console.log("focus", detail)} - let:node -> - {node.text} - - - - diff --git a/tests/TreeView/TreeView.test.ts b/tests/TreeView/TreeView.test.ts deleted file mode 100644 index e52713e8..00000000 --- a/tests/TreeView/TreeView.test.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import TreeViewHierarchy from "./TreeView.hierarchy.test.svelte"; -import TreeView from "./TreeView.test.svelte"; - -const testCases = [ - { name: "TreeView", component: TreeView }, - { name: "TreeView hierarchy", component: TreeViewHierarchy }, -]; - -describe.each(testCases)("$name", ({ component }) => { - const getItemByName = (name: RegExp) => { - return screen.getByRole("treeitem", { - name, - selected: false, - }); - }; - - const getSelectedItemByName = (name: RegExp) => { - return screen.getByRole("treeitem", { - name, - selected: true, - }); - }; - - const noExpandedItems = () => { - expect(screen.queryAllByRole("treeitem", { expanded: true })).toHaveLength( - 0, - ); - }; - - const getAllExpandedItems = () => { - return screen.getAllByRole("treeitem", { expanded: true }); - }; - - it("can select a node", async () => { - const consoleLog = vi.spyOn(console, "log"); - - render(component); - - const firstItem = getItemByName(/AI \/ Machine learning/); - expect(firstItem).toBeInTheDocument(); - - await user.click(firstItem); - expect(getSelectedItemByName(/AI \/ Machine learning/)).toBeInTheDocument(); - expect(consoleLog).toBeCalledWith("selectedIds", [0]); - expect(consoleLog).toBeCalledWith("select", { - disabled: false, - expanded: false, - id: 0, - leaf: true, - selected: false, - text: "AI / Machine learning", - }); - }); - - it("can expand all nodes", async () => { - render(component); - - noExpandedItems(); - - const expandAllButton = screen.getByText("Expand all"); - await user.click(expandAllButton); - - expect(getAllExpandedItems()).toHaveLength(5); - }); - - it("can expand some nodes", async () => { - render(component); - - noExpandedItems(); - - const expandSomeNodesButton = screen.getByText("Expand some nodes"); - await user.click(expandSomeNodesButton); - - expect(getAllExpandedItems()).toHaveLength(2); - - expect( - screen.getByText("IBM Analytics Engine").parentNode?.parentNode, - ).toHaveAttribute("aria-expanded", "true"); - }); -}); diff --git a/tests/TreeView/toHierarchy.test.ts b/tests/TreeView/toHierarchy.test.ts deleted file mode 100644 index 666ed0a7..00000000 --- a/tests/TreeView/toHierarchy.test.ts +++ /dev/null @@ -1,255 +0,0 @@ -import { toHierarchy } from "carbon-components-svelte"; - -describe("toHierarchy", () => { - test("should create a flat hierarchy when no items have parents", () => { - const input = [ - { id: 1, name: "Item 1" }, - { id: 2, name: "Item 2", parentId: "invalid" }, - ]; - const result = toHierarchy(input, (item) => item.parentId); - - expect(result).toEqual([ - { id: 1, name: "Item 1" }, - { id: 2, name: "Item 2", parentId: "invalid" }, - ]); - }); - - test("should create a nested hierarchy with parent-child relationships", () => { - const input = [ - { id: 1, name: "Parent" }, - { id: 2, name: "Child", pid: 1, randomKey: "randomValue" }, - { id: 3, name: "Grandchild", pid: 2 }, - ]; - const result = toHierarchy(input, (item) => item.pid); - - expect(result).toEqual([ - { - id: 1, - name: "Parent", - nodes: [ - { - id: 2, - name: "Child", - pid: 1, - nodes: [ - { - id: 3, - name: "Grandchild", - pid: 2, - }, - ], - randomKey: "randomValue", - }, - ], - }, - ]); - }); - - test("should handle multiple root nodes with children", () => { - const input = [ - { id: 1, name: "Root 1" }, - { id: 2, name: "Root 2" }, - { id: 3, name: "Child 1", pid: 1 }, - { id: 4, name: "Child 2", pid: 2 }, - ]; - const result = toHierarchy(input, (item) => item.pid); - - expect(result).toEqual([ - { - id: 1, - name: "Root 1", - nodes: [ - { - id: 3, - name: "Child 1", - pid: 1, - }, - ], - }, - { - id: 2, - name: "Root 2", - nodes: [ - { - id: 4, - name: "Child 2", - pid: 2, - }, - ], - }, - ]); - }); - - test("should remove empty nodes arrays", () => { - const input = [ - { id: 1, name: "Root" }, - { id: 2, name: "Leaf", pid: 1 }, - ]; - const result = toHierarchy(input, (item) => item.pid); - expect(result).toEqual([ - { - id: 1, - name: "Root", - nodes: [ - { - id: 2, - name: "Leaf", - pid: 1, - }, - ], - }, - ]); - - expect(result[0].nodes?.[0]).not.toHaveProperty("nodes"); - }); - - test("should handle empty input array", () => { - const result = toHierarchy< - { id: string | number; parentId?: string | number }, - "parentId" - >([], (item) => item.parentId || null); - expect(result).toEqual([]); - }); - - test("should handle non-existent parent IDs", () => { - const input = [ - { id: 1, name: "Root" }, - { id: 2, name: "Child", pid: 999 }, - ]; - const result = toHierarchy(input, (item) => item.pid); - expect(result).toEqual([ - { id: 1, name: "Root" }, - { id: 2, name: "Child", pid: 999 }, - ]); - }); - - test("should handle deeply nested structures", () => { - const input = [ - { id: 1, name: "Level 1" }, - { id: 2, name: "Level 2", pid: 1 }, - { id: 3, name: "Level 3", pid: 2 }, - { id: 4, name: "Level 4", pid: 3 }, - { id: 5, name: "Level 5", pid: 4 }, - ]; - const result = toHierarchy(input, (item) => item.pid); - expect(result).toEqual([ - { - id: 1, - name: "Level 1", - nodes: [ - { - id: 2, - name: "Level 2", - pid: 1, - nodes: [ - { - id: 3, - name: "Level 3", - pid: 2, - nodes: [ - { - id: 4, - name: "Level 4", - pid: 3, - nodes: [ - { - id: 5, - name: "Level 5", - pid: 4, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ]); - }); - - test("should handle mixed ID types", () => { - const input = [ - { id: "root", name: "Root" }, - { id: 1, name: "Child 1", pid: "root" }, - { id: "2", name: "Child 2", pid: "root" }, - ]; - const result = toHierarchy(input, (item) => item.pid); - expect(result).toEqual([ - { - id: "root", - name: "Root", - nodes: [ - { - id: 1, - name: "Child 1", - pid: "root", - }, - { - id: "2", - name: "Child 2", - pid: "root", - }, - ], - }, - ]); - }); - - test("should preserve additional properties", () => { - const input = [ - { id: 1, name: "Root", extra: "data", meta: { key: "value" } }, - { id: 2, name: "Child", pid: 1, flag: true, count: 42 }, - ]; - const result = toHierarchy(input, (item) => item.pid); - expect(result).toEqual([ - { - id: 1, - name: "Root", - extra: "data", - meta: { key: "value" }, - nodes: [ - { - id: 2, - name: "Child", - pid: 1, - flag: true, - count: 42, - }, - ], - }, - ]); - }); - - test("should handle null/undefined parent IDs", () => { - const input = [ - { id: 1, name: "Root 1" }, - { id: 2, name: "Root 2", pid: null }, - { id: 3, name: "Root 3", pid: undefined }, - { id: 4, name: "Child", pid: 1 }, - ]; - const result = toHierarchy(input, (item) => item.pid); - expect(result).toEqual([ - { - id: 1, - name: "Root 1", - nodes: [ - { - id: 4, - name: "Child", - pid: 1, - }, - ], - }, - { - id: 2, - name: "Root 2", - pid: null, - }, - { - id: 3, - name: "Root 3", - pid: undefined, - }, - ]); - }); -}); diff --git a/tests/Truncate.test.svelte b/tests/Truncate.test.svelte new file mode 100644 index 00000000..35e90c8b --- /dev/null +++ b/tests/Truncate.test.svelte @@ -0,0 +1,23 @@ + + + + Carbon Components Svelte is a Svelte component library that implements the + Carbon Design System, an open source design system by IBM. + + + + Carbon Components Svelte is a Svelte component library that implements the + Carbon Design System, an open source design system by IBM. + + +

    + Carbon Components Svelte is a Svelte component library that implements the + Carbon Design System, an open source design system by IBM. +

    +

    + Carbon Components Svelte is a Svelte component library that implements the + Carbon Design System, an open source design system by IBM. +

    diff --git a/tests/Truncate/Truncate.test.svelte b/tests/Truncate/Truncate.test.svelte deleted file mode 100644 index d9aee792..00000000 --- a/tests/Truncate/Truncate.test.svelte +++ /dev/null @@ -1,11 +0,0 @@ - - - - {text} - diff --git a/tests/Truncate/Truncate.test.ts b/tests/Truncate/Truncate.test.ts deleted file mode 100644 index b5f7b758..00000000 --- a/tests/Truncate/Truncate.test.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import Truncate from "./Truncate.test.svelte"; -import TruncateAction from "./TruncateAction.test.svelte"; - -describe("Truncate", () => { - describe("component", () => { - test.each([ - ["end", "bx--text-truncate--end"], - ["front", "bx--text-truncate--front"], - ] as const)("should support %s clamp", (clamp, expectedClass) => { - render(Truncate, { props: { clamp } }); - - const element = screen.getByText(/This is a long text/); - expect(element).toHaveClass(expectedClass); - }); - - it("should render text content", () => { - const text = "Custom text content"; - render(Truncate, { props: { text } }); - - expect(screen.getByText(text)).toBeInTheDocument(); - }); - - it("should render as paragraph element", () => { - render(Truncate); - - const element = screen.getByText(/This is a long text/); - expect(element.tagName).toBe("P"); - }); - - it("should default to end clamp", () => { - render(Truncate); - - const element = screen.getByText(/This is a long text/); - expect(element).toHaveClass("bx--text-truncate--end"); - }); - }); - - describe("action", () => { - test.each([ - ["end", "bx--text-truncate--end"], - ["front", "bx--text-truncate--front"], - ] as const)("should support %s clamp", (clamp, expectedClass) => { - render(TruncateAction, { props: { clamp } }); - - const element = screen.getByText(/This is a long text/); - expect(element).toHaveClass(expectedClass); - }); - - test.each([ - ["h1", "H1"], - ["h2", "H2"], - ["h3", "H3"], - ["h4", "H4"], - ["p", "P"], - ["span", "SPAN"], - ] as const)("should work with %s element", (elementType, expectedTag) => { - render(TruncateAction, { props: { element: elementType } }); - - const element = screen.getByText(/This is a long text/); - expect(element.tagName).toBe(expectedTag); - expect(element).toHaveClass("bx--text-truncate--end"); - }); - - it("should preserve existing classes", () => { - render(TruncateAction, { - props: { - element: "p", - text: "Test", - }, - }); - - const element = screen.getByText("Test"); - element.classList.add("custom-class"); - - // Trigger update - element.dispatchEvent(new Event("update")); - - expect(element).toHaveClass("custom-class"); - expect(element).toHaveClass("bx--text-truncate--end"); - }); - - it("should default to end clamp", () => { - render(TruncateAction); - - const element = screen.getByText(/This is a long text/); - expect(element).toHaveClass("bx--text-truncate--end"); - }); - }); -}); diff --git a/tests/Truncate/TruncateAction.test.svelte b/tests/Truncate/TruncateAction.test.svelte deleted file mode 100644 index fe2d8b50..00000000 --- a/tests/Truncate/TruncateAction.test.svelte +++ /dev/null @@ -1,22 +0,0 @@ - - -{#if element === "h1"} -

    {text}

    -{:else if element === "h2"} -

    {text}

    -{:else if element === "h3"} -

    {text}

    -{:else if element === "h4"} -

    {text}

    -{:else if element === "span"} - {text} -{:else} -

    {text}

    -{/if} diff --git a/tests/UnorderedList.test.svelte b/tests/UnorderedList.test.svelte new file mode 100644 index 00000000..ad9df83a --- /dev/null +++ b/tests/UnorderedList.test.svelte @@ -0,0 +1,39 @@ + + + + Unordered list item + Unordered list item + Unordered list item + + + + + Unordered list item + + + Unordered list item + + + Unordered list item + + + + + + Unordered list level 1 + + Unordered list level 2 + + Unordered list level 3 + + Unordered list level 3 + Unordered list level 3 + + + + + Unordered list level 1 + Unordered list level 1 + diff --git a/tests/UnorderedList/UnorderedList.test.svelte b/tests/UnorderedList/UnorderedList.test.svelte deleted file mode 100644 index 96ada196..00000000 --- a/tests/UnorderedList/UnorderedList.test.svelte +++ /dev/null @@ -1,30 +0,0 @@ - - - - {#each items as item} - - {item} - {#if nested && nestedItems.length > 0} - - {#each nestedItems as nestedItem} - {nestedItem} - {/each} - - {/if} - - {/each} - diff --git a/tests/UnorderedList/UnorderedList.test.ts b/tests/UnorderedList/UnorderedList.test.ts deleted file mode 100644 index 4dd4d702..00000000 --- a/tests/UnorderedList/UnorderedList.test.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { render, screen } from "@testing-library/svelte"; -import { user } from "../setup-tests"; -import UnorderedList from "./UnorderedList.test.svelte"; - -describe("UnorderedList", () => { - it("should render with default props", () => { - render(UnorderedList); - - const list = screen.getByRole("list"); - expect(list).toHaveClass("bx--list--unordered"); - expect(list).not.toHaveClass("bx--list--nested"); - expect(list).not.toHaveClass("bx--list--expressive"); - - const items = screen.getAllByRole("listitem"); - expect(items).toHaveLength(3); - expect(items[0]).toHaveTextContent("Item 1"); - expect(items[1]).toHaveTextContent("Item 2"); - expect(items[2]).toHaveTextContent("Item 3"); - }); - - it("should support nested lists", () => { - render(UnorderedList, { - props: { - nested: true, - nestedItems: ["Nested 1", "Nested 2"], - }, - }); - - const lists = screen.getAllByRole("list"); - expect(lists).toHaveLength(4); // Main list + 3 nested lists (one for each main item) - - const mainList = lists[0]; - expect(mainList).toHaveClass("bx--list--unordered"); - expect(mainList).toHaveClass("bx--list--nested"); - - const nestedLists = lists.slice(1); - nestedLists.forEach((list) => { - expect(list).toHaveClass("bx--list--unordered"); - expect(list).toHaveClass("bx--list--nested"); - }); - - const items = screen.getAllByRole("listitem"); - expect(items).toHaveLength(9); // 3 main items + (2 nested items × 3) - }); - - it("should support expressive styles", () => { - render(UnorderedList, { - props: { expressive: true }, - }); - - const list = screen.getByRole("list"); - expect(list).toHaveClass("bx--list--expressive"); - }); - - it("should support custom items", () => { - const customItems = ["Custom 1", "Custom 2", "Custom 3", "Custom 4"]; - render(UnorderedList, { - props: { items: customItems }, - }); - - const items = screen.getAllByRole("listitem"); - expect(items).toHaveLength(customItems.length); - items.forEach((item, index) => { - expect(item).toHaveTextContent(customItems[index]); - }); - }); - - describe("events", () => { - it("should emit click event", async () => { - const { component } = render(UnorderedList); - const list = screen.getByRole("list"); - - const mock = vi.fn(); - component.$on("click", mock); - - await user.click(list); - expect(mock).toHaveBeenCalled(); - }); - - test.each(["mouseover", "mouseenter", "mouseleave"])( - "should emit %s event", - (eventName) => { - const { component } = render(UnorderedList); - const list = screen.getByRole("list"); - - const mock = vi.fn(); - component.$on(eventName, mock); - - const event = new MouseEvent(eventName); - list.dispatchEvent(event); - - expect(mock).toHaveBeenCalled(); - }, - ); - }); - - describe("accessibility", () => { - it("should have correct ARIA role", () => { - render(UnorderedList); - - const list = screen.getByRole("list"); - expect(list.tagName).toBe("UL"); - - const items = screen.getAllByRole("listitem"); - items.forEach((item) => { - expect(item.tagName).toBe("LI"); - }); - }); - - it("should maintain list structure with nested items", () => { - render(UnorderedList, { - props: { - nested: true, - nestedItems: ["Nested 1", "Nested 2"], - }, - }); - - const lists = screen.getAllByRole("list"); - lists.forEach((list) => { - expect(list.tagName).toBe("UL"); - expect(list.children).toBeTruthy(); - Array.from(list.children).forEach((child) => { - expect(child.tagName).toBe("LI"); - }); - }); - }); - }); -}); diff --git a/tests/index.html b/tests/index.html deleted file mode 100644 index 05ee465c..00000000 --- a/tests/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/tests/preprocess/index.js b/tests/preprocess/index.js new file mode 100644 index 00000000..b70ca2ba --- /dev/null +++ b/tests/preprocess/index.js @@ -0,0 +1 @@ +require("./optimize-carbon-imports.test"); diff --git a/tests/preprocess/optimize-carbon-imports.test.js b/tests/preprocess/optimize-carbon-imports.test.js new file mode 100644 index 00000000..de42e64e --- /dev/null +++ b/tests/preprocess/optimize-carbon-imports.test.js @@ -0,0 +1,139 @@ +const assert = require("assert"); +const { preprocess } = require("svelte/compiler"); +const { optimizeCarbonImports } = require("../../preprocess"); + +const fixtures = [ + { + name: "Single base import", + input: ` + `, + output: ` + `, + }, + { + name: "Single base import with markup, styles", + input: ` + + + + + `, + output: ` + + + + + `, + }, + { + name: "Single, aliased base import", + input: ` + `, + output: ` + `, + }, + { + name: "Multiple base imports", + input: ` + `, + output: ` + `, + }, + { + name: "Multiple imports from component folder", + input: ` + `, + output: ` + `, + }, + { + name: "Direct import from component source", + input: ` + `, + output: ` + `, + }, + { + name: "Carbon icons", + input: ` + `, + output: ` + `, + }, + { + name: "Carbon pictograms", + input: ` + `, + output: ` + `, + }, + { + name: "Integration", + input: ` + `, + output: ` + + `, + }, +]; + +(async () => { + for (const { name, input, output } of fixtures) { + console.log("[optimizeCarbonImports]", name); + + const result = await preprocess(input.trim(), [optimizeCarbonImports()]); + assert.strictEqual(result.toString(), output.trim()); + } +})(); diff --git a/tests/setup-tests.ts b/tests/setup-tests.ts deleted file mode 100644 index 018fda20..00000000 --- a/tests/setup-tests.ts +++ /dev/null @@ -1,83 +0,0 @@ -/// -import "@testing-library/jest-dom/vitest"; -import { userEvent } from "@testing-library/user-event"; - -// Mock scrollIntoView since it's not implemented in JSDOM -Element.prototype.scrollIntoView = vi.fn(); - -// Mock ResizeObserver since it's not implemented in JSDOM -class ResizeObserverMock { - callback: ResizeObserverCallback; - elements: Element[]; - - constructor(callback: ResizeObserverCallback) { - this.callback = callback; - this.elements = []; - } - - observe(element: Element) { - this.elements.push(element); - this.callback( - [ - { - target: element, - contentRect: { height: 100 } as DOMRectReadOnly, - borderBoxSize: [], - contentBoxSize: [], - devicePixelContentBoxSize: [], - }, - ], - this, - ); - } - - unobserve(element: Element) { - this.elements = this.elements.filter((el) => el !== element); - } - - disconnect() { - this.elements = []; - } -} - -global.ResizeObserver = ResizeObserverMock; - -export const user = userEvent.setup(); - -export const setupLocalStorageMock = () => { - let localStorageMock: { [key: string]: string } = {}; - let originalLocalStorage: Storage; - - beforeEach(() => { - originalLocalStorage = global.localStorage; - localStorageMock = {}; - global.localStorage = { - getItem: vi.fn((key) => localStorageMock[key] || null), - setItem: vi.fn((key, value) => { - localStorageMock[key] = value; - }), - removeItem: vi.fn((key) => { - delete localStorageMock[key]; - }), - clear: vi.fn(() => { - localStorageMock = {}; - }), - length: 0, - key: vi.fn(), - }; - }); - - afterEach(() => { - global.localStorage = originalLocalStorage; - localStorage.clear(); - vi.restoreAllMocks(); - localStorageMock = {}; - }); - - return { - setMockItem: (key: string, value: string) => { - localStorageMock[key] = value; - }, - getMockItem: (key: string) => localStorageMock[key], - }; -}; diff --git a/thumbnails/breakpoint.svg b/thumbnails/breakpoint.svg deleted file mode 100644 index bd241c25..00000000 --- a/thumbnails/breakpoint.svg +++ /dev/null @@ -1,149 +0,0 @@ - - - breakpoint - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 19:11 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/button-set.svg b/thumbnails/button-set.svg deleted file mode 100644 index 7e3aefbf..00000000 --- a/thumbnails/button-set.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/thumbnails/clickable-tile.svg b/thumbnails/clickable-tile.svg deleted file mode 100644 index c1431493..00000000 --- a/thumbnails/clickable-tile.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - clickable-tile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/composed-modal.svg b/thumbnails/composed-modal.svg deleted file mode 100644 index e452facc..00000000 --- a/thumbnails/composed-modal.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - composed-modal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/context-menu.svg b/thumbnails/context-menu.svg deleted file mode 100644 index 4adb0d4c..00000000 --- a/thumbnails/context-menu.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - context-menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/expandable-tile.svg b/thumbnails/expandable-tile.svg deleted file mode 100644 index 81e97609..00000000 --- a/thumbnails/expandable-tile.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - expandable-tile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/fluid-form.svg b/thumbnails/fluid-form.svg deleted file mode 100644 index 5946428e..00000000 --- a/thumbnails/fluid-form.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - form - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/image-loader.svg b/thumbnails/image-loader.svg deleted file mode 100644 index b1d5f70e..00000000 --- a/thumbnails/image-loader.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - image-loader - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/inline-notification.svg b/thumbnails/inline-notification.svg deleted file mode 100644 index 12759c86..00000000 --- a/thumbnails/inline-notification.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - inline-notification - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/local-storage.svg b/thumbnails/local-storage.svg deleted file mode 100644 index 5b8aedc4..00000000 --- a/thumbnails/local-storage.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - local-storage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/ordered-list.svg b/thumbnails/ordered-list.svg deleted file mode 100644 index e730ef42..00000000 --- a/thumbnails/ordered-list.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - ordered-list - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/password-input.svg b/thumbnails/password-input.svg deleted file mode 100644 index d1351839..00000000 --- a/thumbnails/password-input.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - password-input - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/radio-tile.svg b/thumbnails/radio-tile.svg deleted file mode 100644 index 47862878..00000000 --- a/thumbnails/radio-tile.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - radio-tile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/recursive-list.svg b/thumbnails/recursive-list.svg deleted file mode 100644 index 18a259a9..00000000 --- a/thumbnails/recursive-list.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - recursive-list - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/selectable-tile.svg b/thumbnails/selectable-tile.svg deleted file mode 100644 index 3763c347..00000000 --- a/thumbnails/selectable-tile.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - selectable-tile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/skeleton-placeholder.svg b/thumbnails/skeleton-placeholder.svg deleted file mode 100644 index 3a5d34a1..00000000 --- a/thumbnails/skeleton-placeholder.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - skeleton-placeholder - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/skeleton-text.svg b/thumbnails/skeleton-text.svg deleted file mode 100644 index f0a5ff7f..00000000 --- a/thumbnails/skeleton-text.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - skeleton-text - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/skeleton.svg b/thumbnails/skeleton.svg deleted file mode 100644 index d5fb6b5f..00000000 --- a/thumbnails/skeleton.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - skeleton - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/toast-notification.svg b/thumbnails/toast-notification.svg deleted file mode 100644 index 4c481f9a..00000000 --- a/thumbnails/toast-notification.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - toast-notification - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/tooltip-icon.svg b/thumbnails/tooltip-icon.svg deleted file mode 100644 index e4fa00c3..00000000 --- a/thumbnails/tooltip-icon.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - tooltip-icon - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/truncate.svg b/thumbnails/truncate.svg deleted file mode 100644 index f1ac3dd7..00000000 --- a/thumbnails/truncate.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - truncate - - - - - - - - - - - - - - \ No newline at end of file diff --git a/thumbnails/unordered-list.svg b/thumbnails/unordered-list.svg deleted file mode 100644 index c3f1c435..00000000 --- a/thumbnails/unordered-list.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - unordered-list - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index bf9727a7..db2b31af 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,25 +1 @@ -{ - "compilerOptions": { - "noEmit": true, - "erasableSyntaxOnly": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "ignoreDeprecations": "5.0", - "verbatimModuleSyntax": true, - "isolatedModules": true, - "target": "ESNext", - "module": "ESNext", - "moduleResolution": "node", - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitAny": true, - "strict": true, - "skipLibCheck": true, - "skipDefaultLibCheck": true, - "paths": { - "carbon-components-svelte": ["./types"], - "carbon-components-svelte/*": ["./types/*"] - } - }, - "include": ["src", "tests"] -} +{ "extends": "@tsconfig/svelte" } diff --git a/types/Accordion/Accordion.svelte.d.ts b/types/Accordion/Accordion.d.ts similarity index 76% rename from types/Accordion/Accordion.svelte.d.ts rename to types/Accordion/Accordion.d.ts index 1e36b317..338ca96a 100644 --- a/types/Accordion/Accordion.svelte.d.ts +++ b/types/Accordion/Accordion.d.ts @@ -1,7 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { AccordionSkeletonProps } from "./AccordionSkeleton.svelte"; +/// +import { SvelteComponentTyped } from "svelte"; +import { AccordionSkeletonProps } from "./AccordionSkeleton"; -export type AccordionProps = AccordionSkeletonProps & { +export interface AccordionProps extends AccordionSkeletonProps { /** * Specify alignment of accordion item chevron icon * @default "end" @@ -10,7 +11,6 @@ export type AccordionProps = AccordionSkeletonProps & { /** * Specify the size of the accordion - * @default undefined */ size?: "sm" | "xl"; @@ -25,7 +25,7 @@ export type AccordionProps = AccordionSkeletonProps & { * @default false */ skeleton?: boolean; -}; +} export default class Accordion extends SvelteComponentTyped< AccordionProps, diff --git a/types/Accordion/AccordionItem.svelte.d.ts b/types/Accordion/AccordionItem.d.ts similarity index 65% rename from types/Accordion/AccordionItem.svelte.d.ts rename to types/Accordion/AccordionItem.d.ts index 6c5f0c4b..eca4c772 100644 --- a/types/Accordion/AccordionItem.svelte.d.ts +++ b/types/Accordion/AccordionItem.d.ts @@ -1,12 +1,11 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["li"]; - -type $Props = { +export interface AccordionItemProps + extends svelte.JSX.HTMLAttributes { /** - * Specify the title of the accordion item heading. - * Alternatively, use the "title" slot (e.g., `
    ...
    `) + * Specify the title of the accordion item heading + * Alternatively, use the "title" slot (e.g.,
    ...
    ) * @default "title" */ title?: string; @@ -28,11 +27,7 @@ type $Props = { * @default "Expand/Collapse" */ iconDescription?: string; - - [key: `data-${string}`]: any; -}; - -export type AccordionItemProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class AccordionItem extends SvelteComponentTyped< AccordionItemProps, diff --git a/types/Accordion/AccordionSkeleton.svelte.d.ts b/types/Accordion/AccordionSkeleton.d.ts similarity index 68% rename from types/Accordion/AccordionSkeleton.svelte.d.ts rename to types/Accordion/AccordionSkeleton.d.ts index 2ce1dc07..c761f389 100644 --- a/types/Accordion/AccordionSkeleton.svelte.d.ts +++ b/types/Accordion/AccordionSkeleton.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["ul"]; - -type $Props = { +export interface AccordionSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Specify the number of accordion items to render * @default 4 @@ -18,7 +17,6 @@ type $Props = { /** * Specify the size of the accordion - * @default undefined */ size?: "sm" | "xl"; @@ -27,11 +25,7 @@ type $Props = { * @default true */ open?: boolean; - - [key: `data-${string}`]: any; -}; - -export type AccordionSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class AccordionSkeleton extends SvelteComponentTyped< AccordionSkeletonProps, diff --git a/types/AspectRatio/AspectRatio.d.ts b/types/AspectRatio/AspectRatio.d.ts new file mode 100644 index 00000000..8e723628 --- /dev/null +++ b/types/AspectRatio/AspectRatio.d.ts @@ -0,0 +1,17 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface AspectRatioProps + extends svelte.JSX.HTMLAttributes { + /** + * Specify the aspect ratio + * @default "2x1" + */ + ratio?: "2x1" | "16x9" | "4x3" | "1x1" | "3x4" | "9x16" | "1x2"; +} + +export default class AspectRatio extends SvelteComponentTyped< + AspectRatioProps, + {}, + { default: {} } +> {} diff --git a/types/AspectRatio/AspectRatio.svelte.d.ts b/types/AspectRatio/AspectRatio.svelte.d.ts deleted file mode 100644 index d11a5035..00000000 --- a/types/AspectRatio/AspectRatio.svelte.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - /** - * Specify the aspect ratio - * @default "2x1" - */ - ratio?: - | "2x1" - | "2x3" - | "16x9" - | "4x3" - | "1x1" - | "3x4" - | "3x2" - | "9x16" - | "1x2"; - - [key: `data-${string}`]: any; -}; - -export type AspectRatioProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class AspectRatio extends SvelteComponentTyped< - AspectRatioProps, - Record, - { default: {} } -> {} diff --git a/types/Breadcrumb/Breadcrumb.svelte.d.ts b/types/Breadcrumb/Breadcrumb.d.ts similarity index 70% rename from types/Breadcrumb/Breadcrumb.svelte.d.ts rename to types/Breadcrumb/Breadcrumb.d.ts index 55d24edb..9c3c465a 100644 --- a/types/Breadcrumb/Breadcrumb.svelte.d.ts +++ b/types/Breadcrumb/Breadcrumb.d.ts @@ -1,7 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { BreadcrumbSkeletonProps } from "./BreadcrumbSkeleton.svelte"; +/// +import { SvelteComponentTyped } from "svelte"; +import { BreadcrumbSkeletonProps } from "./BreadcrumbSkeleton"; -export type BreadcrumbProps = BreadcrumbSkeletonProps & { +export interface BreadcrumbProps extends BreadcrumbSkeletonProps { /** * Set to `true` to hide the breadcrumb trailing slash * @default false @@ -13,7 +14,7 @@ export type BreadcrumbProps = BreadcrumbSkeletonProps & { * @default false */ skeleton?: boolean; -}; +} export default class Breadcrumb extends SvelteComponentTyped< BreadcrumbProps, diff --git a/types/Breadcrumb/BreadcrumbItem.svelte.d.ts b/types/Breadcrumb/BreadcrumbItem.d.ts similarity index 64% rename from types/Breadcrumb/BreadcrumbItem.svelte.d.ts rename to types/Breadcrumb/BreadcrumbItem.d.ts index f7c12c1a..7b68f56e 100644 --- a/types/Breadcrumb/BreadcrumbItem.svelte.d.ts +++ b/types/Breadcrumb/BreadcrumbItem.d.ts @@ -1,12 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["li"]; - -type $Props = { +export interface BreadcrumbItemProps + extends svelte.JSX.HTMLAttributes { /** * Set the `href` to use an anchor link - * @default undefined */ href?: string; @@ -15,11 +13,7 @@ type $Props = { * @default false */ isCurrentPage?: boolean; - - [key: `data-${string}`]: any; -}; - -export type BreadcrumbItemProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class BreadcrumbItem extends SvelteComponentTyped< BreadcrumbItemProps, diff --git a/types/Breadcrumb/BreadcrumbSkeleton.svelte.d.ts b/types/Breadcrumb/BreadcrumbSkeleton.d.ts similarity index 63% rename from types/Breadcrumb/BreadcrumbSkeleton.svelte.d.ts rename to types/Breadcrumb/BreadcrumbSkeleton.d.ts index 822b3aaf..c675990e 100644 --- a/types/Breadcrumb/BreadcrumbSkeleton.svelte.d.ts +++ b/types/Breadcrumb/BreadcrumbSkeleton.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface BreadcrumbSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to hide the breadcrumb trailing slash * @default false @@ -15,11 +14,7 @@ type $Props = { * @default 3 */ count?: number; - - [key: `data-${string}`]: any; -}; - -export type BreadcrumbSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class BreadcrumbSkeleton extends SvelteComponentTyped< BreadcrumbSkeletonProps, diff --git a/types/Breakpoint/Breakpoint.svelte.d.ts b/types/Breakpoint/Breakpoint.svelte.d.ts deleted file mode 100644 index 00c6ecd0..00000000 --- a/types/Breakpoint/Breakpoint.svelte.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; - -export type BreakpointSize = "sm" | "md" | "lg" | "xlg" | "max"; - -export type BreakpointValue = 320 | 672 | 1056 | 1312 | 1584; - -export type BreakpointProps = { - /** - * Determine the current Carbon grid breakpoint size - * @default undefined - */ - size?: BreakpointSize; - - /** - * Carbon grid sizes as an object - * @default { sm: false, md: false, lg: false, xlg: false, max: false, } - */ - sizes?: Record; -}; - -export default class Breakpoint extends SvelteComponentTyped< - BreakpointProps, - { - change: CustomEvent<{ - size: BreakpointSize; - breakpointValue: BreakpointValue; - }>; - }, - { default: { size: BreakpointSize; sizes: Record } } -> {} diff --git a/types/Breakpoint/breakpointObserver.d.ts b/types/Breakpoint/breakpointObserver.d.ts deleted file mode 100644 index 77cfe464..00000000 --- a/types/Breakpoint/breakpointObserver.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Readable, Subscriber, Unsubscriber } from "svelte/store"; -import type { BreakpointSize, BreakpointValue } from "./breakpoints"; - -/** - * Creates a readable store that returns the current breakpoint size. - * It also provides functions for creating derived stores used to do comparisons. - */ -export function breakpointObserver(): { - subscribe: ( - this: void, - run: Subscriber, - invalidate?: (value?: any) => void, - ) => Unsubscriber; - /** - * Returns a store readable store that returns whether the current - * breakpoint is smaller than {@link size}. - * @param {BreakpointSize} size Size to compare against. - */ - smallerThan: (size: BreakpointSize) => Readable; - /** - * Returns a store readable store that returns whether the current - * breakpoint is larger than {@link size}. - * @param {BreakpointSize} size Size to compare against. - */ - largerThan: (size: BreakpointSize) => Readable; -}; - -export default breakpointObserver; diff --git a/types/Breakpoint/breakpoints.d.ts b/types/Breakpoint/breakpoints.d.ts deleted file mode 100644 index 44bbbcc4..00000000 --- a/types/Breakpoint/breakpoints.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Pixel sizes of Carbon grid breakpoints. - * @type {Record} - */ -export const breakpoints: Record; - -export type BreakpointSize = "sm" | "md" | "lg" | "xlg" | "max"; - -export type BreakpointValue = 320 | 672 | 1056 | 1312 | 1584; - -export default breakpoints; diff --git a/types/Breakpoint/index.d.ts b/types/Breakpoint/index.d.ts deleted file mode 100644 index 6b191a64..00000000 --- a/types/Breakpoint/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck `Breakpoint` is auto-generated by `sveld`. -export { default as Breakpoint } from "./Breakpoint.svelte"; -export { breakpointObserver } from "./breakpointObserver"; -export { breakpoints } from "./breakpoints"; diff --git a/types/Button/Button.svelte.d.ts b/types/Button/Button.d.ts similarity index 68% rename from types/Button/Button.svelte.d.ts rename to types/Button/Button.d.ts index 20d8f3b5..97d62ed0 100644 --- a/types/Button/Button.svelte.d.ts +++ b/types/Button/Button.d.ts @@ -1,13 +1,12 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; +import { ButtonSkeletonProps } from "./ButtonSkeleton"; -import type { ButtonSkeletonProps } from "./ButtonSkeleton.svelte"; - -type $RestProps = SvelteHTMLElements["button"] & - SvelteHTMLElements["a"] & - SvelteHTMLElements["div"]; - -type $Props = { +export interface ButtonProps + extends ButtonSkeletonProps, + svelte.JSX.HTMLAttributes, + svelte.JSX.HTMLAttributes, + svelte.JSX.HTMLAttributes { /** * Specify the kind of button * @default "primary" @@ -25,13 +24,7 @@ type $Props = { * Specify the size of button * @default "default" */ - size?: "default" | "field" | "small" | "lg" | "xl"; - - /** - * Set to `true` to use Carbon's expressive typesetting - * @default false - */ - expressive?: boolean; + size?: "default" | "field" | "small"; /** * Set to `true` to enable the selected state for an icon-only, ghost button @@ -40,21 +33,24 @@ type $Props = { isSelected?: boolean; /** - * Specify the icon to render - * Alternatively, use the named slot "icon" (e.g., ``) - * @default undefined + * Set to `true` for the icon-only variant + * @default false */ - icon?: any; + hasIconOnly?: boolean; + + /** + * Specify the icon from `carbon-icons-svelte` to render + */ + icon?: typeof import("carbon-icons-svelte").CarbonIcon; /** * Specify the ARIA label for the button icon - * @default undefined */ iconDescription?: string; /** - * Set the alignment of the tooltip relative to the icon. - * Only applies to icon-only buttons + * Set the alignment of the tooltip relative to the icon + * `hasIconOnly` must be set to `true` * @default "center" */ tooltipAlignment?: "start" | "center" | "end"; @@ -86,7 +82,6 @@ type $Props = { /** * Set the `href` to use an anchor link - * @default undefined */ href?: string; @@ -107,18 +102,12 @@ type $Props = { * @default null */ ref?: null | HTMLAnchorElement | HTMLButtonElement; - - [key: `data-${string}`]: any; -}; - -export type ButtonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Button extends SvelteComponentTyped< ButtonProps, { click: WindowEventMap["click"]; - focus: WindowEventMap["focus"]; - blur: WindowEventMap["blur"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; @@ -135,6 +124,5 @@ export default class Button extends SvelteComponentTyped< [key: string]: any; }; }; - icon: {}; } > {} diff --git a/types/Button/ButtonSet.d.ts b/types/Button/ButtonSet.d.ts new file mode 100644 index 00000000..d5eb59fd --- /dev/null +++ b/types/Button/ButtonSet.d.ts @@ -0,0 +1,17 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface ButtonSetProps + extends svelte.JSX.HTMLAttributes { + /** + * Set to `true` to stack the buttons vertically + * @default false + */ + stacked?: boolean; +} + +export default class ButtonSet extends SvelteComponentTyped< + ButtonSetProps, + {}, + { default: {} } +> {} diff --git a/types/Button/ButtonSet.svelte.d.ts b/types/Button/ButtonSet.svelte.d.ts deleted file mode 100644 index 15aacd7e..00000000 --- a/types/Button/ButtonSet.svelte.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - /** - * Set to `true` to stack the buttons vertically - * @default false - */ - stacked?: boolean; - - [key: `data-${string}`]: any; -}; - -export type ButtonSetProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class ButtonSet extends SvelteComponentTyped< - ButtonSetProps, - Record, - { default: {} } -> {} diff --git a/types/Button/ButtonSkeleton.svelte.d.ts b/types/Button/ButtonSkeleton.d.ts similarity index 50% rename from types/Button/ButtonSkeleton.svelte.d.ts rename to types/Button/ButtonSkeleton.d.ts index 0c0a3753..ac57f89e 100644 --- a/types/Button/ButtonSkeleton.svelte.d.ts +++ b/types/Button/ButtonSkeleton.d.ts @@ -1,12 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["a"]; - -type $Props = { +export interface ButtonSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set the `href` to use an anchor link - * @default undefined */ href?: string; @@ -14,19 +12,18 @@ type $Props = { * Specify the size of button skeleton * @default "default" */ - size?: "default" | "field" | "small" | "lg" | "xl"; + size?: "default" | "field" | "small"; - [key: `data-${string}`]: any; -}; - -export type ButtonSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; + /** + * @default false + */ + small?: boolean; +} export default class ButtonSkeleton extends SvelteComponentTyped< ButtonSkeletonProps, { click: WindowEventMap["click"]; - focus: WindowEventMap["focus"]; - blur: WindowEventMap["blur"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; diff --git a/types/Checkbox/Checkbox.svelte.d.ts b/types/Checkbox/Checkbox.d.ts similarity index 68% rename from types/Checkbox/Checkbox.svelte.d.ts rename to types/Checkbox/Checkbox.d.ts index 19b0ae00..cdd7a521 100644 --- a/types/Checkbox/Checkbox.svelte.d.ts +++ b/types/Checkbox/Checkbox.d.ts @@ -1,27 +1,13 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - /** - * Specify the value of the checkbox - * @default "" - */ - value?: any; +/// +import { SvelteComponentTyped } from "svelte"; +export interface CheckboxProps { /** * Specify whether the checkbox is checked * @default false */ checked?: boolean; - /** - * Specify the bound group - * @default undefined - */ - group?: ReadonlyArray; - /** * Specify whether the checkbox is indeterminate * @default false @@ -34,12 +20,6 @@ type $Props = { */ skeleton?: boolean; - /** - * Set to `true` to mark the field as required - * @default false - */ - required?: boolean; - /** * Set to `true` for the checkbox to be read-only * @default false @@ -72,7 +52,6 @@ type $Props = { /** * Specify the title attribute for the label element - * @default undefined */ title?: string; @@ -87,11 +66,7 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type CheckboxProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Checkbox extends SvelteComponentTyped< CheckboxProps, @@ -102,8 +77,6 @@ export default class Checkbox extends SvelteComponentTyped< mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; change: WindowEventMap["change"]; - focus: WindowEventMap["focus"]; - blur: WindowEventMap["blur"]; }, - { labelText: {} } + {} > {} diff --git a/types/Checkbox/CheckboxSkeleton.svelte.d.ts b/types/Checkbox/CheckboxSkeleton.d.ts similarity index 50% rename from types/Checkbox/CheckboxSkeleton.svelte.d.ts rename to types/Checkbox/CheckboxSkeleton.d.ts index 7cff1584..0e3994d1 100644 --- a/types/Checkbox/CheckboxSkeleton.svelte.d.ts +++ b/types/Checkbox/CheckboxSkeleton.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type CheckboxSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +export interface CheckboxSkeletonProps + extends svelte.JSX.HTMLAttributes {} export default class CheckboxSkeleton extends SvelteComponentTyped< CheckboxSkeletonProps, diff --git a/types/CodeSnippet/CodeSnippet.svelte.d.ts b/types/CodeSnippet/CodeSnippet.d.ts similarity index 60% rename from types/CodeSnippet/CodeSnippet.svelte.d.ts rename to types/CodeSnippet/CodeSnippet.d.ts index 72073913..c53d589a 100644 --- a/types/CodeSnippet/CodeSnippet.svelte.d.ts +++ b/types/CodeSnippet/CodeSnippet.d.ts @@ -1,6 +1,7 @@ -import type { SvelteComponentTyped } from "svelte"; +/// +import { SvelteComponentTyped } from "svelte"; -export type CodeSnippetProps = { +export interface CodeSnippetProps { /** * Set the type of code snippet * @default "single" @@ -8,22 +9,12 @@ export type CodeSnippetProps = { type?: "single" | "inline" | "multi"; /** - * Set the code snippet text. - * Alternatively, use the default slot (e.g., `{code}`). - * - * NOTE: you *must* use the `code` prop for the copy-to-clipboard functionality. - * @default undefined + * Set the code snippet text + * Alternatively, use the default slot (e.g., {`code`}) + * You must use the `code` prop to copy the code */ code?: string; - /** - * By default, this component uses `navigator.clipboard.writeText` API to copy text to the user's clipboard. - * - * Provide a custom function to override this behavior. - * @default async (code) => { try { await navigator.clipboard.writeText(code); } catch (e) { console.log(e); } } - */ - copy?: (code: string) => void; - /** * Set to `true` to expand a multi-line code snippet (type="multi") * @default false @@ -37,16 +28,15 @@ export type CodeSnippetProps = { hideCopyButton?: boolean; /** - * Set to `true` for the disabled variant. + * Set to `true` for the disabled variant * Only applies to the "single", "multi" types * @default false */ disabled?: boolean; /** - * Set to `true` to wrap the text. - * - * NOTE: this prop only works with the `type="multi"` variant + * Set to `true` to wrap the text + * Note that `type` must be "multi" * @default false */ wrapText?: boolean; @@ -65,13 +55,11 @@ export type CodeSnippetProps = { /** * Specify the ARIA label for the copy button icon - * @default undefined */ copyButtonDescription?: string; /** * Specify the ARIA label of the copy button - * @default undefined */ copyLabel?: string; @@ -88,26 +76,22 @@ export type CodeSnippetProps = { feedbackTimeout?: number; /** - * Specify the show less text. - * - * NOTE: this prop only works with the `type="multi"` variant + * Specify the show less text + * `type` must be "multi" * @default "Show less" */ showLessText?: string; /** * Specify the show more text - * - * NOTE: this prop only works with the `type="multi"` variant + * `type` must be "multi" * @default "Show more" */ showMoreText?: string; /** - * Set to `false` to hide the show more/less button - * - * NOTE: this prop only works with the `type="multi"` variant - * @default true + * Set to `true` to enable the show more/less button + * @default false */ showMoreLess?: boolean; @@ -122,19 +106,17 @@ export type CodeSnippetProps = { * @default null */ ref?: null | HTMLPreElement; -}; +} export default class CodeSnippet extends SvelteComponentTyped< CodeSnippetProps, { - expand: CustomEvent; - collapse: CustomEvent; - copy: CustomEvent; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; animationend: WindowEventMap["animationend"]; + copy: CustomEvent; }, { default: {} } > {} diff --git a/types/CodeSnippet/CodeSnippetSkeleton.svelte.d.ts b/types/CodeSnippet/CodeSnippetSkeleton.d.ts similarity index 57% rename from types/CodeSnippet/CodeSnippetSkeleton.svelte.d.ts rename to types/CodeSnippet/CodeSnippetSkeleton.d.ts index 2274cf54..7e0c3422 100644 --- a/types/CodeSnippet/CodeSnippetSkeleton.svelte.d.ts +++ b/types/CodeSnippet/CodeSnippetSkeleton.d.ts @@ -1,19 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface CodeSnippetSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set the type of code snippet * @default "single" */ type?: "single" | "multi"; - - [key: `data-${string}`]: any; -}; - -export type CodeSnippetSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class CodeSnippetSkeleton extends SvelteComponentTyped< CodeSnippetSkeletonProps, diff --git a/types/ComboBox/ComboBox.svelte.d.ts b/types/ComboBox/ComboBox.d.ts similarity index 61% rename from types/ComboBox/ComboBox.svelte.d.ts rename to types/ComboBox/ComboBox.d.ts index 5e1de181..72e0abf8 100644 --- a/types/ComboBox/ComboBox.svelte.d.ts +++ b/types/ComboBox/ComboBox.d.ts @@ -1,22 +1,18 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -export type ComboBoxItemId = any; +/// +import { SvelteComponentTyped } from "svelte"; export interface ComboBoxItem { - id: ComboBoxItemId; + id: string; text: string; - disabled?: boolean; } -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface ComboBoxProps + extends svelte.JSX.HTMLAttributes { /** * Set the combobox items * @default [] */ - items?: ReadonlyArray; + items?: ComboBoxItem[]; /** * Override the display of a combobox item @@ -25,10 +21,10 @@ type $Props = { itemToString?: (item: ComboBoxItem) => string; /** - * Set the selected item by value id - * @default undefined + * Set the selected item by value index + * @default -1 */ - selectedId?: ComboBoxItemId; + selectedIndex?: number; /** * Specify the selected combobox value @@ -44,7 +40,6 @@ type $Props = { /** * Set the size of the combobox - * @default undefined */ size?: "sm" | "xl"; @@ -60,12 +55,6 @@ type $Props = { */ titleText?: string; - /** - * Set to `true` to visually hide the label text - * @default false - */ - hideLabel?: boolean; - /** * Specify the placeholder text * @default "" @@ -121,20 +110,9 @@ type $Props = { shouldFilterItem?: (item: ComboBoxItem, value: string) => boolean; /** - * Override the chevron icon label based on the open state. - * Defaults to "Open menu" when closed and "Close menu" when open - * @default undefined + * Override the default translation ids */ - translateWithId?: ( - id: import("../ListBox/ListBoxMenuIcon.svelte").ListBoxMenuIconTranslationId, - ) => string; - - /** - * Override the label of the clear button when the input has a selection. - * Defaults to "Clear selected item" since a combo box can only have on selection. - * @default undefined - */ - translateWithIdSelection?: (id: "clearSelection") => string; + translateWithId?: (id: any) => string; /** * Set an id for the list box component @@ -144,7 +122,6 @@ type $Props = { /** * Specify a name attribute for the input - * @default undefined */ name?: string; @@ -159,31 +136,21 @@ type $Props = { * @default null */ listRef?: null | HTMLDivElement; - - [key: `data-${string}`]: any; -}; - -export type ComboBoxProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ComboBox extends SvelteComponentTyped< ComboBoxProps, { select: CustomEvent<{ - selectedId: ComboBoxItemId; + selectedId: string; + selectedIndex: number; selectedItem: ComboBoxItem; }>; - clear: CustomEvent; keydown: WindowEventMap["keydown"]; - keyup: WindowEventMap["keyup"]; focus: WindowEventMap["focus"]; blur: WindowEventMap["blur"]; - paste: WindowEventMap["paste"]; + clear: WindowEventMap["clear"]; scroll: WindowEventMap["scroll"]; }, - { default: { item: ComboBoxItem; index: number }; titleText: {} } -> { - /** - * Clear the combo box programmatically - */ - clear: (options?: { focus?: boolean }) => void; -} + {} +> {} diff --git a/types/ComposedModal/ComposedModal.svelte.d.ts b/types/ComposedModal/ComposedModal.d.ts similarity index 69% rename from types/ComposedModal/ComposedModal.svelte.d.ts rename to types/ComposedModal/ComposedModal.d.ts index bf5ed54f..821b0566 100644 --- a/types/ComposedModal/ComposedModal.svelte.d.ts +++ b/types/ComposedModal/ComposedModal.d.ts @@ -1,12 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ComposedModalProps + extends svelte.JSX.HTMLAttributes { /** * Set the size of the composed modal - * @default undefined */ size?: "xs" | "sm" | "lg"; @@ -45,25 +43,19 @@ type $Props = { * @default null */ ref?: null | HTMLDivElement; - - [key: `data-${string}`]: any; -}; - -export type ComposedModalProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ComposedModal extends SvelteComponentTyped< ComposedModalProps, { transitionend: CustomEvent<{ open: boolean }>; - keydown: WindowEventMap["keydown"]; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; - submit: CustomEvent; - ["click:button--primary"]: CustomEvent; - close: CustomEvent; - open: CustomEvent; + submit: CustomEvent; + close: CustomEvent; + open: CustomEvent; }, { default: {} } > {} diff --git a/types/ComposedModal/ModalBody.svelte.d.ts b/types/ComposedModal/ModalBody.d.ts similarity index 52% rename from types/ComposedModal/ModalBody.svelte.d.ts rename to types/ComposedModal/ModalBody.d.ts index ed9bccb5..c74d879e 100644 --- a/types/ComposedModal/ModalBody.svelte.d.ts +++ b/types/ComposedModal/ModalBody.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ModalBodyProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` if the modal contains form elements * @default false @@ -15,14 +14,10 @@ type $Props = { * @default false */ hasScrollingContent?: boolean; - - [key: `data-${string}`]: any; -}; - -export type ModalBodyProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ModalBody extends SvelteComponentTyped< ModalBodyProps, - Record, + {}, { default: {} } > {} diff --git a/types/ComposedModal/ModalFooter.d.ts b/types/ComposedModal/ModalFooter.d.ts new file mode 100644 index 00000000..8eb5a2c3 --- /dev/null +++ b/types/ComposedModal/ModalFooter.d.ts @@ -0,0 +1,45 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface ModalFooterProps + extends svelte.JSX.HTMLAttributes { + /** + * Specify the primary button text + * @default "" + */ + primaryButtonText?: string; + + /** + * Set to `true` to disable the primary button + * @default false + */ + primaryButtonDisabled?: boolean; + + /** + * Specify a class for the primary button + */ + primaryClass?: string; + + /** + * Specify the secondary button text + * @default "" + */ + secondaryButtonText?: string; + + /** + * Specify a class for the secondary button + */ + secondaryClass?: string; + + /** + * Set to `true` to use the danger variant + * @default false + */ + danger?: boolean; +} + +export default class ModalFooter extends SvelteComponentTyped< + ModalFooterProps, + {}, + { default: {} } +> {} diff --git a/types/ComposedModal/ModalFooter.svelte.d.ts b/types/ComposedModal/ModalFooter.svelte.d.ts deleted file mode 100644 index 8890c8a7..00000000 --- a/types/ComposedModal/ModalFooter.svelte.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - /** - * Specify the primary button text - * @default "" - */ - primaryButtonText?: string; - - /** - * Specify the primary button icon - * @default undefined - */ - primaryButtonIcon?: any; - - /** - * Set to `true` to disable the primary button - * @default false - */ - primaryButtonDisabled?: boolean; - - /** - * Specify a class for the primary button - * @default undefined - */ - primaryClass?: string; - - /** - * Specify the secondary button text - * @default "" - */ - secondaryButtonText?: string; - - /** - * 2-tuple prop to render two secondary buttons for a 3 button modal - * supersedes `secondaryButtonText` - * @default [] - */ - secondaryButtons?: [{ text: string }, { text: string }]; - - /** - * Specify a class for the secondary button - * @default undefined - */ - secondaryClass?: string; - - /** - * Set to `true` to use the danger variant - * @default false - */ - danger?: boolean; - - [key: `data-${string}`]: any; -}; - -export type ModalFooterProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class ModalFooter extends SvelteComponentTyped< - ModalFooterProps, - { ["click:button--secondary"]: CustomEvent<{ text: string }> }, - { default: {} } -> {} diff --git a/types/ComposedModal/ModalHeader.svelte.d.ts b/types/ComposedModal/ModalHeader.d.ts similarity index 72% rename from types/ComposedModal/ModalHeader.svelte.d.ts rename to types/ComposedModal/ModalHeader.d.ts index 9f8b2ca4..0dde3b49 100644 --- a/types/ComposedModal/ModalHeader.svelte.d.ts +++ b/types/ComposedModal/ModalHeader.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ModalHeaderProps + extends svelte.JSX.HTMLAttributes { /** * Specify the modal title * @default "" @@ -45,11 +44,7 @@ type $Props = { * @default "Close" */ iconDescription?: string; - - [key: `data-${string}`]: any; -}; - -export type ModalHeaderProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ModalHeader extends SvelteComponentTyped< ModalHeaderProps, diff --git a/types/ContentSwitcher/ContentSwitcher.svelte.d.ts b/types/ContentSwitcher/ContentSwitcher.d.ts similarity index 62% rename from types/ContentSwitcher/ContentSwitcher.svelte.d.ts rename to types/ContentSwitcher/ContentSwitcher.d.ts index 09a48ff3..21ffc6ae 100644 --- a/types/ContentSwitcher/ContentSwitcher.svelte.d.ts +++ b/types/ContentSwitcher/ContentSwitcher.d.ts @@ -1,25 +1,25 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ContentSwitcherProps + extends svelte.JSX.HTMLAttributes { /** * Set the selected index of the switch item * @default 0 */ selectedIndex?: number; + /** + * Set to `true` to enable the light variant + * @default false + */ + light?: boolean; + /** * Specify the size of the content switcher - * @default undefined */ size?: "sm" | "xl"; - - [key: `data-${string}`]: any; -}; - -export type ContentSwitcherProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ContentSwitcher extends SvelteComponentTyped< ContentSwitcherProps, diff --git a/types/ContentSwitcher/Switch.svelte.d.ts b/types/ContentSwitcher/Switch.d.ts similarity index 67% rename from types/ContentSwitcher/Switch.svelte.d.ts rename to types/ContentSwitcher/Switch.d.ts index cbe3114c..daefebea 100644 --- a/types/ContentSwitcher/Switch.svelte.d.ts +++ b/types/ContentSwitcher/Switch.d.ts @@ -1,12 +1,11 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["button"]; - -type $Props = { +export interface SwitchProps + extends svelte.JSX.HTMLAttributes { /** - * Specify the switch text. - * Alternatively, use the "text" slot (e.g., `...`) + * Specify the switch text + * Alternatively, use the "text" slot (e.g., ...) * @default "Provide text" */ text?: string; @@ -34,11 +33,7 @@ type $Props = { * @default null */ ref?: null | HTMLButtonElement; - - [key: `data-${string}`]: any; -}; - -export type SwitchProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Switch extends SvelteComponentTyped< SwitchProps, diff --git a/types/ContextMenu/ContextMenu.svelte.d.ts b/types/ContextMenu/ContextMenu.d.ts similarity index 52% rename from types/ContextMenu/ContextMenu.svelte.d.ts rename to types/ContextMenu/ContextMenu.d.ts index 6322cbda..17a4b547 100644 --- a/types/ContextMenu/ContextMenu.svelte.d.ts +++ b/types/ContextMenu/ContextMenu.d.ts @@ -1,16 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["ul"]; - -type $Props = { - /** - * Specify an element or list of elements to trigger the context menu. - * If no element is specified, the context menu applies to the entire window - * @default null - */ - target?: null | ReadonlyArray; +/// +import { SvelteComponentTyped } from "svelte"; +export interface ContextMenuProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to open the menu * Either `x` and `y` must be greater than zero @@ -35,19 +27,15 @@ type $Props = { * @default null */ ref?: null | HTMLUListElement; - - [key: `data-${string}`]: any; -}; - -export type ContextMenuProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ContextMenu extends SvelteComponentTyped< ContextMenuProps, { - open: CustomEvent; click: WindowEventMap["click"]; keydown: WindowEventMap["keydown"]; - close: CustomEvent; + open: CustomEvent; + close: CustomEvent; }, { default: {} } > {} diff --git a/types/ContextMenu/ContextMenuDivider.d.ts b/types/ContextMenu/ContextMenuDivider.d.ts new file mode 100644 index 00000000..24aa8ed7 --- /dev/null +++ b/types/ContextMenu/ContextMenuDivider.d.ts @@ -0,0 +1,10 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface ContextMenuDividerProps {} + +export default class ContextMenuDivider extends SvelteComponentTyped< + ContextMenuDividerProps, + {}, + {} +> {} diff --git a/types/ContextMenu/ContextMenuDivider.svelte.d.ts b/types/ContextMenu/ContextMenuDivider.svelte.d.ts deleted file mode 100644 index f2a34d39..00000000 --- a/types/ContextMenu/ContextMenuDivider.svelte.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; - -export type ContextMenuDividerProps = {}; - -export default class ContextMenuDivider extends SvelteComponentTyped< - ContextMenuDividerProps, - Record, - {} -> {} diff --git a/types/ContextMenu/ContextMenuGroup.svelte.d.ts b/types/ContextMenu/ContextMenuGroup.d.ts similarity index 59% rename from types/ContextMenu/ContextMenuGroup.svelte.d.ts rename to types/ContextMenu/ContextMenuGroup.d.ts index 895139ae..bbe0f5d3 100644 --- a/types/ContextMenu/ContextMenuGroup.svelte.d.ts +++ b/types/ContextMenu/ContextMenuGroup.d.ts @@ -1,20 +1,21 @@ -import type { SvelteComponentTyped } from "svelte"; +/// +import { SvelteComponentTyped } from "svelte"; -export type ContextMenuGroupProps = { +export interface ContextMenuGroupProps { /** * @default [] */ - selectedIds?: ReadonlyArray; + selectedIds?: string[]; /** * Specify the label text * @default "" */ labelText?: string; -}; +} export default class ContextMenuGroup extends SvelteComponentTyped< ContextMenuGroupProps, - Record, + {}, { default: {} } > {} diff --git a/types/ContextMenu/ContextMenuOption.svelte.d.ts b/types/ContextMenu/ContextMenuOption.d.ts similarity index 65% rename from types/ContextMenu/ContextMenuOption.svelte.d.ts rename to types/ContextMenu/ContextMenuOption.d.ts index 3082a4b2..67a1cf04 100644 --- a/types/ContextMenu/ContextMenuOption.svelte.d.ts +++ b/types/ContextMenu/ContextMenuOption.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["li"]; - -type $Props = { +export interface ContextMenuOptionProps + extends svelte.JSX.HTMLAttributes { /** * Specify the kind of option * @default "default" @@ -23,15 +22,14 @@ type $Props = { indented?: boolean; /** - * Specify the icon to render + * Specify the icon from `carbon-icons-svelte` to render * Icon is rendered to the left of the label text - * @default undefined */ - icon?: any; + icon?: typeof import("carbon-icons-svelte").CarbonIcon; /** - * Specify the label text. - * Alternatively, use the "labelText" slot (e.g., `...`) + * Specify the label text + * Alternatively, use the "labelText" slot (e.g., ...) * @default "" */ labelText?: string; @@ -50,8 +48,8 @@ type $Props = { selectable?: boolean; /** - * Specify the shortcut text. - * Alternatively, use the "shortcutText" slot (e.g., `...`) + * Specify the shortcut text + * Alternatively, use the "shortcutText" slot (e.g., ...) * @default "" */ shortcutText?: string; @@ -68,11 +66,7 @@ type $Props = { * @default null */ ref?: null | HTMLLIElement; - - [key: `data-${string}`]: any; -}; - -export type ContextMenuOptionProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ContextMenuOption extends SvelteComponentTyped< ContextMenuOptionProps, @@ -80,7 +74,7 @@ export default class ContextMenuOption extends SvelteComponentTyped< keydown: WindowEventMap["keydown"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; - click: CustomEvent; + click: CustomEvent; }, - { default: {}; icon: {}; labelText: {}; shortcutText: {} } + { default: {}; labelText: {}; shortcutText: {} } > {} diff --git a/types/ContextMenu/ContextMenuRadioGroup.svelte.d.ts b/types/ContextMenu/ContextMenuRadioGroup.d.ts similarity index 68% rename from types/ContextMenu/ContextMenuRadioGroup.svelte.d.ts rename to types/ContextMenu/ContextMenuRadioGroup.d.ts index dac0c5d4..8ea1c9a7 100644 --- a/types/ContextMenu/ContextMenuRadioGroup.svelte.d.ts +++ b/types/ContextMenu/ContextMenuRadioGroup.d.ts @@ -1,6 +1,7 @@ -import type { SvelteComponentTyped } from "svelte"; +/// +import { SvelteComponentTyped } from "svelte"; -export type ContextMenuRadioGroupProps = { +export interface ContextMenuRadioGroupProps { /** * Set the selected radio group id * @default "" @@ -12,10 +13,10 @@ export type ContextMenuRadioGroupProps = { * @default "" */ labelText?: string; -}; +} export default class ContextMenuRadioGroup extends SvelteComponentTyped< ContextMenuRadioGroupProps, - Record, + {}, { default: {} } > {} diff --git a/types/Copy/Copy.d.ts b/types/Copy/Copy.d.ts new file mode 100644 index 00000000..7bad0687 --- /dev/null +++ b/types/Copy/Copy.d.ts @@ -0,0 +1,32 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface CopyProps + extends svelte.JSX.HTMLAttributes { + /** + * Set the feedback text shown after clicking the button + * @default "Copied!" + */ + feedback?: string; + + /** + * Set the timeout duration (ms) to display feedback text + * @default 2000 + */ + feedbackTimeout?: number; + + /** + * Obtain a reference to the button HTML element + * @default null + */ + ref?: null | HTMLButtonElement; +} + +export default class Copy extends SvelteComponentTyped< + CopyProps, + { + click: WindowEventMap["click"]; + animationend: WindowEventMap["animationend"]; + }, + { default: {} } +> {} diff --git a/types/CopyButton/CopyButton.d.ts b/types/CopyButton/CopyButton.d.ts new file mode 100644 index 00000000..fed3e37a --- /dev/null +++ b/types/CopyButton/CopyButton.d.ts @@ -0,0 +1,26 @@ +/// +import { SvelteComponentTyped } from "svelte"; +import { CopyProps } from "../Copy/Copy"; + +export interface CopyButtonProps extends CopyProps { + /** + * Set the title and ARIA label for the copy button + * @default "Copy to clipboard" + */ + iconDescription?: string; + + /** + * Specify the text to copy + */ + text?: string; +} + +export default class CopyButton extends SvelteComponentTyped< + CopyButtonProps, + { + click: WindowEventMap["click"]; + animationend: WindowEventMap["animationend"]; + copy: CustomEvent; + }, + {} +> {} diff --git a/types/CopyButton/CopyButton.svelte.d.ts b/types/CopyButton/CopyButton.svelte.d.ts deleted file mode 100644 index c0319f9d..00000000 --- a/types/CopyButton/CopyButton.svelte.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["button"]; - -type $Props = { - /** - * Set the feedback text shown after clicking the button - * @default "Copied!" - */ - feedback?: string; - - /** - * Set the timeout duration (ms) to display feedback text - * @default 2000 - */ - feedbackTimeout?: number; - - /** - * Set the title and ARIA label for the copy button - * @default "Copy to clipboard" - */ - iconDescription?: string; - - /** - * Specify the text to copy - * @default undefined - */ - text: string; - - /** - * Override the default copy behavior of using the navigator.clipboard.writeText API to copy text - * @default async (text) => { try { await navigator.clipboard.writeText(text); } catch (e) { console.log(e); } } - */ - copy?: (text: string) => void; - - [key: `data-${string}`]: any; -}; - -export type CopyButtonProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class CopyButton extends SvelteComponentTyped< - CopyButtonProps, - { - click: WindowEventMap["click"]; - animationend: WindowEventMap["animationend"]; - copy: CustomEvent; - }, - {} -> {} diff --git a/types/DataTable/DataTable.d.ts b/types/DataTable/DataTable.d.ts new file mode 100644 index 00000000..66812d6a --- /dev/null +++ b/types/DataTable/DataTable.d.ts @@ -0,0 +1,161 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export type DataTableKey = string; + +export type DataTableValue = any; + +export interface DataTableEmptyHeader { + key: DataTableKey; + empty: boolean; + display?: (item: Value) => DataTableValue; + sort?: false | ((a: DataTableValue, b: DataTableValue) => 0 | -1 | 1); + columnMenu?: boolean; +} + +export interface DataTableNonEmptyHeader { + key: DataTableKey; + value: DataTableValue; + display?: (item: Value) => DataTableValue; + sort?: false | ((a: DataTableValue, b: DataTableValue) => 0 | -1 | 1); + columnMenu?: boolean; +} + +export type DataTableHeader = DataTableNonEmptyHeader | DataTableEmptyHeader; + +export interface DataTableRow { + id: any; + [key: string]: DataTableValue; +} + +export type DataTableRowId = string; + +export interface DataTableCell { + key: DataTableKey; + value: DataTableValue; +} + +export interface DataTableProps + extends svelte.JSX.HTMLAttributes { + /** + * Specify the data table headers + * @default [] + */ + headers?: DataTableHeader[]; + + /** + * Specify the rows the data table should render + * keys defined in `headers` are used for the row ids + * @default [] + */ + rows?: DataTableRow[]; + + /** + * Set the size of the data table + */ + size?: "compact" | "short" | "tall"; + + /** + * Specify the title of the data table + * @default "" + */ + title?: string; + + /** + * Specify the description of the data table + * @default "" + */ + description?: string; + + /** + * Set to `true` to use zebra styles + * @default false + */ + zebra?: boolean; + + /** + * Set to `true` for the sortable variant + * @default false + */ + sortable?: boolean; + + /** + * Set to `true` for the expandable variant + * Automatically set to `true` if `batchExpansion` is `true` + * @default false + */ + expandable?: boolean; + + /** + * Set to `true` to enable batch expansion + * @default false + */ + batchExpansion?: boolean; + + /** + * Specify the row ids to be expanded + * @default [] + */ + expandedRowIds?: DataTableRowId[]; + + /** + * Set to `true` for the radio selection variant + * @default false + */ + radio?: boolean; + + /** + * Set to `true` for the selectable variant + * Automatically set to `true` if `radio` or `batchSelection` are `true` + * @default false + */ + selectable?: boolean; + + /** + * Set to `true` to enable batch selection + * @default false + */ + batchSelection?: boolean; + + /** + * Specify the row ids to be selected + * @default [] + */ + selectedRowIds?: DataTableRowId[]; + + /** + * Set to `true` to enable a sticky header + * @default false + */ + stickyHeader?: boolean; +} + +export default class DataTable extends SvelteComponentTyped< + DataTableProps, + { + click: CustomEvent<{ + header?: DataTableHeader; + row?: DataTableRow; + cell?: DataTableCell; + }>; + ["click:header--expand"]: CustomEvent<{ expanded: boolean }>; + ["click:header"]: CustomEvent<{ + header: DataTableHeader; + sortDirection?: "ascending" | "descending" | "none"; + }>; + ["click:row"]: CustomEvent; + ["mouseenter:row"]: CustomEvent; + ["mouseleave:row"]: CustomEvent; + ["click:row--expand"]: CustomEvent<{ + expanded: boolean; + row: DataTableRow; + }>; + ["click:cell"]: CustomEvent; + }, + { + default: {}; + cell: { row: DataTableRow; cell: DataTableCell }; + ["cell-header"]: { header: DataTableNonEmptyHeader }; + ["expanded-row"]: { row: DataTableRow }; + } +> {} diff --git a/types/DataTable/DataTable.svelte.d.ts b/types/DataTable/DataTable.svelte.d.ts deleted file mode 100644 index d5914a02..00000000 --- a/types/DataTable/DataTable.svelte.d.ts +++ /dev/null @@ -1,238 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -export type DataTableKey = - import("./DataTableTypes.d.ts").PropertyPath; - -export type DataTableValue = any; - -export interface DataTableEmptyHeader { - key: DataTableKey | (string & {}); - empty: boolean; - display?: (item: DataTableValue, row: Row) => DataTableValue; - sort?: false | ((a: DataTableValue, b: DataTableValue) => number); - columnMenu?: boolean; - width?: string; - minWidth?: string; -} - -export interface DataTableNonEmptyHeader { - key: DataTableKey; - value: DataTableValue; - display?: (item: DataTableValue, row: Row) => DataTableValue; - sort?: false | ((a: DataTableValue, b: DataTableValue) => number); - columnMenu?: boolean; - width?: string; - minWidth?: string; -} - -export type DataTableHeader = - | DataTableNonEmptyHeader - | DataTableEmptyHeader; - -export interface DataTableRow { - id: any; - [key: string]: DataTableValue; -} - -export type DataTableRowId = any; - -export interface DataTableCell { - key: DataTableKey | (string & {}); - value: DataTableValue; - display?: (item: DataTableValue, row: DataTableRow) => DataTableValue; -} - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - /** - * Specify the data table headers - * @default [] - */ - headers?: ReadonlyArray>; - - /** - * Specify the rows the data table should render - * keys defined in `headers` are used for the row ids - * @default [] - */ - rows?: ReadonlyArray; - - /** - * Set the size of the data table - * @default undefined - */ - size?: "compact" | "short" | "medium" | "tall"; - - /** - * Specify the title of the data table - * @default "" - */ - title?: string; - - /** - * Specify the description of the data table - * @default "" - */ - description?: string; - - /** - * Specify a name attribute for the input elements - * in a selectable data table (radio or checkbox). - * When the table is inside a form, this name will - * be included in the form data on submit. - * @default "ccs-" + Math.random().toString(36) - */ - inputName?: string; - - /** - * Set to `true` to use zebra styles - * @default false - */ - zebra?: boolean; - - /** - * Set to `true` for the sortable variant - * @default false - */ - sortable?: boolean; - - /** - * Specify the header key to sort by - * @default null - */ - sortKey?: DataTableKey; - - /** - * Specify the sort direction - * @default "none" - */ - sortDirection?: "none" | "ascending" | "descending"; - - /** - * Set to `true` for the expandable variant - * Automatically set to `true` if `batchExpansion` is `true` - * @default false - */ - expandable?: boolean; - - /** - * Set to `true` to enable batch expansion - * @default false - */ - batchExpansion?: boolean; - - /** - * Specify the row ids to be expanded - * @default [] - */ - expandedRowIds?: ReadonlyArray; - - /** - * Specify the ids for rows that should not be expandable - * @default [] - */ - nonExpandableRowIds?: ReadonlyArray; - - /** - * Set to `true` for the radio selection variant - * @default false - */ - radio?: boolean; - - /** - * Set to `true` for the selectable variant - * Automatically set to `true` if `radio` or `batchSelection` are `true` - * @default false - */ - selectable?: boolean; - - /** - * Set to `true` to enable batch selection - * @default false - */ - batchSelection?: boolean; - - /** - * Specify the row ids to be selected - * @default [] - */ - selectedRowIds?: ReadonlyArray; - - /** - * Specify the ids of rows that should not be selectable - * @default [] - */ - nonSelectableRowIds?: ReadonlyArray; - - /** - * Set to `true` to enable a sticky header - * @default false - */ - stickyHeader?: boolean; - - /** - * Set to `true` to use static width - * @default false - */ - useStaticWidth?: boolean; - - /** - * Specify the number of items to display in a page - * @default 0 - */ - pageSize?: number; - - /** - * Set to `number` to set current page - * @default 0 - */ - page?: number; - - [key: `data-${string}`]: any; -}; - -export type DataTableProps = Omit<$RestProps, keyof $Props> & - $Props; - -export default class DataTable< - Row extends DataTableRow = DataTableRow, -> extends SvelteComponentTyped< - DataTableProps, - { - click: CustomEvent<{ - header?: DataTableHeader; - row?: Row; - cell?: DataTableCell; - }>; - ["click:header--expand"]: CustomEvent<{ expanded: boolean }>; - ["click:header"]: CustomEvent<{ - header: DataTableHeader; - sortDirection?: "ascending" | "descending" | "none"; - }>; - ["click:header--select"]: CustomEvent<{ - indeterminate: boolean; - selected: boolean; - }>; - ["click:row"]: CustomEvent; - ["mouseenter:row"]: CustomEvent; - ["mouseleave:row"]: CustomEvent; - ["click:row--expand"]: CustomEvent<{ expanded: boolean; row: Row }>; - ["click:row--select"]: CustomEvent<{ selected: boolean; row: Row }>; - ["click:cell"]: CustomEvent>; - }, - { - default: {}; - cell: { - row: Row; - cell: DataTableCell; - rowIndex: number; - cellIndex: number; - }; - ["cell-header"]: { header: DataTableNonEmptyHeader }; - description: {}; - ["expanded-row"]: { row: Row }; - title: {}; - } -> {} diff --git a/types/DataTable/DataTableSkeleton.svelte.d.ts b/types/DataTable/DataTableSkeleton.d.ts similarity index 70% rename from types/DataTable/DataTableSkeleton.svelte.d.ts rename to types/DataTable/DataTableSkeleton.d.ts index 1ace782e..0cf4fc55 100644 --- a/types/DataTable/DataTableSkeleton.svelte.d.ts +++ b/types/DataTable/DataTableSkeleton.d.ts @@ -1,11 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; +import { DataTableHeader } from "./DataTable"; -import type { DataTableHeader } from "./DataTable.svelte"; - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface DataTableSkeletonProps + extends DataTableHeader, + svelte.JSX.HTMLAttributes { /** * Specify the number of columns * Superseded by `headers` if `headers` is a non-empty array @@ -21,7 +20,6 @@ type $Props = { /** * Set the size of the data table - * @default undefined */ size?: "compact" | "short" | "tall"; @@ -42,18 +40,14 @@ type $Props = { * Supersedes `columns` if value is a non-empty array * @default [] */ - headers?: ReadonlyArray>; + headers?: string[] | Partial[]; /** * Set to `false` to hide the toolbar * @default true */ showToolbar?: boolean; - - [key: `data-${string}`]: any; -}; - -export type DataTableSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class DataTableSkeleton extends SvelteComponentTyped< DataTableSkeletonProps, diff --git a/types/DataTable/DataTableTypes.d.ts b/types/DataTable/DataTableTypes.d.ts deleted file mode 100644 index c7c8c589..00000000 --- a/types/DataTable/DataTableTypes.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -type PathDepth = [never, 0, 1, 2, ...0[]]; - -type Join = K extends string | number - ? P extends string | number - ? `${K}${"" extends P ? "" : "."}${P}` - : never - : never; - -// For performance, the maximum traversal depth is 10. -export type PropertyPath = [D] extends [never] - ? never - : T extends object - ? { - [K in keyof T]-?: K extends string | number - ? `${K}` | Join> - : never; - }[keyof T] - : ""; diff --git a/types/DataTable/Table.svelte.d.ts b/types/DataTable/Table.d.ts similarity index 53% rename from types/DataTable/Table.svelte.d.ts rename to types/DataTable/Table.d.ts index c8621f5a..6e9cf0de 100644 --- a/types/DataTable/Table.svelte.d.ts +++ b/types/DataTable/Table.d.ts @@ -1,14 +1,12 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["section"]; - -type $Props = { +export interface TableProps + extends svelte.JSX.HTMLAttributes { /** * Set the size of the table - * @default undefined */ - size?: "compact" | "short" | "medium" | "tall"; + size?: "compact" | "short" | "tall"; /** * Set to `true` to use zebra styles @@ -22,6 +20,12 @@ type $Props = { */ useStaticWidth?: boolean; + /** + * Set to `true` for the bordered variant + * @default false + */ + shouldShowBorder?: boolean; + /** * Set to `true` for the sortable variant * @default false @@ -33,20 +37,10 @@ type $Props = { * @default false */ stickyHeader?: boolean; - - /** - * Set the style attribute on the `table` element - * @default undefined - */ - tableStyle?: string; - - [key: `data-${string}`]: any; -}; - -export type TableProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Table extends SvelteComponentTyped< TableProps, - Record, + {}, { default: {} } > {} diff --git a/types/DataTable/TableBody.d.ts b/types/DataTable/TableBody.d.ts new file mode 100644 index 00000000..7737f2a4 --- /dev/null +++ b/types/DataTable/TableBody.d.ts @@ -0,0 +1,11 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface TableBodyProps + extends svelte.JSX.HTMLAttributes {} + +export default class TableBody extends SvelteComponentTyped< + TableBodyProps, + {}, + { default: {} } +> {} diff --git a/types/DataTable/TableBody.svelte.d.ts b/types/DataTable/TableBody.svelte.d.ts deleted file mode 100644 index a9a060bb..00000000 --- a/types/DataTable/TableBody.svelte.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["tbody"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type TableBodyProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class TableBody extends SvelteComponentTyped< - TableBodyProps, - Record, - { default: {} } -> {} diff --git a/types/DataTable/TableCell.svelte.d.ts b/types/DataTable/TableCell.d.ts similarity index 50% rename from types/DataTable/TableCell.svelte.d.ts rename to types/DataTable/TableCell.d.ts index db31dbac..1aa1de31 100644 --- a/types/DataTable/TableCell.svelte.d.ts +++ b/types/DataTable/TableCell.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["td"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type TableCellProps = Omit<$RestProps, keyof $Props> & $Props; +export interface TableCellProps + extends svelte.JSX.HTMLAttributes {} export default class TableCell extends SvelteComponentTyped< TableCellProps, diff --git a/types/DataTable/TableContainer.d.ts b/types/DataTable/TableContainer.d.ts new file mode 100644 index 00000000..bcdeed1c --- /dev/null +++ b/types/DataTable/TableContainer.d.ts @@ -0,0 +1,29 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface TableContainerProps + extends svelte.JSX.HTMLAttributes { + /** + * Specify the title of the data table + * @default "" + */ + title?: string; + + /** + * Specify the description of the data table + * @default "" + */ + description?: string; + + /** + * Set to `true` to enable a sticky header + * @default false + */ + stickyHeader?: boolean; +} + +export default class TableContainer extends SvelteComponentTyped< + TableContainerProps, + {}, + { default: {} } +> {} diff --git a/types/DataTable/TableContainer.svelte.d.ts b/types/DataTable/TableContainer.svelte.d.ts deleted file mode 100644 index 09382e23..00000000 --- a/types/DataTable/TableContainer.svelte.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - /** - * Specify the title of the data table - * @default "" - */ - title?: string; - - /** - * Specify the description of the data table - * @default "" - */ - description?: string; - - /** - * Set to `true` to enable a sticky header - * @default false - */ - stickyHeader?: boolean; - - /** - * Set to `true` to use static width - * @default false - */ - useStaticWidth?: boolean; - - [key: `data-${string}`]: any; -}; - -export type TableContainerProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class TableContainer extends SvelteComponentTyped< - TableContainerProps, - Record, - { default: {} } -> {} diff --git a/types/DataTable/TableHead.svelte.d.ts b/types/DataTable/TableHead.d.ts similarity index 50% rename from types/DataTable/TableHead.svelte.d.ts rename to types/DataTable/TableHead.d.ts index b7be26dc..3dd59ca6 100644 --- a/types/DataTable/TableHead.svelte.d.ts +++ b/types/DataTable/TableHead.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["thead"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type TableHeadProps = Omit<$RestProps, keyof $Props> & $Props; +export interface TableHeadProps + extends svelte.JSX.HTMLAttributes {} export default class TableHead extends SvelteComponentTyped< TableHeadProps, diff --git a/types/DataTable/TableHeader.svelte.d.ts b/types/DataTable/TableHeader.d.ts similarity index 53% rename from types/DataTable/TableHeader.svelte.d.ts rename to types/DataTable/TableHeader.d.ts index b0dd2925..70926487 100644 --- a/types/DataTable/TableHeader.svelte.d.ts +++ b/types/DataTable/TableHeader.d.ts @@ -1,26 +1,13 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["th"]; - -type $Props = { +export interface TableHeaderProps + extends svelte.JSX.HTMLAttributes { /** - * Set to `true` for the sortable variant + * Set to `true` to disable sorting on this specific cell * @default false */ - sortable?: boolean; - - /** - * Specify the sort direction - * @default "none" - */ - sortDirection?: "none" | "ascending" | "descending"; - - /** - * Set to `true` if the column sorting - * @default false - */ - active?: boolean; + disableSorting?: boolean; /** * Specify the `scope` attribute @@ -39,11 +26,7 @@ type $Props = { * @default "ccs-" + Math.random().toString(36) */ id?: string; - - [key: `data-${string}`]: any; -}; - -export type TableHeaderProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TableHeader extends SvelteComponentTyped< TableHeaderProps, diff --git a/types/DataTable/TableRow.svelte.d.ts b/types/DataTable/TableRow.d.ts similarity index 50% rename from types/DataTable/TableRow.svelte.d.ts rename to types/DataTable/TableRow.d.ts index f4b30b83..e88c052a 100644 --- a/types/DataTable/TableRow.svelte.d.ts +++ b/types/DataTable/TableRow.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["tr"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type TableRowProps = Omit<$RestProps, keyof $Props> & $Props; +export interface TableRowProps + extends svelte.JSX.HTMLAttributes {} export default class TableRow extends SvelteComponentTyped< TableRowProps, diff --git a/types/DataTable/Toolbar.d.ts b/types/DataTable/Toolbar.d.ts new file mode 100644 index 00000000..32e59fc8 --- /dev/null +++ b/types/DataTable/Toolbar.d.ts @@ -0,0 +1,17 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface ToolbarProps + extends svelte.JSX.HTMLAttributes { + /** + * Specify the toolbar size + * @default "default" + */ + size?: "sm" | "default"; +} + +export default class Toolbar extends SvelteComponentTyped< + ToolbarProps, + {}, + { default: {} } +> {} diff --git a/types/DataTable/Toolbar.svelte.d.ts b/types/DataTable/Toolbar.svelte.d.ts deleted file mode 100644 index e70e1955..00000000 --- a/types/DataTable/Toolbar.svelte.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["section"]; - -type $Props = { - /** - * Specify the toolbar size - * @default "default" - */ - size?: "sm" | "default"; - - [key: `data-${string}`]: any; -}; - -export type ToolbarProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class Toolbar extends SvelteComponentTyped< - ToolbarProps, - Record, - { default: {} } -> {} diff --git a/types/DataTable/ToolbarBatchActions.d.ts b/types/DataTable/ToolbarBatchActions.d.ts new file mode 100644 index 00000000..e046a567 --- /dev/null +++ b/types/DataTable/ToolbarBatchActions.d.ts @@ -0,0 +1,17 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface ToolbarBatchActionsProps + extends svelte.JSX.HTMLAttributes { + /** + * Override the total items selected text + * @default (totalSelected) => `${totalSelected} item${totalSelected === 1 ? "" : "s"} selected` + */ + formatTotalSelected?: (totalSelected: number) => string; +} + +export default class ToolbarBatchActions extends SvelteComponentTyped< + ToolbarBatchActionsProps, + {}, + { default: {} } +> {} diff --git a/types/DataTable/ToolbarBatchActions.svelte.d.ts b/types/DataTable/ToolbarBatchActions.svelte.d.ts deleted file mode 100644 index 109466dd..00000000 --- a/types/DataTable/ToolbarBatchActions.svelte.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - /** - * Override the total items selected text - * @default (totalSelected) => `${totalSelected} item${totalSelected === 1 ? "" : "s"} selected` - */ - formatTotalSelected?: (totalSelected: number) => string; - - /** - * Use a boolean to show or hide the toolbar - * @default undefined - */ - active?: undefined | boolean; - - [key: `data-${string}`]: any; -}; - -export type ToolbarBatchActionsProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class ToolbarBatchActions extends SvelteComponentTyped< - ToolbarBatchActionsProps, - { cancel: CustomEvent }, - { default: {}; cancel: {} } -> {} diff --git a/types/DataTable/ToolbarContent.d.ts b/types/DataTable/ToolbarContent.d.ts new file mode 100644 index 00000000..ee8bb0a6 --- /dev/null +++ b/types/DataTable/ToolbarContent.d.ts @@ -0,0 +1,10 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface ToolbarContentProps {} + +export default class ToolbarContent extends SvelteComponentTyped< + ToolbarContentProps, + {}, + { default: {} } +> {} diff --git a/types/DataTable/ToolbarContent.svelte.d.ts b/types/DataTable/ToolbarContent.svelte.d.ts deleted file mode 100644 index de27dc36..00000000 --- a/types/DataTable/ToolbarContent.svelte.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; - -export type ToolbarContentProps = {}; - -export default class ToolbarContent extends SvelteComponentTyped< - ToolbarContentProps, - Record, - { default: {} } -> {} diff --git a/types/DataTable/ToolbarMenu.d.ts b/types/DataTable/ToolbarMenu.d.ts new file mode 100644 index 00000000..69daebf1 --- /dev/null +++ b/types/DataTable/ToolbarMenu.d.ts @@ -0,0 +1,11 @@ +/// +import { SvelteComponentTyped } from "svelte"; +import { OverflowMenuProps } from "../OverflowMenu/OverflowMenu"; + +export interface ToolbarMenuProps extends OverflowMenuProps {} + +export default class ToolbarMenu extends SvelteComponentTyped< + ToolbarMenuProps, + {}, + { default: {} } +> {} diff --git a/types/DataTable/ToolbarMenu.svelte.d.ts b/types/DataTable/ToolbarMenu.svelte.d.ts deleted file mode 100644 index 564df6fb..00000000 --- a/types/DataTable/ToolbarMenu.svelte.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { OverflowMenuProps } from "../OverflowMenu/OverflowMenu.svelte"; - -export type ToolbarMenuProps = OverflowMenuProps & {}; - -export default class ToolbarMenu extends SvelteComponentTyped< - ToolbarMenuProps, - Record, - { default: {} } -> {} diff --git a/types/DataTable/ToolbarMenuItem.d.ts b/types/DataTable/ToolbarMenuItem.d.ts new file mode 100644 index 00000000..7c0bf533 --- /dev/null +++ b/types/DataTable/ToolbarMenuItem.d.ts @@ -0,0 +1,11 @@ +/// +import { SvelteComponentTyped } from "svelte"; +import { OverflowMenuItemProps } from "../OverflowMenu/OverflowMenuItem"; + +export interface ToolbarMenuItemProps extends OverflowMenuItemProps {} + +export default class ToolbarMenuItem extends SvelteComponentTyped< + ToolbarMenuItemProps, + { click: WindowEventMap["click"]; keydown: WindowEventMap["keydown"] }, + { default: {} } +> {} diff --git a/types/DataTable/ToolbarMenuItem.svelte.d.ts b/types/DataTable/ToolbarMenuItem.svelte.d.ts deleted file mode 100644 index cf55221d..00000000 --- a/types/DataTable/ToolbarMenuItem.svelte.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { OverflowMenuItemProps } from "../OverflowMenu/OverflowMenuItem.svelte"; - -export type ToolbarMenuItemProps = OverflowMenuItemProps & {}; - -export default class ToolbarMenuItem extends SvelteComponentTyped< - ToolbarMenuItemProps, - { click: WindowEventMap["click"]; keydown: WindowEventMap["keydown"] }, - { default: {} } -> {} diff --git a/types/DataTable/ToolbarSearch.d.ts b/types/DataTable/ToolbarSearch.d.ts new file mode 100644 index 00000000..2532d644 --- /dev/null +++ b/types/DataTable/ToolbarSearch.d.ts @@ -0,0 +1,52 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface ToolbarSearchProps { + /** + * Specify the value of the search input + * @default "" + */ + value?: number | string; + + /** + * Set to `true` to expand the search bar + * @default false + */ + expanded?: boolean; + + /** + * Set to `true` to keep the search bar expanded + * @default false + */ + persistent?: boolean; + + /** + * Set to `true` to disable the search bar + * @default false + */ + disabled?: boolean; + + /** + * Specify the tabindex + * @default "0" + */ + tabindex?: string; + + /** + * Obtain a reference to the input HTML element + * @default null + */ + ref?: null | HTMLInputElement; +} + +export default class ToolbarSearch extends SvelteComponentTyped< + ToolbarSearchProps, + { + clear: WindowEventMap["clear"]; + change: WindowEventMap["change"]; + input: WindowEventMap["input"]; + focus: WindowEventMap["focus"]; + blur: WindowEventMap["blur"]; + }, + {} +> {} diff --git a/types/DataTable/ToolbarSearch.svelte.d.ts b/types/DataTable/ToolbarSearch.svelte.d.ts deleted file mode 100644 index 76097753..00000000 --- a/types/DataTable/ToolbarSearch.svelte.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { - /** - * Specify the value of the search input - * @default "" - */ - value?: number | string; - - /** - * Set to `true` to expand the search bar - * @default false - */ - expanded?: boolean; - - /** - * Set to `true` to keep the search bar expanded - * @default false - */ - persistent?: boolean; - - /** - * Set to `true` to disable the search bar - * @default false - */ - disabled?: boolean; - - /** - * Set to `true` to filter table rows using the search value. - * - * If `true`, the default search excludes `id`, `cells` fields and - * only does a basic comparison on string and number type cell values. - * - * To implement your own client-side filtering, pass a function - * that accepts a row and value and returns a boolean. - * @default false - */ - shouldFilterRows?: - | boolean - | (( - row: import("./DataTable.svelte").DataTableRow, - value: number | string, - ) => boolean); - - /** - * The filtered row ids - * @default [] - */ - filteredRowIds?: ReadonlyArray; - - /** - * Specify the tabindex - * @default "0" - */ - tabindex?: string; - - /** - * Obtain a reference to the input HTML element - * @default null - */ - ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type ToolbarSearchProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class ToolbarSearch extends SvelteComponentTyped< - ToolbarSearchProps, - { - clear: CustomEvent; - change: WindowEventMap["change"]; - input: WindowEventMap["input"]; - focus: WindowEventMap["focus"]; - blur: WindowEventMap["blur"]; - keyup: WindowEventMap["keyup"]; - keydown: WindowEventMap["keydown"]; - paste: WindowEventMap["paste"]; - }, - {} -> {} diff --git a/types/DatePicker/DatePicker.svelte.d.ts b/types/DatePicker/DatePicker.d.ts similarity index 51% rename from types/DatePicker/DatePicker.svelte.d.ts rename to types/DatePicker/DatePicker.d.ts index 6ce1c818..1ea59415 100644 --- a/types/DatePicker/DatePicker.svelte.d.ts +++ b/types/DatePicker/DatePicker.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface DatePickerProps + extends svelte.JSX.HTMLAttributes { /** * Specify the date picker type * @default "simple" @@ -17,18 +16,9 @@ type $Props = { value?: number | string; /** - * Specify the date picker start date value (from) - * Only works with the "range" date picker type - * @default "" + * Specify the element to append the calendar to */ - valueFrom?: string; - - /** - * Specify the date picker end date value (to) - * Only works with the "range" date picker type - * @default "" - */ - valueTo?: string; + appendTo?: HTMLElement; /** * Specify the date format @@ -52,9 +42,7 @@ type $Props = { * Specify the locale * @default "en" */ - locale?: - | import("flatpickr/dist/types/locale").CustomLocale - | import("flatpickr/dist/types/locale").key; + locale?: string; /** * Set to `true` to use the short variant @@ -73,33 +61,16 @@ type $Props = { * @default "ccs-" + Math.random().toString(36) */ id?: string; - - /** - * Override the options passed to the Flatpickr instance. - * @see https://flatpickr.js.org/options - * @default { static: true } - */ - flatpickrProps?: import("flatpickr/dist/types/options").Options; - - [key: `data-${string}`]: any; -}; - -export type DatePickerProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class DatePicker extends SvelteComponentTyped< DatePickerProps, { - change: CustomEvent< - | string - | { - selectedDates: [dateFrom: Date, dateTo?: Date]; - dateStr: string | { from: string; to: string }; - } - >; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; + change: CustomEvent; }, { default: {} } > {} diff --git a/types/DatePicker/DatePickerInput.svelte.d.ts b/types/DatePicker/DatePickerInput.d.ts similarity index 76% rename from types/DatePicker/DatePickerInput.svelte.d.ts rename to types/DatePicker/DatePickerInput.d.ts index bf45d72c..1a6c24d1 100644 --- a/types/DatePicker/DatePickerInput.svelte.d.ts +++ b/types/DatePicker/DatePickerInput.d.ts @@ -1,12 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface DatePickerInputProps + extends svelte.JSX.HTMLAttributes { /** * Set the size of the input - * @default undefined */ size?: "sm" | "xl"; @@ -34,12 +32,6 @@ type $Props = { */ disabled?: boolean; - /** - * Specify the helper text - * @default "" - */ - helperText?: string; - /** * Specify the ARIA label for the calendar icon * @default "" @@ -90,7 +82,6 @@ type $Props = { /** * Set a name for the input element - * @default undefined */ name?: string; @@ -99,20 +90,14 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type DatePickerInputProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class DatePickerInput extends SvelteComponentTyped< DatePickerInputProps, { input: WindowEventMap["input"]; keydown: WindowEventMap["keydown"]; - keyup: WindowEventMap["keyup"]; blur: WindowEventMap["blur"]; - paste: WindowEventMap["paste"]; }, - { labelText: {} } + {} > {} diff --git a/types/DatePicker/DatePickerSkeleton.svelte.d.ts b/types/DatePicker/DatePickerSkeleton.d.ts similarity index 63% rename from types/DatePicker/DatePickerSkeleton.svelte.d.ts rename to types/DatePicker/DatePickerSkeleton.d.ts index d8ed10c8..bae0692e 100644 --- a/types/DatePicker/DatePickerSkeleton.svelte.d.ts +++ b/types/DatePicker/DatePickerSkeleton.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface DatePickerSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to use the range variant * @default false @@ -15,11 +14,7 @@ type $Props = { * @default "ccs-" + Math.random().toString(36) */ id?: string; - - [key: `data-${string}`]: any; -}; - -export type DatePickerSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class DatePickerSkeleton extends SvelteComponentTyped< DatePickerSkeletonProps, diff --git a/types/Dropdown/Dropdown.svelte.d.ts b/types/Dropdown/Dropdown.d.ts similarity index 71% rename from types/Dropdown/Dropdown.svelte.d.ts rename to types/Dropdown/Dropdown.d.ts index a9b37305..91afec2e 100644 --- a/types/Dropdown/Dropdown.svelte.d.ts +++ b/types/Dropdown/Dropdown.d.ts @@ -1,24 +1,22 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -export type DropdownItemId = any; +export type DropdownItemId = string; export type DropdownItemText = string; export interface DropdownItem { id: DropdownItemId; text: DropdownItemText; - disabled?: boolean; } -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface DropdownProps + extends svelte.JSX.HTMLAttributes { /** * Set the dropdown items * @default [] */ - items?: ReadonlyArray; + items?: DropdownItem[]; /** * Override the display of a dropdown item @@ -27,10 +25,10 @@ type $Props = { itemToString?: (item: DropdownItem) => string; /** - * Specify the selected item id - * @default undefined + * Specify the selected item index + * @default -1 */ - selectedId: DropdownItemId; + selectedIndex?: number; /** * Specify the type of dropdown @@ -46,7 +44,6 @@ type $Props = { /** * Specify the size of the dropdown field - * @default undefined */ size?: "sm" | "lg" | "xl"; @@ -56,6 +53,12 @@ type $Props = { */ open?: boolean; + /** + * Set to `true` to use the inline variant + * @default false + */ + inline?: boolean; + /** * Set to `true` to enable the light variant * @default false @@ -106,7 +109,6 @@ type $Props = { /** * Specify the list box label - * @default undefined */ label?: string; @@ -117,13 +119,9 @@ type $Props = { hideLabel?: boolean; /** - * Override the chevron icon label based on the open state. - * Defaults to "Open menu" when closed and "Close menu" when open - * @default undefined + * Override the default translation ids */ - translateWithId?: ( - id: import("../ListBox/ListBoxMenuIcon.svelte").ListBoxMenuIconTranslationId, - ) => string; + translateWithId?: (id: any) => string; /** * Set an id for the list box component @@ -133,7 +131,6 @@ type $Props = { /** * Specify a name attribute for the list box - * @default undefined */ name?: string; @@ -142,19 +139,16 @@ type $Props = { * @default null */ ref?: null | HTMLButtonElement; - - [key: `data-${string}`]: any; -}; - -export type DropdownProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Dropdown extends SvelteComponentTyped< DropdownProps, { select: CustomEvent<{ selectedId: DropdownItemId; + selectedIndex: number; selectedItem: DropdownItem; }>; }, - { default: { item: DropdownItem; index: number } } + {} > {} diff --git a/types/Dropdown/DropdownSkeleton.svelte.d.ts b/types/Dropdown/DropdownSkeleton.d.ts similarity index 57% rename from types/Dropdown/DropdownSkeleton.svelte.d.ts rename to types/Dropdown/DropdownSkeleton.d.ts index 14c1e60c..3cb8daf3 100644 --- a/types/Dropdown/DropdownSkeleton.svelte.d.ts +++ b/types/Dropdown/DropdownSkeleton.d.ts @@ -1,19 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface DropdownSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to use the inline variant * @default false */ inline?: boolean; - - [key: `data-${string}`]: any; -}; - -export type DropdownSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class DropdownSkeleton extends SvelteComponentTyped< DropdownSkeletonProps, diff --git a/types/FileUploader/FileUploader.d.ts b/types/FileUploader/FileUploader.d.ts new file mode 100644 index 00000000..f311158f --- /dev/null +++ b/types/FileUploader/FileUploader.d.ts @@ -0,0 +1,87 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface FileUploaderProps + extends svelte.JSX.HTMLAttributes { + /** + * Specify the file uploader status + * @default "uploading" + */ + status?: "uploading" | "edit" | "complete"; + + /** + * Specify the accepted file types + * @default [] + */ + accept?: string[]; + + /** + * Obtain the uploaded file names + * @default [] + */ + files?: File[]; + + /** + * Set to `true` to allow multiple files + * @default false + */ + multiple?: boolean; + + /** + * Override the default behavior of clearing the array of uploaded files + * @constant + * @default () => { files = []; } + */ + clearFiles?: () => void; + + /** + * Specify the label description + * @default "" + */ + labelDescription?: string; + + /** + * Specify the label title + * @default "" + */ + labelTitle?: string; + + /** + * Specify the kind of file uploader button + * @default "primary" + */ + kind?: "primary" | "secondary" | "tertiary" | "ghost" | "danger"; + + /** + * Specify the button label + * @default "" + */ + buttonLabel?: string; + + /** + * Specify the ARIA label used for the status icons + * @default "Provide icon description" + */ + iconDescription?: string; + + /** + * Specify a name attribute for the file button uploader input + * @default "" + */ + name?: string; +} + +export default class FileUploader extends SvelteComponentTyped< + FileUploaderProps, + { + add: CustomEvent; + remove: CustomEvent; + click: WindowEventMap["click"]; + mouseover: WindowEventMap["mouseover"]; + mouseenter: WindowEventMap["mouseenter"]; + mouseleave: WindowEventMap["mouseleave"]; + change: WindowEventMap["change"]; + keydown: WindowEventMap["keydown"]; + }, + {} +> {} diff --git a/types/FileUploader/FileUploader.svelte.d.ts b/types/FileUploader/FileUploader.svelte.d.ts deleted file mode 100644 index 0b0d4fe3..00000000 --- a/types/FileUploader/FileUploader.svelte.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - /** - * Specify the file uploader status - * @default "uploading" - */ - status?: "uploading" | "edit" | "complete"; - - /** - * Set to `true` to disable the file uploader - * @default false - */ - disabled?: boolean; - - /** - * Specify the accepted file types - * @default [] - */ - accept?: ReadonlyArray; - - /** - * Obtain a reference to the uploaded files - * @default [] - */ - files?: ReadonlyArray; - - /** - * Set to `true` to allow multiple files - * @default false - */ - multiple?: boolean; - - /** - * Specify the label title. - * Alternatively, use the named slot "labelTitle" (e.g., `...`) - * @default "" - */ - labelTitle?: string; - - /** - * Specify the label description. - * Alternatively, use the named slot "labelDescription" (e.g., `...`) - * @default "" - */ - labelDescription?: string; - - /** - * Specify the kind of file uploader button - * @default "primary" - */ - kind?: import("../Button/Button.svelte").ButtonProps["kind"]; - - /** - * Specify the size of the file uploader button - * @default "small" - */ - size?: import("../Button/Button.svelte").ButtonProps["size"]; - - /** - * Specify the button label - * @default "" - */ - buttonLabel?: string; - - /** - * Specify the ARIA label used for the status icons - * @default "Provide icon description" - */ - iconDescription?: string; - - /** - * Specify a name attribute for the file button uploader input - * @default "" - */ - name?: string; - - [key: `data-${string}`]: any; -}; - -export type FileUploaderProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class FileUploader extends SvelteComponentTyped< - FileUploaderProps, - { - add: CustomEvent>; - remove: CustomEvent>; - change: CustomEvent>; - click: WindowEventMap["click"]; - mouseover: WindowEventMap["mouseover"]; - mouseenter: WindowEventMap["mouseenter"]; - mouseleave: WindowEventMap["mouseleave"]; - keydown: WindowEventMap["keydown"]; - }, - { labelDescription: {}; labelTitle: {} } -> { - /** - * Programmatically clear the uploaded files - */ - clearFiles: () => void; -} diff --git a/types/FileUploader/FileUploaderButton.svelte.d.ts b/types/FileUploader/FileUploaderButton.d.ts similarity index 63% rename from types/FileUploader/FileUploaderButton.svelte.d.ts rename to types/FileUploader/FileUploaderButton.d.ts index 1ceff139..c30bca3e 100644 --- a/types/FileUploader/FileUploaderButton.svelte.d.ts +++ b/types/FileUploader/FileUploaderButton.d.ts @@ -1,20 +1,13 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface FileUploaderButtonProps + extends svelte.JSX.HTMLAttributes { /** * Specify the accepted file types * @default [] */ - accept?: ReadonlyArray; - - /** - * Obtain a reference to the uploaded files - * @default [] - */ - files?: ReadonlyArray; + accept?: string[]; /** * Set to `true` to allow multiple files @@ -38,13 +31,7 @@ type $Props = { * Specify the kind of file uploader button * @default "primary" */ - kind?: import("../Button/Button.svelte").ButtonProps["kind"]; - - /** - * Specify the size of the file uploader button - * @default "small" - */ - size?: import("../Button/Button.svelte").ButtonProps["size"]; + kind?: "primary" | "secondary" | "tertiary" | "ghost" | "danger"; /** * Specify the label text @@ -81,18 +68,14 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type FileUploaderButtonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class FileUploaderButton extends SvelteComponentTyped< FileUploaderButtonProps, { - change: CustomEvent>; keydown: WindowEventMap["keydown"]; + change: WindowEventMap["change"]; click: WindowEventMap["click"]; }, - { labelText: {} } + {} > {} diff --git a/types/FileUploader/FileUploaderDropContainer.svelte.d.ts b/types/FileUploader/FileUploaderDropContainer.d.ts similarity index 62% rename from types/FileUploader/FileUploaderDropContainer.svelte.d.ts rename to types/FileUploader/FileUploaderDropContainer.d.ts index 65a3a5b7..e648a040 100644 --- a/types/FileUploader/FileUploaderDropContainer.svelte.d.ts +++ b/types/FileUploader/FileUploaderDropContainer.d.ts @@ -1,20 +1,13 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface FileUploaderDropContainerProps + extends svelte.JSX.HTMLAttributes { /** * Specify the accepted file types * @default [] */ - accept?: ReadonlyArray; - - /** - * Obtain a reference to the uploaded files - * @default [] - */ - files?: ReadonlyArray; + accept?: string[]; /** * Set to `true` to allow multiple files @@ -23,11 +16,11 @@ type $Props = { multiple?: boolean; /** - * Override the default behavior of validating uploaded files. - * By default, files are not validated + * Override the default behavior of validating uploaded files + * The default behavior does not validate files * @default (files) => files */ - validateFiles?: (files: ReadonlyArray) => ReadonlyArray; + validateFiles?: (files: FileList) => FileList; /** * Specify the label text @@ -70,23 +63,18 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type FileUploaderDropContainerProps = Omit<$RestProps, keyof $Props> & - $Props; +} export default class FileUploaderDropContainer extends SvelteComponentTyped< FileUploaderDropContainerProps, { - add: CustomEvent>; - change: CustomEvent>; + add: CustomEvent; dragover: WindowEventMap["dragover"]; dragleave: WindowEventMap["dragleave"]; drop: WindowEventMap["drop"]; keydown: WindowEventMap["keydown"]; + change: WindowEventMap["change"]; click: WindowEventMap["click"]; }, - { labelText: {} } + {} > {} diff --git a/types/FileUploader/FileUploaderItem.svelte.d.ts b/types/FileUploader/FileUploaderItem.d.ts similarity index 71% rename from types/FileUploader/FileUploaderItem.svelte.d.ts rename to types/FileUploader/FileUploaderItem.d.ts index 9f5e7547..35f71b9a 100644 --- a/types/FileUploader/FileUploaderItem.svelte.d.ts +++ b/types/FileUploader/FileUploaderItem.d.ts @@ -1,21 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["span"]; - -type $Props = { +export interface FileUploaderItemProps + extends svelte.JSX.HTMLAttributes { /** * Specify the file uploader status * @default "uploading" */ status?: "uploading" | "edit" | "complete"; - /** - * Specify the size of button skeleton - * @default "default" - */ - size?: "default" | "field" | "small"; - /** * Specify the ARIA label used for the status icons * @default "" @@ -51,11 +44,7 @@ type $Props = { * @default "" */ name?: string; - - [key: `data-${string}`]: any; -}; - -export type FileUploaderItemProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class FileUploaderItem extends SvelteComponentTyped< FileUploaderItemProps, diff --git a/types/FileUploader/FileUploaderSkeleton.svelte.d.ts b/types/FileUploader/FileUploaderSkeleton.d.ts similarity index 50% rename from types/FileUploader/FileUploaderSkeleton.svelte.d.ts rename to types/FileUploader/FileUploaderSkeleton.d.ts index 42574191..5c2025fe 100644 --- a/types/FileUploader/FileUploaderSkeleton.svelte.d.ts +++ b/types/FileUploader/FileUploaderSkeleton.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type FileUploaderSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +export interface FileUploaderSkeletonProps + extends svelte.JSX.HTMLAttributes {} export default class FileUploaderSkeleton extends SvelteComponentTyped< FileUploaderSkeletonProps, diff --git a/types/FileUploader/Filename.svelte.d.ts b/types/FileUploader/Filename.d.ts similarity index 59% rename from types/FileUploader/Filename.svelte.d.ts rename to types/FileUploader/Filename.d.ts index 50a4e686..1e97af5c 100644 --- a/types/FileUploader/Filename.svelte.d.ts +++ b/types/FileUploader/Filename.d.ts @@ -1,11 +1,7 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"] & - SvelteHTMLElements["button"] & - SvelteHTMLElements["svg"]; - -type $Props = { +export interface FilenameProps { /** * Specify the file name status * @default "uploading" @@ -23,11 +19,7 @@ type $Props = { * @default false */ invalid?: boolean; - - [key: `data-${string}`]: any; -}; - -export type FilenameProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Filename extends SvelteComponentTyped< FilenameProps, diff --git a/types/FluidForm/FluidForm.svelte.d.ts b/types/FluidForm/FluidForm.d.ts similarity index 56% rename from types/FluidForm/FluidForm.svelte.d.ts rename to types/FluidForm/FluidForm.d.ts index 6e36ffad..a3634eb6 100644 --- a/types/FluidForm/FluidForm.svelte.d.ts +++ b/types/FluidForm/FluidForm.d.ts @@ -1,13 +1,7 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["form"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type FluidFormProps = Omit<$RestProps, keyof $Props> & $Props; +export interface FluidFormProps {} export default class FluidForm extends SvelteComponentTyped< FluidFormProps, diff --git a/types/Form/Form.d.ts b/types/Form/Form.d.ts new file mode 100644 index 00000000..80e73661 --- /dev/null +++ b/types/Form/Form.d.ts @@ -0,0 +1,18 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface FormProps + extends svelte.JSX.HTMLAttributes {} + +export default class Form extends SvelteComponentTyped< + FormProps, + { + click: WindowEventMap["click"]; + keydown: WindowEventMap["keydown"]; + mouseover: WindowEventMap["mouseover"]; + mouseenter: WindowEventMap["mouseenter"]; + mouseleave: WindowEventMap["mouseleave"]; + submit: WindowEventMap["submit"]; + }, + { default: {} } +> {} diff --git a/types/Form/Form.svelte.d.ts b/types/Form/Form.svelte.d.ts deleted file mode 100644 index 1cfad285..00000000 --- a/types/Form/Form.svelte.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["form"]; - -type $Props = { - /** - * Obtain a reference to the form element - * @default null - */ - ref?: null | HTMLFormElement; - - [key: `data-${string}`]: any; -}; - -export type FormProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class Form extends SvelteComponentTyped< - FormProps, - { - click: WindowEventMap["click"]; - keydown: WindowEventMap["keydown"]; - mouseover: WindowEventMap["mouseover"]; - mouseenter: WindowEventMap["mouseenter"]; - mouseleave: WindowEventMap["mouseleave"]; - submit: WindowEventMap["submit"]; - }, - { default: {} } -> {} diff --git a/types/FormGroup/FormGroup.svelte.d.ts b/types/FormGroup/FormGroup.d.ts similarity index 66% rename from types/FormGroup/FormGroup.svelte.d.ts rename to types/FormGroup/FormGroup.d.ts index fe6f1182..a9e7dd5b 100644 --- a/types/FormGroup/FormGroup.svelte.d.ts +++ b/types/FormGroup/FormGroup.d.ts @@ -1,15 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["fieldset"]; - -type $Props = { - /** - * Set to `true` for to remove the bottom margin - * @default false - */ - noMargin?: boolean; +/// +import { SvelteComponentTyped } from "svelte"; +export interface FormGroupProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to indicate an invalid state * @default false @@ -22,6 +15,12 @@ type $Props = { */ message?: boolean; + /** + * Set to `true` for to remove the bottom margin + * @default false + */ + noMargin?: boolean; + /** * Specify the message text * @default "" @@ -33,17 +32,7 @@ type $Props = { * @default "" */ legendText?: string; - - /** - * Specify an id for the legend element - * @default "" - */ - legendId?: string; - - [key: `data-${string}`]: any; -}; - -export type FormGroupProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class FormGroup extends SvelteComponentTyped< FormGroupProps, diff --git a/types/FormItem/FormItem.svelte.d.ts b/types/FormItem/FormItem.d.ts similarity index 50% rename from types/FormItem/FormItem.svelte.d.ts rename to types/FormItem/FormItem.d.ts index 496356a6..543f568d 100644 --- a/types/FormItem/FormItem.svelte.d.ts +++ b/types/FormItem/FormItem.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type FormItemProps = Omit<$RestProps, keyof $Props> & $Props; +export interface FormItemProps + extends svelte.JSX.HTMLAttributes {} export default class FormItem extends SvelteComponentTyped< FormItemProps, diff --git a/types/FormLabel/FormLabel.svelte.d.ts b/types/FormLabel/FormLabel.d.ts similarity index 59% rename from types/FormLabel/FormLabel.svelte.d.ts rename to types/FormLabel/FormLabel.d.ts index e7f07659..60ccc79f 100644 --- a/types/FormLabel/FormLabel.svelte.d.ts +++ b/types/FormLabel/FormLabel.d.ts @@ -1,19 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["label"]; - -type $Props = { +export interface FormLabelProps + extends svelte.JSX.HTMLAttributes { /** * Set an id to be used by the label element * @default "ccs-" + Math.random().toString(36) */ id?: string; - - [key: `data-${string}`]: any; -}; - -export type FormLabelProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class FormLabel extends SvelteComponentTyped< FormLabelProps, diff --git a/types/Grid/Column.svelte.d.ts b/types/Grid/Column.d.ts similarity index 76% rename from types/Grid/Column.svelte.d.ts rename to types/Grid/Column.d.ts index 3dab2a87..eda8ac8f 100644 --- a/types/Grid/Column.svelte.d.ts +++ b/types/Grid/Column.d.ts @@ -1,5 +1,5 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; export type ColumnSize = boolean | number; @@ -10,9 +10,8 @@ export interface ColumnSizeDescriptor { export type ColumnBreakpoint = ColumnSize | ColumnSizeDescriptor; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ColumnProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to render a custom HTML element * Props are destructured as `props` in the default slot (e.g.,
    ...
    ) @@ -46,47 +45,37 @@ type $Props = { /** * Specify the aspect ratio of the column - * @default undefined */ aspectRatio?: "2x1" | "16x9" | "9x16" | "1x2" | "4x3" | "3x4" | "1x1"; /** * Set the small breakpoint - * @default undefined */ sm?: ColumnBreakpoint; /** * Set the medium breakpoint - * @default undefined */ md?: ColumnBreakpoint; /** * Set the large breakpoint - * @default undefined */ lg?: ColumnBreakpoint; /** * Set the extra large breakpoint - * @default undefined */ xlg?: ColumnBreakpoint; /** * Set the maximum breakpoint - * @default undefined */ max?: ColumnBreakpoint; - - [key: `data-${string}`]: any; -}; - -export type ColumnProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Column extends SvelteComponentTyped< ColumnProps, - Record, + {}, { default: { props: { class: string; [key: string]: any } } } > {} diff --git a/types/Grid/Grid.svelte.d.ts b/types/Grid/Grid.d.ts similarity index 78% rename from types/Grid/Grid.svelte.d.ts rename to types/Grid/Grid.d.ts index c589e4c3..bcab6463 100644 --- a/types/Grid/Grid.svelte.d.ts +++ b/types/Grid/Grid.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface GridProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to render a custom HTML element * Props are destructured as `props` in the default slot (e.g.,
    ...
    ) @@ -52,14 +51,10 @@ type $Props = { * @default false */ padding?: boolean; - - [key: `data-${string}`]: any; -}; - -export type GridProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Grid extends SvelteComponentTyped< GridProps, - Record, + {}, { default: { props: { class: string; [key: string]: any } } } > {} diff --git a/types/Grid/Row.svelte.d.ts b/types/Grid/Row.d.ts similarity index 76% rename from types/Grid/Row.svelte.d.ts rename to types/Grid/Row.d.ts index 6a53d9ab..2c2a6e78 100644 --- a/types/Grid/Row.svelte.d.ts +++ b/types/Grid/Row.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface RowProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to render a custom HTML element * Props are destructured as `props` in the default slot (e.g.,
    ...
    ) @@ -46,14 +45,10 @@ type $Props = { * @default false */ padding?: boolean; - - [key: `data-${string}`]: any; -}; - -export type RowProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Row extends SvelteComponentTyped< RowProps, - Record, + {}, { default: { props: { class: string; [key: string]: any } } } > {} diff --git a/types/Icon/Icon.d.ts b/types/Icon/Icon.d.ts new file mode 100644 index 00000000..2820cfde --- /dev/null +++ b/types/Icon/Icon.d.ts @@ -0,0 +1,29 @@ +/// +import { SvelteComponentTyped } from "svelte"; +import { IconSkeletonProps } from "./IconSkeleton"; + +export interface IconProps + extends IconSkeletonProps, + svelte.JSX.HTMLAttributes { + /** + * Specify the icon from `carbon-icons-svelte` to render + */ + render?: typeof import("carbon-icons-svelte").CarbonIcon; + + /** + * Set to `true` to display the skeleton state + * @default false + */ + skeleton?: boolean; +} + +export default class Icon extends SvelteComponentTyped< + IconProps, + { + click: WindowEventMap["click"]; + mouseover: WindowEventMap["mouseover"]; + mouseenter: WindowEventMap["mouseenter"]; + mouseleave: WindowEventMap["mouseleave"]; + }, + {} +> {} diff --git a/types/Icon/IconSkeleton.d.ts b/types/Icon/IconSkeleton.d.ts new file mode 100644 index 00000000..97e696ff --- /dev/null +++ b/types/Icon/IconSkeleton.d.ts @@ -0,0 +1,22 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface IconSkeletonProps + extends svelte.JSX.HTMLAttributes { + /** + * Set the size of the icon + * @default 16 + */ + size?: number; +} + +export default class IconSkeleton extends SvelteComponentTyped< + IconSkeletonProps, + { + click: WindowEventMap["click"]; + mouseover: WindowEventMap["mouseover"]; + mouseenter: WindowEventMap["mouseenter"]; + mouseleave: WindowEventMap["mouseleave"]; + }, + {} +> {} diff --git a/types/ImageLoader/ImageLoader.svelte.d.ts b/types/ImageLoader/ImageLoader.d.ts similarity index 61% rename from types/ImageLoader/ImageLoader.svelte.d.ts rename to types/ImageLoader/ImageLoader.d.ts index 304c047f..688bf84c 100644 --- a/types/ImageLoader/ImageLoader.svelte.d.ts +++ b/types/ImageLoader/ImageLoader.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["img"]; - -type $Props = { +export interface ImageLoaderProps + extends svelte.JSX.HTMLAttributes { /** * Specify the image source * @default "" @@ -18,9 +17,8 @@ type $Props = { /** * Specify the aspect ratio for the image wrapper - * @default undefined */ - ratio?: "2x1" | "16x9" | "4x3" | "1x1" | "3x4" | "3x2" | "9x16" | "1x2"; + ratio?: "2x1" | "16x9" | "4x3" | "1x1" | "3x4" | "9x16" | "1x2"; /** * Set to `true` when `loaded` is `true` and `error` is false @@ -47,18 +45,16 @@ type $Props = { */ fadeIn?: boolean; - [key: `data-${string}`]: any; -}; - -export type ImageLoaderProps = Omit<$RestProps, keyof $Props> & $Props; + /** + * Method invoked to load the image provided a `src` value + * @constant + * @default (url) => { if (image != null) image = null; loaded = false; error = false; image = new Image(); image.src = url || src; image.onload = () => (loaded = true); image.onerror = () => (error = true); } + */ + loadImage?: (url?: string) => void; +} export default class ImageLoader extends SvelteComponentTyped< ImageLoaderProps, - { load: CustomEvent; error: CustomEvent }, + { load: CustomEvent; error: CustomEvent }, { error: {}; loading: {} } -> { - /** - * Method invoked to load the image provided a `src` value - */ - loadImage: (url?: string) => void; -} +> {} diff --git a/types/InlineLoading/InlineLoading.svelte.d.ts b/types/InlineLoading/InlineLoading.d.ts similarity index 56% rename from types/InlineLoading/InlineLoading.svelte.d.ts rename to types/InlineLoading/InlineLoading.d.ts index 88a2240e..a9821f78 100644 --- a/types/InlineLoading/InlineLoading.svelte.d.ts +++ b/types/InlineLoading/InlineLoading.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface InlineLoadingProps + extends svelte.JSX.HTMLAttributes { /** * Set the loading status * @default "active" @@ -12,14 +11,11 @@ type $Props = { /** * Set the loading description - * @default undefined */ description?: string; /** - * Specify a description for the loading icon. - * Defaults to the `status` prop for the "error" and "finished" states - * @default undefined + * Specify the ARIA label for the loading icon */ iconDescription?: string; @@ -28,11 +24,7 @@ type $Props = { * @default 1500 */ successDelay?: number; - - [key: `data-${string}`]: any; -}; - -export type InlineLoadingProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class InlineLoading extends SvelteComponentTyped< InlineLoadingProps, @@ -41,7 +33,7 @@ export default class InlineLoading extends SvelteComponentTyped< mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; - success: CustomEvent; + success: CustomEvent; }, {} > {} diff --git a/types/Link/Link.svelte.d.ts b/types/Link/Link.d.ts similarity index 60% rename from types/Link/Link.svelte.d.ts rename to types/Link/Link.d.ts index 8a5c1566..d8dd0993 100644 --- a/types/Link/Link.svelte.d.ts +++ b/types/Link/Link.d.ts @@ -1,18 +1,15 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["a"]; - -type $Props = { +export interface LinkProps + extends svelte.JSX.HTMLAttributes { /** * Specify the size of the link - * @default undefined */ size?: "sm" | "lg"; /** * Specify the href value - * @default undefined */ href?: string; @@ -22,13 +19,6 @@ type $Props = { */ inline?: boolean; - /** - * Specify the icon to render - * `inline` must be `false` - * @default undefined - */ - icon?: any; - /** * Set to `true` to disable the checkbox * @default false @@ -45,12 +35,8 @@ type $Props = { * Obtain a reference to the top-level HTML element * @default null */ - ref?: null | HTMLAnchorElement; - - [key: `data-${string}`]: any; -}; - -export type LinkProps = Omit<$RestProps, keyof $Props> & $Props; + ref?: null | HTMLAnchorElement | HTMLParagraphElement; +} export default class Link extends SvelteComponentTyped< LinkProps, @@ -60,5 +46,5 @@ export default class Link extends SvelteComponentTyped< mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; }, - { default: {}; icon: {} } + { default: {} } > {} diff --git a/types/Link/OutboundLink.svelte.d.ts b/types/Link/OutboundLink.d.ts similarity index 62% rename from types/Link/OutboundLink.svelte.d.ts rename to types/Link/OutboundLink.d.ts index 3ad31e2e..15f6bb77 100644 --- a/types/Link/OutboundLink.svelte.d.ts +++ b/types/Link/OutboundLink.d.ts @@ -1,7 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { LinkProps } from "./Link.svelte"; +/// +import { SvelteComponentTyped } from "svelte"; +import { LinkProps } from "./Link"; -export type OutboundLinkProps = LinkProps & {}; +export interface OutboundLinkProps extends LinkProps {} export default class OutboundLink extends SvelteComponentTyped< OutboundLinkProps, diff --git a/types/ListBox/ListBox.svelte.d.ts b/types/ListBox/ListBox.d.ts similarity index 76% rename from types/ListBox/ListBox.svelte.d.ts rename to types/ListBox/ListBox.d.ts index a0017f77..5dc8c898 100644 --- a/types/ListBox/ListBox.svelte.d.ts +++ b/types/ListBox/ListBox.d.ts @@ -1,12 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ListBoxProps + extends svelte.JSX.HTMLAttributes { /** * Set the size of the list box - * @default undefined */ size?: "sm" | "xl"; @@ -57,11 +55,7 @@ type $Props = { * @default "" */ warnText?: string; - - [key: `data-${string}`]: any; -}; - -export type ListBoxProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ListBox extends SvelteComponentTyped< ListBoxProps, diff --git a/types/ListBox/ListBoxField.svelte.d.ts b/types/ListBox/ListBoxField.d.ts similarity index 75% rename from types/ListBox/ListBoxField.svelte.d.ts rename to types/ListBox/ListBoxField.d.ts index 4b4d782a..5863dd1c 100644 --- a/types/ListBox/ListBoxField.svelte.d.ts +++ b/types/ListBox/ListBoxField.d.ts @@ -1,11 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; export type ListBoxFieldTranslationId = "close" | "open"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ListBoxFieldProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to disable the list box field * @default false @@ -24,6 +23,13 @@ type $Props = { */ tabindex?: string; + /** + * Default translation ids + * @constant + * @default { close: "close", open: "open" } + */ + translationIds?: { close: "close"; open: "open" }; + /** * Override the default translation ids * @default (id) => defaultTranslations[id] @@ -41,11 +47,7 @@ type $Props = { * @default null */ ref?: null | HTMLDivElement; - - [key: `data-${string}`]: any; -}; - -export type ListBoxFieldProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ListBoxField extends SvelteComponentTyped< ListBoxFieldProps, @@ -55,13 +57,7 @@ export default class ListBoxField extends SvelteComponentTyped< mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; keydown: WindowEventMap["keydown"]; - focus: WindowEventMap["focus"]; blur: WindowEventMap["blur"]; }, { default: {} } -> { - /** - * Default translation ids - */ - translationIds: { close: "close"; open: "open" }; -} +> {} diff --git a/types/ListBox/ListBoxMenu.svelte.d.ts b/types/ListBox/ListBoxMenu.d.ts similarity index 56% rename from types/ListBox/ListBoxMenu.svelte.d.ts rename to types/ListBox/ListBoxMenu.d.ts index 72444885..c301eee2 100644 --- a/types/ListBox/ListBoxMenu.svelte.d.ts +++ b/types/ListBox/ListBoxMenu.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ListBoxMenuProps + extends svelte.JSX.HTMLAttributes { /** * Set an id for the top-level element * @default "ccs-" + Math.random().toString(36) @@ -15,11 +14,7 @@ type $Props = { * @default null */ ref?: null | HTMLDivElement; - - [key: `data-${string}`]: any; -}; - -export type ListBoxMenuProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ListBoxMenu extends SvelteComponentTyped< ListBoxMenuProps, diff --git a/types/ListBox/ListBoxMenuIcon.svelte.d.ts b/types/ListBox/ListBoxMenuIcon.d.ts similarity index 60% rename from types/ListBox/ListBoxMenuIcon.svelte.d.ts rename to types/ListBox/ListBoxMenuIcon.d.ts index a5d71e02..df402fc6 100644 --- a/types/ListBox/ListBoxMenuIcon.svelte.d.ts +++ b/types/ListBox/ListBoxMenuIcon.d.ts @@ -1,35 +1,32 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; export type ListBoxMenuIconTranslationId = "close" | "open"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ListBoxMenuIconProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to open the list box menu icon * @default false */ open?: boolean; + /** + * Default translation ids + * @constant + * @default { close: "close", open: "open" } + */ + translationIds?: { close: "close"; open: "open" }; + /** * Override the default translation ids * @default (id) => defaultTranslations[id] */ translateWithId?: (id: ListBoxMenuIconTranslationId) => string; - - [key: `data-${string}`]: any; -}; - -export type ListBoxMenuIconProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ListBoxMenuIcon extends SvelteComponentTyped< ListBoxMenuIconProps, { click: WindowEventMap["click"] }, {} -> { - /** - * Default translation ids - */ - translationIds: { close: "close"; open: "open" }; -} +> {} diff --git a/types/ListBox/ListBoxMenuItem.svelte.d.ts b/types/ListBox/ListBoxMenuItem.d.ts similarity index 54% rename from types/ListBox/ListBoxMenuItem.svelte.d.ts rename to types/ListBox/ListBoxMenuItem.d.ts index 9c980896..9b0c1faa 100644 --- a/types/ListBox/ListBoxMenuItem.svelte.d.ts +++ b/types/ListBox/ListBoxMenuItem.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ListBoxMenuItemProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to enable the active state * @default false @@ -15,17 +14,7 @@ type $Props = { * @default false */ highlighted?: boolean; - - /** - * Set to `true` to disable the menu item - * @default false - */ - disabled?: boolean; - - [key: `data-${string}`]: any; -}; - -export type ListBoxMenuItemProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ListBoxMenuItem extends SvelteComponentTyped< ListBoxMenuItemProps, diff --git a/types/ListBox/ListBoxSelection.svelte.d.ts b/types/ListBox/ListBoxSelection.d.ts similarity index 61% rename from types/ListBox/ListBoxSelection.svelte.d.ts rename to types/ListBox/ListBoxSelection.d.ts index 351bf1ab..134e969f 100644 --- a/types/ListBox/ListBoxSelection.svelte.d.ts +++ b/types/ListBox/ListBoxSelection.d.ts @@ -1,14 +1,12 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; export type ListBoxSelectionTranslationId = "clearAll" | "clearSelection"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ListBoxSelectionProps + extends svelte.JSX.HTMLAttributes { /** * Specify the number of selected items - * @default undefined */ selectionCount?: number; @@ -18,6 +16,13 @@ type $Props = { */ disabled?: boolean; + /** + * Default translation ids + * @constant + * @default { clearAll: "clearAll", clearSelection: "clearSelection", } + */ + translationIds?: { clearAll: "clearAll"; clearSelection: "clearSelection" }; + /** * Override the default translation ids * @default (id) => defaultTranslations[id] @@ -29,19 +34,10 @@ type $Props = { * @default null */ ref?: null | HTMLDivElement; - - [key: `data-${string}`]: any; -}; - -export type ListBoxSelectionProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ListBoxSelection extends SvelteComponentTyped< ListBoxSelectionProps, - { clear: CustomEvent }, + { clear: CustomEvent }, {} -> { - /** - * Default translation ids - */ - translationIds: { clearAll: "clearAll"; clearSelection: "clearSelection" }; -} +> {} diff --git a/types/ListItem/ListItem.svelte.d.ts b/types/ListItem/ListItem.d.ts similarity index 50% rename from types/ListItem/ListItem.svelte.d.ts rename to types/ListItem/ListItem.d.ts index 451c7b08..b5f05e66 100644 --- a/types/ListItem/ListItem.svelte.d.ts +++ b/types/ListItem/ListItem.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["li"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type ListItemProps = Omit<$RestProps, keyof $Props> & $Props; +export interface ListItemProps + extends svelte.JSX.HTMLAttributes {} export default class ListItem extends SvelteComponentTyped< ListItemProps, diff --git a/types/Loading/Loading.svelte.d.ts b/types/Loading/Loading.d.ts similarity index 52% rename from types/Loading/Loading.svelte.d.ts rename to types/Loading/Loading.d.ts index a5fff650..0a7cab4b 100644 --- a/types/Loading/Loading.svelte.d.ts +++ b/types/Loading/Loading.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface LoadingProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to use the small variant * @default false @@ -23,18 +22,20 @@ type $Props = { withOverlay?: boolean; /** - * Specify the description to describe the loading state - * @default "loading" + * Specify the label description + * @default "Active loading indicator" */ description?: string; - [key: `data-${string}`]: any; -}; - -export type LoadingProps = Omit<$RestProps, keyof $Props> & $Props; + /** + * Set an id for the label element + * @default "ccs-" + Math.random().toString(36) + */ + id?: string; +} export default class Loading extends SvelteComponentTyped< LoadingProps, - Record, + {}, {} > {} diff --git a/types/LocalStorage/LocalStorage.svelte.d.ts b/types/LocalStorage/LocalStorage.d.ts similarity index 50% rename from types/LocalStorage/LocalStorage.svelte.d.ts rename to types/LocalStorage/LocalStorage.d.ts index 1599cc6b..f0c93cd5 100644 --- a/types/LocalStorage/LocalStorage.svelte.d.ts +++ b/types/LocalStorage/LocalStorage.d.ts @@ -1,6 +1,7 @@ -import type { SvelteComponentTyped } from "svelte"; +/// +import { SvelteComponentTyped } from "svelte"; -export type LocalStorageProps = { +export interface LocalStorageProps { /** * Specify the local storage key * @default "local-storage-key" @@ -12,23 +13,13 @@ export type LocalStorageProps = { * @default "" */ value?: any; -}; +} export default class LocalStorage extends SvelteComponentTyped< LocalStorageProps, { - save: CustomEvent; + save: CustomEvent; update: CustomEvent<{ prevValue: any; value: any }>; }, {} -> { - /** - * Remove the persisted key value from the browser's local storage - */ - clearItem: () => void; - - /** - * Clear all key values from the browser's local storage - */ - clearAll: () => void; -} +> {} diff --git a/types/Modal/Modal.svelte.d.ts b/types/Modal/Modal.d.ts similarity index 70% rename from types/Modal/Modal.svelte.d.ts rename to types/Modal/Modal.d.ts index 84fb57b0..e33dddad 100644 --- a/types/Modal/Modal.svelte.d.ts +++ b/types/Modal/Modal.d.ts @@ -1,12 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ModalProps + extends svelte.JSX.HTMLAttributes { /** * Set the size of the modal - * @default undefined */ size?: "xs" | "sm" | "lg"; @@ -36,19 +34,16 @@ type $Props = { /** * Specify the modal heading - * @default undefined */ modalHeading?: string; /** * Specify the modal label - * @default undefined */ modalLabel?: string; /** * Specify the ARIA label for the modal - * @default undefined */ modalAriaLabel?: string; @@ -83,14 +78,7 @@ type $Props = { primaryButtonDisabled?: boolean; /** - * Specify the primary button icon - * @default undefined - */ - primaryButtonIcon?: any; - - /** - * Set to `true` for the "submit" and "click:button--primary" events - * to be dispatched when pressing "Enter" + * Set to `true` for the primary button to be triggered when pressing "Enter" * @default true */ shouldSubmitOnEnter?: boolean; @@ -101,13 +89,6 @@ type $Props = { */ secondaryButtonText?: string; - /** - * 2-tuple prop to render two secondary buttons for a 3 button modal - * supersedes `secondaryButtonText` - * @default [] - */ - secondaryButtons?: [{ text: string }, { text: string }]; - /** * Specify a selector to be focused when opening the modal * @default "[data-modal-primary-focus]" @@ -131,26 +112,21 @@ type $Props = { * @default null */ ref?: null | HTMLDivElement; - - [key: `data-${string}`]: any; -}; - -export type ModalProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Modal extends SvelteComponentTyped< ModalProps, { transitionend: CustomEvent<{ open: boolean }>; - ["click:button--secondary"]: CustomEvent<{ text: string }>; keydown: WindowEventMap["keydown"]; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; - submit: CustomEvent; - ["click:button--primary"]: CustomEvent; - close: CustomEvent; - open: CustomEvent; + submit: CustomEvent; + ["click:button--secondary"]: CustomEvent; + close: CustomEvent; + open: CustomEvent; }, { default: {}; heading: {}; label: {} } > {} diff --git a/types/MultiSelect/MultiSelect.svelte.d.ts b/types/MultiSelect/MultiSelect.d.ts similarity index 57% rename from types/MultiSelect/MultiSelect.svelte.d.ts rename to types/MultiSelect/MultiSelect.d.ts index b5be0b72..fc86d082 100644 --- a/types/MultiSelect/MultiSelect.svelte.d.ts +++ b/types/MultiSelect/MultiSelect.d.ts @@ -1,47 +1,34 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -export type MultiSelectItemId = any; +export type MultiSelectItemId = string; export type MultiSelectItemText = string; export interface MultiSelectItem { id: MultiSelectItemId; text: MultiSelectItemText; - disabled?: boolean; } -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface MultiSelectProps + extends svelte.JSX.HTMLAttributes { /** * Set the multiselect items * @default [] */ - items?: ReadonlyArray; + items?: MultiSelectItem[]; /** * Override the display of a multiselect item * @default (item) => item.text || item.id */ - itemToString?: (item: MultiSelectItem) => any; - - /** - * Override the item name, title, labelText, or value passed to the user-selectable checkbox input as well as the hidden inputs. - * @default (item) => {} - */ - itemToInput?: (item: MultiSelectItem) => { - name?: string; - labelText?: any; - title?: string; - value?: string; - }; + itemToString?: (item: MultiSelectItem) => string; /** * Set the selected ids * @default [] */ - selectedIds?: ReadonlyArray; + selectedIds?: MultiSelectItemId[]; /** * Specify the multiselect value @@ -51,7 +38,6 @@ type $Props = { /** * Set the size of the combobox - * @default undefined */ size?: "sm" | "lg" | "xl"; @@ -88,9 +74,9 @@ type $Props = { /** * Override the filtering logic * The default filtering is an exact string comparison - * @default (item, value) => item.text.toLowerCase().includes(value.trim().toLowerCase()) + * @default (item, value) => item.text.toLowerCase().includes(value.toLowerCase()) */ - filterItem?: (item: MultiSelectItem, value: string) => boolean; + filterItem?: (item: MultiSelectItem, value: string) => string; /** * Set to `true` to open the dropdown @@ -126,22 +112,9 @@ type $Props = { | (() => void); /** - * Override the chevron icon label based on the open state. - * Defaults to "Open menu" when closed and "Close menu" when open - * @default undefined + * Override the default translation ids */ - translateWithId?: ( - id: import("../ListBox/ListBoxMenuIcon.svelte").ListBoxMenuIconTranslationId, - ) => string; - - /** - * Override the label of the clear button when the input has a selection. - * Defaults to "Clear selected item" and "Clear all items" if more than one item is selected - * @default undefined - */ - translateWithIdSelection?: ( - id: import("../ListBox/ListBoxSelection.svelte").ListBoxSelectionTranslationId, - ) => string; + translateWithId?: (id: any) => string; /** * Specify the title text @@ -191,12 +164,6 @@ type $Props = { */ label?: string; - /** - * Set to `true` to visually hide the label text - * @default false - */ - hideLabel?: boolean; - /** * Set an id for the list box component * @default "ccs-" + Math.random().toString(36) @@ -205,7 +172,6 @@ type $Props = { /** * Specify a name attribute for the select - * @default undefined */ name?: string; @@ -214,51 +180,20 @@ type $Props = { * @default null */ inputRef?: null | HTMLInputElement; - - /** - * Obtain a reference to the outer div element - * @default null - */ - multiSelectRef?: null | HTMLDivElement; - - /** - * Obtain a reference to the field box element - * @default null - */ - fieldRef?: null | HTMLDivElement; - - /** - * Obtain a reference to the selection element - * @default null - */ - selectionRef?: null | HTMLDivElement; - - /** - * Id of the highlighted ListBoxMenuItem - * @default null - */ - highlightedId?: null | MultiSelectItemId; - - [key: `data-${string}`]: any; -}; - -export type MultiSelectProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class MultiSelect extends SvelteComponentTyped< MultiSelectProps, { select: CustomEvent<{ - selectedIds: MultiSelectItemId[]; + selectedIds: string[]; selected: MultiSelectItem[]; unselected: MultiSelectItem[]; }>; - clear: CustomEvent; - blur: FocusEvent | CustomEvent; + clear: CustomEvent; keydown: WindowEventMap["keydown"]; - input: WindowEventMap["input"]; - keyup: WindowEventMap["keyup"]; focus: WindowEventMap["focus"]; - paste: WindowEventMap["paste"]; + blur: WindowEventMap["blur"]; }, - { default: { item: MultiSelectItem; index: number }; titleText: {} } + {} > {} diff --git a/types/Notification/InlineNotification.svelte.d.ts b/types/Notification/InlineNotification.d.ts similarity index 65% rename from types/Notification/InlineNotification.svelte.d.ts rename to types/Notification/InlineNotification.d.ts index 0eedc810..dc810ee9 100644 --- a/types/Notification/InlineNotification.svelte.d.ts +++ b/types/Notification/InlineNotification.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface InlineNotificationProps + extends svelte.JSX.HTMLAttributes { /** * Specify the kind of notification * @default "error" @@ -53,21 +52,11 @@ type $Props = { hideCloseButton?: boolean; /** - * Specify the ARIA label for the status icon - * @default kind + " icon" + * Specify the ARIA label for the icon + * @default "Closes notification" */ - statusIconDescription?: string; - - /** - * Specify the ARIA label for the close button - * @default "Close notification" - */ - closeButtonDescription?: string; - - [key: `data-${string}`]: any; -}; - -export type InlineNotificationProps = Omit<$RestProps, keyof $Props> & $Props; + iconDescription?: string; +} export default class InlineNotification extends SvelteComponentTyped< InlineNotificationProps, @@ -78,5 +67,5 @@ export default class InlineNotification extends SvelteComponentTyped< mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; }, - { default: {}; actions: {}; subtitle: {}; title: {} } + { default: {}; actions: {} } > {} diff --git a/types/Notification/NotificationActionButton.svelte.d.ts b/types/Notification/NotificationActionButton.d.ts similarity index 64% rename from types/Notification/NotificationActionButton.svelte.d.ts rename to types/Notification/NotificationActionButton.d.ts index 1669c053..5317510d 100644 --- a/types/Notification/NotificationActionButton.svelte.d.ts +++ b/types/Notification/NotificationActionButton.d.ts @@ -1,7 +1,7 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { ButtonProps } from "../Button/Button.svelte"; +/// +import { SvelteComponentTyped } from "svelte"; -export type NotificationActionButtonProps = ButtonProps & {}; +export interface NotificationActionButtonProps {} export default class NotificationActionButton extends SvelteComponentTyped< NotificationActionButtonProps, diff --git a/types/Notification/NotificationButton.svelte.d.ts b/types/Notification/NotificationButton.d.ts similarity index 60% rename from types/Notification/NotificationButton.svelte.d.ts rename to types/Notification/NotificationButton.d.ts index ee7b4d45..8596893d 100644 --- a/types/Notification/NotificationButton.svelte.d.ts +++ b/types/Notification/NotificationButton.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["button"]; - -type $Props = { +export interface NotificationButtonProps + extends svelte.JSX.HTMLAttributes { /** * Set the type of notification * @default "toast" @@ -11,14 +10,12 @@ type $Props = { notificationType?: "toast" | "inline"; /** - * Specify the icon to render - * @default undefined + * Specify the icon from `carbon-icons-svelte` to render */ - icon?: any; + icon?: typeof import("carbon-icons-svelte").CarbonIcon; /** * Specify the title of the icon - * @default undefined */ title?: string; @@ -27,11 +24,7 @@ type $Props = { * @default "Close icon" */ iconDescription?: string; - - [key: `data-${string}`]: any; -}; - -export type NotificationButtonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class NotificationButton extends SvelteComponentTyped< NotificationButtonProps, diff --git a/types/Notification/NotificationIcon.svelte.d.ts b/types/Notification/NotificationIcon.d.ts similarity index 70% rename from types/Notification/NotificationIcon.svelte.d.ts rename to types/Notification/NotificationIcon.d.ts index 19736ad6..06fceb5b 100644 --- a/types/Notification/NotificationIcon.svelte.d.ts +++ b/types/Notification/NotificationIcon.d.ts @@ -1,6 +1,7 @@ -import type { SvelteComponentTyped } from "svelte"; +/// +import { SvelteComponentTyped } from "svelte"; -export type NotificationIconProps = { +export interface NotificationIconProps { /** * Specify the kind of notification icon * @default "error" @@ -21,13 +22,13 @@ export type NotificationIconProps = { /** * Specify the ARIA label for the icon - * @default undefined + * @default "Closes notification" */ - iconDescription: undefined; -}; + iconDescription?: string; +} export default class NotificationIcon extends SvelteComponentTyped< NotificationIconProps, - Record, + {}, {} > {} diff --git a/types/Notification/NotificationTextDetails.d.ts b/types/Notification/NotificationTextDetails.d.ts new file mode 100644 index 00000000..b3db36ba --- /dev/null +++ b/types/Notification/NotificationTextDetails.d.ts @@ -0,0 +1,34 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface NotificationTextDetailsProps { + /** + * Set the type of notification + * @default "toast" + */ + notificationType?: "toast" | "inline"; + + /** + * Specify the title text + * @default "Title" + */ + title?: string; + + /** + * Specify the subtitle text + * @default "" + */ + subtitle?: string; + + /** + * Specify the caption text + * @default "Caption" + */ + caption?: string; +} + +export default class NotificationTextDetails extends SvelteComponentTyped< + NotificationTextDetailsProps, + {}, + { default: {} } +> {} diff --git a/types/Notification/ToastNotification.svelte.d.ts b/types/Notification/ToastNotification.d.ts similarity index 61% rename from types/Notification/ToastNotification.svelte.d.ts rename to types/Notification/ToastNotification.d.ts index 66534bf7..82d881a6 100644 --- a/types/Notification/ToastNotification.svelte.d.ts +++ b/types/Notification/ToastNotification.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ToastNotificationProps + extends svelte.JSX.HTMLAttributes { /** * Specify the kind of notification * @default "error" @@ -53,34 +52,17 @@ type $Props = { caption?: string; /** - * Specify the ARIA label for the status icon - * @default kind + " icon" + * Specify the ARIA label for the icon + * @default "Closes notification" */ - statusIconDescription?: string; - - /** - * Specify the ARIA label for the close button - * @default "Close notification" - */ - closeButtonDescription?: string; + iconDescription?: string; /** * Set to `true` to hide the close button * @default false */ hideCloseButton?: boolean; - - /** - * Set to `true` for the notification to span - * the full width of its containing element. - * @default false - */ - fullWidth?: boolean; - - [key: `data-${string}`]: any; -}; - -export type ToastNotificationProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ToastNotification extends SvelteComponentTyped< ToastNotificationProps, @@ -91,5 +73,5 @@ export default class ToastNotification extends SvelteComponentTyped< mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; }, - { default: {}; caption: {}; subtitle: {}; title: {} } + { default: {} } > {} diff --git a/types/NumberInput/NumberInput.svelte.d.ts b/types/NumberInput/NumberInput.d.ts similarity index 71% rename from types/NumberInput/NumberInput.svelte.d.ts rename to types/NumberInput/NumberInput.d.ts index a0296982..cb227327 100644 --- a/types/NumberInput/NumberInput.svelte.d.ts +++ b/types/NumberInput/NumberInput.d.ts @@ -1,23 +1,20 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; export type NumberInputTranslationId = "increment" | "decrement"; -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface NumberInputProps + extends svelte.JSX.HTMLAttributes { /** * Set the size of the input - * @default undefined */ size?: "sm" | "xl"; /** - * Specify the input value. - * Use `null` to denote "no value" - * @default null + * Specify the input value + * @default "" */ - value?: null | number; + value?: number | string; /** * Specify the step increment @@ -27,13 +24,11 @@ type $Props = { /** * Specify the maximum value - * @default undefined */ max?: number; /** * Specify the minimum value - * @default undefined */ min?: number; @@ -49,6 +44,12 @@ type $Props = { */ readonly?: boolean; + /** + * Set to `true` to enable the mobile variant + * @default false + */ + mobile?: boolean; + /** * Set to `true` to allow for an empty value * @default false @@ -61,12 +62,6 @@ type $Props = { */ disabled?: boolean; - /** - * Set to `true` to hide the input stepper buttons - * @default false - */ - hideSteppers?: boolean; - /** * Specify the ARIA label for the increment icons * @default "" @@ -121,6 +116,13 @@ type $Props = { */ translateWithId?: (id: NumberInputTranslationId) => string; + /** + * Default translation ids + * @constant + * @default { increment: "increment", decrement: "decrement", } + */ + translationIds?: { increment: "increment"; decrement: "decrement" }; + /** * Set an id for the input element * @default "ccs-" + Math.random().toString(36) @@ -129,7 +131,6 @@ type $Props = { /** * Specify a name attribute for the input - * @default undefined */ name?: string; @@ -138,31 +139,17 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type NumberInputProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class NumberInput extends SvelteComponentTyped< NumberInputProps, { - change: CustomEvent; - input: CustomEvent; + change: CustomEvent; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; - keydown: WindowEventMap["keydown"]; - keyup: WindowEventMap["keyup"]; - focus: WindowEventMap["focus"]; - blur: WindowEventMap["blur"]; - paste: WindowEventMap["paste"]; + input: WindowEventMap["input"]; }, { label: {} } -> { - /** - * Default translation ids - */ - translationIds: { increment: "increment"; decrement: "decrement" }; -} +> {} diff --git a/types/NumberInput/NumberInputSkeleton.svelte.d.ts b/types/NumberInput/NumberInputSkeleton.d.ts similarity index 57% rename from types/NumberInput/NumberInputSkeleton.svelte.d.ts rename to types/NumberInput/NumberInputSkeleton.d.ts index 90a6b84e..590d1769 100644 --- a/types/NumberInput/NumberInputSkeleton.svelte.d.ts +++ b/types/NumberInput/NumberInputSkeleton.d.ts @@ -1,19 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface NumberInputSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to hide the label text * @default false */ hideLabel?: boolean; - - [key: `data-${string}`]: any; -}; - -export type NumberInputSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class NumberInputSkeleton extends SvelteComponentTyped< NumberInputSkeletonProps, diff --git a/types/OrderedList/OrderedList.svelte.d.ts b/types/OrderedList/OrderedList.d.ts similarity index 55% rename from types/OrderedList/OrderedList.svelte.d.ts rename to types/OrderedList/OrderedList.d.ts index bbacabce..f44bda3c 100644 --- a/types/OrderedList/OrderedList.svelte.d.ts +++ b/types/OrderedList/OrderedList.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["ol"]; - -type $Props = { +export interface OrderedListProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to use the nested variant * @default false @@ -15,17 +14,7 @@ type $Props = { * @default false */ native?: boolean; - - /** - * Set to `true` to use Carbon's expressive typesetting - * @default false - */ - expressive?: boolean; - - [key: `data-${string}`]: any; -}; - -export type OrderedListProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class OrderedList extends SvelteComponentTyped< OrderedListProps, diff --git a/types/OverflowMenu/OverflowMenu.svelte.d.ts b/types/OverflowMenu/OverflowMenu.d.ts similarity index 73% rename from types/OverflowMenu/OverflowMenu.svelte.d.ts rename to types/OverflowMenu/OverflowMenu.d.ts index 8855d12c..cf16c37d 100644 --- a/types/OverflowMenu/OverflowMenu.svelte.d.ts +++ b/types/OverflowMenu/OverflowMenu.d.ts @@ -1,12 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["button"]; - -type $Props = { +export interface OverflowMenuProps + extends svelte.JSX.HTMLAttributes { /** * Specify the size of the overflow menu - * @default undefined */ size?: "sm" | "xl"; @@ -36,20 +34,16 @@ type $Props = { /** * Specify the menu options class - * @default undefined */ menuOptionsClass?: string; /** - * Specify the icon to render. - * Defaults to `` - * @default undefined + * Specify the icon from `carbon-icons-svelte` to render */ - icon?: any; + icon?: typeof import("carbon-icons-svelte").CarbonIcon; /** * Specify the icon class - * @default undefined */ iconClass?: string; @@ -76,16 +70,12 @@ type $Props = { * @default null */ menuRef?: null | HTMLUListElement; - - [key: `data-${string}`]: any; -}; - -export type OverflowMenuProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class OverflowMenu extends SvelteComponentTyped< OverflowMenuProps, { - close: CustomEvent; + close: CustomEvent<{ index: number; text: string }>; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; diff --git a/types/OverflowMenu/OverflowMenuItem.svelte.d.ts b/types/OverflowMenu/OverflowMenuItem.d.ts similarity index 76% rename from types/OverflowMenu/OverflowMenuItem.svelte.d.ts rename to types/OverflowMenu/OverflowMenuItem.d.ts index e025f961..ac834b4e 100644 --- a/types/OverflowMenu/OverflowMenuItem.svelte.d.ts +++ b/types/OverflowMenu/OverflowMenuItem.d.ts @@ -1,12 +1,11 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["li"]; - -type $Props = { +export interface OverflowMenuItemProps + extends svelte.JSX.HTMLAttributes { /** - * Specify the item text. - * Alternatively, use the default slot + * Specify the item text + * Alternatively, use the default slot for a custom element * @default "Provide text" */ text?: string; @@ -58,11 +57,7 @@ type $Props = { * @default null */ ref?: null | HTMLAnchorElement | HTMLButtonElement; - - [key: `data-${string}`]: any; -}; - -export type OverflowMenuItemProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class OverflowMenuItem extends SvelteComponentTyped< OverflowMenuItemProps, diff --git a/types/Pagination/Pagination.svelte.d.ts b/types/Pagination/Pagination.d.ts similarity index 60% rename from types/Pagination/Pagination.svelte.d.ts rename to types/Pagination/Pagination.d.ts index 71aa600f..3918f385 100644 --- a/types/Pagination/Pagination.svelte.d.ts +++ b/types/Pagination/Pagination.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface PaginationProps + extends svelte.JSX.HTMLAttributes { /** * Specify the current page index * @default 1 @@ -16,17 +15,6 @@ type $Props = { */ totalItems?: number; - /** - * If `totalItems` is a large number, it can affect the - * rendering performance of this component since its value - * is used to calculate the number of pages in the native - * select dropdown. This value creates a small window of - * pages rendered around the current page. By default, - * a maximum of 1000 select items are rendered. - * @default 1000 - */ - pageWindow?: number; - /** * Set to `true` to disable the pagination * @default false @@ -53,13 +41,13 @@ type $Props = { /** * Override the item text - * @default (min, max) => `${min.toLocaleString()}–${max.toLocaleString()} item${max === 1 ? "" : "s"}` + * @default (min, max) => `${min}–${max} items` */ itemText?: (min: number, max: number) => string; /** * Override the item range text - * @default (min, max, total) => `${min.toLocaleString()}–${max.toLocaleString()} of ${total.toLocaleString()} item${max === 1 ? "" : "s"}` + * @default (min, max, total) => `${min}–${max} of ${total} items` */ itemRangeText?: (min: number, max: number, total: number) => string; @@ -85,7 +73,7 @@ type $Props = { * Specify the available page sizes * @default [10] */ - pageSizes?: ReadonlyArray; + pageSizes?: number[]; /** * Set to `true` if the number of pages is unknown @@ -95,13 +83,13 @@ type $Props = { /** * Override the page text - * @default (page) => `page ${page.toLocaleString()}` + * @default (page) => `page ${page}` */ pageText?: (page: number) => string; /** * Override the page range text - * @default (current, total) => `of ${total.toLocaleString()} page${total === 1 ? "" : "s"}` + * @default (current, total) => `of ${total} page${total === 1 ? "" : "s"}` */ pageRangeText?: (current: number, total: number) => string; @@ -110,20 +98,14 @@ type $Props = { * @default "ccs-" + Math.random().toString(36) */ id?: string; - - [key: `data-${string}`]: any; -}; - -export type PaginationProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Pagination extends SvelteComponentTyped< PaginationProps, { - /** Dispatched after any user interaction */ - change: CustomEvent<{ page?: number; pageSize?: number }>; + update: CustomEvent<{ pageSize: number; page: number }>; ["click:button--previous"]: CustomEvent<{ page: number }>; ["click:button--next"]: CustomEvent<{ page: number }>; - update: CustomEvent<{ pageSize: number; page: number }>; }, {} > {} diff --git a/types/Pagination/PaginationSkeleton.svelte.d.ts b/types/Pagination/PaginationSkeleton.d.ts similarity index 50% rename from types/Pagination/PaginationSkeleton.svelte.d.ts rename to types/Pagination/PaginationSkeleton.d.ts index 8195dc01..f3058ab4 100644 --- a/types/Pagination/PaginationSkeleton.svelte.d.ts +++ b/types/Pagination/PaginationSkeleton.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type PaginationSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +export interface PaginationSkeletonProps + extends svelte.JSX.HTMLAttributes {} export default class PaginationSkeleton extends SvelteComponentTyped< PaginationSkeletonProps, diff --git a/types/PaginationNav/PaginationNav.svelte.d.ts b/types/PaginationNav/PaginationNav.d.ts similarity index 60% rename from types/PaginationNav/PaginationNav.svelte.d.ts rename to types/PaginationNav/PaginationNav.d.ts index 4412e7a9..b874be1b 100644 --- a/types/PaginationNav/PaginationNav.svelte.d.ts +++ b/types/PaginationNav/PaginationNav.d.ts @@ -1,12 +1,11 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["nav"]; - -type $Props = { +export interface PaginationNavProps + extends svelte.JSX.HTMLAttributes { /** * Specify the current page index - * @default 1 + * @default 0 */ page?: number; @@ -39,22 +38,11 @@ type $Props = { * @default "Previous page" */ backwardText?: string; - - /** - * Set the position of the tooltip relative to the pagination buttons. - * @default "bottom" - */ - tooltipPosition?: "top" | "right" | "bottom" | "left" | "outside" | "inside"; - - [key: `data-${string}`]: any; -}; - -export type PaginationNavProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class PaginationNav extends SvelteComponentTyped< PaginationNavProps, { - /** fires after every user interaction */ change: CustomEvent<{ page: number }>; ["click:button--previous"]: CustomEvent<{ page: number }>; ["click:button--next"]: CustomEvent<{ page: number }>; diff --git a/types/Popover/Popover.svelte.d.ts b/types/Popover/Popover.d.ts similarity index 74% rename from types/Popover/Popover.svelte.d.ts rename to types/Popover/Popover.d.ts index 893ed1dc..f8feec0d 100644 --- a/types/Popover/Popover.svelte.d.ts +++ b/types/Popover/Popover.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface PopoverProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to display the popover * @default false @@ -57,14 +56,10 @@ type $Props = { * @default false */ relative?: boolean; - - [key: `data-${string}`]: any; -}; - -export type PopoverProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Popover extends SvelteComponentTyped< PopoverProps, - { ["click:outside"]: CustomEvent<{ target: HTMLElement }> }, + { ["click:outside"]: CustomEvent }, { default: {} } > {} diff --git a/types/ProgressBar/ProgressBar.svelte.d.ts b/types/ProgressBar/ProgressBar.svelte.d.ts deleted file mode 100644 index dc76989b..00000000 --- a/types/ProgressBar/ProgressBar.svelte.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - /** - * Specify the current value - * @default undefined - */ - value?: number; - - /** - * Specify the maximum value - * @default 100 - */ - max?: number; - - /** - * Specify the kind of progress bar - * @default "default" - */ - kind?: "default" | "inline" | "indented"; - - /** - * Specify the status - * @default "active" - */ - status?: "active" | "finished" | "error"; - - /** - * Specify the size - * @default "md" - */ - size?: "sm" | "md"; - - /** - * Specify the label text - * @default "" - */ - labelText?: string; - - /** - * Set to `true` to visually hide the label text - * @default false - */ - hideLabel?: boolean; - - /** - * Specify the helper text - * @default "" - */ - helperText?: string; - - /** - * Set an id for the progress bar element - * @default "ccs-" + Math.random().toString(36) - */ - id?: string; - - [key: `data-${string}`]: any; -}; - -export type ProgressBarProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class ProgressBar extends SvelteComponentTyped< - ProgressBarProps, - Record, - { labelText: {} } -> {} diff --git a/types/ProgressIndicator/ProgressIndicator.svelte.d.ts b/types/ProgressIndicator/ProgressIndicator.d.ts similarity index 73% rename from types/ProgressIndicator/ProgressIndicator.svelte.d.ts rename to types/ProgressIndicator/ProgressIndicator.d.ts index 4e234b61..34e9f609 100644 --- a/types/ProgressIndicator/ProgressIndicator.svelte.d.ts +++ b/types/ProgressIndicator/ProgressIndicator.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["ul"]; - -type $Props = { +export interface ProgressIndicatorProps + extends svelte.JSX.HTMLAttributes { /** * Specify the current step index * @default 0 @@ -27,11 +26,7 @@ type $Props = { * @default false */ preventChangeOnClick?: boolean; - - [key: `data-${string}`]: any; -}; - -export type ProgressIndicatorProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ProgressIndicator extends SvelteComponentTyped< ProgressIndicatorProps, diff --git a/types/ProgressIndicator/ProgressIndicatorSkeleton.svelte.d.ts b/types/ProgressIndicator/ProgressIndicatorSkeleton.d.ts similarity index 62% rename from types/ProgressIndicator/ProgressIndicatorSkeleton.svelte.d.ts rename to types/ProgressIndicator/ProgressIndicatorSkeleton.d.ts index d68ad1ac..1e0a71c5 100644 --- a/types/ProgressIndicator/ProgressIndicatorSkeleton.svelte.d.ts +++ b/types/ProgressIndicator/ProgressIndicatorSkeleton.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["ul"]; - -type $Props = { +export interface ProgressIndicatorSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to use the vertical variant * @default false @@ -15,12 +14,7 @@ type $Props = { * @default 4 */ count?: number; - - [key: `data-${string}`]: any; -}; - -export type ProgressIndicatorSkeletonProps = Omit<$RestProps, keyof $Props> & - $Props; +} export default class ProgressIndicatorSkeleton extends SvelteComponentTyped< ProgressIndicatorSkeletonProps, diff --git a/types/ProgressIndicator/ProgressStep.svelte.d.ts b/types/ProgressIndicator/ProgressStep.d.ts similarity index 80% rename from types/ProgressIndicator/ProgressStep.svelte.d.ts rename to types/ProgressIndicator/ProgressStep.d.ts index d85f374e..67b78913 100644 --- a/types/ProgressIndicator/ProgressStep.svelte.d.ts +++ b/types/ProgressIndicator/ProgressStep.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["li"]; - -type $Props = { +export interface ProgressStepProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` for the complete variant * @default false @@ -51,11 +50,7 @@ type $Props = { * @default "ccs-" + Math.random().toString(36) */ id?: string; - - [key: `data-${string}`]: any; -}; - -export type ProgressStepProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ProgressStep extends SvelteComponentTyped< ProgressStepProps, diff --git a/types/README.md b/types/README.md new file mode 100644 index 00000000..51847b04 --- /dev/null +++ b/types/README.md @@ -0,0 +1,7 @@ +# types + +The TypeScript definitions in this folder are auto-generated by [sveld](https://github.com/ibm/sveld). + +Do not edit these types directly. To add or update property types or definitions, update the JSDoc annotations in the component source code in the [src](../src) folder. + +Tests are located in the [tests](../tests) folder. diff --git a/types/RadioButton/RadioButton.svelte.d.ts b/types/RadioButton/RadioButton.d.ts similarity index 56% rename from types/RadioButton/RadioButton.svelte.d.ts rename to types/RadioButton/RadioButton.d.ts index 6933bef7..70ebec13 100644 --- a/types/RadioButton/RadioButton.svelte.d.ts +++ b/types/RadioButton/RadioButton.d.ts @@ -1,14 +1,13 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface RadioButtonProps + extends svelte.JSX.HTMLAttributes { /** * Specify the value of the radio button * @default "" */ - value?: string | number; + value?: string; /** * Set to `true` to check the radio button @@ -17,17 +16,11 @@ type $Props = { checked?: boolean; /** - * Set to `true` to disable the radio button + * et to `true` to disable the radio button * @default false */ disabled?: boolean; - /** - * Set to `true` to mark the field as required - * @default false - */ - required?: boolean; - /** * Specify the label position * @default "right" @@ -53,8 +46,8 @@ type $Props = { id?: string; /** - * Specify a name attribute for the radio button input - * @default undefined + * Specify a name attribute for the checkbox input + * @default "" */ name?: string; @@ -63,18 +56,10 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type RadioButtonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class RadioButton extends SvelteComponentTyped< RadioButtonProps, - { - focus: WindowEventMap["focus"]; - blur: WindowEventMap["blur"]; - change: WindowEventMap["change"]; - }, - { labelText: {} } + { change: WindowEventMap["change"] }, + {} > {} diff --git a/types/RadioButton/RadioButtonSkeleton.svelte.d.ts b/types/RadioButton/RadioButtonSkeleton.d.ts similarity index 50% rename from types/RadioButton/RadioButtonSkeleton.svelte.d.ts rename to types/RadioButton/RadioButtonSkeleton.d.ts index b5f9532f..bb4d6425 100644 --- a/types/RadioButton/RadioButtonSkeleton.svelte.d.ts +++ b/types/RadioButton/RadioButtonSkeleton.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type RadioButtonSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +export interface RadioButtonSkeletonProps + extends svelte.JSX.HTMLAttributes {} export default class RadioButtonSkeleton extends SvelteComponentTyped< RadioButtonSkeletonProps, diff --git a/types/RadioButtonGroup/RadioButtonGroup.svelte.d.ts b/types/RadioButtonGroup/RadioButtonGroup.d.ts similarity index 53% rename from types/RadioButtonGroup/RadioButtonGroup.svelte.d.ts rename to types/RadioButtonGroup/RadioButtonGroup.d.ts index b341e6ec..3b0f95db 100644 --- a/types/RadioButtonGroup/RadioButtonGroup.svelte.d.ts +++ b/types/RadioButtonGroup/RadioButtonGroup.d.ts @@ -1,14 +1,12 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface RadioButtonGroupProps + extends svelte.JSX.HTMLAttributes { /** * Set the selected radio button value - * @default undefined */ - selected?: string | number; + selected?: string; /** * Set to `true` to disable the radio buttons @@ -16,30 +14,12 @@ type $Props = { */ disabled?: boolean; - /** - * Set to `true` to require the selection of a radio button - * @default undefined - */ - required?: boolean; - - /** - * Specify a name attribute for the radio button inputs - * @default undefined - */ - name?: string; - /** * Specify the legend text * @default "" */ legendText?: string; - /** - * Set to `true` to visually hide the legend - * @default false - */ - hideLegend?: boolean; - /** * Specify the label position * @default "right" @@ -54,23 +34,18 @@ type $Props = { /** * Set an id for the container div element - * @default undefined */ id?: string; - - [key: `data-${string}`]: any; -}; - -export type RadioButtonGroupProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class RadioButtonGroup extends SvelteComponentTyped< RadioButtonGroupProps, { - change: CustomEvent; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; + change: CustomEvent; }, { default: {}; legendText: {} } > {} diff --git a/types/RecursiveList/RecursiveList.svelte.d.ts b/types/RecursiveList/RecursiveList.svelte.d.ts deleted file mode 100644 index f261fda1..00000000 --- a/types/RecursiveList/RecursiveList.svelte.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -export interface RecursiveListNode { - text?: string; - href?: string; - html?: string; -} - -type $RestProps = SvelteHTMLElements["ul"] & SvelteHTMLElements["ol"]; - -type $Props = { - /** - * Specify the nodes to render - * @default [] - */ - nodes?: Array; - - /** - * Specify the type of list to render - * @default "unordered" - */ - type?: "unordered" | "ordered" | "ordered-native"; - - [key: `data-${string}`]: any; -}; - -export type RecursiveListProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class RecursiveList extends SvelteComponentTyped< - RecursiveListProps, - Record, - {} -> {} diff --git a/types/Search/Search.svelte.d.ts b/types/Search/Search.d.ts similarity index 71% rename from types/Search/Search.svelte.d.ts rename to types/Search/Search.d.ts index f5481dd8..ce62a728 100644 --- a/types/Search/Search.svelte.d.ts +++ b/types/Search/Search.d.ts @@ -1,14 +1,11 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface SearchProps { /** - * Specify the value of the search input - * @default "" + * @default false */ - value?: any; + small?: boolean; /** * Specify the size of the search input @@ -41,16 +38,16 @@ type $Props = { disabled?: boolean; /** - * Set to `true` to enable the expandable variant - * @default false + * Specify the value of the search input + * @default "" */ - expandable?: boolean; + value?: string; /** - * Set to `true to expand the search input - * @default false + * Specify the `type` attribute of the search input + * @default "text" */ - expanded?: boolean; + type?: string; /** * Specify the `placeholder` attribute of the search input @@ -82,13 +79,6 @@ type $Props = { */ labelText?: string; - /** - * Specify the icon to render. - * Defaults to `` - * @default undefined - */ - icon?: any; - /** * Set an id for the input element * @default "ccs-" + Math.random().toString(36) @@ -100,17 +90,11 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type SearchProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Search extends SvelteComponentTyped< SearchProps, { - expand: CustomEvent; - collapse: CustomEvent; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; @@ -120,9 +104,7 @@ export default class Search extends SvelteComponentTyped< focus: WindowEventMap["focus"]; blur: WindowEventMap["blur"]; keydown: WindowEventMap["keydown"]; - keyup: WindowEventMap["keyup"]; - paste: WindowEventMap["paste"]; - clear: CustomEvent; + clear: CustomEvent; }, - { labelText: {} } + {} > {} diff --git a/types/Search/SearchSkeleton.svelte.d.ts b/types/Search/SearchSkeleton.d.ts similarity index 57% rename from types/Search/SearchSkeleton.svelte.d.ts rename to types/Search/SearchSkeleton.d.ts index 133849d1..eaeb4ec5 100644 --- a/types/Search/SearchSkeleton.svelte.d.ts +++ b/types/Search/SearchSkeleton.d.ts @@ -1,19 +1,19 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; +export interface SearchSkeletonProps + extends svelte.JSX.HTMLAttributes { + /** + * @default false + */ + small?: boolean; -type $Props = { /** * Specify the size of the search input * @default "xl" */ size?: "sm" | "lg" | "xl"; - - [key: `data-${string}`]: any; -}; - -export type SearchSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class SearchSkeleton extends SvelteComponentTyped< SearchSkeletonProps, diff --git a/types/Select/Select.svelte.d.ts b/types/Select/Select.d.ts similarity index 67% rename from types/Select/Select.svelte.d.ts rename to types/Select/Select.d.ts index 295837e0..93bc7546 100644 --- a/types/Select/Select.svelte.d.ts +++ b/types/Select/Select.d.ts @@ -1,18 +1,15 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface SelectProps + extends svelte.JSX.HTMLAttributes { /** * Specify the selected item value - * @default undefined */ - selected?: string | number; + selected?: string; /** * Set the size of the select input - * @default undefined */ size?: "sm" | "xl"; @@ -42,7 +39,6 @@ type $Props = { /** * Specify a name attribute for the select element - * @default undefined */ name?: string; @@ -99,26 +95,10 @@ type $Props = { * @default null */ ref?: null | HTMLSelectElement; - - /** - * Set to `true` to mark the field as required - * @default false - */ - required?: boolean; - - [key: `data-${string}`]: any; -}; - -export type SelectProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Select extends SvelteComponentTyped< SelectProps, - { - /** The selected value. */ update: CustomEvent; - change: WindowEventMap["change"]; - input: WindowEventMap["input"]; - focus: WindowEventMap["focus"]; - blur: WindowEventMap["blur"]; - }, - { default: {}; labelText: {} } + { change: CustomEvent; blur: WindowEventMap["blur"] }, + { default: {} } > {} diff --git a/types/Select/SelectItem.d.ts b/types/Select/SelectItem.d.ts new file mode 100644 index 00000000..b26d5581 --- /dev/null +++ b/types/Select/SelectItem.d.ts @@ -0,0 +1,34 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface SelectItemProps { + /** + * Specify the option value + * @default "" + */ + value?: string; + + /** + * Specify the option text + * @default "" + */ + text?: string; + + /** + * Set to `true` to hide the option + * @default false + */ + hidden?: boolean; + + /** + * Set to `true` to disable the option + * @default false + */ + disabled?: boolean; +} + +export default class SelectItem extends SvelteComponentTyped< + SelectItemProps, + {}, + {} +> {} diff --git a/types/Select/SelectItem.svelte.d.ts b/types/Select/SelectItem.svelte.d.ts deleted file mode 100644 index 2d1106b7..00000000 --- a/types/Select/SelectItem.svelte.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; - -export type SelectItemProps = { - /** - * Specify the option value - * @default "" - */ - value?: string | number; - - /** - * Specify the option text - * If not specified, the value will be used as the text. - * @default undefined - */ - text?: string; - - /** - * Set to `true` to hide the option - * @default false - */ - hidden?: boolean; - - /** - * Set to `true` to disable the option - * @default false - */ - disabled?: boolean; - - /** - * Specify the class of the `option` element - * @default undefined - */ - class?: string; - - /** - * Specify the style of the `option` element - * @default undefined - */ - style?: string; -}; - -export default class SelectItem extends SvelteComponentTyped< - SelectItemProps, - Record, - {} -> {} diff --git a/types/Select/SelectItemGroup.svelte.d.ts b/types/Select/SelectItemGroup.d.ts similarity index 51% rename from types/Select/SelectItemGroup.svelte.d.ts rename to types/Select/SelectItemGroup.d.ts index 679202d7..ff563428 100644 --- a/types/Select/SelectItemGroup.svelte.d.ts +++ b/types/Select/SelectItemGroup.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["optgroup"]; - -type $Props = { +export interface SelectItemGroupProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to disable the optgroup element * @default false @@ -15,14 +14,10 @@ type $Props = { * @default "Provide label" */ label?: string; - - [key: `data-${string}`]: any; -}; - -export type SelectItemGroupProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class SelectItemGroup extends SvelteComponentTyped< SelectItemGroupProps, - Record, + {}, { default: {} } > {} diff --git a/types/Select/SelectSkeleton.svelte.d.ts b/types/Select/SelectSkeleton.d.ts similarity index 57% rename from types/Select/SelectSkeleton.svelte.d.ts rename to types/Select/SelectSkeleton.d.ts index 52d7f8cf..4440e750 100644 --- a/types/Select/SelectSkeleton.svelte.d.ts +++ b/types/Select/SelectSkeleton.d.ts @@ -1,19 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface SelectSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to hide the label text * @default false */ hideLabel?: boolean; - - [key: `data-${string}`]: any; -}; - -export type SelectSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class SelectSkeleton extends SvelteComponentTyped< SelectSkeletonProps, diff --git a/types/SkeletonPlaceholder/SkeletonPlaceholder.svelte.d.ts b/types/SkeletonPlaceholder/SkeletonPlaceholder.d.ts similarity index 50% rename from types/SkeletonPlaceholder/SkeletonPlaceholder.svelte.d.ts rename to types/SkeletonPlaceholder/SkeletonPlaceholder.d.ts index 4e63e986..83780094 100644 --- a/types/SkeletonPlaceholder/SkeletonPlaceholder.svelte.d.ts +++ b/types/SkeletonPlaceholder/SkeletonPlaceholder.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type SkeletonPlaceholderProps = Omit<$RestProps, keyof $Props> & $Props; +export interface SkeletonPlaceholderProps + extends svelte.JSX.HTMLAttributes {} export default class SkeletonPlaceholder extends SvelteComponentTyped< SkeletonPlaceholderProps, diff --git a/types/SkeletonText/SkeletonText.svelte.d.ts b/types/SkeletonText/SkeletonText.d.ts similarity index 70% rename from types/SkeletonText/SkeletonText.svelte.d.ts rename to types/SkeletonText/SkeletonText.d.ts index fe46653c..0d5134d0 100644 --- a/types/SkeletonText/SkeletonText.svelte.d.ts +++ b/types/SkeletonText/SkeletonText.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface SkeletonTextProps + extends svelte.JSX.HTMLAttributes { /** * Specify the number of lines to render * @default 3 @@ -27,11 +26,7 @@ type $Props = { * @default "100%" */ width?: string; - - [key: `data-${string}`]: any; -}; - -export type SkeletonTextProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class SkeletonText extends SvelteComponentTyped< SkeletonTextProps, diff --git a/types/Slider/Slider.svelte.d.ts b/types/Slider/Slider.d.ts similarity index 70% rename from types/Slider/Slider.svelte.d.ts rename to types/Slider/Slider.d.ts index 1767186f..66e7e1af 100644 --- a/types/Slider/Slider.svelte.d.ts +++ b/types/Slider/Slider.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface SliderProps + extends svelte.JSX.HTMLAttributes { /** * Specify the value of the slider * @default 0 @@ -76,13 +75,6 @@ type $Props = { */ hideTextInput?: boolean; - /** - * Set to `true` for the slider to span - * the full width of its containing element. - * @default false - */ - fullWidth?: boolean; - /** * Set an id for the slider div element * @default "ccs-" + Math.random().toString(36) @@ -96,18 +88,11 @@ type $Props = { invalid?: boolean; /** - * Specify the label text. - * Alternatively, use the "labelText" slot (e.g., `...`) + * Specify the label text * @default "" */ labelText?: string; - /** - * Set to `true` to visually hide the label text - * @default false - */ - hideLabel?: boolean; - /** * Set a name for the slider element * @default "" @@ -119,21 +104,16 @@ type $Props = { * @default null */ ref?: null | HTMLDivElement; - - [key: `data-${string}`]: any; -}; - -export type SliderProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Slider extends SvelteComponentTyped< SliderProps, { - change: CustomEvent; - input: CustomEvent; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; + change: CustomEvent; }, - { labelText: {} } + {} > {} diff --git a/types/Slider/SliderSkeleton.svelte.d.ts b/types/Slider/SliderSkeleton.d.ts similarity index 57% rename from types/Slider/SliderSkeleton.svelte.d.ts rename to types/Slider/SliderSkeleton.d.ts index bf98628d..48e7fc0b 100644 --- a/types/Slider/SliderSkeleton.svelte.d.ts +++ b/types/Slider/SliderSkeleton.d.ts @@ -1,19 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface SliderSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to hide the label text * @default false */ hideLabel?: boolean; - - [key: `data-${string}`]: any; -}; - -export type SliderSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class SliderSkeleton extends SvelteComponentTyped< SliderSkeletonProps, diff --git a/types/StructuredList/StructuredList.svelte.d.ts b/types/StructuredList/StructuredList.d.ts similarity index 50% rename from types/StructuredList/StructuredList.svelte.d.ts rename to types/StructuredList/StructuredList.d.ts index ce78c5e6..e405578f 100644 --- a/types/StructuredList/StructuredList.svelte.d.ts +++ b/types/StructuredList/StructuredList.d.ts @@ -1,46 +1,34 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface StructuredListProps + extends svelte.JSX.HTMLAttributes { /** * Specify the selected structured list row value - * @default undefined */ selected?: string; /** - * Set to `true` to use the condensed variant + * Set to `true` to use the bordered variant * @default false */ - condensed?: boolean; - - /** - * Set to `true` to flush the list - * @default false - */ - flush?: boolean; + border?: boolean; /** * Set to `true` to use the selection variant * @default false */ selection?: boolean; - - [key: `data-${string}`]: any; -}; - -export type StructuredListProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class StructuredList extends SvelteComponentTyped< StructuredListProps, { - change: CustomEvent; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; + change: CustomEvent; }, { default: {} } > {} diff --git a/types/StructuredList/StructuredListBody.svelte.d.ts b/types/StructuredList/StructuredListBody.d.ts similarity index 51% rename from types/StructuredList/StructuredListBody.svelte.d.ts rename to types/StructuredList/StructuredListBody.d.ts index d64e16fd..4420d56e 100644 --- a/types/StructuredList/StructuredListBody.svelte.d.ts +++ b/types/StructuredList/StructuredListBody.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type StructuredListBodyProps = Omit<$RestProps, keyof $Props> & $Props; +export interface StructuredListBodyProps + extends svelte.JSX.HTMLAttributes {} export default class StructuredListBody extends SvelteComponentTyped< StructuredListBodyProps, diff --git a/types/StructuredList/StructuredListCell.svelte.d.ts b/types/StructuredList/StructuredListCell.d.ts similarity index 62% rename from types/StructuredList/StructuredListCell.svelte.d.ts rename to types/StructuredList/StructuredListCell.d.ts index b05c8e65..52badf55 100644 --- a/types/StructuredList/StructuredListCell.svelte.d.ts +++ b/types/StructuredList/StructuredListCell.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface StructuredListCellProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to use as a header * @default false @@ -15,11 +14,7 @@ type $Props = { * @default false */ noWrap?: boolean; - - [key: `data-${string}`]: any; -}; - -export type StructuredListCellProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class StructuredListCell extends SvelteComponentTyped< StructuredListCellProps, diff --git a/types/StructuredList/StructuredListHead.svelte.d.ts b/types/StructuredList/StructuredListHead.d.ts similarity index 51% rename from types/StructuredList/StructuredListHead.svelte.d.ts rename to types/StructuredList/StructuredListHead.d.ts index e06697f8..a5d0635e 100644 --- a/types/StructuredList/StructuredListHead.svelte.d.ts +++ b/types/StructuredList/StructuredListHead.d.ts @@ -1,13 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type StructuredListHeadProps = Omit<$RestProps, keyof $Props> & $Props; +export interface StructuredListHeadProps + extends svelte.JSX.HTMLAttributes {} export default class StructuredListHead extends SvelteComponentTyped< StructuredListHeadProps, diff --git a/types/StructuredList/StructuredListInput.svelte.d.ts b/types/StructuredList/StructuredListInput.d.ts similarity index 68% rename from types/StructuredList/StructuredListInput.svelte.d.ts rename to types/StructuredList/StructuredListInput.d.ts index a6c85a30..8fd7fb24 100644 --- a/types/StructuredList/StructuredListInput.svelte.d.ts +++ b/types/StructuredList/StructuredListInput.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface StructuredListInputProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to check the input * @default false @@ -39,14 +38,10 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type StructuredListInputProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class StructuredListInput extends SvelteComponentTyped< StructuredListInputProps, - Record, + {}, {} > {} diff --git a/types/StructuredList/StructuredListRow.svelte.d.ts b/types/StructuredList/StructuredListRow.d.ts similarity index 67% rename from types/StructuredList/StructuredListRow.svelte.d.ts rename to types/StructuredList/StructuredListRow.d.ts index e64ac5de..f5f4c31b 100644 --- a/types/StructuredList/StructuredListRow.svelte.d.ts +++ b/types/StructuredList/StructuredListRow.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["label"]; - -type $Props = { +export interface StructuredListRowProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to use as a header * @default false @@ -21,11 +20,7 @@ type $Props = { * @default "0" */ tabindex?: string; - - [key: `data-${string}`]: any; -}; - -export type StructuredListRowProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class StructuredListRow extends SvelteComponentTyped< StructuredListRowProps, diff --git a/types/StructuredList/StructuredListSkeleton.svelte.d.ts b/types/StructuredList/StructuredListSkeleton.d.ts similarity index 56% rename from types/StructuredList/StructuredListSkeleton.svelte.d.ts rename to types/StructuredList/StructuredListSkeleton.d.ts index 1da26566..0f409f57 100644 --- a/types/StructuredList/StructuredListSkeleton.svelte.d.ts +++ b/types/StructuredList/StructuredListSkeleton.d.ts @@ -1,20 +1,20 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface StructuredListSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Specify the number of rows * @default 5 */ rows?: number; - [key: `data-${string}`]: any; -}; - -export type StructuredListSkeletonProps = Omit<$RestProps, keyof $Props> & - $Props; + /** + * Set to `true` to use the bordered variant + * @default false + */ + border?: boolean; +} export default class StructuredListSkeleton extends SvelteComponentTyped< StructuredListSkeletonProps, diff --git a/types/Tabs/Tab.svelte.d.ts b/types/Tabs/Tab.d.ts similarity index 67% rename from types/Tabs/Tab.svelte.d.ts rename to types/Tabs/Tab.d.ts index 74755b43..43b4f92b 100644 --- a/types/Tabs/Tab.svelte.d.ts +++ b/types/Tabs/Tab.d.ts @@ -1,12 +1,11 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["li"]; - -type $Props = { +export interface TabProps + extends svelte.JSX.HTMLAttributes { /** - * Specify the tab label. - * Alternatively, use the default slot (e.g., `Label`) + * Specify the tab label + * Alternatively, use the default slot (e.g., Label) * @default "" */ label?: string; @@ -40,11 +39,7 @@ type $Props = { * @default null */ ref?: null | HTMLAnchorElement; - - [key: `data-${string}`]: any; -}; - -export type TabProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Tab extends SvelteComponentTyped< TabProps, diff --git a/types/Tabs/TabContent.d.ts b/types/Tabs/TabContent.d.ts new file mode 100644 index 00000000..04acd9ee --- /dev/null +++ b/types/Tabs/TabContent.d.ts @@ -0,0 +1,17 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface TabContentProps + extends svelte.JSX.HTMLAttributes { + /** + * Set an id for the top-level element + * @default "ccs-" + Math.random().toString(36) + */ + id?: string; +} + +export default class TabContent extends SvelteComponentTyped< + TabContentProps, + {}, + { default: {} } +> {} diff --git a/types/Tabs/TabContent.svelte.d.ts b/types/Tabs/TabContent.svelte.d.ts deleted file mode 100644 index 65e59e01..00000000 --- a/types/Tabs/TabContent.svelte.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { - /** - * Set an id for the top-level element - * @default "ccs-" + Math.random().toString(36) - */ - id?: string; - - [key: `data-${string}`]: any; -}; - -export type TabContentProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class TabContent extends SvelteComponentTyped< - TabContentProps, - Record, - { default: {} } -> {} diff --git a/types/Tabs/Tabs.svelte.d.ts b/types/Tabs/Tabs.d.ts similarity index 59% rename from types/Tabs/Tabs.svelte.d.ts rename to types/Tabs/Tabs.d.ts index ad6744ca..758b46ba 100644 --- a/types/Tabs/Tabs.svelte.d.ts +++ b/types/Tabs/Tabs.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface TabsProps + extends svelte.JSX.HTMLAttributes { /** * Specify the selected tab index * @default 0 @@ -16,12 +15,6 @@ type $Props = { */ type?: "default" | "container"; - /** - * Set to `true` for tabs to have an auto-width - * @default false - */ - autoWidth?: boolean; - /** * Specify the ARIA label for the chevron icon * @default "Show menu options" @@ -33,18 +26,14 @@ type $Props = { * @default "#" */ triggerHref?: string; - - [key: `data-${string}`]: any; -}; - -export type TabsProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Tabs extends SvelteComponentTyped< TabsProps, { - change: CustomEvent; keypress: WindowEventMap["keypress"]; click: WindowEventMap["click"]; + change: CustomEvent; }, { default: {}; content: {} } > {} diff --git a/types/Tabs/TabsSkeleton.svelte.d.ts b/types/Tabs/TabsSkeleton.d.ts similarity index 62% rename from types/Tabs/TabsSkeleton.svelte.d.ts rename to types/Tabs/TabsSkeleton.d.ts index 2634390e..d9ff46dd 100644 --- a/types/Tabs/TabsSkeleton.svelte.d.ts +++ b/types/Tabs/TabsSkeleton.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface TabsSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Specify the number of tabs to render * @default 4 @@ -15,11 +14,7 @@ type $Props = { * @default "default" */ type?: "default" | "container"; - - [key: `data-${string}`]: any; -}; - -export type TabsSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TabsSkeleton extends SvelteComponentTyped< TabsSkeletonProps, diff --git a/types/Tag/Tag.svelte.d.ts b/types/Tag/Tag.d.ts similarity index 69% rename from types/Tag/Tag.svelte.d.ts rename to types/Tag/Tag.d.ts index 67f15d9a..f9d1ed8d 100644 --- a/types/Tag/Tag.svelte.d.ts +++ b/types/Tag/Tag.d.ts @@ -1,12 +1,11 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"] & SvelteHTMLElements["span"]; - -type $Props = { +export interface TagProps + extends svelte.JSX.HTMLAttributes, + svelte.JSX.HTMLAttributes { /** * Specify the type of tag - * @default undefined */ type?: | "red" @@ -19,8 +18,7 @@ type $Props = { | "gray" | "cool-gray" | "warm-gray" - | "high-contrast" - | "outline"; + | "high-contrast"; /** * @default "default" @@ -58,21 +56,16 @@ type $Props = { title?: string; /** - * Specify the icon to render - * @default undefined + * Specify the icon from `carbon-icons-svelte` to render */ - icon?: any; + icon?: typeof import("carbon-icons-svelte").CarbonIcon; /** * Set an id for the filterable tag * @default "ccs-" + Math.random().toString(36) */ id?: string; - - [key: `data-${string}`]: any; -}; - -export type TagProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Tag extends SvelteComponentTyped< TagProps, @@ -81,7 +74,7 @@ export default class Tag extends SvelteComponentTyped< mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; - close: CustomEvent; + close: CustomEvent; }, - { default: { props: { class: "bx--tag__label" } }; icon: {} } + { default: { props: { class: "bx--tag__label" } } } > {} diff --git a/types/Tag/TagSkeleton.svelte.d.ts b/types/Tag/TagSkeleton.d.ts similarity index 54% rename from types/Tag/TagSkeleton.svelte.d.ts rename to types/Tag/TagSkeleton.d.ts index 3aa9360d..139968bd 100644 --- a/types/Tag/TagSkeleton.svelte.d.ts +++ b/types/Tag/TagSkeleton.d.ts @@ -1,18 +1,13 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["span"]; - -type $Props = { +export interface TagSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * @default "default" */ size?: "sm" | "default"; - - [key: `data-${string}`]: any; -}; - -export type TagSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TagSkeleton extends SvelteComponentTyped< TagSkeletonProps, diff --git a/types/TextArea/TextArea.svelte.d.ts b/types/TextArea/TextArea.d.ts similarity index 70% rename from types/TextArea/TextArea.svelte.d.ts rename to types/TextArea/TextArea.d.ts index 475661fd..ee686e8f 100644 --- a/types/TextArea/TextArea.svelte.d.ts +++ b/types/TextArea/TextArea.d.ts @@ -1,14 +1,13 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["textarea"]; - -type $Props = { +export interface TextAreaProps + extends svelte.JSX.HTMLAttributes { /** - * Specify the textarea value. + * Specify the textarea value * @default "" */ - value?: null | string; + value?: string; /** * Specify the placeholder text @@ -28,12 +27,6 @@ type $Props = { */ rows?: number; - /** - * Specify the max character count - * @default undefined - */ - maxCount?: number; - /** * Set to `true` to enable the light variant * @default false @@ -46,12 +39,6 @@ type $Props = { */ disabled?: boolean; - /** - * Set to `true` to use the read-only variant - * @default false - */ - readonly?: boolean; - /** * Specify the helper text * @default "" @@ -90,7 +77,6 @@ type $Props = { /** * Specify a name attribute for the input - * @default undefined */ name?: string; @@ -99,11 +85,7 @@ type $Props = { * @default null */ ref?: null | HTMLTextAreaElement; - - [key: `data-${string}`]: any; -}; - -export type TextAreaProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TextArea extends SvelteComponentTyped< TextAreaProps, @@ -114,11 +96,8 @@ export default class TextArea extends SvelteComponentTyped< mouseleave: WindowEventMap["mouseleave"]; change: WindowEventMap["change"]; input: WindowEventMap["input"]; - keydown: WindowEventMap["keydown"]; - keyup: WindowEventMap["keyup"]; focus: WindowEventMap["focus"]; blur: WindowEventMap["blur"]; - paste: WindowEventMap["paste"]; }, - { labelText: {} } + {} > {} diff --git a/types/TextArea/TextAreaSkeleton.svelte.d.ts b/types/TextArea/TextAreaSkeleton.d.ts similarity index 57% rename from types/TextArea/TextAreaSkeleton.svelte.d.ts rename to types/TextArea/TextAreaSkeleton.d.ts index 144ef233..75845295 100644 --- a/types/TextArea/TextAreaSkeleton.svelte.d.ts +++ b/types/TextArea/TextAreaSkeleton.d.ts @@ -1,19 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface TextAreaSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to visually hide the label text * @default false */ hideLabel?: boolean; - - [key: `data-${string}`]: any; -}; - -export type TextAreaSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TextAreaSkeleton extends SvelteComponentTyped< TextAreaSkeletonProps, diff --git a/types/TextInput/PasswordInput.svelte.d.ts b/types/TextInput/PasswordInput.d.ts similarity index 76% rename from types/TextInput/PasswordInput.svelte.d.ts rename to types/TextInput/PasswordInput.d.ts index 470d536b..55ab9b10 100644 --- a/types/TextInput/PasswordInput.svelte.d.ts +++ b/types/TextInput/PasswordInput.d.ts @@ -1,12 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface PasswordInputProps + extends svelte.JSX.HTMLAttributes { /** * Set the size of the input - * @default undefined */ size?: "sm" | "xl"; @@ -94,24 +92,6 @@ type $Props = { */ invalidText?: string; - /** - * Set to `true` to indicate an warning state - * @default false - */ - warn?: boolean; - - /** - * Specify the warning state text - * @default "" - */ - warnText?: string; - - /** - * Set to `true` to use inline version - * @default false - */ - inline?: boolean; - /** * Set an id for the input element * @default "ccs-" + Math.random().toString(36) @@ -120,7 +100,6 @@ type $Props = { /** * Specify a name attribute for the input - * @default undefined */ name?: string; @@ -129,11 +108,7 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type PasswordInputProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class PasswordInput extends SvelteComponentTyped< PasswordInputProps, @@ -145,10 +120,8 @@ export default class PasswordInput extends SvelteComponentTyped< change: WindowEventMap["change"]; input: WindowEventMap["input"]; keydown: WindowEventMap["keydown"]; - keyup: WindowEventMap["keyup"]; focus: WindowEventMap["focus"]; blur: WindowEventMap["blur"]; - paste: WindowEventMap["paste"]; }, - { labelText: {} } + {} > {} diff --git a/types/TextInput/TextInput.svelte.d.ts b/types/TextInput/TextInput.d.ts similarity index 69% rename from types/TextInput/TextInput.svelte.d.ts rename to types/TextInput/TextInput.d.ts index 2d6a53ff..848a075e 100644 --- a/types/TextInput/TextInput.svelte.d.ts +++ b/types/TextInput/TextInput.d.ts @@ -1,23 +1,24 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface TextInputProps + extends svelte.JSX.HTMLAttributes { /** * Set the size of the input - * @default undefined */ size?: "sm" | "xl"; /** - * Specify the input value. - * - * `value` will be set to `null` if type="number" - * and the value is empty. + * Specify the input value * @default "" */ - value?: null | number | string; + value?: number | string; + + /** + * Specify the input type + * @default "" + */ + type?: string; /** * Specify the placeholder text @@ -51,7 +52,6 @@ type $Props = { /** * Specify a name attribute for the input - * @default undefined */ name?: string; @@ -104,36 +104,24 @@ type $Props = { required?: boolean; /** - * Set to `true` to use the inline variant + * Set to `true` to use inline version * @default false */ inline?: boolean; - - /** - * Set to `true` to use the read-only variant - * @default false - */ - readonly?: boolean; - - [key: `data-${string}`]: any; -}; - -export type TextInputProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TextInput extends SvelteComponentTyped< TextInputProps, { - change: CustomEvent; - input: CustomEvent; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; + change: WindowEventMap["change"]; + input: WindowEventMap["input"]; keydown: WindowEventMap["keydown"]; - keyup: WindowEventMap["keyup"]; focus: WindowEventMap["focus"]; blur: WindowEventMap["blur"]; - paste: WindowEventMap["paste"]; }, - { labelText: {} } + {} > {} diff --git a/types/TextInput/TextInputSkeleton.svelte.d.ts b/types/TextInput/TextInputSkeleton.d.ts similarity index 57% rename from types/TextInput/TextInputSkeleton.svelte.d.ts rename to types/TextInput/TextInputSkeleton.d.ts index b2893a18..cecb3ad7 100644 --- a/types/TextInput/TextInputSkeleton.svelte.d.ts +++ b/types/TextInput/TextInputSkeleton.d.ts @@ -1,19 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface TextInputSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to hide the label text * @default false */ hideLabel?: boolean; - - [key: `data-${string}`]: any; -}; - -export type TextInputSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TextInputSkeleton extends SvelteComponentTyped< TextInputSkeletonProps, diff --git a/types/Theme/Theme.svelte.d.ts b/types/Theme/Theme.svelte.d.ts deleted file mode 100644 index 0d497f1f..00000000 --- a/types/Theme/Theme.svelte.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; - -export type CarbonTheme = "white" | "g10" | "g80" | "g90" | "g100"; - -export type ThemeProps = { - /** - * Set the current Carbon theme - * @default "white" - */ - theme?: CarbonTheme; - - /** - * Customize a theme with your own tokens - * @see https://carbondesignsystem.com/guidelines/themes/overview#customizing-a-theme - * @default {} - */ - tokens?: { [token: string]: any }; - - /** - * Set to `true` to persist the theme using window.localStorage - * @default false - */ - persist?: boolean; - - /** - * Specify the local storage key - * @default "theme" - */ - persistKey?: string; - - /** - * Render a toggle or select dropdown to control the theme - * @default undefined - */ - render?: "toggle" | "select"; - - /** - * Override the default toggle props - * @default { themes: ["white", "g100"], labelA: "", labelB: "", labelText: "Dark mode", hideLabel: false, } - */ - toggle?: import("../Toggle/Toggle.svelte").ToggleProps & { - themes?: [labelA: CarbonTheme, labelB: CarbonTheme]; - }; - - /** - * Override the default select props - * @default { themes: themeKeys, labelText: "Themes", hideLabel: false, } - */ - select?: import("../Select/Select.svelte").SelectProps & { - themes?: CarbonTheme[]; - }; -}; - -export default class Theme extends SvelteComponentTyped< - ThemeProps, - { update: CustomEvent<{ theme: CarbonTheme }> }, - { default: { theme: CarbonTheme } } -> {} diff --git a/types/Tile/ClickableTile.svelte.d.ts b/types/Tile/ClickableTile.d.ts similarity index 57% rename from types/Tile/ClickableTile.svelte.d.ts rename to types/Tile/ClickableTile.d.ts index e4bcbe03..53fbd078 100644 --- a/types/Tile/ClickableTile.svelte.d.ts +++ b/types/Tile/ClickableTile.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["a"] & SvelteHTMLElements["p"]; - -type $Props = { +export interface ClickableTileProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to click the tile * @default false @@ -16,22 +15,11 @@ type $Props = { */ light?: boolean; - /** - * Set to `true` to disable the tile - * @default false - */ - disabled?: boolean; - /** * Set the `href` - * @default undefined */ href?: string; - - [key: `data-${string}`]: any; -}; - -export type ClickableTileProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ClickableTile extends SvelteComponentTyped< ClickableTileProps, diff --git a/types/Tile/ExpandableTile.svelte.d.ts b/types/Tile/ExpandableTile.d.ts similarity index 84% rename from types/Tile/ExpandableTile.svelte.d.ts rename to types/Tile/ExpandableTile.d.ts index 09d7064b..ca40a525 100644 --- a/types/Tile/ExpandableTile.svelte.d.ts +++ b/types/Tile/ExpandableTile.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["button"]; - -type $Props = { +export interface ExpandableTileProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to expand the tile * @default false @@ -69,11 +68,7 @@ type $Props = { * @default null */ ref?: null | HTMLButtonElement; - - [key: `data-${string}`]: any; -}; - -export type ExpandableTileProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ExpandableTile extends SvelteComponentTyped< ExpandableTileProps, diff --git a/types/Tile/RadioTile.svelte.d.ts b/types/Tile/RadioTile.d.ts similarity index 70% rename from types/Tile/RadioTile.svelte.d.ts rename to types/Tile/RadioTile.d.ts index 7438e03b..2810bfe6 100644 --- a/types/Tile/RadioTile.svelte.d.ts +++ b/types/Tile/RadioTile.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["label"]; - -type $Props = { +export interface RadioTileProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to check the tile * @default false @@ -22,12 +21,6 @@ type $Props = { */ disabled?: boolean; - /** - * Set to `true` to mark the field as required - * @default false - */ - required?: boolean; - /** * Specify the value of the radio input * @default "" @@ -53,15 +46,11 @@ type $Props = { id?: string; /** - * Specify a name attribute for the radio tile input - * @default undefined + * Specify a name attribute for the input + * @default "" */ name?: string; - - [key: `data-${string}`]: any; -}; - -export type RadioTileProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class RadioTile extends SvelteComponentTyped< RadioTileProps, diff --git a/types/Tile/SelectableTile.svelte.d.ts b/types/Tile/SelectableTile.d.ts similarity index 79% rename from types/Tile/SelectableTile.svelte.d.ts rename to types/Tile/SelectableTile.d.ts index 589716cc..f50a2755 100644 --- a/types/Tile/SelectableTile.svelte.d.ts +++ b/types/Tile/SelectableTile.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["label"]; - -type $Props = { +export interface SelectableTileProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to select the tile * @default false @@ -63,17 +62,11 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type SelectableTileProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class SelectableTile extends SvelteComponentTyped< SelectableTileProps, { - select: CustomEvent; - deselect: CustomEvent; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; diff --git a/types/Tile/Tile.svelte.d.ts b/types/Tile/Tile.d.ts similarity index 57% rename from types/Tile/Tile.svelte.d.ts rename to types/Tile/Tile.d.ts index c3aa83e2..69cf890f 100644 --- a/types/Tile/Tile.svelte.d.ts +++ b/types/Tile/Tile.d.ts @@ -1,19 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface TileProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to enable the light variant * @default false */ light?: boolean; - - [key: `data-${string}`]: any; -}; - -export type TileProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Tile extends SvelteComponentTyped< TileProps, diff --git a/types/Tile/TileGroup.d.ts b/types/Tile/TileGroup.d.ts new file mode 100644 index 00000000..c9ee3884 --- /dev/null +++ b/types/Tile/TileGroup.d.ts @@ -0,0 +1,28 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface TileGroupProps + extends svelte.JSX.HTMLAttributes { + /** + * Specify the selected tile value + */ + selected?: string; + + /** + * Set to `true` to disable the tile group + * @default false + */ + disabled?: boolean; + + /** + * Specify the legend text + * @default "" + */ + legend?: string; +} + +export default class TileGroup extends SvelteComponentTyped< + TileGroupProps, + { select: CustomEvent }, + { default: {} } +> {} diff --git a/types/Tile/TileGroup.svelte.d.ts b/types/Tile/TileGroup.svelte.d.ts deleted file mode 100644 index 16ad5de8..00000000 --- a/types/Tile/TileGroup.svelte.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["fieldset"]; - -type $Props = { - /** - * Specify the selected tile value - * @default undefined - */ - selected?: string; - - /** - * Set to `true` to disable the tile group - * @default false - */ - disabled?: boolean; - - /** - * Set to `true` to require the selection of a radio button - * @default undefined - */ - required?: boolean; - - /** - * Specify a name attribute for the radio button inputs - * @default undefined - */ - name?: string; - - /** - * Specify the legend text - * @default "" - */ - legend?: string; - - [key: `data-${string}`]: any; -}; - -export type TileGroupProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class TileGroup extends SvelteComponentTyped< - TileGroupProps, - { select: CustomEvent }, - { default: {} } -> {} diff --git a/types/TimePicker/TimePicker.svelte.d.ts b/types/TimePicker/TimePicker.d.ts similarity index 78% rename from types/TimePicker/TimePicker.svelte.d.ts rename to types/TimePicker/TimePicker.d.ts index 20c55f29..524f480a 100644 --- a/types/TimePicker/TimePicker.svelte.d.ts +++ b/types/TimePicker/TimePicker.d.ts @@ -1,12 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface TimePickerProps + extends svelte.JSX.HTMLAttributes { /** * Specify the size of the input - * @default undefined */ size?: "sm" | "xl"; @@ -16,6 +14,12 @@ type $Props = { */ value?: string; + /** + * Specify the input type + * @default "text" + */ + type?: string; + /** * Specify the input placeholder text * @default "hh:mm" @@ -78,7 +82,6 @@ type $Props = { /** * Specify a name attribute for the input - * @default undefined */ name?: string; @@ -87,11 +90,7 @@ type $Props = { * @default null */ ref?: null | HTMLInputElement; - - [key: `data-${string}`]: any; -}; - -export type TimePickerProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TimePicker extends SvelteComponentTyped< TimePickerProps, @@ -102,11 +101,8 @@ export default class TimePicker extends SvelteComponentTyped< mouseleave: WindowEventMap["mouseleave"]; change: WindowEventMap["change"]; input: WindowEventMap["input"]; - keydown: WindowEventMap["keydown"]; - keyup: WindowEventMap["keyup"]; focus: WindowEventMap["focus"]; blur: WindowEventMap["blur"]; - paste: WindowEventMap["paste"]; }, - { default: {}; labelText: {} } + { default: {} } > {} diff --git a/types/TimePicker/TimePickerSelect.svelte.d.ts b/types/TimePicker/TimePickerSelect.d.ts similarity index 74% rename from types/TimePicker/TimePickerSelect.svelte.d.ts rename to types/TimePicker/TimePickerSelect.d.ts index 426bc185..c39d43ee 100644 --- a/types/TimePicker/TimePickerSelect.svelte.d.ts +++ b/types/TimePicker/TimePickerSelect.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface TimePickerSelectProps + extends svelte.JSX.HTMLAttributes { /** * Specify the select value * @default "" @@ -28,6 +27,11 @@ type $Props = { */ labelText?: string; + /** + * @default true + */ + hideLabel?: boolean; + /** * Set an id for the select element * @default "ccs-" + Math.random().toString(36) @@ -36,7 +40,6 @@ type $Props = { /** * Specify a name attribute for the select element - * @default undefined */ name?: string; @@ -45,11 +48,7 @@ type $Props = { * @default null */ ref?: null | HTMLSelectElement; - - [key: `data-${string}`]: any; -}; - -export type TimePickerSelectProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TimePickerSelect extends SvelteComponentTyped< TimePickerSelectProps, @@ -59,5 +58,5 @@ export default class TimePickerSelect extends SvelteComponentTyped< mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; }, - { default: {}; labelText: {} } + { default: {} } > {} diff --git a/types/Toggle/Toggle.svelte.d.ts b/types/Toggle/Toggle.d.ts similarity index 72% rename from types/Toggle/Toggle.svelte.d.ts rename to types/Toggle/Toggle.d.ts index 89ac1914..ac607251 100644 --- a/types/Toggle/Toggle.svelte.d.ts +++ b/types/Toggle/Toggle.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ToggleProps + extends svelte.JSX.HTMLAttributes { /** * Specify the toggle size * @default "default" @@ -40,12 +39,6 @@ type $Props = { */ labelText?: string; - /** - * Set to `true` to visually hide the label text - * @default false - */ - hideLabel?: boolean; - /** * Set an id for the input element * @default "ccs-" + Math.random().toString(36) @@ -54,14 +47,9 @@ type $Props = { /** * Specify a name attribute for the checkbox input - * @default undefined */ name?: string; - - [key: `data-${string}`]: any; -}; - -export type ToggleProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Toggle extends SvelteComponentTyped< ToggleProps, @@ -76,5 +64,5 @@ export default class Toggle extends SvelteComponentTyped< focus: WindowEventMap["focus"]; blur: WindowEventMap["blur"]; }, - { labelA: {}; labelB: {}; labelText: {} } + {} > {} diff --git a/types/Toggle/ToggleSkeleton.svelte.d.ts b/types/Toggle/ToggleSkeleton.d.ts similarity index 64% rename from types/Toggle/ToggleSkeleton.svelte.d.ts rename to types/Toggle/ToggleSkeleton.d.ts index 2003a353..54918ff1 100644 --- a/types/Toggle/ToggleSkeleton.svelte.d.ts +++ b/types/Toggle/ToggleSkeleton.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface ToggleSkeletonProps + extends svelte.JSX.HTMLAttributes { /** * Specify the toggle size * @default "default" @@ -21,11 +20,7 @@ type $Props = { * @default "ccs-" + Math.random().toString(36) */ id?: string; - - [key: `data-${string}`]: any; -}; - -export type ToggleSkeletonProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class ToggleSkeleton extends SvelteComponentTyped< ToggleSkeletonProps, @@ -35,5 +30,5 @@ export default class ToggleSkeleton extends SvelteComponentTyped< mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; }, - { labelText: {} } + {} > {} diff --git a/types/ToggleSmall/ToggleSmall.d.ts b/types/ToggleSmall/ToggleSmall.d.ts new file mode 100644 index 00000000..c3a37f6f --- /dev/null +++ b/types/ToggleSmall/ToggleSmall.d.ts @@ -0,0 +1,61 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface ToggleSmallProps + extends svelte.JSX.HTMLAttributes { + /** + * Set to `true` to toggle the checkbox input + * @default false + */ + toggled?: boolean; + + /** + * Set to `true` to disable checkbox input + * @default false + */ + disabled?: boolean; + + /** + * Specify the label for the untoggled state + * @default "Off" + */ + labelA?: string; + + /** + * Specify the label for the toggled state + * @default "On" + */ + labelB?: string; + + /** + * Specify the label text + * @default "" + */ + labelText?: string; + + /** + * Set an id for the input element + * @default "ccs-" + Math.random().toString(36) + */ + id?: string; + + /** + * Specify a name attribute for the checkbox input + */ + name?: string; +} + +export default class ToggleSmall extends SvelteComponentTyped< + ToggleSmallProps, + { + click: WindowEventMap["click"]; + mouseover: WindowEventMap["mouseover"]; + mouseenter: WindowEventMap["mouseenter"]; + mouseleave: WindowEventMap["mouseleave"]; + change: WindowEventMap["change"]; + keyup: WindowEventMap["keyup"]; + focus: WindowEventMap["focus"]; + blur: WindowEventMap["blur"]; + }, + {} +> {} diff --git a/types/ToggleSmall/ToggleSmallSkeleton.d.ts b/types/ToggleSmall/ToggleSmallSkeleton.d.ts new file mode 100644 index 00000000..219d1115 --- /dev/null +++ b/types/ToggleSmall/ToggleSmallSkeleton.d.ts @@ -0,0 +1,28 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface ToggleSmallSkeletonProps + extends svelte.JSX.HTMLAttributes { + /** + * Specify the label text + * @default "" + */ + labelText?: string; + + /** + * Set an id for the input element + * @default "ccs-" + Math.random().toString(36) + */ + id?: string; +} + +export default class ToggleSmallSkeleton extends SvelteComponentTyped< + ToggleSmallSkeletonProps, + { + click: WindowEventMap["click"]; + mouseover: WindowEventMap["mouseover"]; + mouseenter: WindowEventMap["mouseenter"]; + mouseleave: WindowEventMap["mouseleave"]; + }, + {} +> {} diff --git a/types/Tooltip/Tooltip.svelte.d.ts b/types/Tooltip/Tooltip.d.ts similarity index 73% rename from types/Tooltip/Tooltip.svelte.d.ts rename to types/Tooltip/Tooltip.d.ts index d43f6a18..2b0d83fa 100644 --- a/types/Tooltip/Tooltip.svelte.d.ts +++ b/types/Tooltip/Tooltip.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["div"]; - -type $Props = { +export interface TooltipProps + extends svelte.JSX.HTMLAttributes { /** * Set the alignment of the tooltip relative to the icon * @default "center" @@ -29,11 +28,10 @@ type $Props = { hideIcon?: boolean; /** - * Specify the icon to render for the tooltip button. - * Default to `` - * @default undefined + * Specify the icon from `carbon-icons-svelte` to render for the tooltip button + * Icon size must be 16px (e.g., `Add16`, `Task16`) */ - icon?: any; + icon?: typeof import("carbon-icons-svelte").CarbonIcon; /** * Specify the ARIA label for the tooltip button @@ -88,19 +86,10 @@ type $Props = { * @default null */ refIcon?: null | HTMLDivElement; - - [key: `data-${string}`]: any; -}; - -export type TooltipProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class Tooltip extends SvelteComponentTyped< TooltipProps, - { - open: CustomEvent; - close: CustomEvent; - click: WindowEventMap["click"]; - mousedown: WindowEventMap["mousedown"]; - }, + { click: WindowEventMap["click"]; mousedown: WindowEventMap["mousedown"] }, { default: {}; icon: {}; triggerText: {} } > {} diff --git a/types/Tooltip/TooltipFooter.svelte.d.ts b/types/Tooltip/TooltipFooter.d.ts similarity index 69% rename from types/Tooltip/TooltipFooter.svelte.d.ts rename to types/Tooltip/TooltipFooter.d.ts index d998417c..928a64c4 100644 --- a/types/Tooltip/TooltipFooter.svelte.d.ts +++ b/types/Tooltip/TooltipFooter.d.ts @@ -1,15 +1,16 @@ -import type { SvelteComponentTyped } from "svelte"; +/// +import { SvelteComponentTyped } from "svelte"; -export type TooltipFooterProps = { +export interface TooltipFooterProps { /** * Specify a selector to be focused inside the footer when opening the tooltip * @default "a[href], button:not([disabled])" */ selectorPrimaryFocus?: string; -}; +} export default class TooltipFooter extends SvelteComponentTyped< TooltipFooterProps, - Record, + {}, { default: {} } > {} diff --git a/types/TooltipDefinition/TooltipDefinition.svelte.d.ts b/types/TooltipDefinition/TooltipDefinition.d.ts similarity index 68% rename from types/TooltipDefinition/TooltipDefinition.svelte.d.ts rename to types/TooltipDefinition/TooltipDefinition.d.ts index 0af6da3b..69290407 100644 --- a/types/TooltipDefinition/TooltipDefinition.svelte.d.ts +++ b/types/TooltipDefinition/TooltipDefinition.d.ts @@ -1,21 +1,14 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["span"]; - -type $Props = { +export interface TooltipDefinitionProps + extends svelte.JSX.HTMLAttributes { /** * Specify the tooltip text * @default "" */ tooltipText?: string; - /** - * Set to `true` to open the tooltip - * @default false - */ - open?: boolean; - /** * Set the alignment of the tooltip relative to the icon * @default "center" @@ -39,17 +32,11 @@ type $Props = { * @default null */ ref?: null | HTMLButtonElement; - - [key: `data-${string}`]: any; -}; - -export type TooltipDefinitionProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TooltipDefinition extends SvelteComponentTyped< TooltipDefinitionProps, { - open: CustomEvent; - close: CustomEvent; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"]; diff --git a/types/TooltipIcon/TooltipIcon.svelte.d.ts b/types/TooltipIcon/TooltipIcon.d.ts similarity index 67% rename from types/TooltipIcon/TooltipIcon.svelte.d.ts rename to types/TooltipIcon/TooltipIcon.d.ts index 8a83439f..3dfe4492 100644 --- a/types/TooltipIcon/TooltipIcon.svelte.d.ts +++ b/types/TooltipIcon/TooltipIcon.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["button"]; - -type $Props = { +export interface TooltipIconProps + extends svelte.JSX.HTMLAttributes { /** * Specify the tooltip text. * Alternatively, use the "tooltipText" slot @@ -11,18 +10,6 @@ type $Props = { */ tooltipText?: string; - /** - * Specify the icon to render - * @default undefined - */ - icon?: any; - - /** - * Set to `true` to disable the tooltip icon - * @default false - */ - disabled?: boolean; - /** * Set the alignment of the tooltip relative to the icon * @default "center" @@ -46,11 +33,7 @@ type $Props = { * @default null */ ref?: null | HTMLButtonElement; - - [key: `data-${string}`]: any; -}; - -export type TooltipIconProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class TooltipIcon extends SvelteComponentTyped< TooltipIconProps, diff --git a/types/TreeView/TreeView.svelte.d.ts b/types/TreeView/TreeView.svelte.d.ts deleted file mode 100644 index 59bf4d58..00000000 --- a/types/TreeView/TreeView.svelte.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -export type TreeNodeId = string | number; - -export interface TreeNode { - id: TreeNodeId; - text: any; - icon?: any; - disabled?: boolean; - nodes?: TreeNode[]; -} - -type $RestProps = SvelteHTMLElements["ul"]; - -type $Props = { - /** - * Provide an array of nodes to render - * @default [] - */ - nodes?: Array; - - /** - * Set the current active node id - * Only one node can be active - * @default "" - */ - activeId?: TreeNodeId; - - /** - * Set the node ids to be selected - * @default [] - */ - selectedIds?: ReadonlyArray; - - /** - * Set the node ids to be expanded - * @default [] - */ - expandedIds?: ReadonlyArray; - - /** - * Specify the TreeView size - * @default "default" - */ - size?: "default" | "compact"; - - /** - * Specify the label text - * @default "" - */ - labelText?: string; - - /** - * Set to `true` to visually hide the label text - * @default false - */ - hideLabel?: boolean; - - [key: `data-${string}`]: any; -}; - -export type TreeViewProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class TreeView extends SvelteComponentTyped< - TreeViewProps, - { - select: CustomEvent; - toggle: CustomEvent; - focus: CustomEvent; - keydown: WindowEventMap["keydown"]; - }, - { - default: { - node: { - id: TreeNodeId; - text: string; - expanded: boolean; - leaf: boolean; - disabled: boolean; - selected: boolean; - }; - }; - labelText: {}; - } -> { - /** - * Programmatically expand all nodes - */ - expandAll: () => void; - - /** - * Programmatically collapse all nodes - */ - collapseAll: () => void; - - /** - * Programmatically expand a subset of nodes. - * Expands all nodes if no argument is provided - */ - expandNodes: (filterId?: (node: TreeNode) => boolean) => void; - - /** - * Programmatically collapse a subset of nodes. - * Collapses all nodes if no argument is provided - */ - collapseNodes: (filterId?: (node: TreeNode) => boolean) => void; - - /** - * Programmatically show a node by `id`. - * The matching node will be expanded, selected, and focused - */ - showNode: (id: TreeNodeId) => void; -} diff --git a/types/TreeView/index.d.ts b/types/TreeView/index.d.ts deleted file mode 100644 index 59f96be0..00000000 --- a/types/TreeView/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as TreeView } from "./TreeView.svelte"; diff --git a/types/Truncate/Truncate.d.ts b/types/Truncate/Truncate.d.ts new file mode 100644 index 00000000..9977769b --- /dev/null +++ b/types/Truncate/Truncate.d.ts @@ -0,0 +1,16 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface TruncateProps + extends svelte.JSX.HTMLAttributes { + /** + * @default "end" + */ + clamp?: "end" | "front"; +} + +export default class Truncate extends SvelteComponentTyped< + TruncateProps, + {}, + { default: {} } +> {} diff --git a/types/Truncate/Truncate.svelte.d.ts b/types/Truncate/Truncate.svelte.d.ts deleted file mode 100644 index c8384c3b..00000000 --- a/types/Truncate/Truncate.svelte.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["p"]; - -type $Props = { - /** - * @default "end" - */ - clamp?: "end" | "front"; - - [key: `data-${string}`]: any; -}; - -export type TruncateProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class Truncate extends SvelteComponentTyped< - TruncateProps, - Record, - { default: {} } -> {} diff --git a/types/Truncate/truncate.d.ts b/types/Truncate/truncate.d.ts deleted file mode 100644 index f0fa9967..00000000 --- a/types/Truncate/truncate.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -interface TruncateOptions { - clamp?: "end" | "front"; -} - -export function TruncateAction( - node: HTMLElement, - options?: TruncateOptions, -): { - update: (options?: TruncateOptions) => void; -}; - -export default TruncateAction; diff --git a/types/UIShell/Content.d.ts b/types/UIShell/Content.d.ts new file mode 100644 index 00000000..b774d0bb --- /dev/null +++ b/types/UIShell/Content.d.ts @@ -0,0 +1,17 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface ContentProps + extends svelte.JSX.HTMLAttributes { + /** + * Specify the id for the main element + * @default "main-content" + */ + id?: string; +} + +export default class Content extends SvelteComponentTyped< + ContentProps, + {}, + { default: {} } +> {} diff --git a/types/UIShell/Content.svelte.d.ts b/types/UIShell/Content.svelte.d.ts deleted file mode 100644 index 40e98e8a..00000000 --- a/types/UIShell/Content.svelte.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["main"]; - -type $Props = { - /** - * Specify the id for the main element - * @default "main-content" - */ - id?: string; - - [key: `data-${string}`]: any; -}; - -export type ContentProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class Content extends SvelteComponentTyped< - ContentProps, - Record, - { default: {} } -> {} diff --git a/types/UIShell/GlobalHeader/Header.d.ts b/types/UIShell/GlobalHeader/Header.d.ts new file mode 100644 index 00000000..676f328e --- /dev/null +++ b/types/UIShell/GlobalHeader/Header.d.ts @@ -0,0 +1,57 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface HeaderProps + extends svelte.JSX.HTMLAttributes { + /** + * Set to `false` to hide the side nav by default + * @default true + */ + expandedByDefault?: boolean; + + /** + * Set to `true` to open the side nav + * @default false + */ + isSideNavOpen?: boolean; + + /** + * Specify the ARIA label for the header + */ + uiShellAriaLabel?: string; + + /** + * Specify the `href` attribute + */ + href?: string; + + /** + * Specify the company name + */ + company?: string; + + /** + * Specify the platform name + * Alternatively, use the named slot "platform" (e.g., ...) + * @default "" + */ + platformName?: string; + + /** + * Set to `true` to persist the hamburger menu + * @default false + */ + persistentHamburgerMenu?: boolean; + + /** + * Obtain a reference to the HTML anchor element + * @default null + */ + ref?: null | HTMLAnchorElement; +} + +export default class Header extends SvelteComponentTyped< + HeaderProps, + { click: WindowEventMap["click"] }, + { default: {}; platform: {}; ["skip-to-content"]: {} } +> {} diff --git a/types/UIShell/GlobalHeader/HeaderAction.d.ts b/types/UIShell/GlobalHeader/HeaderAction.d.ts new file mode 100644 index 00000000..cf1f7321 --- /dev/null +++ b/types/UIShell/GlobalHeader/HeaderAction.d.ts @@ -0,0 +1,47 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface HeaderActionSlideTransition { + delay?: number; + duration?: number; + easing?: (t: number) => number; +} + +export interface HeaderActionProps + extends svelte.JSX.HTMLAttributes { + /** + * Set to `true` to open the panel + * @default false + */ + isOpen?: boolean; + + /** + * Specify the icon from `carbon-icons-svelte` to render + */ + icon?: typeof import("carbon-icons-svelte").CarbonIcon; + + /** + * Specify the text + * Alternatively, use the named slot "text" (e.g.,
    ...
    ) + */ + text?: string; + + /** + * Obtain a reference to the button HTML element + * @default null + */ + ref?: null | HTMLButtonElement; + + /** + * Customize the panel transition (i.e., `transition:slide`) + * Set to `false` to disable the transition + * @default { duration: 200 } + */ + transition?: false | HeaderActionSlideTransition; +} + +export default class HeaderAction extends SvelteComponentTyped< + HeaderActionProps, + { click: WindowEventMap["click"]; close: CustomEvent }, + { default: {}; text: {} } +> {} diff --git a/types/UIShell/GlobalHeader/HeaderActionLink.d.ts b/types/UIShell/GlobalHeader/HeaderActionLink.d.ts new file mode 100644 index 00000000..12804ee4 --- /dev/null +++ b/types/UIShell/GlobalHeader/HeaderActionLink.d.ts @@ -0,0 +1,33 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface HeaderActionLinkProps + extends svelte.JSX.HTMLAttributes { + /** + * Set to `true` to use the active state + * @default false + */ + linkIsActive?: boolean; + + /** + * Specify the `href` attribute + */ + href?: string; + + /** + * Specify the icon from `carbon-icons-svelte` to render + */ + icon?: typeof import("carbon-icons-svelte").CarbonIcon; + + /** + * Obtain a reference to the HTML anchor element + * @default null + */ + ref?: null | HTMLAnchorElement; +} + +export default class HeaderActionLink extends SvelteComponentTyped< + HeaderActionLinkProps, + {}, + {} +> {} diff --git a/types/UIShell/GlobalHeader/HeaderActionSearch.d.ts b/types/UIShell/GlobalHeader/HeaderActionSearch.d.ts new file mode 100644 index 00000000..38d07d45 --- /dev/null +++ b/types/UIShell/GlobalHeader/HeaderActionSearch.d.ts @@ -0,0 +1,20 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface HeaderActionSearchProps { + /** + * Set to `true` to focus the search + * @default false + */ + searchIsActive?: boolean; +} + +export default class HeaderActionSearch extends SvelteComponentTyped< + HeaderActionSearchProps, + { + inputSearch: CustomEvent<{ action: "search"; textInput: string }>; + focusInputSearch: CustomEvent; + focusOutInputSearch: CustomEvent; + }, + {} +> {} diff --git a/types/UIShell/GlobalHeader/HeaderNav.d.ts b/types/UIShell/GlobalHeader/HeaderNav.d.ts new file mode 100644 index 00000000..7b6cf9b1 --- /dev/null +++ b/types/UIShell/GlobalHeader/HeaderNav.d.ts @@ -0,0 +1,16 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface HeaderNavProps + extends svelte.JSX.HTMLAttributes { + /** + * Specify the ARIA label for the nav + */ + ariaLabel?: string; +} + +export default class HeaderNav extends SvelteComponentTyped< + HeaderNavProps, + {}, + { default: {} } +> {} diff --git a/types/UIShell/HeaderNavItem.svelte.d.ts b/types/UIShell/GlobalHeader/HeaderNavItem.d.ts similarity index 59% rename from types/UIShell/HeaderNavItem.svelte.d.ts rename to types/UIShell/GlobalHeader/HeaderNavItem.d.ts index 014c3dfa..6309cc47 100644 --- a/types/UIShell/HeaderNavItem.svelte.d.ts +++ b/types/UIShell/GlobalHeader/HeaderNavItem.d.ts @@ -1,37 +1,24 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["a"]; - -type $Props = { +export interface HeaderNavItemProps + extends svelte.JSX.HTMLAttributes { /** * Specify the `href` attribute - * @default undefined */ href?: string; /** * Specify the text - * @default undefined */ text?: string; - /** - * Set to `true` to select the item - * @default false - */ - isSelected?: boolean; - /** * Obtain a reference to the HTML anchor element * @default null */ ref?: null | HTMLAnchorElement; - - [key: `data-${string}`]: any; -}; - -export type HeaderNavItemProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class HeaderNavItem extends SvelteComponentTyped< HeaderNavItemProps, @@ -45,5 +32,5 @@ export default class HeaderNavItem extends SvelteComponentTyped< focus: WindowEventMap["focus"]; blur: WindowEventMap["blur"]; }, - { default: {} } + {} > {} diff --git a/types/UIShell/HeaderNavMenu.svelte.d.ts b/types/UIShell/GlobalHeader/HeaderNavMenu.d.ts similarity index 72% rename from types/UIShell/HeaderNavMenu.svelte.d.ts rename to types/UIShell/GlobalHeader/HeaderNavMenu.d.ts index 6260b56b..feb88eb1 100644 --- a/types/UIShell/HeaderNavMenu.svelte.d.ts +++ b/types/UIShell/GlobalHeader/HeaderNavMenu.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["a"]; - -type $Props = { +export interface HeaderNavMenuProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to toggle the expanded state * @default false @@ -18,7 +17,6 @@ type $Props = { /** * Specify the text - * @default undefined */ text?: string; @@ -27,11 +25,7 @@ type $Props = { * @default null */ ref?: null | HTMLAnchorElement; - - [key: `data-${string}`]: any; -}; - -export type HeaderNavMenuProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class HeaderNavMenu extends SvelteComponentTyped< HeaderNavMenuProps, diff --git a/types/UIShell/GlobalHeader/HeaderPanelDivider.d.ts b/types/UIShell/GlobalHeader/HeaderPanelDivider.d.ts new file mode 100644 index 00000000..79d1b001 --- /dev/null +++ b/types/UIShell/GlobalHeader/HeaderPanelDivider.d.ts @@ -0,0 +1,10 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface HeaderPanelDividerProps {} + +export default class HeaderPanelDivider extends SvelteComponentTyped< + HeaderPanelDividerProps, + {}, + { default: {} } +> {} diff --git a/types/UIShell/HeaderPanelLink.svelte.d.ts b/types/UIShell/GlobalHeader/HeaderPanelLink.d.ts similarity index 52% rename from types/UIShell/HeaderPanelLink.svelte.d.ts rename to types/UIShell/GlobalHeader/HeaderPanelLink.d.ts index 9d85f0f9..05b0e0d8 100644 --- a/types/UIShell/HeaderPanelLink.svelte.d.ts +++ b/types/UIShell/GlobalHeader/HeaderPanelLink.d.ts @@ -1,12 +1,10 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["a"]; - -type $Props = { +export interface HeaderPanelLinkProps + extends svelte.JSX.HTMLAttributes { /** * Specify the `href` attribute - * @default undefined */ href?: string; @@ -15,11 +13,7 @@ type $Props = { * @default null */ ref?: null | HTMLAnchorElement; - - [key: `data-${string}`]: any; -}; - -export type HeaderPanelLinkProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class HeaderPanelLink extends SvelteComponentTyped< HeaderPanelLinkProps, diff --git a/types/UIShell/GlobalHeader/HeaderPanelLinks.d.ts b/types/UIShell/GlobalHeader/HeaderPanelLinks.d.ts new file mode 100644 index 00000000..a5f656d7 --- /dev/null +++ b/types/UIShell/GlobalHeader/HeaderPanelLinks.d.ts @@ -0,0 +1,10 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface HeaderPanelLinksProps {} + +export default class HeaderPanelLinks extends SvelteComponentTyped< + HeaderPanelLinksProps, + {}, + { default: {} } +> {} diff --git a/types/UIShell/GlobalHeader/HeaderUtilities.d.ts b/types/UIShell/GlobalHeader/HeaderUtilities.d.ts new file mode 100644 index 00000000..d75eccab --- /dev/null +++ b/types/UIShell/GlobalHeader/HeaderUtilities.d.ts @@ -0,0 +1,10 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface HeaderUtilitiesProps {} + +export default class HeaderUtilities extends SvelteComponentTyped< + HeaderUtilitiesProps, + {}, + { default: {} } +> {} diff --git a/types/UIShell/Header.svelte.d.ts b/types/UIShell/Header.svelte.d.ts deleted file mode 100644 index 2ee6955e..00000000 --- a/types/UIShell/Header.svelte.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["a"]; - -type $Props = { - /** - * Set to `false` to hide the side nav by default - * @default true - */ - expandedByDefault?: boolean; - - /** - * Set to `true` to open the side nav - * @default false - */ - isSideNavOpen?: boolean; - - /** - * Specify the ARIA label for the header - * @default undefined - */ - uiShellAriaLabel?: string; - - /** - * Specify the `href` attribute - * @default undefined - */ - href?: string; - - /** - * Specify the company name. - * - * Alternatively, use the named slot "company" (e.g., `...`) - * @default undefined - */ - company?: string; - - /** - * Specify the platform name. - * Alternatively, use the named slot "platform" (e.g., `...`) - * @default "" - */ - platformName?: string; - - /** - * Set to `true` to persist the hamburger menu - * @default false - */ - persistentHamburgerMenu?: boolean; - - /** - * The window width (px) at which the SideNav is expanded and the hamburger menu is hidden. - * 1056 represents the "large" breakpoint in pixels from the Carbon Design System: - * - small: 320 - * - medium: 672 - * - large: 1056 - * - x-large: 1312 - * - max: 1584 - * @default 1056 - */ - expansionBreakpoint?: number; - - /** - * Obtain a reference to the HTML anchor element - * @default null - */ - ref?: null | HTMLAnchorElement; - - /** - * Specify the icon to render for the closed state. - * Defaults to `` - * @default undefined - */ - iconMenu?: any; - - /** - * Specify the icon to render for the opened state. - * Defaults to `` - * @default undefined - */ - iconClose?: any; - - [key: `data-${string}`]: any; -}; - -export type HeaderProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class Header extends SvelteComponentTyped< - HeaderProps, - { click: WindowEventMap["click"] }, - { default: {}; company: {}; platform: {}; ["skip-to-content"]: {} } -> {} diff --git a/types/UIShell/HeaderAction.svelte.d.ts b/types/UIShell/HeaderAction.svelte.d.ts deleted file mode 100644 index ba5aa45c..00000000 --- a/types/UIShell/HeaderAction.svelte.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["button"]; - -type $Props = { - /** - * Set to `true` to open the panel - * @default false - */ - isOpen?: boolean; - - /** - * Specify the icon to render when the action panel is closed. - * Defaults to `` - * @default undefined - */ - icon?: any; - - /** - * Specify the icon to render when the action panel is open. - * Defaults to `` - * @default undefined - */ - closeIcon?: any; - - /** - * Specify the text displayed next to the icon. - * Alternatively, use the named slot "text" (e.g., `
    ...
    `) - * @default undefined - */ - text?: string; - - /** - * Specify an icon tooltip. The tooltip will not be displayed - * if either the `text` prop or a named slot="text" is used - * @default undefined - */ - iconDescription?: string; - - /** - * Set the alignment of the tooltip relative to the icon. - * Only applies when `iconDescription` is provided - * @default "center" - */ - tooltipAlignment?: "start" | "center" | "end"; - - /** - * Obtain a reference to the button HTML element - * @default null - */ - ref?: null | HTMLButtonElement; - - /** - * Customize the panel transition (i.e., `transition:slide`). - * Set to `false` to disable the transition - * @default { duration: 200 } - */ - transition?: false | import("svelte/transition").SlideParams; - - /** - * Set to `true` to prevent the panel from closing when clicking outside - * @default false - */ - preventCloseOnClickOutside?: boolean; - - [key: `data-${string}`]: any; -}; - -export type HeaderActionProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class HeaderAction extends SvelteComponentTyped< - HeaderActionProps, - { - open: CustomEvent; - close: CustomEvent; - click: WindowEventMap["click"]; - }, - { default: {}; closeIcon: {}; icon: {}; text: {} } -> {} diff --git a/types/UIShell/HeaderActionLink.svelte.d.ts b/types/UIShell/HeaderActionLink.svelte.d.ts deleted file mode 100644 index 54948a2d..00000000 --- a/types/UIShell/HeaderActionLink.svelte.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["a"]; - -type $Props = { - /** - * Set to `true` to use the active state - * @default false - */ - linkIsActive?: boolean; - - /** - * Specify the `href` attribute - * @default undefined - */ - href?: string; - - /** - * Specify the icon to render - * @default undefined - */ - icon?: any; - - /** - * Obtain a reference to the HTML anchor element - * @default null - */ - ref?: null | HTMLAnchorElement; - - [key: `data-${string}`]: any; -}; - -export type HeaderActionLinkProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class HeaderActionLink extends SvelteComponentTyped< - HeaderActionLinkProps, - { click: WindowEventMap["click"] }, - { icon: {} } -> {} diff --git a/types/UIShell/HeaderGlobalAction.svelte.d.ts b/types/UIShell/HeaderGlobalAction.d.ts similarity index 54% rename from types/UIShell/HeaderGlobalAction.svelte.d.ts rename to types/UIShell/HeaderGlobalAction.d.ts index 0a10f9e7..95a584ce 100644 --- a/types/UIShell/HeaderGlobalAction.svelte.d.ts +++ b/types/UIShell/HeaderGlobalAction.d.ts @@ -1,7 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { ButtonProps } from "../Button/Button.svelte"; +/// +import { SvelteComponentTyped } from "svelte"; -export type HeaderGlobalActionProps = ButtonProps & { +export interface HeaderGlobalActionProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to use the active variant * @default false @@ -10,19 +11,18 @@ export type HeaderGlobalActionProps = ButtonProps & { /** * Specify the icon to render - * @default undefined */ - icon?: any; + icon?: typeof import("carbon-icons-svelte").CarbonIcon; /** * Obtain a reference to the HTML button element * @default null */ - ref?: HTMLButtonElement; -}; + ref?: null | HTMLButtonElement; +} export default class HeaderGlobalAction extends SvelteComponentTyped< HeaderGlobalActionProps, { click: WindowEventMap["click"] }, - {} + { default: {} } > {} diff --git a/types/UIShell/HeaderNav.svelte.d.ts b/types/UIShell/HeaderNav.svelte.d.ts deleted file mode 100644 index defcc1cf..00000000 --- a/types/UIShell/HeaderNav.svelte.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["nav"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type HeaderNavProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class HeaderNav extends SvelteComponentTyped< - HeaderNavProps, - Record, - { default: {} } -> {} diff --git a/types/UIShell/HeaderPanelDivider.svelte.d.ts b/types/UIShell/HeaderPanelDivider.svelte.d.ts deleted file mode 100644 index 60b74d6c..00000000 --- a/types/UIShell/HeaderPanelDivider.svelte.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; - -export type HeaderPanelDividerProps = {}; - -export default class HeaderPanelDivider extends SvelteComponentTyped< - HeaderPanelDividerProps, - Record, - { default: {} } -> {} diff --git a/types/UIShell/HeaderPanelLinks.svelte.d.ts b/types/UIShell/HeaderPanelLinks.svelte.d.ts deleted file mode 100644 index c898380f..00000000 --- a/types/UIShell/HeaderPanelLinks.svelte.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; - -export type HeaderPanelLinksProps = {}; - -export default class HeaderPanelLinks extends SvelteComponentTyped< - HeaderPanelLinksProps, - Record, - { default: {} } -> {} diff --git a/types/UIShell/HeaderSearch.svelte.d.ts b/types/UIShell/HeaderSearch.d.ts similarity index 69% rename from types/UIShell/HeaderSearch.svelte.d.ts rename to types/UIShell/HeaderSearch.d.ts index 327f638d..a0759a45 100644 --- a/types/UIShell/HeaderSearch.svelte.d.ts +++ b/types/UIShell/HeaderSearch.d.ts @@ -1,5 +1,5 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; export interface HeaderSearchResult { href: string; @@ -7,9 +7,8 @@ export interface HeaderSearchResult { description?: string; } -type $RestProps = SvelteHTMLElements["input"]; - -type $Props = { +export interface HeaderSearchProps + extends svelte.JSX.HTMLAttributes { /** * Specify the search input value * @default "" @@ -32,25 +31,21 @@ type $Props = { * Render a list of search results * @default [] */ - results?: ReadonlyArray; + results?: HeaderSearchResult[]; /** * Specify the selected result index * @default 0 */ selectedResultIndex?: number; - - [key: `data-${string}`]: any; -}; - -export type HeaderSearchProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class HeaderSearch extends SvelteComponentTyped< HeaderSearchProps, { - active: CustomEvent; - inactive: CustomEvent; - clear: CustomEvent; + active: CustomEvent; + inactive: CustomEvent; + clear: CustomEvent; select: CustomEvent<{ value: string; selectedResultIndex: number; @@ -61,7 +56,6 @@ export default class HeaderSearch extends SvelteComponentTyped< focus: WindowEventMap["focus"]; blur: WindowEventMap["blur"]; keydown: WindowEventMap["keydown"]; - paste: WindowEventMap["paste"]; }, { default: { result: HeaderSearchResult; index: number } } > {} diff --git a/types/UIShell/HeaderUtilities.svelte.d.ts b/types/UIShell/HeaderUtilities.svelte.d.ts deleted file mode 100644 index 277fa7f3..00000000 --- a/types/UIShell/HeaderUtilities.svelte.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; - -export type HeaderUtilitiesProps = {}; - -export default class HeaderUtilities extends SvelteComponentTyped< - HeaderUtilitiesProps, - Record, - { default: {} } -> {} diff --git a/types/UIShell/SideNav.svelte.d.ts b/types/UIShell/SideNav.svelte.d.ts deleted file mode 100644 index 72feba14..00000000 --- a/types/UIShell/SideNav.svelte.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["nav"]; - -type $Props = { - /** - * Set to `true` to use the fixed variant - * @default false - */ - fixed?: boolean; - - /** - * Set to `true` to use the rail variant - * @default false - */ - rail?: boolean; - - /** - * Specify the ARIA label for the nav - * @default undefined - */ - ariaLabel?: string; - - /** - * Set to `true` to toggle the expanded state - * @default false - */ - isOpen?: boolean; - - /** - * The window width (px) at which the SideNav is expanded and the hamburger menu is hidden. - * 1056 represents the "large" breakpoint in pixels from the Carbon Design System: - * - small: 320 - * - medium: 672 - * - large: 1056 - * - x-large: 1312 - * - max: 1584 - * @default 1056 - */ - expansionBreakpoint?: number; - - [key: `data-${string}`]: any; -}; - -export type SideNavProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class SideNav extends SvelteComponentTyped< - SideNavProps, - { - open: CustomEvent; - close: CustomEvent; - ["click:overlay"]: CustomEvent; - }, - { default: {} } -> {} diff --git a/types/UIShell/SideNav/SideNav.d.ts b/types/UIShell/SideNav/SideNav.d.ts new file mode 100644 index 00000000..ecec9933 --- /dev/null +++ b/types/UIShell/SideNav/SideNav.d.ts @@ -0,0 +1,28 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface SideNavProps + extends svelte.JSX.HTMLAttributes { + /** + * Set to `true` to use the fixed variant + * @default false + */ + fixed?: boolean; + + /** + * Specify the ARIA label for the nav + */ + ariaLabel?: string; + + /** + * Set to `true` to toggle the expanded state + * @default false + */ + isOpen?: boolean; +} + +export default class SideNav extends SvelteComponentTyped< + SideNavProps, + {}, + { default: {} } +> {} diff --git a/types/UIShell/SideNav/SideNavItems.d.ts b/types/UIShell/SideNav/SideNavItems.d.ts new file mode 100644 index 00000000..e8790062 --- /dev/null +++ b/types/UIShell/SideNav/SideNavItems.d.ts @@ -0,0 +1,10 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface SideNavItemsProps {} + +export default class SideNavItems extends SvelteComponentTyped< + SideNavItemsProps, + {}, + { default: {} } +> {} diff --git a/types/UIShell/SideNavLink.svelte.d.ts b/types/UIShell/SideNav/SideNavLink.d.ts similarity index 52% rename from types/UIShell/SideNavLink.svelte.d.ts rename to types/UIShell/SideNav/SideNavLink.d.ts index e0a75892..50829d20 100644 --- a/types/UIShell/SideNavLink.svelte.d.ts +++ b/types/UIShell/SideNav/SideNavLink.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["a"]; - -type $Props = { +export interface SideNavLinkProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to select the current link * @default false @@ -12,35 +11,28 @@ type $Props = { /** * Specify the `href` attribute - * @default undefined */ href?: string; /** * Specify the text - * @default undefined */ text?: string; /** - * Specify the icon to render - * @default undefined + * Specify the icon from `carbon-icons-svelte` to render */ - icon?: any; + icon?: typeof import("carbon-icons-svelte").CarbonIcon; /** * Obtain a reference to the HTML anchor element * @default null */ ref?: null | HTMLAnchorElement; - - [key: `data-${string}`]: any; -}; - -export type SideNavLinkProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class SideNavLink extends SvelteComponentTyped< SideNavLinkProps, { click: WindowEventMap["click"] }, - { default: {}; icon: {} } + {} > {} diff --git a/types/UIShell/SideNavMenu.svelte.d.ts b/types/UIShell/SideNav/SideNavMenu.d.ts similarity index 50% rename from types/UIShell/SideNavMenu.svelte.d.ts rename to types/UIShell/SideNav/SideNavMenu.d.ts index b97f45a5..4f1405f0 100644 --- a/types/UIShell/SideNavMenu.svelte.d.ts +++ b/types/UIShell/SideNav/SideNavMenu.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["button"]; - -type $Props = { +export interface SideNavMenuProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to toggle the expanded state * @default false @@ -12,29 +11,23 @@ type $Props = { /** * Specify the text - * @default undefined */ text?: string; /** - * Specify the icon to render - * @default undefined + * Specify the icon from `carbon-icons-svelte` to render */ - icon?: any; + icon?: typeof import("carbon-icons-svelte").CarbonIcon; /** * Obtain a reference to the HTML button element * @default null */ ref?: null | HTMLButtonElement; - - [key: `data-${string}`]: any; -}; - -export type SideNavMenuProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class SideNavMenu extends SvelteComponentTyped< SideNavMenuProps, { click: WindowEventMap["click"] }, - { default: {}; icon: {} } + { default: {} } > {} diff --git a/types/UIShell/SideNavMenuItem.svelte.d.ts b/types/UIShell/SideNav/SideNavMenuItem.d.ts similarity index 56% rename from types/UIShell/SideNavMenuItem.svelte.d.ts rename to types/UIShell/SideNav/SideNavMenuItem.d.ts index 8867f995..6f2df8d8 100644 --- a/types/UIShell/SideNavMenuItem.svelte.d.ts +++ b/types/UIShell/SideNav/SideNavMenuItem.d.ts @@ -1,24 +1,20 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["a"]; - -type $Props = { +export interface SideNavMenuItemProps + extends svelte.JSX.HTMLAttributes { /** * Set to `true` to select the item - * @default false */ isSelected?: boolean; /** * Specify the `href` attribute - * @default undefined */ href?: string; /** * Specify the item text - * @default undefined */ text?: string; @@ -27,11 +23,7 @@ type $Props = { * @default null */ ref?: null | HTMLAnchorElement; - - [key: `data-${string}`]: any; -}; - -export type SideNavMenuItemProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class SideNavMenuItem extends SvelteComponentTyped< SideNavMenuItemProps, diff --git a/types/UIShell/SideNavDivider.d.ts b/types/UIShell/SideNavDivider.d.ts new file mode 100644 index 00000000..b880e27c --- /dev/null +++ b/types/UIShell/SideNavDivider.d.ts @@ -0,0 +1,11 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface SideNavDividerProps + extends svelte.JSX.HTMLAttributes {} + +export default class SideNavDivider extends SvelteComponentTyped< + SideNavDividerProps, + {}, + {} +> {} diff --git a/types/UIShell/SideNavDivider.svelte.d.ts b/types/UIShell/SideNavDivider.svelte.d.ts deleted file mode 100644 index 5dab28bf..00000000 --- a/types/UIShell/SideNavDivider.svelte.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["li"]; - -type $Props = { - [key: `data-${string}`]: any; -}; - -export type SideNavDividerProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class SideNavDivider extends SvelteComponentTyped< - SideNavDividerProps, - Record, - {} -> {} diff --git a/types/UIShell/SideNavItems.svelte.d.ts b/types/UIShell/SideNavItems.svelte.d.ts deleted file mode 100644 index c0816bd0..00000000 --- a/types/UIShell/SideNavItems.svelte.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; - -export type SideNavItemsProps = {}; - -export default class SideNavItems extends SvelteComponentTyped< - SideNavItemsProps, - Record, - { default: {} } -> {} diff --git a/types/UIShell/SkipToContent.svelte.d.ts b/types/UIShell/SkipToContent.d.ts similarity index 53% rename from types/UIShell/SkipToContent.svelte.d.ts rename to types/UIShell/SkipToContent.d.ts index 52c54794..ec8b52ea 100644 --- a/types/UIShell/SkipToContent.svelte.d.ts +++ b/types/UIShell/SkipToContent.d.ts @@ -1,9 +1,8 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; +/// +import { SvelteComponentTyped } from "svelte"; -type $RestProps = SvelteHTMLElements["a"]; - -type $Props = { +export interface SkipToContentProps + extends svelte.JSX.HTMLAttributes { /** * Specify the `href` attribute * @default "#main-content" @@ -15,11 +14,7 @@ type $Props = { * @default "0" */ tabindex?: string; - - [key: `data-${string}`]: any; -}; - -export type SkipToContentProps = Omit<$RestProps, keyof $Props> & $Props; +} export default class SkipToContent extends SvelteComponentTyped< SkipToContentProps, diff --git a/types/UnorderedList/UnorderedList.d.ts b/types/UnorderedList/UnorderedList.d.ts new file mode 100644 index 00000000..debfbdbf --- /dev/null +++ b/types/UnorderedList/UnorderedList.d.ts @@ -0,0 +1,22 @@ +/// +import { SvelteComponentTyped } from "svelte"; + +export interface UnorderedListProps + extends svelte.JSX.HTMLAttributes { + /** + * Set to `true` to use the nested variant + * @default false + */ + nested?: boolean; +} + +export default class UnorderedList extends SvelteComponentTyped< + UnorderedListProps, + { + click: WindowEventMap["click"]; + mouseover: WindowEventMap["mouseover"]; + mouseenter: WindowEventMap["mouseenter"]; + mouseleave: WindowEventMap["mouseleave"]; + }, + { default: {} } +> {} diff --git a/types/UnorderedList/UnorderedList.svelte.d.ts b/types/UnorderedList/UnorderedList.svelte.d.ts deleted file mode 100644 index 0ac708ca..00000000 --- a/types/UnorderedList/UnorderedList.svelte.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { SvelteComponentTyped } from "svelte"; -import type { SvelteHTMLElements } from "svelte/elements"; - -type $RestProps = SvelteHTMLElements["ul"]; - -type $Props = { - /** - * Set to `true` to use the nested variant - * @default false - */ - nested?: boolean; - - /** - * Set to `true` to use Carbon's expressive typesetting - * @default false - */ - expressive?: boolean; - - [key: `data-${string}`]: any; -}; - -export type UnorderedListProps = Omit<$RestProps, keyof $Props> & $Props; - -export default class UnorderedList extends SvelteComponentTyped< - UnorderedListProps, - { - click: WindowEventMap["click"]; - mouseover: WindowEventMap["mouseover"]; - mouseenter: WindowEventMap["mouseenter"]; - mouseleave: WindowEventMap["mouseleave"]; - }, - { default: {} } -> {} diff --git a/types/index.d.ts b/types/index.d.ts index be215d97..f1446a1b 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,169 +1,167 @@ -export { default as Accordion } from "./Accordion/Accordion.svelte"; -export { default as AccordionItem } from "./Accordion/AccordionItem.svelte"; -export { default as AccordionSkeleton } from "./Accordion/AccordionSkeleton.svelte"; -export { default as AspectRatio } from "./AspectRatio/AspectRatio.svelte"; -export { default as Breadcrumb } from "./Breadcrumb/Breadcrumb.svelte"; -export { default as BreadcrumbItem } from "./Breadcrumb/BreadcrumbItem.svelte"; -export { default as BreadcrumbSkeleton } from "./Breadcrumb/BreadcrumbSkeleton.svelte"; -export { default as Breakpoint } from "./Breakpoint/Breakpoint.svelte"; -export { default as breakpointObserver } from "./Breakpoint/breakpointObserver"; -export { default as breakpoints } from "./Breakpoint/breakpoints"; -export { default as Button } from "./Button/Button.svelte"; -export { default as ButtonSkeleton } from "./Button/ButtonSkeleton.svelte"; -export { default as ButtonSet } from "./Button/ButtonSet.svelte"; -export { default as Checkbox } from "./Checkbox/Checkbox.svelte"; -export { default as CheckboxSkeleton } from "./Checkbox/CheckboxSkeleton.svelte"; -export { default as ContentSwitcher } from "./ContentSwitcher/ContentSwitcher.svelte"; -export { default as Switch } from "./ContentSwitcher/Switch.svelte"; -export { default as ContextMenu } from "./ContextMenu/ContextMenu.svelte"; -export { default as ContextMenuDivider } from "./ContextMenu/ContextMenuDivider.svelte"; -export { default as ContextMenuGroup } from "./ContextMenu/ContextMenuGroup.svelte"; -export { default as ContextMenuOption } from "./ContextMenu/ContextMenuOption.svelte"; -export { default as ContextMenuRadioGroup } from "./ContextMenu/ContextMenuRadioGroup.svelte"; -export { default as CopyButton } from "./CopyButton/CopyButton.svelte"; -export { default as ComboBox } from "./ComboBox/ComboBox.svelte"; -export { default as ComposedModal } from "./ComposedModal/ComposedModal.svelte"; -export { default as ModalHeader } from "./ComposedModal/ModalHeader.svelte"; -export { default as ModalBody } from "./ComposedModal/ModalBody.svelte"; -export { default as ModalFooter } from "./ComposedModal/ModalFooter.svelte"; -export { default as CodeSnippet } from "./CodeSnippet/CodeSnippet.svelte"; -export { default as CodeSnippetSkeleton } from "./CodeSnippet/CodeSnippetSkeleton.svelte"; -export { default as DataTable } from "./DataTable/DataTable.svelte"; -export { default as DataTableSkeleton } from "./DataTable/DataTableSkeleton.svelte"; -export { default as Table } from "./DataTable/Table.svelte"; -export { default as TableBody } from "./DataTable/TableBody.svelte"; -export { default as TableCell } from "./DataTable/TableCell.svelte"; -export { default as TableContainer } from "./DataTable/TableContainer.svelte"; -export { default as TableHead } from "./DataTable/TableHead.svelte"; -export { default as TableHeader } from "./DataTable/TableHeader.svelte"; -export { default as TableRow } from "./DataTable/TableRow.svelte"; -export { default as Toolbar } from "./DataTable/Toolbar.svelte"; -export { default as ToolbarContent } from "./DataTable/ToolbarContent.svelte"; -export { default as ToolbarSearch } from "./DataTable/ToolbarSearch.svelte"; -export { default as ToolbarBatchActions } from "./DataTable/ToolbarBatchActions.svelte"; -export { default as ToolbarMenu } from "./DataTable/ToolbarMenu.svelte"; -export { default as ToolbarMenuItem } from "./DataTable/ToolbarMenuItem.svelte"; -export { default as DatePicker } from "./DatePicker/DatePicker.svelte"; -export { default as DatePickerInput } from "./DatePicker/DatePickerInput.svelte"; -export { default as DatePickerSkeleton } from "./DatePicker/DatePickerSkeleton.svelte"; -export { default as Dropdown } from "./Dropdown/Dropdown.svelte"; -export { default as DropdownSkeleton } from "./Dropdown/DropdownSkeleton.svelte"; -export { default as FileUploader } from "./FileUploader/FileUploader.svelte"; -export { default as FileUploaderButton } from "./FileUploader/FileUploaderButton.svelte"; -export { default as FileUploaderItem } from "./FileUploader/FileUploaderItem.svelte"; -export { default as FileUploaderDropContainer } from "./FileUploader/FileUploaderDropContainer.svelte"; -export { default as Filename } from "./FileUploader/Filename.svelte"; -export { default as FileUploaderSkeleton } from "./FileUploader/FileUploaderSkeleton.svelte"; -export { default as Form } from "./Form/Form.svelte"; -export { default as FluidForm } from "./FluidForm/FluidForm.svelte"; -export { default as FormGroup } from "./FormGroup/FormGroup.svelte"; -export { default as FormItem } from "./FormItem/FormItem.svelte"; -export { default as FormLabel } from "./FormLabel/FormLabel.svelte"; -export { default as Grid } from "./Grid/Grid.svelte"; -export { default as Row } from "./Grid/Row.svelte"; -export { default as Column } from "./Grid/Column.svelte"; -export { default as ImageLoader } from "./ImageLoader/ImageLoader.svelte"; -export { default as InlineLoading } from "./InlineLoading/InlineLoading.svelte"; -export { default as Link } from "./Link/Link.svelte"; -export { default as OutboundLink } from "./Link/OutboundLink.svelte"; -export { default as ListBox } from "./ListBox/ListBox.svelte"; -export { default as ListBoxField } from "./ListBox/ListBoxField.svelte"; -export { default as ListBoxMenu } from "./ListBox/ListBoxMenu.svelte"; -export { default as ListBoxMenuIcon } from "./ListBox/ListBoxMenuIcon.svelte"; -export { default as ListBoxMenuItem } from "./ListBox/ListBoxMenuItem.svelte"; -export { default as ListBoxSelection } from "./ListBox/ListBoxSelection.svelte"; -export { default as ListItem } from "./ListItem/ListItem.svelte"; -export { default as Loading } from "./Loading/Loading.svelte"; -export { default as LocalStorage } from "./LocalStorage/LocalStorage.svelte"; -export { default as MultiSelect } from "./MultiSelect/MultiSelect.svelte"; -export { default as Modal } from "./Modal/Modal.svelte"; -export { default as ToastNotification } from "./Notification/ToastNotification.svelte"; -export { default as InlineNotification } from "./Notification/InlineNotification.svelte"; -export { default as NotificationActionButton } from "./Notification/NotificationActionButton.svelte"; -export { default as NotificationButton } from "./Notification/NotificationButton.svelte"; -export { default as NotificationIcon } from "./Notification/NotificationIcon.svelte"; -export { default as NumberInput } from "./NumberInput/NumberInput.svelte"; -export { default as NumberInputSkeleton } from "./NumberInput/NumberInputSkeleton.svelte"; -export { default as OrderedList } from "./OrderedList/OrderedList.svelte"; -export { default as OverflowMenu } from "./OverflowMenu/OverflowMenu.svelte"; -export { default as OverflowMenuItem } from "./OverflowMenu/OverflowMenuItem.svelte"; -export { default as Pagination } from "./Pagination/Pagination.svelte"; -export { default as PaginationSkeleton } from "./Pagination/PaginationSkeleton.svelte"; -export { default as PaginationNav } from "./PaginationNav/PaginationNav.svelte"; -export { default as Popover } from "./Popover/Popover.svelte"; -export { default as ProgressBar } from "./ProgressBar/ProgressBar.svelte"; -export { default as ProgressIndicator } from "./ProgressIndicator/ProgressIndicator.svelte"; -export { default as ProgressIndicatorSkeleton } from "./ProgressIndicator/ProgressIndicatorSkeleton.svelte"; -export { default as ProgressStep } from "./ProgressIndicator/ProgressStep.svelte"; -export { default as RadioButton } from "./RadioButton/RadioButton.svelte"; -export { default as RadioButtonSkeleton } from "./RadioButton/RadioButtonSkeleton.svelte"; -export { default as RadioButtonGroup } from "./RadioButtonGroup/RadioButtonGroup.svelte"; -export { default as RecursiveList } from "./RecursiveList/RecursiveList.svelte"; -export { default as Search } from "./Search/Search.svelte"; -export { default as SearchSkeleton } from "./Search/SearchSkeleton.svelte"; -export { default as Select } from "./Select/Select.svelte"; -export { default as SelectSkeleton } from "./Select/SelectSkeleton.svelte"; -export { default as SelectItem } from "./Select/SelectItem.svelte"; -export { default as SelectItemGroup } from "./Select/SelectItemGroup.svelte"; -export { default as SkeletonPlaceholder } from "./SkeletonPlaceholder/SkeletonPlaceholder.svelte"; -export { default as SkeletonText } from "./SkeletonText/SkeletonText.svelte"; -export { default as Slider } from "./Slider/Slider.svelte"; -export { default as SliderSkeleton } from "./Slider/SliderSkeleton.svelte"; -export { default as StructuredList } from "./StructuredList/StructuredList.svelte"; -export { default as StructuredListSkeleton } from "./StructuredList/StructuredListSkeleton.svelte"; -export { default as StructuredListBody } from "./StructuredList/StructuredListBody.svelte"; -export { default as StructuredListHead } from "./StructuredList/StructuredListHead.svelte"; -export { default as StructuredListCell } from "./StructuredList/StructuredListCell.svelte"; -export { default as StructuredListRow } from "./StructuredList/StructuredListRow.svelte"; -export { default as StructuredListInput } from "./StructuredList/StructuredListInput.svelte"; -export { default as Tabs } from "./Tabs/Tabs.svelte"; -export { default as Tab } from "./Tabs/Tab.svelte"; -export { default as TabContent } from "./Tabs/TabContent.svelte"; -export { default as TabsSkeleton } from "./Tabs/TabsSkeleton.svelte"; -export { default as Tag } from "./Tag/Tag.svelte"; -export { default as TagSkeleton } from "./Tag/TagSkeleton.svelte"; -export { default as TextArea } from "./TextArea/TextArea.svelte"; -export { default as TextAreaSkeleton } from "./TextArea/TextAreaSkeleton.svelte"; -export { default as TextInput } from "./TextInput/TextInput.svelte"; -export { default as TextInputSkeleton } from "./TextInput/TextInputSkeleton.svelte"; -export { default as PasswordInput } from "./TextInput/PasswordInput.svelte"; -export { default as Theme } from "./Theme/Theme.svelte"; -export { default as Tile } from "./Tile/Tile.svelte"; -export { default as ClickableTile } from "./Tile/ClickableTile.svelte"; -export { default as ExpandableTile } from "./Tile/ExpandableTile.svelte"; -export { default as SelectableTile } from "./Tile/SelectableTile.svelte"; -export { default as RadioTile } from "./Tile/RadioTile.svelte"; -export { default as TileGroup } from "./Tile/TileGroup.svelte"; -export { default as TimePicker } from "./TimePicker/TimePicker.svelte"; -export { default as TimePickerSelect } from "./TimePicker/TimePickerSelect.svelte"; -export { default as Toggle } from "./Toggle/Toggle.svelte"; -export { default as ToggleSkeleton } from "./Toggle/ToggleSkeleton.svelte"; -export { default as Tooltip } from "./Tooltip/Tooltip.svelte"; -export { default as TooltipFooter } from "./Tooltip/TooltipFooter.svelte"; -export { default as TooltipDefinition } from "./TooltipDefinition/TooltipDefinition.svelte"; -export { default as TooltipIcon } from "./TooltipIcon/TooltipIcon.svelte"; -export { default as TreeView } from "./TreeView/TreeView.svelte"; -export { default as Truncate } from "./Truncate/Truncate.svelte"; -export { default as truncate } from "./Truncate/truncate"; -export { default as Header } from "./UIShell/Header.svelte"; -export { default as HeaderAction } from "./UIShell/HeaderAction.svelte"; -export { default as HeaderActionLink } from "./UIShell/HeaderActionLink.svelte"; -export { default as HeaderNav } from "./UIShell/HeaderNav.svelte"; -export { default as HeaderNavItem } from "./UIShell/HeaderNavItem.svelte"; -export { default as HeaderNavMenu } from "./UIShell/HeaderNavMenu.svelte"; -export { default as HeaderPanelDivider } from "./UIShell/HeaderPanelDivider.svelte"; -export { default as HeaderPanelLink } from "./UIShell/HeaderPanelLink.svelte"; -export { default as HeaderPanelLinks } from "./UIShell/HeaderPanelLinks.svelte"; -export { default as HeaderUtilities } from "./UIShell/HeaderUtilities.svelte"; -export { default as SideNav } from "./UIShell/SideNav.svelte"; -export { default as SideNavItems } from "./UIShell/SideNavItems.svelte"; -export { default as SideNavLink } from "./UIShell/SideNavLink.svelte"; -export { default as SideNavMenu } from "./UIShell/SideNavMenu.svelte"; -export { default as SideNavMenuItem } from "./UIShell/SideNavMenuItem.svelte"; -export { default as SideNavDivider } from "./UIShell/SideNavDivider.svelte"; -export { default as Content } from "./UIShell/Content.svelte"; -export { default as SkipToContent } from "./UIShell/SkipToContent.svelte"; -export { default as HeaderGlobalAction } from "./UIShell/HeaderGlobalAction.svelte"; -export { default as HeaderSearch } from "./UIShell/HeaderSearch.svelte"; -export { default as UnorderedList } from "./UnorderedList/UnorderedList.svelte"; -export { default as toHierarchy } from "./utils/toHierarchy"; +export { default as Accordion } from "./Accordion/Accordion"; +export { default as AccordionItem } from "./Accordion/AccordionItem"; +export { default as AccordionSkeleton } from "./Accordion/AccordionSkeleton"; +export { default as AspectRatio } from "./AspectRatio/AspectRatio"; +export { default as Breadcrumb } from "./Breadcrumb/Breadcrumb"; +export { default as BreadcrumbItem } from "./Breadcrumb/BreadcrumbItem"; +export { default as BreadcrumbSkeleton } from "./Breadcrumb/BreadcrumbSkeleton"; +export { default as Button } from "./Button/Button"; +export { default as ButtonSkeleton } from "./Button/ButtonSkeleton"; +export { default as ButtonSet } from "./Button/ButtonSet"; +export { default as Checkbox } from "./Checkbox/Checkbox"; +export { default as CheckboxSkeleton } from "./Checkbox/CheckboxSkeleton"; +export { default as ContentSwitcher } from "./ContentSwitcher/ContentSwitcher"; +export { default as Switch } from "./ContentSwitcher/Switch"; +export { default as ContextMenu } from "./ContextMenu/ContextMenu"; +export { default as ContextMenuDivider } from "./ContextMenu/ContextMenuDivider"; +export { default as ContextMenuGroup } from "./ContextMenu/ContextMenuGroup"; +export { default as ContextMenuOption } from "./ContextMenu/ContextMenuOption"; +export { default as ContextMenuRadioGroup } from "./ContextMenu/ContextMenuRadioGroup"; +export { default as Copy } from "./Copy/Copy"; +export { default as CopyButton } from "./CopyButton/CopyButton"; +export { default as ComboBox } from "./ComboBox/ComboBox"; +export { default as ComposedModal } from "./ComposedModal/ComposedModal"; +export { default as ModalHeader } from "./ComposedModal/ModalHeader"; +export { default as ModalBody } from "./ComposedModal/ModalBody"; +export { default as ModalFooter } from "./ComposedModal/ModalFooter"; +export { default as CodeSnippet } from "./CodeSnippet/CodeSnippet"; +export { default as CodeSnippetSkeleton } from "./CodeSnippet/CodeSnippetSkeleton"; +export { default as DataTable } from "./DataTable/DataTable"; +export { default as DataTableSkeleton } from "./DataTable/DataTableSkeleton"; +export { default as Table } from "./DataTable/Table"; +export { default as TableBody } from "./DataTable/TableBody"; +export { default as TableCell } from "./DataTable/TableCell"; +export { default as TableContainer } from "./DataTable/TableContainer"; +export { default as TableHead } from "./DataTable/TableHead"; +export { default as TableHeader } from "./DataTable/TableHeader"; +export { default as TableRow } from "./DataTable/TableRow"; +export { default as Toolbar } from "./DataTable/Toolbar"; +export { default as ToolbarContent } from "./DataTable/ToolbarContent"; +export { default as ToolbarSearch } from "./DataTable/ToolbarSearch"; +export { default as ToolbarBatchActions } from "./DataTable/ToolbarBatchActions"; +export { default as ToolbarMenu } from "./DataTable/ToolbarMenu"; +export { default as ToolbarMenuItem } from "./DataTable/ToolbarMenuItem"; +export { default as DatePicker } from "./DatePicker/DatePicker"; +export { default as DatePickerInput } from "./DatePicker/DatePickerInput"; +export { default as DatePickerSkeleton } from "./DatePicker/DatePickerSkeleton"; +export { default as Dropdown } from "./Dropdown/Dropdown"; +export { default as DropdownSkeleton } from "./Dropdown/DropdownSkeleton"; +export { default as FileUploader } from "./FileUploader/FileUploader"; +export { default as FileUploaderButton } from "./FileUploader/FileUploaderButton"; +export { default as FileUploaderItem } from "./FileUploader/FileUploaderItem"; +export { default as FileUploaderDropContainer } from "./FileUploader/FileUploaderDropContainer"; +export { default as Filename } from "./FileUploader/Filename"; +export { default as FileUploaderSkeleton } from "./FileUploader/FileUploaderSkeleton"; +export { default as Form } from "./Form/Form"; +export { default as FluidForm } from "./FluidForm/FluidForm"; +export { default as FormGroup } from "./FormGroup/FormGroup"; +export { default as FormItem } from "./FormItem/FormItem"; +export { default as FormLabel } from "./FormLabel/FormLabel"; +export { default as Grid } from "./Grid/Grid"; +export { default as Row } from "./Grid/Row"; +export { default as Column } from "./Grid/Column"; +export { default as Icon } from "./Icon/Icon"; +export { default as IconSkeleton } from "./Icon/IconSkeleton"; +export { default as ImageLoader } from "./ImageLoader/ImageLoader"; +export { default as InlineLoading } from "./InlineLoading/InlineLoading"; +export { default as Link } from "./Link/Link"; +export { default as OutboundLink } from "./Link/OutboundLink"; +export { default as ListBox } from "./ListBox/ListBox"; +export { default as ListBoxField } from "./ListBox/ListBoxField"; +export { default as ListBoxMenu } from "./ListBox/ListBoxMenu"; +export { default as ListBoxMenuIcon } from "./ListBox/ListBoxMenuIcon"; +export { default as ListBoxMenuItem } from "./ListBox/ListBoxMenuItem"; +export { default as ListBoxSelection } from "./ListBox/ListBoxSelection"; +export { default as ListItem } from "./ListItem/ListItem"; +export { default as Loading } from "./Loading/Loading"; +export { default as LocalStorage } from "./LocalStorage/LocalStorage"; +export { default as MultiSelect } from "./MultiSelect/MultiSelect"; +export { default as Modal } from "./Modal/Modal"; +export { default as ToastNotification } from "./Notification/ToastNotification"; +export { default as InlineNotification } from "./Notification/InlineNotification"; +export { default as NotificationActionButton } from "./Notification/NotificationActionButton"; +export { default as NotificationButton } from "./Notification/NotificationButton"; +export { default as NotificationIcon } from "./Notification/NotificationIcon"; +export { default as NotificationTextDetails } from "./Notification/NotificationTextDetails"; +export { default as NumberInput } from "./NumberInput/NumberInput"; +export { default as NumberInputSkeleton } from "./NumberInput/NumberInputSkeleton"; +export { default as OrderedList } from "./OrderedList/OrderedList"; +export { default as OverflowMenu } from "./OverflowMenu/OverflowMenu"; +export { default as OverflowMenuItem } from "./OverflowMenu/OverflowMenuItem"; +export { default as Pagination } from "./Pagination/Pagination"; +export { default as PaginationSkeleton } from "./Pagination/PaginationSkeleton"; +export { default as PaginationNav } from "./PaginationNav/PaginationNav"; +export { default as Popover } from "./Popover/Popover"; +export { default as ProgressIndicator } from "./ProgressIndicator/ProgressIndicator"; +export { default as ProgressIndicatorSkeleton } from "./ProgressIndicator/ProgressIndicatorSkeleton"; +export { default as ProgressStep } from "./ProgressIndicator/ProgressStep"; +export { default as RadioButton } from "./RadioButton/RadioButton"; +export { default as RadioButtonSkeleton } from "./RadioButton/RadioButtonSkeleton"; +export { default as RadioButtonGroup } from "./RadioButtonGroup/RadioButtonGroup"; +export { default as Search } from "./Search/Search"; +export { default as SearchSkeleton } from "./Search/SearchSkeleton"; +export { default as Select } from "./Select/Select"; +export { default as SelectSkeleton } from "./Select/SelectSkeleton"; +export { default as SelectItem } from "./Select/SelectItem"; +export { default as SelectItemGroup } from "./Select/SelectItemGroup"; +export { default as SkeletonPlaceholder } from "./SkeletonPlaceholder/SkeletonPlaceholder"; +export { default as SkeletonText } from "./SkeletonText/SkeletonText"; +export { default as Slider } from "./Slider/Slider"; +export { default as SliderSkeleton } from "./Slider/SliderSkeleton"; +export { default as StructuredList } from "./StructuredList/StructuredList"; +export { default as StructuredListSkeleton } from "./StructuredList/StructuredListSkeleton"; +export { default as StructuredListBody } from "./StructuredList/StructuredListBody"; +export { default as StructuredListHead } from "./StructuredList/StructuredListHead"; +export { default as StructuredListCell } from "./StructuredList/StructuredListCell"; +export { default as StructuredListRow } from "./StructuredList/StructuredListRow"; +export { default as StructuredListInput } from "./StructuredList/StructuredListInput"; +export { default as Tabs } from "./Tabs/Tabs"; +export { default as Tab } from "./Tabs/Tab"; +export { default as TabContent } from "./Tabs/TabContent"; +export { default as TabsSkeleton } from "./Tabs/TabsSkeleton"; +export { default as Tag } from "./Tag/Tag"; +export { default as TagSkeleton } from "./Tag/TagSkeleton"; +export { default as TextArea } from "./TextArea/TextArea"; +export { default as TextAreaSkeleton } from "./TextArea/TextAreaSkeleton"; +export { default as TextInput } from "./TextInput/TextInput"; +export { default as TextInputSkeleton } from "./TextInput/TextInputSkeleton"; +export { default as PasswordInput } from "./TextInput/PasswordInput"; +export { default as Tile } from "./Tile/Tile"; +export { default as ClickableTile } from "./Tile/ClickableTile"; +export { default as ExpandableTile } from "./Tile/ExpandableTile"; +export { default as SelectableTile } from "./Tile/SelectableTile"; +export { default as RadioTile } from "./Tile/RadioTile"; +export { default as TileGroup } from "./Tile/TileGroup"; +export { default as TimePicker } from "./TimePicker/TimePicker"; +export { default as TimePickerSelect } from "./TimePicker/TimePickerSelect"; +export { default as Toggle } from "./Toggle/Toggle"; +export { default as ToggleSkeleton } from "./Toggle/ToggleSkeleton"; +export { default as ToggleSmall } from "./ToggleSmall/ToggleSmall"; +export { default as ToggleSmallSkeleton } from "./ToggleSmall/ToggleSmallSkeleton"; +export { default as Tooltip } from "./Tooltip/Tooltip"; +export { default as TooltipFooter } from "./Tooltip/TooltipFooter"; +export { default as TooltipDefinition } from "./TooltipDefinition/TooltipDefinition"; +export { default as TooltipIcon } from "./TooltipIcon/TooltipIcon"; +export { default as Truncate } from "./Truncate/Truncate"; +export { default as Header } from "./UIShell/GlobalHeader/Header"; +export { default as HeaderAction } from "./UIShell/GlobalHeader/HeaderAction"; +export { default as HeaderActionLink } from "./UIShell/GlobalHeader/HeaderActionLink"; +export { default as HeaderActionSearch } from "./UIShell/GlobalHeader/HeaderActionSearch"; +export { default as HeaderNav } from "./UIShell/GlobalHeader/HeaderNav"; +export { default as HeaderNavItem } from "./UIShell/GlobalHeader/HeaderNavItem"; +export { default as HeaderNavMenu } from "./UIShell/GlobalHeader/HeaderNavMenu"; +export { default as HeaderPanelDivider } from "./UIShell/GlobalHeader/HeaderPanelDivider"; +export { default as HeaderPanelLink } from "./UIShell/GlobalHeader/HeaderPanelLink"; +export { default as HeaderPanelLinks } from "./UIShell/GlobalHeader/HeaderPanelLinks"; +export { default as HeaderUtilities } from "./UIShell/GlobalHeader/HeaderUtilities"; +export { default as SideNav } from "./UIShell/SideNav/SideNav"; +export { default as SideNavItems } from "./UIShell/SideNav/SideNavItems"; +export { default as SideNavLink } from "./UIShell/SideNav/SideNavLink"; +export { default as SideNavMenu } from "./UIShell/SideNav/SideNavMenu"; +export { default as SideNavMenuItem } from "./UIShell/SideNav/SideNavMenuItem"; +export { default as SideNavDivider } from "./UIShell/SideNavDivider"; +export { default as Content } from "./UIShell/Content"; +export { default as SkipToContent } from "./UIShell/SkipToContent"; +export { default as HeaderGlobalAction } from "./UIShell/HeaderGlobalAction"; +export { default as HeaderSearch } from "./UIShell/HeaderSearch"; +export { default as UnorderedList } from "./UnorderedList/UnorderedList"; diff --git a/types/utils/toHierarchy.d.ts b/types/utils/toHierarchy.d.ts deleted file mode 100644 index a805f899..00000000 --- a/types/utils/toHierarchy.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -type NodeLike = { - id: string | number; - nodes?: NodeLike[]; - [key: string]: any; -}; - -/** Create a hierarchical tree from a flat array. */ -export function toHierarchy< - T extends NodeLike, - K extends keyof Omit, ->( - flatArray: T[] | readonly T[], - /** - * Function that returns the parent ID for a given node. - * @example - * toHierarchy(flatArray, (node) => node.parentId); - */ - getParentId: (node: T) => T[K] | null, -): (T & { nodes?: (T & { nodes?: T[] })[] })[]; - -export default toHierarchy; diff --git a/vite.config.ts b/vite.config.ts deleted file mode 100644 index c17edf31..00000000 --- a/vite.config.ts +++ /dev/null @@ -1,25 +0,0 @@ -/// -import { svelte, vitePreprocess } from "@sveltejs/vite-plugin-svelte"; -import { optimizeImports } from "carbon-preprocess-svelte"; -import { defineConfig } from "vite"; - -export default defineConfig({ - root: "./tests", - plugins: [ - svelte({ - preprocess: [vitePreprocess(), optimizeImports()], - }), - ], - optimizeDeps: { - exclude: ["carbon-components-svelte", "carbon-icons-svelte"], - }, - resolve: process.env.VITEST ? { conditions: ["browser"] } : undefined, - test: { - globals: true, - environment: "jsdom", - clearMocks: true, - // Suppress `console` output in CI. - silent: !!process.env.CI, - setupFiles: ["./tests/setup-tests.ts"], - }, -}); diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..0b43ed4d --- /dev/null +++ b/yarn.lock @@ -0,0 +1,2663 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" + integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== + dependencies: + "@babel/highlight" "^7.10.4" + +"@babel/code-frame@^7.12.11": + version "7.12.11" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== + dependencies: + "@babel/highlight" "^7.10.4" + +"@babel/generator@^7.12.11": + version "7.12.11" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz#98a7df7b8c358c9a37ab07a24056853016aba3af" + integrity sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA== + dependencies: + "@babel/types" "^7.12.11" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@babel/helper-function-name@^7.12.11": + version "7.12.11" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz#1fd7738aee5dcf53c3ecff24f1da9c511ec47b42" + integrity sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA== + dependencies: + "@babel/helper-get-function-arity" "^7.12.10" + "@babel/template" "^7.12.7" + "@babel/types" "^7.12.11" + +"@babel/helper-get-function-arity@^7.12.10": + version "7.12.10" + resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz#b158817a3165b5faa2047825dfa61970ddcc16cf" + integrity sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag== + dependencies: + "@babel/types" "^7.12.10" + +"@babel/helper-split-export-declaration@^7.12.11": + version "7.12.11" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz#1b4cc424458643c47d37022223da33d76ea4603a" + integrity sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g== + dependencies: + "@babel/types" "^7.12.11" + +"@babel/helper-validator-identifier@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" + integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== + +"@babel/helper-validator-identifier@^7.12.11": + version "7.12.11" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" + integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== + +"@babel/highlight@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" + integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.12.11", "@babel/parser@^7.12.5", "@babel/parser@^7.12.7": + version "7.12.11" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79" + integrity sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg== + +"@babel/template@^7.12.7": + version "7.12.7" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc" + integrity sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/parser" "^7.12.7" + "@babel/types" "^7.12.7" + +"@babel/traverse@^7.12.5": + version "7.12.12" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.12.tgz#d0cd87892704edd8da002d674bc811ce64743376" + integrity sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w== + dependencies: + "@babel/code-frame" "^7.12.11" + "@babel/generator" "^7.12.11" + "@babel/helper-function-name" "^7.12.11" + "@babel/helper-split-export-declaration" "^7.12.11" + "@babel/parser" "^7.12.11" + "@babel/types" "^7.12.12" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + +"@babel/types@^7.12.10", "@babel/types@^7.12.11", "@babel/types@^7.12.12", "@babel/types@^7.12.7": + version "7.12.12" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" + integrity sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + +"@carbon/telemetry@0.0.0-alpha.6": + version "0.0.0-alpha.6" + resolved "https://registry.npmjs.org/@carbon/telemetry/-/telemetry-0.0.0-alpha.6.tgz#1d11e64f310e98f32c3db0c55f02e047f2398087" + integrity sha512-DCE8ui/tFi+qvCH+mewbUbWzsiq5Ko3HU1lgrVbpjWv1LfswLKFmMg4Os+PmX6edYoBj39qVChJPeaN/UyfJDw== + dependencies: + "@babel/parser" "^7.12.5" + "@babel/traverse" "^7.12.5" + ci-info "^2.0.0" + configstore "^5.0.1" + fast-glob "^3.2.4" + fs-extra "^9.0.1" + got "^11.8.0" + semver "^7.3.2" + winston "^3.3.3" + yargs "^16.1.1" + +"@dabh/diagnostics@^2.0.2": + version "2.0.2" + resolved "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" + integrity sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q== + dependencies: + colorspace "1.1.x" + enabled "2.0.x" + kuler "^2.0.0" + +"@nodelib/fs.scandir@2.1.4": + version "2.1.4" + resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69" + integrity sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA== + dependencies: + "@nodelib/fs.stat" "2.0.4" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.4", "@nodelib/fs.stat@^2.0.2": + version "2.0.4" + resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz#a3f2dd61bab43b8db8fa108a121cfffe4c676655" + integrity sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.6" + resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz#cce9396b30aa5afe9e3756608f5831adcb53d063" + integrity sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow== + dependencies: + "@nodelib/fs.scandir" "2.1.4" + fastq "^1.6.0" + +"@rollup/plugin-commonjs@^17.1.0": + version "17.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz#757ec88737dffa8aa913eb392fade2e45aef2a2d" + integrity sha512-PoMdXCw0ZyvjpCMT5aV4nkL0QywxP29sODQsSGeDpr/oI49Qq9tRtAsb/LbYbDzFlOydVEqHmmZWFtXJEAX9ew== + dependencies: + "@rollup/pluginutils" "^3.1.0" + commondir "^1.0.1" + estree-walker "^2.0.1" + glob "^7.1.6" + is-reference "^1.2.1" + magic-string "^0.25.7" + resolve "^1.17.0" + +"@rollup/plugin-node-resolve@^11.0.1", "@rollup/plugin-node-resolve@^11.1.1": + version "11.1.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.1.1.tgz#47bc34252914794a1b06fb50371d7520a03f91f3" + integrity sha512-zlBXR4eRS+2m79TsUZWhsd0slrHUYdRx4JF+aVQm+MI0wsKdlpC2vlDVjmlGvtZY1vsefOT9w3JxvmWSBei+Lg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" + builtin-modules "^3.1.0" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.19.0" + +"@rollup/pluginutils@^3.1.0": + version "3.1.0" + resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" + integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== + dependencies: + "@types/estree" "0.0.39" + estree-walker "^1.0.1" + picomatch "^2.2.2" + +"@sindresorhus/is@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.0.tgz#2ff674e9611b45b528896d820d3d7a812de2f0e4" + integrity sha512-FyD2meJpDPjyNQejSjvnhpgI/azsQkA4lGbuu5BQZfjvJ9cbRZXzeWL2HceCekW4lixO9JPesIIQkSoLjeJHNQ== + +"@szmarczak/http-timer@^4.0.5": + version "4.0.5" + resolved "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.5.tgz#bfbd50211e9dfa51ba07da58a14cdfd333205152" + integrity sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ== + dependencies: + defer-to-connect "^2.0.0" + +"@tsconfig/svelte@^1.0.10": + version "1.0.10" + resolved "https://registry.npmjs.org/@tsconfig/svelte/-/svelte-1.0.10.tgz#30ec7feeee0bdf38b12a50f0686f8a2e7b6b9dc0" + integrity sha512-EBrpH2iXXfaf/9z81koiDYkp2mlwW2XzFcAqn6qh7VKyP8zBvHHAQzNhY+W9vH5arAjmGAm5g8ElWq6YmXm3ig== + +"@types/cacheable-request@^6.0.1": + version "6.0.1" + resolved "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.1.tgz#5d22f3dded1fd3a84c0bbeb5039a7419c2c91976" + integrity sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "*" + "@types/node" "*" + "@types/responselike" "*" + +"@types/color-name@^1.1.1": + version "1.1.1" + resolved "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" + integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== + +"@types/estree@*": + version "0.0.45" + resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884" + integrity sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g== + +"@types/estree@0.0.39": + version "0.0.39" + resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" + integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== + +"@types/http-cache-semantics@*": + version "4.0.0" + resolved "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" + integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A== + +"@types/keyv@*": + version "3.1.1" + resolved "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7" + integrity sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw== + dependencies: + "@types/node" "*" + +"@types/node@*": + version "14.0.23" + resolved "https://registry.npmjs.org/@types/node/-/node-14.0.23.tgz#676fa0883450ed9da0bb24156213636290892806" + integrity sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw== + +"@types/parse-json@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" + integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== + +"@types/pug@^2.0.4": + version "2.0.4" + resolved "https://registry.npmjs.org/@types/pug/-/pug-2.0.4.tgz#8772fcd0418e3cd2cc171555d73007415051f4b2" + integrity sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI= + +"@types/resolve@1.17.1": + version "1.17.1" + resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" + integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== + dependencies: + "@types/node" "*" + +"@types/responselike@*", "@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + +"@types/sass@^1.16.0": + version "1.16.0" + resolved "https://registry.npmjs.org/@types/sass/-/sass-1.16.0.tgz#b41ac1c17fa68ffb57d43e2360486ef526b3d57d" + integrity sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA== + dependencies: + "@types/node" "*" + +acorn@^8.0.4: + version "8.0.5" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.0.5.tgz#a3bfb872a74a6a7f661bc81b9849d9cac12601b7" + integrity sha512-v+DieK/HJkJOpFBETDJioequtc3PfxsWMaxIdIwujtF7FEV/MAyDQLlm6/zPvr7Mix07mLh6ccVwIsloceodlg== + +aggregate-error@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz#db2fe7246e536f40d9b5442a39e117d7dd6a24e0" + integrity sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-escapes@^4.3.0: + version "4.3.1" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" + integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== + dependencies: + type-fest "^0.11.0" + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.2.1" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" + integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== + dependencies: + "@types/color-name" "^1.1.1" + color-convert "^2.0.1" + +anymatch@~3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" + integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= + +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + +async@^2.6.1: + version "2.6.3" + resolved "https://registry.npmjs.org/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + dependencies: + lodash "^4.17.14" + +async@^3.1.0: + version "3.2.0" + resolved "https://registry.npmjs.org/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" + integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw== + +at-least-node@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" + integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== + +autoprefixer@^10.2.4: + version "10.2.4" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.2.4.tgz#c0e7cf24fcc6a1ae5d6250c623f0cb8beef2f7e1" + integrity sha512-DCCdUQiMD+P/as8m3XkeTUkUKuuRqLGcwD0nll7wevhqoJfMRpJlkFd1+MQh1pvupjiQuip42lc/VFvfUTMSKw== + dependencies: + browserslist "^4.16.1" + caniuse-lite "^1.0.30001181" + colorette "^1.2.1" + fraction.js "^4.0.13" + normalize-range "^0.1.2" + postcss-value-parser "^4.1.0" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +binary-extensions@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" + integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.1, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browserslist@^4.16.1: + version "4.16.1" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.16.1.tgz#bf757a2da376b3447b800a16f0f1c96358138766" + integrity sha512-UXhDrwqsNcpTYJBTZsbGATDxZbiVDsx6UjpmRUmtnP10pr8wAYr5LgFoEFw9ixriQH2mv/NX2SfGzE/o8GndLA== + dependencies: + caniuse-lite "^1.0.30001173" + colorette "^1.2.1" + electron-to-chromium "^1.3.634" + escalade "^3.1.1" + node-releases "^1.1.69" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +builtin-modules@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484" + integrity sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw== + +cacheable-lookup@^5.0.3: + version "5.0.4" + resolved "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" + integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== + +cacheable-request@^7.0.1: + version "7.0.1" + resolved "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.1.tgz#062031c2856232782ed694a257fa35da93942a58" + integrity sha512-lt0mJ6YAnsrBErpTMWeu5kl/tg9xMAWjavYTN6VQXM1A/teBITuNcccXsCxF0tDQQJf9DfAaX5O4e0zp0KlfZw== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^4.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^2.0.0" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +caniuse-lite@^1.0.30001173: + version "1.0.30001180" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001180.tgz#67abcd6d1edf48fa5e7d1e84091d1d65ab76e33b" + integrity sha512-n8JVqXuZMVSPKiPiypjFtDTXc4jWIdjxull0f92WLo7e1MSi3uJ3NvveakSh/aCl1QKFAvIz3vIj0v+0K+FrXw== + +caniuse-lite@^1.0.30001181: + version "1.0.30001183" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001183.tgz#7a57ba9d6584119bb5f2bc76d3cc47ba9356b3e2" + integrity sha512-7JkwTEE1hlRKETbCFd8HDZeLiQIUcl8rC6JgNjvHCNaxOeNmQ9V4LvQXRUsKIV2CC73qKxljwVhToaA3kLRqTw== + +carbon-components@10.32.0: + version "10.32.0" + resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.32.0.tgz#0fbf60ea8fc12cea43ae7860bec844b3c2c0880f" + integrity sha512-LM44X6VhUc+yrZBSz+IW1aT/OGxAS0oiiy/kV7CiDpsUDF5zlPOwgokZbeYLo2mhB1wBZ1q9jwvItZ4zfaZuMw== + dependencies: + "@carbon/telemetry" "0.0.0-alpha.6" + flatpickr "4.6.1" + lodash.debounce "^4.0.8" + warning "^3.0.0" + +carbon-icons-svelte@^10.27.0: + version "10.27.0" + resolved "https://registry.yarnpkg.com/carbon-icons-svelte/-/carbon-icons-svelte-10.27.0.tgz#918e806d09e0e9cf61cf756ff0f9be49125ff9ea" + integrity sha512-e3l95wurOuEYMQxaDT2oYH322yRKgvTq5TDkzvylMGlCkA8erJH5lSwCM59VNFgPtptH4fIW9FlbQtpfp4iQ7Q== + +chalk@^2.0.0, chalk@^2.4.1: + version "2.4.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0, chalk@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +"chokidar@>=2.0.0 <4.0.0": + version "3.5.1" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" + integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.5.0" + optionalDependencies: + fsevents "~2.3.1" + +chokidar@^3.4.1: + version "3.4.3" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" + integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.5.0" + optionalDependencies: + fsevents "~2.1.2" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + +cli-truncate@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" + integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== + dependencies: + slice-ansi "^3.0.0" + string-width "^4.2.0" + +clipboard-copy@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/clipboard-copy/-/clipboard-copy-3.2.0.tgz#3c5b8651d3512dcfad295d77a9eb09e7fac8d5fb" + integrity sha512-vooFaGFL6ulEP1liiaWFBmmfuPm3cY3y7T9eB83ZTnYc/oFeAKsq3NcDrOkBC8XaauEE8zHQwI7k0+JSYiVQSQ== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + dependencies: + mimic-response "^1.0.0" + +color-convert@^1.9.0, color-convert@^1.9.1: + version "1.9.3" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@^1.0.0, color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +color-string@^1.5.2: + version "1.5.4" + resolved "https://registry.npmjs.org/color-string/-/color-string-1.5.4.tgz#dd51cd25cfee953d138fe4002372cc3d0e504cb6" + integrity sha512-57yF5yt8Xa3czSEW1jfQDE79Idk0+AkN/4KWad6tbdxUmAs3MvjxlWSWD4deYytcRfoZ9nhKyFl1kj5tBvidbw== + dependencies: + color-name "^1.0.0" + simple-swizzle "^0.2.2" + +color@3.0.x: + version "3.0.0" + resolved "https://registry.npmjs.org/color/-/color-3.0.0.tgz#d920b4328d534a3ac8295d68f7bd4ba6c427be9a" + integrity sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w== + dependencies: + color-convert "^1.9.1" + color-string "^1.5.2" + +colorette@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b" + integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw== + +colors@^1.2.1: + version "1.4.0" + resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" + integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== + +colorspace@1.1.x: + version "1.1.2" + resolved "https://registry.npmjs.org/colorspace/-/colorspace-1.1.2.tgz#e0128950d082b86a2168580796a0aa5d6c68d8c5" + integrity sha512-vt+OoIP2d76xLhjwbBaucYlNSpPsrJWPlBTtwCpQKIu6/CSMutyzX93O/Do0qzpH3YoHEes8YEFXyZ797rEhzQ== + dependencies: + color "3.0.x" + text-hex "1.0.x" + +commander@^2.18.0, commander@^2.20.0: + version "2.20.3" + resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commander@^6.2.0: + version "6.2.0" + resolved "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz#b990bfb8ac030aedc6d11bc04d1488ffef56db75" + integrity sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q== + +comment-parser@^0.7.6: + version "0.7.6" + resolved "https://registry.npmjs.org/comment-parser/-/comment-parser-0.7.6.tgz#0e743a53c8e646c899a1323db31f6cd337b10f12" + integrity sha512-GKNxVA7/iuTnAqGADlTWX4tkhzxZKXp5fLJqKTlQLHkE65XDUKutZ3BHaJC5IGcper2tT3QRD1xr4o3jNpgXXg== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + +compare-versions@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62" + integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +configstore@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" + integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== + dependencies: + dot-prop "^5.2.0" + graceful-fs "^4.1.2" + make-dir "^3.0.0" + unique-string "^2.0.0" + write-file-atomic "^3.0.0" + xdg-basedir "^4.0.0" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +cosmiconfig@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3" + integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.2.1" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.10.0" + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^7.0.0: + version "7.0.3" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +crypto-random-string@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" + integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== + +debug@^4.1.0, debug@^4.2.0: + version "4.3.1" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + dependencies: + ms "2.1.2" + +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= + +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + +defer-to-connect@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.0.tgz#83d6b199db041593ac84d781b5222308ccf4c2c1" + integrity sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg== + +define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +detect-indent@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz#0abd0f549f69fc6659a254fe96786186b6f528fd" + integrity sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA== + +dot-prop@^5.2.0: + version "5.3.0" + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" + integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== + dependencies: + is-obj "^2.0.0" + +electron-to-chromium@^1.3.634: + version "1.3.646" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.646.tgz#a7dc089d6d83b6d6cc01f91de524e91f12e6ccfa" + integrity sha512-P+3q8ugIPezulqoBYaLoUsF0fT4YNpe+zEDmdDUDnHZUAeSbBjMbis+JjJp9duU8BdfWV3VXf27NTBcwhRTsAQ== + +email-addresses@^3.0.1: + version "3.1.0" + resolved "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz#cabf7e085cbdb63008a70319a74e6136188812fb" + integrity sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +enabled@2.0.x: + version "2.0.0" + resolved "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" + integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== + +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +enquirer@^2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: + version "1.17.7" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" + integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-abstract@^1.18.0-next.0: + version "1.18.0-next.1" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" + integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-negative-zero "^2.0.0" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +estree-walker@^0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" + integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== + +estree-walker@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" + integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== + +estree-walker@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz#f8e030fb21cefa183b44b7ad516b747434e7a3e0" + integrity sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg== + +execa@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" + integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== + dependencies: + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + +fast-glob@^3.2.4, fast-glob@^3.2.5: + version "3.2.5" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" + integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + picomatch "^2.2.1" + +fast-safe-stringify@^2.0.4: + version "2.0.7" + resolved "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" + integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== + +fastq@^1.6.0: + version "1.10.0" + resolved "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz#74dbefccade964932cdf500473ef302719c652bb" + integrity sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA== + dependencies: + reusify "^1.0.4" + +fecha@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/fecha/-/fecha-4.2.0.tgz#3ffb6395453e3f3efff850404f0a59b6747f5f41" + integrity sha512-aN3pcx/DSmtyoovUudctc8+6Hl4T+hI9GBBHLjA76jdZl7+b1sgh5g4k+u/GL3dTy1/pnYzKp69FpJ0OicE3Wg== + +figures@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" + integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== + dependencies: + escape-string-regexp "^1.0.5" + +filename-reserved-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-1.0.0.tgz#e61cf805f0de1c984567d0386dc5df50ee5af7e4" + integrity sha1-5hz4BfDeHJhFZ9A4bcXfUO5a9+Q= + +filenamify-url@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/filenamify-url/-/filenamify-url-1.0.0.tgz#b32bd81319ef5863b73078bed50f46a4f7975f50" + integrity sha1-syvYExnvWGO3MHi+1Q9GpPeXX1A= + dependencies: + filenamify "^1.0.0" + humanize-url "^1.0.0" + +filenamify@^1.0.0: + version "1.2.1" + resolved "https://registry.npmjs.org/filenamify/-/filenamify-1.2.1.tgz#a9f2ffd11c503bed300015029272378f1f1365a5" + integrity sha1-qfL/0RxQO+0wABUCknI3jx8TZaU= + dependencies: + filename-reserved-regex "^1.0.0" + strip-outer "^1.0.0" + trim-repeated "^1.0.0" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-cache-dir@^3.3.1: + version "3.3.1" + resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" + integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== + dependencies: + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" + +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-versions@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz#3c57e573bf97769b8cb8df16934b627915da4965" + integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ== + dependencies: + semver-regex "^3.1.2" + +flatpickr@4.6.1: + version "4.6.1" + resolved "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.1.tgz#9eb498ab805dd27f5ae02e1ac6ac6c099ce45e94" + integrity sha512-3ULSxbXmcMIRzer/2jLNweoqHpwDvsjEawO2FUd9UFR8uPwLM+LruZcPDpuZStcEgbQKhuFOfXo4nYdGladSNw== + +flatpickr@4.6.9: + version "4.6.9" + resolved "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.9.tgz#9a13383e8a6814bda5d232eae3fcdccb97dc1499" + integrity sha512-F0azNNi8foVWKSF+8X+ZJzz8r9sE1G4hl06RyceIaLvyltKvDl6vqk9Lm/6AUUCi5HWaIjiUbk7UpeE/fOXOpw== + +fn.name@1.x.x: + version "1.1.0" + resolved "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" + integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== + +fraction.js@^4.0.13: + version "4.0.13" + resolved "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.13.tgz#3c1c315fa16b35c85fffa95725a36fa729c69dfe" + integrity sha512-E1fz2Xs9ltlUp+qbiyx9wmt2n9dRzPsS11Jtdb8D2o+cC7wr9xkkKsVKJuBX0ST+LVS+LhLO+SbLJNtfWcJvXA== + +fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^9.0.1: + version "9.0.1" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc" + integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^1.0.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +fsevents@~2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.1.tgz#b209ab14c61012636c8863507edf7fb68cc54e9f" + integrity sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" + integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== + +get-stream@^5.0.0, get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +gh-pages@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/gh-pages/-/gh-pages-3.1.0.tgz#ec3ed0f6a6e3fc3d888758fa018f08191c96bd55" + integrity sha512-3b1rly9kuf3/dXsT8+ZxP0UhNLOo1CItj+3e31yUVcaph/yDsJ9RzD7JOw5o5zpBTJVQLlJAASNkUfepi9fe2w== + dependencies: + async "^2.6.1" + commander "^2.18.0" + email-addresses "^3.0.1" + filenamify-url "^1.0.0" + find-cache-dir "^3.3.1" + fs-extra "^8.1.0" + globby "^6.1.0" + +glob-parent@^5.1.0, glob-parent@~5.1.0: + version "5.1.1" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + dependencies: + is-glob "^4.0.1" + +glob@^7.0.3, glob@^7.1.6: + version "7.1.6" + resolved "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globby@^6.1.0: + version "6.1.0" + resolved "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" + integrity sha1-9abXDoOV4hyFj7BInWTfAkJNUGw= + dependencies: + array-union "^1.0.1" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +got@^11.8.0: + version "11.8.1" + resolved "https://registry.npmjs.org/got/-/got-11.8.1.tgz#df04adfaf2e782babb3daabc79139feec2f7e85d" + integrity sha512-9aYdZL+6nHmvJwHALLwKSUZ0hMwGaJGYv3hoPLPgnT8BoBXm1SjnZeky+91tfwJaDzun2s4RsBRy48IEYv2q2Q== + dependencies: + "@sindresorhus/is" "^4.0.0" + "@szmarczak/http-timer" "^4.0.5" + "@types/cacheable-request" "^6.0.1" + "@types/responselike" "^1.0.0" + cacheable-lookup "^5.0.3" + cacheable-request "^7.0.1" + decompress-response "^6.0.0" + http2-wrapper "^1.0.0-beta.5.2" + lowercase-keys "^2.0.0" + p-cancelable "^2.0.0" + responselike "^2.0.0" + +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: + version "4.2.4" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-symbols@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hosted-git-info@^2.1.4: + version "2.8.8" + resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" + integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== + +http-cache-semantics@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" + integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== + +http2-wrapper@^1.0.0-beta.5.2: + version "1.0.0-beta.5.2" + resolved "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.0-beta.5.2.tgz#8b923deb90144aea65cf834b016a340fc98556f3" + integrity sha512-xYz9goEyBnC8XwXDTuC/MZ6t+MrKVQZOk4s7+PaDkwIsQd8IwqvM+0M6bA/2lvG8GHXcPdf+MejTUeO2LCPCeQ== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.0.0" + +human-signals@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" + integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== + +humanize-url@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/humanize-url/-/humanize-url-1.0.1.tgz#f4ab99e0d288174ca4e1e50407c55fbae464efff" + integrity sha1-9KuZ4NKIF0yk4eUEB8VfuuRk7/8= + dependencies: + normalize-url "^1.0.0" + strip-url-auth "^1.0.0" + +husky@^4.3.8: + version "4.3.8" + resolved "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d" + integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow== + dependencies: + chalk "^4.0.0" + ci-info "^2.0.0" + compare-versions "^3.6.0" + cosmiconfig "^7.0.0" + find-versions "^4.0.0" + opencollective-postinstall "^2.0.2" + pkg-dir "^5.0.0" + please-upgrade-node "^3.2.0" + slash "^3.0.0" + which-pm-runs "^1.0.0" + +import-fresh@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" + integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-arrayish@^0.3.1: + version "0.3.2" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" + integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-callable@^1.1.4, is-callable@^1.2.2: + version "1.2.2" + resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" + integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== + +is-core-module@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" + integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" + integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= + +is-negative-zero@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz#9553b121b0fac28869da9ed459e20c7543788461" + integrity sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= + +is-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" + integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== + +is-plain-obj@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + +is-reference@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== + dependencies: + "@types/estree" "*" + +is-regex@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" + integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== + dependencies: + has-symbols "^1.0.1" + +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= + +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + +is-symbol@^1.0.2: + version "1.0.3" + resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" + integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== + dependencies: + has-symbols "^1.0.1" + +is-typedarray@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +jest-worker@^26.2.1: + version "26.3.0" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-26.3.0.tgz#7c8a97e4f4364b4f05ed8bca8ca0c24de091871f" + integrity sha512-Vmpn2F6IASefL+DVBhPzI2J9/GJUsqzomdeN+P+dK8/jKxbh8R3BtFnx3FIta7wYlPU62cpJMJQo4kuOowcMnw== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^7.0.0" + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +keyv@^4.0.0: + version "4.0.3" + resolved "https://registry.npmjs.org/keyv/-/keyv-4.0.3.tgz#4f3aa98de254803cafcd2896734108daa35e4254" + integrity sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA== + dependencies: + json-buffer "3.0.1" + +kuler@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" + integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A== + +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + +lint-staged@^10.5.3: + version "10.5.3" + resolved "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.3.tgz#c682838b3eadd4c864d1022da05daa0912fb1da5" + integrity sha512-TanwFfuqUBLufxCc3RUtFEkFraSPNR3WzWcGF39R3f2J7S9+iF9W0KTVLfSy09lYGmZS5NDCxjNvhGMSJyFCWg== + dependencies: + chalk "^4.1.0" + cli-truncate "^2.1.0" + commander "^6.2.0" + cosmiconfig "^7.0.0" + debug "^4.2.0" + dedent "^0.7.0" + enquirer "^2.3.6" + execa "^4.1.0" + listr2 "^3.2.2" + log-symbols "^4.0.0" + micromatch "^4.0.2" + normalize-path "^3.0.0" + please-upgrade-node "^3.2.0" + string-argv "0.3.1" + stringify-object "^3.3.0" + +listr2@^3.2.2: + version "3.2.2" + resolved "https://registry.npmjs.org/listr2/-/listr2-3.2.2.tgz#d20feb75015e506992b55af40722ba1af168b8f1" + integrity sha512-AajqcZEUikF2ioph6PfH3dIuxJclhr3i3kHgTOP0xeXdWQohrvJAAmqVcV43/GI987HFY/vzT73jYXoa4esDHg== + dependencies: + chalk "^4.1.0" + cli-truncate "^2.1.0" + figures "^3.2.0" + indent-string "^4.0.0" + log-update "^4.0.0" + p-map "^4.0.0" + rxjs "^6.6.3" + through "^2.3.8" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + +lodash@^4.17.14, lodash@^4.17.19: + version "4.17.20" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +log-symbols@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" + integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA== + dependencies: + chalk "^4.0.0" + +log-update@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" + integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== + dependencies: + ansi-escapes "^4.3.0" + cli-cursor "^3.1.0" + slice-ansi "^4.0.0" + wrap-ansi "^6.2.0" + +logform@^2.2.0: + version "2.2.0" + resolved "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz#40f036d19161fc76b68ab50fdc7fe495544492f2" + integrity sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg== + dependencies: + colors "^1.2.1" + fast-safe-stringify "^2.0.4" + fecha "^4.2.0" + ms "^2.1.1" + triple-beam "^1.3.0" + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +magic-string@^0.25.7: + version "0.25.7" + resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" + integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== + dependencies: + sourcemap-codec "^1.4.4" + +make-dir@^3.0.0, make-dir@^3.0.2: + version "3.1.0" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +mimic-response@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + +min-indent@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" + integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nanoid@^3.1.20: + version "3.1.20" + resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788" + integrity sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +node-releases@^1.1.69: + version "1.1.70" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.70.tgz#66e0ed0273aa65666d7fe78febe7634875426a08" + integrity sha512-Slf2s69+2/uAD79pVVQo8uSiC34+g8GWY8UH2Qtqv34ZfhYrxpYpfzs9Js9d6O0mbDmALuxaTlplnBTnSELcrw== + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-range@^0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" + integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= + +normalize-url@^1.0.0: + version "1.9.1" + resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c" + integrity sha1-LMDWazHqIwNkWENuNiDYWVTGbDw= + dependencies: + object-assign "^4.0.1" + prepend-http "^1.0.0" + query-string "^4.1.0" + sort-keys "^1.0.0" + +normalize-url@^4.1.0: + version "4.5.0" + resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" + integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== + +npm-run-all@^4.1.5: + version "4.1.5" + resolved "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz#04476202a15ee0e2e214080861bff12a51d98fba" + integrity sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ== + dependencies: + ansi-styles "^3.2.1" + chalk "^2.4.1" + cross-spawn "^6.0.5" + memorystream "^0.3.1" + minimatch "^3.0.4" + pidtree "^0.3.0" + read-pkg "^3.0.0" + shell-quote "^1.6.1" + string.prototype.padend "^3.0.0" + +npm-run-path@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-inspect@^1.8.0: + version "1.8.0" + resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" + integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== + +object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz#303867a666cdd41936ecdedfb1f8f3e32a478cdd" + integrity sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.18.0-next.0" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +one-time@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz#e06bc174aed214ed58edede573b433bbf827cb45" + integrity sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g== + dependencies: + fn.name "1.x.x" + +onetime@^5.1.0: + version "5.1.0" + resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" + integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== + dependencies: + mimic-fn "^2.1.0" + +opencollective-postinstall@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259" + integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q== + +p-cancelable@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e" + integrity sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg== + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse-json@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz#73e5114c986d143efa3712d4ea24db9a4266f60f" + integrity sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + lines-and-columns "^1.1.6" + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1, picomatch@^2.2.2: + version "2.2.2" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + +pidtree@^0.3.0: + version "0.3.1" + resolved "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz#ef09ac2cc0533df1f3250ccf2c4d366b0d12114a" + integrity sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA== + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + +pkg-dir@^4.1.0: + version "4.2.0" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +pkg-dir@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" + integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== + dependencies: + find-up "^5.0.0" + +please-upgrade-node@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" + integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== + dependencies: + semver-compare "^1.0.0" + +postcss-value-parser@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" + integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== + +postcss@^8.2.4: + version "8.2.4" + resolved "https://registry.npmjs.org/postcss/-/postcss-8.2.4.tgz#20a98a39cf303d15129c2865a9ec37eda0031d04" + integrity sha512-kRFftRoExRVXZlwUuay9iC824qmXPcQQVzAjbCCgjpXnkdMCJYBu2gTwAaFBzv8ewND6O8xFb3aELmEkh9zTzg== + dependencies: + colorette "^1.2.1" + nanoid "^3.1.20" + source-map "^0.6.1" + +prepend-http@^1.0.0: + version "1.0.4" + resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= + +prettier-plugin-svelte@^2.1.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/prettier-plugin-svelte/-/prettier-plugin-svelte-2.1.5.tgz#cb1df2bffafa0562f05e02c6e9373806ef51ebb1" + integrity sha512-7ySuC/n0Rk8v6GrzoruojfLYde6ncjeFCAA65Dm+fXrK2Mgc3FlvzXMPpm//P3LgfEoc3zMEG/xog1YeoNhdSQ== + +prettier@^2.2.1: + version "2.2.1" + resolved "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" + integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +query-string@^4.1.0: + version "4.3.4" + resolved "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" + integrity sha1-u7aTucqRXCMlFbIosaArYJBD2+s= + dependencies: + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +readable-stream@^2.3.7: + version "2.3.7" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.4.0: + version "3.6.0" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readdirp@~3.5.0: + version "3.5.0" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" + integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== + dependencies: + picomatch "^2.2.1" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-relative@^0.8.7: + version "0.8.7" + resolved "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de" + integrity sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4= + +resolve-alpn@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.0.0.tgz#745ad60b3d6aff4b4a48e01b8c0bdc70959e0e8c" + integrity sha512-rTuiIEqFmGxne4IovivKSDzld2lWW9QCjqv80SYjPgf+gS35eaCAjaP54CCwGAwBtnCsvNLYtqxe1Nw+i6JEmA== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve@^1.10.0, resolve@^1.17.0: + version "1.17.0" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +resolve@^1.19.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" + integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== + dependencies: + is-core-module "^2.1.0" + path-parse "^1.0.6" + +responselike@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723" + integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw== + dependencies: + lowercase-keys "^2.0.0" + +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rollup-plugin-svelte@^7.0.0, rollup-plugin-svelte@^7.1.0: + version "7.1.0" + resolved "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.1.0.tgz#d45f2b92b1014be4eb46b55aa033fb9a9c65f04d" + integrity sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg== + dependencies: + require-relative "^0.8.7" + rollup-pluginutils "^2.8.2" + +rollup-plugin-terser@^7.0.2: + version "7.0.2" + resolved "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" + integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== + dependencies: + "@babel/code-frame" "^7.10.4" + jest-worker "^26.2.1" + serialize-javascript "^4.0.0" + terser "^5.0.0" + +rollup-pluginutils@^2.8.2: + version "2.8.2" + resolved "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" + integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== + dependencies: + estree-walker "^0.6.1" + +rollup@^2.36.0: + version "2.38.5" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.38.5.tgz#be41ad4fe0c103a8794377afceb5f22b8f603d6a" + integrity sha512-VoWt8DysFGDVRGWuHTqZzT02J0ASgjVq/hPs9QcBOGMd7B+jfTr/iqMVEyOi901rE3xq+Deq66GzIT1yt7sGwQ== + optionalDependencies: + fsevents "~2.3.1" + +rollup@^2.38.4: + version "2.38.4" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.38.4.tgz#1b84ea8728c73b1a00a6a6e9c630ec8c3fe48cea" + integrity sha512-B0LcJhjiwKkTl79aGVF/u5KdzsH8IylVfV56Ut6c9ouWLJcUK17T83aZBetNYSnZtXf2OHD4+2PbmRW+Fp5ulg== + optionalDependencies: + fsevents "~2.3.1" + +run-parallel@^1.1.9: + version "1.1.10" + resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz#60a51b2ae836636c81377df16cb107351bcd13ef" + integrity sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw== + +rxjs@^6.6.3: + version "6.6.3" + resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" + integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== + dependencies: + tslib "^1.9.0" + +safe-buffer@^5.1.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +sass@^1.32.6: + version "1.32.6" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.32.6.tgz#e3646c8325cd97ff75a8a15226007f3ccd221393" + integrity sha512-1bcDHDcSqeFtMr0JXI3xc/CXX6c4p0wHHivJdru8W7waM7a1WjKMm4m/Z5sY7CbVw4Whi2Chpcw6DFfSWwGLzQ== + dependencies: + chokidar ">=2.0.0 <4.0.0" + +semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= + +semver-regex@^3.1.2: + version "3.1.2" + resolved "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807" + integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA== + +"semver@2 || 3 || 4 || 5", semver@^5.5.0: + version "5.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.0.0: + version "6.3.0" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.3.2: + version "7.3.4" + resolved "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" + integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== + dependencies: + lru-cache "^6.0.0" + +serialize-javascript@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" + integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== + dependencies: + randombytes "^2.1.0" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +shell-quote@^1.6.1: + version "1.7.2" + resolved "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" + integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== + +signal-exit@^3.0.2: + version "3.0.3" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + +simple-swizzle@^0.2.2: + version "0.2.2" + resolved "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" + integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= + dependencies: + is-arrayish "^0.3.1" + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slice-ansi@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" + integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + +sort-keys@^1.0.0: + version "1.1.2" + resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" + integrity sha1-RBttTTRnmPG05J6JIK37oOVD+a0= + dependencies: + is-plain-obj "^1.0.0" + +source-map-support@~0.5.12: + version "0.5.19" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.5.0: + version "0.5.7" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@^0.7.3: + version "0.7.3" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + +sourcemap-codec@^1.4.4: + version "1.4.8" + resolved "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== + +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.5" + resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== + +stack-trace@0.0.x: + version "0.0.10" + resolved "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= + +string-argv@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" + integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +string.prototype.padend@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.0.tgz#dc08f57a8010dc5c153550318f67e13adbb72ac3" + integrity sha512-3aIv8Ffdp8EZj8iLwREGpQaUZiPyrWrpzMBHvkiSW/bK/EGve9np07Vwy7IJ5waydpGXzQZu/F8Oze2/IWkBaA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + +string.prototype.trimend@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" + integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + +string.prototype.trimstart@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" + integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +stringify-object@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== + dependencies: + get-own-enumerable-property-symbols "^3.0.0" + is-obj "^1.0.1" + is-regexp "^1.0.0" + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-indent@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" + integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== + dependencies: + min-indent "^1.0.0" + +strip-outer@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz#b2fd2abf6604b9d1e6013057195df836b8a9d631" + integrity sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg== + dependencies: + escape-string-regexp "^1.0.2" + +strip-url-auth@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/strip-url-auth/-/strip-url-auth-1.0.1.tgz#22b0fa3a41385b33be3f331551bbb837fa0cd7ae" + integrity sha1-IrD6OkE4WzO+PzMVUbu4N/oM164= + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.0.0, supports-color@^7.1.0: + version "7.1.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" + integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== + dependencies: + has-flag "^4.0.0" + +sveld@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/sveld/-/sveld-0.7.0.tgz#379ecb92e42216cca11f7d7beecef6587c8f2b16" + integrity sha512-M022X3vjs6EVunPSC/oubO3br8vwcBZXYTdglGrydNCSTY5JewE+tY6Y+z8TaYeFt7PtEc6uVz1vzBIUqcrpyw== + dependencies: + "@rollup/plugin-node-resolve" "^11.0.1" + acorn "^8.0.4" + comment-parser "^0.7.6" + fast-glob "^3.2.5" + fs-extra "^9.0.1" + prettier "^2.2.1" + rollup "^2.36.0" + rollup-plugin-svelte "^7.0.0" + svelte "^3.31.2" + +svelte-check@^1.1.32: + version "1.1.32" + resolved "https://registry.yarnpkg.com/svelte-check/-/svelte-check-1.1.32.tgz#a3b6865130ad82861122664b27f93f9e57350484" + integrity sha512-tnG79CAz9F5kY8EYGeTfKNSN2OPbSQR/BVAFB60cFYa4P59Ti+6iGZ4gxNFm+dmzFSgZ5bjDq/AJneA0h7Pxow== + dependencies: + chalk "^4.0.0" + chokidar "^3.4.1" + glob "^7.1.6" + import-fresh "^3.2.1" + minimist "^1.2.5" + source-map "^0.7.3" + svelte-preprocess "^4.0.0" + typescript "*" + +svelte-preprocess@^4.0.0: + version "4.5.2" + resolved "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.5.2.tgz#37976d1e0d866eb382411d486f7468d2275087e9" + integrity sha512-ClUX5NecnGBwI+nJnnBvKKy0XutCq5uHTIKe6cPhpvuOj9AAnyvef9wOZAE93yr85OKPutGCNIJa/X1TrJ7O0Q== + dependencies: + "@types/pug" "^2.0.4" + "@types/sass" "^1.16.0" + detect-indent "^6.0.0" + strip-indent "^3.0.0" + +svelte@^3.31.2, svelte@^3.32.1: + version "3.32.1" + resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.32.1.tgz#c4b6e35517d0ed77e652cc8964ef660afa2f70f3" + integrity sha512-j1KmD2ZOU0RGq1/STDXjwfh0/eJ/Deh2NXyuz1bpR9eOcz9yImn4CGxXdbSAN7cMTm9a7IyPUIbuBCzu/pXK0g== + +terser@^5.0.0: + version "5.3.0" + resolved "https://registry.npmjs.org/terser/-/terser-5.3.0.tgz#c481f4afecdcc182d5e2bdd2ff2dc61555161e81" + integrity sha512-XTT3D3AwxC54KywJijmY2mxZ8nJiEjBHVYzq8l9OaYuRFWeQNBwvipuzzYEP4e+/AVcd1hqG/CqgsdIRyT45Fg== + dependencies: + commander "^2.20.0" + source-map "~0.6.1" + source-map-support "~0.5.12" + +text-hex@1.0.x: + version "1.0.0" + resolved "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5" + integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg== + +through@^2.3.8: + version "2.3.8" + resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +trim-repeated@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz#e3646a2ea4e891312bf7eace6cfb05380bc01c21" + integrity sha1-42RqLqTokTEr9+rObPsFOAvAHCE= + dependencies: + escape-string-regexp "^1.0.2" + +triple-beam@^1.2.0, triple-beam@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9" + integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw== + +tslib@^1.9.0: + version "1.13.0" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" + integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== + +type-fest@^0.11.0: + version "0.11.0" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" + integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + +typescript@*: + version "4.0.5" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389" + integrity sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ== + +typescript@^4.1.3: + version "4.1.3" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7" + integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg== + +unique-string@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" + integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== + dependencies: + crypto-random-string "^2.0.0" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +universalify@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d" + integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug== + +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +warning@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c" + integrity sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w= + dependencies: + loose-envify "^1.0.0" + +which-pm-runs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" + integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +winston-transport@^4.4.0: + version "4.4.0" + resolved "https://registry.npmjs.org/winston-transport/-/winston-transport-4.4.0.tgz#17af518daa690d5b2ecccaa7acf7b20ca7925e59" + integrity sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw== + dependencies: + readable-stream "^2.3.7" + triple-beam "^1.2.0" + +winston@^3.3.3: + version "3.3.3" + resolved "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz#ae6172042cafb29786afa3d09c8ff833ab7c9170" + integrity sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw== + dependencies: + "@dabh/diagnostics" "^2.0.2" + async "^3.1.0" + is-stream "^2.0.0" + logform "^2.2.0" + one-time "^1.0.0" + readable-stream "^3.4.0" + stack-trace "0.0.x" + triple-beam "^1.3.0" + winston-transport "^4.4.0" + +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" + +xdg-basedir@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" + integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== + +y18n@^5.0.5: + version "5.0.5" + resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" + integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yaml@^1.10.0: + version "1.10.0" + resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e" + integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg== + +yargs-parser@^20.2.2: + version "20.2.4" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs@^16.1.1: + version "16.2.0" + resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==