@kolkrabbi/kol-component 0.12.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-component",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "KOL design-system components — atoms through organisms, emitting canonical kol-* classes. Pairs with @kolkrabbi/kol-theme for styling.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@floating-ui/react": "^0.27.19",
25
25
  "embla-carousel-react": "^8.6.0",
26
- "@kolkrabbi/kol-icons": "0.7.0"
26
+ "@kolkrabbi/kol-icons": "0.7.1"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "^18.3.0 || ^19.0.0",
@@ -1,4 +1,4 @@
1
- import { useEffect, useMemo, useState } from 'react'
1
+ import { useEffect, useId, useMemo, useState } from 'react'
2
2
  import Input from '../atoms/Input.jsx'
3
3
 
4
4
  /**
@@ -46,6 +46,10 @@ const Slider = ({
46
46
  displayWidth = 6,
47
47
  fontSize,
48
48
  }) => {
49
+ /* Label ↔ input pairing — the <label> is a sibling of the range input, so
50
+ * without an htmlFor/id pair the visible label confers no accessible name. */
51
+ const sliderId = useId()
52
+
49
53
  const handleChange = (e) => {
50
54
  if (onChange) {
51
55
  onChange(Number(e.target.value))
@@ -96,6 +100,7 @@ const Slider = ({
96
100
  <div className={`control-slider gap-3 shadow-none ${className}`}>
97
101
  {label && (
98
102
  <label
103
+ htmlFor={sliderId}
99
104
  className={`kol-helper-12 whitespace-nowrap shrink-0 w-fit ${disabled ? 'opacity-50' : ''}`}
100
105
  style={fontSize ? { fontSize } : undefined}
101
106
  >
@@ -103,6 +108,7 @@ const Slider = ({
103
108
  </label>
104
109
  )}
105
110
  <input
111
+ id={sliderId}
106
112
  type="range"
107
113
  min={min}
108
114
  max={max}