@sebgroup/green-core 1.20.0 → 1.20.2

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.
Files changed (115) hide show
  1. package/chunks/{chunk.DFYMYEGD.js → chunk.2X23R32H.js} +0 -1
  2. package/chunks/{chunk.ZLWSCK7R.js → chunk.4QOFEG6G.js} +17 -8
  3. package/chunks/{chunk.CGZNEIGV.js → chunk.4ZTSWZUY.js} +6 -7
  4. package/chunks/{chunk.3KJV6CHY.js → chunk.5EPIZQO6.js} +2 -2
  5. package/chunks/{chunk.6LA2CKUM.js → chunk.73TOOYEY.js} +1 -1
  6. package/chunks/{chunk.YDYO7HP5.js → chunk.ATEP56AI.js} +2 -2
  7. package/chunks/{chunk.NYOCHFZE.js → chunk.BJOJYTQV.js} +5 -5
  8. package/chunks/{chunk.Z5NACNXH.js → chunk.BLKXWE5L.js} +2 -2
  9. package/chunks/{chunk.BKSMVF4C.js → chunk.DFTJBJPB.js} +1 -1
  10. package/chunks/{chunk.Y42J4CV3.js → chunk.FQUH54AY.js} +2 -2
  11. package/chunks/{chunk.PE6MD3MB.js → chunk.GJ4HS4M4.js} +3 -3
  12. package/chunks/{chunk.NRYXPR4Z.js → chunk.HHH2BCUH.js} +3 -4
  13. package/chunks/{chunk.RSCI4LL2.js → chunk.IKRRGS7G.js} +7 -6
  14. package/chunks/{chunk.YEV6STTM.js → chunk.JG4R6KQ7.js} +1 -1
  15. package/chunks/{chunk.GOOHCUU6.js → chunk.KMGYMMFU.js} +39 -11
  16. package/chunks/{chunk.VHKGMBUL.js → chunk.KPNRNWRS.js} +3 -3
  17. package/chunks/{chunk.BJCCPLEO.js → chunk.LZXR7Q7Q.js} +2 -2
  18. package/chunks/{chunk.5PHLJFEX.js → chunk.METO6ZWZ.js} +2 -3
  19. package/chunks/{chunk.XOARVFGN.js → chunk.MZSK66DN.js} +4 -1
  20. package/chunks/{chunk.EC77QYRA.js → chunk.NI33W56L.js} +2 -2
  21. package/chunks/{chunk.2RF5VP6K.js → chunk.PKBOP746.js} +4 -4
  22. package/chunks/{chunk.A62LO4CP.js → chunk.UDH3TBG6.js} +1 -1
  23. package/chunks/chunk.VOYMQ322.js +1 -1
  24. package/chunks/{chunk.CH2GIVY6.js → chunk.VXAUXCMI.js} +31 -5
  25. package/chunks/{chunk.CUR4WRCG.js → chunk.Z43CP7DK.js} +4 -4
  26. package/chunks/{chunk.W2XAWNZY.js → chunk.ZE4NFOBK.js} +4 -4
  27. package/chunks/{chunk.EM7MZKG5.js → chunk.ZQ4D5K7J.js} +5 -1
  28. package/components/button/button.d.ts +5 -2
  29. package/components/button/button.js +7 -8
  30. package/components/button/button.trans.styles.js +1 -1
  31. package/components/button/index.js +7 -8
  32. package/components/context-menu/context-menu.d.ts +1 -1
  33. package/components/context-menu/context-menu.js +9 -9
  34. package/components/context-menu/context-menu.trans.styles.js +1 -1
  35. package/components/context-menu/index.js +12 -12
  36. package/components/datepicker/datepicker.js +12 -12
  37. package/components/datepicker/datepicker.trans.styles.js +1 -1
  38. package/components/datepicker/index.js +12 -12
  39. package/components/dropdown/dropdown.d.ts +0 -1
  40. package/components/dropdown/dropdown.js +9 -9
  41. package/components/dropdown/dropdown.trans.styles.js +1 -1
  42. package/components/dropdown/index.js +10 -10
  43. package/components/filter-chips/filter-chip/filter-chip.d.ts +3 -5
  44. package/components/filter-chips/filter-chip/filter-chip.js +9 -10
  45. package/components/filter-chips/filter-chip/filter-chip.trans.styles.js +1 -1
  46. package/components/filter-chips/filter-chip/index.js +9 -10
  47. package/components/filter-chips/filter-chips.d.ts +8 -0
  48. package/components/filter-chips/filter-chips.js +11 -12
  49. package/components/filter-chips/filter-chips.trans.styles.js +1 -1
  50. package/components/filter-chips/index.js +11 -12
  51. package/components/form-control.d.ts +3 -0
  52. package/components/form-control.js +2 -2
  53. package/components/grid/grid.d.ts +6 -6
  54. package/components/grid/grid.js +3 -3
  55. package/components/grid/index.js +3 -3
  56. package/components/grouped-list/grouped-list.js +5 -5
  57. package/components/grouped-list/grouped-list.trans.styles.js +1 -1
  58. package/components/grouped-list/index.js +5 -5
  59. package/components/grouped-list/list-item.js +2 -2
  60. package/components/icon/icon.js +2 -2
  61. package/components/icon/index.js +2 -2
  62. package/components/index.js +44 -45
  63. package/components/radio/radio-group.js +70 -5
  64. package/components/segmented-control/index.js +7 -5
  65. package/components/segmented-control/segment/index.js +4 -4
  66. package/components/segmented-control/segment/segment.js +4 -4
  67. package/components/segmented-control/segment/segment.trans.styles.js +1 -1
  68. package/components/segmented-control/segmented-control.d.ts +1 -0
  69. package/components/segmented-control/segmented-control.js +7 -5
  70. package/components/segmented-control/segmented-control.trans.styles.js +1 -1
  71. package/components/theme/index.js +3 -3
  72. package/components/theme/theme.js +3 -3
  73. package/components/theme/theme.trans.styles.js +1 -1
  74. package/gds-element.d.ts +8 -1
  75. package/index.js +44 -45
  76. package/mixins/focusable.d.ts +1 -1
  77. package/package.json +4 -4
  78. package/primitives/calendar/calendar.d.ts +26 -0
  79. package/primitives/calendar/calendar.js +3 -3
  80. package/primitives/calendar/functions.d.ts +1 -1
  81. package/primitives/calendar/index.js +3 -3
  82. package/primitives/listbox/index.js +5 -5
  83. package/primitives/listbox/listbox.d.ts +0 -1
  84. package/primitives/listbox/listbox.js +5 -5
  85. package/primitives/listbox/option.d.ts +0 -1
  86. package/primitives/listbox/option.js +3 -3
  87. package/primitives/menu/index.js +5 -5
  88. package/primitives/menu/menu-heading.js +3 -3
  89. package/primitives/menu/menu-item.js +3 -3
  90. package/primitives/menu/menu.js +5 -5
  91. package/primitives/popover/index.js +3 -3
  92. package/primitives/popover/popover.js +3 -3
  93. package/primitives/ripple/index.js +2 -2
  94. package/primitives/ripple/ripple.js +2 -2
  95. package/transitional-styles.js +1 -1
  96. package/utils/decorators/observe-light-dom.d.ts +1 -1
  97. package/utils/decorators/resize-observer.d.ts +1 -1
  98. package/utils/decorators/watch-media-query.d.ts +1 -1
  99. package/utils/decorators/watch.d.ts +1 -1
  100. package/utils/helpers/custom-element-scoping.d.ts +1 -3
  101. package/utils/localization/localization.d.ts +1 -1
  102. package/chunks/chunk.3RYYLMGT.js +0 -74
  103. package/chunks/chunk.YBOK7MI7.js +0 -31
  104. package/components/badge/badge.d.ts +0 -43
  105. package/components/badge/badge.js +0 -245
  106. package/components/checkbox/checkbox.d.ts +0 -12
  107. package/components/checkbox/checkbox.js +0 -219
  108. package/components/input/input.d.ts +0 -69
  109. package/components/input/input.js +0 -658
  110. package/components/radio/radio.d.ts +0 -14
  111. package/components/radio/radio.js +0 -240
  112. package/components/switch/switch.d.ts +0 -12
  113. package/components/switch/switch.js +0 -164
  114. package/components/tooltip/tooltip.d.ts +0 -14
  115. package/components/tooltip/tooltip.js +0 -252
@@ -1,4 +1,25 @@
1
1
  import { GdsElement } from '../../gds-element';
2
+ /**
3
+ * Used to customize the appearance of a date in the calendar.
4
+ */
5
+ export type CustomizedDate = {
6
+ /**
7
+ * The date to customize.
8
+ */
9
+ date: Date;
10
+ /**
11
+ * The color of the indicator.
12
+ */
13
+ color?: string;
14
+ /**
15
+ * The type of indicator.
16
+ */
17
+ indicator?: 'dot';
18
+ /**
19
+ * Whether the date is disabled or not.
20
+ */
21
+ disabled: boolean;
22
+ };
2
23
  /**
3
24
  * @element gds-calendar
4
25
  * @internal
@@ -50,6 +71,11 @@ export declare class GdsCalendar extends GdsElement {
50
71
  * Whether to show week numbers or not.
51
72
  */
52
73
  showWeekNumbers: boolean;
74
+ /**
75
+ * An array of `CustomizedDate` objects that can be used customize the appearance of dates.
76
+ * This can only be set through the property, not through an attribute.
77
+ */
78
+ customizedDates?: CustomizedDate[];
53
79
  /**
54
80
  * Returns the date cell element for the given day number.
55
81
  */
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  GdsCalendar
3
- } from "../../chunks/chunk.CH2GIVY6.js";
3
+ } from "../../chunks/chunk.VXAUXCMI.js";
4
4
  import "../../chunks/chunk.375BWME4.js";
5
- import "../../chunks/chunk.ZLWSCK7R.js";
6
- import "../../chunks/chunk.EM7MZKG5.js";
5
+ import "../../chunks/chunk.4QOFEG6G.js";
6
+ import "../../chunks/chunk.ZQ4D5K7J.js";
7
7
  import "../../chunks/chunk.W7CV3QYI.js";
8
8
  import "../../chunks/chunk.2WO4NHJ2.js";
9
9
  import "../../chunks/chunk.YO24ZYAD.js";
@@ -1,5 +1,5 @@
1
1
  import { TemplateResult } from 'lit-html';
2
- export declare type Week = {
2
+ export type Week = {
3
3
  days: Date[];
4
4
  };
5
5
  export declare function renderMonthGridView(date: Date, template: (weeks: Week[]) => TemplateResult): TemplateResult<1>;
@@ -1,10 +1,10 @@
1
1
  import "../../chunks/chunk.TMBQL2RO.js";
2
2
  import {
3
3
  GdsCalendar
4
- } from "../../chunks/chunk.CH2GIVY6.js";
4
+ } from "../../chunks/chunk.VXAUXCMI.js";
5
5
  import "../../chunks/chunk.375BWME4.js";
6
- import "../../chunks/chunk.ZLWSCK7R.js";
7
- import "../../chunks/chunk.EM7MZKG5.js";
6
+ import "../../chunks/chunk.4QOFEG6G.js";
7
+ import "../../chunks/chunk.ZQ4D5K7J.js";
8
8
  import "../../chunks/chunk.W7CV3QYI.js";
9
9
  import "../../chunks/chunk.2WO4NHJ2.js";
10
10
  import "../../chunks/chunk.YO24ZYAD.js";
@@ -1,13 +1,13 @@
1
1
  import "../../chunks/chunk.MI4A2C2A.js";
2
2
  import {
3
3
  GdsListbox
4
- } from "../../chunks/chunk.NRYXPR4Z.js";
5
- import "../../chunks/chunk.5PHLJFEX.js";
6
- import "../../chunks/chunk.DFYMYEGD.js";
4
+ } from "../../chunks/chunk.HHH2BCUH.js";
5
+ import "../../chunks/chunk.METO6ZWZ.js";
6
+ import "../../chunks/chunk.2X23R32H.js";
7
7
  import "../../chunks/chunk.2ND5EWHE.js";
8
+ import "../../chunks/chunk.4QOFEG6G.js";
8
9
  import "../../chunks/chunk.WM7HBMMV.js";
9
- import "../../chunks/chunk.ZLWSCK7R.js";
10
- import "../../chunks/chunk.EM7MZKG5.js";
10
+ import "../../chunks/chunk.ZQ4D5K7J.js";
11
11
  import "../../chunks/chunk.W7CV3QYI.js";
12
12
  import "../../chunks/chunk.2WO4NHJ2.js";
13
13
  import "../../chunks/chunk.YO24ZYAD.js";
@@ -1,4 +1,3 @@
1
- import 'reflect-metadata';
2
1
  import { GdsElement } from '../../gds-element';
3
2
  import '../../primitives/listbox/option';
4
3
  import type { GdsOption, OptionsContainer } from '../../primitives/listbox/option';
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  GdsListbox
3
- } from "../../chunks/chunk.NRYXPR4Z.js";
4
- import "../../chunks/chunk.5PHLJFEX.js";
5
- import "../../chunks/chunk.DFYMYEGD.js";
3
+ } from "../../chunks/chunk.HHH2BCUH.js";
4
+ import "../../chunks/chunk.METO6ZWZ.js";
5
+ import "../../chunks/chunk.2X23R32H.js";
6
6
  import "../../chunks/chunk.2ND5EWHE.js";
7
+ import "../../chunks/chunk.4QOFEG6G.js";
7
8
  import "../../chunks/chunk.WM7HBMMV.js";
8
- import "../../chunks/chunk.ZLWSCK7R.js";
9
- import "../../chunks/chunk.EM7MZKG5.js";
9
+ import "../../chunks/chunk.ZQ4D5K7J.js";
10
10
  import "../../chunks/chunk.W7CV3QYI.js";
11
11
  import "../../chunks/chunk.2WO4NHJ2.js";
12
12
  import "../../chunks/chunk.YO24ZYAD.js";
@@ -1,5 +1,4 @@
1
1
  import { GdsElement } from '../../gds-element';
2
- import 'reflect-metadata';
3
2
  export interface OptionsContainer extends HTMLElement {
4
3
  options: GdsOption[];
5
4
  multiple: boolean;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  GdsOption
3
- } from "../../chunks/chunk.5PHLJFEX.js";
3
+ } from "../../chunks/chunk.METO6ZWZ.js";
4
4
  import "../../chunks/chunk.2ND5EWHE.js";
5
+ import "../../chunks/chunk.4QOFEG6G.js";
5
6
  import "../../chunks/chunk.WM7HBMMV.js";
6
- import "../../chunks/chunk.ZLWSCK7R.js";
7
- import "../../chunks/chunk.EM7MZKG5.js";
7
+ import "../../chunks/chunk.ZQ4D5K7J.js";
8
8
  import "../../chunks/chunk.W7CV3QYI.js";
9
9
  import "../../chunks/chunk.2WO4NHJ2.js";
10
10
  import "../../chunks/chunk.YO24ZYAD.js";
@@ -1,12 +1,12 @@
1
1
  import "../../chunks/chunk.UF6IEONX.js";
2
2
  import {
3
3
  GdsMenu
4
- } from "../../chunks/chunk.PE6MD3MB.js";
5
- import "../../chunks/chunk.EC77QYRA.js";
6
- import "../../chunks/chunk.DFYMYEGD.js";
4
+ } from "../../chunks/chunk.GJ4HS4M4.js";
5
+ import "../../chunks/chunk.NI33W56L.js";
6
+ import "../../chunks/chunk.2X23R32H.js";
7
7
  import "../../chunks/chunk.2ND5EWHE.js";
8
- import "../../chunks/chunk.ZLWSCK7R.js";
9
- import "../../chunks/chunk.EM7MZKG5.js";
8
+ import "../../chunks/chunk.4QOFEG6G.js";
9
+ import "../../chunks/chunk.ZQ4D5K7J.js";
10
10
  import "../../chunks/chunk.W7CV3QYI.js";
11
11
  import "../../chunks/chunk.YO24ZYAD.js";
12
12
  import "../../chunks/chunk.VOYMQ322.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  GdsMenuHeading
3
- } from "../../chunks/chunk.3KJV6CHY.js";
4
- import "../../chunks/chunk.ZLWSCK7R.js";
5
- import "../../chunks/chunk.EM7MZKG5.js";
3
+ } from "../../chunks/chunk.5EPIZQO6.js";
4
+ import "../../chunks/chunk.4QOFEG6G.js";
5
+ import "../../chunks/chunk.ZQ4D5K7J.js";
6
6
  import "../../chunks/chunk.W7CV3QYI.js";
7
7
  import "../../chunks/chunk.YO24ZYAD.js";
8
8
  import "../../chunks/chunk.VOYMQ322.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  GdsMenuItem
3
- } from "../../chunks/chunk.EC77QYRA.js";
3
+ } from "../../chunks/chunk.NI33W56L.js";
4
4
  import "../../chunks/chunk.2ND5EWHE.js";
5
- import "../../chunks/chunk.ZLWSCK7R.js";
6
- import "../../chunks/chunk.EM7MZKG5.js";
5
+ import "../../chunks/chunk.4QOFEG6G.js";
6
+ import "../../chunks/chunk.ZQ4D5K7J.js";
7
7
  import "../../chunks/chunk.W7CV3QYI.js";
8
8
  import "../../chunks/chunk.YO24ZYAD.js";
9
9
  import "../../chunks/chunk.VOYMQ322.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  GdsMenu
3
- } from "../../chunks/chunk.PE6MD3MB.js";
4
- import "../../chunks/chunk.EC77QYRA.js";
5
- import "../../chunks/chunk.DFYMYEGD.js";
3
+ } from "../../chunks/chunk.GJ4HS4M4.js";
4
+ import "../../chunks/chunk.NI33W56L.js";
5
+ import "../../chunks/chunk.2X23R32H.js";
6
6
  import "../../chunks/chunk.2ND5EWHE.js";
7
- import "../../chunks/chunk.ZLWSCK7R.js";
8
- import "../../chunks/chunk.EM7MZKG5.js";
7
+ import "../../chunks/chunk.4QOFEG6G.js";
8
+ import "../../chunks/chunk.ZQ4D5K7J.js";
9
9
  import "../../chunks/chunk.W7CV3QYI.js";
10
10
  import "../../chunks/chunk.YO24ZYAD.js";
11
11
  import "../../chunks/chunk.VOYMQ322.js";
@@ -1,10 +1,10 @@
1
1
  import "../../chunks/chunk.XU4HZLJL.js";
2
2
  import {
3
3
  GdsPopover
4
- } from "../../chunks/chunk.CUR4WRCG.js";
4
+ } from "../../chunks/chunk.Z43CP7DK.js";
5
+ import "../../chunks/chunk.4QOFEG6G.js";
5
6
  import "../../chunks/chunk.WM7HBMMV.js";
6
- import "../../chunks/chunk.ZLWSCK7R.js";
7
- import "../../chunks/chunk.EM7MZKG5.js";
7
+ import "../../chunks/chunk.ZQ4D5K7J.js";
8
8
  import "../../chunks/chunk.W7CV3QYI.js";
9
9
  import "../../chunks/chunk.2WO4NHJ2.js";
10
10
  import "../../chunks/chunk.YO24ZYAD.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  GdsPopover
3
- } from "../../chunks/chunk.CUR4WRCG.js";
3
+ } from "../../chunks/chunk.Z43CP7DK.js";
4
+ import "../../chunks/chunk.4QOFEG6G.js";
4
5
  import "../../chunks/chunk.WM7HBMMV.js";
5
- import "../../chunks/chunk.ZLWSCK7R.js";
6
- import "../../chunks/chunk.EM7MZKG5.js";
6
+ import "../../chunks/chunk.ZQ4D5K7J.js";
7
7
  import "../../chunks/chunk.W7CV3QYI.js";
8
8
  import "../../chunks/chunk.2WO4NHJ2.js";
9
9
  import "../../chunks/chunk.YO24ZYAD.js";
@@ -1,8 +1,8 @@
1
1
  import "../../chunks/chunk.TX64TTBN.js";
2
2
  import {
3
3
  Ripple
4
- } from "../../chunks/chunk.A62LO4CP.js";
5
- import "../../chunks/chunk.W2XAWNZY.js";
4
+ } from "../../chunks/chunk.UDH3TBG6.js";
5
+ import "../../chunks/chunk.ZE4NFOBK.js";
6
6
  import "../../chunks/chunk.YO24ZYAD.js";
7
7
  import "../../chunks/chunk.VOYMQ322.js";
8
8
  import "../../chunks/chunk.5VURDMKE.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Ripple
3
- } from "../../chunks/chunk.A62LO4CP.js";
4
- import "../../chunks/chunk.W2XAWNZY.js";
3
+ } from "../../chunks/chunk.UDH3TBG6.js";
4
+ import "../../chunks/chunk.ZE4NFOBK.js";
5
5
  import "../../chunks/chunk.YO24ZYAD.js";
6
6
  import "../../chunks/chunk.VOYMQ322.js";
7
7
  import "../../chunks/chunk.5VURDMKE.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TransitionalStyles,
3
3
  registerTransitionalStyles
4
- } from "./chunks/chunk.ZLWSCK7R.js";
4
+ } from "./chunks/chunk.4QOFEG6G.js";
5
5
  import "./chunks/chunk.W7CV3QYI.js";
6
6
  import "./chunks/chunk.VOYMQ322.js";
7
7
  import "./chunks/chunk.5VURDMKE.js";
@@ -1,5 +1,5 @@
1
1
  import type { LitElement } from 'lit';
2
- declare type Handler = () => void;
2
+ type Handler = () => void;
3
3
  /**
4
4
  * Runs when the light DOM children of the component changes.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import type { LitElement } from 'lit';
2
- declare type Handler = () => void;
2
+ type Handler = () => void;
3
3
  /**
4
4
  * Runs when the size of the component changes.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { LitElement } from 'lit';
2
- declare type Handler = (matches: boolean) => void;
2
+ type Handler = (matches: boolean) => void;
3
3
  /**
4
4
  * Media queries expressing standard breakpoints.
5
5
  * TODO: These should probably be imported from somehere, so that they are always in sync with CSS.
@@ -1,5 +1,5 @@
1
1
  import type { LitElement } from 'lit';
2
- declare type UpdateHandler = (prev?: unknown, next?: unknown) => void;
2
+ type UpdateHandler = (prev?: unknown, next?: unknown) => void;
3
3
  interface WatchOptions {
4
4
  /**
5
5
  * If true, will only start watching after the initial update/render
@@ -71,9 +71,7 @@ export declare const VER_SUFFIX = "-gdsvsuffix";
71
71
  * @category Decorator
72
72
  * @param tagName The tag name of the custom element to define.
73
73
  */
74
- export declare const gdsCustomElement: (tagName: string) => (classOrDescriptor: {
75
- prototype: HTMLElement;
76
- } | import("@lit/reactive-element/decorators/base").ClassDescriptor) => any;
74
+ export declare const gdsCustomElement: (tagName: string) => import("lit/decorators.js").CustomElementDecorator;
77
75
  /**
78
76
  * Template tag factory that creates a new template tag, which rewrites all custom element names from the
79
77
  * lookup table to include the version suffix, and then passes the template on to the provided template tag.
@@ -1,7 +1,7 @@
1
1
  import { targetLocales } from '../../generated/locale-codes';
2
2
  import * as templates_sv from '../../generated/locales/sv';
3
3
  declare const localizedTemplates: Map<string, typeof templates_sv>;
4
- declare type LocalizationConfig = {
4
+ type LocalizationConfig = {
5
5
  extraLocales: string[];
6
6
  extraTemplates: typeof localizedTemplates;
7
7
  };
@@ -1,74 +0,0 @@
1
- import {
2
- constrainSlots
3
- } from "./chunk.KBYQYDL3.js";
4
- import {
5
- __decorateClass,
6
- __privateAdd,
7
- __privateSet
8
- } from "./chunk.5VURDMKE.js";
9
-
10
- // libs/core/src/components/radio/radio-group.ts
11
- import { LitElement, html } from "lit";
12
- import { customElement, property } from "lit/decorators.js";
13
- var _internals;
14
- var GdsRadioGroup = class extends LitElement {
15
- constructor() {
16
- super();
17
- // Private members
18
- __privateAdd(this, _internals, void 0);
19
- this.label = "Label";
20
- this.inputElement = null;
21
- this.exludeAttr = ["id", "label"];
22
- __privateSet(this, _internals, this.attachInternals());
23
- constrainSlots(this);
24
- }
25
- reflectAttributesToInput() {
26
- if (this.inputElement) {
27
- const attributes = this.attributes;
28
- for (let i = 0; i < attributes.length; i++) {
29
- const attribute = attributes[i];
30
- if (!this.exludeAttr.includes(attribute.name)) {
31
- this.inputElement.setAttribute(attribute.name, attribute.value);
32
- }
33
- }
34
- }
35
- }
36
- update(changedProperties) {
37
- var _a;
38
- super.update(changedProperties);
39
- if (!this.inputElement) {
40
- this.inputElement = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById(
41
- "radio"
42
- );
43
- }
44
- this.reflectAttributesToInput();
45
- }
46
- render() {
47
- return html`
48
- <fieldset
49
- class="gds-radio-group"
50
- role="radiogroup"
51
- aria-labelledby="label"
52
- >
53
- <label>${this.label}</label>
54
- <slot></slot>
55
- </fieldset>
56
- `;
57
- }
58
- };
59
- _internals = new WeakMap();
60
- // static styles = unsafeCSS(styles)
61
- GdsRadioGroup.shadowRootOptions = {
62
- mode: "open",
63
- delegatesFocus: true
64
- };
65
- __decorateClass([
66
- property({ type: String, reflect: true, attribute: "label" })
67
- ], GdsRadioGroup.prototype, "label", 2);
68
- GdsRadioGroup = __decorateClass([
69
- customElement("gds-radio-group")
70
- ], GdsRadioGroup);
71
-
72
- export {
73
- GdsRadioGroup
74
- };
@@ -1,31 +0,0 @@
1
- // libs/core/src/utils/directives/forward-attributes.ts
2
- import { Directive, PartType, directive } from "lit/directive.js";
3
- import { nothing } from "lit/html.js";
4
- var ForwardAttributesDirective = class extends Directive {
5
- constructor(partInfo) {
6
- super(partInfo);
7
- if (partInfo.type !== PartType.ELEMENT) {
8
- throw new Error(
9
- "The `forwardAttributes` directive must be used in element bindings"
10
- );
11
- }
12
- }
13
- render(_filter) {
14
- return nothing;
15
- }
16
- update(part, [filter]) {
17
- var _a;
18
- const element = part.element;
19
- const host = (_a = part.options) == null ? void 0 : _a.host;
20
- Array.from(host.attributes).forEach((attr) => {
21
- if (filter(attr)) {
22
- element.setAttribute(attr.name.replace("gds-", ""), attr.value);
23
- }
24
- });
25
- }
26
- };
27
- var forwardAttributes = directive(ForwardAttributesDirective);
28
-
29
- export {
30
- forwardAttributes
31
- };
@@ -1,43 +0,0 @@
1
- import { LitElement } from 'lit';
2
- /**
3
- *
4
- * @element gds-badge
5
- * @summary A component that displays a badge with different variants and types.
6
- * @documentation https://seb.io/docs/component/badge
7
- * @status beta
8
- * @since 1.0.0
9
- *
10
- * @cssprop --gds-badge-background-color - The background color of the badge.
11
- * @cssprop --gds-badge-color - The text color of the badge.
12
- * @cssprop --gds-badge-font-size - The font size of the badge.
13
- * @cssprop --gds-badge-height - The height of the badge.
14
- * @cssprop --gds-badge-width - The width of the badge.
15
- *
16
- * @variant Information - A badge with an information icon and blue background color.
17
- * @variant Success - A badge with a checkmark icon and green background color.
18
- * @variant Warning - A badge with an exclamation mark icon and yellow background color.
19
- * @variant Error - A badge with a cross icon and red background color.
20
- *
21
- * @type Status - A badge that displays a status.
22
- * @type Counter - A badge that displays a count.
23
- * @type Indicator - A badge that displays an icon and percentage.
24
- *
25
- * @example
26
- * <gds-badge variant="Information" type="Status">Pending</gds-badge>
27
- * <gds-badge variant="Success" type="Counter">10</gds-badge>
28
- * <gds-badge variant="Warning" type="Indicator" icon="warning" percentage="50">50%</gds-badge>
29
- * <gds-badge variant="Error" type="Status">Failed</gds-badge>
30
- *
31
- */
32
- export declare class GdsBadge extends LitElement {
33
- #private;
34
- static styles: import("lit").CSSResult;
35
- static shadowRootOptions: ShadowRootInit;
36
- constructor();
37
- variant: string;
38
- type: string;
39
- icon: string;
40
- slotIcon(): import("lit").TemplateResult<1>;
41
- slotLabel(): "" | import("lit").TemplateResult<1>;
42
- render(): import("lit").TemplateResult<1>;
43
- }