reke-ui 0.4.3 → 0.5.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.
@@ -4,48 +4,48 @@
4
4
  "modules": [
5
5
  {
6
6
  "kind": "javascript-module",
7
- "path": "src/components/reke-badge/reke-badge.ts",
7
+ "path": "src/components/reke-alert/reke-alert.ts",
8
8
  "declarations": [
9
9
  {
10
10
  "kind": "class",
11
11
  "description": "",
12
- "name": "RekeBadge",
12
+ "name": "RekeAlert",
13
13
  "cssProperties": [
14
14
  {
15
- "description": "Default variant background color.",
16
- "name": "--reke-color-surface",
17
- "default": "#1A1A1A"
15
+ "description": "Success variant color.",
16
+ "name": "--reke-color-primary",
17
+ "default": "#22C55E"
18
18
  },
19
19
  {
20
- "description": "Default variant text color.",
21
- "name": "--reke-color-text",
22
- "default": "#E5E5E5"
20
+ "description": "Error variant color.",
21
+ "name": "--reke-color-danger",
22
+ "default": "#EF4444"
23
23
  },
24
24
  {
25
- "description": "Default variant border color.",
26
- "name": "--reke-color-border",
27
- "default": "#252525"
25
+ "description": "Warning variant color.",
26
+ "name": "--reke-color-warning",
27
+ "default": "#F59E0B"
28
28
  },
29
29
  {
30
- "description": "Primary/success variant accent color.",
31
- "name": "--reke-color-primary",
32
- "default": "#22C55E"
30
+ "description": "Info variant color.",
31
+ "name": "--reke-color-secondary",
32
+ "default": "#3B82F6"
33
33
  },
34
34
  {
35
- "description": "Danger variant accent color.",
36
- "name": "--reke-color-danger",
37
- "default": "#EF4444"
35
+ "description": "Alert border radius.",
36
+ "name": "--reke-radius",
37
+ "default": "4px"
38
38
  }
39
39
  ],
40
40
  "cssParts": [
41
41
  {
42
- "description": "The inner badge element.",
43
- "name": "badge"
42
+ "description": "The outer alert container.",
43
+ "name": "alert"
44
44
  }
45
45
  ],
46
46
  "slots": [
47
47
  {
48
- "description": "Default slot for badge text.",
48
+ "description": "Default slot for alert content (icon + text, or just text).",
49
49
  "name": ""
50
50
  }
51
51
  ],
@@ -54,131 +54,124 @@
54
54
  "kind": "field",
55
55
  "name": "variant",
56
56
  "type": {
57
- "text": "BadgeVariant"
57
+ "text": "AlertVariant"
58
58
  },
59
- "default": "'default'",
59
+ "default": "'info'",
60
60
  "attribute": "variant",
61
61
  "reflects": true
62
62
  },
63
63
  {
64
64
  "kind": "field",
65
- "name": "size",
65
+ "name": "dismissible",
66
66
  "type": {
67
- "text": "BadgeSize"
67
+ "text": "boolean"
68
68
  },
69
- "default": "'md'",
70
- "attribute": "size",
69
+ "default": "false",
70
+ "attribute": "dismissible",
71
71
  "reflects": true
72
72
  },
73
73
  {
74
- "kind": "field",
75
- "name": "shape",
76
- "type": {
77
- "text": "BadgeShape"
78
- },
79
- "default": "'pill'",
80
- "attribute": "shape",
81
- "reflects": true
74
+ "kind": "method",
75
+ "name": "handleClose",
76
+ "privacy": "private"
77
+ }
78
+ ],
79
+ "events": [
80
+ {
81
+ "description": "Fired when the alert is dismissed (only when dismissible).",
82
+ "name": "reke-close"
82
83
  }
83
84
  ],
84
85
  "attributes": [
85
86
  {
86
87
  "name": "variant",
87
88
  "type": {
88
- "text": "BadgeVariant"
89
+ "text": "AlertVariant"
89
90
  },
90
- "default": "'default'",
91
+ "default": "'info'",
91
92
  "fieldName": "variant"
92
93
  },
93
94
  {
94
- "name": "size",
95
- "type": {
96
- "text": "BadgeSize"
97
- },
98
- "default": "'md'",
99
- "fieldName": "size"
100
- },
101
- {
102
- "name": "shape",
95
+ "name": "dismissible",
103
96
  "type": {
104
- "text": "BadgeShape"
97
+ "text": "boolean"
105
98
  },
106
- "default": "'pill'",
107
- "fieldName": "shape"
99
+ "default": "false",
100
+ "fieldName": "dismissible"
108
101
  }
109
102
  ],
110
103
  "superclass": {
111
104
  "name": "RekeElement",
112
105
  "module": "/src/shared/base-element.js"
113
106
  },
114
- "tagName": "reke-badge",
107
+ "tagName": "reke-alert",
115
108
  "customElement": true,
116
- "summary": "A badge component for displaying labels, statuses, and counts."
109
+ "summary": "An inline alert with color variants. Content via default slot."
117
110
  }
118
111
  ],
119
112
  "exports": [
120
113
  {
121
114
  "kind": "js",
122
- "name": "RekeBadge",
115
+ "name": "RekeAlert",
123
116
  "declaration": {
124
- "name": "RekeBadge",
125
- "module": "src/components/reke-badge/reke-badge.ts"
117
+ "name": "RekeAlert",
118
+ "module": "src/components/reke-alert/reke-alert.ts"
126
119
  }
127
120
  },
128
121
  {
129
122
  "kind": "custom-element-definition",
130
- "name": "reke-badge",
123
+ "name": "reke-alert",
131
124
  "declaration": {
132
- "name": "RekeBadge",
133
- "module": "src/components/reke-badge/reke-badge.ts"
125
+ "name": "RekeAlert",
126
+ "module": "src/components/reke-alert/reke-alert.ts"
134
127
  }
135
128
  }
136
129
  ]
137
130
  },
138
131
  {
139
132
  "kind": "javascript-module",
140
- "path": "src/components/reke-alert/reke-alert.ts",
133
+ "path": "src/components/reke-badge/reke-badge.ts",
141
134
  "declarations": [
142
135
  {
143
136
  "kind": "class",
144
137
  "description": "",
145
- "name": "RekeAlert",
138
+ "name": "RekeBadge",
146
139
  "cssProperties": [
147
140
  {
148
- "description": "Success variant color.",
149
- "name": "--reke-color-primary",
150
- "default": "#22C55E"
141
+ "description": "Default variant background color.",
142
+ "name": "--reke-color-surface",
143
+ "default": "#1A1A1A"
151
144
  },
152
145
  {
153
- "description": "Error variant color.",
154
- "name": "--reke-color-danger",
155
- "default": "#EF4444"
146
+ "description": "Default variant text color.",
147
+ "name": "--reke-color-text",
148
+ "default": "#E5E5E5"
156
149
  },
157
150
  {
158
- "description": "Warning variant color.",
159
- "name": "--reke-color-warning",
160
- "default": "#F59E0B"
151
+ "description": "Default variant border color.",
152
+ "name": "--reke-color-border",
153
+ "default": "#252525"
161
154
  },
162
155
  {
163
- "description": "Info variant color.",
164
- "name": "--reke-color-secondary",
165
- "default": "#3B82F6"
156
+ "description": "Primary/success variant accent color.",
157
+ "name": "--reke-color-primary",
158
+ "default": "#22C55E"
166
159
  },
167
160
  {
168
- "description": "Alert border radius.",
169
- "name": "--reke-radius",
170
- "default": "4px"
161
+ "description": "Danger variant accent color.",
162
+ "name": "--reke-color-danger",
163
+ "default": "#EF4444"
171
164
  }
172
165
  ],
173
166
  "cssParts": [
174
167
  {
175
- "description": "The outer alert container.",
176
- "name": "alert"
168
+ "description": "The inner badge element.",
169
+ "name": "badge"
177
170
  }
178
171
  ],
179
172
  "slots": [
180
173
  {
181
- "description": "Default slot for alert content (icon + text, or just text).",
174
+ "description": "Default slot for badge text.",
182
175
  "name": ""
183
176
  }
184
177
  ],
@@ -187,76 +180,83 @@
187
180
  "kind": "field",
188
181
  "name": "variant",
189
182
  "type": {
190
- "text": "AlertVariant"
183
+ "text": "BadgeVariant"
191
184
  },
192
- "default": "'info'",
185
+ "default": "'default'",
193
186
  "attribute": "variant",
194
187
  "reflects": true
195
188
  },
196
189
  {
197
190
  "kind": "field",
198
- "name": "dismissible",
191
+ "name": "size",
199
192
  "type": {
200
- "text": "boolean"
193
+ "text": "BadgeSize"
201
194
  },
202
- "default": "false",
203
- "attribute": "dismissible",
195
+ "default": "'md'",
196
+ "attribute": "size",
204
197
  "reflects": true
205
198
  },
206
199
  {
207
- "kind": "method",
208
- "name": "handleClose",
209
- "privacy": "private"
210
- }
211
- ],
212
- "events": [
213
- {
214
- "description": "Fired when the alert is dismissed (only when dismissible).",
215
- "name": "reke-close"
200
+ "kind": "field",
201
+ "name": "shape",
202
+ "type": {
203
+ "text": "BadgeShape"
204
+ },
205
+ "default": "'pill'",
206
+ "attribute": "shape",
207
+ "reflects": true
216
208
  }
217
209
  ],
218
210
  "attributes": [
219
211
  {
220
212
  "name": "variant",
221
213
  "type": {
222
- "text": "AlertVariant"
214
+ "text": "BadgeVariant"
223
215
  },
224
- "default": "'info'",
216
+ "default": "'default'",
225
217
  "fieldName": "variant"
226
218
  },
227
219
  {
228
- "name": "dismissible",
220
+ "name": "size",
229
221
  "type": {
230
- "text": "boolean"
222
+ "text": "BadgeSize"
231
223
  },
232
- "default": "false",
233
- "fieldName": "dismissible"
224
+ "default": "'md'",
225
+ "fieldName": "size"
226
+ },
227
+ {
228
+ "name": "shape",
229
+ "type": {
230
+ "text": "BadgeShape"
231
+ },
232
+ "default": "'pill'",
233
+ "fieldName": "shape"
234
234
  }
235
235
  ],
236
236
  "superclass": {
237
237
  "name": "RekeElement",
238
238
  "module": "/src/shared/base-element.js"
239
239
  },
240
- "tagName": "reke-alert",
240
+ "tagName": "reke-badge",
241
241
  "customElement": true,
242
- "summary": "An inline alert with color variants. Content via default slot."
242
+ "summary": "A badge component for displaying labels, statuses, and counts."
243
243
  }
244
244
  ],
245
245
  "exports": [
246
246
  {
247
247
  "kind": "js",
248
- "name": "RekeAlert",
248
+ "name": "RekeBadge",
249
249
  "declaration": {
250
- "name": "RekeAlert",
251
- "module": "src/components/reke-alert/reke-alert.ts"
250
+ "name": "RekeBadge",
251
+ "module": "src/components/reke-badge/reke-badge.ts"
252
252
  }
253
253
  },
254
254
  {
255
255
  "kind": "custom-element-definition",
256
- "name": "reke-alert",
256
+ "name": "reke-badge",
257
257
  "declaration": {
258
- "name": "RekeAlert",
259
- "module": "src/components/reke-alert/reke-alert.ts"
258
+ "name": "RekeBadge",
259
+ "module": "src/components/reke-badge/reke-badge.ts"
260
260
  }
261
261
  }
262
262
  ]
@@ -5626,6 +5626,10 @@
5626
5626
  {
5627
5627
  "description": "The inner sliding thumb element.",
5628
5628
  "name": "thumb"
5629
+ },
5630
+ {
5631
+ "description": "The visible label text.",
5632
+ "name": "label"
5629
5633
  }
5630
5634
  ],
5631
5635
  "members": [
@@ -5656,8 +5660,20 @@
5656
5660
  "text": "string"
5657
5661
  },
5658
5662
  "default": "''",
5663
+ "description": "Visible text next to the switch, and its accessible name.",
5659
5664
  "attribute": "label"
5660
5665
  },
5666
+ {
5667
+ "kind": "field",
5668
+ "name": "labelHidden",
5669
+ "type": {
5670
+ "text": "boolean"
5671
+ },
5672
+ "default": "false",
5673
+ "description": "Keeps `label` as the accessible name without rendering it.",
5674
+ "attribute": "label-hidden",
5675
+ "reflects": true
5676
+ },
5661
5677
  {
5662
5678
  "kind": "method",
5663
5679
  "name": "toggle",
@@ -5711,7 +5727,17 @@
5711
5727
  "text": "string"
5712
5728
  },
5713
5729
  "default": "''",
5730
+ "description": "Visible text next to the switch, and its accessible name.",
5714
5731
  "fieldName": "label"
5732
+ },
5733
+ {
5734
+ "name": "label-hidden",
5735
+ "type": {
5736
+ "text": "boolean"
5737
+ },
5738
+ "default": "false",
5739
+ "description": "Keeps `label` as the accessible name without rendering it.",
5740
+ "fieldName": "labelHidden"
5715
5741
  }
5716
5742
  ],
5717
5743
  "superclass": {
@@ -5,8 +5,12 @@ import { RekeElement } from '../../shared/base-element.js';
5
5
  *
6
6
  * @fires reke-change - Fired when the toggle state changes, with `{ checked: boolean }` detail.
7
7
  *
8
+ * @property label - Visible text next to the switch, and its accessible name.
9
+ * @property labelHidden - Keeps `label` as the accessible name without rendering it.
10
+ *
8
11
  * @csspart track - The outer track element.
9
12
  * @csspart thumb - The inner sliding thumb element.
13
+ * @csspart label - The visible label text.
10
14
  *
11
15
  * @cssprop [--reke-color-primary=#22C55E] - Track background when checked.
12
16
  * @cssprop [--reke-color-on-primary=#0A0A0B] - Thumb color when checked.
@@ -19,7 +23,15 @@ export declare class RekeToggle extends RekeElement {
19
23
  static styles: import("lit").CSSResult[];
20
24
  checked: boolean;
21
25
  disabled: boolean;
26
+ /** Visible text rendered next to the switch. Doubles as its accessible name. */
22
27
  label: string;
28
+ /**
29
+ * Renders the switch on its own while keeping `label` as its accessible name.
30
+ *
31
+ * Without this, a bare toggle has no name at all: the `role="switch"` lives in
32
+ * the shadow DOM, so an `aria-label` set on the host never reaches it.
33
+ */
34
+ labelHidden: boolean;
23
35
  private toggle;
24
36
  private handleClick;
25
37
  private handleKeyDown;
@@ -1 +1 @@
1
- {"version":3,"file":"reke-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/reke-toggle/reke-toggle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D;;;;;;;;;;;;;;;GAeG;AACH,qBACa,UAAW,SAAQ,WAAW;IACzC,OAAgB,MAAM,4BAAU;IAGhC,OAAO,UAAS;IAGhB,QAAQ,UAAS;IAGjB,KAAK,SAAM;IAEX,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,aAAa;IAOZ,MAAM;CAkBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
1
+ {"version":3,"file":"reke-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/reke-toggle/reke-toggle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,UAAW,SAAQ,WAAW;IACzC,OAAgB,MAAM,4BAAU;IAGhC,OAAO,UAAS;IAGhB,QAAQ,UAAS;IAEjB,gFAAgF;IAEhF,KAAK,SAAM;IAEX;;;;;OAKG;IAEH,WAAW,UAAS;IAEpB,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,aAAa;IAOZ,MAAM;CAsBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -6,7 +6,7 @@ import { customElement as a, property as o } from "lit/decorators.js";
6
6
  //#region src/components/reke-toggle/reke-toggle.ts
7
7
  var s = class extends e {
8
8
  constructor(...e) {
9
- super(...e), this.checked = !1, this.disabled = !1, this.label = "";
9
+ super(...e), this.checked = !1, this.disabled = !1, this.label = "", this.labelHidden = !1;
10
10
  }
11
11
  static {
12
12
  this.styles = n;
@@ -34,7 +34,7 @@ var s = class extends e {
34
34
  <div part="track" class="track ${this.checked ? "track--checked" : ""}">
35
35
  <div part="thumb" class="thumb ${this.checked ? "thumb--checked" : ""}"></div>
36
36
  </div>
37
- ${this.label ? r`<span class="label">${this.label}</span>` : i}
37
+ ${this.label && !this.labelHidden ? r`<span part="label" class="label">${this.label}</span>` : i}
38
38
  </div>
39
39
  `;
40
40
  }
@@ -45,6 +45,10 @@ t([o({
45
45
  })], s.prototype, "checked", void 0), t([o({
46
46
  type: Boolean,
47
47
  reflect: !0
48
- })], s.prototype, "disabled", void 0), t([o()], s.prototype, "label", void 0), s = t([a("reke-toggle")], s);
48
+ })], s.prototype, "disabled", void 0), t([o()], s.prototype, "label", void 0), t([o({
49
+ type: Boolean,
50
+ reflect: !0,
51
+ attribute: "label-hidden"
52
+ })], s.prototype, "labelHidden", void 0), s = t([a("reke-toggle")], s);
49
53
  //#endregion
50
54
  export { s as RekeToggle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reke-ui",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
4
4
  "description": "Web Component library built with Lit 3 — dark & light themes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",