@capra/core 1.5.2 → 1.5.3
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/index.cjs +4 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.mts +9 -9
- package/dist/index.mjs +4 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -3427,9 +3427,12 @@ var EmptyState_module_default = {
|
|
|
3427
3427
|
};
|
|
3428
3428
|
//#endregion
|
|
3429
3429
|
//#region src/components/EmptyState/EmptyState.tsx
|
|
3430
|
+
const NOOP_IMAGE = () => null;
|
|
3430
3431
|
function lazyLoad(importFn) {
|
|
3431
3432
|
return react.default.lazy(() => importFn().then((m) => {
|
|
3432
|
-
|
|
3433
|
+
const componentName = Object.getOwnPropertyNames(m).find((name) => name.match(/^[A-Z]/));
|
|
3434
|
+
if (!componentName) return { default: NOOP_IMAGE };
|
|
3435
|
+
return { default: m[componentName] };
|
|
3433
3436
|
}));
|
|
3434
3437
|
}
|
|
3435
3438
|
const ILLUSTRATIONS = {
|
package/dist/index.d.cts
CHANGED
|
@@ -125,7 +125,7 @@ declare const TextInput: React$2.ForwardRefExoticComponent<{
|
|
|
125
125
|
*/
|
|
126
126
|
size?: Size$3; /** Content after the input (e.g. icon or clear button). */
|
|
127
127
|
trailingSlot?: React$2.ReactNode;
|
|
128
|
-
} & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "
|
|
128
|
+
} & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "className" | "size"> & React$2.RefAttributes<HTMLInputElement>>;
|
|
129
129
|
//#endregion
|
|
130
130
|
//#region src/components/input-helpers/fieldLayout.d.ts
|
|
131
131
|
type FieldLayoutProps = {
|
|
@@ -172,7 +172,7 @@ declare const AutocompleteField: ((props: {
|
|
|
172
172
|
leadingSlot?: React$1.ReactNode;
|
|
173
173
|
size?: Size$3;
|
|
174
174
|
trailingSlot?: React$1.ReactNode;
|
|
175
|
-
} & StylingOverrideProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "
|
|
175
|
+
} & StylingOverrideProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "className" | "size"> & React$1.RefAttributes<HTMLInputElement>, "ref">, "onChange" | "value"> & React$1.RefAttributes<HTMLInputElement>) => React$1.ReactElement) & {
|
|
176
176
|
Item: typeof AutocompleteItem;
|
|
177
177
|
};
|
|
178
178
|
//#endregion
|
|
@@ -429,7 +429,7 @@ type RadioGroupProps = RadioGroupContextValue & StylingOverrideProps & Omit<Reac
|
|
|
429
429
|
/**
|
|
430
430
|
* A control wrapper for a group of radio buttons.
|
|
431
431
|
*/
|
|
432
|
-
declare const RadioGroup: (props: RadioGroupContextValue & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref">, "
|
|
432
|
+
declare const RadioGroup: (props: RadioGroupContextValue & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref">, "className" | "onChange"> & React$2.RefAttributes<HTMLFieldSetElement>) => React$2.ReactElement;
|
|
433
433
|
//#endregion
|
|
434
434
|
//#region src/components/Radio/Radio.d.ts
|
|
435
435
|
type ChildrenLabel = {
|
|
@@ -562,7 +562,7 @@ declare const Checkbox: React$2.ForwardRefExoticComponent<{
|
|
|
562
562
|
checked?: boolean; /** Default checked state for uncontrolled component. */
|
|
563
563
|
defaultChecked?: boolean; /** The label for the checkbox. */
|
|
564
564
|
children?: string | React$2.ReactNode;
|
|
565
|
-
} & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "
|
|
565
|
+
} & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "className" | "type"> & React$2.RefAttributes<HTMLInputElement>>;
|
|
566
566
|
//#endregion
|
|
567
567
|
//#region src/components/Collapse/Collapse.d.ts
|
|
568
568
|
/** Props forwarded to React Aria `Disclosure`; see https://reactaria.adobe.com/Disclosure */
|
|
@@ -636,7 +636,7 @@ declare const TextField: React$2.ForwardRefExoticComponent<{
|
|
|
636
636
|
/** Called with the new string value when the input changes. */onChange?: (value: string) => void; /** When true, shows a character count. */
|
|
637
637
|
showCount?: boolean;
|
|
638
638
|
value?: string | number | undefined;
|
|
639
|
-
} & FieldLayoutProps & Omit<TextInputProps, "
|
|
639
|
+
} & FieldLayoutProps & Omit<TextInputProps, "onChange" | "value"> & React$2.RefAttributes<HTMLInputElement>>;
|
|
640
640
|
//#endregion
|
|
641
641
|
//#region src/components/PasswordField/PasswordField.d.ts
|
|
642
642
|
type PasswordFieldProps = Omit<TextFieldProps, 'trailingSlot' | 'type'>;
|
|
@@ -660,7 +660,7 @@ type NumberFieldProps = Omit<TextInputProps, 'type' | 'onChange' | 'min' | 'max'
|
|
|
660
660
|
/**
|
|
661
661
|
* Number field built on React Aria `NumberField`, with custom increment/decrement controls (native spinners hidden).
|
|
662
662
|
*/
|
|
663
|
-
declare const NumberField: React$2.ForwardRefExoticComponent<Omit<TextInputProps, "
|
|
663
|
+
declare const NumberField: React$2.ForwardRefExoticComponent<Omit<TextInputProps, "onChange" | "max" | "min" | "type" | "step"> & {
|
|
664
664
|
/** Called with the unformatted number value when the number changes. */onChange?: (value: number) => void; /** Locale-aware display and parsing for the displayed value (see https://react-aria.adobe.com/NumberField#format-options) */
|
|
665
665
|
formatOptions?: Intl.NumberFormatOptions; /** Minimum value */
|
|
666
666
|
min?: number; /** Maximum value */
|
|
@@ -682,7 +682,7 @@ type DatePickerFieldProps<T extends DateValue = DateValue> = FieldLayoutProps &
|
|
|
682
682
|
required?: boolean; /** Invalid value; `appearance="danger"` also forces an invalid state for display. */
|
|
683
683
|
isInvalid?: boolean;
|
|
684
684
|
};
|
|
685
|
-
declare const DatePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "placeholder" | "size" | "appearance" | "leadingSlot"> & Pick<DatePickerProps<DateValue>, "
|
|
685
|
+
declare const DatePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "placeholder" | "size" | "appearance" | "leadingSlot"> & Pick<DatePickerProps<DateValue>, "defaultValue" | "onChange" | "value"> & {
|
|
686
686
|
/** Smallest date/time unit shown in the field. Only `day` and `second` are supported. */granularity?: "day" | "second";
|
|
687
687
|
} & StylingOverrideProps & {
|
|
688
688
|
/** When true, shows a clear control to the left of the calendar button while the field has a value. */canClear?: boolean; /** Disables the field. */
|
|
@@ -710,7 +710,7 @@ type DateRangePickerFieldProps<T extends DateValue = DateValue> = FieldLayoutPro
|
|
|
710
710
|
};
|
|
711
711
|
declare const DateRangePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "size" | "appearance" | "leadingSlot"> & {
|
|
712
712
|
/** Placeholders for empty start and end, shown with a swap icon between them when the group is not focus-within. */placeholder?: DateRangePickerFieldPlaceholder;
|
|
713
|
-
} & Pick<DateRangePickerProps<DateValue>, "
|
|
713
|
+
} & Pick<DateRangePickerProps<DateValue>, "defaultValue" | "onChange" | "value" | "shouldCloseOnSelect"> & {
|
|
714
714
|
/** Smallest date/time unit shown in the fields. Only `day` and `second` are supported. */granularity?: "day" | "second";
|
|
715
715
|
} & StylingOverrideProps & {
|
|
716
716
|
/** When true, shows a clear control to the left of the calendar button while the field has a value. */canClear?: boolean; /** Disables the field. */
|
|
@@ -770,7 +770,7 @@ declare const TextArea: React$2.ForwardRefExoticComponent<{
|
|
|
770
770
|
autoSize?: TextAreaAutoSize; /** When true, shows a character count. */
|
|
771
771
|
showCount?: boolean; /** Called with the new string value when the input changes. */
|
|
772
772
|
onChange?: (value: string) => void;
|
|
773
|
-
} & FieldLayoutProps & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "style" | "
|
|
773
|
+
} & FieldLayoutProps & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "style" | "className" | "onChange" | "size"> & React$2.RefAttributes<HTMLTextAreaElement>>;
|
|
774
774
|
//#endregion
|
|
775
775
|
//#region src/components/Modal/Modal.d.ts
|
|
776
776
|
type ModalSize = 'sm' | 'md' | 'lg';
|
package/dist/index.d.mts
CHANGED
|
@@ -125,7 +125,7 @@ declare const TextInput: React$2.ForwardRefExoticComponent<{
|
|
|
125
125
|
*/
|
|
126
126
|
size?: Size$3; /** Content after the input (e.g. icon or clear button). */
|
|
127
127
|
trailingSlot?: React$2.ReactNode;
|
|
128
|
-
} & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "
|
|
128
|
+
} & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "className" | "size"> & React$2.RefAttributes<HTMLInputElement>>;
|
|
129
129
|
//#endregion
|
|
130
130
|
//#region src/components/input-helpers/fieldLayout.d.ts
|
|
131
131
|
type FieldLayoutProps = {
|
|
@@ -172,7 +172,7 @@ declare const AutocompleteField: ((props: {
|
|
|
172
172
|
leadingSlot?: React$1.ReactNode;
|
|
173
173
|
size?: Size$3;
|
|
174
174
|
trailingSlot?: React$1.ReactNode;
|
|
175
|
-
} & StylingOverrideProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "
|
|
175
|
+
} & StylingOverrideProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "style" | "className" | "size"> & React$1.RefAttributes<HTMLInputElement>, "ref">, "onChange" | "value"> & React$1.RefAttributes<HTMLInputElement>) => React$1.ReactElement) & {
|
|
176
176
|
Item: typeof AutocompleteItem;
|
|
177
177
|
};
|
|
178
178
|
//#endregion
|
|
@@ -429,7 +429,7 @@ type RadioGroupProps = RadioGroupContextValue & StylingOverrideProps & Omit<Reac
|
|
|
429
429
|
/**
|
|
430
430
|
* A control wrapper for a group of radio buttons.
|
|
431
431
|
*/
|
|
432
|
-
declare const RadioGroup: (props: RadioGroupContextValue & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref">, "
|
|
432
|
+
declare const RadioGroup: (props: RadioGroupContextValue & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref">, "className" | "onChange"> & React$2.RefAttributes<HTMLFieldSetElement>) => React$2.ReactElement;
|
|
433
433
|
//#endregion
|
|
434
434
|
//#region src/components/Radio/Radio.d.ts
|
|
435
435
|
type ChildrenLabel = {
|
|
@@ -562,7 +562,7 @@ declare const Checkbox: React$2.ForwardRefExoticComponent<{
|
|
|
562
562
|
checked?: boolean; /** Default checked state for uncontrolled component. */
|
|
563
563
|
defaultChecked?: boolean; /** The label for the checkbox. */
|
|
564
564
|
children?: string | React$2.ReactNode;
|
|
565
|
-
} & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "
|
|
565
|
+
} & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "className" | "type"> & React$2.RefAttributes<HTMLInputElement>>;
|
|
566
566
|
//#endregion
|
|
567
567
|
//#region src/components/Collapse/Collapse.d.ts
|
|
568
568
|
/** Props forwarded to React Aria `Disclosure`; see https://reactaria.adobe.com/Disclosure */
|
|
@@ -636,7 +636,7 @@ declare const TextField: React$2.ForwardRefExoticComponent<{
|
|
|
636
636
|
/** Called with the new string value when the input changes. */onChange?: (value: string) => void; /** When true, shows a character count. */
|
|
637
637
|
showCount?: boolean;
|
|
638
638
|
value?: string | number | undefined;
|
|
639
|
-
} & FieldLayoutProps & Omit<TextInputProps, "
|
|
639
|
+
} & FieldLayoutProps & Omit<TextInputProps, "onChange" | "value"> & React$2.RefAttributes<HTMLInputElement>>;
|
|
640
640
|
//#endregion
|
|
641
641
|
//#region src/components/PasswordField/PasswordField.d.ts
|
|
642
642
|
type PasswordFieldProps = Omit<TextFieldProps, 'trailingSlot' | 'type'>;
|
|
@@ -660,7 +660,7 @@ type NumberFieldProps = Omit<TextInputProps, 'type' | 'onChange' | 'min' | 'max'
|
|
|
660
660
|
/**
|
|
661
661
|
* Number field built on React Aria `NumberField`, with custom increment/decrement controls (native spinners hidden).
|
|
662
662
|
*/
|
|
663
|
-
declare const NumberField: React$2.ForwardRefExoticComponent<Omit<TextInputProps, "
|
|
663
|
+
declare const NumberField: React$2.ForwardRefExoticComponent<Omit<TextInputProps, "onChange" | "max" | "min" | "type" | "step"> & {
|
|
664
664
|
/** Called with the unformatted number value when the number changes. */onChange?: (value: number) => void; /** Locale-aware display and parsing for the displayed value (see https://react-aria.adobe.com/NumberField#format-options) */
|
|
665
665
|
formatOptions?: Intl.NumberFormatOptions; /** Minimum value */
|
|
666
666
|
min?: number; /** Maximum value */
|
|
@@ -682,7 +682,7 @@ type DatePickerFieldProps<T extends DateValue = DateValue> = FieldLayoutProps &
|
|
|
682
682
|
required?: boolean; /** Invalid value; `appearance="danger"` also forces an invalid state for display. */
|
|
683
683
|
isInvalid?: boolean;
|
|
684
684
|
};
|
|
685
|
-
declare const DatePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "placeholder" | "size" | "appearance" | "leadingSlot"> & Pick<DatePickerProps<DateValue>, "
|
|
685
|
+
declare const DatePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "placeholder" | "size" | "appearance" | "leadingSlot"> & Pick<DatePickerProps<DateValue>, "defaultValue" | "onChange" | "value"> & {
|
|
686
686
|
/** Smallest date/time unit shown in the field. Only `day` and `second` are supported. */granularity?: "day" | "second";
|
|
687
687
|
} & StylingOverrideProps & {
|
|
688
688
|
/** When true, shows a clear control to the left of the calendar button while the field has a value. */canClear?: boolean; /** Disables the field. */
|
|
@@ -710,7 +710,7 @@ type DateRangePickerFieldProps<T extends DateValue = DateValue> = FieldLayoutPro
|
|
|
710
710
|
};
|
|
711
711
|
declare const DateRangePickerField: React$2.ForwardRefExoticComponent<FieldLayoutProps & Pick<TextInputProps, "size" | "appearance" | "leadingSlot"> & {
|
|
712
712
|
/** Placeholders for empty start and end, shown with a swap icon between them when the group is not focus-within. */placeholder?: DateRangePickerFieldPlaceholder;
|
|
713
|
-
} & Pick<DateRangePickerProps<DateValue>, "
|
|
713
|
+
} & Pick<DateRangePickerProps<DateValue>, "defaultValue" | "onChange" | "value" | "shouldCloseOnSelect"> & {
|
|
714
714
|
/** Smallest date/time unit shown in the fields. Only `day` and `second` are supported. */granularity?: "day" | "second";
|
|
715
715
|
} & StylingOverrideProps & {
|
|
716
716
|
/** When true, shows a clear control to the left of the calendar button while the field has a value. */canClear?: boolean; /** Disables the field. */
|
|
@@ -770,7 +770,7 @@ declare const TextArea: React$2.ForwardRefExoticComponent<{
|
|
|
770
770
|
autoSize?: TextAreaAutoSize; /** When true, shows a character count. */
|
|
771
771
|
showCount?: boolean; /** Called with the new string value when the input changes. */
|
|
772
772
|
onChange?: (value: string) => void;
|
|
773
|
-
} & FieldLayoutProps & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "style" | "
|
|
773
|
+
} & FieldLayoutProps & StylingOverrideProps & Omit<Omit<React$2.DetailedHTMLProps<React$2.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, "style" | "className" | "onChange" | "size"> & React$2.RefAttributes<HTMLTextAreaElement>>;
|
|
774
774
|
//#endregion
|
|
775
775
|
//#region src/components/Modal/Modal.d.ts
|
|
776
776
|
type ModalSize = 'sm' | 'md' | 'lg';
|
package/dist/index.mjs
CHANGED
|
@@ -3403,9 +3403,12 @@ var EmptyState_module_default = {
|
|
|
3403
3403
|
};
|
|
3404
3404
|
//#endregion
|
|
3405
3405
|
//#region src/components/EmptyState/EmptyState.tsx
|
|
3406
|
+
const NOOP_IMAGE = () => null;
|
|
3406
3407
|
function lazyLoad(importFn) {
|
|
3407
3408
|
return React.lazy(() => importFn().then((m) => {
|
|
3408
|
-
|
|
3409
|
+
const componentName = Object.getOwnPropertyNames(m).find((name) => name.match(/^[A-Z]/));
|
|
3410
|
+
if (!componentName) return { default: NOOP_IMAGE };
|
|
3411
|
+
return { default: m[componentName] };
|
|
3409
3412
|
}));
|
|
3410
3413
|
}
|
|
3411
3414
|
const ILLUSTRATIONS = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capra/core",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Core React components for the Capra design system",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"antd": "4.24.16",
|
|
44
44
|
"storybook": "^10.4.6",
|
|
45
45
|
"tsdown": "^0.22.0",
|
|
46
|
-
"@private/building": "0.0.4",
|
|
47
46
|
"@capra/theme": "1.2.1",
|
|
47
|
+
"@private/building": "0.0.4",
|
|
48
|
+
"@private/stories": "0.0.0",
|
|
48
49
|
"@private/linting": "0.0.0",
|
|
49
|
-
"@private/testing": "0.0.7"
|
|
50
|
-
"@private/stories": "0.0.0"
|
|
50
|
+
"@private/testing": "0.0.7"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"clean": "rm -rf ./dist",
|