@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.
Files changed (147) hide show
  1. package/dist/components/BannerAlert/BannerAlert.d.ts +5 -5
  2. package/dist/components/BannerAlert/BannerAlert.js +5 -5
  3. package/dist/components/Breadcrumb/BreadcrumbDropdown.d.ts +6 -0
  4. package/dist/components/Breadcrumb/BreadcrumbDropdown.js +6 -0
  5. package/dist/components/Breadcrumb/BreadcrumbDropdown.js.map +1 -1
  6. package/dist/components/CheckboxGroup/CheckboxGroupExample.js +1 -0
  7. package/dist/components/CheckboxGroup/CheckboxGroupExample.js.map +1 -1
  8. package/dist/components/ChipGroup/ChipGroup.d.ts +15 -28
  9. package/dist/components/ChipGroup/ChipGroup.js +12 -22
  10. package/dist/components/ChipGroup/ChipGroup.js.map +1 -1
  11. package/dist/components/ChipGroup/ChipGroupExample.js +61 -6
  12. package/dist/components/ChipGroup/ChipGroupExample.js.map +1 -1
  13. package/dist/components/ChipGroup/chip-group.css +5 -3
  14. package/dist/components/ChipGroup/chip-group.css.js +5 -3
  15. package/dist/components/Drawer/Drawer.js.map +1 -1
  16. package/dist/components/Field/FieldDescription.d.ts +7 -5
  17. package/dist/components/Field/FieldDescription.js +7 -3
  18. package/dist/components/Field/FieldDescription.js.map +1 -1
  19. package/dist/components/Field/FieldError.d.ts +6 -0
  20. package/dist/components/Field/FieldError.js +6 -0
  21. package/dist/components/Field/FieldError.js.map +1 -1
  22. package/dist/components/Field/FieldLabel.d.ts +6 -0
  23. package/dist/components/Field/FieldLabel.js +6 -0
  24. package/dist/components/Field/FieldLabel.js.map +1 -1
  25. package/dist/components/Field/utils.d.ts +5 -0
  26. package/dist/components/Field/utils.js +5 -0
  27. package/dist/components/Field/utils.js.map +1 -1
  28. package/dist/components/InlineAlert/SvgWarningTwoTone.d.ts +6 -0
  29. package/dist/components/InlineAlert/SvgWarningTwoTone.js +6 -0
  30. package/dist/components/InlineAlert/SvgWarningTwoTone.js.map +1 -1
  31. package/dist/components/InputNumber/IncrementButton.d.ts +13 -3
  32. package/dist/components/InputNumber/IncrementButton.js +11 -4
  33. package/dist/components/InputNumber/IncrementButton.js.map +1 -1
  34. package/dist/components/InputNumber/InputNumber.js +26 -10
  35. package/dist/components/InputNumber/InputNumber.js.map +1 -1
  36. package/dist/components/InputNumber/InputNumberExample.js +1 -0
  37. package/dist/components/InputNumber/InputNumberExample.js.map +1 -1
  38. package/dist/components/InputNumber/input-number.css +6 -0
  39. package/dist/components/InputNumber/input-number.css.js +6 -0
  40. package/dist/components/Link/Link.d.ts +1 -1
  41. package/dist/components/Link/Link.js +1 -1
  42. package/dist/components/OTPInput/OTPInput.d.ts +13 -3
  43. package/dist/components/OTPInput/OTPInput.js +11 -39
  44. package/dist/components/OTPInput/OTPInput.js.map +1 -1
  45. package/dist/components/OTPInput/OTPInputExample.js +6 -1
  46. package/dist/components/OTPInput/OTPInputExample.js.map +1 -1
  47. package/dist/components/OTPInput/otp-input.css +18 -17
  48. package/dist/components/OTPInput/otp-input.css.js +18 -17
  49. package/dist/components/Pagination/PageList.d.ts +6 -0
  50. package/dist/components/Pagination/PageList.js +6 -0
  51. package/dist/components/Pagination/PageList.js.map +1 -1
  52. package/dist/components/Scrim/Scrim.d.ts +0 -1
  53. package/dist/components/Scrim/Scrim.js +0 -1
  54. package/dist/components/Scrim/Scrim.js.map +1 -1
  55. package/dist/components/Select/Select.d.ts +11 -11
  56. package/dist/components/Select/Select.js +11 -11
  57. package/dist/components/Skeleton/Circular.d.ts +6 -0
  58. package/dist/components/Skeleton/Circular.js +6 -0
  59. package/dist/components/Skeleton/Circular.js.map +1 -1
  60. package/dist/components/Skeleton/Photo.d.ts +6 -0
  61. package/dist/components/Skeleton/Photo.js +6 -0
  62. package/dist/components/Skeleton/Photo.js.map +1 -1
  63. package/dist/components/Skeleton/Profile.d.ts +6 -0
  64. package/dist/components/Skeleton/Profile.js +6 -0
  65. package/dist/components/Skeleton/Profile.js.map +1 -1
  66. package/dist/components/Skeleton/Rectangular.d.ts +6 -0
  67. package/dist/components/Skeleton/Rectangular.js +6 -0
  68. package/dist/components/Skeleton/Rectangular.js.map +1 -1
  69. package/dist/components/Skeleton/Thumbnail.d.ts +6 -0
  70. package/dist/components/Skeleton/Thumbnail.js +6 -0
  71. package/dist/components/Skeleton/Thumbnail.js.map +1 -1
  72. package/dist/components/Slider/SliderIntervalDots.d.ts +6 -0
  73. package/dist/components/Slider/SliderIntervalDots.js +6 -0
  74. package/dist/components/Slider/SliderIntervalDots.js.map +1 -1
  75. package/dist/components/Snackbar/Manager.d.ts +0 -1
  76. package/dist/components/Snackbar/Manager.js +0 -1
  77. package/dist/components/Snackbar/Manager.js.map +1 -1
  78. package/dist/components/Snackbar/Snackbar.d.ts +0 -1
  79. package/dist/components/Snackbar/Snackbar.js +0 -1
  80. package/dist/components/Snackbar/Snackbar.js.map +1 -1
  81. package/dist/components/TabList/TabList.js +1 -2
  82. package/dist/components/TabList/TabList.js.map +1 -1
  83. package/dist/components/Table/Footer.d.ts +6 -0
  84. package/dist/components/Table/Footer.js +6 -0
  85. package/dist/components/Table/Footer.js.map +1 -1
  86. package/dist/components/TimePicker/Listbox.d.ts +6 -0
  87. package/dist/components/TimePicker/Listbox.js +6 -0
  88. package/dist/components/TimePicker/Listbox.js.map +1 -1
  89. package/dist/components/TimePicker/Segment.d.ts +6 -0
  90. package/dist/components/TimePicker/Segment.js +6 -0
  91. package/dist/components/TimePicker/Segment.js.map +1 -1
  92. package/dist/components/Truncated/Truncated.d.ts +0 -1
  93. package/dist/components/Truncated/Truncated.js +1 -2
  94. package/dist/components/Truncated/Truncated.js.map +1 -1
  95. package/dist/components/UIProvider/UIProvider.d.ts +0 -1
  96. package/dist/components/UIProvider/UIProvider.js +0 -1
  97. package/dist/components/UIProvider/UIProvider.js.map +1 -1
  98. package/dist/hooks/useLongPress.d.ts +30 -15
  99. package/dist/hooks/useLongPress.js +26 -42
  100. package/dist/hooks/useLongPress.js.map +1 -1
  101. package/dist/styles/base.css +9 -0
  102. package/dist/styles/base.css.js +9 -0
  103. package/package.json +1 -1
  104. package/src/components/BannerAlert/BannerAlert.tsx +5 -5
  105. package/src/components/Breadcrumb/BreadcrumbDropdown.tsx +6 -0
  106. package/src/components/CheckboxGroup/CheckboxGroupExample.tsx +1 -0
  107. package/src/components/ChipGroup/ChipGroup.rtl.test.tsx +16 -11
  108. package/src/components/ChipGroup/ChipGroup.tsx +18 -36
  109. package/src/components/ChipGroup/ChipGroupExample.tsx +64 -36
  110. package/src/components/ChipGroup/chip-group.scss +5 -3
  111. package/src/components/Drawer/Drawer.tsx +0 -1
  112. package/src/components/Field/FieldDescription.tsx +7 -5
  113. package/src/components/Field/FieldError.tsx +6 -0
  114. package/src/components/Field/FieldLabel.tsx +6 -0
  115. package/src/components/Field/utils.ts +5 -0
  116. package/src/components/InlineAlert/SvgWarningTwoTone.tsx +6 -0
  117. package/src/components/InputNumber/IncrementButton.tsx +21 -11
  118. package/src/components/InputNumber/InputNumber.tsx +33 -31
  119. package/src/components/InputNumber/InputNumberExample.tsx +1 -0
  120. package/src/components/InputNumber/input-number.scss +10 -0
  121. package/src/components/Link/Link.tsx +1 -1
  122. package/src/components/OTPInput/OTPInput.rtl.test.tsx +4 -2
  123. package/src/components/OTPInput/OTPInput.tsx +34 -63
  124. package/src/components/OTPInput/OTPInputExample.tsx +6 -1
  125. package/src/components/OTPInput/otp-input.scss +50 -45
  126. package/src/components/Pagination/PageList.tsx +6 -0
  127. package/src/components/Scrim/Scrim.tsx +0 -1
  128. package/src/components/Select/Select.tsx +11 -11
  129. package/src/components/Skeleton/Circular.tsx +6 -0
  130. package/src/components/Skeleton/Photo.tsx +6 -0
  131. package/src/components/Skeleton/Profile.tsx +6 -0
  132. package/src/components/Skeleton/Rectangular.tsx +6 -0
  133. package/src/components/Skeleton/Thumbnail.tsx +6 -0
  134. package/src/components/Slider/SliderIntervalDots.tsx +6 -0
  135. package/src/components/Snackbar/Manager.tsx +0 -1
  136. package/src/components/Snackbar/Snackbar.tsx +0 -1
  137. package/src/components/TabList/TabList.tsx +1 -2
  138. package/src/components/Table/Footer.tsx +6 -0
  139. package/src/components/TimePicker/Listbox.tsx +6 -0
  140. package/src/components/TimePicker/Segment.tsx +6 -0
  141. package/src/components/Truncated/Truncated.tsx +1 -2
  142. package/src/components/UIProvider/UIProvider.tsx +0 -1
  143. package/src/hooks/useLongPress.ts +58 -48
  144. package/src/styles/base.scss +9 -0
  145. package/dist/components/Truncated/truncated.css +0 -8
  146. package/dist/components/Truncated/truncated.css.js +0 -13
  147. package/src/components/Truncated/truncated.scss +0 -8
@@ -1,15 +1,15 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import './input-number.css.js';
3
- import { useMemo } from 'react';
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 = undefined) {
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 = Number(value);
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 = useMemo(() => isNumber(valueProp) || 0, [valueProp]);
71
- const handleIncrement = (increment) => {
72
- onChange(value + increment * step);
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: [!!centered && (_jsx(IncrementButton, { disabled: disabled ? true : value + -1 < min, increment: -1, inputId: inputId, onIncrement: handleIncrement })), _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, onChange: (e) => {
75
- onChange(isNumber(e.target.value));
76
- }, readOnly: readOnly, required: required, step: step, type: "number", value: value }), !centered && (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": true, "data-divider": true }), _jsx(IncrementButton, { disabled: !!disabled || value + -1 < min, increment: -1, inputId: inputId, onIncrement: handleIncrement })] })), _jsx(IncrementButton, { disabled: !!disabled || value + 1 > max, increment: 1, inputId: inputId, onIncrement: handleIncrement })] }));
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,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,SAAS,QAAQ,CAAC,KAAc,EAAE,gBAAoC,SAAS;IAC3E,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,aAAa,CAAC;IACpD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC;AAC5C,CAAC;AA8BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,UAAU,WAAW,CAAC,EACxB,KAAK,EAAE,SAAS,EAChB,QAAQ,EACR,KAAK,GAAG,QAAQ,EAChB,IAAI,GAAG,QAAQ,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,IAAI,EACJ,EAAE,EAA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,GAAG,EACR,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;oBACV,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;oBAC3C,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;oBACxC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBACnB,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;oBACZ,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;oBAC3C,QAAQ,CAAC,IAAI,CAAC,CAAC;gBACnB,CAAC,EACD,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GACzC,EACF,0DAAgC,EAChC,KAAC,eAAe,IACZ,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,QAAQ,EACb,gBAAgB,EAAE,gBAAgB,GACpC,EACF,KAAC,eAAe,IAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,KAAK,EAAC,gBAAgB,EAAE,gBAAgB,GAAI,IACzG,CACT,CAAC;AACN,CAAC"}
@@ -4,5 +4,6 @@ export const InputNumberExample = {
4
4
  'aria-label': 'input number aria-label',
5
5
  },
6
6
  render: ({ props, Component }) => _jsx(Component, { ...props }),
7
+ variants: false,
7
8
  };
8
9
  //# sourceMappingURL=InputNumberExample.js.map
@@ -1 +1 @@
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;CAC7D,CAAC"}
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://bspk.dev" label="Example label" trailingIcon="external" />;
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://bspk.dev" label="Example label" trailingIcon="external" />;
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
- * <OTPInput name="2-auth-otp" length={4} value={otpValue} onChange={setOtpValue} />;
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
- * <OTPInput name="2-auth-otp" length={4} value={otpValue} onChange={setOtpValue} />;
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?.slice(0, length) || '';
19
- const parentRef = useRef(null);
20
- const element = (index) => parentRef.current?.children[index + 1];
21
- const setIndex = (index, character) => {
22
- const charArray = value.split('');
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,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AA4BtC;;;;;;;;;;GAUG;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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,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;IAChB,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
+ {"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]:hover:not(:focus)::after {
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]:focus:not(:active):empty::before {
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]:hover:not(:focus)::after {
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]:focus:not(:active):empty::before {
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,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAiB;IACjE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,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Props = CommonProps<'owner'> & {
21
21
  * attention to a modal or sheet.
22
22
  *
23
23
  * @name Scrim
24
- *
25
24
  * @phase Utility
26
25
  */
27
26
  export declare function Scrim({ visible, owner, ...props }: ScrimProps): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,6 @@ import './scrim.css.js';
5
5
  * attention to a modal or sheet.
6
6
  *
7
7
  * @name Scrim
8
- *
9
8
  * @phase Utility
10
9
  */
11
10
  export function Scrim({ visible = true, owner, ...props }) {
@@ -1 +1 @@
1
- {"version":3,"file":"Scrim.js","sourceRoot":"","sources":["../../../src/components/Scrim/Scrim.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,CAAC;AAoBtB;;;;;;;GAOG;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"}
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
- * itemCount={5}
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
- * itemCount={5}
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
- * itemCount={5}
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
- * itemCount={5}
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"}