@politiet/sheriff-web-components 2.0.2 → 2.0.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.
@@ -5,8 +5,6 @@ declare module 'react' {
5
5
  namespace JSX {
6
6
  interface SDSAlertElementProps extends Merge<React.HTMLAttributes<SDSAlert>, SDSAlertProps> {
7
7
  }
8
- interface SDSCheckboxGroupElementProps extends Merge<React.HTMLAttributes<SDSCheckboxGroup>, SDSCheckboxGroupProps> {
9
- }
10
8
  interface SDSHeadingElementProps extends Merge<React.HTMLAttributes<SDSHeading>, SDSHeadingProps> {
11
9
  }
12
10
  interface SDSIconElementProps extends Merge<React.HTMLAttributes<SDSIcon>, SDSIconProps> {
@@ -17,8 +15,6 @@ declare module 'react' {
17
15
  }
18
16
  interface SDSNotificationElementProps extends Merge<React.HTMLAttributes<SDSNotification>, SDSNotificationProps> {
19
17
  }
20
- interface SDSRadioGroupElementProps extends Merge<React.HTMLAttributes<SDSRadioGroup>, SDSRadioGroupProps> {
21
- }
22
18
  interface SDSTagElementProps extends Merge<React.HTMLAttributes<SDSTag>, SDSTagProps> {
23
19
  }
24
20
  interface SDSTextElementProps extends Merge<React.HTMLAttributes<SDSText>, SDSTextProps> {
@@ -27,10 +23,14 @@ declare module 'react' {
27
23
  }
28
24
  interface SDSCheckboxElementProps extends Merge<React.InputHTMLAttributes<SDSCheckbox>, SDSCheckboxProps> {
29
25
  }
26
+ interface SDSCheckboxGroupElementProps extends Merge<React.InputHTMLAttributes<SDSCheckboxGroup>, SDSCheckboxGroupProps> {
27
+ }
30
28
  interface SDSChipElementProps extends Merge<React.InputHTMLAttributes<SDSChip>, SDSChipProps> {
31
29
  }
32
30
  interface SDSRadioElementProps extends Merge<React.InputHTMLAttributes<SDSRadio>, SDSRadioProps> {
33
31
  }
32
+ interface SDSRadioGroupElementProps extends Merge<React.InputHTMLAttributes<SDSRadioGroup>, SDSRadioGroupProps> {
33
+ }
34
34
  interface SDSSwitchElementProps extends Merge<React.InputHTMLAttributes<SDSSwitch>, SDSSwitchProps> {
35
35
  }
36
36
  interface SDSTextFieldElementProps extends Merge<React.InputHTMLAttributes<SDSTextField>, SDSTextFieldProps> {
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/frameworks/react.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACN,QAAQ,EACR,aAAa,EACb,SAAS,EACT,cAAc,EACd,OAAO,EACP,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,SAAS,EACT,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,cAAc,EACd,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,MAAM,IAAI,CAAC;AAEZ,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;AAExC,OAAO,QAAQ,OAAO,CAAC;IACtB,UAAU,GAAG,CAAC;QAEb,UAAU,oBAAqB,SAAQ,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;SAAG;QAC9F,UAAU,4BAA6B,SAAQ,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;SAAG;QACtH,UAAU,sBAAuB,SAAQ,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;SAAG;QACpG,UAAU,mBAAoB,SAAQ,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,C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E,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;YACxE,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;YAC/D,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;YAClE,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC;YAC9E,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAC;SACjF;KACD;CACD"}
@@ -2,5 +2,6 @@ import { SDSCheckboxGroup } from '../sds-checkbox-group/sds-checkbox-group';
2
2
  import { SheriffEventName } from '../types';
3
3
  export declare const SDSCheckboxGroupWrapper: import("@lit/react").ReactWebComponent<SDSCheckboxGroup, {
4
4
  onUpdate: SheriffEventName;
5
+ onChange: SheriffEventName;
5
6
  }>;
6
7
  //# sourceMappingURL=SDSCheckboxGroupWrapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SDSCheckboxGroupWrapper.d.ts","sourceRoot":"","sources":["../../src/react-wrappers/SDSCheckboxGroupWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,uBAAuB;cAKR,gBAAgB;EAE1C,CAAC"}
1
+ {"version":3,"file":"SDSCheckboxGroupWrapper.d.ts","sourceRoot":"","sources":["../../src/react-wrappers/SDSCheckboxGroupWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,uBAAuB;cAKR,gBAAgB;cACpB,gBAAgB;EAEtC,CAAC"}
@@ -7,6 +7,7 @@ export const SDSCheckboxGroupWrapper = createComponent({
7
7
  react: React,
8
8
  events: {
9
9
  onUpdate: 'sds-update',
10
+ onChange: 'change',
10
11
  },
11
12
  });
12
13
  //# sourceMappingURL=SDSCheckboxGroupWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SDSCheckboxGroupWrapper.js","sourceRoot":"","sources":["../../src/react-wrappers/SDSCheckboxGroupWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAG5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC;IACtD,OAAO,EAAE,oBAAoB;IAC7B,YAAY,EAAE,gBAAgB;IAC9B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACP,QAAQ,EAAE,YAAgC;KAC1C;CACD,CAAC,CAAC","sourcesContent":["import { createComponent } from '@lit/react';\nimport React from 'react';\nimport { SDSCheckboxGroup } from '../sds-checkbox-group/sds-checkbox-group';\nimport { SheriffEventName } from '../types';\n\nexport const SDSCheckboxGroupWrapper = createComponent({\n\ttagName: 'sds-checkbox-group',\n\telementClass: SDSCheckboxGroup,\n\treact: React,\n\tevents: {\n\t\tonUpdate: 'sds-update' as SheriffEventName,\n\t},\n});\n"]}
1
+ {"version":3,"file":"SDSCheckboxGroupWrapper.js","sourceRoot":"","sources":["../../src/react-wrappers/SDSCheckboxGroupWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAG5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC;IACtD,OAAO,EAAE,oBAAoB;IAC7B,YAAY,EAAE,gBAAgB;IAC9B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACP,QAAQ,EAAE,YAAgC;QAC1C,QAAQ,EAAE,QAA4B;KACtC;CACD,CAAC,CAAC","sourcesContent":["import { createComponent } from '@lit/react';\nimport React from 'react';\nimport { SDSCheckboxGroup } from '../sds-checkbox-group/sds-checkbox-group';\nimport { SheriffEventName } from '../types';\n\nexport const SDSCheckboxGroupWrapper = createComponent({\n\ttagName: 'sds-checkbox-group',\n\telementClass: SDSCheckboxGroup,\n\treact: React,\n\tevents: {\n\t\tonUpdate: 'sds-update' as SheriffEventName,\n\t\tonChange: 'change' as SheriffEventName,\n\t},\n});\n"]}
@@ -2,5 +2,6 @@ import { SDSRadioGroup } from '../sds-radio-group/sds-radio-group';
2
2
  import { SheriffEventName } from '../types';
3
3
  export declare const SDSRadioGroupWrapper: import("@lit/react").ReactWebComponent<SDSRadioGroup, {
4
4
  onUpdate: SheriffEventName;
5
+ onChange: SheriffEventName;
5
6
  }>;
6
7
  //# sourceMappingURL=SDSRadioGroupWrapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SDSRadioGroupWrapper.d.ts","sourceRoot":"","sources":["../../src/react-wrappers/SDSRadioGroupWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,oBAAoB;cAKL,gBAAgB;EAE1C,CAAC"}
1
+ {"version":3,"file":"SDSRadioGroupWrapper.d.ts","sourceRoot":"","sources":["../../src/react-wrappers/SDSRadioGroupWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,oBAAoB;cAKL,gBAAgB;cACpB,gBAAgB;EAEtC,CAAC"}
@@ -7,6 +7,7 @@ export const SDSRadioGroupWrapper = createComponent({
7
7
  react: React,
8
8
  events: {
9
9
  onUpdate: 'sds-update',
10
+ onChange: 'change',
10
11
  },
11
12
  });
12
13
  //# sourceMappingURL=SDSRadioGroupWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SDSRadioGroupWrapper.js","sourceRoot":"","sources":["../../src/react-wrappers/SDSRadioGroupWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;IACnD,OAAO,EAAE,iBAAiB;IAC1B,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACP,QAAQ,EAAE,YAAgC;KAC1C;CACD,CAAC,CAAC","sourcesContent":["import { createComponent } from '@lit/react';\nimport React from 'react';\nimport { SDSRadioGroup } from '../sds-radio-group/sds-radio-group';\nimport { SheriffEventName } from '../types';\n\nexport const SDSRadioGroupWrapper = createComponent({\n\ttagName: 'sds-radio-group',\n\telementClass: SDSRadioGroup,\n\treact: React,\n\tevents: {\n\t\tonUpdate: 'sds-update' as SheriffEventName,\n\t},\n});\n"]}
1
+ {"version":3,"file":"SDSRadioGroupWrapper.js","sourceRoot":"","sources":["../../src/react-wrappers/SDSRadioGroupWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;IACnD,OAAO,EAAE,iBAAiB;IAC1B,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACP,QAAQ,EAAE,YAAgC;QAC1C,QAAQ,EAAE,QAA4B;KACtC;CACD,CAAC,CAAC","sourcesContent":["import { createComponent } from '@lit/react';\nimport React from 'react';\nimport { SDSRadioGroup } from '../sds-radio-group/sds-radio-group';\nimport { SheriffEventName } from '../types';\n\nexport const SDSRadioGroupWrapper = createComponent({\n\ttagName: 'sds-radio-group',\n\telementClass: SDSRadioGroup,\n\treact: React,\n\tevents: {\n\t\tonUpdate: 'sds-update' as SheriffEventName,\n\t\tonChange: 'change' as SheriffEventName,\n\t},\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sds-alert.styles.d.ts","sourceRoot":"","sources":["../../src/sds-alert/sds-alert.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAsJlB,CAAC"}
1
+ {"version":3,"file":"sds-alert.styles.d.ts","sourceRoot":"","sources":["../../src/sds-alert/sds-alert.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA4KlB,CAAC"}
@@ -22,6 +22,7 @@ export const styles = css `
22
22
  --_sds-alert-title-line-height: var(--sds-alert-title-line-height, var(--sds-components-line-height-tall-title-md));
23
23
 
24
24
  --_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-info-text-subtle));
25
+ --_sds-alert-icon-color-background: var(--sds-alert-icon-color-background, var(--sds-color-action-contrast-default, white));
25
26
  --_sds-alert-max-line-width: var(--sds-alert-max-line-width, var(--sds-typography-max-line-width));
26
27
  --_sds-alert-padding: var(--sds-alert-padding, var(--sds-spacing-sm));
27
28
 
@@ -77,7 +78,6 @@ export const styles = css `
77
78
  display: flex;
78
79
  flex: 1;
79
80
  flex-direction: column;
80
- gap: var(--_sds-alert-content-gap);
81
81
  }
82
82
 
83
83
  .sds-alert__actions {
@@ -102,8 +102,30 @@ export const styles = css `
102
102
  --_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-md));
103
103
  --_sds-alert-font-weight: var(--sds-alert-font-weight, var(--sds-typography-body-md-tall-desktop-font-weight));
104
104
 
105
- ::slotted([slot='message']) {
106
- padding: 3px 0 !important;
105
+ position: relative;
106
+
107
+ &::after {
108
+ content: '';
109
+ position: absolute;
110
+ top: 8px;
111
+ left: 9px;
112
+ width: 16px;
113
+ height: 16px;
114
+ background-color: var(--_sds-alert-icon-color-background);
115
+ z-index: 0;
116
+ clip-path: circle(50%);
117
+ }
118
+ }
119
+
120
+ :host([variant='secondary']):host([data-palette='attention']) {
121
+ --sds-icon-color: var(--sds-alert-icon-color, var(--sds-color-action-default));
122
+
123
+ &::after {
124
+ top: 9px;
125
+ left: 7px;
126
+ width: 20px;
127
+ height: 16px;
128
+ clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
107
129
  }
108
130
  }
109
131
 
@@ -1 +1 @@
1
- {"version":3,"file":"sds-alert.styles.js","sourceRoot":"","sources":["../../src/sds-alert/sds-alert.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsJxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-info-surface-tinted));\n\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, var(--sds-color-alert-info-border-default));\n\t\t--_sds-alert-border-radius: var(--sds-alert-border-radius, var(--sds-radius-sm));\n\t\t--_sds-alert-border-width: var(--sds-alert-border-width, var(--sds-border-sm));\n\n\t\t--_sds-alert-column-gap: var(--sds-alert-column-gap, var(--sds-spacing-2xs));\n\t\t--_sds-alert-content-gap: var(--sds-alert-content-gap, var(--sds-spacing-3xs));\n\n\t\t--_sds-alert-font-family: var(--sds-alert-font-family, var(--sds-typography-font-family-roboto));\n\t\t--_sds-alert-text-color: var(--sds-alert-text-color, var(--sds-color-alert-info-text-default));\n\n\t\t--_sds-alert-font-size: var(--sds-alert-font-size, var(--sds-components-font-size-content-md));\n\t\t--_sds-alert-font-weight: var(--sds-alert-font-weight, var(--sds-typography-body-md-desktop-font-weight));\n\t\t--_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-md));\n\n\t\t--_sds-alert-title-font-size: var(--sds-alert-title-font-size, var(--sds-components-font-size-title-md));\n\t\t--_sds-alert-title-font-weight: var(--sds-alert-title-font-weight, var(--sds-typography-body-lg-strong-tall-desktop-font-weight));\n\t\t--_sds-alert-title-line-height: var(--sds-alert-title-line-height, var(--sds-components-line-height-tall-title-md));\n\n\t\t--_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-info-text-subtle));\n\t\t--_sds-alert-max-line-width: var(--sds-alert-max-line-width, var(--sds-typography-max-line-width));\n\t\t--_sds-alert-padding: var(--sds-alert-padding, var(--sds-spacing-sm));\n\n\t\tdisplay: block;\n\t}\n\n\t.sds-alert {\n\t\tdisplay: flex;\n\t\tgap: var(--_sds-alert-column-gap);\n\t\tpadding: var(--_sds-alert-padding);\n\t\tbackground-color: var(--_sds-alert-background-color);\n\t\tborder: var(--_sds-alert-border-width) solid var(--_sds-alert-border-color);\n\t\tborder-radius: var(--_sds-alert-border-radius);\n\t\tcolor: var(--_sds-alert-text-color);\n\t\tfont-family: var(--_sds-alert-font-family);\n\t\ttext-align: left;\n\t}\n\n\t:host([data-palette='success']) {\n\t\t--_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-success-text-subtle));\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, var(--sds-color-alert-success-border-default));\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-success-surface-tinted));\n\t\t--_sds-alert-text-color: var(--sds-alert-text-color, var(--sds-color-alert-success-text-default));\n\t}\n\n\t:host([data-palette='danger']) {\n\t\t--_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-danger-text-subtle));\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, var(--sds-color-alert-danger-border-default));\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-danger-surface-tinted));\n\t\t--_sds-alert-text-color: var(--sds-alert-text-color, var(--sds-color-alert-danger-text-default));\n\t}\n\n\t:host([data-palette='attention']) {\n\t\t--_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-attention-text-subtle));\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, var(--sds-color-alert-attention-border-default));\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-attention-surface-tinted));\n\t\t--_sds-alert-text-color: var(--sds-alert-text-color, var(--sds-color-alert-attention-text-default));\n\t}\n\n\t:host([data-palette='warning']) {\n\t\t--_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-warning-text-subtle));\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, var(--sds-color-alert-warning-border-default));\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-warning-surface-tinted));\n\t\t--_sds-alert-text-color: var(--sds-alert-text-color, var(--sds-color-alert-warning-text-default));\n\t}\n\n\t.sds-alert__type {\n\t\tcolor: var(--_sds-alert-icon-color);\n\t}\n\n\t.sds-alert__content {\n\t\talign-self: center;\n\t\tdisplay: flex;\n\t\tflex: 1;\n\t\tflex-direction: column;\n\t\tgap: var(--_sds-alert-content-gap);\n\t}\n\n\t.sds-alert__actions {\n\t\t--sds-button-padding-inline: 0;\n\t\t--sds-button-text-color: var(--sds-color-action-default);\n\t}\n\n\t.sds-alert__icon {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tz-index: 1;\n\t}\n\n\t:host([variant='secondary']) {\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, transparent);\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, transparent);\n\n\t\t--_sds-alert-padding: var(--sds-alert-padding, var(--sds-spacing-4xs));\n\t\t--_sds-alert-column-gap: var(--sds-alert-column-gap, var(--sds-spacing-3xs));\n\t\t--_sds-alert-content-gap: var(--sds-alert-content-gap, var(--sds-spacing-4xs));\n\n\t\t--_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-md));\n\t\t--_sds-alert-font-weight: var(--sds-alert-font-weight, var(--sds-typography-body-md-tall-desktop-font-weight));\n\n\t\t::slotted([slot='message']) {\n\t\t\tpadding: 3px 0 !important;\n\t\t}\n\t}\n\n\t:host([variant='secondary']):host([size='sm']) {\n\t\t--_sds-alert-font-size: var(--sds-alert-font-size, var(--sds-components-font-size-content-sm));\n\t\t--_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-sm));\n\t\t--_sds-alert-title-font-size: var(--sds-alert-title-font-size, var(--sds-components-font-size-title-sm));\n\t\t--_sds-alert-title-line-height: var(--sds-alert-title-line-height, var(--sds-components-line-height-tall-title-sm));\n\t}\n\n\t:host([variant='secondary']):host([size='md']) {\n\t\t--_sds-alert-font-size: var(--sds-alert-font-size, var(--sds-components-font-size-content-md));\n\t\t--_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-md));\n\t\t--_sds-alert-title-font-size: var(--sds-alert-title-font-size, var(--sds-components-font-size-title-md));\n\t\t--_sds-alert-title-line-height: var(--sds-alert-title-line-height, var(--sds-components-line-height-tall-title-md));\n\t}\n\n\t:host([variant='secondary']):host([size='lg']) {\n\t\t--_sds-alert-font-size: var(--sds-alert-font-size, var(--sds-components-font-size-content-lg));\n\t\t--_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-lg));\n\t\t--_sds-alert-title-font-size: var(--sds-alert-title-font-size, var(--sds-components-font-size-title-lg));\n\t\t--_sds-alert-title-line-height: var(--sds-alert-title-line-height, var(--sds-components-line-height-tall-title-lg));\n\t}\n\n\t::slotted([slot='title']),\n\t::slotted(:is(h1, h2, h3, h4, h5, h6)) {\n\t\tcolor: var(--_sds-alert-text-color) !important;\n\t\tfont-size: var(--_sds-alert-title-font-size) !important;\n\t\tfont-style: normal !important;\n\t\tfont-weight: var(--_sds-alert-title-font-weight) !important;\n\t\tline-height: var(--_sds-alert-title-line-height) !important;\n\t\tmargin: 0 !important;\n\t\tmax-width: var(--_sds-alert-max-line-width) !important;\n\t}\n\n\t::slotted([slot='message']),\n\t::slotted(:is(p)) {\n\t\tcolor: var(--_sds-alert-text-color) !important;\n\t\tfont-size: var(--_sds-alert-font-size) !important;\n\t\tfont-style: normal !important;\n\t\tfont-weight: var(--_sds-alert-font-weight) !important;\n\t\tline-height: var(--_sds-alert-line-height) !important;\n\t\tmargin: 0 !important;\n\t\tmax-width: var(--_sds-alert-max-line-width) !important;\n\t}\n`;\n"]}
1
+ {"version":3,"file":"sds-alert.styles.js","sourceRoot":"","sources":["../../src/sds-alert/sds-alert.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4KxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-info-surface-tinted));\n\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, var(--sds-color-alert-info-border-default));\n\t\t--_sds-alert-border-radius: var(--sds-alert-border-radius, var(--sds-radius-sm));\n\t\t--_sds-alert-border-width: var(--sds-alert-border-width, var(--sds-border-sm));\n\n\t\t--_sds-alert-column-gap: var(--sds-alert-column-gap, var(--sds-spacing-2xs));\n\t\t--_sds-alert-content-gap: var(--sds-alert-content-gap, var(--sds-spacing-3xs));\n\n\t\t--_sds-alert-font-family: var(--sds-alert-font-family, var(--sds-typography-font-family-roboto));\n\t\t--_sds-alert-text-color: var(--sds-alert-text-color, var(--sds-color-alert-info-text-default));\n\n\t\t--_sds-alert-font-size: var(--sds-alert-font-size, var(--sds-components-font-size-content-md));\n\t\t--_sds-alert-font-weight: var(--sds-alert-font-weight, var(--sds-typography-body-md-desktop-font-weight));\n\t\t--_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-md));\n\n\t\t--_sds-alert-title-font-size: var(--sds-alert-title-font-size, var(--sds-components-font-size-title-md));\n\t\t--_sds-alert-title-font-weight: var(--sds-alert-title-font-weight, var(--sds-typography-body-lg-strong-tall-desktop-font-weight));\n\t\t--_sds-alert-title-line-height: var(--sds-alert-title-line-height, var(--sds-components-line-height-tall-title-md));\n\n\t\t--_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-info-text-subtle));\n\t\t--_sds-alert-icon-color-background: var(--sds-alert-icon-color-background, var(--sds-color-action-contrast-default, white));\n\t\t--_sds-alert-max-line-width: var(--sds-alert-max-line-width, var(--sds-typography-max-line-width));\n\t\t--_sds-alert-padding: var(--sds-alert-padding, var(--sds-spacing-sm));\n\n\t\tdisplay: block;\n\t}\n\n\t.sds-alert {\n\t\tdisplay: flex;\n\t\tgap: var(--_sds-alert-column-gap);\n\t\tpadding: var(--_sds-alert-padding);\n\t\tbackground-color: var(--_sds-alert-background-color);\n\t\tborder: var(--_sds-alert-border-width) solid var(--_sds-alert-border-color);\n\t\tborder-radius: var(--_sds-alert-border-radius);\n\t\tcolor: var(--_sds-alert-text-color);\n\t\tfont-family: var(--_sds-alert-font-family);\n\t\ttext-align: left;\n\t}\n\n\t:host([data-palette='success']) {\n\t\t--_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-success-text-subtle));\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, var(--sds-color-alert-success-border-default));\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-success-surface-tinted));\n\t\t--_sds-alert-text-color: var(--sds-alert-text-color, var(--sds-color-alert-success-text-default));\n\t}\n\n\t:host([data-palette='danger']) {\n\t\t--_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-danger-text-subtle));\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, var(--sds-color-alert-danger-border-default));\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-danger-surface-tinted));\n\t\t--_sds-alert-text-color: var(--sds-alert-text-color, var(--sds-color-alert-danger-text-default));\n\t}\n\n\t:host([data-palette='attention']) {\n\t\t--_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-attention-text-subtle));\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, var(--sds-color-alert-attention-border-default));\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-attention-surface-tinted));\n\t\t--_sds-alert-text-color: var(--sds-alert-text-color, var(--sds-color-alert-attention-text-default));\n\t}\n\n\t:host([data-palette='warning']) {\n\t\t--_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-warning-text-subtle));\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, var(--sds-color-alert-warning-border-default));\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-warning-surface-tinted));\n\t\t--_sds-alert-text-color: var(--sds-alert-text-color, var(--sds-color-alert-warning-text-default));\n\t}\n\n\t.sds-alert__type {\n\t\tcolor: var(--_sds-alert-icon-color);\n\t}\n\n\t.sds-alert__content {\n\t\talign-self: center;\n\t\tdisplay: flex;\n\t\tflex: 1;\n\t\tflex-direction: column;\n\t}\n\n\t.sds-alert__actions {\n\t\t--sds-button-padding-inline: 0;\n\t\t--sds-button-text-color: var(--sds-color-action-default);\n\t}\n\n\t.sds-alert__icon {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tz-index: 1;\n\t}\n\n\t:host([variant='secondary']) {\n\t\t--_sds-alert-background-color: var(--sds-alert-background-color, transparent);\n\t\t--_sds-alert-border-color: var(--sds-alert-border-color, transparent);\n\n\t\t--_sds-alert-padding: var(--sds-alert-padding, var(--sds-spacing-4xs));\n\t\t--_sds-alert-column-gap: var(--sds-alert-column-gap, var(--sds-spacing-3xs));\n\t\t--_sds-alert-content-gap: var(--sds-alert-content-gap, var(--sds-spacing-4xs));\n\n\t\t--_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-md));\n\t\t--_sds-alert-font-weight: var(--sds-alert-font-weight, var(--sds-typography-body-md-tall-desktop-font-weight));\n\n\t\tposition: relative;\n\n\t\t&::after {\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: 8px;\n\t\t\tleft: 9px;\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tbackground-color: var(--_sds-alert-icon-color-background);\n\t\t\tz-index: 0;\n\t\t\tclip-path: circle(50%);\n\t\t}\n\t}\n\n\t:host([variant='secondary']):host([data-palette='attention']) {\n\t\t--sds-icon-color: var(--sds-alert-icon-color, var(--sds-color-action-default));\n\n\t\t&::after {\n\t\t\ttop: 9px;\n\t\t\tleft: 7px;\n\t\t\twidth: 20px;\n\t\t\theight: 16px;\n\t\t\tclip-path: polygon(50% 0%, 0% 100%, 100% 100%);\n\t\t}\n\t}\n\n\t:host([variant='secondary']):host([size='sm']) {\n\t\t--_sds-alert-font-size: var(--sds-alert-font-size, var(--sds-components-font-size-content-sm));\n\t\t--_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-sm));\n\t\t--_sds-alert-title-font-size: var(--sds-alert-title-font-size, var(--sds-components-font-size-title-sm));\n\t\t--_sds-alert-title-line-height: var(--sds-alert-title-line-height, var(--sds-components-line-height-tall-title-sm));\n\t}\n\n\t:host([variant='secondary']):host([size='md']) {\n\t\t--_sds-alert-font-size: var(--sds-alert-font-size, var(--sds-components-font-size-content-md));\n\t\t--_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-md));\n\t\t--_sds-alert-title-font-size: var(--sds-alert-title-font-size, var(--sds-components-font-size-title-md));\n\t\t--_sds-alert-title-line-height: var(--sds-alert-title-line-height, var(--sds-components-line-height-tall-title-md));\n\t}\n\n\t:host([variant='secondary']):host([size='lg']) {\n\t\t--_sds-alert-font-size: var(--sds-alert-font-size, var(--sds-components-font-size-content-lg));\n\t\t--_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-lg));\n\t\t--_sds-alert-title-font-size: var(--sds-alert-title-font-size, var(--sds-components-font-size-title-lg));\n\t\t--_sds-alert-title-line-height: var(--sds-alert-title-line-height, var(--sds-components-line-height-tall-title-lg));\n\t}\n\n\t::slotted([slot='title']),\n\t::slotted(:is(h1, h2, h3, h4, h5, h6)) {\n\t\tcolor: var(--_sds-alert-text-color) !important;\n\t\tfont-size: var(--_sds-alert-title-font-size) !important;\n\t\tfont-style: normal !important;\n\t\tfont-weight: var(--_sds-alert-title-font-weight) !important;\n\t\tline-height: var(--_sds-alert-title-line-height) !important;\n\t\tmargin: 0 !important;\n\t\tmax-width: var(--_sds-alert-max-line-width) !important;\n\t}\n\n\t::slotted([slot='message']),\n\t::slotted(:is(p)) {\n\t\tcolor: var(--_sds-alert-text-color) !important;\n\t\tfont-size: var(--_sds-alert-font-size) !important;\n\t\tfont-style: normal !important;\n\t\tfont-weight: var(--_sds-alert-font-weight) !important;\n\t\tline-height: var(--_sds-alert-line-height) !important;\n\t\tmargin: 0 !important;\n\t\tmax-width: var(--_sds-alert-max-line-width) !important;\n\t}\n`;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sds-button.styles.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA+IlB,CAAC"}
1
+ {"version":3,"file":"sds-button.styles.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA2JlB,CAAC"}
@@ -88,7 +88,7 @@ export const styles = css `
88
88
  }
89
89
 
90
90
  .sds-button:active {
91
- --_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-hover)));
91
+ --_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));
92
92
  }
93
93
  }
94
94
 
@@ -115,6 +115,18 @@ export const styles = css `
115
115
  }
116
116
  }
117
117
 
118
+ :host([variant='tertiary']):host([icon]) {
119
+ .sds-button:hover {
120
+ --_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-main-surface-hover)));
121
+ --_sds-button-border-color: var(--sds-button-border-color, transparent);
122
+ }
123
+
124
+ .sds-button:active {
125
+ --_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));
126
+ --_sds-button-border-color: var(--sds-button-border-color, transparent);
127
+ }
128
+ }
129
+
118
130
  :host([size='medium']), /* Deprecated */
119
131
  :host([size='md']) {
120
132
  --_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-md));
@@ -1 +1 @@
1
- {"version":3,"file":"sds-button.styles.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+IxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-border-width: var(--sds-button-border-width, var(--sds-border-md));\n\t\t--_sds-button-disabled-opacity: var(--sds-button-disabled-opacity, var(--sds-color-states-disabled-opacity));\n\t\t--_sds-button-focus-color: var(--sds-button-focus-color, var(--sds-color-states-focus-outer));\n\t\t--_sds-button-focus-inner-color: var(--sds-button-focus-inner-color, var(--sds-color-states-focus-inner));\n\t\t--_sds-button-focus-spacing: var(--sds-button-focus-spacing, var(--sds-color-states-focus-spacing));\n\t\t--_sds-button-font-family: var(--sds-button-font, var(--sds-typography-font-family-roboto));\n\t\t--_sds-button-font-size: var(--sds-button-font-size, var(--sds-typography-body-md-desktop-font-size));\n\t\t--_sds-button-font-weight: var(--sds-button-font-weight, var(--sds-typography-body-md-strong-desktop-font-weight));\n\t\t--_sds-button-gap: var(--sds-button-gap, var(--sds-spacing-3xs));\n\t\t--_sds-button-line-height: var(--sds-button-line-height, var(--sds-typography-body-md-desktop-line-height));\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-lg));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, 0);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-xs));\n\t\t--_sds-button-radius: var(--sds-button-radius, var(--sds-radius-sm));\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-main-action-contrast-default)));\n\n\t\t--_sds-button-tertiary-text-decoration: var(--sds-typography-link-text-decoration, underline);\n\t\t--_sds-button-tertiary-text-underline-offset: var(--sds-typography-link-text-underline-offset, 4px);\n\t\t--_sds-button-tertiary-text-underline-thickness: 2px;\n\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\n\t\t::slotted(sds-icon) {\n\t\t\t--sds-icon-color: var(--_sds-button-text-color);\n\t\t}\n\t}\n\n\t.sds-button {\n\t\talign-items: center;\n\t\tbackground-color: var(--_sds-button-background-color);\n\t\tborder-radius: var(--_sds-button-radius);\n\t\tborder: var(--_sds-button-border-width) solid var(--_sds-button-border-color);\n\t\tcolor: var(--_sds-button-text-color);\n\t\tcursor: pointer;\n\t\tdisplay: inline-flex;\n\t\tfont-family: var(--_sds-button-font-family);\n\t\tfont-size: var(--_sds-button-font-size);\n\t\tfont-weight: var(--_sds-button-font-weight);\n\t\tgap: var(--_sds-button-gap);\n\t\tinline-size: 100%;\n\t\tjustify-content: center;\n\t\tline-height: var(--_sds-button-line-height);\n\t\tmin-height: var(--_sds-button-min-height);\n\t\tpadding: var(--_sds-button-padding-block) var(--_sds-button-padding-inline);\n\t\ttext-align: center;\n\n\t\t&:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\tbox-shadow: 0 0 0 var(--sds-color-states-focus-spacing) var(--_sds-button-focus-inner-color);\n\t\t\toutline: 3px solid var(--_sds-button-focus-color);\n\t\t\toutline-offset: 3px;\n\t\t}\n\n\t\t&:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t}\n\n\t\t&:disabled {\n\t\t\topacity: var(--_sds-button-disabled-opacity);\n\t\t\tcursor: not-allowed;\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n\n\t.sds-button--as-link {\n\t\tinline-size: auto;\n\t\ttext-decoration: none;\n\t}\n\n\t:host([variant='secondary']) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-main-surface-hover)));\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-hover)));\n\t\t}\n\t}\n\n\t:host([variant='tertiary']) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\n\t\t\ttext-decoration: var(--_sds-button-tertiary-text-decoration);\n\t\t\ttext-decoration-thickness: var(--_sds-button-tertiary-text-underline-thickness);\n\t\t\ttext-underline-offset: var(--_sds-button-tertiary-text-underline-offset);\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t}\n\t}\n\n\t:host([size='medium']), /* Deprecated */\n\t:host([size='md']) {\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-md));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, var(--sds-spacing-4xs));\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-3xs));\n\n\t\t&:host([variant='tertiary']) {\n\t\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t}\n\t}\n\n\t:host([size='small']), /* Deprecated */\n\t:host([size='sm']) {\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-sm));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, 0);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-3xs));\n\t\tfont-size: 0.875rem;\n\n\t\t&:host([variant='tertiary']) {\n\t\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t}\n\t}\n\n\t:host([icon]) {\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\tmin-width: var(--_sds-button-min-height);\n\t}\n`;\n"]}
1
+ {"version":3,"file":"sds-button.styles.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2JxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-border-width: var(--sds-button-border-width, var(--sds-border-md));\n\t\t--_sds-button-disabled-opacity: var(--sds-button-disabled-opacity, var(--sds-color-states-disabled-opacity));\n\t\t--_sds-button-focus-color: var(--sds-button-focus-color, var(--sds-color-states-focus-outer));\n\t\t--_sds-button-focus-inner-color: var(--sds-button-focus-inner-color, var(--sds-color-states-focus-inner));\n\t\t--_sds-button-focus-spacing: var(--sds-button-focus-spacing, var(--sds-color-states-focus-spacing));\n\t\t--_sds-button-font-family: var(--sds-button-font, var(--sds-typography-font-family-roboto));\n\t\t--_sds-button-font-size: var(--sds-button-font-size, var(--sds-typography-body-md-desktop-font-size));\n\t\t--_sds-button-font-weight: var(--sds-button-font-weight, var(--sds-typography-body-md-strong-desktop-font-weight));\n\t\t--_sds-button-gap: var(--sds-button-gap, var(--sds-spacing-3xs));\n\t\t--_sds-button-line-height: var(--sds-button-line-height, var(--sds-typography-body-md-desktop-line-height));\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-lg));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, 0);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-xs));\n\t\t--_sds-button-radius: var(--sds-button-radius, var(--sds-radius-sm));\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-main-action-contrast-default)));\n\n\t\t--_sds-button-tertiary-text-decoration: var(--sds-typography-link-text-decoration, underline);\n\t\t--_sds-button-tertiary-text-underline-offset: var(--sds-typography-link-text-underline-offset, 4px);\n\t\t--_sds-button-tertiary-text-underline-thickness: 2px;\n\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\n\t\t::slotted(sds-icon) {\n\t\t\t--sds-icon-color: var(--_sds-button-text-color);\n\t\t}\n\t}\n\n\t.sds-button {\n\t\talign-items: center;\n\t\tbackground-color: var(--_sds-button-background-color);\n\t\tborder-radius: var(--_sds-button-radius);\n\t\tborder: var(--_sds-button-border-width) solid var(--_sds-button-border-color);\n\t\tcolor: var(--_sds-button-text-color);\n\t\tcursor: pointer;\n\t\tdisplay: inline-flex;\n\t\tfont-family: var(--_sds-button-font-family);\n\t\tfont-size: var(--_sds-button-font-size);\n\t\tfont-weight: var(--_sds-button-font-weight);\n\t\tgap: var(--_sds-button-gap);\n\t\tinline-size: 100%;\n\t\tjustify-content: center;\n\t\tline-height: var(--_sds-button-line-height);\n\t\tmin-height: var(--_sds-button-min-height);\n\t\tpadding: var(--_sds-button-padding-block) var(--_sds-button-padding-inline);\n\t\ttext-align: center;\n\n\t\t&:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\tbox-shadow: 0 0 0 var(--sds-color-states-focus-spacing) var(--_sds-button-focus-inner-color);\n\t\t\toutline: 3px solid var(--_sds-button-focus-color);\n\t\t\toutline-offset: 3px;\n\t\t}\n\n\t\t&:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t}\n\n\t\t&:disabled {\n\t\t\topacity: var(--_sds-button-disabled-opacity);\n\t\t\tcursor: not-allowed;\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n\n\t.sds-button--as-link {\n\t\tinline-size: auto;\n\t\ttext-decoration: none;\n\t}\n\n\t:host([variant='secondary']) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-main-surface-hover)));\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));\n\t\t}\n\t}\n\n\t:host([variant='tertiary']) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\n\t\t\ttext-decoration: var(--_sds-button-tertiary-text-decoration);\n\t\t\ttext-decoration-thickness: var(--_sds-button-tertiary-text-underline-thickness);\n\t\t\ttext-underline-offset: var(--_sds-button-tertiary-text-underline-offset);\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t}\n\t}\n\n\t:host([variant='tertiary']):host([icon]) {\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-main-surface-hover)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t}\n\t}\n\n\t:host([size='medium']), /* Deprecated */\n\t:host([size='md']) {\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-md));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, var(--sds-spacing-4xs));\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-3xs));\n\n\t\t&:host([variant='tertiary']) {\n\t\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t}\n\t}\n\n\t:host([size='small']), /* Deprecated */\n\t:host([size='sm']) {\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-sm));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, 0);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-3xs));\n\t\tfont-size: 0.875rem;\n\n\t\t&:host([variant='tertiary']) {\n\t\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t}\n\t}\n\n\t:host([icon]) {\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\tmin-width: var(--_sds-button-min-height);\n\t}\n`;\n"]}
@@ -13,33 +13,46 @@ export interface SDSRadioProps {
13
13
  readonly?: boolean;
14
14
  size?: RadioSize;
15
15
  'help-text'?: string;
16
+ parentRequestDisabled?: boolean;
16
17
  }
17
18
  export declare class SDSRadio extends LitElement {
18
19
  static styles: import("lit").CSSResult[];
19
20
  static formAssociated: boolean;
20
21
  readonly internals: ElementInternals;
21
- disabled: SDSRadioProps['disabled'];
22
- required: SDSRadioProps['disabled'];
22
+ required: SDSRadioProps['required'];
23
23
  label: SDSRadioProps['label'];
24
24
  hideLabel: SDSRadioProps['hide-label'];
25
25
  name?: SDSRadioProps['name'];
26
26
  value: SDSRadioProps['value'];
27
- checked: SDSRadioProps['disabled'];
27
+ checked: SDSRadioProps['checked'];
28
28
  error: SDSRadioProps['error'];
29
29
  readOnly: SDSRadioProps['readonly'];
30
30
  size: SDSRadioProps['size'];
31
31
  helpText?: SDSRadioProps['help-text'];
32
+ get disabled(): SDSRadioProps['disabled'];
33
+ set disabled(value: SDSRadioProps['disabled']);
34
+ /**
35
+ * parentRequestDisabled:
36
+ * - Set by SDSRadioGroup to request disabled/enabled.
37
+ * - Only applied if SDSRadio is NOT self-controlled.
38
+ */
39
+ get parentRequestDisabled(): SDSRadioProps['parentRequestDisabled'];
40
+ set parentRequestDisabled(value: SDSRadioProps['parentRequestDisabled']);
32
41
  control: HTMLInputElement;
42
+ private _disabled;
43
+ private _disabledIsAuthorControlled;
44
+ private _settingDisabledFromParent;
45
+ private _parentRequestDisabled;
33
46
  private _initialChecked;
34
47
  constructor();
35
48
  connectedCallback(): void;
36
49
  disconnectedCallback(): void;
37
50
  firstUpdated(_changedProperties: PropertyValues): void;
51
+ updated(changedProperties: Map<string | number | symbol, unknown>): void;
38
52
  private _getGroupRadios;
39
53
  private _updateGroupValidation;
40
54
  private readonly _handleKeydown;
41
55
  formResetCallback(): void;
42
- updated(changedProperties: Map<string | number | symbol, unknown>): void;
43
56
  private _uncheckSiblings;
44
57
  private readonly _handleChange;
45
58
  private readonly _handleFocus;
@@ -1 +1 @@
1
- {"version":3,"file":"sds-radio.d.ts","sourceRoot":"","sources":["../../src/sds-radio/sds-radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAC;AAMhE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,KAAK,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AAExD,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;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O,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;IAwB1E,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,QAAQ,CAAC,cAAc,CA4B7B;IAEF,iBAAiB;IAOjB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAc5B;IAEF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAG3B;IAEF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAG1B;IAEF,IAAI,IAAI,2BAEP;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,QAAQ,kBAEX;IAED,IAAI,iBAAiB,WAEpB;IAED,IAAI,YAAY,YAEf;IAED,aAAa,IAAI,OAAO;IAIxB,cAAc,IAAI,OAAO;IAIzB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIxC,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAQpC,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,KAAK,IAAI,IAAI;IAIb,MAAM;CAkCf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD"}
@@ -11,9 +11,43 @@ import { classMap } from 'lit/directives/class-map.js';
11
11
  import { guardedCustomElement } from '../utils/guarded-custom-element';
12
12
  import { styles } from './sds-radio.styles';
13
13
  let SDSRadio = class SDSRadio extends LitElement {
14
+ get disabled() {
15
+ return this._disabled;
16
+ }
17
+ set disabled(value) {
18
+ const newVal = value ?? false;
19
+ const oldVal = this._disabled;
20
+ if (oldVal === newVal)
21
+ return;
22
+ this._disabled = newVal;
23
+ this.requestUpdate('disabled', oldVal);
24
+ if (!this._settingDisabledFromParent) {
25
+ this._disabledIsAuthorControlled = newVal;
26
+ }
27
+ }
28
+ /**
29
+ * parentRequestDisabled:
30
+ * - Set by SDSRadioGroup to request disabled/enabled.
31
+ * - Only applied if SDSRadio is NOT self-controlled.
32
+ */
33
+ get parentRequestDisabled() {
34
+ return this._parentRequestDisabled;
35
+ }
36
+ set parentRequestDisabled(value) {
37
+ const newVal = value ?? false;
38
+ const oldVal = this._parentRequestDisabled;
39
+ if (oldVal === newVal)
40
+ return;
41
+ this._parentRequestDisabled = newVal;
42
+ this.requestUpdate('parentRequestDisabled', oldVal);
43
+ if (this._disabledIsAuthorControlled)
44
+ return;
45
+ this._settingDisabledFromParent = true;
46
+ this.disabled = newVal;
47
+ this._settingDisabledFromParent = false;
48
+ }
14
49
  constructor() {
15
50
  super();
16
- this.disabled = false;
17
51
  this.required = false;
18
52
  this.label = '';
19
53
  this.hideLabel = false;
@@ -22,6 +56,10 @@ let SDSRadio = class SDSRadio extends LitElement {
22
56
  this.error = false;
23
57
  this.readOnly = false;
24
58
  this.size = 'md';
59
+ this._disabled = false;
60
+ this._disabledIsAuthorControlled = false;
61
+ this._settingDisabledFromParent = false;
62
+ this._parentRequestDisabled = false;
25
63
  this._initialChecked = false;
26
64
  this._handleKeydown = (event) => {
27
65
  if (!this.name || this.disabled || this.readOnly)
@@ -90,6 +128,27 @@ let SDSRadio = class SDSRadio extends LitElement {
90
128
  super.firstUpdated(_changedProperties);
91
129
  this._updateGroupValidation();
92
130
  }
131
+ updated(changedProperties) {
132
+ super.updated(changedProperties);
133
+ if (changedProperties.has('checked')) {
134
+ if (this.checked) {
135
+ this._uncheckSiblings();
136
+ this.internals.setFormValue(this.value ?? null);
137
+ }
138
+ else {
139
+ this.internals.setFormValue(null);
140
+ }
141
+ this._updateGroupValidation();
142
+ }
143
+ if (changedProperties.has('required') && this.control) {
144
+ this.control.required = this.required ?? false;
145
+ }
146
+ if (!this._disabledIsAuthorControlled && this.disabled !== this._parentRequestDisabled) {
147
+ this._settingDisabledFromParent = true;
148
+ this.disabled = this._parentRequestDisabled ?? false;
149
+ this._settingDisabledFromParent = false;
150
+ }
151
+ }
93
152
  _getGroupRadios() {
94
153
  if (!this.name)
95
154
  return [this];
@@ -118,22 +177,6 @@ let SDSRadio = class SDSRadio extends LitElement {
118
177
  this.internals.setFormValue(this.checked ? this.value ?? 'on' : null);
119
178
  this._updateGroupValidation();
120
179
  }
121
- updated(changedProperties) {
122
- super.updated(changedProperties);
123
- if (changedProperties.has('checked')) {
124
- if (this.checked) {
125
- this._uncheckSiblings();
126
- this.internals.setFormValue(this.value ?? null);
127
- }
128
- else {
129
- this.internals.setFormValue(null);
130
- }
131
- this._updateGroupValidation();
132
- }
133
- if (changedProperties.has('required') && this.control) {
134
- this.control.required = this.required ?? false;
135
- }
136
- }
137
180
  _uncheckSiblings() {
138
181
  if (!this.name)
139
182
  return;
@@ -170,7 +213,9 @@ let SDSRadio = class SDSRadio extends LitElement {
170
213
  this.internals.setValidity({ customError: !!message }, message);
171
214
  }
172
215
  formDisabledCallback(disabled) {
216
+ this._settingDisabledFromParent = true;
173
217
  this.disabled = disabled;
218
+ this._settingDisabledFromParent = false;
174
219
  if (this.control)
175
220
  this.control.disabled = disabled;
176
221
  }
@@ -204,7 +249,8 @@ let SDSRadio = class SDSRadio extends LitElement {
204
249
  value="${ifDefined(this.value)}"
205
250
  ?checked="${this.checked ?? false}"
206
251
  .checked="${this.checked ?? false}"
207
- ?disabled="${this.disabled}"
252
+ ?disabled="${this.disabled ?? false}"
253
+ .disabled="${this.disabled ?? false}"
208
254
  ?required="${this.required}"
209
255
  ?readonly="${this.readOnly}"
210
256
  @change="${this._handleChange}"
@@ -221,9 +267,6 @@ let SDSRadio = class SDSRadio extends LitElement {
221
267
  // Styling
222
268
  SDSRadio.styles = [styles];
223
269
  SDSRadio.formAssociated = true;
224
- __decorate([
225
- property({ type: Boolean, reflect: true })
226
- ], SDSRadio.prototype, "disabled", void 0);
227
270
  __decorate([
228
271
  property({ type: Boolean, reflect: true })
229
272
  ], SDSRadio.prototype, "required", void 0);
@@ -254,6 +297,18 @@ __decorate([
254
297
  __decorate([
255
298
  property({ type: String, attribute: 'help-text' })
256
299
  ], SDSRadio.prototype, "helpText", void 0);
300
+ __decorate([
301
+ property({ type: Boolean, reflect: true })
302
+ /**
303
+ * disabled:
304
+ * - If set directly (prop/attr), this radio becomes "self-controlled"
305
+ * and ignores parentRequestDisabled.
306
+ * - If not self-controlled, this follows parentRequestDisabled (group/form).
307
+ */
308
+ ], SDSRadio.prototype, "disabled", null);
309
+ __decorate([
310
+ property({ type: Boolean, attribute: false })
311
+ ], SDSRadio.prototype, "parentRequestDisabled", null);
257
312
  __decorate([
258
313
  query('#control')
259
314
  ], SDSRadio.prototype, "control", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"sds-radio.js","sourceRoot":"","sources":["../../src/sds-radio/sds-radio.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAoBrC,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAuBvC;QACC,KAAK,EAAE,CAAC;QAjBmC,aAAQ,GAA8B,KAAK,CAAC;QAC5C,aAAQ,GAA8B,KAAK,CAAC;QAC7C,UAAK,GAA2B,EAAE,CAAC;QACT,cAAS,GAAgC,KAAK,CAAC;QAExF,UAAK,GAA2B,IAAI,CAAC;QACrB,YAAO,GAA8B,KAAK,CAAC;QAC3C,UAAK,GAA2B,KAAK,CAAC;QACf,aAAQ,GAA8B,KAAK,CAAC;QACpE,SAAI,GAA0B,IAAI,CAAC;QAKtE,oBAAe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CAA6C;AACpE;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAAoC;AAC1B;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;0CAAuC;AAEvE;IAAlB,KAAK,CAAC,UAAU,CAAC;yCAA4B;AAnBlC,QAAQ;IADpB,oBAAoB,CAAC,WAAW,CAAC;GACrB,QAAQ,CAmPpB","sourcesContent":["import { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { styles } from './sds-radio.styles';\nimport { SDS_SIZES } from '../types';\n\ntype RadioSize = Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\n\nexport interface SDSRadioProps {\n\tdisabled?: boolean;\n\trequired?: boolean;\n\tlabel?: string;\n\t'hide-label'?: boolean;\n\tname?: string;\n\tvalue?: string;\n\tchecked?: boolean;\n\terror?: boolean;\n\treadonly?: boolean;\n\tsize?: RadioSize;\n\t'help-text'?: string;\n}\n\n@guardedCustomElement('sds-radio')\nexport class SDSRadio extends LitElement {\n\t// Styling\n\tstatic override styles = [styles];\n\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\t@property({ type: Boolean, reflect: true }) disabled: SDSRadioProps['disabled'] = false;\n\t@property({ type: Boolean, reflect: true }) required: SDSRadioProps['disabled'] = false;\n\t@property({ type: String, reflect: true }) label: SDSRadioProps['label'] = '';\n\t@property({ type: Boolean, reflect: true, attribute: 'hide-label' }) hideLabel: SDSRadioProps['hide-label'] = false;\n\t@property({ type: String, reflect: true }) name?: SDSRadioProps['name'];\n\t@property({ type: String }) value: SDSRadioProps['value'] = 'on';\n\t@property({ type: Boolean, reflect: true }) checked: SDSRadioProps['disabled'] = false;\n\t@property({ type: Boolean, reflect: true }) error: SDSRadioProps['error'] = false;\n\t@property({ type: Boolean, attribute: 'readonly', reflect: true }) readOnly: SDSRadioProps['readonly'] = false;\n\t@property({ type: String, reflect: true }) size: SDSRadioProps['size'] = 'md';\n\t@property({ type: String, attribute: 'help-text' }) helpText?: SDSRadioProps['help-text'];\n\n\t@query('#control') control!: HTMLInputElement;\n\n\tprivate _initialChecked: boolean = 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\toverride connectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.internals.role = 'radio';\n\t\tif (!this._initialChecked) {\n\t\t\tthis._initialChecked = this.checked ?? false;\n\t\t}\n\t\tthis.addEventListener('keydown', this._handleKeydown);\n\t}\n\n\toverride disconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.removeEventListener('keydown', this._handleKeydown);\n\t}\n\n\toverride firstUpdated(_changedProperties: PropertyValues): void {\n\t\tsuper.firstUpdated(_changedProperties);\n\t\tthis._updateGroupValidation();\n\t}\n\n\tprivate _getGroupRadios(): SDSRadio[] {\n\t\tif (!this.name) return [this];\n\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\tconst radioGroup = Array.from(root.querySelectorAll<SDSRadio>(`sds-radio[name=\"${this.name}\"]`));\n\t\treturn radioGroup;\n\t}\n\n\tprivate _updateGroupValidation() {\n\t\tconst group: Array<SDSRadio> = this._getGroupRadios();\n\t\tconst isAnyChecked = group.some((radio) => radio.checked);\n\t\tconst isAnyRequired = group.some((radio) => radio.required);\n\t\tgroup.forEach((radio) => {\n\t\t\tif (!radio.control) return;\n\t\t\tif (isAnyRequired) {\n\t\t\t\tradio.internals.setValidity(isAnyChecked ? {} : { valueMissing: true }, isAnyChecked ? '' : radio.control.validationMessage, radio.control);\n\t\t\t} else {\n\t\t\t\tradio.internals.setValidity({});\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate readonly _handleKeydown = (event: KeyboardEvent) => {\n\t\tif (!this.name || this.disabled || this.readOnly) return;\n\n\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\tconst radios = Array.from(root.querySelectorAll<SDSRadio>(`sds-radio[name=\"${this.name}\"]`));\n\t\tconst currentIndex = radios.indexOf(this);\n\n\t\tif (currentIndex === -1) return;\n\n\t\tlet targetIndex: number | null = null;\n\n\t\tswitch (event.key) {\n\t\t\tcase 'ArrowUp':\n\t\t\tcase 'ArrowLeft':\n\t\t\t\ttargetIndex = currentIndex > 0 ? currentIndex - 1 : radios.length - 1;\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowDown':\n\t\t\tcase 'ArrowRight':\n\t\t\t\ttargetIndex = currentIndex < radios.length - 1 ? currentIndex + 1 : 0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\tconst targetRadio = radios[targetIndex];\n\t\ttargetRadio?.focus();\n\t\ttargetRadio?.click();\n\t\tevent.preventDefault();\n\t};\n\n\tformResetCallback() {\n\t\tthis.checked = this._initialChecked;\n\t\tthis.control.checked = this._initialChecked;\n\t\tthis.internals.setFormValue(this.checked ? this.value ?? 'on' : null);\n\t\tthis._updateGroupValidation();\n\t}\n\n\toverride updated(changedProperties: Map<string | number | symbol, unknown>) {\n\t\tsuper.updated(changedProperties);\n\t\tif (changedProperties.has('checked')) {\n\t\t\tif (this.checked) {\n\t\t\t\tthis._uncheckSiblings();\n\t\t\t\tthis.internals.setFormValue(this.value ?? null);\n\t\t\t} else {\n\t\t\t\tthis.internals.setFormValue(null);\n\t\t\t}\n\t\t\tthis._updateGroupValidation();\n\t\t}\n\n\t\tif (changedProperties.has('required') && this.control) {\n\t\t\tthis.control.required = this.required ?? false;\n\t\t}\n\t}\n\n\tprivate _uncheckSiblings() {\n\t\tif (!this.name) return;\n\t\tconst radios: Array<SDSRadio> = this._getGroupRadios();\n\n\t\tfor (const radio of radios) {\n\t\t\tif (radio !== this && radio.checked) {\n\t\t\t\tradio.checked = false;\n\t\t\t\tradio.internals.setFormValue(null);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate readonly _handleChange = (event: Event) => {\n\t\tif (this.disabled || this.readOnly) {\n\t\t\t(event.target as HTMLInputElement).checked = this.checked ?? false;\n\t\t\tevent.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tconst elem = event.target as HTMLInputElement;\n\t\tthis.checked = elem.checked;\n\t\tif (this.checked) {\n\t\t\tthis._uncheckSiblings();\n\t\t}\n\t\tthis._updateGroupValidation();\n\t\tthis.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));\n\t};\n\n\tprivate readonly _handleFocus = (event: Event) => {\n\t\tevent.stopImmediatePropagation();\n\t\tthis.dispatchEvent(new CustomEvent('focus', { bubbles: true, composed: true }));\n\t};\n\n\tprivate readonly _handleBlur = (event: Event) => {\n\t\tevent.stopImmediatePropagation();\n\t\tthis.dispatchEvent(new CustomEvent('blur', { bubbles: true, composed: true }));\n\t};\n\n\tget form() {\n\t\treturn this.internals.form;\n\t}\n\n\tget type(): string {\n\t\treturn 'radio';\n\t}\n\n\tget validity() {\n\t\treturn this.internals.validity;\n\t}\n\n\tget validationMessage() {\n\t\treturn this.internals.validationMessage;\n\t}\n\n\tget willValidate() {\n\t\treturn this.internals.willValidate;\n\t}\n\n\tcheckValidity(): boolean {\n\t\treturn this.internals.checkValidity();\n\t}\n\n\treportValidity(): boolean {\n\t\treturn this.internals.reportValidity();\n\t}\n\n\tsetCustomValidity(message: string): void {\n\t\tthis.internals.setValidity({ customError: !!message }, message);\n\t}\n\n\tformDisabledCallback(disabled: boolean): void {\n\t\tthis.disabled = disabled;\n\t\tif (this.control) this.control.disabled = disabled;\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.readOnly) this.shadowRoot?.querySelector('input')?.click();\n\t}\n\n\toverride render() {\n\t\tconst radioClasses = {\n\t\t\t'sds-radio': true,\n\t\t\t'sds-radio--error': Boolean(this.error),\n\t\t};\n\n\t\tconst inputClasses = {\n\t\t\t'sds-radio__input': true,\n\t\t\t'sds-radio__input--error': Boolean(this.error),\n\t\t};\n\n\t\treturn html`\n\t\t\t<div class=\"${classMap(radioClasses)}\">\n\t\t\t\t<input\n\t\t\t\t\tid=\"control\"\n\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t\t?checked=\"${this.checked ?? false}\"\n\t\t\t\t\t.checked=\"${this.checked ?? false}\"\n\t\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t\t?required=\"${this.required}\"\n\t\t\t\t\t?readonly=\"${this.readOnly}\"\n\t\t\t\t\t@change=\"${this._handleChange}\"\n\t\t\t\t\t@focus=\"${this._handleFocus}\"\n\t\t\t\t\t@blur=\"${this._handleBlur}\"\n\t\t\t\t\tclass=\"${classMap(inputClasses)}\"\n\t\t\t\t/>\n\t\t\t\t${this.label ? html`<label class=\"sds-radio__label\" for=\"control\">${this.label}</label>` : nothing}\n\t\t\t\t${this.helpText ? html`<span class=\"sds-radio__help-text\">${this.helpText}</span>` : nothing}\n\t\t\t</div>\n\t\t`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-radio': SDSRadio;\n\t}\n}\n"]}
1
+ {"version":3,"file":"sds-radio.js","sourceRoot":"","sources":["../../src/sds-radio/sds-radio.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,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B;AAnElC,QAAQ;IADpB,oBAAoB,CAAC,WAAW,CAAC;GACrB,QAAQ,CAkTpB","sourcesContent":["import { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { styles } from './sds-radio.styles';\nimport { SDS_SIZES } from '../types';\n\ntype RadioSize = Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\n\nexport interface SDSRadioProps {\n\tdisabled?: boolean;\n\trequired?: boolean;\n\tlabel?: string;\n\t'hide-label'?: boolean;\n\tname?: string;\n\tvalue?: string;\n\tchecked?: boolean;\n\terror?: boolean;\n\treadonly?: boolean;\n\tsize?: RadioSize;\n\t'help-text'?: string;\n\tparentRequestDisabled?: boolean;\n}\n\n@guardedCustomElement('sds-radio')\nexport class SDSRadio extends LitElement {\n\t// Styling\n\tstatic override styles = [styles];\n\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\t@property({ type: Boolean, reflect: true }) required: SDSRadioProps['required'] = false;\n\t@property({ type: String, reflect: true }) label: SDSRadioProps['label'] = '';\n\t@property({ type: Boolean, reflect: true, attribute: 'hide-label' }) hideLabel: SDSRadioProps['hide-label'] = false;\n\t@property({ type: String, reflect: true }) name?: SDSRadioProps['name'];\n\t@property({ type: String }) value: SDSRadioProps['value'] = 'on';\n\t@property({ type: Boolean, reflect: true }) checked: SDSRadioProps['checked'] = false;\n\t@property({ type: Boolean, reflect: true }) error: SDSRadioProps['error'] = false;\n\t@property({ type: Boolean, attribute: 'readonly', reflect: true }) readOnly: SDSRadioProps['readonly'] = false;\n\t@property({ type: String, reflect: true }) size: SDSRadioProps['size'] = 'md';\n\t@property({ type: String, attribute: 'help-text' }) helpText?: SDSRadioProps['help-text'];\n\t@property({ type: Boolean, reflect: true })\n\n\t/**\n\t * disabled:\n\t * - If set directly (prop/attr), this radio becomes \"self-controlled\"\n\t * and ignores parentRequestDisabled.\n\t * - If not self-controlled, this follows parentRequestDisabled (group/form).\n\t */\n\tget disabled(): SDSRadioProps['disabled'] {\n\t\treturn this._disabled;\n\t}\n\tset disabled(value: SDSRadioProps['disabled']) {\n\t\tconst newVal = value ?? false;\n\t\tconst oldVal = this._disabled;\n\n\t\tif (oldVal === newVal) return;\n\n\t\tthis._disabled = newVal;\n\t\tthis.requestUpdate('disabled', oldVal);\n\n\t\tif (!this._settingDisabledFromParent) {\n\t\t\tthis._disabledIsAuthorControlled = newVal;\n\t\t}\n\t}\n\n\t/**\n\t * parentRequestDisabled:\n\t * - Set by SDSRadioGroup to request disabled/enabled.\n\t * - Only applied if SDSRadio is NOT self-controlled.\n\t */\n\t@property({ type: Boolean, attribute: false })\n\tget parentRequestDisabled(): SDSRadioProps['parentRequestDisabled'] {\n\t\treturn this._parentRequestDisabled;\n\t}\n\tset parentRequestDisabled(value: SDSRadioProps['parentRequestDisabled']) {\n\t\tconst newVal = value ?? false;\n\t\tconst oldVal = this._parentRequestDisabled;\n\n\t\tif (oldVal === newVal) return;\n\n\t\tthis._parentRequestDisabled = newVal;\n\t\tthis.requestUpdate('parentRequestDisabled', oldVal);\n\n\t\tif (this._disabledIsAuthorControlled) return;\n\n\t\tthis._settingDisabledFromParent = true;\n\t\tthis.disabled = newVal;\n\t\tthis._settingDisabledFromParent = false;\n\t}\n\n\t@query('#control') control!: HTMLInputElement;\n\n\tprivate _disabled: SDSRadioProps['disabled'] = false;\n\tprivate _disabledIsAuthorControlled: boolean = false;\n\tprivate _settingDisabledFromParent: boolean = false;\n\tprivate _parentRequestDisabled: SDSRadioProps['parentRequestDisabled'] = false;\n\tprivate _initialChecked: boolean = 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\toverride connectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.internals.role = 'radio';\n\t\tif (!this._initialChecked) {\n\t\t\tthis._initialChecked = this.checked ?? false;\n\t\t}\n\t\tthis.addEventListener('keydown', this._handleKeydown);\n\t}\n\n\toverride disconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.removeEventListener('keydown', this._handleKeydown);\n\t}\n\n\toverride firstUpdated(_changedProperties: PropertyValues): void {\n\t\tsuper.firstUpdated(_changedProperties);\n\t\tthis._updateGroupValidation();\n\t}\n\n\toverride updated(changedProperties: Map<string | number | symbol, unknown>) {\n\t\tsuper.updated(changedProperties);\n\n\t\tif (changedProperties.has('checked')) {\n\t\t\tif (this.checked) {\n\t\t\t\tthis._uncheckSiblings();\n\t\t\t\tthis.internals.setFormValue(this.value ?? null);\n\t\t\t} else {\n\t\t\t\tthis.internals.setFormValue(null);\n\t\t\t}\n\t\t\tthis._updateGroupValidation();\n\t\t}\n\n\t\tif (changedProperties.has('required') && this.control) {\n\t\t\tthis.control.required = this.required ?? false;\n\t\t}\n\n\t\tif (!this._disabledIsAuthorControlled && this.disabled !== this._parentRequestDisabled) {\n\t\t\tthis._settingDisabledFromParent = true;\n\t\t\tthis.disabled = this._parentRequestDisabled ?? false;\n\t\t\tthis._settingDisabledFromParent = false;\n\t\t}\n\t}\n\n\tprivate _getGroupRadios(): SDSRadio[] {\n\t\tif (!this.name) return [this];\n\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\tconst radioGroup = Array.from(root.querySelectorAll<SDSRadio>(`sds-radio[name=\"${this.name}\"]`));\n\t\treturn radioGroup;\n\t}\n\n\tprivate _updateGroupValidation() {\n\t\tconst group: Array<SDSRadio> = this._getGroupRadios();\n\t\tconst isAnyChecked = group.some((radio) => radio.checked);\n\t\tconst isAnyRequired = group.some((radio) => radio.required);\n\t\tgroup.forEach((radio) => {\n\t\t\tif (!radio.control) return;\n\t\t\tif (isAnyRequired) {\n\t\t\t\tradio.internals.setValidity(isAnyChecked ? {} : { valueMissing: true }, isAnyChecked ? '' : radio.control.validationMessage, radio.control);\n\t\t\t} else {\n\t\t\t\tradio.internals.setValidity({});\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate readonly _handleKeydown = (event: KeyboardEvent) => {\n\t\tif (!this.name || this.disabled || this.readOnly) return;\n\n\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\tconst radios = Array.from(root.querySelectorAll<SDSRadio>(`sds-radio[name=\"${this.name}\"]`));\n\t\tconst currentIndex = radios.indexOf(this);\n\n\t\tif (currentIndex === -1) return;\n\n\t\tlet targetIndex: number | null = null;\n\n\t\tswitch (event.key) {\n\t\t\tcase 'ArrowUp':\n\t\t\tcase 'ArrowLeft':\n\t\t\t\ttargetIndex = currentIndex > 0 ? currentIndex - 1 : radios.length - 1;\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowDown':\n\t\t\tcase 'ArrowRight':\n\t\t\t\ttargetIndex = currentIndex < radios.length - 1 ? currentIndex + 1 : 0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\tconst targetRadio = radios[targetIndex];\n\t\ttargetRadio?.focus();\n\t\ttargetRadio?.click();\n\t\tevent.preventDefault();\n\t};\n\n\tformResetCallback() {\n\t\tthis.checked = this._initialChecked;\n\t\tthis.control.checked = this._initialChecked;\n\t\tthis.internals.setFormValue(this.checked ? this.value ?? 'on' : null);\n\t\tthis._updateGroupValidation();\n\t}\n\n\tprivate _uncheckSiblings() {\n\t\tif (!this.name) return;\n\t\tconst radios: Array<SDSRadio> = this._getGroupRadios();\n\n\t\tfor (const radio of radios) {\n\t\t\tif (radio !== this && radio.checked) {\n\t\t\t\tradio.checked = false;\n\t\t\t\tradio.internals.setFormValue(null);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate readonly _handleChange = (event: Event) => {\n\t\tif (this.disabled || this.readOnly) {\n\t\t\t(event.target as HTMLInputElement).checked = this.checked ?? false;\n\t\t\tevent.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tconst elem = event.target as HTMLInputElement;\n\t\tthis.checked = elem.checked;\n\t\tif (this.checked) {\n\t\t\tthis._uncheckSiblings();\n\t\t}\n\t\tthis._updateGroupValidation();\n\t\tthis.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));\n\t};\n\n\tprivate readonly _handleFocus = (event: Event) => {\n\t\tevent.stopImmediatePropagation();\n\t\tthis.dispatchEvent(new CustomEvent('focus', { bubbles: true, composed: true }));\n\t};\n\n\tprivate readonly _handleBlur = (event: Event) => {\n\t\tevent.stopImmediatePropagation();\n\t\tthis.dispatchEvent(new CustomEvent('blur', { bubbles: true, composed: true }));\n\t};\n\n\tget form() {\n\t\treturn this.internals.form;\n\t}\n\n\tget type(): string {\n\t\treturn 'radio';\n\t}\n\n\tget validity() {\n\t\treturn this.internals.validity;\n\t}\n\n\tget validationMessage() {\n\t\treturn this.internals.validationMessage;\n\t}\n\n\tget willValidate() {\n\t\treturn this.internals.willValidate;\n\t}\n\n\tcheckValidity(): boolean {\n\t\treturn this.internals.checkValidity();\n\t}\n\n\treportValidity(): boolean {\n\t\treturn this.internals.reportValidity();\n\t}\n\n\tsetCustomValidity(message: string): void {\n\t\tthis.internals.setValidity({ customError: !!message }, message);\n\t}\n\n\tformDisabledCallback(disabled: boolean): void {\n\t\tthis._settingDisabledFromParent = true;\n\t\tthis.disabled = disabled;\n\t\tthis._settingDisabledFromParent = false;\n\n\t\tif (this.control) this.control.disabled = disabled;\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.readOnly) this.shadowRoot?.querySelector('input')?.click();\n\t}\n\n\toverride render() {\n\t\tconst radioClasses = {\n\t\t\t'sds-radio': true,\n\t\t\t'sds-radio--error': Boolean(this.error),\n\t\t};\n\n\t\tconst inputClasses = {\n\t\t\t'sds-radio__input': true,\n\t\t\t'sds-radio__input--error': Boolean(this.error),\n\t\t};\n\n\t\treturn html`\n\t\t\t<div class=\"${classMap(radioClasses)}\">\n\t\t\t\t<input\n\t\t\t\t\tid=\"control\"\n\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t\t?checked=\"${this.checked ?? false}\"\n\t\t\t\t\t.checked=\"${this.checked ?? false}\"\n\t\t\t\t\t?disabled=\"${this.disabled ?? false}\"\n\t\t\t\t\t.disabled=\"${this.disabled ?? false}\"\n\t\t\t\t\t?required=\"${this.required}\"\n\t\t\t\t\t?readonly=\"${this.readOnly}\"\n\t\t\t\t\t@change=\"${this._handleChange}\"\n\t\t\t\t\t@focus=\"${this._handleFocus}\"\n\t\t\t\t\t@blur=\"${this._handleBlur}\"\n\t\t\t\t\tclass=\"${classMap(inputClasses)}\"\n\t\t\t\t/>\n\t\t\t\t${this.label ? html`<label class=\"sds-radio__label\" for=\"control\">${this.label}</label>` : nothing}\n\t\t\t\t${this.helpText ? html`<span class=\"sds-radio__help-text\">${this.helpText}</span>` : nothing}\n\t\t\t</div>\n\t\t`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-radio': SDSRadio;\n\t}\n}\n"]}
@@ -32,6 +32,7 @@ export declare class SDSRadioGroup extends LitElement {
32
32
  private _slotElement;
33
33
  private readonly _handleRadioChange;
34
34
  private _handleSlotChange;
35
+ private _getChildRadios;
35
36
  private _updateChildProps;
36
37
  updated(changedProps: Map<string | number | symbol, unknown>): void;
37
38
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
@@ -1 +1 @@
1
- {"version":3,"file":"sds-radio-group.d.ts","sourceRoot":"","sources":["../../src/sds-radio-group/sds-radio-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAC;AAKhD,OAAO,EAAE,SAAS,EAAE,M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AC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACxC,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAS;IACxF,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAY;IACvB,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAS;IACjD,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAS;IAClD,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAQ;IAE1E,OAAO,CAAC,cAAc,CAAuB;IACvC,OAAO,CAAC,YAAY,CAAmB;IAEtD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAOjC;IAEF,OAAO,CAAC,iBAAiB,CAEvB;IAEF,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,iBAAiB;IA0BhB,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;IAS5D,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAevF,MAAM;IA+Bf,IAAI,KAAK,IAAI,EAAE,CAEd;CACD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,iBAAiB,EAAE,aAAa,CAAC;KACjC;CACD"}
@@ -33,28 +33,32 @@ let SDSRadioGroup = class SDSRadioGroup extends LitElement {
33
33
  this._updateChildProps([...updatableRadioProps]);
34
34
  };
35
35
  }
36
+ _getChildRadios() {
37
+ return this._slotElement?.assignedElements({ flatten: true }).filter((element) => element.tagName === 'SDS-RADIO') ?? [];
38
+ }
36
39
  _updateChildProps(changedAttributes) {
37
- const radios = this._slotElement?.assignedElements({ flatten: true }).filter((element) => element.tagName === 'SDS-RADIO') ?? [];
38
- radios.forEach((radio) => {
39
- changedAttributes.forEach((attribute) => {
40
+ const radios = this._getChildRadios();
41
+ for (const childRadio of radios) {
42
+ for (const attribute of changedAttributes) {
40
43
  switch (attribute) {
41
44
  case 'readOnly':
42
- radio.readOnly = this.readOnly;
45
+ childRadio.readOnly = this.readOnly;
43
46
  break;
44
47
  case 'disabled':
45
- radio.disabled = this.disabled;
48
+ childRadio.parentRequestDisabled = this.disabled;
46
49
  break;
47
50
  case 'errorMessage':
48
- radio.error = Boolean(this.errorMessage);
51
+ childRadio.error = Boolean(this.errorMessage);
49
52
  break;
50
53
  case 'required':
51
- radio.required = this.required;
54
+ childRadio.required = this.required;
52
55
  break;
53
56
  case 'size':
54
- radio.size = this.size;
57
+ childRadio.size = this.size;
58
+ break;
55
59
  }
56
- });
57
- });
60
+ }
61
+ }
58
62
  }
59
63
  updated(changedProps) {
60
64
  super.updated(changedProps);
@@ -1 +1 @@
1
- {"version":3,"file":"sds-radio-group.js","sourceRoot":"","sources":["../../src/sds-radio-group/sds-radio-group.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIlD,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAGlG,OAAO,wBAAwB,CAAC;AAChC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,wBAAwB,CAAC;AAoBzB,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAM6D,aAAQ,GAAmC,KAAK,CAAC;QACxF,cAAS,GAAqB,QAAQ,CAAC;QACvB,aAAQ,GAAmC,KAAK,CAAC;QACjD,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AC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;mDAAoD;AACxC;IAAlE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAkD;AACxF;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAwC;AACvB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAkD;AACjD;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAkD;AAClD;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAyC;AAElE;IAAhB,KAAK,EAAE;qDAA8C;AAC/B;IAAtB,KAAK,CAAC,MAAM,CAAC;mDAAwC;AAb1C,aAAa;IADzB,oBAAoB,CAAC,iBAAiB,CAAC;GAC3B,aAAa,CA8GzB","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property, state, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { styles } from './sds-radio-group.styles';\nimport { SDS_SIZES } from '../types';\n\ntype RadioGroupSize = Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\nconst updatableRadioProps = ['disabled', 'errorMessage', 'readOnly', 'required', 'size'] as const;\ntype UpdatableRadioProp = (typeof updatableRadioProps)[number];\n\nimport '../sds-radio/sds-radio';\nimport '../sds-icon/sds-icon';\nimport '../sds-alert/sds-alert';\nimport { SDSRadio } from '../sds-radio/sds-radio';\n\n/**\n * TODO: Implement keyboard navigation behavior according to\n * https://www.w3.org/WAI/ARIA/apg/patterns/radio/\n */\n\nexport interface SDSRadioGroupProps {\n\tlegend?: string;\n\t'help-text'?: string;\n\t'error-message'?: string;\n\treadonly?: boolean;\n\tdirection?: 'column' | 'row';\n\tdisabled?: boolean;\n\tsize?: RadioGroupSize;\n\trequired?: boolean;\n}\n\n@guardedCustomElement('sds-radio-group')\nexport class SDSRadioGroup extends LitElement {\n\tstatic override styles = [styles];\n\n\t@property({ type: String }) legend?: SDSRadioGroupProps['legend'];\n\t@property({ type: String, attribute: 'help-text' }) helpText?: SDSRadioGroupProps['help-text'];\n\t@property({ type: String, attribute: 'error-message' }) errorMessage?: SDSRadioGroupProps['error-message'];\n\t@property({ type: Boolean, attribute: 'readonly', reflect: true }) readOnly: SDSRadioGroupProps['readonly'] = false;\n\t@property({ type: String }) direction: 'column' | 'row' = 'column';\n\t@property({ type: Boolean, reflect: true }) disabled: SDSRadioGroupProps['disabled'] = false;\n\t@property({ type: Boolean, reflect: true }) required: SDSRadioGroupProps['required'] = false;\n\t@property({ type: String, reflect: true }) size: SDSRadioGroupProps['size'] = 'md';\n\n\t@state() private _selectedValue: string | null = null;\n\t@query('slot') private _slotElement!: HTMLSlotElement;\n\n\tprivate readonly _handleRadioChange = (event: Event): void => {\n\t\tconst target = event.composedPath().find((el) => el instanceof HTMLElement && el.tagName === 'SDS-RADIO') as HTMLElement & { value: string };\n\n\t\tif (target) {\n\t\t\tthis._selectedValue = target.getAttribute('value') || null;\n\t\t\tthis.dispatchEvent(new CustomEvent('sds-update', { bubbles: true, composed: true }));\n\t\t}\n\t};\n\n\tprivate _handleSlotChange = () => {\n\t\tthis._updateChildProps([...updatableRadioProps]);\n\t};\n\n\tprivate _updateChildProps(changedAttributes: Array<UpdatableRadioProp>) {\n\t\tconst radios = this._slotElement?.assignedElements({ flatten: true }).filter((element): element is SDSRadio => element.tagName === 'SDS-RADIO') ?? [];\n\t\tradios.forEach((radio) => {\n\t\t\tchangedAttributes.forEach((attribute) => {\n\t\t\t\tswitch (attribute) {\n\t\t\t\t\tcase 'readOnly':\n\t\t\t\t\t\tradio.readOnly = this.readOnly;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'disabled':\n\t\t\t\t\t\tradio.disabled = this.disabled;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'errorMessage':\n\t\t\t\t\t\tradio.error = Boolean(this.errorMessage);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'required':\n\t\t\t\t\t\tradio.required = this.required;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'size':\n\t\t\t\t\t\tradio.size = this.size;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\toverride updated(changedProps: Map<string | number | symbol, unknown>) {\n\t\tsuper.updated(changedProps);\n\n\t\tconst changedKeys = Array.from(changedProps.keys());\n\t\tif (changedKeys.includes('errorMessage') || changedKeys.includes('error-message')) {\n\t\t\tthis._updateChildProps(['errorMessage']);\n\t\t}\n\t}\n\n\toverride attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n\t\tsuper.attributeChangedCallback(name, _old, value);\n\n\t\t// DOM attribute for readonly has different casing than our types\n\t\tif (name === 'readonly') {\n\t\t\tthis._updateChildProps(['readOnly']);\n\t\t\treturn;\n\t\t}\n\n\t\tconst property = name as UpdatableRadioProp;\n\t\tif (updatableRadioProps.includes(property)) {\n\t\t\tthis._updateChildProps([property]);\n\t\t}\n\t}\n\n\toverride render() {\n\t\tconst radioGroupClasses = {\n\t\t\t'sds-radio-group': true,\n\t\t\t'sds-radio-group--readonly': this.readOnly ?? false,\n\t\t\t'sds-radio-group--disabled': this.disabled ?? false,\n\t\t};\n\n\t\tconst radioClasses = {\n\t\t\t'sds-radio-group__radios': true,\n\t\t\t'sds-radio-group--column': this.direction === 'column',\n\t\t\t'sds-radio-group--row': this.direction === 'row',\n\t\t};\n\n\t\treturn html`\n\t\t\t<fieldset class=\"${classMap(radioGroupClasses)}\">\n\t\t\t\t${this.legend\n\t\t\t\t\t? html`<legend class=\"sds-radio-group__legend\">${this.readOnly ? html`<sds-icon name=\"lock-material-filled\" size=\"md\"></sds-icon>` : nothing}${this.legend}</legend>`\n\t\t\t\t\t: nothing}\n\t\t\t\t${this.helpText ? html`<p class=\"sds-radio-group__help-text\">${this.helpText}</p>` : nothing}\n\t\t\t\t<div class=\"${classMap(radioClasses)}\" @change=${this._handleRadioChange}>\n\t\t\t\t\t<slot @slotchange=${this._handleSlotChange}></slot>\n\t\t\t\t</div>\n\t\t\t\t${this.errorMessage\n\t\t\t\t\t? html`<sds-alert variant=\"secondary\" data-palette=\"danger\">\n\t\t\t\t\t\t\t<p slot=\"message\">${this.errorMessage}</p>\n\t\t\t\t\t\t</sds-alert>`\n\t\t\t\t\t: nothing}\n\t\t\t</fieldset>\n\t\t`;\n\t}\n\n\tget value(): {} {\n\t\treturn { selectedValue: this._selectedValue };\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-radio-group': SDSRadioGroup;\n\t}\n}\n"]}
1
+ {"version":3,"file":"sds-radio-group.js","sourceRoot":"","sources":["../../src/sds-radio-group/sds-radio-group.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIlD,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAGlG,OAAO,wBAAwB,CAAC;AAChC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,wBAAwB,CAAC;AAoBzB,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAM6D,aAAQ,GAAmC,KA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AuC;AACd;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;+CAA4C;AACvC;IAAvD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;mDAAoD;AACxC;IAAlE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAkD;AACxF;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAwC;AACvB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAkD;AACjD;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAkD;AAClD;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAyC;AAElE;IAAhB,KAAK,EAAE;qDAA8C;AAC/B;IAAtB,KAAK,CAAC,MAAM,CAAC;mDAAwC;AAb1C,aAAa;IADzB,oBAAoB,CAAC,iBAAiB,CAAC;GAC3B,aAAa,CAoHzB","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property, state, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { styles } from './sds-radio-group.styles';\nimport { SDS_SIZES } from '../types';\n\ntype RadioGroupSize = Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\nconst updatableRadioProps = ['disabled', 'errorMessage', 'readOnly', 'required', 'size'] as const;\ntype UpdatableRadioProp = (typeof updatableRadioProps)[number];\n\nimport '../sds-radio/sds-radio';\nimport '../sds-icon/sds-icon';\nimport '../sds-alert/sds-alert';\nimport { SDSRadio } from '../sds-radio/sds-radio';\n\n/**\n * TODO: Implement keyboard navigation behavior according to\n * https://www.w3.org/WAI/ARIA/apg/patterns/radio/\n */\n\nexport interface SDSRadioGroupProps {\n\tlegend?: string;\n\t'help-text'?: string;\n\t'error-message'?: string;\n\treadonly?: boolean;\n\tdirection?: 'column' | 'row';\n\tdisabled?: boolean;\n\tsize?: RadioGroupSize;\n\trequired?: boolean;\n}\n\n@guardedCustomElement('sds-radio-group')\nexport class SDSRadioGroup extends LitElement {\n\tstatic override styles = [styles];\n\n\t@property({ type: String }) legend?: SDSRadioGroupProps['legend'];\n\t@property({ type: String, attribute: 'help-text' }) helpText?: SDSRadioGroupProps['help-text'];\n\t@property({ type: String, attribute: 'error-message' }) errorMessage?: SDSRadioGroupProps['error-message'];\n\t@property({ type: Boolean, attribute: 'readonly', reflect: true }) readOnly: SDSRadioGroupProps['readonly'] = false;\n\t@property({ type: String }) direction: 'column' | 'row' = 'column';\n\t@property({ type: Boolean, reflect: true }) disabled: SDSRadioGroupProps['disabled'] = false;\n\t@property({ type: Boolean, reflect: true }) required: SDSRadioGroupProps['required'] = false;\n\t@property({ type: String, reflect: true }) size: SDSRadioGroupProps['size'] = 'md';\n\n\t@state() private _selectedValue: string | null = null;\n\t@query('slot') private _slotElement!: HTMLSlotElement;\n\n\tprivate readonly _handleRadioChange = (event: Event): void => {\n\t\tconst target = event.composedPath().find((el) => el instanceof HTMLElement && el.tagName === 'SDS-RADIO') as HTMLElement & { value: string };\n\n\t\tif (target) {\n\t\t\tthis._selectedValue = target.getAttribute('value') || null;\n\t\t\tthis.dispatchEvent(new CustomEvent('sds-update', { bubbles: true, composed: true }));\n\t\t}\n\t};\n\n\tprivate _handleSlotChange = () => {\n\t\tthis._updateChildProps([...updatableRadioProps]);\n\t};\n\n\tprivate _getChildRadios(): SDSRadio[] {\n\t\treturn this._slotElement?.assignedElements({ flatten: true }).filter((element): element is SDSRadio => element.tagName === 'SDS-RADIO') ?? [];\n\t}\n\n\tprivate _updateChildProps(changedAttributes: Array<UpdatableRadioProp>) {\n\t\tconst radios = this._getChildRadios();\n\n\t\tfor (const childRadio of radios) {\n\t\t\tfor (const attribute of changedAttributes) {\n\t\t\t\tswitch (attribute) {\n\t\t\t\t\tcase 'readOnly':\n\t\t\t\t\t\tchildRadio.readOnly = this.readOnly;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'disabled':\n\t\t\t\t\t\tchildRadio.parentRequestDisabled = this.disabled;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'errorMessage':\n\t\t\t\t\t\tchildRadio.error = Boolean(this.errorMessage);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'required':\n\t\t\t\t\t\tchildRadio.required = this.required;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'size':\n\t\t\t\t\t\tchildRadio.size = this.size;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\toverride updated(changedProps: Map<string | number | symbol, unknown>) {\n\t\tsuper.updated(changedProps);\n\n\t\tconst changedKeys = Array.from(changedProps.keys());\n\t\tif (changedKeys.includes('errorMessage') || changedKeys.includes('error-message')) {\n\t\t\tthis._updateChildProps(['errorMessage']);\n\t\t}\n\t}\n\n\toverride attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n\t\tsuper.attributeChangedCallback(name, _old, value);\n\n\t\t// DOM attribute for readonly has different casing than our types\n\t\tif (name === 'readonly') {\n\t\t\tthis._updateChildProps(['readOnly']);\n\t\t\treturn;\n\t\t}\n\n\t\tconst property = name as UpdatableRadioProp;\n\t\tif (updatableRadioProps.includes(property)) {\n\t\t\tthis._updateChildProps([property]);\n\t\t}\n\t}\n\n\toverride render() {\n\t\tconst radioGroupClasses = {\n\t\t\t'sds-radio-group': true,\n\t\t\t'sds-radio-group--readonly': this.readOnly ?? false,\n\t\t\t'sds-radio-group--disabled': this.disabled ?? false,\n\t\t};\n\n\t\tconst radioClasses = {\n\t\t\t'sds-radio-group__radios': true,\n\t\t\t'sds-radio-group--column': this.direction === 'column',\n\t\t\t'sds-radio-group--row': this.direction === 'row',\n\t\t};\n\n\t\treturn html`\n\t\t\t<fieldset class=\"${classMap(radioGroupClasses)}\">\n\t\t\t\t${this.legend\n\t\t\t\t\t? html`<legend class=\"sds-radio-group__legend\">${this.readOnly ? html`<sds-icon name=\"lock-material-filled\" size=\"md\"></sds-icon>` : nothing}${this.legend}</legend>`\n\t\t\t\t\t: nothing}\n\t\t\t\t${this.helpText ? html`<p class=\"sds-radio-group__help-text\">${this.helpText}</p>` : nothing}\n\t\t\t\t<div class=\"${classMap(radioClasses)}\" @change=${this._handleRadioChange}>\n\t\t\t\t\t<slot @slotchange=${this._handleSlotChange}></slot>\n\t\t\t\t</div>\n\t\t\t\t${this.errorMessage\n\t\t\t\t\t? html`<sds-alert variant=\"secondary\" data-palette=\"danger\">\n\t\t\t\t\t\t\t<p slot=\"message\">${this.errorMessage}</p>\n\t\t\t\t\t\t</sds-alert>`\n\t\t\t\t\t: nothing}\n\t\t\t</fieldset>\n\t\t`;\n\t}\n\n\tget value(): {} {\n\t\treturn { selectedValue: this._selectedValue };\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-radio-group': SDSRadioGroup;\n\t}\n}\n"]}
@@ -615,6 +615,7 @@ const styles$g = i$4`
615
615
  --_sds-alert-title-line-height: var(--sds-alert-title-line-height, var(--sds-components-line-height-tall-title-md));
616
616
 
617
617
  --_sds-alert-icon-color: var(--sds-alert-icon-color, var(--sds-color-alert-info-text-subtle));
618
+ --_sds-alert-icon-color-background: var(--sds-alert-icon-color-background, var(--sds-color-action-contrast-default, white));
618
619
  --_sds-alert-max-line-width: var(--sds-alert-max-line-width, var(--sds-typography-max-line-width));
619
620
  --_sds-alert-padding: var(--sds-alert-padding, var(--sds-spacing-sm));
620
621
 
@@ -670,7 +671,6 @@ const styles$g = i$4`
670
671
  display: flex;
671
672
  flex: 1;
672
673
  flex-direction: column;
673
- gap: var(--_sds-alert-content-gap);
674
674
  }
675
675
 
676
676
  .sds-alert__actions {
@@ -695,8 +695,30 @@ const styles$g = i$4`
695
695
  --_sds-alert-line-height: var(--sds-alert-line-height, var(--sds-components-line-height-tall-content-md));
696
696
  --_sds-alert-font-weight: var(--sds-alert-font-weight, var(--sds-typography-body-md-tall-desktop-font-weight));
697
697
 
698
- ::slotted([slot='message']) {
699
- padding: 3px 0 !important;
698
+ position: relative;
699
+
700
+ &::after {
701
+ content: '';
702
+ position: absolute;
703
+ top: 8px;
704
+ left: 9px;
705
+ width: 16px;
706
+ height: 16px;
707
+ background-color: var(--_sds-alert-icon-color-background);
708
+ z-index: 0;
709
+ clip-path: circle(50%);
710
+ }
711
+ }
712
+
713
+ :host([variant='secondary']):host([data-palette='attention']) {
714
+ --sds-icon-color: var(--sds-alert-icon-color, var(--sds-color-action-default));
715
+
716
+ &::after {
717
+ top: 9px;
718
+ left: 7px;
719
+ width: 20px;
720
+ height: 16px;
721
+ clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
700
722
  }
701
723
  }
702
724
 
@@ -1099,7 +1121,7 @@ const styles$e = i$4`
1099
1121
  }
1100
1122
 
1101
1123
  .sds-button:active {
1102
- --_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-hover)));
1124
+ --_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));
1103
1125
  }
1104
1126
  }
1105
1127
 
@@ -1126,6 +1148,18 @@ const styles$e = i$4`
1126
1148
  }
1127
1149
  }
1128
1150
 
1151
+ :host([variant='tertiary']):host([icon]) {
1152
+ .sds-button:hover {
1153
+ --_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-main-surface-hover)));
1154
+ --_sds-button-border-color: var(--sds-button-border-color, transparent);
1155
+ }
1156
+
1157
+ .sds-button:active {
1158
+ --_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));
1159
+ --_sds-button-border-color: var(--sds-button-border-color, transparent);
1160
+ }
1161
+ }
1162
+
1129
1163
  :host([size='medium']), /* Deprecated */
1130
1164
  :host([size='md']) {
1131
1165
  --_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-md));
@@ -3173,7 +3207,6 @@ var __decorateClass$6 = (decorators, target, key, kind) => {
3173
3207
  let SDSRadio = class extends i$1 {
3174
3208
  constructor() {
3175
3209
  super();
3176
- this.disabled = false;
3177
3210
  this.required = false;
3178
3211
  this.label = "";
3179
3212
  this.hideLabel = false;
@@ -3182,6 +3215,10 @@ let SDSRadio = class extends i$1 {
3182
3215
  this.error = false;
3183
3216
  this.readOnly = false;
3184
3217
  this.size = "md";
3218
+ this._disabled = false;
3219
+ this._disabledIsAuthorControlled = false;
3220
+ this._settingDisabledFromParent = false;
3221
+ this._parentRequestDisabled = false;
3185
3222
  this._initialChecked = false;
3186
3223
  this._handleKeydown = (event) => {
3187
3224
  if (!this.name || this.disabled || this.readOnly) return;
@@ -3232,6 +3269,39 @@ let SDSRadio = class extends i$1 {
3232
3269
  this.internals = this.attachInternals();
3233
3270
  this.attachShadow({ mode: "open", delegatesFocus: true });
3234
3271
  }
3272
+ /**
3273
+ * disabled:
3274
+ * - If set directly (prop/attr), this radio becomes "self-controlled"
3275
+ * and ignores parentRequestDisabled.
3276
+ * - If not self-controlled, this follows parentRequestDisabled (group/form).
3277
+ */
3278
+ get disabled() {
3279
+ return this._disabled;
3280
+ }
3281
+ set disabled(value) {
3282
+ const newVal = value ?? false;
3283
+ const oldVal = this._disabled;
3284
+ if (oldVal === newVal) return;
3285
+ this._disabled = newVal;
3286
+ this.requestUpdate("disabled", oldVal);
3287
+ if (!this._settingDisabledFromParent) {
3288
+ this._disabledIsAuthorControlled = newVal;
3289
+ }
3290
+ }
3291
+ get parentRequestDisabled() {
3292
+ return this._parentRequestDisabled;
3293
+ }
3294
+ set parentRequestDisabled(value) {
3295
+ const newVal = value ?? false;
3296
+ const oldVal = this._parentRequestDisabled;
3297
+ if (oldVal === newVal) return;
3298
+ this._parentRequestDisabled = newVal;
3299
+ this.requestUpdate("parentRequestDisabled", oldVal);
3300
+ if (this._disabledIsAuthorControlled) return;
3301
+ this._settingDisabledFromParent = true;
3302
+ this.disabled = newVal;
3303
+ this._settingDisabledFromParent = false;
3304
+ }
3235
3305
  connectedCallback() {
3236
3306
  super.connectedCallback();
3237
3307
  this.internals.role = "radio";
@@ -3248,6 +3318,26 @@ let SDSRadio = class extends i$1 {
3248
3318
  super.firstUpdated(_changedProperties);
3249
3319
  this._updateGroupValidation();
3250
3320
  }
3321
+ updated(changedProperties) {
3322
+ super.updated(changedProperties);
3323
+ if (changedProperties.has("checked")) {
3324
+ if (this.checked) {
3325
+ this._uncheckSiblings();
3326
+ this.internals.setFormValue(this.value ?? null);
3327
+ } else {
3328
+ this.internals.setFormValue(null);
3329
+ }
3330
+ this._updateGroupValidation();
3331
+ }
3332
+ if (changedProperties.has("required") && this.control) {
3333
+ this.control.required = this.required ?? false;
3334
+ }
3335
+ if (!this._disabledIsAuthorControlled && this.disabled !== this._parentRequestDisabled) {
3336
+ this._settingDisabledFromParent = true;
3337
+ this.disabled = this._parentRequestDisabled ?? false;
3338
+ this._settingDisabledFromParent = false;
3339
+ }
3340
+ }
3251
3341
  _getGroupRadios() {
3252
3342
  if (!this.name) return [this];
3253
3343
  const root = this.getRootNode();
@@ -3273,21 +3363,6 @@ let SDSRadio = class extends i$1 {
3273
3363
  this.internals.setFormValue(this.checked ? this.value ?? "on" : null);
3274
3364
  this._updateGroupValidation();
3275
3365
  }
3276
- updated(changedProperties) {
3277
- super.updated(changedProperties);
3278
- if (changedProperties.has("checked")) {
3279
- if (this.checked) {
3280
- this._uncheckSiblings();
3281
- this.internals.setFormValue(this.value ?? null);
3282
- } else {
3283
- this.internals.setFormValue(null);
3284
- }
3285
- this._updateGroupValidation();
3286
- }
3287
- if (changedProperties.has("required") && this.control) {
3288
- this.control.required = this.required ?? false;
3289
- }
3290
- }
3291
3366
  _uncheckSiblings() {
3292
3367
  if (!this.name) return;
3293
3368
  const radios = this._getGroupRadios();
@@ -3323,7 +3398,9 @@ let SDSRadio = class extends i$1 {
3323
3398
  this.internals.setValidity({ customError: !!message }, message);
3324
3399
  }
3325
3400
  formDisabledCallback(disabled) {
3401
+ this._settingDisabledFromParent = true;
3326
3402
  this.disabled = disabled;
3403
+ this._settingDisabledFromParent = false;
3327
3404
  if (this.control) this.control.disabled = disabled;
3328
3405
  }
3329
3406
  focus() {
@@ -3353,7 +3430,8 @@ let SDSRadio = class extends i$1 {
3353
3430
  value="${o$1(this.value)}"
3354
3431
  ?checked="${this.checked ?? false}"
3355
3432
  .checked="${this.checked ?? false}"
3356
- ?disabled="${this.disabled}"
3433
+ ?disabled="${this.disabled ?? false}"
3434
+ .disabled="${this.disabled ?? false}"
3357
3435
  ?required="${this.required}"
3358
3436
  ?readonly="${this.readOnly}"
3359
3437
  @change="${this._handleChange}"
@@ -3369,9 +3447,6 @@ let SDSRadio = class extends i$1 {
3369
3447
  };
3370
3448
  SDSRadio.styles = [styles$6];
3371
3449
  SDSRadio.formAssociated = true;
3372
- __decorateClass$6([
3373
- n2({ type: Boolean, reflect: true })
3374
- ], SDSRadio.prototype, "disabled", 2);
3375
3450
  __decorateClass$6([
3376
3451
  n2({ type: Boolean, reflect: true })
3377
3452
  ], SDSRadio.prototype, "required", 2);
@@ -3402,6 +3477,12 @@ __decorateClass$6([
3402
3477
  __decorateClass$6([
3403
3478
  n2({ type: String, attribute: "help-text" })
3404
3479
  ], SDSRadio.prototype, "helpText", 2);
3480
+ __decorateClass$6([
3481
+ n2({ type: Boolean, reflect: true })
3482
+ ], SDSRadio.prototype, "disabled", 1);
3483
+ __decorateClass$6([
3484
+ n2({ type: Boolean, attribute: false })
3485
+ ], SDSRadio.prototype, "parentRequestDisabled", 1);
3405
3486
  __decorateClass$6([
3406
3487
  e$3("#control")
3407
3488
  ], SDSRadio.prototype, "control", 2);
@@ -3538,28 +3619,32 @@ let SDSRadioGroup = class extends i$1 {
3538
3619
  this._updateChildProps([...updatableRadioProps]);
3539
3620
  };
3540
3621
  }
3622
+ _getChildRadios() {
3623
+ return this._slotElement?.assignedElements({ flatten: true }).filter((element) => element.tagName === "SDS-RADIO") ?? [];
3624
+ }
3541
3625
  _updateChildProps(changedAttributes) {
3542
- const radios = this._slotElement?.assignedElements({ flatten: true }).filter((element) => element.tagName === "SDS-RADIO") ?? [];
3543
- radios.forEach((radio) => {
3544
- changedAttributes.forEach((attribute) => {
3626
+ const radios = this._getChildRadios();
3627
+ for (const childRadio of radios) {
3628
+ for (const attribute of changedAttributes) {
3545
3629
  switch (attribute) {
3546
3630
  case "readOnly":
3547
- radio.readOnly = this.readOnly;
3631
+ childRadio.readOnly = this.readOnly;
3548
3632
  break;
3549
3633
  case "disabled":
3550
- radio.disabled = this.disabled;
3634
+ childRadio.parentRequestDisabled = this.disabled;
3551
3635
  break;
3552
3636
  case "errorMessage":
3553
- radio.error = Boolean(this.errorMessage);
3637
+ childRadio.error = Boolean(this.errorMessage);
3554
3638
  break;
3555
3639
  case "required":
3556
- radio.required = this.required;
3640
+ childRadio.required = this.required;
3557
3641
  break;
3558
3642
  case "size":
3559
- radio.size = this.size;
3643
+ childRadio.size = this.size;
3644
+ break;
3560
3645
  }
3561
- });
3562
- });
3646
+ }
3647
+ }
3563
3648
  }
3564
3649
  updated(changedProps) {
3565
3650
  super.updated(changedProps);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@politiet/sheriff-web-components",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Sheriff Design System Web Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -138,7 +138,7 @@
138
138
  "@politiet/sheriff-icons": "^2.0.1"
139
139
  },
140
140
  "peerDependencies": {
141
- "@politiet/sheriff-css-framework": "^2.0.2"
141
+ "@politiet/sheriff-css-framework": "^2.1.0"
142
142
  },
143
143
  "author": "Politiets IT-enhet",
144
144
  "license": "ISC"