diff --git a/package-lock.json b/package-lock.json index e47f475cf5b..2369a74a49f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,6 +43,7 @@ "@types/estree": "1.0.5", "@types/jest": "29.5.12", "@types/jest-axe": "3.5.9", + "@types/jsdom": "21.1.6", "@types/lodash-es": "4.17.12", "@types/node": "^20.12.7", "@types/prettier": "2.7.3", @@ -2954,9 +2955,9 @@ "dev": true }, "node_modules/@cspell/dict-golang": { - "version": "6.0.8", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.8.tgz", - "integrity": "sha512-1OwJNMU0oVISaNjaoQJatgYszFlNESzXPOg1f5/9V0+nL+R08nzDpZi4cWwPaHr8pIBtXzEoHL0dGY+IuoLFtQ==", + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.6.tgz", + "integrity": "sha512-NHgTtd8l8h4EEnBVb/WXlIh/b5CfX3xkaqCXUjOHBx9ToIFk7NdPnXbevwsBHIxy2QDdr7mi0f9RWtGyW4xYWg==", "dev": true }, "node_modules/@cspell/dict-haskell": { @@ -3089,9 +3090,9 @@ "dev": true }, "node_modules/@cspell/dict-software-terms": { - "version": "3.3.22", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.22.tgz", - "integrity": "sha512-uEtaN0xeDbGh88QX+SSvvBNvZahk3ZXBRnfgHWoppUF6WGtg1oLtuLWO6fGGtwRE4klXvSWP8rA2ixzAbWvYqw==", + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.20.tgz", + "integrity": "sha512-KmPwCxYWEu7SGyT/0m/n6i6R4ZgxbmN3XcerzA6Z629Wm5iZTVfJaMWqDK2RKAyBawS7OMfxGz0W/wYU4FhJlA==", "dev": true }, "node_modules/@cspell/dict-sql": { @@ -8948,6 +8949,17 @@ "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, + "node_modules/@types/jsdom": { + "version": "21.1.6", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.6.tgz", + "integrity": "sha512-/7kkMsC+/kMs7gAYmmBR9P0vGTnOoLhQhyhQJSlXGI5bzTHp6xdo0TtKWQAsz6pmSAeVqKSbqeyP6hytqr9FDw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -9175,6 +9187,12 @@ "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true + }, "node_modules/@types/trusted-types": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", @@ -11460,9 +11478,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001626", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001626.tgz", - "integrity": "sha512-JRW7kAH8PFJzoPCJhLSHgDgKg5348hsQ68aqb+slnzuB5QFERv846oA/mRChmlLAOdEDeOkRn3ynb1gSFnjt3w==", + "version": "1.0.30001620", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz", + "integrity": "sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==", "dev": true, "funding": [ { @@ -14551,9 +14569,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.775", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.775.tgz", - "integrity": "sha512-JpOfl1aNAiZ88wFzjPczTLwYIoPIsij8S9/XQH9lqMpiJOf23kxea68B8wje4f68t4rOIq4Bh+vP4I65njiJBw==", + "version": "1.4.774", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.774.tgz", + "integrity": "sha512-132O1XCd7zcTkzS3FgkAzKmnBuNJjK8WjcTtNuoylj7MYbqw5eXehjQ5OK91g0zm7OTKIPeaAG4CPoRfD9M1Mg==", "dev": true }, "node_modules/emittery": { @@ -36253,7 +36271,7 @@ }, "packages/calcite-components": { "name": "@esri/calcite-components", - "version": "2.9.1-next.1", + "version": "2.10.0-next.1", "license": "SEE LICENSE.md", "dependencies": { "@floating-ui/dom": "1.6.5", @@ -37504,10 +37522,10 @@ }, "packages/calcite-components-angular/projects/component-library": { "name": "@esri/calcite-components-angular", - "version": "2.9.1-next.1", + "version": "2.10.0-next.1", "license": "SEE LICENSE.md", "dependencies": { - "@esri/calcite-components": "^2.9.1-next.1", + "@esri/calcite-components": "^2.10.0-next.1", "tslib": "2.6.2" }, "peerDependencies": { @@ -37517,10 +37535,10 @@ }, "packages/calcite-components-react": { "name": "@esri/calcite-components-react", - "version": "2.9.1-next.1", + "version": "2.10.0-next.1", "license": "SEE LICENSE.md", "dependencies": { - "@esri/calcite-components": "^2.9.1-next.1" + "@esri/calcite-components": "^2.10.0-next.1" }, "peerDependencies": { "react": ">=16.7", diff --git a/package.json b/package.json index de159561418..45164384239 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "@types/estree": "1.0.5", "@types/jest": "29.5.12", "@types/jest-axe": "3.5.9", + "@types/jsdom": "21.1.6", "@types/lodash-es": "4.17.12", "@types/node": "^20.12.7", "@types/prettier": "2.7.3", diff --git a/packages/calcite-components-angular/projects/component-library/CHANGELOG.md b/packages/calcite-components-angular/projects/component-library/CHANGELOG.md index ec28835607e..f100fc7097f 100644 --- a/packages/calcite-components-angular/projects/component-library/CHANGELOG.md +++ b/packages/calcite-components-angular/projects/component-library/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.10.0-next.1](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.10.0-next.0...@esri/calcite-components-angular@2.10.0-next.1) (2024-06-06) + +**Note:** Version bump only for package @esri/calcite-components-angular + +## [2.10.0-next.0](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.9.1-next.3...@esri/calcite-components-angular@2.10.0-next.0) (2024-06-06) + +**Note:** Version bump only for package @esri/calcite-components-angular + +## [2.9.1-next.3](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.9.1-next.2...@esri/calcite-components-angular@2.9.1-next.3) (2024-06-05) + +**Note:** Version bump only for package @esri/calcite-components-angular + +## [2.9.1-next.2](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.9.1-next.1...@esri/calcite-components-angular@2.9.1-next.2) (2024-06-04) + +**Note:** Version bump only for package @esri/calcite-components-angular + ## [2.9.1-next.1](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-angular@2.9.1-next.0...@esri/calcite-components-angular@2.9.1-next.1) (2024-06-04) **Note:** Version bump only for package @esri/calcite-components-angular diff --git a/packages/calcite-components-angular/projects/component-library/package.json b/packages/calcite-components-angular/projects/component-library/package.json index f0774f1e2f1..c13bd859453 100644 --- a/packages/calcite-components-angular/projects/component-library/package.json +++ b/packages/calcite-components-angular/projects/component-library/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components-angular", - "version": "2.9.1-next.1", + "version": "2.10.0-next.1", "description": "A set of Angular components that wrap Esri's Calcite Components.", "homepage": "https://developers.arcgis.com/calcite-design-system/", "bugs": { @@ -20,7 +20,7 @@ "dist" ], "dependencies": { - "@esri/calcite-components": "^2.9.1-next.1", + "@esri/calcite-components": "^2.10.0-next.1", "tslib": "2.6.2" }, "peerDependencies": { diff --git a/packages/calcite-components-react/CHANGELOG.md b/packages/calcite-components-react/CHANGELOG.md index 7fcf5a6db5b..1106056e815 100644 --- a/packages/calcite-components-react/CHANGELOG.md +++ b/packages/calcite-components-react/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.10.0-next.1](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.10.0-next.0...@esri/calcite-components-react@2.10.0-next.1) (2024-06-06) + +**Note:** Version bump only for package @esri/calcite-components-react + +## [2.10.0-next.0](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.9.1-next.3...@esri/calcite-components-react@2.10.0-next.0) (2024-06-06) + +**Note:** Version bump only for package @esri/calcite-components-react + +## [2.9.1-next.3](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.9.1-next.2...@esri/calcite-components-react@2.9.1-next.3) (2024-06-05) + +**Note:** Version bump only for package @esri/calcite-components-react + +## [2.9.1-next.2](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.9.1-next.1...@esri/calcite-components-react@2.9.1-next.2) (2024-06-04) + +**Note:** Version bump only for package @esri/calcite-components-react + ## [2.9.1-next.1](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@2.9.1-next.0...@esri/calcite-components-react@2.9.1-next.1) (2024-06-04) **Note:** Version bump only for package @esri/calcite-components-react diff --git a/packages/calcite-components-react/package.json b/packages/calcite-components-react/package.json index 63b6ab59382..fb7397bca33 100644 --- a/packages/calcite-components-react/package.json +++ b/packages/calcite-components-react/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components-react", - "version": "2.9.1-next.1", + "version": "2.10.0-next.1", "description": "A set of React components that wrap calcite components", "homepage": "https://developers.arcgis.com/calcite-design-system/", "repository": { @@ -28,7 +28,7 @@ "tsc": "tsc" }, "dependencies": { - "@esri/calcite-components": "^2.9.1-next.1" + "@esri/calcite-components": "^2.10.0-next.1" }, "peerDependencies": { "react": ">=16.7", diff --git a/packages/calcite-components/.storybook/interfaces.ts b/packages/calcite-components/.storybook/interfaces.ts deleted file mode 100644 index 594ef97e87e..00000000000 --- a/packages/calcite-components/.storybook/interfaces.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* Note: using `.d.ts` file extension will exclude it from the output build */ -export type Alignment = "start" | "center" | "end"; -export type Appearance = "solid" | "outline" | "outline-fill" | "transparent"; -export type Columns = 1 | 2 | 3 | 4 | 5 | 6; -export type FlipContext = "both" | "start" | "end"; -export type Kind = "brand" | "danger" | "info" | "inverse" | "neutral" | "warning" | "success"; -export type Layout = - | "horizontal" - | "vertical" - | "grid" - | "inline" - | "center" - | "auto" - | "fixed" - | "none" - | "horizontal-single"; -export type LogicalFlowPosition = "inline-start" | "inline-end" | "block-start" | "block-end"; -export type ModeClass = "calcite-mode-light" | "calcite-mode-dark" | "calcite-mode-auto"; -export type ModeName = "light" | "dark" | "auto"; -export type Position = "start" | "end" | "top" | "bottom"; -export type SelectionAppearance = "icon" | "border"; -export type SelectionMode = - | "single" - | "none" - | "children" - | "single-persist" - | "multichildren" - | "ancestors" - | "multiple"; -export type Scale = "s" | "m" | "l"; -export type Status = "invalid" | "valid" | "idle"; -export type Width = "auto" | "half" | "full"; -export type ArrowType = "inline" | "edge" | "none"; -export type DisplayMode = "dock" | "float" | "overlay"; -export type ToggleDisplay = "button" | "switch"; -export type Dir = "ltr" | "rtl"; -export type ButtonType = "radio" | "checkbox"; -export type InteractionMode = "interactive" | "static"; -export type IconType = "chevron" | "caret" | "ellipsis" | "overflow"; -export type DeterminateType = "determinate" | "indeterminate"; -export type FillType = "single" | "range"; -export type LabelType = "percent" | "units"; -export type ClickType = "click" | "hover"; -export type CollapseDirection = "down" | "up"; -export type TextType = - | "text" - | "textarea" - | "email" - | "password" - | "tel" - | "number" - | "search" - | "file" - | "time" - | "date"; -export type Mode = "offset" | "name"; diff --git a/packages/calcite-components/.storybook/resources.ts b/packages/calcite-components/.storybook/resources.ts index 6d2a0e4f25b..c2f14090c76 100644 --- a/packages/calcite-components/.storybook/resources.ts +++ b/packages/calcite-components/.storybook/resources.ts @@ -8,23 +8,23 @@ import { Kind, Width, SelectionMode, - ArrowType, - DisplayMode, - ToggleDisplay, Layout, Dir, - ButtonType, - InteractionMode, IconType, - DeterminateType, - FillType, - LabelType, - ClickType, CollapseDirection, - TextType, - Mode, SelectionAppearance, -} from "./interfaces"; +} from "../../calcite-components/src/components/interfaces.ts"; +import { ArrowType } from "../src/components/carousel/interfaces.ts"; +import { BlockSectionToggleDisplay } from "../src/components/block-section/interfaces.ts"; +import { TileSelectType } from "../src/components/tile-select/interfaces.ts"; +import { TableInteractionMode } from "../src/components/table/interfaces.ts"; +import { DeterminateType } from "../src/components/loader/interfaces.ts"; +import { MeterFillType, MeterLabelType } from "../src/components/meter/interfaces.ts"; +import { DropdownClickType } from "../src/components/dropdown/interfaces.ts"; +import { TextType } from "../src/components/input/interfaces.ts"; +import { TimeZoneMode } from "../src/components/input-time-zone/interfaces.ts"; +import { DisplayMode } from "../src/components/sheet/interfaces.ts"; +import { ShellDisplayMode } from "../src/components/shell/interfaces.ts"; interface AttributeMetadata { values: T[]; @@ -43,20 +43,21 @@ interface CommonAttributes { selectionMode: AttributeMetadata; arrowType: AttributeMetadata; displayMode: AttributeMetadata; - toggleDisplay: AttributeMetadata; + toggleDisplay: AttributeMetadata; layout: AttributeMetadata; dir: AttributeMetadata; - buttonType: AttributeMetadata; - interactionMode: AttributeMetadata; + buttonType: AttributeMetadata; + interactionMode: AttributeMetadata; iconType: AttributeMetadata; determinateType: AttributeMetadata; - fillType: AttributeMetadata; - labelType: AttributeMetadata; - clickType: AttributeMetadata; + fillType: AttributeMetadata; + labelType: AttributeMetadata; + clickType: AttributeMetadata; collapseDirection: AttributeMetadata; textType: AttributeMetadata; - mode: AttributeMetadata; + mode: AttributeMetadata; selectionAppearance: AttributeMetadata; + shellDisplayMode: AttributeMetadata; } const logicalFlowPositionOptions: LogicalFlowPosition[] = ["inline-start", "inline-end", "block-start", "block-end"]; @@ -77,8 +78,8 @@ const selectionModeOptions: SelectionMode[] = [ "multiple", ]; const arrowTypeOptions: ArrowType[] = ["inline", "edge", "none"]; -const displayModeOptions: DisplayMode[] = ["dock", "float", "overlay"]; -const toggleDisplayOptions: ToggleDisplay[] = ["button", "switch"]; +const displayModeOptions: DisplayMode[] = ["float", "overlay"]; +const toggleDisplayOptions: BlockSectionToggleDisplay[] = ["button", "switch"]; const layoutOptions: Layout[] = [ "horizontal", "vertical", @@ -91,13 +92,13 @@ const layoutOptions: Layout[] = [ "horizontal-single", ]; const dirOptions: Dir[] = ["ltr", "rtl"]; -const buttonTypeOptions: ButtonType[] = ["radio", "checkbox"]; -const interactionModeOptions: InteractionMode[] = ["interactive", "static"]; -const iconTypeOptions: IconType[] = ["chevron", "caret", "ellipsis", "overflow"]; +const buttonTypeOptions: TileSelectType[] = ["radio", "checkbox"]; +const interactionModeOptions: TableInteractionMode[] = ["interactive", "static"]; +const iconTypeOptions: IconType[] = ["chevron", "caret", "ellipsis", "overflow", "plus-minus"]; const determinateTypeOptions: DeterminateType[] = ["determinate", "indeterminate"]; -const fillTypeOptions: FillType[] = ["single", "range"]; -const labelTypeOptions: LabelType[] = ["percent", "units"]; -const clickTypeOptions: ClickType[] = ["click", "hover"]; +const fillTypeOptions: MeterFillType[] = ["single", "range"]; +const labelTypeOptions: MeterLabelType[] = ["percent", "units"]; +const clickTypeOptions: DropdownClickType[] = ["click", "hover"]; const collapseDirectionOptions: CollapseDirection[] = ["down", "up"]; const textTypeOptions: TextType[] = [ "text", @@ -111,8 +112,9 @@ const textTypeOptions: TextType[] = [ "time", "date", ]; -const modeOptions: Mode[] = ["offset", "name"]; +const modeOptions: TimeZoneMode[] = ["offset", "name"]; const selectionAppearanceOptions: SelectionAppearance[] = ["icon", "border"]; +const shellDisplayModeOptions: ShellDisplayMode[] = ["dock", "float", "overlay"]; export const ATTRIBUTES: CommonAttributes = { alignment: { @@ -215,4 +217,8 @@ export const ATTRIBUTES: CommonAttributes = { values: selectionAppearanceOptions, defaultValue: selectionAppearanceOptions[0], }, + shellDisplayMode: { + values: shellDisplayModeOptions, + defaultValue: shellDisplayModeOptions[0], + }, }; diff --git a/packages/calcite-components/CHANGELOG.md b/packages/calcite-components/CHANGELOG.md index 2e893d0ebc5..9f19fa2f54f 100644 --- a/packages/calcite-components/CHANGELOG.md +++ b/packages/calcite-components/CHANGELOG.md @@ -3,6 +3,39 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.10.0-next.1](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.10.0-next.0...@esri/calcite-components@2.10.0-next.1) (2024-06-06) + +### Features + +- **action-bar, action-pad:** add expandLabel and collapseLabel to messages ([#9497](https://github.com/Esri/calcite-design-system/issues/9497)) ([12407eb](https://github.com/Esri/calcite-design-system/commit/12407eba686c7da11c5463b9e6dcbd74fdefb7cc)), closes [#5539](https://github.com/Esri/calcite-design-system/issues/5539) + +### Bug Fixes + +- **block:** add accessible label for slotted controls ([#9502](https://github.com/Esri/calcite-design-system/issues/9502)) ([a9054d5](https://github.com/Esri/calcite-design-system/commit/a9054d5e496cff038553ac349829b28ff5941a4f)), closes [#8037](https://github.com/Esri/calcite-design-system/issues/8037) + +## [2.10.0-next.0](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.9.1-next.3...@esri/calcite-components@2.10.0-next.0) (2024-06-06) + +### Features + +- **action-menu, combobox, dropdown, input-date-picker, popover:** allow logical placements for flipPlacements property. [#8825](https://github.com/Esri/calcite-design-system/issues/8825) ([#9490](https://github.com/Esri/calcite-design-system/issues/9490)) ([45aabaa](https://github.com/Esri/calcite-design-system/commit/45aabaa27ab50523ccdc5df07019cc8ed7dfb2b0)) + +### Bug Fixes + +- **list-item:** hide nested list items by default ([#9474](https://github.com/Esri/calcite-design-system/issues/9474)) ([fb06ef9](https://github.com/Esri/calcite-design-system/commit/fb06ef96c7bf719afa9a46c8eff09f0945c6f3cd)), closes [#9400](https://github.com/Esri/calcite-design-system/issues/9400) +- **popover:** correct border radius on close button ([#9485](https://github.com/Esri/calcite-design-system/issues/9485)) ([d0fba56](https://github.com/Esri/calcite-design-system/commit/d0fba5655ef730e012586f3be6ccb82f674308a7)), closes [#8208](https://github.com/Esri/calcite-design-system/issues/8208) + +## [2.9.1-next.3](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.9.1-next.2...@esri/calcite-components@2.9.1-next.3) (2024-06-05) + +### Bug Fixes + +- **alert:** pause auto-close alert when link focused ([#9503](https://github.com/Esri/calcite-design-system/issues/9503)) ([fa9a829](https://github.com/Esri/calcite-design-system/commit/fa9a8296d2757d8b58d6bb79d2d308d096507b49)), closes [#5960](https://github.com/Esri/calcite-design-system/issues/5960) + +## [2.9.1-next.2](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.9.1-next.1...@esri/calcite-components@2.9.1-next.2) (2024-06-04) + +### Bug Fixes + +- **block-section:** restore block toggling when clicking on the header switch ([#9472](https://github.com/Esri/calcite-design-system/issues/9472)) ([519a11c](https://github.com/Esri/calcite-design-system/commit/519a11c6d85383e7d7bab95a9c52330864606602)), closes [#9454](https://github.com/Esri/calcite-design-system/issues/9454) [#9194](https://github.com/Esri/calcite-design-system/issues/9194) + ## [2.9.1-next.1](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@2.9.1-next.0...@esri/calcite-components@2.9.1-next.1) (2024-06-04) ### Bug Fixes diff --git a/packages/calcite-components/package.json b/packages/calcite-components/package.json index 9e54e66245f..5eae7d88196 100644 --- a/packages/calcite-components/package.json +++ b/packages/calcite-components/package.json @@ -1,6 +1,6 @@ { "name": "@esri/calcite-components", - "version": "2.9.1-next.1", + "version": "2.10.0-next.1", "homepage": "https://developers.arcgis.com/calcite-design-system/", "description": "Web Components for Esri's Calcite Design System.", "main": "dist/index.cjs.js", diff --git a/packages/calcite-components/src/components.d.ts b/packages/calcite-components/src/components.d.ts index b0ea2d37b6c..af91005d058 100644 --- a/packages/calcite-components/src/components.d.ts +++ b/packages/calcite-components/src/components.d.ts @@ -5,12 +5,13 @@ * It contains typing information for all components that exist in this project. */ import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; -import { Alignment, Appearance, Columns, FlipContext, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces"; +import { Alignment, Appearance, CollapseDirection, FlipContext, IconType, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces"; import { RequestedItem } from "./components/accordion/interfaces"; import { RequestedItem as RequestedItem1 } from "./components/accordion-item/interfaces"; import { ActionMessages } from "./components/action/assets/action/t9n"; -import { EffectivePlacement, LogicalPlacement, MenuPlacement, OverlayPositioning, ReferenceElement } from "./utils/floating-ui"; +import { FlipPlacement, LogicalPlacement, MenuPlacement, OverlayPositioning, ReferenceElement } from "./utils/floating-ui"; import { ActionBarMessages } from "./components/action-bar/assets/action-bar/t9n"; +import { Columns } from "./components/action-group/interfaces"; import { ActionGroupMessages } from "./components/action-group/assets/action-group/t9n"; import { ActionPadMessages } from "./components/action-pad/assets/action-pad/t9n"; import { AlertDuration, Sync } from "./components/alert/interfaces"; @@ -61,7 +62,7 @@ import { ListItemMessages } from "./components/list-item/assets/list-item/t9n"; import { MenuMessages } from "./components/menu/assets/menu/t9n"; import { MenuItemMessages } from "./components/menu-item/assets/menu-item/t9n"; import { MenuItemCustomEvent } from "./components/menu-item/interfaces"; -import { MeterLabelType } from "./components/meter/interfaces"; +import { MeterFillType, MeterLabelType } from "./components/meter/interfaces"; import { ModalMessages } from "./components/modal/assets/modal/t9n"; import { NoticeMessages } from "./components/notice/assets/notice/t9n"; import { PaginationMessages } from "./components/pagination/assets/pagination/t9n"; @@ -95,12 +96,13 @@ import { TipManagerMessages } from "./components/tip-manager/assets/tip-manager/ import { TreeItemSelectDetail } from "./components/tree-item/interfaces"; import { ValueListMessages } from "./components/value-list/assets/value-list/t9n"; import { ListItemAndHandle } from "./components/value-list-item/interfaces"; -export { Alignment, Appearance, Columns, FlipContext, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces"; +export { Alignment, Appearance, CollapseDirection, FlipContext, IconType, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces"; export { RequestedItem } from "./components/accordion/interfaces"; export { RequestedItem as RequestedItem1 } from "./components/accordion-item/interfaces"; export { ActionMessages } from "./components/action/assets/action/t9n"; -export { EffectivePlacement, LogicalPlacement, MenuPlacement, OverlayPositioning, ReferenceElement } from "./utils/floating-ui"; +export { FlipPlacement, LogicalPlacement, MenuPlacement, OverlayPositioning, ReferenceElement } from "./utils/floating-ui"; export { ActionBarMessages } from "./components/action-bar/assets/action-bar/t9n"; +export { Columns } from "./components/action-group/interfaces"; export { ActionGroupMessages } from "./components/action-group/assets/action-group/t9n"; export { ActionPadMessages } from "./components/action-pad/assets/action-pad/t9n"; export { AlertDuration, Sync } from "./components/alert/interfaces"; @@ -151,7 +153,7 @@ export { ListItemMessages } from "./components/list-item/assets/list-item/t9n"; export { MenuMessages } from "./components/menu/assets/menu/t9n"; export { MenuItemMessages } from "./components/menu-item/assets/menu-item/t9n"; export { MenuItemCustomEvent } from "./components/menu-item/interfaces"; -export { MeterLabelType } from "./components/meter/interfaces"; +export { MeterFillType, MeterLabelType } from "./components/meter/interfaces"; export { ModalMessages } from "./components/modal/assets/modal/t9n"; export { NoticeMessages } from "./components/notice/assets/notice/t9n"; export { PaginationMessages } from "./components/pagination/assets/pagination/t9n"; @@ -194,11 +196,11 @@ export namespace Components { /** * Specifies the placement of the icon in the header. */ - "iconPosition": Position; + "iconPosition": Extract<"start" | "end", Position>; /** * Specifies the type of the icon in the header. */ - "iconType": "chevron" | "caret" | "plus-minus"; + "iconType": Extract<"chevron" | "caret" | "plus-minus", IconType>; /** * Specifies the size of the component. */ @@ -239,7 +241,7 @@ export namespace Components { /** * Specifies the placement of the icon in the header inherited from the `calcite-accordion`. */ - "iconPosition": Position; + "iconPosition": Extract<"start" | "end", Position>; /** * Specifies an icon to display at the start of the component. */ @@ -247,7 +249,7 @@ export namespace Components { /** * Specifies the type of the icon in the header inherited from the `calcite-accordion`. */ - "iconType": "chevron" | "caret" | "plus-minus"; + "iconType": Extract<"chevron" | "caret" | "plus-minus", IconType>; /** * Specifies the size of the component inherited from the `calcite-accordion`. */ @@ -363,7 +365,7 @@ export namespace Components { /** * Arranges the component depending on the element's `dir` property. */ - "position": Position; + "position": Extract<"start" | "end", Position>; /** * Specifies the size of the expand `calcite-action`. */ @@ -390,7 +392,7 @@ export namespace Components { * Indicates the layout of the component. * @deprecated Use the `layout` property on the component's parent instead. */ - "layout": Layout; + "layout": Extract<"horizontal" | "vertical" | "grid", Layout>; /** * When `true`, the `calcite-action-menu` is open. */ @@ -428,7 +430,7 @@ export namespace Components { /** * Defines the available placements that can be used when a flip occurs. */ - "flipPlacements": EffectivePlacement[]; + "flipPlacements": FlipPlacement[]; /** * Specifies the text string for the component. */ @@ -470,7 +472,7 @@ export namespace Components { /** * Indicates the layout of the component. */ - "layout": Layout; + "layout": Extract<"horizontal" | "vertical" | "grid", Layout>; /** * Use this property to override individual strings used by the component. */ @@ -486,7 +488,7 @@ export namespace Components { /** * Arranges the component depending on the element's `dir` property. */ - "position": Position; + "position": Extract<"start" | "end", Position>; /** * Specifies the size of the expand `calcite-action`. */ @@ -1229,7 +1231,7 @@ export namespace Components { /** * Defines the available placements that can be used when a flip occurs. */ - "flipPlacements": EffectivePlacement[]; + "flipPlacements": FlipPlacement[]; /** * The `id` of the form that will be associated with the component. When not set, the component will be associated with its ancestor form element, if any. */ @@ -1627,7 +1629,7 @@ export namespace Components { /** * Defines the available placements that can be used when a flip occurs. */ - "flipPlacements": EffectivePlacement[]; + "flipPlacements": FlipPlacement[]; /** * Specifies the maximum number of `calcite-dropdown-item`s to display before showing a scroller. Value must be greater than `0`, and does not include `groupTitle`'s from `calcite-dropdown-group`. */ @@ -1858,7 +1860,7 @@ export namespace Components { /** * Specifies the direction of the collapse. */ - "collapseDirection": "down" | "up"; + "collapseDirection": CollapseDirection; /** * When `true`, hides the component's content area. */ @@ -2249,7 +2251,7 @@ export namespace Components { /** * Defines the available placements that can be used when a flip occurs. */ - "flipPlacements": EffectivePlacement[]; + "flipPlacements": FlipPlacement[]; /** * When `true`, prevents focus trapping. */ @@ -3252,7 +3254,7 @@ export namespace Components { /** * Specifies the component's display, where `"single"` displays a single color and `"range"` displays a range of colors based on provided `low`, `high`, `min` or `max` values. */ - "fillType": "single" | "range"; + "fillType": MeterFillType; /** * The `id` of the form that will be associated with the component. When not set, the component will be associated with its ancestor form element, if any. */ @@ -3630,7 +3632,7 @@ export namespace Components { /** * Specifies the direction of the collapse. */ - "collapseDirection": "down" | "up"; + "collapseDirection": CollapseDirection; /** * When `true`, hides the component's content area. */ @@ -3836,7 +3838,7 @@ export namespace Components { /** * Defines the available placements that can be used when a flip occurs. */ - "flipPlacements": EffectivePlacement[]; + "flipPlacements": FlipPlacement[]; /** * When `true`, prevents focus trapping. */ @@ -3993,7 +3995,7 @@ export namespace Components { /** * Defines the layout of the component. */ - "layout": Layout; + "layout": Extract<"horizontal" | "vertical" | "grid", Layout>; /** * Specifies the name of the component on form submission. Must be unique to other component instances. */ @@ -4185,7 +4187,7 @@ export namespace Components { /** * Defines the layout of the component inherited from parent `calcite-segmented-control`, defaults to `horizontal`. */ - "layout": Layout; + "layout": Extract<"horizontal" | "vertical" | "grid", Layout>; /** * Specifies the size of the component inherited from the `calcite-segmented-control`, defaults to `m`. */ @@ -4333,7 +4335,7 @@ export namespace Components { /** * Specifies the component's position. Will be flipped when the element direction is right-to-left (`"rtl"`). */ - "position": Position; + "position": Extract<"start" | "end", Position>; } interface CalciteShellPanel { /** @@ -4373,7 +4375,7 @@ export namespace Components { /** * Specifies the component's position. Will be flipped when the element direction is right-to-left (`"rtl"`). */ - "position": Position; + "position": Extract<"start" | "end", Position>; /** * When `true` and `displayMode` is not `float`, the component's content area is resizable. */ @@ -4530,7 +4532,7 @@ export namespace Components { /** * Indicates the horizontal or vertical orientation of the component. */ - "layout": Layout; + "layout": Extract<"horizontal" | "vertical" | "grid", Layout>; /** * When true, content is waiting to be loaded. This state shows a busy indicator. */ @@ -5252,7 +5254,7 @@ export namespace Components { /** * Defines the layout of the component. Use `"horizontal"` for rows, and `"vertical"` for a single column. */ - "layout": Exclude; + "layout": Extract; /** * Specifies the size of the component. */ @@ -5293,7 +5295,7 @@ export namespace Components { /** * Defines the layout of the component. Use `"horizontal"` for rows, and `"vertical"` for a single column. */ - "layout": Exclude; + "layout": Extract; /** * Specifies the size of the component. */ @@ -7901,11 +7903,11 @@ declare namespace LocalJSX { /** * Specifies the placement of the icon in the header. */ - "iconPosition"?: Position; + "iconPosition"?: Extract<"start" | "end", Position>; /** * Specifies the type of the icon in the header. */ - "iconType"?: "chevron" | "caret" | "plus-minus"; + "iconType"?: Extract<"chevron" | "caret" | "plus-minus", IconType>; "onCalciteInternalAccordionChange"?: (event: CalciteAccordionCustomEvent) => void; /** * Specifies the size of the component. @@ -7947,7 +7949,7 @@ declare namespace LocalJSX { /** * Specifies the placement of the icon in the header inherited from the `calcite-accordion`. */ - "iconPosition"?: Position; + "iconPosition"?: Extract<"start" | "end", Position>; /** * Specifies an icon to display at the start of the component. */ @@ -7955,7 +7957,7 @@ declare namespace LocalJSX { /** * Specifies the type of the icon in the header inherited from the `calcite-accordion`. */ - "iconType"?: "chevron" | "caret" | "plus-minus"; + "iconType"?: Extract<"chevron" | "caret" | "plus-minus", IconType>; "onCalciteInternalAccordionItemClose"?: (event: CalciteAccordionItemCustomEvent) => void; "onCalciteInternalAccordionItemSelect"?: (event: CalciteAccordionItemCustomEvent) => void; /** @@ -8065,7 +8067,7 @@ declare namespace LocalJSX { /** * Arranges the component depending on the element's `dir` property. */ - "position"?: Position; + "position"?: Extract<"start" | "end", Position>; /** * Specifies the size of the expand `calcite-action`. */ @@ -8088,7 +8090,7 @@ declare namespace LocalJSX { * Indicates the layout of the component. * @deprecated Use the `layout` property on the component's parent instead. */ - "layout"?: Layout; + "layout"?: Extract<"horizontal" | "vertical" | "grid", Layout>; /** * When `true`, the `calcite-action-menu` is open. */ @@ -8122,7 +8124,7 @@ declare namespace LocalJSX { /** * Defines the available placements that can be used when a flip occurs. */ - "flipPlacements"?: EffectivePlacement[]; + "flipPlacements"?: FlipPlacement[]; /** * Specifies the text string for the component. */ @@ -8164,7 +8166,7 @@ declare namespace LocalJSX { /** * Indicates the layout of the component. */ - "layout"?: Layout; + "layout"?: Extract<"horizontal" | "vertical" | "grid", Layout>; /** * Use this property to override individual strings used by the component. */ @@ -8184,7 +8186,7 @@ declare namespace LocalJSX { /** * Arranges the component depending on the element's `dir` property. */ - "position"?: Position; + "position"?: Extract<"start" | "end", Position>; /** * Specifies the size of the expand `calcite-action`. */ @@ -8984,7 +8986,7 @@ declare namespace LocalJSX { /** * Defines the available placements that can be used when a flip occurs. */ - "flipPlacements"?: EffectivePlacement[]; + "flipPlacements"?: FlipPlacement[]; /** * The `id` of the form that will be associated with the component. When not set, the component will be associated with its ancestor form element, if any. */ @@ -9425,7 +9427,7 @@ declare namespace LocalJSX { /** * Defines the available placements that can be used when a flip occurs. */ - "flipPlacements"?: EffectivePlacement[]; + "flipPlacements"?: FlipPlacement[]; /** * Specifies the maximum number of `calcite-dropdown-item`s to display before showing a scroller. Value must be greater than `0`, and does not include `groupTitle`'s from `calcite-dropdown-group`. */ @@ -9653,7 +9655,7 @@ declare namespace LocalJSX { /** * Specifies the direction of the collapse. */ - "collapseDirection"?: "down" | "up"; + "collapseDirection"?: CollapseDirection; /** * When `true`, hides the component's content area. */ @@ -10063,7 +10065,7 @@ declare namespace LocalJSX { /** * Defines the available placements that can be used when a flip occurs. */ - "flipPlacements"?: EffectivePlacement[]; + "flipPlacements"?: FlipPlacement[]; /** * When `true`, prevents focus trapping. */ @@ -11153,7 +11155,7 @@ declare namespace LocalJSX { /** * Specifies the component's display, where `"single"` displays a single color and `"range"` displays a range of colors based on provided `low`, `high`, `min` or `max` values. */ - "fillType"?: "single" | "range"; + "fillType"?: MeterFillType; /** * The `id` of the form that will be associated with the component. When not set, the component will be associated with its ancestor form element, if any. */ @@ -11526,7 +11528,7 @@ declare namespace LocalJSX { /** * Specifies the direction of the collapse. */ - "collapseDirection"?: "down" | "up"; + "collapseDirection"?: CollapseDirection; /** * When `true`, hides the component's content area. */ @@ -11747,7 +11749,7 @@ declare namespace LocalJSX { /** * Defines the available placements that can be used when a flip occurs. */ - "flipPlacements"?: EffectivePlacement[]; + "flipPlacements"?: FlipPlacement[]; /** * When `true`, prevents focus trapping. */ @@ -11918,7 +11920,7 @@ declare namespace LocalJSX { /** * Defines the layout of the component. */ - "layout"?: Layout; + "layout"?: Extract<"horizontal" | "vertical" | "grid", Layout>; /** * Specifies the name of the component on form submission. Must be unique to other component instances. */ @@ -12110,7 +12112,7 @@ declare namespace LocalJSX { /** * Defines the layout of the component inherited from parent `calcite-segmented-control`, defaults to `horizontal`. */ - "layout"?: Layout; + "layout"?: Extract<"horizontal" | "vertical" | "grid", Layout>; /** * Fires when the item has been selected. */ @@ -12270,7 +12272,7 @@ declare namespace LocalJSX { /** * Specifies the component's position. Will be flipped when the element direction is right-to-left (`"rtl"`). */ - "position"?: Position; + "position"?: Extract<"start" | "end", Position>; } interface CalciteShellPanel { /** @@ -12312,7 +12314,7 @@ declare namespace LocalJSX { /** * Specifies the component's position. Will be flipped when the element direction is right-to-left (`"rtl"`). */ - "position"?: Position; + "position"?: Extract<"start" | "end", Position>; /** * When `true` and `displayMode` is not `float`, the component's content area is resizable. */ @@ -12473,7 +12475,7 @@ declare namespace LocalJSX { /** * Indicates the horizontal or vertical orientation of the component. */ - "layout"?: Layout; + "layout"?: Extract<"horizontal" | "vertical" | "grid", Layout>; /** * When true, content is waiting to be loaded. This state shows a busy indicator. */ @@ -13210,7 +13212,7 @@ declare namespace LocalJSX { /** * Defines the layout of the component. Use `"horizontal"` for rows, and `"vertical"` for a single column. */ - "layout"?: Exclude; + "layout"?: Extract; "onCalciteInternalTileKeyEvent"?: (event: CalciteTileCustomEvent) => void; /** * Fires when the selected state of the component changes. @@ -13252,7 +13254,7 @@ declare namespace LocalJSX { /** * Defines the layout of the component. Use `"horizontal"` for rows, and `"vertical"` for a single column. */ - "layout"?: Exclude; + "layout"?: Extract; /** * Fires when the component's selection changes. */ diff --git a/packages/calcite-components/src/components/accordion-item/accordion-item.tsx b/packages/calcite-components/src/components/accordion-item/accordion-item.tsx index 3336c3868da..973e9374f3a 100644 --- a/packages/calcite-components/src/components/accordion-item/accordion-item.tsx +++ b/packages/calcite-components/src/components/accordion-item/accordion-item.tsx @@ -23,8 +23,13 @@ import { } from "../../utils/dom"; import { CSS_UTILITY } from "../../utils/resources"; import { getIconScale } from "../../utils/component"; -import { FlipContext, Position, Scale, SelectionMode } from "../interfaces"; -import { componentFocusable } from "../../utils/component"; +import { FlipContext, Position, Scale, SelectionMode, IconType } from "../interfaces"; +import { + componentFocusable, + LoadableComponent, + setComponentLoaded, + setUpLoadableComponent, +} from "../../utils/loadable"; import { SLOTS, CSS, IDS } from "./resources"; import { RequestedItem } from "./interfaces"; @@ -38,7 +43,7 @@ import { RequestedItem } from "./interfaces"; styleUrl: "accordion-item.scss", shadow: true, }) -export class AccordionItem implements ConditionalSlotComponent { +export class AccordionItem implements ConditionalSlotComponent, LoadableComponent { //-------------------------------------------------------------------------- // // Public Properties @@ -68,13 +73,13 @@ export class AccordionItem implements ConditionalSlotComponent { * * @internal */ - @Prop() iconPosition: Position; + @Prop() iconPosition: Extract<"start" | "end", Position>; /** Specifies the type of the icon in the header inherited from the `calcite-accordion`. * * @internal */ - @Prop() iconType: "chevron" | "caret" | "plus-minus"; + @Prop() iconType: Extract<"chevron" | "caret" | "plus-minus", IconType>; /** * The containing `accordion` element. @@ -116,6 +121,14 @@ export class AccordionItem implements ConditionalSlotComponent { connectConditionalSlotComponent(this); } + componentWillLoad(): void { + setUpLoadableComponent(this); + } + + componentDidLoad(): void { + setComponentLoaded(this); + } + disconnectedCallback(): void { disconnectConditionalSlotComponent(this); } @@ -300,7 +313,7 @@ export class AccordionItem implements ConditionalSlotComponent { /** Sets focus on the component. */ @Method() async setFocus(): Promise { - await componentFocusable(this.el); + await componentFocusable(this); this.headerEl.focus(); } diff --git a/packages/calcite-components/src/components/accordion/accordion.stories.ts b/packages/calcite-components/src/components/accordion/accordion.stories.ts index f5a3cafc654..122990c1642 100644 --- a/packages/calcite-components/src/components/accordion/accordion.stories.ts +++ b/packages/calcite-components/src/components/accordion/accordion.stories.ts @@ -1,19 +1,14 @@ +import { AccordionItem } from "../accordion-item/accordion-item"; import { modesDarkDefault } from "../../../.storybook/utils"; import { placeholderImage } from "../../../.storybook/placeholderImage"; import { iconNames } from "../../../.storybook/helpers"; import { html } from "../../../support/formatting"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { Accordion } from "./accordion"; const { scale, appearance, selectionMode } = ATTRIBUTES; -interface AccordionArgs { - scale: string; - appearance: string; - selectionMode: string; - heading: string; - description: string; - iconStart: string; - iconEnd: string; -} +type AccordionStoryArgs = Pick & + Pick; export default { title: "Components/Accordion", @@ -62,7 +57,7 @@ const accordionItemContent = `Custom content here

More custom content here`; -export const simple = (args: AccordionArgs): string => html` +export const simple = (args: AccordionStoryArgs): string => html` = "solid"; /** Specifies the placement of the icon in the header. */ - @Prop({ reflect: true }) iconPosition: Position = "end"; + @Prop({ reflect: true }) iconPosition: Extract<"start" | "end", Position> = "end"; /** Specifies the type of the icon in the header. */ - @Prop({ reflect: true }) iconType: "chevron" | "caret" | "plus-minus" = "chevron"; + @Prop({ reflect: true }) iconType: Extract<"chevron" | "caret" | "plus-minus", IconType> = + "chevron"; /** Specifies the size of the component. */ @Prop({ reflect: true }) scale: Scale = "m"; diff --git a/packages/calcite-components/src/components/action-bar/action-bar.e2e.ts b/packages/calcite-components/src/components/action-bar/action-bar.e2e.ts index b11afdf4a08..5ab4d2a3967 100755 --- a/packages/calcite-components/src/components/action-bar/action-bar.e2e.ts +++ b/packages/calcite-components/src/components/action-bar/action-bar.e2e.ts @@ -75,6 +75,37 @@ describe("calcite-action-bar", () => { ); }); + describe("messageOverrides", () => { + it("should honor expandLabel and collapseLabel", async () => { + const page = await newE2EPage(); + + await page.setContent(""); + await page.waitForChanges(); + + const actionBar = await page.find("calcite-action-bar"); + + const expandLabel = "Open me up"; + const collapseLabel = "Close me down"; + + actionBar.setProperty("messageOverrides", { + expandLabel, + collapseLabel, + }); + await page.waitForChanges(); + + const expandAction = await page.find("calcite-action-bar >>> #expand-toggle"); + + expect(expandAction).not.toBeNull(); + + expect(await expandAction.getProperty("label")).toBe(expandLabel); + + actionBar.setProperty("expanded", true); + await page.waitForChanges(); + + expect(await expandAction.getProperty("label")).toBe(collapseLabel); + }); + }); + describe("expand functionality", () => { it("should not modify actions within an action-menu", async () => { const page = await newE2EPage({ @@ -109,7 +140,7 @@ describe("calcite-action-bar", () => { await page.waitForChanges(); - const expandAction = await page.find("calcite-action-bar >>> calcite-action"); + const expandAction = await page.find("calcite-action-bar >>> #expand-toggle"); expect(expandAction).not.toBeNull(); }); diff --git a/packages/calcite-components/src/components/action-bar/action-bar.stories.ts b/packages/calcite-components/src/components/action-bar/action-bar.stories.ts index 0009376f81a..968c00b2345 100644 --- a/packages/calcite-components/src/components/action-bar/action-bar.stories.ts +++ b/packages/calcite-components/src/components/action-bar/action-bar.stories.ts @@ -1,13 +1,10 @@ import { boolean, modesDarkDefault } from "../../../.storybook/utils"; import { html } from "../../../support/formatting"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { ActionBar } from "./action-bar"; const { position } = ATTRIBUTES; -interface ActionBarArgs { - expandDisabled: boolean; - expanded: boolean; - position: string; -} +type ActionBarStoryArgs = Pick; export default { title: "Components/Action Bar", @@ -24,7 +21,7 @@ export default { }, }; -export const simple = (args: ActionBarArgs): string => html` +export const simple = (args: ActionBarStoryArgs): string => html` ; /** * Specifies the size of the expand `calcite-action`. @@ -407,8 +407,10 @@ export class ActionBar const expandToggleNode = !expandDisabled ? ( = "vertical"; /** * Indicates number of columns. diff --git a/packages/calcite-components/src/components/action-group/interfaces.ts b/packages/calcite-components/src/components/action-group/interfaces.ts new file mode 100644 index 00000000000..0acab8fea32 --- /dev/null +++ b/packages/calcite-components/src/components/action-group/interfaces.ts @@ -0,0 +1 @@ +export type Columns = 1 | 2 | 3 | 4 | 5 | 6; diff --git a/packages/calcite-components/src/components/action-menu/action-menu.tsx b/packages/calcite-components/src/components/action-menu/action-menu.tsx index 9aef5401634..c49e17b093d 100755 --- a/packages/calcite-components/src/components/action-menu/action-menu.tsx +++ b/packages/calcite-components/src/components/action-menu/action-menu.tsx @@ -12,7 +12,7 @@ import { import { Fragment, VNode } from "@stencil/core/internal"; import { getRoundRobinIndex } from "../../utils/array"; import { focusElement, toAriaBoolean } from "../../utils/dom"; -import { EffectivePlacement, LogicalPlacement, OverlayPositioning } from "../../utils/floating-ui"; +import { FlipPlacement, LogicalPlacement, OverlayPositioning } from "../../utils/floating-ui"; import { guid } from "../../utils/guid"; import { isActivationKey } from "../../utils/key"; import { @@ -82,7 +82,7 @@ export class ActionMenu implements LoadableComponent { /** * Defines the available placements that can be used when a flip occurs. */ - @Prop() flipPlacements: EffectivePlacement[]; + @Prop() flipPlacements: FlipPlacement[]; /** * Specifies the text string for the component. diff --git a/packages/calcite-components/src/components/action-pad/action-pad.e2e.ts b/packages/calcite-components/src/components/action-pad/action-pad.e2e.ts index ce870bee16b..f8cd30eabcd 100755 --- a/packages/calcite-components/src/components/action-pad/action-pad.e2e.ts +++ b/packages/calcite-components/src/components/action-pad/action-pad.e2e.ts @@ -77,6 +77,37 @@ describe("calcite-action-pad", () => { ); }); + describe("messageOverrides", () => { + it("should honor expandLabel and collapseLabel", async () => { + const page = await newE2EPage(); + + await page.setContent(""); + await page.waitForChanges(); + + const actionPad = await page.find("calcite-action-pad"); + + const expandLabel = "Open me up"; + const collapseLabel = "Close me down"; + + actionPad.setProperty("messageOverrides", { + expandLabel, + collapseLabel, + }); + await page.waitForChanges(); + + const expandAction = await page.find("calcite-action-pad >>> #expand-toggle"); + + expect(expandAction).not.toBeNull(); + + expect(await expandAction.getProperty("label")).toBe(expandLabel); + + actionPad.setProperty("expanded", true); + await page.waitForChanges(); + + expect(await expandAction.getProperty("label")).toBe(collapseLabel); + }); + }); + describe("expand functionality", () => { it("should be expandable by default", async () => { const page = await newE2EPage(); @@ -85,7 +116,7 @@ describe("calcite-action-pad", () => { await page.waitForChanges(); - const expandAction = await page.find("calcite-action-pad >>> calcite-action"); + const expandAction = await page.find("calcite-action-pad >>> #expand-toggle"); expect(expandAction).not.toBeNull(); }); @@ -97,7 +128,7 @@ describe("calcite-action-pad", () => { await page.waitForChanges(); - const expandAction = await page.find("calcite-action-pad >>> calcite-action"); + const expandAction = await page.find("calcite-action-pad >>> #expand-toggle"); expect(expandAction).toBeNull(); }); @@ -187,7 +218,7 @@ describe("calcite-action-pad", () => { `, ); - const expandAction = await page.find("calcite-action-pad >>> calcite-action"); + const expandAction = await page.find("calcite-action-pad >>> #expand-toggle"); const action = await page.find("calcite-action"); const actionPad = await page.find("calcite-action-pad"); const group = await page.find("calcite-action-group"); diff --git a/packages/calcite-components/src/components/action-pad/action-pad.stories.ts b/packages/calcite-components/src/components/action-pad/action-pad.stories.ts index a8a0d2eff8b..6224cfe3507 100644 --- a/packages/calcite-components/src/components/action-pad/action-pad.stories.ts +++ b/packages/calcite-components/src/components/action-pad/action-pad.stories.ts @@ -1,13 +1,10 @@ import { boolean, modesDarkDefault } from "../../../.storybook/utils"; import { html } from "../../../support/formatting"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { ActionPad } from "./action-pad"; const { position } = ATTRIBUTES; -interface ActionPadArgs { - expandDisabled: boolean; - expanded: boolean; - position: string; -} +type ActionPadStoryArgs = Pick; export default { title: "Components/Action Pad", @@ -29,7 +26,7 @@ export default { }, }; -export const simple = (args: ActionPadArgs): string => html` +export const simple = (args: ActionPadStoryArgs): string => html` = "vertical"; @Watch("layout") layoutHandler(): void { @@ -92,7 +92,7 @@ export class ActionPad /** * Arranges the component depending on the element's `dir` property. */ - @Prop({ reflect: true }) position: Position; + @Prop({ reflect: true }) position: Extract<"start" | "end", Position>; /** * Specifies the size of the expand `calcite-action`. @@ -281,8 +281,10 @@ export class ActionPad const expandToggleNode = !expandDisabled ? ( ; export default { title: "Components/Buttons/Action", @@ -55,7 +57,7 @@ export default { }, }; -export const simple = (args: ActionArgs): string => html` +export const simple = (args: ActionStoryArgs): string => html`
{ await page.waitForTimeout(DURATIONS.medium + animationDurationInMs); await page.waitForSelector("#alert", { visible: false }); }); + + it("pauses on focus and resumes on blur", async () => { + await button.click(); + expect(await alert.isVisible()).toBe(true); + expect(await alert.getProperty("autoCloseDuration")).toEqual("medium"); + expect(playState).toEqual("running"); + buttonClose = await page.find(`#alert >>> .${CSS.close}`); + buttonClose.focus(); + await page.waitForTimeout(DURATIONS.medium); + expect(await alert.isVisible()).toBe(true); + await button.focus(); + await page.waitForTimeout(DURATIONS.medium + animationDurationInMs); + await page.waitForSelector("#alert", { visible: false }); + }); }); describe("translation support", () => { diff --git a/packages/calcite-components/src/components/alert/alert.scss b/packages/calcite-components/src/components/alert/alert.scss index 68c259951b4..17587b14794 100644 --- a/packages/calcite-components/src/components/alert/alert.scss +++ b/packages/calcite-components/src/components/alert/alert.scss @@ -293,11 +293,16 @@ $alertDurations: :host([auto-close-duration="#{$name}"]) .dismiss-progress:after { animation: dismissProgress $duration ease-out; } - :host(:hover[auto-close-duration="#{$name}"]) .dismiss-progress:after { + :host(:hover[auto-close-duration="#{$name}"]) .dismiss-progress:after, + :host(:focus[auto-close-duration="#{$name}"]) .dismiss-progress:after { animation-play-state: paused; } } +.container.focused .dismiss-progress:after { + animation-play-state: paused; +} + @keyframes dismissProgress { 0% { @apply w-0 opacity-75; diff --git a/packages/calcite-components/src/components/alert/alert.tsx b/packages/calcite-components/src/components/alert/alert.tsx index 0e4b2be7365..366fd9b6a81 100644 --- a/packages/calcite-components/src/components/alert/alert.tsx +++ b/packages/calcite-components/src/components/alert/alert.tsx @@ -200,6 +200,7 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen }), ); window.clearTimeout(this.autoCloseTimeoutId); + this.autoCloseTimeoutId = null; window.clearTimeout(this.queueTimeout); disconnectLocalized(this); disconnectMessages(this); @@ -226,13 +227,18 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen [CSS.containerQueued]: queued, [`${CSS.container}--${placement}`]: true, [CSS.containerSlottedInShell]: this.slottedInShell, + [CSS.focused]: this.keyBoardFocus, }} onPointerEnter={this.autoClose && this.autoCloseTimeoutId ? this.handleMouseOver : null} - onPointerLeave={this.autoClose && this.autoCloseTimeoutId ? this.handleMouseLeave : null} + onPointerLeave={this.autoClose ? this.handleMouseLeave : null} ref={this.setTransitionEl} > {effectiveIcon && this.renderIcon(effectiveIcon)} -
+
@@ -246,6 +252,18 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen ); } + private handleKeyBoardFocus = (): void => { + this.keyBoardFocus = true; + this.handleFocus(); + }; + + private handleKeyBoardBlur = (): void => { + this.keyBoardFocus = false; + if (!this.mouseFocus) { + this.handleBlur(); + } + }; + private renderCloseButton(): VNode { return (
- - -
) : (
, + Pick { text: string; - sectionOpen: boolean; - toggleDisplay: string; + sectionOpen: BlockSection["open"]; } export default { @@ -22,7 +18,7 @@ export default { args: { heading: "Heading", description: "description", - blockOpen: true, + open: true, collapsible: true, loading: false, disabled: false, @@ -42,11 +38,11 @@ export default { }, }; -export const simple = (args: BlockArgs): string => html` +export const simple = (args: BlockStoryArgs): string => html` +
) : null} diff --git a/packages/calcite-components/src/components/button/button.stories.ts b/packages/calcite-components/src/components/button/button.stories.ts index ea9b24943a1..1dce317e526 100644 --- a/packages/calcite-components/src/components/button/button.stories.ts +++ b/packages/calcite-components/src/components/button/button.stories.ts @@ -2,17 +2,11 @@ import { iconNames } from "../../../.storybook/helpers"; import { boolean, modesDarkDefault } from "../../../.storybook/utils"; import { html } from "../../../support/formatting"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { Button } from "./button"; const { appearance, kind, scale, width } = ATTRIBUTES; -interface ButtonArgs { - appearance: string; - kind: string; - scale: string; - round: boolean; - href: string; - loading: boolean; - disabled: boolean; - width: string; +interface ButtonStoryArgs + extends Pick { text: string; } @@ -49,7 +43,7 @@ export default { }, }; -export const simple = (args: ButtonArgs): string => html` +export const simple = (args: ButtonStoryArgs): string => html` { src: string; } @@ -28,7 +28,7 @@ export default { }, }; -export const simple = (args: CardGroupArgs): string => html` +export const simple = (args: CardGroupStoryArgs): string => html` Sample image alt diff --git a/packages/calcite-components/src/components/card/card.stories.ts b/packages/calcite-components/src/components/card/card.stories.ts index e86148f2ea5..c1dfaff212d 100644 --- a/packages/calcite-components/src/components/card/card.stories.ts +++ b/packages/calcite-components/src/components/card/card.stories.ts @@ -2,13 +2,10 @@ import { placeholderImage } from "../../../.storybook/placeholderImage"; import { html } from "../../../support/formatting"; import { boolean, modesDarkDefault } from "../../../.storybook/utils"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { Card } from "./card"; const { logicalFlowPosition } = ATTRIBUTES; -interface CardArgs { - loading: boolean; - selected: boolean; - thumbnailPosition: string; -} +type CardStoryArgs = Pick; export default { title: "Components/Card", @@ -60,7 +57,7 @@ const footerEndButtonsHtml = html`
`; -export const simple = (args: CardArgs): string => html` +export const simple = (args: CardStoryArgs): string => html`
html`
`; -export const simpleWithFooterLinks = (args: CardArgs): string => html` +export const simpleWithFooterLinks = (args: CardStoryArgs): string => html`
html`
`; -export const simpleWithFooterButton = (args: CardArgs): string => html` +export const simpleWithFooterButton = (args: CardStoryArgs): string => html`
; export default { title: "Components/Carousel", args: { controlOverlay: false, disabled: false, - autoPlayDuration: 6000, - autoPlay: false, + autoplayDuration: 6000, + autoplay: false, label: "Example carousel label", arrowType: arrowType.defaultValue, }, @@ -31,13 +28,13 @@ export default { }, }; -export const simple = (args: CarouselArgs): string => +export const simple = (args: CarouselStoryArgs): string => html`
diff --git a/packages/calcite-components/src/components/checkbox/checkbox.stories.ts b/packages/calcite-components/src/components/checkbox/checkbox.stories.ts index 3b61fe57003..2420cb782cc 100644 --- a/packages/calcite-components/src/components/checkbox/checkbox.stories.ts +++ b/packages/calcite-components/src/components/checkbox/checkbox.stories.ts @@ -1,16 +1,10 @@ import { boolean, modesDarkDefault } from "../../../.storybook/utils"; import { html } from "../../../support/formatting"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { Checkbox } from "./checkbox"; const { scale, status } = ATTRIBUTES; -interface CheckboxArgs { - checked: boolean; - disabled: boolean; - indeterminate: boolean; - scale: string; - status: string; - label: string; -} +type CheckboxStoryArgs = Pick; export default { title: "Components/Controls/Checkbox", @@ -34,7 +28,7 @@ export default { }, }; -export const simple = (args: CheckboxArgs): string => html` +export const simple = (args: CheckboxStoryArgs): string => html` ; export default { title: "Components/Chip Group", @@ -28,7 +26,7 @@ export default { }, }; -export const simple = (args: ChipGroupArgs): string => html` +export const simple = (args: ChipGroupStoryArgs): string => html` Forest Tundra diff --git a/packages/calcite-components/src/components/chip/chip.stories.ts b/packages/calcite-components/src/components/chip/chip.stories.ts index 0f68241f80b..8b3286fda87 100644 --- a/packages/calcite-components/src/components/chip/chip.stories.ts +++ b/packages/calcite-components/src/components/chip/chip.stories.ts @@ -3,15 +3,10 @@ import { placeholderImage } from "../../../.storybook/placeholderImage"; import { boolean, modesDarkDefault } from "../../../.storybook/utils"; import { html } from "../../../support/formatting"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { Chip } from "./chip"; const { scale, appearance, kind } = ATTRIBUTES; -interface ChipArgs { - scale: string; - appearance: string; - kind: string; - closable: boolean; - selected: boolean; -} +type ChipStoryArgs = Pick; export default { title: "Components/Chip", @@ -40,7 +35,7 @@ export default { }, }; -export const simple = (args: ChipArgs): string => html` +export const simple = (args: ChipStoryArgs): string => html`
; export default { title: "Components/Controls/ColorPicker/support/ColorPickerSwatch", @@ -14,7 +12,7 @@ export default { }, }; -export const simple = (args: ColorPickerSwatchArgs): string => html` +export const simple = (args: ColorPickerSwatchStoryArgs): string => html` `; diff --git a/packages/calcite-components/src/components/color-picker/color-picker.stories.ts b/packages/calcite-components/src/components/color-picker/color-picker.stories.ts index f2d06771e02..9cd34b95e23 100644 --- a/packages/calcite-components/src/components/color-picker/color-picker.stories.ts +++ b/packages/calcite-components/src/components/color-picker/color-picker.stories.ts @@ -1,16 +1,13 @@ import { boolean, modesDarkDefault } from "../../../.storybook/utils"; import { html } from "../../../support/formatting"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { ColorPicker } from "./color-picker"; const { scale } = ATTRIBUTES; -interface ColorPickerArgs { - channelsDisabled: boolean; - hexDisabled: boolean; - savedDisabled: boolean; - scale: string; - clearable: boolean; - value: string; -} +type ColorPickerStoryArgs = Pick< + ColorPicker, + "channelsDisabled" | "hexDisabled" | "savedDisabled" | "scale" | "clearable" | "value" +>; export default { title: "Components/Controls/ColorPicker", @@ -30,7 +27,7 @@ export default { }, }; -export const simple = (args: ColorPickerArgs): string => html` +export const simple = (args: ColorPickerStoryArgs): string => html` { dir: string; lang: string; - max: string; - min: string; nextMonthLabel: string; prevMonthLabel: string; - range: boolean; - scale: string; - value: string; } export default { @@ -48,7 +44,7 @@ export default { }, }; -export const simple = (args: DatePickerArgs): string => html` +export const simple = (args: DatePickerStoryArgs): string => html`
& + Pick; export default { title: "Components/Buttons/Dropdown", @@ -57,7 +55,7 @@ export default { }, }; -export const simple = (args: DropdownArgs): string => html` +export const simple = (args: DropdownStoryArgs): string => html` ; export default { title: "Components/Buttons/FAB", @@ -39,7 +34,7 @@ export default { }, }; -export const simple = (args: FabArgs): string => html` +export const simple = (args: FabStoryArgs): string => html` { heightScale: string; - loading: boolean; } export default { @@ -77,7 +75,7 @@ const flowItemContent = `${headerHTML} ${contentHTML} ${footerHTML}`; -export const simple = (args: FlowItemArgs): string => html` +export const simple = (args: FlowItemStoryArgs): string => html` `; -export const simple = (args: FlowArgs): string => html` +export const simple = (args: FlowStoryArgs): string => html` = ({ expanded, expandText, collapseText, + expandLabel, + collapseLabel, toggle, el, position, @@ -76,6 +80,7 @@ export const ExpandToggle: FunctionalComponent = ({ const rtl = getElementDir(el) === "rtl"; const text = expanded ? collapseText : expandText; + const label = expanded ? collapseLabel : expandLabel; const icons = [ICONS.chevronsLeft, ICONS.chevronsRight]; if (rtl) { @@ -89,6 +94,8 @@ export const ExpandToggle: FunctionalComponent = ({ const actionNode = ( setTooltipReference({ tooltip, referenceElement, expanded, ref }) diff --git a/packages/calcite-components/src/components/graph/graph.stories.ts b/packages/calcite-components/src/components/graph/graph.stories.ts index e4efabcafbb..46b4736b225 100644 --- a/packages/calcite-components/src/components/graph/graph.stories.ts +++ b/packages/calcite-components/src/components/graph/graph.stories.ts @@ -1,10 +1,9 @@ import { modesDarkDefault } from "../../../.storybook/utils"; +import { Graph } from "./graph"; -interface GraphArgs { +interface GraphStoryArgs extends Pick { width: number; height: number; - min: number; - max: number; } export default { @@ -34,7 +33,7 @@ const data: HTMLCalciteGraphElement["data"] = [ const rainbow = ["red", "orange", "yellow", "green", "cyan", "blue", "violet"]; const colorStops = rainbow.map((color, i) => ({ offset: (1 / (rainbow.length - 1)) * i, color })); -export const simple = (args: GraphArgs): HTMLDivElement => { +export const simple = (args: GraphStoryArgs): HTMLDivElement => { const div = document.createElement("div"); div.style.width = `${args.width}px`; div.style.height = `${args.height}px`; diff --git a/packages/calcite-components/src/components/icon/icon.stories.ts b/packages/calcite-components/src/components/icon/icon.stories.ts index 8c651ce13ef..793934a30df 100644 --- a/packages/calcite-components/src/components/icon/icon.stories.ts +++ b/packages/calcite-components/src/components/icon/icon.stories.ts @@ -2,14 +2,12 @@ import { iconNames } from "../../../.storybook/helpers"; import { modesDarkDefault } from "../../../.storybook/utils"; import { html } from "../../../support/formatting"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { Icon } from "./icon"; const { scale } = ATTRIBUTES; const sampleIcon = iconNames.find((item) => item === "arrowRight"); -interface IconArgs { - icon: string; - scale: string; -} +type IconStoryArgs = Pick; export default { title: "Components/Icon", @@ -29,7 +27,7 @@ export default { }, }; -export const simple = (args: IconArgs): string => html` +export const simple = (args: IconStoryArgs): string => html` `; diff --git a/packages/calcite-components/src/components/inline-editable/inline-editable.stories.ts b/packages/calcite-components/src/components/inline-editable/inline-editable.stories.ts index 8135108cced..0273fb9cf20 100644 --- a/packages/calcite-components/src/components/inline-editable/inline-editable.stories.ts +++ b/packages/calcite-components/src/components/inline-editable/inline-editable.stories.ts @@ -1,17 +1,12 @@ +import { Input } from "../input/input"; import { boolean, modesDarkDefault } from "../../../.storybook/utils"; import { html } from "../../../support/formatting"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { InlineEditable } from "./inline-editable"; const { scale, alignment } = ATTRIBUTES; -interface InlineEditableArgs { - scale: string; - controls: boolean; - editingEnabled: boolean; - loading: boolean; - disabled: boolean; - alignment: string; - placeholder: string; -} +type InlineEditableStoryArgs = Pick & + Pick; export default { title: "Components/Controls/Inline Editable", @@ -36,7 +31,7 @@ export default { }, }; -export const simple = (args: InlineEditableArgs): string => html` +export const simple = (args: InlineEditableStoryArgs): string => html`
{ lang: string; - placement: string; - validationMessage: string; - validationIcon: string; } export default { @@ -55,7 +52,7 @@ export default { }, }; -export const simple = (args: InputDatePickerArgs): string => html` +export const simple = (args: InputDatePickerStoryArgs): string => html`
; export default { title: "Components/Controls/Input Number", @@ -75,7 +77,7 @@ export default { }, }; -export const simple = (args: InputNumberArgs): string => html` +export const simple = (args: InputNumberStoryArgs): string => html`
; export default { title: "Components/Controls/Input Text", @@ -55,7 +57,7 @@ export default { }, }; -export const simple = (args: InputTextArgs): string => html` +export const simple = (args: InputTextStoryArgs): string => html`
{ hidden: boolean; - name: string; - placement: string; - scale: string; - status: string; - step: number; - validationMessage: string; - validationIcon: string; - value: string; } export default { @@ -52,7 +48,7 @@ export default { }, }; -export const simple = (args: InputTimePickerArgs): string => html` +export const simple = (args: InputTimePickerStoryArgs): string => html` ; export default { title: "Components/Controls/InputTimeZone", @@ -50,7 +47,7 @@ export default { }, }; -export const simple = (args: InputTimeZoneArgs): string => html` +export const simple = (args: InputTimeZoneStoryArgs): string => html` ; export default { title: "Components/Controls/Input", @@ -81,7 +83,7 @@ export default { }, }; -export const simple = (args: InputArgs): string => html` +export const simple = (args: InputStoryArgs): string => html`
iconName.endsWith("16")) .map((iconName) => iconName.replace("16", "")); -interface LinkArgs { +interface LinkStoryArgs extends Pick { containingFontSize: string; containingFontWeight: string; - href: string; - disabled: boolean; text: string; } @@ -36,7 +35,7 @@ export default { }, }; -export const simple = (args: LinkArgs): string => html` +export const simple = (args: LinkStoryArgs): string => html`
Some wrapping text ${args.text} diff --git a/packages/calcite-components/src/components/list-item/list-item.scss b/packages/calcite-components/src/components/list-item/list-item.scss index 3cf36325352..d183d842738 100755 --- a/packages/calcite-components/src/components/list-item/list-item.scss +++ b/packages/calcite-components/src/components/list-item/list-item.scss @@ -14,16 +14,6 @@ @include disabled(); -.indent { - @apply flex - flex-col - border-solid - border-0 - border-color-3; - - margin-inline-start: var(--calcite-list-item-spacing-indent, theme("spacing.6")); -} - .container { @apply bg-foreground-1 box-border @@ -62,11 +52,16 @@ } .nested-container { - @apply flex flex-col; + @apply hidden flex-col + border-solid + border-0 + border-color-3; + + margin-inline-start: var(--calcite-list-item-spacing-indent, theme("spacing.6")); } -.nested-container--hidden { - @apply hidden; +.nested-container--open { + @apply flex; } .content-container { diff --git a/packages/calcite-components/src/components/list-item/list-item.tsx b/packages/calcite-components/src/components/list-item/list-item.tsx index f2a88a3857e..bc8bf02e23f 100644 --- a/packages/calcite-components/src/components/list-item/list-item.tsx +++ b/packages/calcite-components/src/components/list-item/list-item.tsx @@ -585,7 +585,7 @@ export class ListItem
{this.renderContentBottom()}
-
{this.renderDefaultContainer()}
+ {this.renderDefaultContainer()} ); diff --git a/packages/calcite-components/src/components/list-item/resources.ts b/packages/calcite-components/src/components/list-item/resources.ts index a51d1b84885..6257d95a488 100644 --- a/packages/calcite-components/src/components/list-item/resources.ts +++ b/packages/calcite-components/src/components/list-item/resources.ts @@ -2,7 +2,6 @@ export const CSS = { wrapper: "wrapper", wrapperBordered: "wrapper--bordered", container: "container", - indent: "indent", containerHover: "container--hover", containerBorder: "container--border", containerBorderSelected: "container--border-selected", @@ -11,7 +10,7 @@ export const CSS = { contentContainerSelectable: "content-container--selectable", contentContainerHasCenterContent: "content-container--has-center-content", nestedContainer: "nested-container", - nestedContainerHidden: "nested-container--hidden", + nestedContainerOpen: "nested-container--open", content: "content", customContent: "custom-content", actionsStart: "actions-start", diff --git a/packages/calcite-components/src/components/list/list.stories.ts b/packages/calcite-components/src/components/list/list.stories.ts index 01387a868dd..2a0cdb85903 100644 --- a/packages/calcite-components/src/components/list/list.stories.ts +++ b/packages/calcite-components/src/components/list/list.stories.ts @@ -2,18 +2,16 @@ import { boolean, modesDarkDefault } from "../../../.storybook/utils"; import { placeholderImage } from "../../../.storybook/placeholderImage"; import { html } from "../../../support/formatting"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { List } from "./list"; const { selectionMode, selectionAppearance } = ATTRIBUTES; -interface ListArgs { - selectionMode: string; - selectionAppearance: string; - loading: boolean; +interface ListStoryArgs + extends Pick< + List, + "selectionMode" | "selectionAppearance" | "loading" | "filterEnabled" | "dragEnabled" | "disabled" | "label" + > { closable: boolean; closed: boolean; - filterEnabled: boolean; - dragEnabled: boolean; - disabled: boolean; - label: string; } export default { @@ -52,7 +50,7 @@ const thumbnailImage = placeholderImage({ width: 44, height: 44 }); const listHTML = (): string => html` selection-mode="none" selection-appearance="icon" label="My List" `; -export const simple = (args: ListArgs): string => html` +export const simple = (args: ListStoryArgs): string => html` ; export default { title: "Components/Loader", @@ -30,7 +27,7 @@ export default { }, }; -export const simple_TestOnly = (args: LoaderArgs): string => html` +export const simple_TestOnly = (args: LoaderStoryArgs): string => html` `; diff --git a/packages/calcite-components/src/components/menu-item/menu-item.stories.ts b/packages/calcite-components/src/components/menu-item/menu-item.stories.ts index c96734b56ff..d63acf44464 100644 --- a/packages/calcite-components/src/components/menu-item/menu-item.stories.ts +++ b/packages/calcite-components/src/components/menu-item/menu-item.stories.ts @@ -1,16 +1,11 @@ import { boolean } from "../../../.storybook/utils"; import { iconNames } from "../../../.storybook/helpers"; import { html } from "../../../support/formatting"; +import { CalciteMenuItem } from "./menu-item"; -interface MenuItemArgs { - text: string; +interface MenuItemStoryArgs + extends Pick { src: string; - href: string; - rel: string; - target: string; - label: string; - active: boolean; - breadcrumb: boolean; } export default { @@ -27,7 +22,7 @@ export default { }, }; -export const simple = (args: MenuItemArgs): string => html` +export const simple = (args: MenuItemStoryArgs): string => html` ; export default { title: "Components/Menu", @@ -28,7 +27,7 @@ export default { }, }; -export const simple = (args: MenuArgs): string => html` +export const simple = (args: MenuStoryArgs): string => html` diff --git a/packages/calcite-components/src/components/meter/interfaces.ts b/packages/calcite-components/src/components/meter/interfaces.ts index 9a0b6e4eeb4..0ab6bb0ffbc 100644 --- a/packages/calcite-components/src/components/meter/interfaces.ts +++ b/packages/calcite-components/src/components/meter/interfaces.ts @@ -1 +1,2 @@ export type MeterLabelType = "percent" | "units"; +export type MeterFillType = "single" | "range"; diff --git a/packages/calcite-components/src/components/meter/meter.stories.ts b/packages/calcite-components/src/components/meter/meter.stories.ts index 927afecebb2..da2a881d02e 100644 --- a/packages/calcite-components/src/components/meter/meter.stories.ts +++ b/packages/calcite-components/src/components/meter/meter.stories.ts @@ -1,23 +1,25 @@ import { html } from "../../../support/formatting"; import { boolean, modesDarkDefault } from "../../../.storybook/utils"; import { ATTRIBUTES } from "../../../.storybook/resources"; +import { Meter } from "./meter"; const { fillType, appearance, labelType } = ATTRIBUTES; -interface MeterArgs { - min: number; - max: number; - low: number; - high: number; - value: number; - fillType: string; - appearance: string; - rangeLabelType: string; - valueLabelType: string; - unitLabel: string; - groupSeparator: boolean; - rangeLabels: boolean; - valueLabel: boolean; -} +type MeterStoryArgs = Pick< + Meter, + | "min" + | "max" + | "low" + | "high" + | "value" + | "fillType" + | "appearance" + | "rangeLabelType" + | "valueLabelType" + | "unitLabel" + | "groupSeparator" + | "rangeLabels" + | "valueLabel" +>; export default { title: "Components/Meter", @@ -56,7 +58,7 @@ export default { }, }; -export const simple = (args: MeterArgs): string => +export const simple = (args: MeterStoryArgs): string => html`; export default { title: "Components/Modal", @@ -45,7 +41,7 @@ export default { }, }; -export const simple = (args: ModalArgs): string => html` +export const simple = (args: ModalStoryArgs): string => html` ; export default { title: "Components/Navigation/Navigation Logo", @@ -17,7 +14,7 @@ export default { }, }; -export const simple = (args: NavigationLogoArgs): string => +export const simple = (args: NavigationLogoStoryArgs): string => html`; export default { title: "Components/Navigation/Navigation User", @@ -23,11 +20,11 @@ export default { }, }; -export const simple = (args: NavigationUserArgs): string => html` +export const simple = (args: NavigationUserStoryArgs): string => html` { showIcon: boolean; - open: boolean; - closable: boolean; noticeScale: string; - width: string; - kind: string; - icon: string; actionScale: string; } @@ -51,7 +47,7 @@ export default { }, }; -export const simple = (args: NoticeArgs): string => html` +export const simple = (args: NoticeStoryArgs): string => html`
{ lang: string; - numberingSystem: string; - totalItems: number; - pageSize: number; } export default { @@ -44,7 +41,7 @@ export default { }, }; -export const simple = (args: PaginationArgs): string => html` +export const simple = (args: PaginationStoryArgs): string => html`