Skip to content

Commit

Permalink
Refactor OptionalProps in split-button
Browse files Browse the repository at this point in the history
Refs: #6254
  • Loading branch information
anicyne committed May 14, 2024
1 parent 6b690e7 commit 2bff389
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 43 deletions.
6 changes: 4 additions & 2 deletions packages/components/src/components/split-button/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import type {
ButtonTypePropType,
ButtonVariantPropType,
CustomClassPropType,
DisabledPropType,
HideLabelPropType,
IconsPropType,
LabelPropType,
NamePropType,
Expand Down Expand Up @@ -143,14 +145,14 @@ export class KolSplitButton implements SplitButtonProps /*, SplitButtonAPI*/ {
/**
* Makes the element not focusable and ignore all events.
*/
@Prop() public _disabled?: boolean = false;
@Prop() public _disabled?: DisabledPropType = false;

/**
* Hides the caption by default and displays the caption text with a tooltip when the
* interactive element is focused or the mouse is over it.
* @TODO: Change type back to `HideLabelPropType` after Stencil#4663 has been resolved.
*/
@Prop() public _hideLabel?: boolean = false;
@Prop() public _hideLabel?: HideLabelPropType = false;

/**
* Defines the icon classnames (e.g. `_icons="fa-solid fa-user"`).
Expand Down
8 changes: 5 additions & 3 deletions packages/components/src/schema/components/split-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import type {
ButtonCallbacksPropType,
PropAlternativeButtonLinkRole,
PropButtonVariant,
PropDisabled,
PropHideLabel,
PropIcons,
PropLabel,
PropName,
Expand All @@ -15,9 +17,9 @@ import type { StencilUnknown } from '../types';
type RequiredProps = PropLabel;
type OptionalProps = {
on?: ButtonCallbacksPropType<StencilUnknown>;
hideLabel: boolean;
disabled: boolean;
} & PropAlternativeButtonLinkRole &
} & PropDisabled &
PropHideLabel &
PropAlternativeButtonLinkRole &
PropIcons &
PropTooltipAlign &
PropButtonVariant &
Expand Down
114 changes: 76 additions & 38 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2bff389

Please sign in to comment.