@pk-design/react-tailwind 1.8.1 → 1.9.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.
@@ -85,23 +85,27 @@ export interface ButtonBaseProps {
85
85
  */
86
86
  loadingText?: string;
87
87
  /**
88
- * Applies 50% border radius, producing a pill-shaped button.
88
+ * Applies a fully rounded border radius, producing a pill-shaped button
89
+ * (or a circle when combined with `iconOnly`).
89
90
  * @default false
90
91
  */
91
92
  rounded?: boolean;
92
93
  /**
93
- * Indicates that the button only contains an icon.
94
+ * Indicates that the button only contains an icon. Requires `aria-label`
95
+ * or `aria-labelledby` so the button has an accessible name.
94
96
  * @default false
95
97
  */
96
98
  iconOnly?: boolean;
97
99
  /**
98
- * Prevents outline styles on keyboard focus.
100
+ * Removes the focus ring shown on keyboard focus. Only use this when the
101
+ * button gets another visible focus indicator, e.g. via `className`.
99
102
  * @default false
100
103
  */
101
104
  noOutlineOnFocus?: boolean;
102
105
  /**
103
- * Indicates active toggle state (applies aria-pressed).
104
- * @default false
106
+ * Turns the button into a toggle: when set to `true` or `false`,
107
+ * `aria-pressed` reflects it and `true` shows a ring. Leave unset for a
108
+ * regular (non-toggle) button.
105
109
  */
106
110
  active?: boolean;
107
111
  /**
@@ -113,7 +117,9 @@ export interface ButtonBaseProps {
113
117
  */
114
118
  type?: 'button' | 'submit' | 'reset';
115
119
  /**
116
- * Standard disabled attribute. Only applies when as="button".
120
+ * Disables the button. Rendered as the native `disabled` attribute on
121
+ * `<button>`, or as `aria-disabled` (with `tabIndex={-1}` and clicks
122
+ * blocked) for any other element passed via `as`.
117
123
  */
118
124
  disabled?: boolean;
119
125
  }
@@ -22,11 +22,21 @@ export interface SelectBoxProps<T extends BaseOption | string = BaseOption> {
22
22
  /** List of option groups to display in the dropdown (alternative to options) */
23
23
  groups?: OptionGroup<T>[];
24
24
  /**
25
- * Currently selected option(s).
25
+ * Currently selected option(s). Passing this makes the SelectBox controlled:
26
+ * it shows exactly this value, so update it from `onChange`.
26
27
  * - For single select: a single T or null
27
28
  * - For multi-select: T[]
29
+ *
30
+ * Leave it undefined to let the SelectBox manage its own selection
31
+ * (optionally seeded with `defaultSelected`).
28
32
  */
29
33
  selected?: T | T[] | null;
34
+ /**
35
+ * Initial selection when the SelectBox is uncontrolled (`selected` not passed).
36
+ * Only read on mount; later changes are ignored. `onChange` still fires on
37
+ * every change.
38
+ */
39
+ defaultSelected?: T | T[] | null;
30
40
  /** Size scale of the SelectBox component (`"sm"` | `"md"` | `"lg"`). Defaults to `"md"`. */
31
41
  size?: SelectBoxSize;
32
42
  /** Name of the field inside option objects to use as the label (defaults to "label") */
@@ -59,6 +69,13 @@ export interface SelectBoxProps<T extends BaseOption | string = BaseOption> {
59
69
  placeholder?: string;
60
70
  /** CSS classes applied to the dropdown options container */
61
71
  dropdownContainerClass?: string;
72
+ /**
73
+ * Minimum width of the dropdown panel. By default the panel matches the
74
+ * input width; set this so it can grow wider than a narrow input. Numbers
75
+ * are treated as pixels, strings accept any CSS length (e.g. `"16rem"`).
76
+ * The panel stays left-aligned with the input.
77
+ */
78
+ dropdownMinWidth?: number | string;
62
79
  /**
63
80
  * Whether the open dropdown traps focus and makes the rest of the page inert.
64
81
  * @default false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pk-design/react-tailwind",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "main": "dist/react-tailwind.cjs.js",
5
5
  "module": "dist/react-tailwind.es.js",
6
6
  "types": "dist/types/index.d.ts",