@stackloop/ui 3.3.4 → 3.3.5
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/README.md +35 -3
- package/dist/CountrySelect.d.ts +3 -0
- package/dist/DatePicker.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1745 -1493
- package/dist/index.js.map +1 -1
- package/dist/stackloop-ui.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -239,9 +239,14 @@ Components with the `animate` prop:
|
|
|
239
239
|
- **`defaultCountry`**: `string` — default: `'US'`.
|
|
240
240
|
- **`autoDetect`**: `boolean` — default: `true`. Uses `navigator.language` to select a country.
|
|
241
241
|
- **`onCountryChange`**: `(country: Country) => void` — optional.
|
|
242
|
+
- **`label`**: `string` — optional.
|
|
243
|
+
- **`required`**: `boolean` — optional. Shows a required marker (`*`) on label and passes `required` to the inner input.
|
|
244
|
+
- **`error`**: `string` — optional. Shows error state and helper text.
|
|
245
|
+
- **`hint`**: `string` — optional. Shown only when `error` is not present.
|
|
242
246
|
- **`searchable`**: `boolean` — default: `true`.
|
|
243
247
|
- **`showFlags`**: `boolean` — default: `true`.
|
|
244
248
|
- **`animate`**: `boolean` — default: `true`.
|
|
249
|
+
- **`className`**: `string` — optional.
|
|
245
250
|
- Inherits standard `input` HTML attributes.
|
|
246
251
|
- **Usage:**
|
|
247
252
|
|
|
@@ -252,6 +257,8 @@ Components with the `animate` prop:
|
|
|
252
257
|
label="Phone"
|
|
253
258
|
value={phone}
|
|
254
259
|
onChange={(dialCode, value) => setPhone(`${dialCode}${value}`)}
|
|
260
|
+
required
|
|
261
|
+
hint="Include area code"
|
|
255
262
|
searchable
|
|
256
263
|
autoDetect
|
|
257
264
|
/>
|
|
@@ -264,11 +271,16 @@ Components with the `animate` prop:
|
|
|
264
271
|
- **`onChange`**: `(value: string) => void` — optional.
|
|
265
272
|
- **`onCountryChange`**: `(country: Country) => void` — optional.
|
|
266
273
|
- **`label`**: `string` — optional.
|
|
274
|
+
- **`required`**: `boolean` — optional. Shows a required marker (`*`) and `aria-required` on trigger.
|
|
267
275
|
- **`placeholder`**: `string` — optional.
|
|
276
|
+
- **`error`**: `string` — optional. Adds error border/ring and error message.
|
|
277
|
+
- **`hint`**: `string` — optional. Shown only when `error` is not present.
|
|
268
278
|
- **`searchable`**: `boolean` — default: `true`.
|
|
269
279
|
- **`clearable`**: `boolean` — default: `true`.
|
|
270
280
|
- **`showFlags`**: `boolean` — default: `true`.
|
|
281
|
+
- **`disabled`**: `boolean` — optional.
|
|
271
282
|
- **`animate`**: `boolean` — default: `true`.
|
|
283
|
+
- **`className`**: `string` — optional.
|
|
272
284
|
- **Usage:**
|
|
273
285
|
|
|
274
286
|
```jsx
|
|
@@ -278,6 +290,8 @@ Components with the `animate` prop:
|
|
|
278
290
|
label="Country"
|
|
279
291
|
value={country}
|
|
280
292
|
onChange={setCountry}
|
|
293
|
+
required
|
|
294
|
+
hint="Used for regional formatting"
|
|
281
295
|
searchable
|
|
282
296
|
/>
|
|
283
297
|
```
|
|
@@ -644,17 +658,35 @@ Components with the `animate` prop:
|
|
|
644
658
|
```
|
|
645
659
|
|
|
646
660
|
**DatePicker**:
|
|
647
|
-
- **Description:** Date picker with
|
|
661
|
+
- **Description:** Date picker with day grid, min/max date constraints, and fast custom month/year pickers.
|
|
648
662
|
- **Props:**
|
|
649
663
|
- **`value`**: `Date` — optional.
|
|
650
664
|
- **`onChange`**: `(date: Date) => void` — required.
|
|
651
|
-
- **`label
|
|
665
|
+
- **`label`**: `string` — optional.
|
|
666
|
+
- **`required`**: `boolean` — optional. Shows required marker (`*`) and `aria-required`.
|
|
667
|
+
- **`placeholder`**: `string` — default: `'Select date'`.
|
|
668
|
+
- **`error`**: `string` — optional.
|
|
669
|
+
- **`hint`**: `string` — optional. Shown only when `error` is not present.
|
|
670
|
+
- **`disabled`**: `boolean` — optional.
|
|
671
|
+
- **`minDate`** / **`maxDate`**: `Date` — optional.
|
|
672
|
+
- **`animate`**: `boolean` — default: `true`.
|
|
673
|
+
- **`className`**: `string` — optional.
|
|
674
|
+
- **Features:**
|
|
675
|
+
- **Custom Month Menu:** Scrollable month dropdown/dropup (no native browser select).
|
|
676
|
+
- **Custom Year Menu:** Scrollable year dropdown/dropup that supports quick jumps across many years.
|
|
677
|
+
- **Adaptive Positioning:** Month/year menus open upward when there is insufficient viewport space below.
|
|
652
678
|
- **Usage:**
|
|
653
679
|
|
|
654
680
|
```jsx
|
|
655
681
|
import { DatePicker } from '@stackloop/ui'
|
|
656
682
|
|
|
657
|
-
<DatePicker
|
|
683
|
+
<DatePicker
|
|
684
|
+
label="Date of birth"
|
|
685
|
+
value={date}
|
|
686
|
+
onChange={setDate}
|
|
687
|
+
required
|
|
688
|
+
hint="Choose month/year quickly from the menu"
|
|
689
|
+
/>
|
|
658
690
|
```
|
|
659
691
|
|
|
660
692
|
**DualSlider**:
|
package/dist/CountrySelect.d.ts
CHANGED
|
@@ -5,7 +5,10 @@ export interface CountrySelectProps {
|
|
|
5
5
|
onChange?: (value: string) => void;
|
|
6
6
|
onCountryChange?: (country: Country) => void;
|
|
7
7
|
label?: string;
|
|
8
|
+
required?: boolean;
|
|
8
9
|
placeholder?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
hint?: string;
|
|
9
12
|
searchable?: boolean;
|
|
10
13
|
clearable?: boolean;
|
|
11
14
|
showFlags?: boolean;
|
package/dist/DatePicker.d.ts
CHANGED