@bspk/ui 1.3.9 → 1.3.11
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/dist/components/BannerAlert/BannerAlert.d.ts +5 -5
- package/dist/components/BannerAlert/BannerAlert.js +5 -5
- package/dist/components/Breadcrumb/BreadcrumbDropdown.d.ts +6 -0
- package/dist/components/Breadcrumb/BreadcrumbDropdown.js +6 -0
- package/dist/components/Breadcrumb/BreadcrumbDropdown.js.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js +1 -0
- package/dist/components/CheckboxGroup/CheckboxGroupExample.js.map +1 -1
- package/dist/components/ChipGroup/ChipGroup.d.ts +15 -28
- package/dist/components/ChipGroup/ChipGroup.js +12 -22
- package/dist/components/ChipGroup/ChipGroup.js.map +1 -1
- package/dist/components/ChipGroup/ChipGroupExample.js +61 -6
- package/dist/components/ChipGroup/ChipGroupExample.js.map +1 -1
- package/dist/components/ChipGroup/chip-group.css +5 -3
- package/dist/components/ChipGroup/chip-group.css.js +5 -3
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Field/FieldDescription.d.ts +7 -5
- package/dist/components/Field/FieldDescription.js +7 -3
- package/dist/components/Field/FieldDescription.js.map +1 -1
- package/dist/components/Field/FieldError.d.ts +6 -0
- package/dist/components/Field/FieldError.js +6 -0
- package/dist/components/Field/FieldError.js.map +1 -1
- package/dist/components/Field/FieldLabel.d.ts +6 -0
- package/dist/components/Field/FieldLabel.js +6 -0
- package/dist/components/Field/FieldLabel.js.map +1 -1
- package/dist/components/Field/utils.d.ts +5 -0
- package/dist/components/Field/utils.js +5 -0
- package/dist/components/Field/utils.js.map +1 -1
- package/dist/components/InlineAlert/SvgWarningTwoTone.d.ts +6 -0
- package/dist/components/InlineAlert/SvgWarningTwoTone.js +6 -0
- package/dist/components/InlineAlert/SvgWarningTwoTone.js.map +1 -1
- package/dist/components/InputNumber/IncrementButton.d.ts +13 -3
- package/dist/components/InputNumber/IncrementButton.js +11 -4
- package/dist/components/InputNumber/IncrementButton.js.map +1 -1
- package/dist/components/InputNumber/InputNumber.js +26 -10
- package/dist/components/InputNumber/InputNumber.js.map +1 -1
- package/dist/components/InputNumber/InputNumberExample.js +1 -0
- package/dist/components/InputNumber/InputNumberExample.js.map +1 -1
- package/dist/components/InputNumber/input-number.css +6 -0
- package/dist/components/InputNumber/input-number.css.js +6 -0
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/OTPInput/OTPInput.d.ts +13 -3
- package/dist/components/OTPInput/OTPInput.js +11 -39
- package/dist/components/OTPInput/OTPInput.js.map +1 -1
- package/dist/components/OTPInput/OTPInputExample.js +6 -1
- package/dist/components/OTPInput/OTPInputExample.js.map +1 -1
- package/dist/components/OTPInput/otp-input.css +18 -17
- package/dist/components/OTPInput/otp-input.css.js +18 -17
- package/dist/components/Pagination/PageList.d.ts +6 -0
- package/dist/components/Pagination/PageList.js +6 -0
- package/dist/components/Pagination/PageList.js.map +1 -1
- package/dist/components/Scrim/Scrim.d.ts +0 -1
- package/dist/components/Scrim/Scrim.js +0 -1
- package/dist/components/Scrim/Scrim.js.map +1 -1
- package/dist/components/Select/Select.d.ts +11 -11
- package/dist/components/Select/Select.js +11 -11
- package/dist/components/Skeleton/Circular.d.ts +6 -0
- package/dist/components/Skeleton/Circular.js +6 -0
- package/dist/components/Skeleton/Circular.js.map +1 -1
- package/dist/components/Skeleton/Photo.d.ts +6 -0
- package/dist/components/Skeleton/Photo.js +6 -0
- package/dist/components/Skeleton/Photo.js.map +1 -1
- package/dist/components/Skeleton/Profile.d.ts +6 -0
- package/dist/components/Skeleton/Profile.js +6 -0
- package/dist/components/Skeleton/Profile.js.map +1 -1
- package/dist/components/Skeleton/Rectangular.d.ts +6 -0
- package/dist/components/Skeleton/Rectangular.js +6 -0
- package/dist/components/Skeleton/Rectangular.js.map +1 -1
- package/dist/components/Skeleton/Thumbnail.d.ts +6 -0
- package/dist/components/Skeleton/Thumbnail.js +6 -0
- package/dist/components/Skeleton/Thumbnail.js.map +1 -1
- package/dist/components/Slider/SliderIntervalDots.d.ts +6 -0
- package/dist/components/Slider/SliderIntervalDots.js +6 -0
- package/dist/components/Slider/SliderIntervalDots.js.map +1 -1
- package/dist/components/Snackbar/Manager.d.ts +0 -1
- package/dist/components/Snackbar/Manager.js +0 -1
- package/dist/components/Snackbar/Manager.js.map +1 -1
- package/dist/components/Snackbar/Snackbar.d.ts +0 -1
- package/dist/components/Snackbar/Snackbar.js +0 -1
- package/dist/components/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/TabList/TabList.js +1 -2
- package/dist/components/TabList/TabList.js.map +1 -1
- package/dist/components/Table/Footer.d.ts +6 -0
- package/dist/components/Table/Footer.js +6 -0
- package/dist/components/Table/Footer.js.map +1 -1
- package/dist/components/TimePicker/Listbox.d.ts +6 -0
- package/dist/components/TimePicker/Listbox.js +6 -0
- package/dist/components/TimePicker/Listbox.js.map +1 -1
- package/dist/components/TimePicker/Segment.d.ts +6 -0
- package/dist/components/TimePicker/Segment.js +6 -0
- package/dist/components/TimePicker/Segment.js.map +1 -1
- package/dist/components/Truncated/Truncated.d.ts +0 -1
- package/dist/components/Truncated/Truncated.js +1 -2
- package/dist/components/Truncated/Truncated.js.map +1 -1
- package/dist/components/UIProvider/UIProvider.d.ts +0 -1
- package/dist/components/UIProvider/UIProvider.js +0 -1
- package/dist/components/UIProvider/UIProvider.js.map +1 -1
- package/dist/hooks/useLongPress.d.ts +30 -15
- package/dist/hooks/useLongPress.js +26 -42
- package/dist/hooks/useLongPress.js.map +1 -1
- package/dist/styles/base.css +9 -0
- package/dist/styles/base.css.js +9 -0
- package/package.json +1 -1
- package/src/components/BannerAlert/BannerAlert.tsx +5 -5
- package/src/components/Breadcrumb/BreadcrumbDropdown.tsx +6 -0
- package/src/components/CheckboxGroup/CheckboxGroupExample.tsx +1 -0
- package/src/components/ChipGroup/ChipGroup.rtl.test.tsx +16 -11
- package/src/components/ChipGroup/ChipGroup.tsx +18 -36
- package/src/components/ChipGroup/ChipGroupExample.tsx +64 -36
- package/src/components/ChipGroup/chip-group.scss +5 -3
- package/src/components/Drawer/Drawer.tsx +0 -1
- package/src/components/Field/FieldDescription.tsx +7 -5
- package/src/components/Field/FieldError.tsx +6 -0
- package/src/components/Field/FieldLabel.tsx +6 -0
- package/src/components/Field/utils.ts +5 -0
- package/src/components/InlineAlert/SvgWarningTwoTone.tsx +6 -0
- package/src/components/InputNumber/IncrementButton.tsx +21 -11
- package/src/components/InputNumber/InputNumber.tsx +33 -31
- package/src/components/InputNumber/InputNumberExample.tsx +1 -0
- package/src/components/InputNumber/input-number.scss +10 -0
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/OTPInput/OTPInput.rtl.test.tsx +4 -2
- package/src/components/OTPInput/OTPInput.tsx +34 -63
- package/src/components/OTPInput/OTPInputExample.tsx +6 -1
- package/src/components/OTPInput/otp-input.scss +50 -45
- package/src/components/Pagination/PageList.tsx +6 -0
- package/src/components/Scrim/Scrim.tsx +0 -1
- package/src/components/Select/Select.tsx +11 -11
- package/src/components/Skeleton/Circular.tsx +6 -0
- package/src/components/Skeleton/Photo.tsx +6 -0
- package/src/components/Skeleton/Profile.tsx +6 -0
- package/src/components/Skeleton/Rectangular.tsx +6 -0
- package/src/components/Skeleton/Thumbnail.tsx +6 -0
- package/src/components/Slider/SliderIntervalDots.tsx +6 -0
- package/src/components/Snackbar/Manager.tsx +0 -1
- package/src/components/Snackbar/Snackbar.tsx +0 -1
- package/src/components/TabList/TabList.tsx +1 -2
- package/src/components/Table/Footer.tsx +6 -0
- package/src/components/TimePicker/Listbox.tsx +6 -0
- package/src/components/TimePicker/Segment.tsx +6 -0
- package/src/components/Truncated/Truncated.tsx +1 -2
- package/src/components/UIProvider/UIProvider.tsx +0 -1
- package/src/hooks/useLongPress.ts +58 -48
- package/src/styles/base.scss +9 -0
- package/dist/components/Truncated/truncated.css +0 -8
- package/dist/components/Truncated/truncated.css.js +0 -13
- package/src/components/Truncated/truncated.scss +0 -8
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import './input-number.css.js';
|
|
3
|
-
import {
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
4
|
import { IncrementButton } from './IncrementButton';
|
|
5
5
|
import { useFieldInit } from '../Field';
|
|
6
6
|
import { useId } from '../../hooks/useId';
|
|
7
|
-
function isNumber(value, fallbackValue
|
|
7
|
+
function isNumber(value, fallbackValue) {
|
|
8
8
|
if (typeof value === 'number')
|
|
9
9
|
return value;
|
|
10
10
|
if (typeof value !== 'string')
|
|
11
11
|
return fallbackValue;
|
|
12
|
-
const num =
|
|
12
|
+
const num = parseFloat(value);
|
|
13
13
|
return isNaN(num) ? fallbackValue : num;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
@@ -67,12 +67,28 @@ export function InputNumber({ value: valueProp, onChange, align = 'center', size
|
|
|
67
67
|
const max = typeof maxProp === 'number' && maxProp >= min ? maxProp : Number.MAX_SAFE_INTEGER;
|
|
68
68
|
const centered = align !== 'left';
|
|
69
69
|
const inputId = useId(id);
|
|
70
|
-
const value =
|
|
71
|
-
const
|
|
72
|
-
|
|
70
|
+
const value = isNumber(valueProp, min);
|
|
71
|
+
const removeDisabled = disabled || value + step * -1 < min;
|
|
72
|
+
const addDisabled = disabled || value + step > max;
|
|
73
|
+
const valueRef = useRef(value);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
valueRef.current = value;
|
|
76
|
+
}, [value]);
|
|
77
|
+
const incrementHandler = (kind) => {
|
|
78
|
+
const increment = kind === 'add' ? step : step * -1;
|
|
79
|
+
const next = valueRef.current + increment;
|
|
80
|
+
if (next < min || next > max)
|
|
81
|
+
return false;
|
|
82
|
+
onChange(next);
|
|
83
|
+
return true;
|
|
73
84
|
};
|
|
74
|
-
return (_jsxs("div", { "data-bspk": "input-number", "data-centered": centered || undefined, "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-readonly": readOnly || undefined, "data-size": size, "data-stepper-input": true, children: [
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
return (_jsxs("div", { "data-bspk": "input-number", "data-centered": centered || undefined, "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-readonly": readOnly || undefined, "data-size": size, "data-stepper-input": true, children: [_jsx("input", { ...inputElementProps, "aria-describedby": ariaDescribedBy || undefined, "aria-errormessage": ariaErrorMessage || undefined, "aria-invalid": invalid, "aria-label": ariaLabel, autoComplete: "off", "data-input": true, "data-stepper-input-element": true, disabled: disabled, id: inputId, inputMode: "numeric", max: max, min: min, name: name, onBlur: (e) => {
|
|
86
|
+
const next = isNumber(e.target.value, min);
|
|
87
|
+
e.target.value = next?.toString() || '';
|
|
88
|
+
onChange(next);
|
|
89
|
+
}, onChange: (e) => {
|
|
90
|
+
const next = isNumber(e.target.value, min);
|
|
91
|
+
onChange(next);
|
|
92
|
+
}, readOnly: readOnly, required: required, step: step, type: "number", value: value !== undefined ? value : '' }), _jsx("div", { "aria-hidden": true, "data-divider": true }), _jsx(IncrementButton, { disabled: removeDisabled, inputId: inputId, kind: "remove", triggerIncrement: incrementHandler }), _jsx(IncrementButton, { disabled: addDisabled, inputId: inputId, kind: "add", triggerIncrement: incrementHandler })] }));
|
|
77
93
|
}
|
|
78
94
|
//# sourceMappingURL=InputNumber.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputNumber.js","sourceRoot":"","sources":["../../../src/components/InputNumber/InputNumber.tsx"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"InputNumber.js","sourceRoot":"","sources":["../../../src/components/InputNumber/InputNumber.tsx"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OA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AY,EAAE,yBAAyB;KAC1C;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,GAAI;
|
|
1
|
+
{"version":3,"file":"InputNumberExample.js","sourceRoot":"","sources":["../../../src/components/InputNumber/InputNumberExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,kBAAkB,GAAuC;IAClE,YAAY,EAAE;QACV,YAAY,EAAE,yBAAyB;KAC1C;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,GAAI;IAC1D,QAAQ,EAAE,KAAK;CAClB,CAAC"}
|
|
@@ -97,5 +97,11 @@
|
|
|
97
97
|
--height: var(--spacing-sizing-12);
|
|
98
98
|
--svg-width: var(--spacing-sizing-06);
|
|
99
99
|
}
|
|
100
|
+
[data-bspk=input-number][data-centered] button:first-of-type {
|
|
101
|
+
order: -1;
|
|
102
|
+
}
|
|
103
|
+
[data-bspk=input-number][data-centered] [data-divider] {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
100
106
|
|
|
101
107
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -100,6 +100,12 @@ style.appendChild(document.createTextNode(`[data-bspk=input-number] {
|
|
|
100
100
|
--height: var(--spacing-sizing-12);
|
|
101
101
|
--svg-width: var(--spacing-sizing-06);
|
|
102
102
|
}
|
|
103
|
+
[data-bspk=input-number][data-centered] button:first-of-type {
|
|
104
|
+
order: -1;
|
|
105
|
+
}
|
|
106
|
+
[data-bspk=input-number][data-centered] [data-divider] {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
103
109
|
|
|
104
110
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
105
111
|
`));
|
|
@@ -44,7 +44,7 @@ export type LinkProps = Pick<CommonPropsLibrary, 'disabled'> & {
|
|
|
44
44
|
* @example
|
|
45
45
|
* import { Link } from '@bspk/ui/Link';
|
|
46
46
|
*
|
|
47
|
-
* <Link href="https://
|
|
47
|
+
* <Link href="https://anywhere.re" label="Example label" trailingIcon="external" />;
|
|
48
48
|
*
|
|
49
49
|
* @name Link
|
|
50
50
|
* @phase UXReview
|
|
@@ -7,7 +7,7 @@ import { lazy, Suspense } from 'react';
|
|
|
7
7
|
* @example
|
|
8
8
|
* import { Link } from '@bspk/ui/Link';
|
|
9
9
|
*
|
|
10
|
-
* <Link href="https://
|
|
10
|
+
* <Link href="https://anywhere.re" label="Example label" trailingIcon="external" />;
|
|
11
11
|
*
|
|
12
12
|
* @name Link
|
|
13
13
|
* @phase UXReview
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './otp-input.scss';
|
|
2
2
|
import { CommonProps } from '-/types/common';
|
|
3
|
-
export type OTPInputProps = CommonProps<'id' | 'invalid' | 'name' | 'size'> & {
|
|
3
|
+
export type OTPInputProps = CommonProps<'aria-label' | 'id' | 'invalid' | 'name' | 'size'> & {
|
|
4
4
|
/**
|
|
5
5
|
* The value of the otp-input.
|
|
6
6
|
*
|
|
@@ -23,6 +23,12 @@ export type OTPInputProps = CommonProps<'id' | 'invalid' | 'name' | 'size'> & {
|
|
|
23
23
|
* @maximum 10
|
|
24
24
|
*/
|
|
25
25
|
length?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The mode of the otp-input.
|
|
28
|
+
*
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
alphanumeric?: boolean;
|
|
26
32
|
};
|
|
27
33
|
/**
|
|
28
34
|
* A row of input fields that are used to input a temporary secure pin code sent to the customer.
|
|
@@ -30,10 +36,14 @@ export type OTPInputProps = CommonProps<'id' | 'invalid' | 'name' | 'size'> & {
|
|
|
30
36
|
* @example
|
|
31
37
|
* import { OTPInput } from '@bspk/ui/OTPInput';
|
|
32
38
|
*
|
|
33
|
-
*
|
|
39
|
+
* () => {
|
|
40
|
+
* const [otpValue, setOtpValue] = useState('');
|
|
41
|
+
*
|
|
42
|
+
* return <OTPInput name="2-auth" length={6} value={otpValue} onChange={setOtpValue} alphanumeric={false} />;
|
|
43
|
+
* };
|
|
34
44
|
*
|
|
35
45
|
* @name OTPInput
|
|
36
46
|
* @phase UXReview
|
|
37
47
|
*/
|
|
38
|
-
export declare function OTPInput({ value: valueProp, onChange, name, id: idProp, length, size, invalid, }: OTPInputProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function OTPInput({ value: valueProp, onChange, name, id: idProp, length, size, invalid, alphanumeric, 'aria-label': ariaLabel, }: OTPInputProps): import("react/jsx-runtime").JSX.Element;
|
|
39
49
|
/** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import './otp-input.css.js';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
3
|
import { useId } from '../../hooks/useId';
|
|
5
4
|
/**
|
|
6
5
|
* A row of input fields that are used to input a temporary secure pin code sent to the customer.
|
|
@@ -8,48 +7,21 @@ import { useId } from '../../hooks/useId';
|
|
|
8
7
|
* @example
|
|
9
8
|
* import { OTPInput } from '@bspk/ui/OTPInput';
|
|
10
9
|
*
|
|
11
|
-
*
|
|
10
|
+
* () => {
|
|
11
|
+
* const [otpValue, setOtpValue] = useState('');
|
|
12
|
+
*
|
|
13
|
+
* return <OTPInput name="2-auth" length={6} value={otpValue} onChange={setOtpValue} alphanumeric={false} />;
|
|
14
|
+
* };
|
|
12
15
|
*
|
|
13
16
|
* @name OTPInput
|
|
14
17
|
* @phase UXReview
|
|
15
18
|
*/
|
|
16
|
-
export function OTPInput({ value: valueProp, onChange, name, id: idProp, length = 6, size = 'medium', invalid = false, }) {
|
|
19
|
+
export function OTPInput({ value: valueProp, onChange, name, id: idProp, length = 6, size = 'medium', invalid = false, alphanumeric = false, 'aria-label': ariaLabel = 'OTP input', }) {
|
|
17
20
|
const id = useId(idProp);
|
|
18
|
-
const value = valueProp
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
charArray[index] = character;
|
|
24
|
-
return charArray.join('');
|
|
25
|
-
};
|
|
26
|
-
const updateValue = (next) => onChange(next.slice(0, length).toUpperCase());
|
|
27
|
-
return (_jsxs("div", { "data-bspk": "otp-input", "data-invalid": invalid || undefined, "data-size": size || 'medium', id: id, ref: parentRef, children: [_jsx("input", { name: name, type: "hidden", value: value }), Array.from({ length }, (_, index) => (_jsx("span", { "aria-label": `OTP digit ${index + 1}`, "data-digit": index + 1, onClick: (e) => {
|
|
28
|
-
if (value[index])
|
|
29
|
-
return;
|
|
30
|
-
// if a digit does not exist for the previous index then focus the previous input
|
|
31
|
-
if (!value[index - 1]) {
|
|
32
|
-
e.preventDefault();
|
|
33
|
-
element(value.length)?.focus();
|
|
34
|
-
}
|
|
35
|
-
}, onKeyDown: (event) => {
|
|
36
|
-
if (event.key === 'Backspace') {
|
|
37
|
-
if (value) {
|
|
38
|
-
// delete the last value if there is one and focus the first empty input
|
|
39
|
-
const next = value.slice(0, -1);
|
|
40
|
-
updateValue(next);
|
|
41
|
-
element(next.length)?.focus();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// if a single character key is pressed at at the current index and focus the next input
|
|
45
|
-
if (event.key.length === 1) {
|
|
46
|
-
updateValue(setIndex(index, event.key));
|
|
47
|
-
element(index + 1)?.focus();
|
|
48
|
-
}
|
|
49
|
-
}, onPaste: (event) => {
|
|
50
|
-
const pastedData = event.clipboardData.getData('text').trim();
|
|
51
|
-
updateValue(pastedData);
|
|
52
|
-
element(length - 1)?.focus();
|
|
53
|
-
}, role: "textbox", tabIndex: 0, children: value?.[index] || '' }, index)))] }));
|
|
21
|
+
const value = valueProp || '';
|
|
22
|
+
const activeIndex = Math.min(value.length, length - 1);
|
|
23
|
+
return (_jsxs("div", { "data-bspk": "otp-input", "data-invalid": invalid || undefined, "data-size": size || 'medium', id: id, children: [_jsx("input", { "aria-label": ariaLabel, inputMode: alphanumeric ? 'text' : 'numeric', name: name, onChange: (event) => {
|
|
24
|
+
onChange(event.target.value.trim().toUpperCase().slice(0, length));
|
|
25
|
+
}, type: alphanumeric ? 'text' : 'number', value: value }), _jsx("span", { "data-digits": true, children: Array.from({ length }, (_, index) => (_jsx("span", { "data-active": index === activeIndex || undefined, "data-digit": true, children: value[index] }, index))) })] }));
|
|
54
26
|
}
|
|
55
27
|
//# sourceMappingURL=OTPInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTPInput.js","sourceRoot":"","sources":["../../../src/components/OTPInput/OTPInput.tsx"],"names":[],"mappings":";AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"OTPInput.js","sourceRoot":"","sources":["../../../src/components/OTPInput/OTPInput.tsx"],"names":[],"mappings":";AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAkCtC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,QAAQ,CAAC,EACrB,KAAK,EAAE,SAAS,EAChB,QAAQ,EACR,IAAI,EACJ,EAAE,EAAE,MAAM,EACV,MAAM,GAAG,CAAC,EACV,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,KAAK,EACf,YAAY,GAAG,KAAK,EACpB,YAAY,EAAE,SAAS,GAAG,WAAW,GACzB;IACZ,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,KAAK,GAAG,SAAS,IAAI,EAAE,CAAC;IAC9B,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IAEvD,OAAO,CACH,4BAAe,WAAW,kBAAe,OAAO,IAAI,SAAS,eAAa,IAAI,IAAI,QAAQ,EAAE,EAAE,EAAE,EAAE,aAC9F,8BACgB,SAAS,EACrB,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC5C,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAChB,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;gBACvE,CAAC,EACD,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EACtC,KAAK,EAAE,KAAK,GACd,EACF,8CACK,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAClC,8BAAmB,KAAK,KAAK,WAAW,IAAI,SAAS,gCAChD,KAAK,CAAC,KAAK,CAAC,IADsD,KAAK,CAErE,CACV,CAAC,GACC,IACL,CACT,CAAC;AACN,CAAC"}
|
|
@@ -19,7 +19,12 @@ export const presets = [
|
|
|
19
19
|
];
|
|
20
20
|
export const OTPInputExample = {
|
|
21
21
|
containerStyle: { width: '100%' },
|
|
22
|
-
defaultState: {
|
|
22
|
+
defaultState: {
|
|
23
|
+
value: '',
|
|
24
|
+
length: 6,
|
|
25
|
+
name: 'OTP Input',
|
|
26
|
+
alphanumeric: false,
|
|
27
|
+
},
|
|
23
28
|
disableProps: [],
|
|
24
29
|
presets,
|
|
25
30
|
render: ({ props, Component }) => _jsx(Component, { ...props }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTPInputExample.js","sourceRoot":"","sources":["../../../src/components/OTPInput/OTPInputExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,OAAO,GAA4B;IAC5C;QACI,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE;YACP,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,WAAW;SACpB;KACJ;IACD;QACI,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE;YACP,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,WAAW;SACpB;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAoC;IAC5D,cAAc,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IACjC,YAAY,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"OTPInputExample.js","sourceRoot":"","sources":["../../../src/components/OTPInput/OTPInputExample.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,OAAO,GAA4B;IAC5C;QACI,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE;YACP,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,WAAW;SACpB;KACJ;IACD;QACI,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE;YACP,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,WAAW;SACpB;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAoC;IAC5D,cAAc,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IACjC,YAAY,EAAE;QACV,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,WAAW;QACjB,YAAY,EAAE,KAAK;KACtB;IACD,YAAY,EAAE,EAAE;IAChB,OAAO;IACP,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,GAAI;IAC1D,QAAQ,EAAE,EAAE;CACf,CAAC"}
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
[data-bspk=otp-input] {
|
|
2
|
+
width: fit-content;
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
[data-bspk=otp-input] input[inputMode] {
|
|
6
|
+
position: absolute;
|
|
7
|
+
inset: 0;
|
|
8
|
+
opacity: 0;
|
|
9
|
+
border: none;
|
|
10
|
+
caret-color: transparent;
|
|
11
|
+
}
|
|
12
|
+
[data-bspk=otp-input] [data-digits] {
|
|
2
13
|
display: flex;
|
|
3
14
|
flex-direction: row;
|
|
4
15
|
justify-content: center;
|
|
5
16
|
gap: var(--spacing-sizing-02);
|
|
6
17
|
font: var(--font);
|
|
7
18
|
width: fit-content;
|
|
19
|
+
position: relative;
|
|
20
|
+
pointer-events: none;
|
|
8
21
|
}
|
|
9
|
-
[data-bspk=otp-input] [data-digit] {
|
|
22
|
+
[data-bspk=otp-input] [data-digits] [data-digit] {
|
|
10
23
|
display: flex;
|
|
24
|
+
flex-direction: row;
|
|
11
25
|
align-items: center;
|
|
12
26
|
justify-content: center;
|
|
13
27
|
border-radius: var(--radius-sm);
|
|
@@ -17,25 +31,12 @@
|
|
|
17
31
|
width: var(--width);
|
|
18
32
|
position: relative;
|
|
19
33
|
outline: none;
|
|
34
|
+
text-align: center;
|
|
20
35
|
}
|
|
21
|
-
[data-bspk=otp-input] [data-digit]
|
|
22
|
-
background: var(--interaction-hover-opacity);
|
|
23
|
-
content: "";
|
|
24
|
-
position: absolute;
|
|
25
|
-
inset: 0;
|
|
26
|
-
border-radius: var(--radius-sm);
|
|
27
|
-
}
|
|
28
|
-
[data-bspk=otp-input] [data-digit]:active::after {
|
|
29
|
-
background: var(--interaction-press-opacity);
|
|
30
|
-
content: "";
|
|
31
|
-
position: absolute;
|
|
32
|
-
inset: 0;
|
|
33
|
-
border-radius: var(--radius-sm);
|
|
34
|
-
}
|
|
35
|
-
[data-bspk=otp-input] [data-digit]:focus:not(:active) {
|
|
36
|
+
[data-bspk=otp-input] input[inputMode]:focus + [data-digits] [data-digit][data-active] {
|
|
36
37
|
outline: solid 2px var(--stroke-neutral-focus);
|
|
37
38
|
}
|
|
38
|
-
[data-bspk=otp-input] [data-digit]
|
|
39
|
+
[data-bspk=otp-input] input[inputMode]:focus + [data-digits] [data-digit][data-active]:empty::before {
|
|
39
40
|
content: "";
|
|
40
41
|
width: 2px;
|
|
41
42
|
height: calc(var(--caret-height) - 8px);
|
|
@@ -2,15 +2,29 @@
|
|
|
2
2
|
* Do not edit this file directly. */
|
|
3
3
|
const style = document.createElement('style');
|
|
4
4
|
style.appendChild(document.createTextNode(`[data-bspk=otp-input] {
|
|
5
|
+
width: fit-content;
|
|
6
|
+
position: relative;
|
|
7
|
+
}
|
|
8
|
+
[data-bspk=otp-input] input[inputMode] {
|
|
9
|
+
position: absolute;
|
|
10
|
+
inset: 0;
|
|
11
|
+
opacity: 0;
|
|
12
|
+
border: none;
|
|
13
|
+
caret-color: transparent;
|
|
14
|
+
}
|
|
15
|
+
[data-bspk=otp-input] [data-digits] {
|
|
5
16
|
display: flex;
|
|
6
17
|
flex-direction: row;
|
|
7
18
|
justify-content: center;
|
|
8
19
|
gap: var(--spacing-sizing-02);
|
|
9
20
|
font: var(--font);
|
|
10
21
|
width: fit-content;
|
|
22
|
+
position: relative;
|
|
23
|
+
pointer-events: none;
|
|
11
24
|
}
|
|
12
|
-
[data-bspk=otp-input] [data-digit] {
|
|
25
|
+
[data-bspk=otp-input] [data-digits] [data-digit] {
|
|
13
26
|
display: flex;
|
|
27
|
+
flex-direction: row;
|
|
14
28
|
align-items: center;
|
|
15
29
|
justify-content: center;
|
|
16
30
|
border-radius: var(--radius-sm);
|
|
@@ -20,25 +34,12 @@ style.appendChild(document.createTextNode(`[data-bspk=otp-input] {
|
|
|
20
34
|
width: var(--width);
|
|
21
35
|
position: relative;
|
|
22
36
|
outline: none;
|
|
37
|
+
text-align: center;
|
|
23
38
|
}
|
|
24
|
-
[data-bspk=otp-input] [data-digit]
|
|
25
|
-
background: var(--interaction-hover-opacity);
|
|
26
|
-
content: "";
|
|
27
|
-
position: absolute;
|
|
28
|
-
inset: 0;
|
|
29
|
-
border-radius: var(--radius-sm);
|
|
30
|
-
}
|
|
31
|
-
[data-bspk=otp-input] [data-digit]:active::after {
|
|
32
|
-
background: var(--interaction-press-opacity);
|
|
33
|
-
content: "";
|
|
34
|
-
position: absolute;
|
|
35
|
-
inset: 0;
|
|
36
|
-
border-radius: var(--radius-sm);
|
|
37
|
-
}
|
|
38
|
-
[data-bspk=otp-input] [data-digit]:focus:not(:active) {
|
|
39
|
+
[data-bspk=otp-input] input[inputMode]:focus + [data-digits] [data-digit][data-active] {
|
|
39
40
|
outline: solid 2px var(--stroke-neutral-focus);
|
|
40
41
|
}
|
|
41
|
-
[data-bspk=otp-input] [data-digit]
|
|
42
|
+
[data-bspk=otp-input] input[inputMode]:focus + [data-digits] [data-digit][data-active]:empty::before {
|
|
42
43
|
content: "";
|
|
43
44
|
width: 2px;
|
|
44
45
|
height: calc(var(--caret-height) - 8px);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { PaginationProps } from './Pagination';
|
|
2
2
|
export type PageListProps = Pick<PaginationProps, 'numPages' | 'onChange' | 'value'>;
|
|
3
|
+
/**
|
|
4
|
+
* PageList component displays a list of page buttons for pagination.
|
|
5
|
+
*
|
|
6
|
+
* @name PageList
|
|
7
|
+
* @parent Pagination
|
|
8
|
+
*/
|
|
3
9
|
export declare function PageList({ numPages, onChange, value }: PageListProps): import("react/jsx-runtime").JSX.Element[];
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '../Button';
|
|
3
|
+
/**
|
|
4
|
+
* PageList component displays a list of page buttons for pagination.
|
|
5
|
+
*
|
|
6
|
+
* @name PageList
|
|
7
|
+
* @parent Pagination
|
|
8
|
+
*/
|
|
3
9
|
export function PageList({ numPages, onChange, value }) {
|
|
4
10
|
return Array.from({ length: numPages }, (_, index) => {
|
|
5
11
|
const page = index + 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageList.js","sourceRoot":"","sources":["../../../src/components/Pagination/PageList.tsx"],"names":[],"mappings":";AACA,OAAO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,OAAO,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,IAL3C,IAAI,CAMX,CACL,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrim.js","sourceRoot":"","sources":["../../../src/components/Scrim/Scrim.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,CAAC;AAoBtB
|
|
1
|
+
{"version":3,"file":"Scrim.js","sourceRoot":"","sources":["../../../src/components/Scrim/Scrim.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,CAAC;AAoBtB;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAc;IACjE,OAAO,CACH,iBACQ,KAAK,iBACG,MAAM,eACR,OAAO,qBACA,KAAK,IAAI,SAAS,iBACtB,CAAC,OAAO,IAAI,SAAS,GACpC,CACL,CAAC;AACN,CAAC"}
|
|
@@ -58,16 +58,16 @@ export type SelectProps = CommonProps<'size'> & FieldControlProps<string, Keyboa
|
|
|
58
58
|
* @example
|
|
59
59
|
* import { Select } from '@bspk/ui/Select';
|
|
60
60
|
*
|
|
61
|
-
* const OPTIONS = [
|
|
62
|
-
* { id: '1', label: 'Option 1' },
|
|
63
|
-
* { id: '2', label: 'Option 2' },
|
|
64
|
-
* { id: '3', label: 'Option 3' },
|
|
65
|
-
* { id: '4', label: 'Option 4' },
|
|
66
|
-
* { id: '5', label: 'Option 5' },
|
|
67
|
-
* { id: '6', label: 'Option 6' },
|
|
68
|
-
* ];
|
|
69
|
-
*
|
|
70
61
|
* () => {
|
|
62
|
+
* const OPTIONS = [
|
|
63
|
+
* { id: '1', label: 'Option 1' },
|
|
64
|
+
* { id: '2', label: 'Option 2' },
|
|
65
|
+
* { id: '3', label: 'Option 3' },
|
|
66
|
+
* { id: '4', label: 'Option 4' },
|
|
67
|
+
* { id: '5', label: 'Option 5' },
|
|
68
|
+
* { id: '6', label: 'Option 6' },
|
|
69
|
+
* ];
|
|
70
|
+
*
|
|
71
71
|
* const [selected, setSelected] = useState<string[]>([]);
|
|
72
72
|
*
|
|
73
73
|
* return (
|
|
@@ -75,7 +75,7 @@ export type SelectProps = CommonProps<'size'> & FieldControlProps<string, Keyboa
|
|
|
75
75
|
* // standalone select example
|
|
76
76
|
* <Select
|
|
77
77
|
* aria-label="Select an option"
|
|
78
|
-
*
|
|
78
|
+
* scrollLimit={5}
|
|
79
79
|
* name="example-select"
|
|
80
80
|
* onChange={setSelected}
|
|
81
81
|
* options={OPTIONS}
|
|
@@ -88,7 +88,7 @@ export type SelectProps = CommonProps<'size'> & FieldControlProps<string, Keyboa
|
|
|
88
88
|
* <Field>
|
|
89
89
|
* <FieldLabel>Select an option</FieldLabel>
|
|
90
90
|
* <Select
|
|
91
|
-
*
|
|
91
|
+
* scrollLimit={5}
|
|
92
92
|
* name="example-select"
|
|
93
93
|
* onChange={setSelected}
|
|
94
94
|
* options={OPTIONS}
|
|
@@ -19,16 +19,16 @@ import { scrollListItemsStyle } from '../../utils/scrollListItemsStyle';
|
|
|
19
19
|
* @example
|
|
20
20
|
* import { Select } from '@bspk/ui/Select';
|
|
21
21
|
*
|
|
22
|
-
* const OPTIONS = [
|
|
23
|
-
* { id: '1', label: 'Option 1' },
|
|
24
|
-
* { id: '2', label: 'Option 2' },
|
|
25
|
-
* { id: '3', label: 'Option 3' },
|
|
26
|
-
* { id: '4', label: 'Option 4' },
|
|
27
|
-
* { id: '5', label: 'Option 5' },
|
|
28
|
-
* { id: '6', label: 'Option 6' },
|
|
29
|
-
* ];
|
|
30
|
-
*
|
|
31
22
|
* () => {
|
|
23
|
+
* const OPTIONS = [
|
|
24
|
+
* { id: '1', label: 'Option 1' },
|
|
25
|
+
* { id: '2', label: 'Option 2' },
|
|
26
|
+
* { id: '3', label: 'Option 3' },
|
|
27
|
+
* { id: '4', label: 'Option 4' },
|
|
28
|
+
* { id: '5', label: 'Option 5' },
|
|
29
|
+
* { id: '6', label: 'Option 6' },
|
|
30
|
+
* ];
|
|
31
|
+
*
|
|
32
32
|
* const [selected, setSelected] = useState<string[]>([]);
|
|
33
33
|
*
|
|
34
34
|
* return (
|
|
@@ -36,7 +36,7 @@ import { scrollListItemsStyle } from '../../utils/scrollListItemsStyle';
|
|
|
36
36
|
* // standalone select example
|
|
37
37
|
* <Select
|
|
38
38
|
* aria-label="Select an option"
|
|
39
|
-
*
|
|
39
|
+
* scrollLimit={5}
|
|
40
40
|
* name="example-select"
|
|
41
41
|
* onChange={setSelected}
|
|
42
42
|
* options={OPTIONS}
|
|
@@ -49,7 +49,7 @@ import { scrollListItemsStyle } from '../../utils/scrollListItemsStyle';
|
|
|
49
49
|
* <Field>
|
|
50
50
|
* <FieldLabel>Select an option</FieldLabel>
|
|
51
51
|
* <Select
|
|
52
|
-
*
|
|
52
|
+
* scrollLimit={5}
|
|
53
53
|
* name="example-select"
|
|
54
54
|
* onChange={setSelected}
|
|
55
55
|
* options={OPTIONS}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { SkeletonProps } from './Skeleton';
|
|
2
|
+
/**
|
|
3
|
+
* SkeletonCircular component displays a circular skeleton loader.
|
|
4
|
+
*
|
|
5
|
+
* @name SkeletonCircular
|
|
6
|
+
* @parent Skeleton
|
|
7
|
+
*/
|
|
2
8
|
export declare function SkeletonCircular(props: Pick<SkeletonProps, 'height' | 'width'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Skeleton } from './Skeleton';
|
|
3
|
+
/**
|
|
4
|
+
* SkeletonCircular component displays a circular skeleton loader.
|
|
5
|
+
*
|
|
6
|
+
* @name SkeletonCircular
|
|
7
|
+
* @parent Skeleton
|
|
8
|
+
*/
|
|
3
9
|
export function SkeletonCircular(props) {
|
|
4
10
|
return _jsx(Skeleton, { ...props, variant: "circular" });
|
|
5
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circular.js","sourceRoot":"","sources":["../../../src/components/Skeleton/Circular.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAErD,MAAM,UAAU,gBAAgB,CAAC,KAA8C;IAC3E,OAAO,KAAC,QAAQ,OAAK,KAAK,EAAE,OAAO,EAAC,UAAU,GAAG,CAAC;AACtD,CAAC"}
|
|
1
|
+
{"version":3,"file":"Circular.js","sourceRoot":"","sources":["../../../src/components/Skeleton/Circular.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAErD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA8C;IAC3E,OAAO,KAAC,QAAQ,OAAK,KAAK,EAAE,OAAO,EAAC,UAAU,GAAG,CAAC;AACtD,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { SkeletonProps } from './Skeleton';
|
|
2
|
+
/**
|
|
3
|
+
* SkeletonPhoto component displays a photo skeleton loader.
|
|
4
|
+
*
|
|
5
|
+
* @name SkeletonPhoto
|
|
6
|
+
* @parent Skeleton
|
|
7
|
+
*/
|
|
2
8
|
export declare function SkeletonPhoto(props: Pick<SkeletonProps, 'height' | 'width'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Skeleton } from './Skeleton';
|
|
3
|
+
/**
|
|
4
|
+
* SkeletonPhoto component displays a photo skeleton loader.
|
|
5
|
+
*
|
|
6
|
+
* @name SkeletonPhoto
|
|
7
|
+
* @parent Skeleton
|
|
8
|
+
*/
|
|
3
9
|
export function SkeletonPhoto(props) {
|
|
4
10
|
return _jsx(Skeleton, { ...props, variant: "photo" });
|
|
5
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Photo.js","sourceRoot":"","sources":["../../../src/components/Skeleton/Photo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAErD,MAAM,UAAU,aAAa,CAAC,KAA8C;IACxE,OAAO,KAAC,QAAQ,OAAK,KAAK,EAAE,OAAO,EAAC,OAAO,GAAG,CAAC;AACnD,CAAC"}
|
|
1
|
+
{"version":3,"file":"Photo.js","sourceRoot":"","sources":["../../../src/components/Skeleton/Photo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAErD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAA8C;IACxE,OAAO,KAAC,QAAQ,OAAK,KAAK,EAAE,OAAO,EAAC,OAAO,GAAG,CAAC;AACnD,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { SkeletonProps } from './Skeleton';
|
|
2
|
+
/**
|
|
3
|
+
* SkeletonProfile component displays a profile skeleton loader.
|
|
4
|
+
*
|
|
5
|
+
* @name SkeletonProfile
|
|
6
|
+
* @parent Skeleton
|
|
7
|
+
*/
|
|
2
8
|
export declare function SkeletonProfile(props: Pick<SkeletonProps, 'height' | 'width'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Skeleton } from './Skeleton';
|
|
3
|
+
/**
|
|
4
|
+
* SkeletonProfile component displays a profile skeleton loader.
|
|
5
|
+
*
|
|
6
|
+
* @name SkeletonProfile
|
|
7
|
+
* @parent Skeleton
|
|
8
|
+
*/
|
|
3
9
|
export function SkeletonProfile(props) {
|
|
4
10
|
return _jsx(Skeleton, { ...props, variant: "profile" });
|
|
5
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../../../src/components/Skeleton/Profile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAErD,MAAM,UAAU,eAAe,CAAC,KAA8C;IAC1E,OAAO,KAAC,QAAQ,OAAK,KAAK,EAAE,OAAO,EAAC,SAAS,GAAG,CAAC;AACrD,CAAC"}
|
|
1
|
+
{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../../../src/components/Skeleton/Profile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAErD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAA8C;IAC1E,OAAO,KAAC,QAAQ,OAAK,KAAK,EAAE,OAAO,EAAC,SAAS,GAAG,CAAC;AACrD,CAAC"}
|