@donotdev/components 0.3.2 → 0.3.4

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.
@@ -14,7 +14,7 @@ These are the only ways one should handle layout to get to quick results functio
14
14
  - **Section** - Layout section with title, grid, tone system, and `bleed` prop for full-viewport-width content (images, maps, galleries).
15
15
  - **Grid** - CSS Grid layout primitive with responsive column control.
16
16
  - **Stack** - Flexbox layout for arranging items in rows or columns.
17
- - **HeroSection** - Hero banner with title, subtitle, gradient backgrounds, `bleed` for full-width, and `backgroundImage` for cover images with overlay.
17
+ - **HeroSection** - Hero banner with title (a div styled at h1 level, not an h1 element: the page provides its own h1 if it needs one), subtitle, gradient backgrounds, `bleed` for full-width, and `backgroundImage` for cover images with overlay.
18
18
  - **CallToAction** - Conversion-focused section with actions, `bleed` for full-width, and `backgroundImage` for cover images with overlay.
19
19
 
20
20
  ---
@@ -24,7 +24,7 @@ These are the only ways one should handle layout to get to quick results functio
24
24
  - **Card** - Premium card component with title, content, footer, and elevation variants.
25
25
  - **Navigation with middle-click support:** Wrap Card in Link component for navigation that supports middle-click (opens in new tab). See navigation section below.
26
26
  - **DualCard** - Side-by-side card layout for comparison or feature showcases.
27
- - **Text** - Typography component with semantic text variants.
27
+ - **Text** - Typography component with semantic text variants. `<Text as="h2" level="body">` keeps the h2 element but renders body-sized (an explicit `level` always emits `data-level`).
28
28
  - **Blockquote** - Styled blockquote for citations and testimonials.
29
29
  - **List** - Bullet points, numbered lists, and feature lists with zero CSS. Use `icon` prop for custom icons, `icon={null}` for plain bullets.
30
30
  - **DescriptionList** - Key-value pairs and metadata using semantic HTML (dl, dt, dd).
@@ -48,7 +48,7 @@ These are the only ways one should handle layout to get to quick results functio
48
48
 
49
49
  - **Input** - Accessible input with mobile-friendly touch targets and key state styling.
50
50
  - **QuantityStepper** - Controlled lot-aware quantity editor via `onChange`, or legacy increment/decrement callbacks. Supports zero, collapsed presentation, and vertical orientation. Editable mode requires safe-integer lot bounds and a valid controlled quantity; reconcile invalid persisted quantities before enabling it. See [QuantityStepper](./QUANTITY_STEPPER.md).
51
- - **PasswordInput** - Password field with show/hide toggle functionality.
51
+ - **PasswordInput** - Password field with show/hide toggle functionality. `revealAriaLabel={{ show, hide }}` names the toggle (pass translated strings; framework keys `auth:passwordToggle.show` / `.hide`; default English).
52
52
  - **Textarea** - Multi-line text input component.
53
53
  - **Label** - Accessible label with icon support and various positions.
54
54
  - **Field help (`info`)** - Opt-in: `info="…"` on `Input`, `PasswordInput`, `Select`, `Combobox`, `DatePicker`, `DateTimePicker`, `RangeInput`, `PinInput` or `FloatingLabel` (needs `label`) adds an (i) after the label; hover or keyboard focus shows the text, a tap pins it on touch screens. Without `info`, nothing is rendered. For a label you render yourself, place `<FieldInfo text="…" />` next to it.
@@ -78,7 +78,7 @@ These are the only ways one should handle layout to get to quick results functio
78
78
 
79
79
  - **Tabs** - Tabbed interface with props-based API and full keyboard navigation.
80
80
  - **Accordion** - Vertically stacked headings that reveal content sections.
81
- - **NavigationMenu** - Props-based navigation menu with nested menus and rich content.
81
+ - **NavigationMenu** - Props-based navigation menu with nested menus and rich content. Item `active: true` marks the current page (`aria-current="page"` + `data-active="true"` on its link, accent background). Sub-menu lists have no bullets.
82
82
  - **Pagination** - Accessible pagination with page number generation and ellipsis.
83
83
  - **Command** - Command palette component for keyboard navigation and search.
84
84
  - **CommandDialog** - Command palette dialog optimized for Cmd+K navigation.
@@ -91,7 +91,7 @@ These are the only ways one should handle layout to get to quick results functio
91
91
  - **Popover** - Accessible popover displaying rich content in a portal.
92
92
  - **Tooltip** - Tooltip component with positioning and delay controls.
93
93
  - **HoverCard** - Card that appears on hover with rich content.
94
- - **Sheet** - Slide-out panel for sidebars, mobile navigation, or editing panels.
94
+ - **Sheet** - Slide-out panel for sidebars, mobile navigation, or editing panels. `closeLabel` names the close button (pass a translated string, framework key `dndev:sheet.close`; default `Close sheet`).
95
95
  - **ContextMenu** - Right-click context menu with nested submenus.
96
96
  - **DropdownMenu** - Professional dropdown menu with props-based API.
97
97
 
@@ -105,7 +105,7 @@ These are the only ways one should handle layout to get to quick results functio
105
105
  - **Avatar** - Accessible avatar with image and fallback support.
106
106
  - **Badge** - Status indicator with semantic variants (polymorphic: div, span, mark).
107
107
  - **Tag** - Tag component for labels and categories. `removeLabel`: remove button label (default `'Remove'`).
108
- - **Calendar** - Accessible date picker built on react-day-picker. `DatePicker` and `DateTimePicker` load it on demand (browser idle after a picker mounts, or when the calendar trigger is pointed at, focused or opened), so a page with a date field does not ship it up front. If it cannot load, the popover shows `calendarErrorLabel` (pass a translated string; crud fields pass `t('date.calendarLoadError')`).
108
+ - **Calendar** - Accessible date picker built on react-day-picker. `DatePicker` and `DateTimePicker` load it on demand (browser idle after a picker mounts, or when the calendar trigger is pointed at, focused or opened), so a page with a date field does not ship it up front. If it cannot load, the popover shows `calendarErrorLabel` (pass a translated string; crud fields pass `t('date.calendarLoadError')`). Pickers outside DatePicker use `LazyCalendar` (`errorLabel` required) with `preloadCalendar` on trigger pointer-enter / focus and `useIdlePreloadCalendar()`; crud `DateFilter` does, so it no longer ships react-day-picker up front.
109
109
 
110
110
  ---
111
111
 
@@ -34,7 +34,7 @@ For vertical controls, add `vertical`: **plus above quantity above minus**, incl
34
34
  | `step?: number` | `1` | Positive safe-integer lot size. |
35
35
  | `max?: number` | `Number.MAX_SAFE_INTEGER` | Safe integer at least `min`; effective maximum rounds down to a complete lot. |
36
36
  | `allowZero?: boolean` | `false` | Allows committing zero, separate from positive lots. |
37
- | `collapseWhenZero?: boolean` | `false` | At zero, shows a large accessible plus, reserving the entire expanded footprint. |
37
+ | `collapseWhenZero?: boolean` | `false` | At zero, shows only a square accessible plus at the inline end, reserving the block size only; the first + grows the control toward the inline start. |
38
38
  | `vertical?: boolean` | `false` | Plus, quantity, minus stacked; changes visual and keyboard traversal order. |
39
39
  | `disabled?: boolean` | `false` | Disables all controls. |
40
40
  | `fullWidth?: boolean` | `false` | Fills available inline width, horizontal or vertical. |
@@ -65,7 +65,7 @@ Without `onChange`, `onIncrement?: () => void` and `onDecrement?: () => void` dr
65
65
 
66
66
  Supply localized labels. All enabled visible buttons and the editor are keyboard reachable; boundary buttons are natively disabled outside an editing session. While editing, directions stay reachable to apply a step to a replacement draft, even when the controlled value is at a bound. Hidden collapsed controls leave the accessibility tree and tab order. The same plus DOM node survives expansion/collapse; collapsing while the editor/minus has focus transfers focus to plus, without stealing focus from outside the group.
67
67
 
68
- Touch targets use `max(var(--touch-target), 44px)`. Density/theme tokens drive size, spacing, icons, borders, and focus. The expanded grid footprint is reserved in both states, horizontal and vertical: collapse never removes its grid tracks. Cell sizing includes the larger collapsed icon, inherited line height, and padding before grid placement; fixed block tracks prevent intrinsic icon sizing from changing the footprint. Enlarged text can grow cells without clipping. The same sizing applies on mobile, tablet, and desktop; `fullWidth` stretches the available inline space without reducing target sizes. Reduced-motion users receive no button transition. Native buttons are `type="button"`; the only timers are the press-and-hold repeat, cleared on release, disable and unmount; no browser globals during render or SSR-only branches.
68
+ Touch targets use `var(--touch-target)`: each cell is exactly the token (padding and icons fit inside, so a larger `--gap-sm` never inflates it) and grows only with enlarged text (`max(target, 1lh + 2 × --gap-sm)`, WCAG 1.4.4 / 1.4.12). − and + are one cell square; the quantity field is content-sized for three tabular digits (`3ch + --gap-sm`), one cell high, and stays at the touch target when it is a clickable `onValueClick` button. Expanded minimum footprint: two cells + field + border. `fullWidth` fills the container but shrinks to that minimum, never further. Collapsed, the horizontal control is a single cell-sized square (+) aligned to the inline end with `fullWidth` (otherwise placed by its parent); rows are fixed in both states so expanding never shifts layout vertically, and the inline size is not reserved. Expansion animates only the inline size, from the inline end toward the inline start (logical properties, RTL-correct): − and the field reveal from zero-width tracks and fade in (`--dur-normal`, `--ease-in-out`); they clip their own content, so focus rings are never clipped. Vertical keeps its stacked footprint: the collapsed + spans all three cells, not animated. Density/theme tokens drive size, spacing, icons, borders, and focus. The same sizing applies on mobile, tablet, and desktop. Reduced-motion users receive no transition. Native buttons are `type="button"`; the only timers are the press-and-hold repeat, cleared on release, disable and unmount; no browser globals during render or SSR-only branches.
69
69
 
70
70
  CSS is loaded by the existing component stylesheet import and framework styles index; no new export or style-index entries are required.
71
71
 
@@ -75,4 +75,4 @@ CSS is loaded by the existing component stylesheet import and framework styles i
75
75
  bun test packages/components/src/atomic/QuantityStepper/__tests__/quantity.test.ts packages/components/src/atomic/QuantityStepper/__tests__/QuantityStepper.dom.test.tsx
76
76
  ```
77
77
 
78
- DOM tests use `bun:test`, Happy DOM, and React `act`, exercising the actual component rather than a mock. They cover legacy value-button focus across collapse/expansion, horizontal and vertical, and guard the shared sizing, focus-visible, and enabled-only hover CSS. Happy DOM does not measure layout; browser regressions must verify equal collapsed/expanded bounds, fullWidth, enlarged text, and target sizes across mobile/tablet/desktop.
78
+ DOM tests use `bun:test`, Happy DOM, and React `act`, exercising the actual component rather than a mock. They cover legacy value-button focus across collapse/expansion, horizontal and vertical, and guard the shared sizing, focus-visible, and enabled-only hover CSS. Happy DOM does not measure layout; browser regressions (`tests/quantity-cart/run.ts`) verify equal collapsed/expanded block size, the collapsed square, fullWidth, enlarged text, and target sizes across mobile/tablet/desktop.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/components",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Styled UI components for DoNotDev",