ionbase-ui 0.18.0 → 0.19.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,6 +4,82 @@
4
4
  "propsType": "ToggleProps",
5
5
  "description": "Toggle is a checkbox with `role=\"switch\"`.\n\nNot a button with aria-pressed: a switch is a form value, and the checkbox\ngives form association and `:checked` for free. `role=\"switch\"` changes only\nhow it is announced — \"on/off\" rather than \"checked/unchecked\" — which is\nwhat Figma's On/Off states describe.\n\nThe visual difference from Checkbox is entirely in CSS; this component and\nCheckbox are near-identical by design rather than by accident, and are kept\napart because Figma models them as separate components with separate size\nramps.",
6
6
  "import": "import { Toggle } from 'ionbase-ui';",
7
+ "status": "stable",
8
+ "summary": "A switch — a checkbox with role=\"switch\", announced as on/off.",
9
+ "useWhen": [
10
+ "the change takes effect immediately: a setting, a feature flag, a preference"
11
+ ],
12
+ "useInstead": [
13
+ {
14
+ "when": "the value is collected and submitted with a form",
15
+ "use": "Checkbox",
16
+ "why": "a switch reads as taking effect now; a checkbox reads as a value being gathered"
17
+ },
18
+ {
19
+ "when": "there are more than two states",
20
+ "use": "RadioGroup"
21
+ }
22
+ ],
23
+ "variants": {
24
+ "size": {
25
+ "sm": {
26
+ "use": "dense settings rows and table filters"
27
+ },
28
+ "md": {
29
+ "use": "the default"
30
+ },
31
+ "lg": {
32
+ "use": "touch targets and prominent single settings"
33
+ }
34
+ },
35
+ "intent": {
36
+ "brand": {
37
+ "use": "the default"
38
+ },
39
+ "neutral": {
40
+ "use": "a setting with no positive or negative reading — display and layout preferences"
41
+ },
42
+ "danger": {
43
+ "use": "turning on something destructive or hard to undo"
44
+ }
45
+ }
46
+ },
47
+ "slots": {
48
+ "children": {
49
+ "accepts": "text",
50
+ "note": "the visible label; omit for a bare switch and supply `aria-label`"
51
+ }
52
+ },
53
+ "a11y": {
54
+ "role": "switch",
55
+ "guarantees": [
56
+ "a real <input type=\"checkbox\"> underneath, so form association, label clicking and `:checked` come from the platform",
57
+ "`role=\"switch\"` changes only the announcement — \"on/off\" rather than \"checked/unchecked\""
58
+ ],
59
+ "requires": [
60
+ "`children`, or `aria-label` when there is no visible label"
61
+ ]
62
+ },
63
+ "antiPatterns": [
64
+ {
65
+ "dont": "a Toggle with a Save button beside it",
66
+ "why": "a switch says the change is already applied; if it needs saving it is a Checkbox"
67
+ },
68
+ {
69
+ "dont": "labelling a Toggle \"Enable dark mode?\" as a question",
70
+ "why": "a switch label names the thing being switched, not a question about it"
71
+ },
72
+ {
73
+ "dont": "a button with `aria-pressed` for a setting",
74
+ "why": "a switch is a form value; the checkbox gives form association and `:checked` for free"
75
+ }
76
+ ],
77
+ "deprecated": [
78
+ {
79
+ "prop": "disabled",
80
+ "replacement": "isDisabled"
81
+ }
82
+ ],
7
83
  "stylesheet": "src/styles/toggle.css",
8
84
  "tokens": [
9
85
  "--border-disabled",
@@ -4,6 +4,80 @@
4
4
  "propsType": "TooltipProps",
5
5
  "description": "Tooltip — Figma `Tooltip` (801:1568).\n\nWraps its trigger rather than taking a ref, so the common case is one\nelement deep: `<Tooltip label=\"...\"><Button/></Tooltip>`.\n\nFOCUS OPENS IT, NOT JUST HOVER. A hover-only tooltip is invisible to keyboard\nand switch users, and `useTooltipTrigger` wires both plus Escape to dismiss.\nIt also enforces one open tooltip at a time and a shared warmup, so moving\nalong a row of icon buttons does not flash a tooltip per button.\n\nThe trigger is cloned with the interaction props and a ref, which means it\nmust forward both. Every component in this library does; a bare `<div>` does\ntoo. A function component that drops its ref will render, but the tooltip\nwill have nothing to position against.",
6
6
  "import": "import { Tooltip } from 'ionbase-ui';",
7
+ "status": "stable",
8
+ "summary": "A text-only hint attached to a trigger. Opens on hover and on focus.",
9
+ "useWhen": [
10
+ "naming an icon-only control",
11
+ "adding a short clarification that is genuinely optional to read"
12
+ ],
13
+ "useInstead": [
14
+ {
15
+ "when": "the content has anything focusable in it — a link, a button, a field",
16
+ "use": "Popover",
17
+ "why": "a tooltip cannot be focused, cannot be scrolled, and closes the moment the pointer leaves"
18
+ },
19
+ {
20
+ "when": "the information is required to complete the field",
21
+ "use": "Input",
22
+ "why": "Input's helper text is always visible; a tooltip is not discoverable on touch"
23
+ }
24
+ ],
25
+ "variants": {
26
+ "placement": {
27
+ "top": {
28
+ "use": "above the trigger — the default reading position"
29
+ },
30
+ "bottom": {
31
+ "use": "below the trigger, for something near the top of the viewport"
32
+ },
33
+ "left": {
34
+ "use": "to the left of the trigger"
35
+ },
36
+ "right": {
37
+ "use": "to the right of the trigger"
38
+ }
39
+ }
40
+ },
41
+ "slots": {
42
+ "label": {
43
+ "accepts": "text",
44
+ "note": "the hint. Text only"
45
+ },
46
+ "title": {
47
+ "accepts": "text",
48
+ "note": "optional heading above the label"
49
+ },
50
+ "children": {
51
+ "accepts": "Button",
52
+ "note": "the trigger. Must forward both a ref and DOM props"
53
+ }
54
+ },
55
+ "a11y": {
56
+ "role": "tooltip",
57
+ "guarantees": [
58
+ "focus opens it, not only hover — a hover-only tooltip is invisible to keyboard and switch users",
59
+ "Escape dismisses it",
60
+ "one tooltip open at a time with a shared warmup, so moving along a row of icon buttons does not flash one per button",
61
+ "`placement` flips to the opposite side when there is no room"
62
+ ],
63
+ "requires": [
64
+ "a trigger that is already labelled for icon-only controls — Tooltip supplies the hint, not the trigger's name"
65
+ ]
66
+ },
67
+ "antiPatterns": [
68
+ {
69
+ "dont": "putting a link or button inside `label`",
70
+ "why": "it cannot be reached — the tooltip closes when the pointer leaves the trigger"
71
+ },
72
+ {
73
+ "dont": "a tooltip as the only place information appears",
74
+ "why": "it is undiscoverable on touch, where there is no hover"
75
+ },
76
+ {
77
+ "dont": "a tooltip on a disabled Button",
78
+ "why": "a disabled button takes no focus and often no pointer events, so the hint never appears for a keyboard user"
79
+ }
80
+ ],
7
81
  "stylesheet": "src/styles/tooltip.css",
8
82
  "tokens": [
9
83
  "--font-family-sans",