@haiilo/catalyst 7.0.1 → 8.0.0

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 (96) hide show
  1. package/dist/catalyst/catalyst.css +120 -26
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/index.esm.js +2 -2
  5. package/dist/catalyst/index.esm.js.map +1 -1
  6. package/dist/catalyst/p-85d057f0.js +2 -0
  7. package/dist/catalyst/p-85d057f0.js.map +1 -0
  8. package/dist/catalyst/p-8a447e2d.entry.js +10 -0
  9. package/dist/catalyst/p-8a447e2d.entry.js.map +1 -0
  10. package/dist/catalyst/scss/core/_base.scss +1 -1
  11. package/dist/catalyst/scss/core/_form.scss +6 -0
  12. package/dist/catalyst/scss/core/_typography.scss +14 -13
  13. package/dist/catalyst/scss/utils/_color.scss +11 -1
  14. package/dist/catalyst/scss/utils/_typography.mixins.scss +1 -2
  15. package/dist/cjs/cat-alert_26.cjs.entry.js +14 -10
  16. package/dist/cjs/cat-alert_26.cjs.entry.js.map +1 -1
  17. package/dist/cjs/catalyst.cjs.js +1 -1
  18. package/dist/cjs/index.cjs.js +31 -9
  19. package/dist/cjs/index.cjs.js.map +1 -1
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/cjs/{of-8545b523.js → of-395b2f57.js} +6 -2
  22. package/dist/cjs/of-395b2f57.js.map +1 -0
  23. package/dist/collection/components/cat-alert/cat-alert.css +29 -0
  24. package/dist/collection/components/cat-alert/cat-alert.js +2 -0
  25. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
  26. package/dist/collection/components/cat-badge/cat-badge.css +6 -0
  27. package/dist/collection/components/cat-badge/cat-badge.js +2 -2
  28. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
  29. package/dist/collection/components/cat-button/cat-button.css +17 -0
  30. package/dist/collection/components/cat-button/cat-button.js +2 -2
  31. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  32. package/dist/collection/components/cat-checkbox/cat-checkbox.js +27 -9
  33. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  34. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.css +0 -2
  35. package/dist/collection/components/cat-icon/cat-icon-registry.js +3 -1
  36. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
  37. package/dist/collection/components/cat-input/cat-input.css +98 -2
  38. package/dist/collection/components/cat-select/cat-select.css +96 -1
  39. package/dist/collection/components/cat-select/cat-select.js +4 -4
  40. package/dist/collection/components/cat-select/connectors.js +28 -8
  41. package/dist/collection/components/cat-select/connectors.js.map +1 -1
  42. package/dist/collection/components/cat-textarea/cat-textarea.css +96 -1
  43. package/dist/collection/components/cat-toggle/cat-toggle.js +28 -10
  44. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  45. package/dist/collection/index.js +1 -1
  46. package/dist/collection/index.js.map +1 -1
  47. package/dist/collection/scss/core/_base.scss +1 -1
  48. package/dist/collection/scss/core/_form.scss +6 -0
  49. package/dist/collection/scss/core/_typography.scss +14 -13
  50. package/dist/collection/scss/utils/_color.scss +11 -1
  51. package/dist/collection/scss/utils/_typography.mixins.scss +1 -2
  52. package/dist/components/cat-alert.js +3 -1
  53. package/dist/components/cat-alert.js.map +1 -1
  54. package/dist/components/cat-badge.js +1 -1
  55. package/dist/components/cat-badge.js.map +1 -1
  56. package/dist/components/cat-button2.js +1 -1
  57. package/dist/components/cat-button2.js.map +1 -1
  58. package/dist/components/cat-checkbox2.js +4 -2
  59. package/dist/components/cat-checkbox2.js.map +1 -1
  60. package/dist/components/cat-datepicker-inline.js +1 -1
  61. package/dist/components/cat-datepicker-inline.js.map +1 -1
  62. package/dist/components/cat-dropdown2.js.map +1 -1
  63. package/dist/components/cat-icon-registry.js +5 -1
  64. package/dist/components/cat-icon-registry.js.map +1 -1
  65. package/dist/components/cat-input2.js +1 -1
  66. package/dist/components/cat-input2.js.map +1 -1
  67. package/dist/components/cat-select2.js +1 -1
  68. package/dist/components/cat-select2.js.map +1 -1
  69. package/dist/components/cat-textarea.js +1 -1
  70. package/dist/components/cat-textarea.js.map +1 -1
  71. package/dist/components/cat-toggle.js +4 -2
  72. package/dist/components/cat-toggle.js.map +1 -1
  73. package/dist/components/index.js +29 -9
  74. package/dist/components/index.js.map +1 -1
  75. package/dist/esm/cat-alert_26.entry.js +14 -10
  76. package/dist/esm/cat-alert_26.entry.js.map +1 -1
  77. package/dist/esm/catalyst.js +1 -1
  78. package/dist/esm/index.js +31 -11
  79. package/dist/esm/index.js.map +1 -1
  80. package/dist/esm/loader.js +1 -1
  81. package/dist/esm/{of-a965d8fb.js → of-04d3d9e1.js} +6 -2
  82. package/dist/esm/of-04d3d9e1.js.map +1 -0
  83. package/dist/types/components/cat-badge/cat-badge.d.ts +1 -1
  84. package/dist/types/components/cat-button/cat-button.d.ts +1 -1
  85. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +8 -4
  86. package/dist/types/components/cat-select/connectors.d.ts +24 -1
  87. package/dist/types/components/cat-toggle/cat-toggle.d.ts +9 -5
  88. package/dist/types/components.d.ts +36 -20
  89. package/dist/types/index.d.ts +1 -1
  90. package/package.json +2 -2
  91. package/dist/catalyst/p-19fad7af.js +0 -2
  92. package/dist/catalyst/p-19fad7af.js.map +0 -1
  93. package/dist/catalyst/p-bd6c4003.entry.js +0 -10
  94. package/dist/catalyst/p-bd6c4003.entry.js.map +0 -1
  95. package/dist/cjs/of-8545b523.js.map +0 -1
  96. package/dist/esm/of-a965d8fb.js.map +0 -1
@@ -1,20 +1,40 @@
1
1
  import { of } from "rxjs";
2
2
  /**
3
- * Creates a connector that resolves local string array data.
3
+ * Creates a connector that resolves local object array data.
4
4
  *
5
- * @param data the string array to connect to
6
- * @returns a connector that resolves local string array data
5
+ * @param data the object array to connect to
6
+ * @returns a connector that resolves local object array data
7
7
  */
8
- export function stringArrayConnector(data) {
9
- const toItem = (id) => ({ id, name: id });
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ export function objectArrayConnector(data) {
10
10
  return {
11
- resolve: ids => of(data.filter(id => ids.includes(id)).map(toItem)),
11
+ resolve: ids => of(data.filter(({ id }) => ids.includes(id))),
12
12
  retrieve: term => of({
13
- content: data.filter(id => id.toLowerCase().includes(term.toLowerCase())).map(toItem),
13
+ content: data.filter(({ id }) => id.toLowerCase().includes(term.toLowerCase())),
14
14
  last: true,
15
15
  totalElements: data.length
16
16
  }),
17
- render: item => ({ label: item.name })
17
+ render: ({ label }) => ({ label })
18
18
  };
19
19
  }
20
+ /**
21
+ * Creates a connector that resolves local string array data.
22
+ *
23
+ * @param data the string array to connect to
24
+ * @returns a connector that resolves local string array data
25
+ */
26
+ export function stringArrayConnector(data) {
27
+ const items = data.map(id => ({ id, label: id }));
28
+ return objectArrayConnector(items);
29
+ }
30
+ /**
31
+ * Creates a connector that resolves local string map data.
32
+ *
33
+ * @param data the string map to connect to
34
+ * @returns a connector that resolves local string map data
35
+ */
36
+ export function stringMapConnector(data) {
37
+ const items = Array.from(data).map(([id, label]) => ({ id, label }));
38
+ return objectArrayConnector(items);
39
+ }
20
40
  //# sourceMappingURL=connectors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectors.js","sourceRoot":"","sources":["../../../src/components/cat-select/connectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAG1B;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAc;EACjD,MAAM,MAAM,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;EAClD,OAAO;IACL,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACnE,QAAQ,EAAE,IAAI,CAAC,EAAE,CACf,EAAE,CAAC;MACD,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;MACrF,IAAI,EAAE,IAAI;MACV,aAAa,EAAE,IAAI,CAAC,MAAM;KAC3B,CAAC;IACJ,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;GACvC,CAAC;AACJ,CAAC","sourcesContent":["import { of } from 'rxjs';\nimport { CatSelectConnector } from './cat-select';\n\n/**\n * Creates a connector that resolves local string array data.\n *\n * @param data the string array to connect to\n * @returns a connector that resolves local string array data\n */\nexport function stringArrayConnector(data: string[]): CatSelectConnector {\n const toItem = (id: string) => ({ id, name: id });\n return {\n resolve: ids => of(data.filter(id => ids.includes(id)).map(toItem)),\n retrieve: term =>\n of({\n content: data.filter(id => id.toLowerCase().includes(term.toLowerCase())).map(toItem),\n last: true,\n totalElements: data.length\n }),\n render: item => ({ label: item.name })\n };\n}\n"]}
1
+ {"version":3,"file":"connectors.js","sourceRoot":"","sources":["../../../src/components/cat-select/connectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAG1B;;;;;GAKG;AACH,8DAA8D;AAC9D,MAAM,UAAU,oBAAoB,CAAgD,IAAS;EAC3F,OAAO;IACL,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7D,QAAQ,EAAE,IAAI,CAAC,EAAE,CACf,EAAE,CAAC;MACD,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;MAC/E,IAAI,EAAE,IAAI;MACV,aAAa,EAAE,IAAI,CAAC,MAAM;KAC3B,CAAC;IACJ,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;GACnC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAc;EACjD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;EAClD,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAyB;EAC1D,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;EACrE,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import { of } from 'rxjs';\nimport { CatSelectConnector } from './cat-select';\n\n/**\n * Creates a connector that resolves local object array data.\n *\n * @param data the object array to connect to\n * @returns a connector that resolves local object array data\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function objectArrayConnector<T extends { id: string; label: string } = any>(data: T[]): CatSelectConnector<T> {\n return {\n resolve: ids => of(data.filter(({ id }) => ids.includes(id))),\n retrieve: term =>\n of({\n content: data.filter(({ id }) => id.toLowerCase().includes(term.toLowerCase())),\n last: true,\n totalElements: data.length\n }),\n render: ({ label }) => ({ label })\n };\n}\n\n/**\n * Creates a connector that resolves local string array data.\n *\n * @param data the string array to connect to\n * @returns a connector that resolves local string array data\n */\nexport function stringArrayConnector(data: string[]): CatSelectConnector<{ id: string; label: string }> {\n const items = data.map(id => ({ id, label: id }));\n return objectArrayConnector(items);\n}\n\n/**\n * Creates a connector that resolves local string map data.\n *\n * @param data the string map to connect to\n * @returns a connector that resolves local string map data\n */\nexport function stringMapConnector(data: Map<string, string>): CatSelectConnector<{ id: string; label: string }> {\n const items = Array.from(data).map(([id, label]) => ({ id, label }));\n return objectArrayConnector(items);\n}\n"]}
@@ -26,6 +26,10 @@
26
26
  .cat-bg-primary {
27
27
  background-color: rgb(var(--cat-primary-bg, 0, 129, 148)) !important;
28
28
  color: rgb(var(--cat-primary-fill, 255, 255, 255)) !important;
29
+ --cat-primary-text: cat-token("color.theme.primary.fill", $wrap: false);
30
+ --cat-primary-text-hover: cat-token("color.theme.primary.fill-hover", $wrap: false);
31
+ --cat-primary-text-active: cat-token("color.theme.primary.fill-active", $wrap: false);
32
+ --cat-link-decoration: underline;
29
33
  }
30
34
 
31
35
  .cat-bg-primary-hover {
@@ -34,6 +38,10 @@
34
38
  .cat-bg-primary-hover:hover {
35
39
  background-color: rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;
36
40
  color: rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important;
41
+ --cat-primary-text: cat-token("color.theme.primary.fill", $wrap: false);
42
+ --cat-primary-text-hover: cat-token("color.theme.primary.fill-hover", $wrap: false);
43
+ --cat-primary-text-active: cat-token("color.theme.primary.fill-active", $wrap: false);
44
+ --cat-link-decoration: underline;
37
45
  }
38
46
 
39
47
  .cat-text-primary,
@@ -57,6 +65,10 @@
57
65
  .cat-bg-primaryInverted {
58
66
  background-color: #93b4f2 !important;
59
67
  color: black !important;
68
+ --cat-primary-text: cat-token("color.theme.primaryInverted.fill", $wrap: false);
69
+ --cat-primary-text-hover: cat-token("color.theme.primaryInverted.fill-hover", $wrap: false);
70
+ --cat-primary-text-active: cat-token("color.theme.primaryInverted.fill-active", $wrap: false);
71
+ --cat-link-decoration: underline;
60
72
  }
61
73
 
62
74
  .cat-bg-primaryInverted-hover {
@@ -65,6 +77,10 @@
65
77
  .cat-bg-primaryInverted-hover:hover {
66
78
  background-color: #93b4f2 !important;
67
79
  color: black !important;
80
+ --cat-primary-text: cat-token("color.theme.primaryInverted.fill", $wrap: false);
81
+ --cat-primary-text-hover: cat-token("color.theme.primaryInverted.fill-hover", $wrap: false);
82
+ --cat-primary-text-active: cat-token("color.theme.primaryInverted.fill-active", $wrap: false);
83
+ --cat-link-decoration: underline;
68
84
  }
69
85
 
70
86
  .cat-text-primaryInverted,
@@ -88,6 +104,10 @@
88
104
  .cat-bg-secondary {
89
105
  background-color: rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;
90
106
  color: rgb(var(--cat-secondary-fill, 255, 255, 255)) !important;
107
+ --cat-primary-text: cat-token("color.theme.secondary.fill", $wrap: false);
108
+ --cat-primary-text-hover: cat-token("color.theme.secondary.fill-hover", $wrap: false);
109
+ --cat-primary-text-active: cat-token("color.theme.secondary.fill-active", $wrap: false);
110
+ --cat-link-decoration: underline;
91
111
  }
92
112
 
93
113
  .cat-bg-secondary-hover {
@@ -96,6 +116,10 @@
96
116
  .cat-bg-secondary-hover:hover {
97
117
  background-color: rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;
98
118
  color: rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important;
119
+ --cat-primary-text: cat-token("color.theme.secondary.fill", $wrap: false);
120
+ --cat-primary-text-hover: cat-token("color.theme.secondary.fill-hover", $wrap: false);
121
+ --cat-primary-text-active: cat-token("color.theme.secondary.fill-active", $wrap: false);
122
+ --cat-link-decoration: underline;
99
123
  }
100
124
 
101
125
  .cat-text-secondary,
@@ -119,6 +143,10 @@
119
143
  .cat-bg-secondaryInverted {
120
144
  background-color: #697687 !important;
121
145
  color: black !important;
146
+ --cat-primary-text: cat-token("color.theme.secondaryInverted.fill", $wrap: false);
147
+ --cat-primary-text-hover: cat-token("color.theme.secondaryInverted.fill-hover", $wrap: false);
148
+ --cat-primary-text-active: cat-token("color.theme.secondaryInverted.fill-active", $wrap: false);
149
+ --cat-link-decoration: underline;
122
150
  }
123
151
 
124
152
  .cat-bg-secondaryInverted-hover {
@@ -127,6 +155,10 @@
127
155
  .cat-bg-secondaryInverted-hover:hover {
128
156
  background-color: #697687 !important;
129
157
  color: black !important;
158
+ --cat-primary-text: cat-token("color.theme.secondaryInverted.fill", $wrap: false);
159
+ --cat-primary-text-hover: cat-token("color.theme.secondaryInverted.fill-hover", $wrap: false);
160
+ --cat-primary-text-active: cat-token("color.theme.secondaryInverted.fill-active", $wrap: false);
161
+ --cat-link-decoration: underline;
130
162
  }
131
163
 
132
164
  .cat-text-secondaryInverted,
@@ -147,9 +179,52 @@
147
179
  color: white !important;
148
180
  }
149
181
 
182
+ .cat-bg-info {
183
+ background-color: rgb(var(--cat-success-bg, 0, 115, 230)) !important;
184
+ color: rgb(var(--cat-success-fill, 255, 255, 255)) !important;
185
+ --cat-primary-text: cat-token("color.theme.info.fill", $wrap: false);
186
+ --cat-primary-text-hover: cat-token("color.theme.info.fill-hover", $wrap: false);
187
+ --cat-primary-text-active: cat-token("color.theme.info.fill-active", $wrap: false);
188
+ --cat-link-decoration: underline;
189
+ }
190
+
191
+ .cat-bg-info-hover {
192
+ transition: background-color 125ms, color 125ms;
193
+ }
194
+ .cat-bg-info-hover:hover {
195
+ background-color: rgb(var(--cat-success-bg-hover, 0, 107, 227)) !important;
196
+ color: rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;
197
+ --cat-primary-text: cat-token("color.theme.info.fill", $wrap: false);
198
+ --cat-primary-text-hover: cat-token("color.theme.info.fill-hover", $wrap: false);
199
+ --cat-primary-text-active: cat-token("color.theme.info.fill-active", $wrap: false);
200
+ --cat-link-decoration: underline;
201
+ }
202
+
203
+ .cat-text-info,
204
+ .cat-link-info {
205
+ color: rgb(var(--cat-success-text, 0, 115, 230)) !important;
206
+ }
207
+
208
+ .cat-link-info,
209
+ .cat-text-info-hover {
210
+ transition: color 125ms;
211
+ }
212
+ .cat-link-info:hover,
213
+ .cat-text-info-hover:hover {
214
+ color: rgb(var(--cat-success-text-hover, 0, 107, 227)) !important;
215
+ }
216
+ .cat-link-info:active,
217
+ .cat-text-info-hover:active {
218
+ color: rgb(var(--cat-success-text-active, 0, 96, 223)) !important;
219
+ }
220
+
150
221
  .cat-bg-success {
151
222
  background-color: rgb(var(--cat-success-bg, 0, 132, 88)) !important;
152
223
  color: rgb(var(--cat-success-fill, 255, 255, 255)) !important;
224
+ --cat-primary-text: cat-token("color.theme.success.fill", $wrap: false);
225
+ --cat-primary-text-hover: cat-token("color.theme.success.fill-hover", $wrap: false);
226
+ --cat-primary-text-active: cat-token("color.theme.success.fill-active", $wrap: false);
227
+ --cat-link-decoration: underline;
153
228
  }
154
229
 
155
230
  .cat-bg-success-hover {
@@ -158,6 +233,10 @@
158
233
  .cat-bg-success-hover:hover {
159
234
  background-color: rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;
160
235
  color: rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;
236
+ --cat-primary-text: cat-token("color.theme.success.fill", $wrap: false);
237
+ --cat-primary-text-hover: cat-token("color.theme.success.fill-hover", $wrap: false);
238
+ --cat-primary-text-active: cat-token("color.theme.success.fill-active", $wrap: false);
239
+ --cat-link-decoration: underline;
161
240
  }
162
241
 
163
242
  .cat-text-success,
@@ -181,6 +260,10 @@
181
260
  .cat-bg-warning {
182
261
  background-color: rgb(var(--cat-warning-bg, 255, 206, 128)) !important;
183
262
  color: rgb(var(--cat-warning-fill, 0, 0, 0)) !important;
263
+ --cat-primary-text: cat-token("color.theme.warning.fill", $wrap: false);
264
+ --cat-primary-text-hover: cat-token("color.theme.warning.fill-hover", $wrap: false);
265
+ --cat-primary-text-active: cat-token("color.theme.warning.fill-active", $wrap: false);
266
+ --cat-link-decoration: underline;
184
267
  }
185
268
 
186
269
  .cat-bg-warning-hover {
@@ -189,6 +272,10 @@
189
272
  .cat-bg-warning-hover:hover {
190
273
  background-color: rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;
191
274
  color: rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important;
275
+ --cat-primary-text: cat-token("color.theme.warning.fill", $wrap: false);
276
+ --cat-primary-text-hover: cat-token("color.theme.warning.fill-hover", $wrap: false);
277
+ --cat-primary-text-active: cat-token("color.theme.warning.fill-active", $wrap: false);
278
+ --cat-link-decoration: underline;
192
279
  }
193
280
 
194
281
  .cat-text-warning,
@@ -212,6 +299,10 @@
212
299
  .cat-bg-danger {
213
300
  background-color: rgb(var(--cat-danger-bg, 217, 52, 13)) !important;
214
301
  color: rgb(var(--cat-danger-fill, 255, 255, 255)) !important;
302
+ --cat-primary-text: cat-token("color.theme.danger.fill", $wrap: false);
303
+ --cat-primary-text-hover: cat-token("color.theme.danger.fill-hover", $wrap: false);
304
+ --cat-primary-text-active: cat-token("color.theme.danger.fill-active", $wrap: false);
305
+ --cat-link-decoration: underline;
215
306
  }
216
307
 
217
308
  .cat-bg-danger-hover {
@@ -220,6 +311,10 @@
220
311
  .cat-bg-danger-hover:hover {
221
312
  background-color: rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;
222
313
  color: rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important;
314
+ --cat-primary-text: cat-token("color.theme.danger.fill", $wrap: false);
315
+ --cat-primary-text-hover: cat-token("color.theme.danger.fill-hover", $wrap: false);
316
+ --cat-primary-text-active: cat-token("color.theme.danger.fill-active", $wrap: false);
317
+ --cat-link-decoration: underline;
223
318
  }
224
319
 
225
320
  .cat-text-danger,
@@ -257,7 +352,7 @@
257
352
  }
258
353
 
259
354
  .cat-bg-muted {
260
- color: rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;
355
+ background-color: #f2f4f7 !important;
261
356
  }
262
357
 
263
358
  .cat-text-reset {
@@ -24,6 +24,7 @@ export class CatToggle {
24
24
  this.name = undefined;
25
25
  this.required = false;
26
26
  this.value = undefined;
27
+ this.noValue = undefined;
27
28
  this.resolvedValue = null;
28
29
  this.hint = undefined;
29
30
  this.labelLeft = false;
@@ -77,7 +78,7 @@ export class CatToggle {
77
78
  this.catBlur.emit(event);
78
79
  }
79
80
  updateResolved() {
80
- this.resolvedValue = this.value == null ? this.checked : this.checked ? this.value : null;
81
+ this.resolvedValue = this.checked ? this.value ?? true : this.noValue ?? false;
81
82
  }
82
83
  static get is() { return "cat-toggle"; }
83
84
  static get encapsulation() { return "shadow"; }
@@ -218,35 +219,52 @@ export class CatToggle {
218
219
  "defaultValue": "false"
219
220
  },
220
221
  "value": {
221
- "type": "string",
222
+ "type": "any",
222
223
  "mutable": false,
223
224
  "complexType": {
224
- "original": "string",
225
- "resolved": "string | undefined",
225
+ "original": "any",
226
+ "resolved": "any",
226
227
  "references": {}
227
228
  },
228
229
  "required": false,
229
230
  "optional": true,
230
231
  "docs": {
231
232
  "tags": [],
232
- "text": "The value of the toggle."
233
+ "text": "The value of the checked toggle."
233
234
  },
234
235
  "attribute": "value",
235
236
  "reflect": false
236
237
  },
238
+ "noValue": {
239
+ "type": "any",
240
+ "mutable": false,
241
+ "complexType": {
242
+ "original": "any",
243
+ "resolved": "any",
244
+ "references": {}
245
+ },
246
+ "required": false,
247
+ "optional": true,
248
+ "docs": {
249
+ "tags": [],
250
+ "text": "The value of the unchecked toggle."
251
+ },
252
+ "attribute": "no-value",
253
+ "reflect": false
254
+ },
237
255
  "resolvedValue": {
238
256
  "type": "any",
239
257
  "mutable": true,
240
258
  "complexType": {
241
- "original": "string | boolean | null",
242
- "resolved": "boolean | null | string",
259
+ "original": "any",
260
+ "resolved": "any",
243
261
  "references": {}
244
262
  },
245
263
  "required": false,
246
264
  "optional": false,
247
265
  "docs": {
248
266
  "tags": [],
249
- "text": "The resolved value of the toggle, based on the checked state and value."
267
+ "text": "The resolved value of the toggle, based on the checked state, value and noValue."
250
268
  },
251
269
  "attribute": "resolved-value",
252
270
  "reflect": false,
@@ -322,8 +340,8 @@ export class CatToggle {
322
340
  "text": "Emitted when the checked status of the toggle is changed."
323
341
  },
324
342
  "complexType": {
325
- "original": "boolean | string | null",
326
- "resolved": "boolean | null | string",
343
+ "original": "any",
344
+ "resolved": "any",
327
345
  "references": {}
328
346
  }
329
347
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"cat-toggle.js","sourceRoot":"","sources":["../../../src/components/cat-toggle/cat-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;GAQG;AAMH,MAAM,OAAO,SAAS;;IACH,QAAG,GAAG,cAAc,YAAY,EAAE,EAAE,CAAC;2BAS3B,KAAK;0BAEN,KAAK;mBAKI,KAAK;oBAKrB,KAAK;;iBAUR,EAAE;uBAKI,KAAK;;oBAUR,KAAK;;yBAU0C,IAAI;;qBAUlD,KAAK;;;EAjEzB,IAAY,EAAE;IACZ,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,GAAG,CAAC;EACrC,CAAC;EAqFD,iBAAiB;IACf,IAAI,CAAC,cAAc,EAAE,CAAC;EACxB,CAAC;EAED,mBAAmB;IACjB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC1E,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IACxE,IAAI,CAAC,IAAI,C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AAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;EAC5F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\n\nlet nextUniqueId = 0;\n\n/**\n * Toggles are graphical interface switches that give user control over a\n * feature or option that can be turned on or off.\n *\n * @slot hint - Optional hint element to be displayed with the toggle.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part toggle - The toggle element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-toggle',\n styleUrls: ['cat-toggle.scss'],\n shadow: true\n})\nexport class CatToggle {\n private readonly _id = `cat-toggle-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n /**\n * Checked state of the toggle.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Disabled state of the toggle.\n */\n @Prop() disabled = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label of the toggle that is visible.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * The name of the input.\n */\n @Prop() name?: string;\n\n /**\n * Required state of the toggle.\n */\n @Prop() required = false;\n\n /**\n * The value of the toggle.\n */\n @Prop() value?: string;\n\n /**\n * The resolved value of the toggle, based on the checked state and value.\n */\n @Prop({ mutable: true }) resolvedValue: string | boolean | null = null;\n\n /**\n * Optional hint text(s) to be displayed with the toggle.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the toggle.\n */\n @Prop() labelLeft = false;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the checked status of the toggle is changed.\n */\n @Event() catChange!: EventEmitter<boolean | string | null>;\n\n /**\n * Emitted when the toggle received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the toggle loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad() {\n this.updateResolved();\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on toggle', this);\n }\n }\n\n /**\n * Programmatically move focus to the toggle. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the toggle. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n render() {\n return (\n <Host>\n <label\n htmlFor={this.id}\n class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }}\n >\n <input\n {...this.nativeAttributes}\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n class=\"form-check-input\"\n role=\"switch\"\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-describedby={this.hasHint ? this.id + '-hint' : undefined}\n />\n <span class=\"toggle\" part=\"toggle\"></span>\n <span class=\"label\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {this.hasHint && (\n <div class={{ 'hint-wrapper': true, 'label-left': this.labelLeft }}>\n <div class=\"toggle-placeholder\"></div>\n <CatFormHint id={this.id} hint={this.hint} slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>} />\n </div>\n )}\n </Host>\n );\n }\n\n private get hasHint() {\n return !!this.hint || !!this.hasSlottedHint;\n }\n\n private onInput() {\n this.checked = this.input.checked;\n this.updateResolved();\n this.catChange.emit(this.resolvedValue);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n\n private updateResolved() {\n this.resolvedValue = this.value == null ? this.checked : this.checked ? this.value : null;\n }\n}\n"]}
1
+ {"version":3,"file":"cat-toggle.js","sourceRoot":"","sources":["../../../src/components/cat-toggle/cat-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;GAQG;AAMH,MAAM,OAAO,SAAS;;IACH,QAAG,GAAG,cAAc,YAAY,EAAE,EAAE,CAAC;2BA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AC,IAAI,CAAC,cAAc,CAAC;EAC9C,CAAC;EAEO,OAAO;IACb,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAClC,IAAI,CAAC,cAAc,EAAE,CAAC;IACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;EAC1C,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3B,CAAC;EAEO,cAAc;IACpB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC;EACjF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\n\nlet nextUniqueId = 0;\n\n/**\n * Toggles are graphical interface switches that give user control over a\n * feature or option that can be turned on or off.\n *\n * @slot hint - Optional hint element to be displayed with the toggle.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part toggle - The toggle element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-toggle',\n styleUrls: ['cat-toggle.scss'],\n shadow: true\n})\nexport class CatToggle {\n private readonly _id = `cat-toggle-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n /**\n * Checked state of the toggle.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Disabled state of the toggle.\n */\n @Prop() disabled = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label of the toggle that is visible.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * The name of the input.\n */\n @Prop() name?: string;\n\n /**\n * Required state of the toggle.\n */\n @Prop() required = false;\n\n /**\n * The value of the checked toggle.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop() value?: any;\n\n /**\n * The value of the unchecked toggle.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop() noValue?: any;\n\n /**\n * The resolved value of the toggle, based on the checked state, value and noValue.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Prop({ mutable: true }) resolvedValue: any = null;\n\n /**\n * Optional hint text(s) to be displayed with the toggle.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the toggle.\n */\n @Prop() labelLeft = false;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the checked status of the toggle is changed.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Event() catChange!: EventEmitter<any>;\n\n /**\n * Emitted when the toggle received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the toggle loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad() {\n this.updateResolved();\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on toggle', this);\n }\n }\n\n /**\n * Programmatically move focus to the toggle. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the toggle. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n render() {\n return (\n <Host>\n <label\n htmlFor={this.id}\n class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }}\n >\n <input\n {...this.nativeAttributes}\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n class=\"form-check-input\"\n role=\"switch\"\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-describedby={this.hasHint ? this.id + '-hint' : undefined}\n />\n <span class=\"toggle\" part=\"toggle\"></span>\n <span class=\"label\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {this.hasHint && (\n <div class={{ 'hint-wrapper': true, 'label-left': this.labelLeft }}>\n <div class=\"toggle-placeholder\"></div>\n <CatFormHint id={this.id} hint={this.hint} slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>} />\n </div>\n )}\n </Host>\n );\n }\n\n private get hasHint() {\n return !!this.hint || !!this.hasSlottedHint;\n }\n\n private onInput() {\n this.checked = this.input.checked;\n this.updateResolved();\n this.catChange.emit(this.resolvedValue);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n\n private updateResolved() {\n this.resolvedValue = this.checked ? this.value ?? true : this.noValue ?? false;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  export { CatI18nRegistry, catI18nRegistry } from './components/cat-i18n/cat-i18n-registry';
2
2
  export { CatIconRegistry, catIconRegistry } from './components/cat-icon/cat-icon-registry';
3
3
  export { CatNotificationService, catNotificationService } from './components/cat-notification/cat-notification';
4
- export { stringArrayConnector } from './components/cat-select/connectors';
4
+ export { objectArrayConnector, stringArrayConnector, stringMapConnector } from './components/cat-select/connectors';
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EACL,sBAAsB,EAEtB,sBAAsB,EACvB,MAAM,gDAAgD,CAAC;AASxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export { Components, JSX } from './components';\nexport { CatI18nRegistry, catI18nRegistry } from './components/cat-i18n/cat-i18n-registry';\nexport { CatIconRegistry, catIconRegistry } from './components/cat-icon/cat-icon-registry';\nexport {\n CatNotificationService,\n ToastOptions,\n catNotificationService\n} from './components/cat-notification/cat-notification';\nexport {\n CatSelectConnector,\n CatSelectMultipleTaggingValue,\n CatSelectTaggingValue,\n Item,\n Page,\n RenderInfo\n} from './components/cat-select/cat-select';\nexport { stringArrayConnector } from './components/cat-select/connectors';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EACL,sBAAsB,EAEtB,sBAAsB,EACvB,MAAM,gDAAgD,CAAC;AASxD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export { Components, JSX } from './components';\nexport { CatI18nRegistry, catI18nRegistry } from './components/cat-i18n/cat-i18n-registry';\nexport { CatIconRegistry, catIconRegistry } from './components/cat-icon/cat-icon-registry';\nexport {\n CatNotificationService,\n ToastOptions,\n catNotificationService\n} from './components/cat-notification/cat-notification';\nexport {\n CatSelectConnector,\n CatSelectMultipleTaggingValue,\n CatSelectTaggingValue,\n Item,\n Page,\n RenderInfo\n} from './components/cat-select/cat-select';\nexport { objectArrayConnector, stringArrayConnector, stringMapConnector } from './components/cat-select/connectors';\n"]}
@@ -8,6 +8,6 @@ body {
8
8
 
9
9
  body {
10
10
  @include cat-body('m');
11
- font-family: cat-token('font.family.body'), $font-fallback-base, cat-token('font.family.emoji'), $font-fallback-emoji;
11
+ font-family: cat-token('font.family.base'), $font-fallback-base, cat-token('font.family.emoji'), $font-fallback-emoji;
12
12
  color: cat-token('color.ui.font.base');
13
13
  }
@@ -12,3 +12,9 @@
12
12
  margin-bottom: 0.5rem;
13
13
  }
14
14
  }
15
+
16
+ .cat-label {
17
+ @include cat-body('m');
18
+ display: block;
19
+ margin-bottom: 0.5rem;
20
+ }
@@ -105,22 +105,11 @@ ul {
105
105
  padding-left: 2rem;
106
106
  }
107
107
 
108
- ol,
109
- ul,
110
- dl {
111
- ol,
112
- ul,
113
- dl {
114
- margin-bottom: 0;
115
- }
116
- }
117
-
118
108
  nav ol,
119
109
  nav ul,
120
110
  ol.cat-plain,
121
111
  ul.cat-plain {
122
112
  list-style: none;
123
- margin: 0;
124
113
  padding: 0;
125
114
  }
126
115
 
@@ -128,7 +117,7 @@ dt {
128
117
  font-weight: 600;
129
118
  }
130
119
 
131
- dd {
120
+ dd:not(:last-child) {
132
121
  margin-bottom: 0.5rem;
133
122
  margin-left: 0;
134
123
  }
@@ -228,6 +217,7 @@ code {
228
217
  :where(h1, h2, h3),
229
218
  :is(.cat-h1, .cat-h2, .cat-h3) {
230
219
  color: $cat-font-color-head;
220
+ font-family: $cat-font-family-head, $font-fallback-base, cat-token('font.family.emoji'), $font-fallback-emoji;
231
221
  margin-bottom: calc($cat-head-margin-bottom * var(--cat-article-spacer, 1));
232
222
 
233
223
  &:has(+ h1, + h2, + h3, + h4, + h5, + h6, + .cat-h1, + .cat-h2, + .cat-h3, + .cat-h4, + .cat-h5, + .cat-h6) {
@@ -238,13 +228,24 @@ code {
238
228
  :where(h4, h5, h6),
239
229
  :is(.cat-h4, .cat-h5, .cat-h6) {
240
230
  color: $cat-font-color-head;
231
+ font-family: $cat-font-family-head, $font-fallback-base, cat-token('font.family.emoji'), $font-fallback-emoji;
241
232
  margin-bottom: calc($cat-head-margin-bottom * 0.5 * var(--cat-article-spacer, 1));
242
233
  }
243
234
 
244
- :where(p, ol, ul, dl, blockquote, figure, pre, cat-alert, cat-card) {
235
+ :where(p, ol, ul, dl, blockquote, figure, pre, table, cat-alert, cat-card):not(:last-child) {
245
236
  margin-bottom: calc($cat-body-margin-bottom * var(--cat-article-spacer, 1));
246
237
  }
247
238
 
239
+ ol,
240
+ ul,
241
+ dl {
242
+ ol,
243
+ ul,
244
+ dl {
245
+ margin-bottom: 0;
246
+ }
247
+ }
248
+
248
249
  hr,
249
250
  .cat-hr {
250
251
  margin: calc($cat-body-margin-bottom * var(--cat-article-spacer, 1)) 0;
@@ -4,6 +4,11 @@
4
4
  .cat-bg-#{$name} {
5
5
  background-color: cat-token('color.theme.#{$name}.bg') !important;
6
6
  color: cat-token('color.theme.#{$name}.fill') !important;
7
+ // adjust nested links
8
+ --cat-primary-text: cat-token('color.theme.#{$name}.fill', $wrap: false);
9
+ --cat-primary-text-hover: cat-token('color.theme.#{$name}.fill-hover', $wrap: false);
10
+ --cat-primary-text-active: cat-token('color.theme.#{$name}.fill-active', $wrap: false);
11
+ --cat-link-decoration: underline;
7
12
  }
8
13
 
9
14
  .cat-bg-#{$name}-hover {
@@ -14,6 +19,11 @@
14
19
  &:hover {
15
20
  background-color: cat-token('color.theme.#{$name}.bgHover') !important;
16
21
  color: cat-token('color.theme.#{$name}.fillHover') !important;
22
+ // adjust nested links
23
+ --cat-primary-text: cat-token('color.theme.#{$name}.fill', $wrap: false);
24
+ --cat-primary-text-hover: cat-token('color.theme.#{$name}.fill-hover', $wrap: false);
25
+ --cat-primary-text-active: cat-token('color.theme.#{$name}.fill-active', $wrap: false);
26
+ --cat-link-decoration: underline;
17
27
  }
18
28
  }
19
29
 
@@ -55,7 +65,7 @@
55
65
  }
56
66
 
57
67
  .cat-bg-muted {
58
- color: cat-token('color.ui.font.muted') !important;
68
+ background-color: cat-token('color.ui.background.muted') !important;
59
69
  }
60
70
 
61
71
  .cat-text-reset {
@@ -11,8 +11,7 @@
11
11
  }
12
12
 
13
13
  @mixin cat-head($size, $weight: cat-token('font.weight.head')) {
14
- // skip color, as it is only set for editorial styles
15
- font-family: $cat-font-family-head, $font-fallback-base, cat-token('font.family.emoji'), $font-fallback-emoji;
14
+ // skip color and family, as it is only set for editorial styles
16
15
  font-size: cat-head-font-size($size);
17
16
  line-height: cat-head-line-height($size);
18
17
  font-weight: $weight;
@@ -7,7 +7,7 @@ function setAttributeDefault(host, attr, value) {
7
7
  }
8
8
  }
9
9
 
10
- const catAlertCss = ":host{display:flex;gap:0.5rem;padding:1.25rem;border-radius:var(--cat-border-radius-l, 0.5rem)}:host([hidden]){display:none}:host(:focus-visible){outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.content{align-self:center}::slotted(:last-child){margin-bottom:0 !important}:host([color=primary]){background-color:rgb(var(--cat-primary-bg, 0, 129, 148));color:rgb(var(--cat-primary-fill, 255, 255, 255))}:host([color=secondary]){background-color:rgb(var(--cat-secondary-bg, 105, 118, 135));color:rgb(var(--cat-secondary-fill, 255, 255, 255))}:host([color=success]){background-color:rgb(var(--cat-success-bg, 0, 132, 88));color:rgb(var(--cat-success-fill, 255, 255, 255))}:host([color=warning]){background-color:rgb(var(--cat-warning-bg, 255, 206, 128));color:rgb(var(--cat-warning-fill, 0, 0, 0))}:host([color=danger]){background-color:rgb(var(--cat-danger-bg, 217, 52, 13));color:rgb(var(--cat-danger-fill, 255, 255, 255))}";
10
+ const catAlertCss = ":host{display:flex;gap:0.5rem;padding:1.25rem;border-radius:var(--cat-border-radius-l, 0.5rem)}:host([hidden]){display:none}:host(:focus-visible){outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.content{align-self:center}::slotted(:last-child){margin-bottom:0 !important}:host([color=primary]){background-color:rgb(var(--cat-primary-bg, 0, 129, 148));color:rgb(var(--cat-primary-fill, 255, 255, 255));--cat-primary-text:cat-token(\"color.theme.primary.fill\", $wrap: false);--cat-primary-text-hover:cat-token(\"color.theme.primary.fill-hover\", $wrap: false);--cat-primary-text-active:cat-token(\"color.theme.primary.fill-active\", $wrap: false);--cat-link-decoration:underline}:host([color=secondary]){background-color:rgb(var(--cat-secondary-bg, 105, 118, 135));color:rgb(var(--cat-secondary-fill, 255, 255, 255));--cat-primary-text:cat-token(\"color.theme.secondary.fill\", $wrap: false);--cat-primary-text-hover:cat-token(\"color.theme.secondary.fill-hover\", $wrap: false);--cat-primary-text-active:cat-token(\"color.theme.secondary.fill-active\", $wrap: false);--cat-link-decoration:underline}:host([color=info]){background-color:rgb(var(--cat-success-bg, 0, 115, 230));color:rgb(var(--cat-success-fill, 255, 255, 255));--cat-primary-text:cat-token(\"color.theme.info.fill\", $wrap: false);--cat-primary-text-hover:cat-token(\"color.theme.info.fill-hover\", $wrap: false);--cat-primary-text-active:cat-token(\"color.theme.info.fill-active\", $wrap: false);--cat-link-decoration:underline}:host([color=success]){background-color:rgb(var(--cat-success-bg, 0, 132, 88));color:rgb(var(--cat-success-fill, 255, 255, 255));--cat-primary-text:cat-token(\"color.theme.success.fill\", $wrap: false);--cat-primary-text-hover:cat-token(\"color.theme.success.fill-hover\", $wrap: false);--cat-primary-text-active:cat-token(\"color.theme.success.fill-active\", $wrap: false);--cat-link-decoration:underline}:host([color=warning]){background-color:rgb(var(--cat-warning-bg, 255, 206, 128));color:rgb(var(--cat-warning-fill, 0, 0, 0));--cat-primary-text:cat-token(\"color.theme.warning.fill\", $wrap: false);--cat-primary-text-hover:cat-token(\"color.theme.warning.fill-hover\", $wrap: false);--cat-primary-text-active:cat-token(\"color.theme.warning.fill-active\", $wrap: false);--cat-link-decoration:underline}:host([color=danger]){background-color:rgb(var(--cat-danger-bg, 217, 52, 13));color:rgb(var(--cat-danger-fill, 255, 255, 255));--cat-primary-text:cat-token(\"color.theme.danger.fill\", $wrap: false);--cat-primary-text-hover:cat-token(\"color.theme.danger.fill-hover\", $wrap: false);--cat-primary-text-active:cat-token(\"color.theme.danger.fill-active\", $wrap: false);--cat-link-decoration:underline}";
11
11
 
12
12
  const CatAlert$1 = /*@__PURE__*/ proxyCustomElement(class CatAlert extends HTMLElement {
13
13
  constructor() {
@@ -17,6 +17,7 @@ const CatAlert$1 = /*@__PURE__*/ proxyCustomElement(class CatAlert extends HTMLE
17
17
  this.mapIcon = new Map([
18
18
  ['primary', '$cat:alert-primary'],
19
19
  ['secondary', '$cat:alert-secondary'],
20
+ ['info', '$cat:alert-info'],
20
21
  ['success', '$cat:alert-success'],
21
22
  ['warning', '$cat:alert-warning'],
22
23
  ['danger', '$cat:alert-danger']
@@ -24,6 +25,7 @@ const CatAlert$1 = /*@__PURE__*/ proxyCustomElement(class CatAlert extends HTMLE
24
25
  this.mapRole = new Map([
25
26
  ['primary', 'status'],
26
27
  ['secondary', 'status'],
28
+ ['info', 'status'],
27
29
  ['success', 'status'],
28
30
  ['warning', 'alert'],
29
31
  ['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GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAa,EAC3G,WAAK,KAAK,EAAC,SAAS,IAClB,eAAa,CACT,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatAlert"],"sources":["src/utils/setDefault.ts","src/components/cat-alert/cat-alert.scss?tag=cat-alert&encapsulation=shadow","src/components/cat-alert/cat-alert.tsx"],"sourcesContent":["export function setAttributeDefault<T extends { hostElement: HTMLElement }>(\n host: T,\n attr: string,\n value: unknown\n): void {\n if (!host.hostElement.hasAttribute(attr) && value != null) {\n host.hostElement.setAttribute(attr, String(value));\n }\n}\n\nexport function setAttribute<T extends { hostElement: HTMLElement }>(host: T, attr: string, value: unknown): void {\n host.hostElement.setAttribute(attr, String(value));\n}\n","@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n:host {\n display: flex;\n gap: 0.5rem;\n padding: 1.25rem;\n border-radius: cat-border-radius('l');\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host(:focus-visible) {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n}\n\n.content {\n align-self: center;\n}\n\n::slotted(:last-child) {\n margin-bottom: 0 !important;\n}\n\n// ----- theme\n\n@mixin theme($theme) {\n :host([color='#{$theme}']) {\n background-color: cat-token('color.theme.#{$theme}.bg');\n color: cat-token('color.theme.#{$theme}.fill');\n }\n}\n\n@include theme('primary');\n@include theme('secondary');\n@include theme('success');\n@include theme('warning');\n@include theme('danger');\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\nimport { setAttributeDefault } from '../../utils/setDefault';\n\n/**\n * Informs user about important changes or conditions in the interface. Use this\n * component if you need to capture user’s attention in a prominent way.\n */\n@Component({\n tag: 'cat-alert',\n styleUrl: 'cat-alert.scss',\n shadow: true\n})\nexport class CatAlert {\n private readonly mapIcon: Map<string, string> = new Map([\n ['primary', '$cat:alert-primary'],\n ['secondary', '$cat:alert-secondary'],\n ['success', '$cat:alert-success'],\n ['warning', '$cat:alert-warning'],\n ['danger', '$cat:alert-danger']\n ]);\n private readonly mapRole: Map<string, string> = new Map([\n ['primary', 'status'],\n ['secondary', 'status'],\n ['success', 'status'],\n ['warning', 'alert'],\n ['danger', 'alert']\n ]);\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * The color palette of the alert.\n */\n @Prop({ reflect: true }) color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'primary';\n\n /**\n * The name of an icon to be displayed in the alert.\n */\n @Prop() icon?: string;\n\n /**\n * Whether the icon of the alert is deactivated.\n */\n @Prop() noIcon = false;\n\n connectedCallback() {\n setAttributeDefault(this, 'tabindex', 0);\n setAttributeDefault(this, 'role', this.mapRole.get(this.color));\n }\n\n render() {\n return (\n <Host>\n {!this.noIcon && <cat-icon size=\"l\" icon={this.icon ? this.icon : this.mapIcon.get(this.color)}></cat-icon>}\n <div class=\"content\">\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"cat-alert.js","mappings":";;;SAAgB,mBAAmB,CACjC,IAAO,EACP,IAAY,EACZ,KAAc;EAEd,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE;IACzD,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;GACpD;AACH;;ACRA,MAAM,WAAW,GAAG,urFAAurF;;MCY9rFA,UAAQ;;;;;IACF,YAAO,GAAwB,IAAI,GAAG,CAAC;MACtD,CAAC,SAAS,EAAE,oBAAoB,CAAC;MACjC,CAAC,WAAW,EAAE,sBAAsB,CAAC;MACrC,CAAC,MAAM,EAAE,iBAAiB,CAAC;MAC3B,CAAC,SAAS,EAAE,oBAAoB,CAAC;MACjC,CAAC,SAAS,EAAE,oBAAoB,CAAC;MACjC,CAAC,QAAQ,EAAE,mBAAmB,CAAC;KAChC,CAAC,CAAC;IACc,YAAO,GAAwB,IAAI,GAAG,CAAC;MACtD,CAAC,SAAS,EAAE,QAAQ,CAAC;MACrB,CAAC,WAAW,EAAE,QAAQ,CAAC;MACvB,CAAC,MAAM,EAAE,QAAQ,CAAC;MAClB,CAAC,SAAS,EAAE,QAAQ,CAAC;MACrB,CAAC,SAAS,EAAE,OAAO,CAAC;MACpB,CAAC,QAAQ,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;iBAO0F,SAAS;;kBAUrF,KAAK;;EAEtB,iBAAiB;IACf,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IACzC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;GACjE;EAED,MAAM;IACJ,QACE,EAAC,IAAI,QACF,CAAC,IAAI,CAAC,MAAM,IAAI,gBAAU,IAAI,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAa,EAC3G,WAAK,KAAK,EAAC,SAAS,IAClB,eAAa,CACT,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatAlert"],"sources":["src/utils/setDefault.ts","src/components/cat-alert/cat-alert.scss?tag=cat-alert&encapsulation=shadow","src/components/cat-alert/cat-alert.tsx"],"sourcesContent":["export function setAttributeDefault<T extends { hostElement: HTMLElement }>(\n host: T,\n attr: string,\n value: unknown\n): void {\n if (!host.hostElement.hasAttribute(attr) && value != null) {\n host.hostElement.setAttribute(attr, String(value));\n }\n}\n\nexport function setAttribute<T extends { hostElement: HTMLElement }>(host: T, attr: string, value: unknown): void {\n host.hostElement.setAttribute(attr, String(value));\n}\n","@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n:host {\n display: flex;\n gap: 0.5rem;\n padding: 1.25rem;\n border-radius: cat-border-radius('l');\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host(:focus-visible) {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n}\n\n.content {\n align-self: center;\n}\n\n::slotted(:last-child) {\n margin-bottom: 0 !important;\n}\n\n// ----- theme\n\n@mixin theme($theme) {\n :host([color='#{$theme}']) {\n background-color: cat-token('color.theme.#{$theme}.bg');\n color: cat-token('color.theme.#{$theme}.fill');\n // adjust nested links\n --cat-primary-text: cat-token('color.theme.#{$theme}.fill', $wrap: false);\n --cat-primary-text-hover: cat-token('color.theme.#{$theme}.fill-hover', $wrap: false);\n --cat-primary-text-active: cat-token('color.theme.#{$theme}.fill-active', $wrap: false);\n --cat-link-decoration: underline;\n }\n}\n\n@include theme('primary');\n@include theme('secondary');\n@include theme('info');\n@include theme('success');\n@include theme('warning');\n@include theme('danger');\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\nimport { setAttributeDefault } from '../../utils/setDefault';\n\n/**\n * Informs user about important changes or conditions in the interface. Use this\n * component if you need to capture user’s attention in a prominent way.\n */\n@Component({\n tag: 'cat-alert',\n styleUrl: 'cat-alert.scss',\n shadow: true\n})\nexport class CatAlert {\n private readonly mapIcon: Map<string, string> = new Map([\n ['primary', '$cat:alert-primary'],\n ['secondary', '$cat:alert-secondary'],\n ['info', '$cat:alert-info'],\n ['success', '$cat:alert-success'],\n ['warning', '$cat:alert-warning'],\n ['danger', '$cat:alert-danger']\n ]);\n private readonly mapRole: Map<string, string> = new Map([\n ['primary', 'status'],\n ['secondary', 'status'],\n ['info', 'status'],\n ['success', 'status'],\n ['warning', 'alert'],\n ['danger', 'alert']\n ]);\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * The color palette of the alert.\n */\n @Prop({ reflect: true }) color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'primary';\n\n /**\n * The name of an icon to be displayed in the alert.\n */\n @Prop() icon?: string;\n\n /**\n * Whether the icon of the alert is deactivated.\n */\n @Prop() noIcon = false;\n\n connectedCallback() {\n setAttributeDefault(this, 'tabindex', 0);\n setAttributeDefault(this, 'role', this.mapRole.get(this.color));\n }\n\n render() {\n return (\n <Host>\n {!this.noIcon && <cat-icon size=\"l\" icon={this.icon ? this.icon : this.mapIcon.get(this.color)}></cat-icon>}\n <div class=\"content\">\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
2
 
3
- const catBadgeCss = ":host([hidden]){display:none}:host{display:inline-flex;max-width:100%;vertical-align:baseline;align-items:center;justify-content:center;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;line-height:1.5}:host slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}:host([round]){border-radius:10rem}:host([variant=filled]){background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}:host([variant=outlined]){background-color:white;color:rgb(var(--text));box-shadow:inset 0 0 0 1px rgba(var(--text), 0.2)}:host([color=primary]){--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148)}:host([color=secondary]){--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0)}:host([color=success]){--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88)}:host([color=warning]){--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0)}:host([color=danger]){--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13)}:host([size=xs]){height:1rem;min-width:1rem;font-size:0.75rem;padding:0 0.25rem}:host([size=s]){height:1.5rem;min-width:1.5rem;font-size:0.75rem;padding:0 0.5rem}:host([size=m]){height:2rem;min-width:2rem;font-size:0.875rem;padding:0 0.75rem}:host([size=l]){height:2.5rem;min-width:2.5rem;font-size:0.9375rem;padding:0 1rem}:host([size=xl]){height:3rem;min-width:3rem;font-size:1.125rem;padding:0 1rem}:host([pulse][variant=filled]){animation:1.5s ease 0s infinite normal none running pulse}:host([pulse][variant=outlined]){animation:1.5s ease 0s infinite normal none running pulse-outlined}@keyframes pulse{0%{box-shadow:0 0 0 0 rgb(var(--bg))}70%{box-shadow:transparent 0 0 0 0.5rem}100%{box-shadow:transparent 0 0 0 0}}@keyframes pulse-outlined{0%{box-shadow:0 0 0 0 rgb(var(--bg)), inset 0 0 0 1px rgba(var(--text), 0.2)}70%{box-shadow:transparent 0 0 0 0.5rem, inset 0 0 0 1px rgba(var(--text), 0.2)}100%{box-shadow:transparent 0 0 0 0, inset 0 0 0 1px rgba(var(--text), 0.2)}}";
3
+ const catBadgeCss = ":host([hidden]){display:none}:host{display:inline-flex;max-width:100%;vertical-align:baseline;align-items:center;justify-content:center;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;line-height:1.5}:host slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}:host([round]){border-radius:10rem}:host([variant=filled]){background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}:host([variant=outlined]){background-color:white;color:rgb(var(--text));box-shadow:inset 0 0 0 1px rgba(var(--text), 0.2)}:host([color=primary]){--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148)}:host([color=secondary]){--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0)}:host([color=info]){--bg:var(--cat-success-bg, 0, 115, 230);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 115, 230)}:host([color=success]){--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88)}:host([color=warning]){--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0)}:host([color=danger]){--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13)}:host([size=xs]){height:1rem;min-width:1rem;font-size:0.75rem;padding:0 0.25rem}:host([size=s]){height:1.5rem;min-width:1.5rem;font-size:0.75rem;padding:0 0.5rem}:host([size=m]){height:2rem;min-width:2rem;font-size:0.875rem;padding:0 0.75rem}:host([size=l]){height:2.5rem;min-width:2.5rem;font-size:0.9375rem;padding:0 1rem}:host([size=xl]){height:3rem;min-width:3rem;font-size:1.125rem;padding:0 1rem}:host([pulse][variant=filled]){animation:1.5s ease 0s infinite normal none running pulse}:host([pulse][variant=outlined]){animation:1.5s ease 0s infinite normal none running pulse-outlined}@keyframes pulse{0%{box-shadow:0 0 0 0 rgb(var(--bg))}70%{box-shadow:transparent 0 0 0 0.5rem}100%{box-shadow:transparent 0 0 0 0}}@keyframes pulse-outlined{0%{box-shadow:0 0 0 0 rgb(var(--bg)), inset 0 0 0 1px rgba(var(--text), 0.2)}70%{box-shadow:transparent 0 0 0 0.5rem, inset 0 0 0 1px rgba(var(--text), 0.2)}100%{box-shadow:transparent 0 0 0 0, inset 0 0 0 1px rgba(var(--text), 0.2)}}";
4
4
 
5
5
  const CatBadge$1 = /*@__PURE__*/ proxyCustomElement(class CatBadge extends HTMLElement {
6
6
  constructor() {