@ahrowe/ui 0.11.0 → 0.12.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 (64) hide show
  1. package/dist/esm/common/accordion/accordion.module.mjs.map +1 -1
  2. package/dist/esm/common/accordion/accordion.plain.module.mjs.map +1 -1
  3. package/dist/esm/common/accordion/accordion.primary.module.mjs.map +1 -1
  4. package/dist/esm/common/actionIcon/actionIcon.module.mjs.map +1 -1
  5. package/dist/esm/common/animatedText/animatedText.mjs +1 -1
  6. package/dist/esm/common/animatedText/animatedText.mjs.map +1 -1
  7. package/dist/esm/common/animatedText/animatedText.types.mjs.map +1 -1
  8. package/dist/esm/common/button/button.module.mjs.map +1 -1
  9. package/dist/esm/common/card/card.module.mjs.map +1 -1
  10. package/dist/esm/common/checkbox/checkbox.module.mjs.map +1 -1
  11. package/dist/esm/common/chip/chip.module.mjs.map +1 -1
  12. package/dist/esm/common/colorPicker/colorPicker.mjs +1 -1
  13. package/dist/esm/common/colorPicker/colorPicker.mjs.map +1 -1
  14. package/dist/esm/common/colorPicker/colorPicker.module.mjs +1 -1
  15. package/dist/esm/common/colorPicker/colorPicker.module.mjs.map +1 -1
  16. package/dist/esm/common/datePicker/components/datePickerMonth/datePickerMonth.module.mjs.map +1 -1
  17. package/dist/esm/common/datePicker/datePicker.module.mjs.map +1 -1
  18. package/dist/esm/common/dropZone/dropZone.module.mjs.map +1 -1
  19. package/dist/esm/common/dropdown/dropdown.module.mjs.map +1 -1
  20. package/dist/esm/common/fab/fab.module.mjs.map +1 -1
  21. package/dist/esm/common/floatingMenu/floatingMenu.module.mjs.map +1 -1
  22. package/dist/esm/common/iconPicker/iconPicker.module.mjs.map +1 -1
  23. package/dist/esm/common/input/input.module.mjs.map +1 -1
  24. package/dist/esm/common/inputDropdown/inputDropdown.module.mjs.map +1 -1
  25. package/dist/esm/common/klipyPicker/klipyPicker.module.mjs.map +1 -1
  26. package/dist/esm/common/modal/modal.module.mjs.map +1 -1
  27. package/dist/esm/common/numberInput/numberInput.module.mjs.map +1 -1
  28. package/dist/esm/common/optionPicker/optionPicker.module.mjs.map +1 -1
  29. package/dist/esm/common/radioGroup/radioGroup.module.mjs.map +1 -1
  30. package/dist/esm/common/roomDrawer/roomDrawer.module.mjs.map +1 -1
  31. package/dist/esm/common/roomViewer/roomViewer.module.mjs.map +1 -1
  32. package/dist/esm/common/slider/slider.mjs +2 -0
  33. package/dist/esm/common/slider/slider.mjs.map +1 -0
  34. package/dist/esm/common/slider/slider.module.mjs +2 -0
  35. package/dist/esm/common/slider/slider.module.mjs.map +1 -0
  36. package/dist/esm/common/stepper/stepper.mjs +1 -1
  37. package/dist/esm/common/stepper/stepper.mjs.map +1 -1
  38. package/dist/esm/common/stepper/stepper.module.mjs +1 -1
  39. package/dist/esm/common/stepper/stepper.module.mjs.map +1 -1
  40. package/dist/esm/common/stepper/stepper.types.mjs.map +1 -1
  41. package/dist/esm/common/switch/switch.module.mjs.map +1 -1
  42. package/dist/esm/common/tabHeader/tabHeader.module.mjs.map +1 -1
  43. package/dist/esm/common/timeInput/components/clockDial/clockDial.module.mjs.map +1 -1
  44. package/dist/esm/common/timeInput/timeInput.module.mjs.map +1 -1
  45. package/dist/esm/common/toast/toast.module.mjs.map +1 -1
  46. package/dist/esm/common/virtualList/virtualList.module.mjs.map +1 -1
  47. package/dist/esm/index.mjs +1 -1
  48. package/dist/index.cjs +4 -4
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/style.css +1 -1
  51. package/dist/types/package/common/animatedText/animatedText.d.ts +1 -1
  52. package/dist/types/package/common/animatedText/animatedText.types.d.ts +6 -0
  53. package/dist/types/package/common/slider/index.d.ts +2 -0
  54. package/dist/types/package/common/slider/slider.d.ts +3 -0
  55. package/dist/types/package/common/slider/slider.types.d.ts +43 -0
  56. package/dist/types/package/common/stepper/stepper.types.d.ts +5 -5
  57. package/dist/types/package/common/themeProvider/theme.types.d.ts +10 -0
  58. package/dist/types/package/index.d.ts +2 -0
  59. package/docs/AnimatedText.md +5 -0
  60. package/docs/CLAUDE.md +1 -0
  61. package/docs/ColorPicker.md +2 -0
  62. package/docs/Slider.md +93 -0
  63. package/docs/Stepper.md +6 -6
  64. package/package.json +1 -1
package/docs/Slider.md ADDED
@@ -0,0 +1,93 @@
1
+ # Slider
2
+
3
+ **When to use:** Let the user pick a number from a continuous or stepped range by dragging a thumb: volume, brightness, price ranges, zoom, quality presets. For free numeric entry use `NumberInput`; for a few discrete options use `OptionPicker` or `RadioGroup`.
4
+
5
+ **Import:** `import { Slider } from '@ahrowe/ui'`
6
+ **Types:** `import type { SliderProps, SliderMark } from '@ahrowe/ui'`
7
+
8
+ ```tsx
9
+ import { useState } from 'react';
10
+ import { Slider } from '@ahrowe/ui';
11
+
12
+ // Controlled
13
+ const [value, setValue] = useState(40);
14
+ <Slider value={value} onChange={setValue} aria-label="Value" />
15
+
16
+ // Uncontrolled
17
+ <Slider defaultValue={40} onChangeEnd={(v) => save(v)} />
18
+
19
+ // Value bubble above the thumb
20
+ <Slider value={volume} onChange={setVolume} showValue />
21
+
22
+ // Custom range, step, and formatting
23
+ <Slider
24
+ value={price}
25
+ onChange={setPrice}
26
+ min={0}
27
+ max={1000}
28
+ step={50}
29
+ showValue
30
+ formatValue={(v) => `€${v}`}
31
+ />
32
+
33
+ // Tick marks (labelled and unlabelled)
34
+ <Slider
35
+ value={quality}
36
+ onChange={setQuality}
37
+ min={0}
38
+ max={4}
39
+ step={1}
40
+ marks={[
41
+ { value: 0, label: 'Low' },
42
+ { value: 2, label: 'Medium' },
43
+ { value: 4, label: 'High' },
44
+ ]}
45
+ />
46
+
47
+ // Larger thumb, themed colours (one-off)
48
+ <Slider
49
+ value={value}
50
+ onChange={setValue}
51
+ size="26px"
52
+ style={{
53
+ '--slider-range-color': 'var(--success-color)',
54
+ '--slider-thumb-color': 'var(--success-color)',
55
+ } as React.CSSProperties}
56
+ />
57
+ ```
58
+
59
+ **Interaction:** drag the thumb or click anywhere on the track to jump there. With keyboard focus: `←`/`↓` and `→`/`↑` move by `step`, `Page Up`/`Page Down` by ten steps, `Home`/`End` jump to `min`/`max`. Values always snap to `step`.
60
+
61
+ **`onChange` vs `onChangeEnd`:** `onChange` fires on every change (each drag move and each key press); `onChangeEnd` fires once the value is committed, on pointer release or on each keyboard step. Use `onChangeEnd` to defer expensive work (a network save, a heavy re-render) until the user settles.
62
+
63
+ **Key props:**
64
+
65
+ | Prop | Type | Description |
66
+ |------|------|-------------|
67
+ | `value` | `number` | Controlled value (omit for uncontrolled) |
68
+ | `defaultValue` | `number` | Initial value when uncontrolled (default `min`) |
69
+ | `onChange` | `(value: number) => void` | Fires on every change |
70
+ | `onChangeEnd` | `(value: number) => void` | Fires once the value is committed |
71
+ | `min` | `number` | Minimum (default `0`) |
72
+ | `max` | `number` | Maximum (default `100`) |
73
+ | `step` | `number` | Snap increment (default `1`) |
74
+ | `disabled` | `boolean` | Disable interaction |
75
+ | `marks` | `SliderMark[]` | Tick marks, `{ value, label? }` |
76
+ | `showValue` | `boolean` | Show the current value in a bubble above the thumb |
77
+ | `formatValue` | `(value: number) => ReactNode` | Format the bubble text and `aria-valuetext` |
78
+ | `size` | `string` | Thumb diameter, any CSS length (default `'18px'`) |
79
+ | `aria-label` | `string` | Accessible label |
80
+
81
+ **Accessibility:** renders `role="slider"` with `aria-valuemin` / `aria-valuemax` / `aria-valuenow` (and `aria-valuetext` when `formatValue` returns a string/number). Give it an `aria-label` (or wire up your own visible label). Respects `prefers-reduced-motion` (no thumb/fill transition).
82
+
83
+ **Theming:** override these CSS variables theme-wide via `ThemeProvider` or per instance via `style`; each falls back to a built-in default:
84
+
85
+ | Variable | Falls back to |
86
+ |----------|---------------|
87
+ | `--slider-track-color` | `var(--background-accent-light)` |
88
+ | `--slider-range-color` | `var(--primary-color)` |
89
+ | `--slider-thumb-color` | `var(--primary-color)` |
90
+ | `--slider-thumb-size` | `18px` (also settable per instance via `size`) |
91
+ | `--slider-track-height` | `6px` |
92
+
93
+ **Slots:** `root` `track` `range` `thumb` `mark` `markLabel` `value`
package/docs/Stepper.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Stepper
2
2
 
3
- **When to use:** Step progress indicator multi-step forms, onboarding flows, checkout wizards. Shows completed, current, and upcoming steps, and (vertically) can expand a collapsible body under the active step.
3
+ **When to use:** Step progress indicator for multi-step forms, onboarding flows, and checkout wizards. Shows completed, current, and upcoming steps, and (vertically) can expand a collapsible body under the active step.
4
4
 
5
5
  **Import:** `import { Stepper } from '@ahrowe/ui'`
6
6
  **Types:** `import type { StepperStep, StepperProps } from '@ahrowe/ui'`
@@ -36,7 +36,7 @@ const steps = [
36
36
  onStepClicked={(stepIndex) => setCurrentStep(stepIndex)}
37
37
  />
38
38
 
39
- // Rich steps icon, description, error, optional
39
+ // Rich steps: icon, description, error, optional
40
40
  <Stepper
41
41
  currentStep={2}
42
42
  steps={[
@@ -46,7 +46,7 @@ const steps = [
46
46
  ]}
47
47
  />
48
48
 
49
- // Vertical wizard with collapsible bodies only the active step's body is open
49
+ // Vertical wizard with collapsible bodies (only the active step's body is open)
50
50
  <Stepper
51
51
  alignment={StepperAlignment.Vertical}
52
52
  collapse={StepperCollapse.ActiveOnly}
@@ -80,7 +80,7 @@ const steps = [
80
80
  | `currentStep` | `number` | Zero-based active step index |
81
81
  | `alignment` | `StepperAlignment \| 'horizontal' \| 'vertical'` | Layout direction (default `Horizontal`) |
82
82
  | `styleType` | `StepperStyleType` | Marker/connector preset (default `Default`) |
83
- | `collapse` | `StepperCollapse` | Which `content` bodies are expanded vertical only (default `None`) |
83
+ | `collapse` | `StepperCollapse` | Which `content` bodies are expanded. Vertical only (default `None`) |
84
84
  | `labelPlacement` | `StepperLabelPlacement` | Label position; default `Bottom` (horizontal) / `Right` (vertical). An out-of-orientation value falls back to that default |
85
85
  | `onStepClicked` | `(stepIndex: number) => void` | Navigate on step click. Linear: only completed steps are clickable; with `nonLinear`, any enabled step except the current one |
86
86
  | `nonLinear` | `boolean` | Allow clicking any step, not just completed ones |
@@ -88,7 +88,7 @@ const steps = [
88
88
 
89
89
  **Collapse (vertical `content`):** `None` keeps every body open; `ActiveOnly` opens just the current step's body (classic vertical wizard); `Completed` collapses completed bodies while keeping the current and upcoming ones open. Bodies animate their height and respect `prefers-reduced-motion`. Horizontal steppers don't render inline `content` and ignore `collapse`.
90
90
 
91
- **Theming:** these are theme variables (typed on `ThemeVariables`) set them theme-wide via `ThemeProvider`'s `variables`, or per instance via `style`, without fighting specificity. Each falls back to a built-in default when unset:
91
+ **Theming:** these are theme variables (typed on `ThemeVariables`). Set them theme-wide via `ThemeProvider`'s `variables`, or per instance via `style`, without fighting specificity. Each falls back to a built-in default when unset:
92
92
 
93
93
  | Variable | Falls back to |
94
94
  |----------|---------------|
@@ -105,7 +105,7 @@ const steps = [
105
105
  | `--stepper-text-on-marker` | `var(--text-on-primary)` |
106
106
 
107
107
  ```tsx
108
- // Theme-wide, via ThemeProvider circular pink markers, thicker connectors
108
+ // Theme-wide, via ThemeProvider: circular pink markers, thicker connectors
109
109
  const theme: Theme = {
110
110
  id: 'brand',
111
111
  variables: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahrowe/ui",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },