@politiet/sheriff-web-components 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/frameworks/preact.d.ts +44 -0
- package/dist/frameworks/react.d.ts +44 -0
- package/dist/frameworks/solidjs.d.ts +44 -0
- package/dist/frameworks/svelte.d.ts +2 -0
- package/dist/frameworks/vue.d.ts +42 -0
- package/dist/index.d.ts +2 -1
- package/dist/sds-button/sds-button.d.ts +73 -0
- package/dist/sds-button/sds-button.d.ts.map +1 -1
- package/dist/sds-button/sds-button.js +42 -29
- package/dist/sds-button/sds-button.js.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.d.ts.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.js +0 -29
- package/dist/sds-checkbox/sds-checkbox.js.map +1 -1
- package/dist/sds-checkbox-group/sds-checkbox-group.d.ts +1 -14
- package/dist/sds-checkbox-group/sds-checkbox-group.d.ts.map +1 -1
- package/dist/sds-checkbox-group/sds-checkbox-group.js +0 -21
- package/dist/sds-checkbox-group/sds-checkbox-group.js.map +1 -1
- package/dist/sds-chip/sds-chip.d.ts +1 -13
- package/dist/sds-chip/sds-chip.d.ts.map +1 -1
- package/dist/sds-chip/sds-chip.js +0 -21
- package/dist/sds-chip/sds-chip.js.map +1 -1
- package/dist/sds-detail/sds-detail.d.ts +1 -13
- package/dist/sds-detail/sds-detail.d.ts.map +1 -1
- package/dist/sds-detail/sds-detail.js +0 -21
- package/dist/sds-detail/sds-detail.js.map +1 -1
- package/dist/sds-heading/sds-heading.d.ts +1 -13
- package/dist/sds-heading/sds-heading.d.ts.map +1 -1
- package/dist/sds-heading/sds-heading.js +0 -21
- package/dist/sds-heading/sds-heading.js.map +1 -1
- package/dist/sds-icon/sds-icon.d.ts +1 -13
- package/dist/sds-icon/sds-icon.d.ts.map +1 -1
- package/dist/sds-icon/sds-icon.js +0 -21
- package/dist/sds-icon/sds-icon.js.map +1 -1
- package/dist/sds-label/sds-label.d.ts +1 -13
- package/dist/sds-label/sds-label.d.ts.map +1 -1
- package/dist/sds-label/sds-label.js +0 -21
- package/dist/sds-label/sds-label.js.map +1 -1
- package/dist/sds-link/sds-link.d.ts +1 -13
- package/dist/sds-link/sds-link.d.ts.map +1 -1
- package/dist/sds-link/sds-link.js +0 -21
- package/dist/sds-link/sds-link.js.map +1 -1
- package/dist/sds-loader/sds-loader.d.ts +1 -13
- package/dist/sds-loader/sds-loader.d.ts.map +1 -1
- package/dist/sds-loader/sds-loader.js +0 -21
- package/dist/sds-loader/sds-loader.js.map +1 -1
- package/dist/sds-nav-card/sds-nav-card.d.ts +1 -13
- package/dist/sds-nav-card/sds-nav-card.d.ts.map +1 -1
- package/dist/sds-nav-card/sds-nav-card.js +0 -21
- package/dist/sds-nav-card/sds-nav-card.js.map +1 -1
- package/dist/sds-notification/sds-notification.d.ts +1 -13
- package/dist/sds-notification/sds-notification.d.ts.map +1 -1
- package/dist/sds-notification/sds-notification.js +0 -21
- package/dist/sds-notification/sds-notification.js.map +1 -1
- package/dist/sds-paragraph/sds-paragraph.d.ts +1 -13
- package/dist/sds-paragraph/sds-paragraph.d.ts.map +1 -1
- package/dist/sds-paragraph/sds-paragraph.js +0 -21
- package/dist/sds-paragraph/sds-paragraph.js.map +1 -1
- package/dist/sds-radio/sds-radio.d.ts +1 -14
- package/dist/sds-radio/sds-radio.d.ts.map +1 -1
- package/dist/sds-radio/sds-radio.js +0 -21
- package/dist/sds-radio/sds-radio.js.map +1 -1
- package/dist/sds-radio-group/sds-radio-group.d.ts +1 -14
- package/dist/sds-radio-group/sds-radio-group.d.ts.map +1 -1
- package/dist/sds-radio-group/sds-radio-group.js +0 -21
- package/dist/sds-radio-group/sds-radio-group.js.map +1 -1
- package/dist/sds-switch/sds-switch.d.ts +1 -13
- package/dist/sds-switch/sds-switch.d.ts.map +1 -1
- package/dist/sds-switch/sds-switch.js +0 -21
- package/dist/sds-switch/sds-switch.js.map +1 -1
- package/dist/sds-text/sds-text.d.ts +1 -13
- package/dist/sds-text/sds-text.d.ts.map +1 -1
- package/dist/sds-text/sds-text.js +0 -21
- package/dist/sds-text/sds-text.js.map +1 -1
- package/dist/sds-textfield/sds-textfield.d.ts +1 -13
- package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
- package/dist/sds-textfield/sds-textfield.js +0 -21
- package/dist/sds-textfield/sds-textfield.js.map +1 -1
- package/dist/sheriff-web-components.js +26 -20
- package/package.json +21 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import 'preact';
|
|
2
|
+
import { SDSButtonProps } from '../sds-button/sds-button';
|
|
3
|
+
import { SDSCheckboxProps } from '../sds-checkbox/sds-checkbox';
|
|
4
|
+
import { SDSCheckboxGroupProps } from '../sds-checkbox-group/sds-checkbox-group';
|
|
5
|
+
import { SDSChipProps } from '../sds-chip/sds-chip';
|
|
6
|
+
import { SDSDetailProps } from '../sds-detail/sds-detail';
|
|
7
|
+
import { SDSHeadingProps } from '../sds-heading/sds-heading';
|
|
8
|
+
import { SDSIconProps } from '../sds-icon/sds-icon';
|
|
9
|
+
import { SDSLabelProps } from '../sds-label/sds-label';
|
|
10
|
+
import { SDSLinkProps } from '../sds-link/sds-link';
|
|
11
|
+
import { SDSLoaderProps } from '../sds-loader/sds-loader';
|
|
12
|
+
import { SDSNavCardProps } from '../sds-nav-card/sds-nav-card';
|
|
13
|
+
import { SDSNotificationProps } from '../sds-notification/sds-notification';
|
|
14
|
+
import { SDSParagraphProps } from '../sds-paragraph/sds-paragraph';
|
|
15
|
+
import { SDSRadioProps } from '../sds-radio/sds-radio';
|
|
16
|
+
import { SDSRadioGroupProps } from '../sds-radio-group/sds-radio-group';
|
|
17
|
+
import { SDSSwitchProps } from '../sds-switch/sds-switch';
|
|
18
|
+
import { SDSTextProps } from '../sds-text/sds-text';
|
|
19
|
+
import { SDSTextFieldProps } from '../sds-textfield/sds-textfield';
|
|
20
|
+
declare module 'preact' {
|
|
21
|
+
namespace JSX {
|
|
22
|
+
interface IntrinsicElements {
|
|
23
|
+
'sds-button': SDSButtonProps & JSX.HTMLAttributes<HTMLElement>;
|
|
24
|
+
'sds-checkbox': SDSCheckboxProps & JSX.HTMLAttributes<HTMLElement>;
|
|
25
|
+
'sds-checkbox-group': SDSCheckboxGroupProps & JSX.HTMLAttributes<HTMLElement>;
|
|
26
|
+
'sds-chip': SDSChipProps & JSX.HTMLAttributes<HTMLElement>;
|
|
27
|
+
'sds-detail': SDSDetailProps & JSX.HTMLAttributes<HTMLElement>;
|
|
28
|
+
'sds-heading': SDSHeadingProps & JSX.HTMLAttributes<HTMLElement>;
|
|
29
|
+
'sds-icon': SDSIconProps & JSX.HTMLAttributes<HTMLElement>;
|
|
30
|
+
'sds-label': SDSLabelProps & JSX.HTMLAttributes<HTMLElement>;
|
|
31
|
+
'sds-link': SDSLinkProps & JSX.HTMLAttributes<HTMLElement>;
|
|
32
|
+
'sds-loader': SDSLoaderProps & JSX.HTMLAttributes<HTMLElement>;
|
|
33
|
+
'sds-nav-card': SDSNavCardProps & JSX.HTMLAttributes<HTMLElement>;
|
|
34
|
+
'sds-notification': SDSNotificationProps & JSX.HTMLAttributes<HTMLElement>;
|
|
35
|
+
'sds-paragraph': SDSParagraphProps & JSX.HTMLAttributes<HTMLElement>;
|
|
36
|
+
'sds-radio': SDSRadioProps & JSX.HTMLAttributes<HTMLElement>;
|
|
37
|
+
'sds-radio-group': SDSRadioGroupProps & JSX.HTMLAttributes<HTMLElement>;
|
|
38
|
+
'sds-switch': SDSSwitchProps & JSX.HTMLAttributes<HTMLElement>;
|
|
39
|
+
'sds-text': SDSTextProps & JSX.HTMLAttributes<HTMLElement>;
|
|
40
|
+
'sds-textfield': SDSTextFieldProps & JSX.HTMLAttributes<HTMLElement>;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=preact.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
import { SDSButtonProps } from '../sds-button/sds-button';
|
|
3
|
+
import { SDSCheckboxProps } from '../sds-checkbox/sds-checkbox';
|
|
4
|
+
import { SDSCheckboxGroupProps } from '../sds-checkbox-group/sds-checkbox-group';
|
|
5
|
+
import { SDSChipProps } from '../sds-chip/sds-chip';
|
|
6
|
+
import { SDSDetailProps } from '../sds-detail/sds-detail';
|
|
7
|
+
import { SDSHeadingProps } from '../sds-heading/sds-heading';
|
|
8
|
+
import { SDSIconProps } from '../sds-icon/sds-icon';
|
|
9
|
+
import { SDSLabelProps } from '../sds-label/sds-label';
|
|
10
|
+
import { SDSLinkProps } from '../sds-link/sds-link';
|
|
11
|
+
import { SDSLoaderProps } from '../sds-loader/sds-loader';
|
|
12
|
+
import { SDSNavCardProps } from '../sds-nav-card/sds-nav-card';
|
|
13
|
+
import { SDSNotificationProps } from '../sds-notification/sds-notification';
|
|
14
|
+
import { SDSParagraphProps } from '../sds-paragraph/sds-paragraph';
|
|
15
|
+
import { SDSRadioProps } from '../sds-radio/sds-radio';
|
|
16
|
+
import { SDSRadioGroupProps } from '../sds-radio-group/sds-radio-group';
|
|
17
|
+
import { SDSSwitchProps } from '../sds-switch/sds-switch';
|
|
18
|
+
import { SDSTextProps } from '../sds-text/sds-text';
|
|
19
|
+
import { SDSTextFieldProps } from '../sds-textfield/sds-textfield';
|
|
20
|
+
declare module 'react' {
|
|
21
|
+
namespace JSX {
|
|
22
|
+
interface IntrinsicElements {
|
|
23
|
+
'sds-button': SDSButtonProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
24
|
+
'sds-checkbox': SDSCheckboxProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
25
|
+
'sds-checkbox-group': SDSCheckboxGroupProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
26
|
+
'sds-chip': SDSChipProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
27
|
+
'sds-detail': SDSDetailProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
28
|
+
'sds-heading': SDSHeadingProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
29
|
+
'sds-icon': SDSIconProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
30
|
+
'sds-label': SDSLabelProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
31
|
+
'sds-link': SDSLinkProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
32
|
+
'sds-loader': SDSLoaderProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
33
|
+
'sds-nav-card': SDSNavCardProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
34
|
+
'sds-notification': SDSNotificationProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
35
|
+
'sds-paragraph': SDSParagraphProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
36
|
+
'sds-radio': SDSRadioProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
37
|
+
'sds-radio-group': SDSRadioGroupProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
38
|
+
'sds-switch': SDSSwitchProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
39
|
+
'sds-text': SDSTextProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
40
|
+
'sds-textfield': SDSTextFieldProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import 'solid-js';
|
|
2
|
+
import { SDSButtonProps } from '../sds-button/sds-button';
|
|
3
|
+
import { SDSCheckboxProps } from '../sds-checkbox/sds-checkbox';
|
|
4
|
+
import { SDSCheckboxGroupProps } from '../sds-checkbox-group/sds-checkbox-group';
|
|
5
|
+
import { SDSChipProps } from '../sds-chip/sds-chip';
|
|
6
|
+
import { SDSDetailProps } from '../sds-detail/sds-detail';
|
|
7
|
+
import { SDSHeadingProps } from '../sds-heading/sds-heading';
|
|
8
|
+
import { SDSIconProps } from '../sds-icon/sds-icon';
|
|
9
|
+
import { SDSLabelProps } from '../sds-label/sds-label';
|
|
10
|
+
import { SDSLinkProps } from '../sds-link/sds-link';
|
|
11
|
+
import { SDSLoaderProps } from '../sds-loader/sds-loader';
|
|
12
|
+
import { SDSNavCardProps } from '../sds-nav-card/sds-nav-card';
|
|
13
|
+
import { SDSNotificationProps } from '../sds-notification/sds-notification';
|
|
14
|
+
import { SDSParagraphProps } from '../sds-paragraph/sds-paragraph';
|
|
15
|
+
import { SDSRadioProps } from '../sds-radio/sds-radio';
|
|
16
|
+
import { SDSRadioGroupProps } from '../sds-radio-group/sds-radio-group';
|
|
17
|
+
import { SDSSwitchProps } from '../sds-switch/sds-switch';
|
|
18
|
+
import { SDSTextProps } from '../sds-text/sds-text';
|
|
19
|
+
import { SDSTextFieldProps } from '../sds-textfield/sds-textfield';
|
|
20
|
+
declare module 'solid-js' {
|
|
21
|
+
namespace JSX {
|
|
22
|
+
interface IntrinsicElements {
|
|
23
|
+
'sds-button': SDSButtonProps & JSX.HTMLAttributes<HTMLElement>;
|
|
24
|
+
'sds-checkbox': SDSCheckboxProps & JSX.HTMLAttributes<HTMLElement>;
|
|
25
|
+
'sds-checkbox-group': SDSCheckboxGroupProps & JSX.HTMLAttributes<HTMLElement>;
|
|
26
|
+
'sds-chip': SDSChipProps & JSX.HTMLAttributes<HTMLElement>;
|
|
27
|
+
'sds-detail': SDSDetailProps & JSX.HTMLAttributes<HTMLElement>;
|
|
28
|
+
'sds-heading': SDSHeadingProps & JSX.HTMLAttributes<HTMLElement>;
|
|
29
|
+
'sds-icon': SDSIconProps & JSX.HTMLAttributes<HTMLElement>;
|
|
30
|
+
'sds-label': SDSLabelProps & JSX.HTMLAttributes<HTMLElement>;
|
|
31
|
+
'sds-link': SDSLinkProps & JSX.HTMLAttributes<HTMLElement>;
|
|
32
|
+
'sds-loader': SDSLoaderProps & JSX.HTMLAttributes<HTMLElement>;
|
|
33
|
+
'sds-nav-card': SDSNavCardProps & JSX.HTMLAttributes<HTMLElement>;
|
|
34
|
+
'sds-notification': SDSNotificationProps & JSX.HTMLAttributes<HTMLElement>;
|
|
35
|
+
'sds-paragraph': SDSParagraphProps & JSX.HTMLAttributes<HTMLElement>;
|
|
36
|
+
'sds-radio': SDSRadioProps & JSX.HTMLAttributes<HTMLElement>;
|
|
37
|
+
'sds-radio-group': SDSRadioGroupProps & JSX.HTMLAttributes<HTMLElement>;
|
|
38
|
+
'sds-switch': SDSSwitchProps & JSX.HTMLAttributes<HTMLElement>;
|
|
39
|
+
'sds-text': SDSTextProps & JSX.HTMLAttributes<HTMLElement>;
|
|
40
|
+
'sds-textfield': SDSTextFieldProps & JSX.HTMLAttributes<HTMLElement>;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=solidjs.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { DefineComponent } from 'vue';
|
|
2
|
+
import { SDSButtonProps } from '../sds-button/sds-button';
|
|
3
|
+
import { SDSCheckboxProps } from '../sds-checkbox/sds-checkbox';
|
|
4
|
+
import { SDSCheckboxGroupProps } from '../sds-checkbox-group/sds-checkbox-group';
|
|
5
|
+
import { SDSChipProps } from '../sds-chip/sds-chip';
|
|
6
|
+
import { SDSDetailProps } from '../sds-detail/sds-detail';
|
|
7
|
+
import { SDSHeadingProps } from '../sds-heading/sds-heading';
|
|
8
|
+
import { SDSIconProps } from '../sds-icon/sds-icon';
|
|
9
|
+
import { SDSLabelProps } from '../sds-label/sds-label';
|
|
10
|
+
import { SDSLinkProps } from '../sds-link/sds-link';
|
|
11
|
+
import { SDSLoaderProps } from '../sds-loader/sds-loader';
|
|
12
|
+
import { SDSNavCardProps } from '../sds-nav-card/sds-nav-card';
|
|
13
|
+
import { SDSNotificationProps } from '../sds-notification/sds-notification';
|
|
14
|
+
import { SDSParagraphProps } from '../sds-paragraph/sds-paragraph';
|
|
15
|
+
import { SDSRadioProps } from '../sds-radio/sds-radio';
|
|
16
|
+
import { SDSRadioGroupProps } from '../sds-radio-group/sds-radio-group';
|
|
17
|
+
import { SDSSwitchProps } from '../sds-switch/sds-switch';
|
|
18
|
+
import { SDSTextProps } from '../sds-text/sds-text';
|
|
19
|
+
import { SDSTextFieldProps } from '../sds-textfield/sds-textfield';
|
|
20
|
+
declare module 'vue' {
|
|
21
|
+
interface GlobalComponents {
|
|
22
|
+
'sds-button': DefineComponent<SDSButtonProps>;
|
|
23
|
+
'sds-checkbox': DefineComponent<SDSCheckboxProps>;
|
|
24
|
+
'sds-checkbox-group': DefineComponent<SDSCheckboxGroupProps>;
|
|
25
|
+
'sds-chip': DefineComponent<SDSChipProps>;
|
|
26
|
+
'sds-detail': DefineComponent<SDSDetailProps>;
|
|
27
|
+
'sds-heading': DefineComponent<SDSHeadingProps>;
|
|
28
|
+
'sds-icon': DefineComponent<SDSIconProps>;
|
|
29
|
+
'sds-label': DefineComponent<SDSLabelProps>;
|
|
30
|
+
'sds-link': DefineComponent<SDSLinkProps>;
|
|
31
|
+
'sds-loader': DefineComponent<SDSLoaderProps>;
|
|
32
|
+
'sds-nav-card': DefineComponent<SDSNavCardProps>;
|
|
33
|
+
'sds-notification': DefineComponent<SDSNotificationProps>;
|
|
34
|
+
'sds-paragraph': DefineComponent<SDSParagraphProps>;
|
|
35
|
+
'sds-radio': DefineComponent<SDSRadioProps>;
|
|
36
|
+
'sds-radio-group': DefineComponent<SDSRadioGroupProps>;
|
|
37
|
+
'sds-switch': DefineComponent<SDSSwitchProps>;
|
|
38
|
+
'sds-text': DefineComponent<SDSTextProps>;
|
|
39
|
+
'sds-textfield': DefineComponent<SDSTextFieldProps>;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=vue.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { SDSButton } from './sds-button/sds-button';
|
|
1
2
|
export { SDSCheckbox } from './sds-checkbox/sds-checkbox';
|
|
2
3
|
export { SDSCheckboxGroup } from './sds-checkbox-group/sds-checkbox-group';
|
|
3
4
|
export { SDSChip } from './sds-chip/sds-chip';
|
|
@@ -15,4 +16,4 @@ export { SDSRadioGroup } from './sds-radio-group/sds-radio-group';
|
|
|
15
16
|
export { SDSSwitch } from './sds-switch/sds-switch';
|
|
16
17
|
export { SDSText } from './sds-text/sds-text';
|
|
17
18
|
export { SDSTextField } from './sds-textfield/sds-textfield';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Specifies the valid types for the button.
|
|
4
|
+
* @typedef {'button' | 'submit' | 'reset'} ButtonType
|
|
5
|
+
*/
|
|
2
6
|
type ButtonType = 'button' | 'submit' | 'reset';
|
|
7
|
+
/**
|
|
8
|
+
* Visual style variants for the button.
|
|
9
|
+
* @typedef {'primary' | 'secondary' | 'tertiary' | 'critical'} ButtonVariant
|
|
10
|
+
*/
|
|
3
11
|
type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'critical';
|
|
12
|
+
/**
|
|
13
|
+
* Available size options for the button.
|
|
14
|
+
* @typedef {'large' | 'medium' | 'small'} ButtonSize
|
|
15
|
+
*/
|
|
4
16
|
type ButtonSize = 'large' | 'medium' | 'small';
|
|
17
|
+
/**
|
|
18
|
+
* Properties for the `<sds-button>` web component.
|
|
19
|
+
*
|
|
20
|
+
* @prop {ButtonType} [type='button'] - Specifies the button behavior: normal, submit, or reset.
|
|
21
|
+
* @prop {ButtonVariant} [variant='primary'] - Sets the visual style of the button.
|
|
22
|
+
* @prop {ButtonSize} [size='large'] - Defines the button's size.
|
|
23
|
+
* @prop {boolean} [disabled=false] - Disables the button if true.
|
|
24
|
+
* @prop {string} [name] - The name attribute for form submission.
|
|
25
|
+
* @prop {string} [value] - The value attribute for form submission.
|
|
26
|
+
* @prop {string} [form] - Associates the button with a form by its ID.
|
|
27
|
+
* @prop {(event: CustomEvent) => void} [onClick] - Callback fired on click events.
|
|
28
|
+
* @prop {(event: CustomEvent) => void} [onSubmit] - Callback fired on submit events.
|
|
29
|
+
* @prop {(event: CustomEvent) => void} [onReset] - Callback fired on reset events.
|
|
30
|
+
*/
|
|
5
31
|
export interface SDSButtonProps {
|
|
6
32
|
type?: ButtonType;
|
|
7
33
|
variant?: ButtonVariant;
|
|
@@ -14,22 +40,69 @@ export interface SDSButtonProps {
|
|
|
14
40
|
onSubmit?: (event: CustomEvent) => void;
|
|
15
41
|
onReset?: (event: CustomEvent) => void;
|
|
16
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Custom element `<sds-button>` for rendering a styled button.
|
|
45
|
+
*
|
|
46
|
+
* @element sds-button
|
|
47
|
+
*/
|
|
17
48
|
export declare class SDSButton extends LitElement {
|
|
18
49
|
static styles: import("lit").CSSResult[];
|
|
19
50
|
static formAssociated: boolean;
|
|
20
51
|
readonly internals: ElementInternals;
|
|
52
|
+
/**
|
|
53
|
+
* The button type attribute.
|
|
54
|
+
* @default "button"
|
|
55
|
+
*/
|
|
21
56
|
type: ButtonType;
|
|
57
|
+
/**
|
|
58
|
+
* Visual variant of the button.
|
|
59
|
+
* @default "primary"
|
|
60
|
+
*/
|
|
22
61
|
variant: ButtonVariant;
|
|
62
|
+
/**
|
|
63
|
+
* The size of the button.
|
|
64
|
+
* @default "large"
|
|
65
|
+
*/
|
|
23
66
|
size: ButtonSize;
|
|
67
|
+
/**
|
|
68
|
+
* Indicates if the button is disabled.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
24
71
|
disabled: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Name attribute of the button.
|
|
74
|
+
*/
|
|
25
75
|
name?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Value attribute of the button.
|
|
78
|
+
*/
|
|
26
79
|
value: string;
|
|
80
|
+
/**
|
|
81
|
+
* The ID of the form associated with the button.
|
|
82
|
+
*/
|
|
27
83
|
form?: string;
|
|
28
84
|
constructor();
|
|
85
|
+
/**
|
|
86
|
+
* Internal click handler managing submit, reset, or regular clicks.
|
|
87
|
+
* @param event - The mouse click event.
|
|
88
|
+
*/
|
|
29
89
|
private readonly _handleClick;
|
|
90
|
+
/**
|
|
91
|
+
* Focuses the underlying button element.
|
|
92
|
+
*/
|
|
30
93
|
focus(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Blurs the underlying button element.
|
|
96
|
+
*/
|
|
31
97
|
blur(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Triggers a click on the underlying button element.
|
|
100
|
+
*/
|
|
32
101
|
click(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Renders the button template.
|
|
104
|
+
* @returns The template for the button.
|
|
105
|
+
*/
|
|
33
106
|
render(): import("lit-html").TemplateResult<1>;
|
|
34
107
|
}
|
|
35
108
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-button.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAMvC,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-button.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.ts"],"names":[],"mappings":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G;IAEH,IAAI,CAAC,EAAE,MAAM,CAAC;;IAQd;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAuD3B;IAEF;;OAEG;IACM,KAAK,IAAI,IAAI;IAItB;;OAEG;IACM,IAAI,IAAI,IAAI;IAIrB;;OAEG;IACM,KAAK,IAAI,IAAI;IAItB;;;OAGG;IACM,MAAM;CA2Bf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,YAAY,EAAE,SAAS,CAAC;KACxB;CACD"}
|
|
@@ -9,14 +9,42 @@ import { customElement, property } from 'lit/decorators.js';
|
|
|
9
9
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
11
|
import { styles } from './sds-button.styles';
|
|
12
|
+
/**
|
|
13
|
+
* Custom element `<sds-button>` for rendering a styled button.
|
|
14
|
+
*
|
|
15
|
+
* @element sds-button
|
|
16
|
+
*/
|
|
12
17
|
let SDSButton = class SDSButton extends LitElement {
|
|
13
18
|
constructor() {
|
|
14
19
|
super();
|
|
20
|
+
/**
|
|
21
|
+
* The button type attribute.
|
|
22
|
+
* @default "button"
|
|
23
|
+
*/
|
|
15
24
|
this.type = 'button';
|
|
25
|
+
/**
|
|
26
|
+
* Visual variant of the button.
|
|
27
|
+
* @default "primary"
|
|
28
|
+
*/
|
|
16
29
|
this.variant = 'primary';
|
|
30
|
+
/**
|
|
31
|
+
* The size of the button.
|
|
32
|
+
* @default "large"
|
|
33
|
+
*/
|
|
17
34
|
this.size = 'large';
|
|
35
|
+
/**
|
|
36
|
+
* Indicates if the button is disabled.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
18
39
|
this.disabled = false;
|
|
40
|
+
/**
|
|
41
|
+
* Value attribute of the button.
|
|
42
|
+
*/
|
|
19
43
|
this.value = '';
|
|
44
|
+
/**
|
|
45
|
+
* Internal click handler managing submit, reset, or regular clicks.
|
|
46
|
+
* @param event - The mouse click event.
|
|
47
|
+
*/
|
|
20
48
|
this._handleClick = (event) => {
|
|
21
49
|
event.preventDefault();
|
|
22
50
|
event.stopImmediatePropagation();
|
|
@@ -71,18 +99,31 @@ let SDSButton = class SDSButton extends LitElement {
|
|
|
71
99
|
this.internals = this.attachInternals();
|
|
72
100
|
this.attachShadow({ mode: 'open', delegatesFocus: true });
|
|
73
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Focuses the underlying button element.
|
|
104
|
+
*/
|
|
74
105
|
focus() {
|
|
75
106
|
if (!this.disabled)
|
|
76
107
|
this.shadowRoot?.querySelector('button')?.focus();
|
|
77
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Blurs the underlying button element.
|
|
111
|
+
*/
|
|
78
112
|
blur() {
|
|
79
113
|
if (!this.disabled)
|
|
80
114
|
this.shadowRoot?.querySelector('button')?.blur();
|
|
81
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Triggers a click on the underlying button element.
|
|
118
|
+
*/
|
|
82
119
|
click() {
|
|
83
120
|
if (!this.disabled)
|
|
84
121
|
this.shadowRoot?.querySelector('button')?.click();
|
|
85
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Renders the button template.
|
|
125
|
+
* @returns The template for the button.
|
|
126
|
+
*/
|
|
86
127
|
render() {
|
|
87
128
|
const buttonClasses = {
|
|
88
129
|
'sds-button': true,
|
|
@@ -111,6 +152,7 @@ let SDSButton = class SDSButton extends LitElement {
|
|
|
111
152
|
}
|
|
112
153
|
};
|
|
113
154
|
SDSButton.styles = [styles];
|
|
155
|
+
// Enables form association for this component.
|
|
114
156
|
SDSButton.formAssociated = true;
|
|
115
157
|
__decorate([
|
|
116
158
|
property({ type: String, reflect: true })
|
|
@@ -137,33 +179,4 @@ SDSButton = __decorate([
|
|
|
137
179
|
customElement('sds-button')
|
|
138
180
|
], SDSButton);
|
|
139
181
|
export { SDSButton };
|
|
140
|
-
/*// NextJs
|
|
141
|
-
declare module 'react' {
|
|
142
|
-
namespace JSX {
|
|
143
|
-
interface IntrinsicElements {
|
|
144
|
-
'sds-button': SDSButtonProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}*/
|
|
148
|
-
/*
|
|
149
|
-
// Angular
|
|
150
|
-
declare module '@angular/core' {
|
|
151
|
-
interface IntrinsicElements {
|
|
152
|
-
'sds-button': SDSButtonProps;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Vue
|
|
157
|
-
declare module 'vue' {
|
|
158
|
-
export interface GlobalComponents {
|
|
159
|
-
'sds-button': SDSButtonProps;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Svelte
|
|
164
|
-
declare namespace svelteHTML {
|
|
165
|
-
interface HTMLAttributes<T> {
|
|
166
|
-
'sds-button'?: SDSButtonProps;
|
|
167
|
-
}
|
|
168
|
-
} */
|
|
169
182
|
//# sourceMappingURL=sds-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-button.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAoBtC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAoBxC;QACC,KAAK,EAAE,CAAC;QAdT,SAAI,GAAe,QAAQ,CAAC;QAG5B,YAAO,GAAkB,SAAS,CAAC;QAGnC,SAAI,GAAe,OAAO,CAAC;QAEiB,aAAQ,GAAY,KAAK,CAAC;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AQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAAe;AAlB7C,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA0HrB;;AAgBD;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;IAoBI","sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styles } from './sds-button.styles';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\ntype ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'critical';\ntype ButtonSize = 'large' | 'medium' | 'small';\n\nexport interface SDSButtonProps {\n\ttype?: ButtonType;\n\tvariant?: ButtonVariant;\n\tsize?: ButtonSize;\n\tdisabled?: boolean;\n\tname?: string;\n\tvalue?: string;\n\tform?: string;\n\tonClick?: (event: CustomEvent) => void;\n\tonSubmit?: (event: CustomEvent) => void;\n\tonReset?: (event: CustomEvent) => void;\n}\n\n@customElement('sds-button')\nexport class SDSButton extends LitElement {\n\tstatic override styles = [styles];\n\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\t@property({ type: String, reflect: true })\n\ttype: ButtonType = 'button';\n\n\t@property({ type: String, reflect: true })\n\tvariant: ButtonVariant = 'primary';\n\n\t@property({ type: String, reflect: true })\n\tsize: ButtonSize = 'large';\n\n\t@property({ type: Boolean, reflect: true }) disabled: boolean = false;\n\t@property({ type: String, reflect: true }) name?: string;\n\t@property({ type: String, reflect: true }) value: string = '';\n\t@property({ type: String, reflect: true }) form?: string;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.internals = this.attachInternals();\n\t\tthis.attachShadow({ mode: 'open', delegatesFocus: true });\n\t}\n\n\tprivate readonly _handleClick = (event: MouseEvent) => {\n\t\tevent.preventDefault();\n\t\tevent.stopImmediatePropagation();\n\n\t\tif (!this.disabled) {\n\t\t\tswitch (this.type) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst submitEvent = new CustomEvent('submit', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\tcancelable: true,\n\t\t\t\t\t});\n\t\t\t\t\tconst shouldSubmit = this.dispatchEvent(submitEvent);\n\n\t\t\t\t\tif (shouldSubmit) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.submit();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.submit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'reset': {\n\t\t\t\t\tconst resetEvent = new CustomEvent('reset', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\tcancelable: true,\n\t\t\t\t\t});\n\t\t\t\t\tconst shouldReset = this.dispatchEvent(resetEvent);\n\n\t\t\t\t\tif (shouldReset) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.reset();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.reset();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent('click', {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n\n\toverride focus(): void {\n\t\tif (!this.disabled) this.shadowRoot?.querySelector('button')?.focus();\n\t}\n\n\toverride blur(): void {\n\t\tif (!this.disabled) this.shadowRoot?.querySelector('button')?.blur();\n\t}\n\n\toverride click(): void {\n\t\tif (!this.disabled) this.shadowRoot?.querySelector('button')?.click();\n\t}\n\n\toverride render() {\n\t\tconst buttonClasses = {\n\t\t\t'sds-button': true,\n\t\t\t'sds-button--secondary': this.variant === 'secondary',\n\t\t\t'sds-button--tertiary': this.variant === 'tertiary',\n\t\t\t'sds-button--critical': this.variant === 'critical',\n\t\t\t'sds-button--medium': this.size === 'medium',\n\t\t\t'sds-button--small': this.size === 'small',\n\t\t};\n\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tid=\"control\"\n\t\t\t\tform=\"${ifDefined(this.form)}\"\n\t\t\t\tclass=\"${classMap(buttonClasses)}\"\n\t\t\t\ttype=\"${this.type}\"\n\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t@click=\"${this._handleClick}\"\n\t\t\t>\n\t\t\t\t<slot name=\"before\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"after\"></slot>\n\t\t\t</button>\n\t\t`;\n\t}\n}\n\ndeclare global {\n\t// HTML\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-button': SDSButton;\n\t}\n\n\t/*// React\n\tnamespace JSX {\n\t\tinterface IntrinsicElements {\n\t\t\t'sds-button': SDSButtonProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;\n\t\t}\n\t}*/\n}\n\n/*// NextJs\ndeclare module 'react' {\n\tnamespace JSX {\n\t\tinterface IntrinsicElements {\n\t\t\t'sds-button': SDSButtonProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;\n\t\t}\n\t}\n}*/\n\n/*\n// Angular\ndeclare module '@angular/core' {\n\tinterface IntrinsicElements {\n\t\t'sds-button': SDSButtonProps;\n\t}\n}\n\n// Vue\ndeclare module 'vue' {\n\texport interface GlobalComponents {\n\t\t'sds-button': SDSButtonProps;\n\t}\n}\n\n// Svelte\ndeclare namespace svelteHTML {\n\tinterface HTMLAttributes<T> {\n\t\t'sds-button'?: SDSButtonProps;\n\t}\n} */\n"]}
|
|
1
|
+
{"version":3,"file":"sds-button.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA+C7C;;;;GAIG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAqDxC;QACC,KAAK,EAAE,CAAC;QA/CT;;;WAGG;QAEH,SAAI,GAAe,QAAQ,CAAC;QAE5B;;;WAGG;QAEH,YAAO,GAAkB,SAAS,CAAC;QAEnC;;;WAGG;QAEH,SAAI,GAAe,OAAO,CAAC;QAE3B;;;WAGG;QAEH,aAAQ,GAAY,KAAK,CAAC;QAQ1B;;WAEG;QAEH,UAAK,GAAW,EAAE,CAAC;QAcnB;;;WAGG;QACc,iBAAY,GAAG,CAAC,KAAiB,EAAE,EAAE;YACrD,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,KAAK,CAAC,wBAAwB,EAAE,CAAC;YAEjC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACpB,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;oBACnB,KAAK,QAAQ,CAAC,CAAC,CAAC;wBACf,MAAM,WAAW,GAAG,I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C,CAAC;QAEF,OAAO,IAAI,CAAA;;;YAGD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;aACnB,QAAQ,CAAC,aAAa,CAAC;YACxB,IAAI,CAAC,IAAI;YACT,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;aACnB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;iBACjB,IAAI,CAAC,QAAQ;cAChB,IAAI,CAAC,YAAY;;;;;;GAM5B,CAAC;IACH,CAAC;;AA1Ke,gBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAElC,+CAA+C;AACxC,wBAAc,GAAG,IAAI,AAAP,CAAQ;AAQ7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACd;AAO5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACP;AAOnC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACf;AAO3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CACjB;AAM1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAC5B;AAMd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACvB;AAMnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAC5B;AAnDF,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA4KrB","sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styles } from './sds-button.styles';\n\n/**\n * Specifies the valid types for the button.\n * @typedef {'button' | 'submit' | 'reset'} ButtonType\n */\ntype ButtonType = 'button' | 'submit' | 'reset';\n\n/**\n * Visual style variants for the button.\n * @typedef {'primary' | 'secondary' | 'tertiary' | 'critical'} ButtonVariant\n */\ntype ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'critical';\n\n/**\n * Available size options for the button.\n * @typedef {'large' | 'medium' | 'small'} ButtonSize\n */\ntype ButtonSize = 'large' | 'medium' | 'small';\n\n/**\n * Properties for the `<sds-button>` web component.\n *\n * @prop {ButtonType} [type='button'] - Specifies the button behavior: normal, submit, or reset.\n * @prop {ButtonVariant} [variant='primary'] - Sets the visual style of the button.\n * @prop {ButtonSize} [size='large'] - Defines the button's size.\n * @prop {boolean} [disabled=false] - Disables the button if true.\n * @prop {string} [name] - The name attribute for form submission.\n * @prop {string} [value] - The value attribute for form submission.\n * @prop {string} [form] - Associates the button with a form by its ID.\n * @prop {(event: CustomEvent) => void} [onClick] - Callback fired on click events.\n * @prop {(event: CustomEvent) => void} [onSubmit] - Callback fired on submit events.\n * @prop {(event: CustomEvent) => void} [onReset] - Callback fired on reset events.\n */\nexport interface SDSButtonProps {\n\ttype?: ButtonType;\n\tvariant?: ButtonVariant;\n\tsize?: ButtonSize;\n\tdisabled?: boolean;\n\tname?: string;\n\tvalue?: string;\n\tform?: string;\n\tonClick?: (event: CustomEvent) => void;\n\tonSubmit?: (event: CustomEvent) => void;\n\tonReset?: (event: CustomEvent) => void;\n}\n\n/**\n * Custom element `<sds-button>` for rendering a styled button.\n *\n * @element sds-button\n */\n@customElement('sds-button')\nexport class SDSButton extends LitElement {\n\tstatic override styles = [styles];\n\n\t// Enables form association for this component.\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\t/**\n\t * The button type attribute.\n\t * @default \"button\"\n\t */\n\t@property({ type: String, reflect: true })\n\ttype: ButtonType = 'button';\n\n\t/**\n\t * Visual variant of the button.\n\t * @default \"primary\"\n\t */\n\t@property({ type: String, reflect: true })\n\tvariant: ButtonVariant = 'primary';\n\n\t/**\n\t * The size of the button.\n\t * @default \"large\"\n\t */\n\t@property({ type: String, reflect: true })\n\tsize: ButtonSize = 'large';\n\n\t/**\n\t * Indicates if the button is disabled.\n\t * @default false\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tdisabled: boolean = false;\n\n\t/**\n\t * Name attribute of the button.\n\t */\n\t@property({ type: String, reflect: true })\n\tname?: string;\n\n\t/**\n\t * Value attribute of the button.\n\t */\n\t@property({ type: String, reflect: true })\n\tvalue: string = '';\n\n\t/**\n\t * The ID of the form associated with the button.\n\t */\n\t@property({ type: String, reflect: true })\n\tform?: string;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.internals = this.attachInternals();\n\t\tthis.attachShadow({ mode: 'open', delegatesFocus: true });\n\t}\n\n\t/**\n\t * Internal click handler managing submit, reset, or regular clicks.\n\t * @param event - The mouse click event.\n\t */\n\tprivate readonly _handleClick = (event: MouseEvent) => {\n\t\tevent.preventDefault();\n\t\tevent.stopImmediatePropagation();\n\n\t\tif (!this.disabled) {\n\t\t\tswitch (this.type) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst submitEvent = new CustomEvent('submit', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\tcancelable: true,\n\t\t\t\t\t});\n\t\t\t\t\tconst shouldSubmit = this.dispatchEvent(submitEvent);\n\n\t\t\t\t\tif (shouldSubmit) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.submit();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.submit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'reset': {\n\t\t\t\t\tconst resetEvent = new CustomEvent('reset', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\tcancelable: true,\n\t\t\t\t\t});\n\t\t\t\t\tconst shouldReset = this.dispatchEvent(resetEvent);\n\n\t\t\t\t\tif (shouldReset) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.reset();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.reset();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent('click', {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * Focuses the underlying button element.\n\t */\n\toverride focus(): void {\n\t\tif (!this.disabled) this.shadowRoot?.querySelector('button')?.focus();\n\t}\n\n\t/**\n\t * Blurs the underlying button element.\n\t */\n\toverride blur(): void {\n\t\tif (!this.disabled) this.shadowRoot?.querySelector('button')?.blur();\n\t}\n\n\t/**\n\t * Triggers a click on the underlying button element.\n\t */\n\toverride click(): void {\n\t\tif (!this.disabled) this.shadowRoot?.querySelector('button')?.click();\n\t}\n\n\t/**\n\t * Renders the button template.\n\t * @returns The template for the button.\n\t */\n\toverride render() {\n\t\tconst buttonClasses = {\n\t\t\t'sds-button': true,\n\t\t\t'sds-button--secondary': this.variant === 'secondary',\n\t\t\t'sds-button--tertiary': this.variant === 'tertiary',\n\t\t\t'sds-button--critical': this.variant === 'critical',\n\t\t\t'sds-button--medium': this.size === 'medium',\n\t\t\t'sds-button--small': this.size === 'small',\n\t\t};\n\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tid=\"control\"\n\t\t\t\tform=\"${ifDefined(this.form)}\"\n\t\t\t\tclass=\"${classMap(buttonClasses)}\"\n\t\t\t\ttype=\"${this.type}\"\n\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t@click=\"${this._handleClick}\"\n\t\t\t>\n\t\t\t\t<slot name=\"before\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"after\"></slot>\n\t\t\t</button>\n\t\t`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-button': SDSButton;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-checkbox.d.ts","sourceRoot":"","sources":["../../src/sds-checkbox/sds-checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAC;AAOhD,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;IAC7E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;IAC7D,MAAM,CAAC,EAAE,CAAC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C;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;IAC7D,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;CAC5D;AAED,qBACa,WAAY,SAAQ,UAAU;IAE1C,OAAgB,MAAM,4BAAY;IAElC,MAAM,CAAC,cAAc,UAAQ;IAC7B,SAAgB,SAAS,EAAE,gBAAgB,CAAC;IAGD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACC,OAAO,UAAS;IAChB,QAAQ,UAAS;IACjB,KAAK,UAAS;;IAS1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAa5B;IAEF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAS3B;IAEF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAS1B;IAEO,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,KAAK,IAAI,IAAI;IAIb,MAAM;CA8Bf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,WAAW,CAAC;KAC5B;CACD"}
|
|
@@ -113,33 +113,4 @@ SDSCheckbox = __decorate([
|
|
|
113
113
|
customElement('sds-checkbox')
|
|
114
114
|
], SDSCheckbox);
|
|
115
115
|
export { SDSCheckbox };
|
|
116
|
-
/*// NextJs
|
|
117
|
-
declare module 'react' {
|
|
118
|
-
namespace JSX {
|
|
119
|
-
interface IntrinsicElements {
|
|
120
|
-
'sds-checkbox': SDSCheckboxProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}*/
|
|
124
|
-
/*
|
|
125
|
-
// Angular
|
|
126
|
-
declare module '@angular/core' {
|
|
127
|
-
interface IntrinsicElements {
|
|
128
|
-
'sds-checkbox': SDSCheckboxProps;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// Vue
|
|
133
|
-
declare module 'vue' {
|
|
134
|
-
export interface GlobalComponents {
|
|
135
|
-
'sds-checkbox': SDSCheckboxProps;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Svelte
|
|
140
|
-
declare namespace svelteHTML {
|
|
141
|
-
interface HTMLAttributes<T> {
|
|
142
|
-
'sds-checkbox'?: SDSCheckboxProps;
|
|
143
|
-
}
|
|
144
|
-
} */
|
|
145
116
|
//# sourceMappingURL=sds-checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-checkbox.js","sourceRoot":"","sources":["../../src/sds-checkbox/sds-checkbox.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAgBxC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAe1C;QACC,KAAK,EAAE,CAAC;QALmC,YAAO,GAAG,KAAK,CAAC;QAChB,aAAQ,GAAG,KAAK,CAAC;QACjB,UAAK,GAAG,KAAK,CAAC;QAQ1D,iBAAiB;QACA,kBAAa,GAAG,CAAC,KAAY,EAAE,EAAE;YACjD,KAAK,CAAC,wBAAwB,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACpB,MAAM,IAAI,GAAG,KAAK,CAAC,MAA0B,CAAC;gBAC9C,IAAI,CAAC,OAAO,GAAG,I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AAC;0CAAgB;AACC;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAiB;AAChB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAAkB;AACjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAe;AAb9C,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAqGvB","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './sds-checkbox.styles';\n\n// Props Interface\nexport interface SDSCheckboxProps {\n\tname?: string;\n\tlabel?: string;\n\tvalue?: string;\n\tchecked?: boolean;\n\tdisabled?: boolean;\n\terror?: boolean;\n\tonChange?: (event: CustomEvent<{ checked: boolean; value: string }>) => void;\n\tonFocus?: (event: CustomEvent<{ checked: boolean }>) => void;\n\tonBlur?: (event: CustomEvent<{ checked: boolean }>) => void;\n}\n\n@customElement('sds-checkbox')\nexport class SDSCheckbox extends LitElement {\n\t// Styling\n\tstatic override styles = [styles];\n\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\t// Props\n\t@property({ type: String, reflect: true }) name?: string;\n\t@property({ type: String, reflect: true }) label?: string;\n\t@property({ type: String }) value?: string;\n\t@property({ type: Boolean, reflect: true }) checked = false;\n\t@property({ type: Boolean, reflect: true }) disabled = false;\n\t@property({ type: Boolean, reflect: true }) error = false;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.internals = this.attachInternals();\n\t\tthis.attachShadow({ mode: 'open', delegatesFocus: true });\n\t}\n\n\t// Event handling\n\tprivate readonly _handleChange = (event: Event) => {\n\t\tevent.stopImmediatePropagation();\n\t\tif (!this.disabled) {\n\t\t\tconst elem = event.target as HTMLInputElement;\n\t\t\tthis.checked = elem.checked;\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('change', {\n\t\t\t\t\tdetail: { checked: this.checked, value: elem.value },\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcomposed: true,\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t};\n\n\tprivate readonly _handleFocus = (event: FocusEvent) => {\n\t\tevent.stopImmediatePropagation();\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('focus', {\n\t\t\t\tdetail: { checked: this.checked },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t})\n\t\t);\n\t};\n\n\tprivate readonly _handleBlur = (event: FocusEvent) => {\n\t\tevent.stopImmediatePropagation();\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('blur', {\n\t\t\t\tdetail: { checked: this.checked },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t})\n\t\t);\n\t};\n\n\toverride focus(): void {\n\t\tif (!this.disabled) this.shadowRoot?.querySelector('input')?.focus();\n\t}\n\n\toverride blur(): void {\n\t\tif (!this.disabled) this.shadowRoot?.querySelector('input')?.blur();\n\t}\n\n\toverride click(): void {\n\t\tif (!this.disabled) this.shadowRoot?.querySelector('input')?.click();\n\t}\n\n\toverride render() {\n\t\tconst checkboxClasses = {\n\t\t\t'sds-checkbox': true,\n\t\t\t'sds-checkbox--error': Boolean(this.error),\n\t\t};\n\n\t\tconst inputClasses = {\n\t\t\t'sds-checkbox__input': true,\n\t\t\t'sds-checkbox__input--error': Boolean(this.error),\n\t\t};\n\n\t\treturn html`\n\t\t\t<div class=\"${classMap(checkboxClasses)}\">\n\t\t\t\t<label class=\"sds-checkbox__label\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t\t\t?checked=\"${this.checked}\"\n\t\t\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t\t\t@change=\"${this._handleChange}\"\n\t\t\t\t\t\t@focus=\"${this._handleFocus}\"\n\t\t\t\t\t\t@blur=\"${this._handleBlur}\"\n\t\t\t\t\t\tclass=\"${classMap(inputClasses)}\"\n\t\t\t\t\t/>\n\t\t\t\t\t${this.label ? html`<span class=\"sds-checkbox__text\">${this.label}</span>` : nothing}\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-checkbox': SDSCheckbox;\n\t}\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import '../sds-checkbox/sds-checkbox';
|
|
3
3
|
import '../sds-icon/sds-icon';
|
|
4
|
-
interface SDSCheckboxGroupProps {
|
|
4
|
+
export interface SDSCheckboxGroupProps {
|
|
5
5
|
legend?: string;
|
|
6
6
|
'help-text'?: string;
|
|
7
7
|
'error-message'?: string;
|
|
@@ -22,18 +22,5 @@ declare global {
|
|
|
22
22
|
interface HTMLElementTagNameMap {
|
|
23
23
|
'sds-checkbox-group': SDSCheckboxGroup;
|
|
24
24
|
}
|
|
25
|
-
namespace JSX {
|
|
26
|
-
interface IntrinsicElements {
|
|
27
|
-
'sds-checkbox-group': SDSCheckboxGroupProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
declare module 'react' {
|
|
32
|
-
namespace JSX {
|
|
33
|
-
interface IntrinsicElements {
|
|
34
|
-
'sds-checkbox-group': SDSCheckboxGroupProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
25
|
}
|
|
38
|
-
export {};
|
|
39
26
|
//# sourceMappingURL=sds-checkbox-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-checkbox-group.d.ts","sourceRoot":"","sources":["../../src/sds-checkbox-group/sds-checkbox-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAC;AAKhD,OAAO,8BAA8B,CAAC;AACtC,OAAO,sBAAsB,CAAC;AAG9B,
|
|
1
|
+
{"version":3,"file":"sds-checkbox-group.d.ts","sourceRoot":"","sources":["../../src/sds-checkbox-group/sds-checkbox-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAC;AAKhD,OAAO,8BAA8B,CAAC;AACtC,OAAO,sBAAsB,CAAC;AAG9B,MAAM,WAAW,qBAAqB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC;QAAE,cAAc,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;CACtE;AAED,qBACa,gBAAiB,SAAQ,UAAU;IAE/C,OAAgB,MAAM,4BAAY;IAGS,MAAM,CAAC,EAAE,MAAM,CAAC;IACQ,QAAQ,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IAG7F,OAAO,CAAC,cAAc,CAAgB;IAEtC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAgBpC;IAEO,MAAM;CA0Bf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,oBAAoB,EAAE,gBAAgB,CAAC;KACvC;CACD"}
|
|
@@ -72,25 +72,4 @@ SDSCheckboxGroup = __decorate([
|
|
|
72
72
|
customElement('sds-checkbox-group')
|
|
73
73
|
], SDSCheckboxGroup);
|
|
74
74
|
export { SDSCheckboxGroup };
|
|
75
|
-
/*
|
|
76
|
-
// Angular
|
|
77
|
-
declare module '@angular/core' {
|
|
78
|
-
interface IntrinsicElements {
|
|
79
|
-
'sds-checkbox-group': SDSCheckboxGroupProps;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Vue
|
|
84
|
-
declare module 'vue' {
|
|
85
|
-
export interface GlobalComponents {
|
|
86
|
-
'sds-checkbox-group': SDSCheckboxGroupProps;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Svelte
|
|
91
|
-
declare namespace svelteHTML {
|
|
92
|
-
interface HTMLAttributes<T> {
|
|
93
|
-
'sds-checkbox-group'?: SDSCheckboxGroupProps;
|
|
94
|
-
}
|
|
95
|
-
} */
|
|
96
75
|
//# sourceMappingURL=sds-checkbox-group.js.map
|