-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into benelan/constraint-va…
…lidation-apis * origin/main: build(deps): update dependency @esri/calcite-ui-icons to v3.27.9 (#9216) fix(combobox, input-time-zone): improve readOnly behavior and styling (#9222) feat(carousel): Add Carousel and Carousel Item components (#8995)
- Loading branch information
Showing
65 changed files
with
3,509 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/calcite-components/src/components/carousel-item/carousel-item.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { accessible, hidden, renders } from "../../tests/commonTests"; | ||
|
||
describe("calcite-carousel-item", () => { | ||
describe("renders", () => { | ||
renders("<calcite-carousel-item selected></calcite-carousel-item>", { | ||
display: "flex", | ||
}); | ||
}); | ||
|
||
describe("honors hidden attribute", () => { | ||
hidden("calcite-carousel-item"); | ||
}); | ||
|
||
describe("accessible", () => { | ||
accessible("calcite-carousel-item"); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
packages/calcite-components/src/components/carousel-item/carousel-item.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
:host { | ||
@apply flex; | ||
} | ||
|
||
.container { | ||
@apply hidden; | ||
inline-size: var(--calcite-container-size-content-fluid); | ||
} | ||
|
||
:host([selected]) .container { | ||
@apply block; | ||
} | ||
|
||
@include base-component(); |
60 changes: 60 additions & 0 deletions
60
packages/calcite-components/src/components/carousel-item/carousel-item.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { Component, Element, h, Host, Prop, VNode } from "@stencil/core"; | ||
import { guid } from "../../utils/guid"; | ||
import { CSS } from "./resources"; | ||
|
||
/** | ||
* @slot - A slot for adding content. | ||
*/ | ||
@Component({ | ||
tag: "calcite-carousel-item", | ||
styleUrl: "carousel-item.scss", | ||
shadow: true, | ||
}) | ||
export class CarouselItem { | ||
// -------------------------------------------------------------------------- | ||
// | ||
// Properties | ||
// | ||
// -------------------------------------------------------------------------- | ||
|
||
/** | ||
* Accessible name for the component. | ||
*/ | ||
@Prop() label!: string; | ||
|
||
/** | ||
* When `true`, the component is selected. | ||
*/ | ||
@Prop({ reflect: true }) selected = false; | ||
|
||
// -------------------------------------------------------------------------- | ||
// | ||
// Private Properties | ||
// | ||
// -------------------------------------------------------------------------- | ||
|
||
@Element() el: HTMLCalciteCarouselItemElement; | ||
|
||
private guid = `calcite-carousel-item-${guid()}`; | ||
|
||
// -------------------------------------------------------------------------- | ||
// | ||
// Render Methods | ||
// | ||
// -------------------------------------------------------------------------- | ||
|
||
render(): VNode { | ||
const id = this.el.id || this.guid; | ||
return ( | ||
<Host id={id}> | ||
<div | ||
aria-label={this.label} | ||
class={{ [CSS.container]: true, [CSS.selected]: this.selected }} | ||
role="tabpanel" | ||
> | ||
<slot /> | ||
</div> | ||
</Host> | ||
); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
packages/calcite-components/src/components/carousel-item/readme.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# calcite-carousel-item | ||
|
||
<!-- Auto Generated Below --> | ||
|
||
## Properties | ||
|
||
| Property | Attribute | Description | Type | Default | | ||
| -------------------- | ---------- | ---------------------------------------------------------------------------------------- | --------------------- | ----------- | | ||
| `active` | `active` | When `true`, the component is active if it has a parent `calcite-carousel`. | `boolean` | `false` | | ||
| `disabled` | `disabled` | When `true`, interaction is prevented and the component is displayed with lower opacity. | `boolean` | `false` | | ||
| `label` *(required)* | `label` | The component label text. | `string` | `undefined` | | ||
| `messageOverrides` | -- | Use this property to override individual strings used by the component. | `{ close?: string; }` | `undefined` | | ||
|
||
## Methods | ||
|
||
### `setFocus() => Promise<void>` | ||
|
||
Sets focus on the component. | ||
|
||
#### Returns | ||
|
||
Type: `Promise<void>` | ||
|
||
## Slots | ||
|
||
| Slot | Description | | ||
| ---- | -------------------------- | | ||
| | A slot for adding content. | | ||
|
||
--- | ||
|
||
*Built with [StencilJS](https://stenciljs.com/)* |
Oops, something went wrong.