Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(Steps): use CSS logical properties instead of physical values #1158

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/beeq/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3525,6 +3525,9 @@ declare namespace LocalJSX {
"type"?: TStatusType;
}
interface BqStepItem {
/**
* Callback handler emitted when the step item is clicked
*/
"onBqClick"?: (event: BqStepItemCustomEvent<{ target: HTMLBqStepItemElement; value: string }>) => void;
/**
* It defines prefix size
Expand Down
8 changes: 5 additions & 3 deletions packages/beeq/src/components/step-item/bq-step-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,20 @@ export class BqStepItem {
// Events section
// Requires JSDocs for public API documentation
// ==============================================

/** Callback handler emitted when the step item is clicked */
@Event() bqClick: EventEmitter<{ target: HTMLBqStepItemElement; value: string }>;

// Component lifecycle events
// Ordered by their natural call order
// =====================================

componentWillLoad() {
connectedCallback() {
this.checkPropValues();
}

componentDidLoad() {
this.checkPropValues();
this.handleIconPrefix();
}

// Listeners
Expand Down Expand Up @@ -119,7 +121,7 @@ export class BqStepItem {
{/* TITLE */}
<div
class={{
'bq-step-item__content--title pr-xs3 text-m leading-regular text-text-primary': true,
'bq-step-item__content--title pe-xs3 text-m leading-regular text-text-primary': true,
'pointer-events-none': this.isDisabled,
'text-text-brand': this.isCurrent,
}}
Expand Down
6 changes: 3 additions & 3 deletions packages/beeq/src/components/step-item/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

## Events

| Event | Description | Type |
| --------- | ----------- | ---------------------------------------------------------------- |
| `bqClick` | | `CustomEvent<{ target: HTMLBqStepItemElement; value: string; }>` |
| Event | Description | Type |
| --------- | ------------------------------------------------------ | ---------------------------------------------------------------- |
| `bqClick` | Callback handler emitted when the step item is clicked | `CustomEvent<{ target: HTMLBqStepItemElement; value: string; }>` |


## Shadow Parts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

.bq-step-item__prefix.numeric {
@apply flex items-center justify-center rounded-full;
@apply h-[--bq-step-item--prefix-num-size] w-[--bq-step-item--prefix-num-size] bg-[--bq-step-item--prefix-num-bg-color];
@apply bg-[--bq-step-item--prefix-num-bg-color] bs-[--bq-step-item--prefix-num-size] is-[--bq-step-item--prefix-num-size];
@apply text-m font-semibold leading-regular;

&.small {
Expand Down
6 changes: 3 additions & 3 deletions packages/beeq/src/components/steps/bq-steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class BqSteps {
// ===================================

render() {
const dividerPaddingTop = this.size === 'small' ? 'pt-s' : 'pt-m';
const dividerPaddingTop = this.size === 'small' ? 'p-bs-s' : 'p-bs-m';

return (
<div
Expand All @@ -114,9 +114,9 @@ export class BqSteps {
>
<slot />
<bq-divider
class={`absolute left-0 right-0 -z-10 px-s ${dividerPaddingTop}`}
class={`absolute -z-10 inset-ie-0 inset-is-0 p-i-s ${dividerPaddingTop}`}
stroke-color={this.dividerColor}
exportparts="base: divider-base,dash-start:divider-dash-start,dash-end:divider-dash-end"
exportparts="base:divider-base,dash-start:divider-dash-start,dash-end:divider-dash-end"
/>
</div>
);
Expand Down