Skip to content

Commit

Permalink
Remove accessKey from initial states and make sure they're not required
Browse files Browse the repository at this point in the history
  • Loading branch information
sdvg committed Oct 27, 2023
1 parent 52af81a commit 6037f6e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion packages/components/src/components/button/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ export class KolButtonWc implements API {
_on: {},
_type: 'button', // ⚠ required
_variant: 'normal', // ⚠ required
_accessKey: '',
};

public constructor() {
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/components/span/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export class KolSpanWc implements API {
_hideLabel: false,
_icons: {},
_label: '', // ⚠ required
_accessKey: '',
};

@Watch('_accessKey')
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/components/tooltip/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ export class KolTooltip implements API {
@Prop() public _label!: LabelPropType;

@State() public state: States = {
_accessKey: '',
_align: 'top',
_id: nonce(),
_label: '…', // ⚠ required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Props, States } from '../types';
export const getTooltipHtml = (props: Props, additionalAttrs = ''): string => {
const state: States = mixMembers<Props, States>(
{
_accessKey: '',
_align: 'top',
_id: nonce(),
_label: '…', // ⚠ required
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/tooltip/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type RequiredProps = PropLabel;
type OptionalProps = PropAlign & PropId & PropAccessKey;
export type Props = Generic.Element.Members<RequiredProps, OptionalProps>;

type RequiredStates = RequiredProps & OptionalProps;
type RequiredStates = RequiredProps & PropAlign & PropId;
type OptionalStates = NonNullable<unknown>;

export type States = Generic.Element.Members<RequiredStates, OptionalStates>;
Expand Down

0 comments on commit 6037f6e

Please sign in to comment.