@capyx/components-library 0.0.20 → 0.0.21
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/addons/AutocompleteInput.js +1 -0
- package/dist/addons/CharacterCountInput.d.ts +0 -2
- package/dist/addons/CharacterCountInput.d.ts.map +1 -1
- package/dist/addons/CharacterCountInput.js +1 -10
- package/dist/addons/index.d.ts.map +1 -1
- package/dist/components/RichTextInput.d.ts +1 -1
- package/dist/components/RichTextInput.d.ts.map +1 -1
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -121,6 +121,7 @@ export const AutocompleteInput = ({ suggestions: allSuggestions, children, highl
|
|
|
121
121
|
childProps?.onBlur?.();
|
|
122
122
|
},
|
|
123
123
|
});
|
|
124
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: Keyboard events are handled on the container div for accessibility
|
|
124
125
|
return (_jsxs("div", { ref: containerRef, style: { position: 'relative' }, onKeyDown: handleKeyDown, children: [enhancedChild, showSuggestions && filteredSuggestions.length > 0 && (_jsx(ListGroup, { ref: listRef, role: "listbox", className: listClassName, style: {
|
|
125
126
|
position: 'absolute',
|
|
126
127
|
top: '100%',
|
|
@@ -3,8 +3,6 @@ import { type FC, type PropsWithChildren, type ReactNode } from 'react';
|
|
|
3
3
|
* Props for the CharacterCountInput component
|
|
4
4
|
*/
|
|
5
5
|
export type CharacterCountInputProps = PropsWithChildren<{
|
|
6
|
-
/** Array of valid HTML element types to monitor (e.g., ["text", "email", "textarea"]) */
|
|
7
|
-
validHTMLElements?: string[];
|
|
8
6
|
/** CSS class for the container wrapper */
|
|
9
7
|
containerClassName?: string;
|
|
10
8
|
/** CSS class for the character counter element */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CharacterCountInput.d.ts","sourceRoot":"","sources":["../../lib/addons/CharacterCountInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,EAAE,EACP,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EAId,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CharacterCountInput.d.ts","sourceRoot":"","sources":["../../lib/addons/CharacterCountInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,EAAE,EACP,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EAId,MAAM,OAAO,CAAC;AAGf;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IACxD,0CAA0C;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uDAAuD;IACvD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;IAC5D,4DAA4D;IAC5D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wEAAwE;IACxE,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CA8G5D,CAAC"}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState, } from 'react';
|
|
3
3
|
import { Form } from 'react-bootstrap';
|
|
4
|
-
const _DEFAULT_VALID_HTML_ELEMENTS = [
|
|
5
|
-
'text',
|
|
6
|
-
'email',
|
|
7
|
-
'password',
|
|
8
|
-
'search',
|
|
9
|
-
'tel',
|
|
10
|
-
'url',
|
|
11
|
-
'textarea',
|
|
12
|
-
];
|
|
13
4
|
/**
|
|
14
5
|
* A wrapper component that adds a character counter to text inputs and textareas.
|
|
15
6
|
* Automatically detects the maxLength property from the child input and displays
|
|
@@ -55,7 +46,7 @@ const _DEFAULT_VALID_HTML_ELEMENTS = [
|
|
|
55
46
|
* <TextInput name="title" maxLength={50} />
|
|
56
47
|
* </CharacterCountInput>
|
|
57
48
|
*/
|
|
58
|
-
export const CharacterCountInput = ({
|
|
49
|
+
export const CharacterCountInput = ({ children, containerClassName = 'text-end', counterClassName = '', normalClassName = 'text-muted', warningClassName = 'text-warning', dangerClassName = 'text-danger', warningThreshold = 10, formatCounter, showCounter = true, showWhenEmpty = false, }) => {
|
|
59
50
|
const containerRef = useRef(null);
|
|
60
51
|
const [characterCount, setCharacterCount] = useState(0);
|
|
61
52
|
const [maxLength, setMaxLength] = useState(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/addons/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/addons/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type CSSProperties, type FC } from 'react';
|
|
|
2
2
|
import 'react-quill-new/dist/quill.snow.css';
|
|
3
3
|
import './RichTextInput.css';
|
|
4
4
|
declare const formats: readonly ["header", "bold", "color", "italic", "link", "strike", "script", "underline", "list", "code", "blockquote", "code-block"];
|
|
5
|
-
type FormatType = typeof formats[number];
|
|
5
|
+
export type FormatType = typeof formats[number];
|
|
6
6
|
/**
|
|
7
7
|
* Props for the RichTextInput component
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextInput.d.ts","sourceRoot":"","sources":["../../lib/components/RichTextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAwC,MAAM,OAAO,CAAC;AAG1F,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qBAAqB,CAAC;AAE7B,QAAA,MAAM,OAAO,qIAAsI,CAAC;AACpJ,
|
|
1
|
+
{"version":3,"file":"RichTextInput.d.ts","sourceRoot":"","sources":["../../lib/components/RichTextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAwC,MAAM,OAAO,CAAC;AAG1F,OAAO,qCAAqC,CAAC;AAC7C,OAAO,qBAAqB,CAAC;AAE7B,QAAA,MAAM,OAAO,qIAAsI,CAAC;AACpJ,MAAM,MAAM,UAAU,GAAG,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAkFhD,CAAC"}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
export type { CheckInputProps } from './CheckInput';
|
|
1
2
|
export { CheckInput } from './CheckInput';
|
|
3
|
+
export type { DateInputProps } from './DateInput';
|
|
2
4
|
export { DateInput } from './DateInput';
|
|
5
|
+
export type { FileInputProps } from './FileInput';
|
|
3
6
|
export { FileInput } from './FileInput';
|
|
7
|
+
export type { FormatType, RichTextInputProps } from './RichTextInput';
|
|
4
8
|
export { RichTextInput } from './RichTextInput';
|
|
9
|
+
export type { SelectInputProps } from './SelectInput';
|
|
5
10
|
export { SelectInput } from './SelectInput';
|
|
11
|
+
export type { SwitchInputProps } from './SwitchInput';
|
|
6
12
|
export { SwitchInput } from './SwitchInput';
|
|
13
|
+
export type { ChipStyle, TagsInputProps } from './TagsInput';
|
|
7
14
|
export { TagsInput } from './TagsInput';
|
|
15
|
+
export type { TextAreaInputProps } from './TextAreaInput';
|
|
8
16
|
export { TextAreaInput } from './TextAreaInput';
|
|
17
|
+
export type { TextInputProps } from './TextInput';
|
|
9
18
|
export { TextInput } from './TextInput';
|
|
10
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/components/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|