@bi-digital/react 0.2.20 → 0.2.22
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/{alert-footer-F_v71IcX.d.ts → alert-footer-CmqpWEov.d.ts} +112 -112
- package/dist/{checkbox-CXVZj5Vv.js → checkbox-CxA8UXr6.js} +2 -1
- package/dist/{checkbox-CXVZj5Vv.js.map → checkbox-CxA8UXr6.js.map} +1 -1
- package/dist/components/alert/alert-footer.d.ts +10 -10
- package/dist/components/alert/alert.d.ts +10 -10
- package/dist/components/alert/index.d.ts +10 -10
- package/dist/components/avatar/avatar.d.ts +10 -10
- package/dist/components/avatar/index.d.ts +10 -10
- package/dist/components/badge/badge.d.ts +10 -10
- package/dist/components/badge/index.d.ts +10 -10
- package/dist/components/button/button.d.ts +10 -10
- package/dist/components/button/index.d.ts +10 -10
- package/dist/components/card/card-action.d.ts +10 -10
- package/dist/components/card/card-actions.d.ts +10 -10
- package/dist/components/card/card-content.d.ts +10 -10
- package/dist/components/card/card-date.d.ts +10 -10
- package/dist/components/card/card-header.d.ts +10 -10
- package/dist/components/card/card-media.d.ts +10 -10
- package/dist/components/card/card.d.ts +10 -10
- package/dist/components/card/index.d.ts +10 -10
- package/dist/components/checkbox/checkbox-subsection.d.ts +10 -10
- package/dist/components/checkbox/checkbox.d.ts +10 -10
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/checkbox/index.d.ts +10 -10
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/chip/chip.d.ts +10 -10
- package/dist/components/chip/index.d.ts +10 -10
- package/dist/components/dialog/dialog-close-button.d.ts +10 -10
- package/dist/components/dialog/dialog-content.d.ts +10 -10
- package/dist/components/dialog/dialog-footer.d.ts +10 -10
- package/dist/components/dialog/dialog-header.d.ts +10 -10
- package/dist/components/dialog/dialog-trigger-context.d.ts +1 -1
- package/dist/components/dialog/dialog-trigger.d.ts +10 -10
- package/dist/components/dialog/dialog.d.ts +10 -10
- package/dist/components/dialog/index.d.ts +10 -10
- package/dist/components/drawer/drawer-close-button.d.ts +10 -10
- package/dist/components/drawer/drawer-content.d.ts +10 -10
- package/dist/components/drawer/drawer-footer.d.ts +10 -10
- package/dist/components/drawer/drawer-header.d.ts +10 -10
- package/dist/components/drawer/drawer-trigger-context.d.ts +1 -1
- package/dist/components/drawer/drawer-trigger.d.ts +10 -10
- package/dist/components/drawer/drawer.d.ts +10 -10
- package/dist/components/drawer/index.d.ts +10 -10
- package/dist/components/dropdown/dropdown-button.d.ts +10 -10
- package/dist/components/dropdown/dropdown-item.d.ts +1 -1
- package/dist/components/dropdown/dropdown-list.d.ts +1 -1
- package/dist/components/dropdown/dropdown-trigger-context.d.ts +1 -1
- package/dist/components/dropdown/dropdown-trigger.d.ts +10 -10
- package/dist/components/dropdown/dropdown.d.ts +10 -10
- package/dist/components/dropdown/index.d.ts +10 -10
- package/dist/components/field/field-affix.d.ts +10 -10
- package/dist/components/field/field-description.d.ts +10 -10
- package/dist/components/field/field.d.ts +10 -10
- package/dist/components/field/index.d.ts +10 -10
- package/dist/components/fieldset/fieldset-description.d.ts +10 -10
- package/dist/components/fieldset/fieldset-legend.d.ts +10 -10
- package/dist/components/fieldset/fieldset.d.ts +10 -10
- package/dist/components/fieldset/index.d.ts +10 -10
- package/dist/components/filter-group/filter-group.d.ts +10 -10
- package/dist/components/filter-group/index.d.ts +10 -10
- package/dist/components/footer/footer-links.d.ts +1 -1
- package/dist/components/footer/footer.d.ts +10 -10
- package/dist/components/footer/index.d.ts +10 -10
- package/dist/components/index.d.ts +10 -10
- package/dist/components/index.js +4 -4
- package/dist/components/input/index.d.ts +10 -10
- package/dist/components/input/input.d.ts +10 -10
- package/dist/components/label/index.d.ts +10 -10
- package/dist/components/label/label.d.ts +10 -10
- package/dist/components/link/index.d.ts +10 -10
- package/dist/components/link/link.d.ts +10 -10
- package/dist/components/logo/index.d.ts +10 -10
- package/dist/components/logo/logo.d.ts +10 -10
- package/dist/components/navbar/index.d.ts +10 -10
- package/dist/components/navbar/navbar.d.ts +10 -10
- package/dist/components/navbar/sub-navbar.d.ts +10 -10
- package/dist/components/pagination/index.d.ts +10 -10
- package/dist/components/pagination/pagination-button.d.ts +10 -10
- package/dist/components/pagination/pagination-item.d.ts +1 -1
- package/dist/components/pagination/pagination.d.ts +10 -10
- package/dist/components/popover/index.d.ts +10 -10
- package/dist/components/popover/popover-trigger-context.d.ts +1 -1
- package/dist/components/popover/popover-trigger.d.ts +10 -10
- package/dist/components/popover/popover.d.ts +10 -10
- package/dist/components/radio/index.d.ts +10 -10
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio/radio.d.ts +10 -10
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/search/index.d.ts +10 -10
- package/dist/components/search/index.js +1 -1
- package/dist/components/search/search.d.ts +10 -10
- package/dist/components/search/search.js +1 -1
- package/dist/components/select/index.d.ts +10 -10
- package/dist/components/select/select-optgroup.d.ts +10 -10
- package/dist/components/select/select-option.d.ts +10 -10
- package/dist/components/select/select.d.ts +10 -10
- package/dist/components/skip-link/index.d.ts +10 -10
- package/dist/components/skip-link/skip-link.d.ts +10 -10
- package/dist/components/spinner/index.d.ts +10 -10
- package/dist/components/spinner/spinner.d.ts +10 -10
- package/dist/components/sticky-header/index.d.ts +1 -1
- package/dist/components/sticky-header/sticky-header.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +10 -10
- package/dist/components/tabs/tab.d.ts +10 -10
- package/dist/components/tabs/tabs-list.d.ts +10 -10
- package/dist/components/tabs/tabs-panel.d.ts +10 -10
- package/dist/components/tabs/tabs.d.ts +10 -10
- package/dist/components/textarea/index.d.ts +10 -10
- package/dist/components/textarea/textarea.d.ts +10 -10
- package/dist/components/textfield/index.d.ts +10 -10
- package/dist/components/textfield/index.js +1 -1
- package/dist/components/textfield/textfield.d.ts +10 -10
- package/dist/components/textfield/textfield.js +1 -1
- package/dist/components/validation-message/index.d.ts +10 -10
- package/dist/components/validation-message/validation-message.d.ts +10 -10
- package/dist/{dialog-trigger-context-CpvFZdAf.d.ts → dialog-trigger-context-CedfUYNj.d.ts} +5 -5
- package/dist/{drawer-trigger-context-_6XODjjT.d.ts → drawer-trigger-context-V67j5GyK.d.ts} +3 -3
- package/dist/{dropdown-item-DF22Z5Fn.d.ts → dropdown-item-CnQfwJGB.d.ts} +3 -3
- package/dist/{dropdown-list-C3lptEFd.d.ts → dropdown-list-DK4FJAqB.d.ts} +3 -3
- package/dist/{dropdown-trigger-context-CZCfmNC-.d.ts → dropdown-trigger-context-C51vPffs.d.ts} +3 -3
- package/dist/{footer-links-XPnAoNyU.d.ts → footer-links-C9v9gcuW.d.ts} +3 -3
- package/dist/main.d.ts +10 -10
- package/dist/main.js +4 -4
- package/dist/{pagination-item-B5s_Fpjt.d.ts → pagination-item-CEfdaSuS.d.ts} +3 -3
- package/dist/{popover-trigger-context-B_lI5ACl.d.ts → popover-trigger-context-CQKQbCmr.d.ts} +5 -5
- package/dist/{radio-ulWuU7RE.js → radio-Cn3PqpMt.js} +2 -1
- package/dist/{radio-ulWuU7RE.js.map → radio-Cn3PqpMt.js.map} +1 -1
- package/dist/{search-Cqnboh3z.js → search-CdV5su_L.js} +2 -1
- package/dist/{search-Cqnboh3z.js.map → search-CdV5su_L.js.map} +1 -1
- package/dist/{sticky-header-BhzeZPgJ.d.ts → sticky-header-DxtaS2U0.d.ts} +3 -3
- package/dist/{textfield-D9Ssbb43.js → textfield-CdqVq5R0.js} +3 -1
- package/dist/{textfield-D9Ssbb43.js.map → textfield-CdqVq5R0.js.map} +1 -1
- package/dist/utilities/hooks/index.d.ts +10 -10
- package/dist/utilities/hooks/usePagination/usePagination.d.ts +10 -10
- package/dist/utilities/index.d.ts +10 -10
- package/package.json +4 -4
package/dist/main.js
CHANGED
|
@@ -30,7 +30,7 @@ import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect-B5btmYlF.
|
|
|
30
30
|
import "./useMergeRefs-CcJMoo46.js";
|
|
31
31
|
import { usePagination } from "./usePagination-DNqO-ob2.js";
|
|
32
32
|
import "./hooks-BmaG9QJW.js";
|
|
33
|
-
import { Checkbox } from "./checkbox-
|
|
33
|
+
import { Checkbox } from "./checkbox-CxA8UXr6.js";
|
|
34
34
|
import { CheckboxSubsection } from "./checkbox-subsection-CGXgII6v.js";
|
|
35
35
|
import "./checkbox-DdQn64cR.js";
|
|
36
36
|
import { Chip } from "./chip-CRcC9TkL.js";
|
|
@@ -84,9 +84,9 @@ import { Pagination } from "./pagination-DxXjiIgC.js";
|
|
|
84
84
|
import { PaginationButton } from "./pagination-button-CjEZPPC8.js";
|
|
85
85
|
import { PaginationItem } from "./pagination-item-DXnI0BWj.js";
|
|
86
86
|
import "./pagination-DUyQRuUE.js";
|
|
87
|
-
import { Radio } from "./radio-
|
|
87
|
+
import { Radio } from "./radio-Cn3PqpMt.js";
|
|
88
88
|
import "./radio-Uyx2D7dl.js";
|
|
89
|
-
import { Search } from "./search-
|
|
89
|
+
import { Search } from "./search-CdV5su_L.js";
|
|
90
90
|
import "./search-VYIc3wFh.js";
|
|
91
91
|
import { Select } from "./select-DCZV6wZu.js";
|
|
92
92
|
import { SelectOption } from "./select-option-BByWq34J.js";
|
|
@@ -105,7 +105,7 @@ import { Textarea } from "./textarea-C580HmQX.js";
|
|
|
105
105
|
import "./textarea-D37K5D86.js";
|
|
106
106
|
import { ValidationMessage } from "./validation-message-6AQTIup_.js";
|
|
107
107
|
import "./validation-message-B4lI2a0K.js";
|
|
108
|
-
import { Textfield } from "./textfield-
|
|
108
|
+
import { Textfield } from "./textfield-CdqVq5R0.js";
|
|
109
109
|
import "./textfield-CWoUw1b2.js";
|
|
110
110
|
import "./components-CUDHzsYh.js";
|
|
111
111
|
import "./utilities-JoKvbhOy.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime51 from "react/jsx-runtime";
|
|
2
2
|
import { HTMLAttributes, Ref } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/pagination/pagination-item.d.ts
|
|
@@ -15,7 +15,7 @@ declare const PaginationItem: ({
|
|
|
15
15
|
asChild,
|
|
16
16
|
children,
|
|
17
17
|
...rest
|
|
18
|
-
}: PaginationItemProps) =>
|
|
18
|
+
}: PaginationItemProps) => react_jsx_runtime51.JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { PaginationItem, PaginationItemProps };
|
|
21
|
-
//# sourceMappingURL=pagination-item-
|
|
21
|
+
//# sourceMappingURL=pagination-item-CEfdaSuS.d.ts.map
|
package/dist/{popover-trigger-context-B_lI5ACl.d.ts → popover-trigger-context-CQKQbCmr.d.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime54 from "react/jsx-runtime";
|
|
2
|
+
import * as react53 from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/popover/popover-trigger-context.d.ts
|
|
6
|
-
declare const Context:
|
|
6
|
+
declare const Context: react53.Context<{
|
|
7
7
|
popoverId?: string;
|
|
8
8
|
setPopoverId?: (id: string) => void;
|
|
9
9
|
popoverOpen?: boolean;
|
|
@@ -25,7 +25,7 @@ type PopoverTriggerContextProps = {
|
|
|
25
25
|
*/
|
|
26
26
|
declare const PopoverTriggerContext: ({
|
|
27
27
|
children
|
|
28
|
-
}: PopoverTriggerContextProps) =>
|
|
28
|
+
}: PopoverTriggerContextProps) => react_jsx_runtime54.JSX.Element;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { Context, PopoverTriggerContext, PopoverTriggerContextProps };
|
|
31
|
-
//# sourceMappingURL=popover-trigger-context-
|
|
31
|
+
//# sourceMappingURL=popover-trigger-context-CQKQbCmr.d.ts.map
|
|
@@ -22,6 +22,7 @@ const Radio = ({ dark, label, description, error, fullwidth, style, className, r
|
|
|
22
22
|
ref,
|
|
23
23
|
"aria-invalid": error || void 0,
|
|
24
24
|
"aria-describedby": ariaDescribedBy,
|
|
25
|
+
dark,
|
|
25
26
|
...props
|
|
26
27
|
}),
|
|
27
28
|
label && /* @__PURE__ */ jsx(Label, {
|
|
@@ -41,4 +42,4 @@ const Radio = ({ dark, label, description, error, fullwidth, style, className, r
|
|
|
41
42
|
|
|
42
43
|
//#endregion
|
|
43
44
|
export { Radio };
|
|
44
|
-
//# sourceMappingURL=radio-
|
|
45
|
+
//# sourceMappingURL=radio-Cn3PqpMt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-
|
|
1
|
+
{"version":3,"file":"radio-Cn3PqpMt.js","names":[],"sources":["../src/components/radio/radio.tsx"],"sourcesContent":["import { useId, type ReactNode, type Ref } from 'react';\n\nimport type { LabelRequiredProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\nimport { Field, FieldDescription } from '../field';\nimport { Input, type InputProps } from '../input';\nimport { Label } from '../label';\n\nexport type RadioProps = MergeRight<\n LabelRequiredProps & Omit<InputProps, 'type' | 'role' | 'size'>,\n {\n /** Label */\n label?: ReactNode;\n /** Description */\n description?: ReactNode;\n /** Add error indication to the radio. */\n error?: boolean;\n /** If true, the radio will take up the full width of the container, and not just \"fit-content\" which is default */\n fullwidth?: boolean;\n ref?: Ref<HTMLInputElement>;\n }\n>;\n\nexport const Radio = ({\n dark,\n label,\n description,\n error,\n fullwidth,\n style,\n className,\n ref,\n id,\n 'aria-describedby': ariaDescribedByProp,\n ...props\n}: RadioProps) => {\n const descriptionId = useId();\n\n const ariaDescribedBy = [description ? descriptionId : '', ariaDescribedByProp].join(' ').trim() || undefined;\n\n return (\n <Field className={className} data-dark={dark} style={style} fullwidth={fullwidth} asChild>\n <label>\n <Input\n type='radio'\n id={id}\n ref={ref}\n aria-invalid={error || undefined}\n aria-describedby={ariaDescribedBy}\n dark={dark}\n {...props}\n />\n {label && (\n <Label weight='medium' htmlFor={id} asChild>\n <span>{label}</span>\n </Label>\n )}\n {description && (\n // Aria-hidden is used to prevent screen readers from reading the description twice:\n // once as part of the label and once from being connected through aria-describedby.\n <FieldDescription aria-hidden='true' id={descriptionId}>\n {description}\n </FieldDescription>\n )}\n </label>\n </Field>\n );\n};\n"],"mappings":";;;;;;;;AAuBA,MAAa,QAAQ,CAAC,EACpB,MACA,OACA,aACA,OACA,WACA,OACA,WACA,KACA,IACA,oBAAoB,oBACpB,GAAG,OACQ,KAAK;CAChB,MAAM,gBAAgB,OAAO;CAE7B,MAAM,kBAAkB,CAAC,cAAc,gBAAgB,IAAI,mBAAoB,EAAC,KAAK,IAAI,CAAC,MAAM;AAEhG,wBACE,IAAC;EAAiB;EAAW,aAAW;EAAa;EAAkB;EAAW;4BAChF,KAAC;mBACC,IAAC;IACC,MAAK;IACD;IACC;IACL,gBAAc;IACd,oBAAkB;IACZ;IACN,GAAI;KACJ;GACD,yBACC,IAAC;IAAM,QAAO;IAAS,SAAS;IAAI;8BAClC,IAAC,oBAAM,QAAa;KACd;GAET,+BAGC,IAAC;IAAiB,eAAY;IAAO,IAAI;cACtC;KACgB;MAEf;GACF;AAEX"}
|
|
@@ -32,6 +32,7 @@ const Search = ({ className, onSubmit, onReset, clearAriaLabel = "Clear", size =
|
|
|
32
32
|
type: "text",
|
|
33
33
|
ref,
|
|
34
34
|
size,
|
|
35
|
+
dark,
|
|
35
36
|
...props
|
|
36
37
|
}),
|
|
37
38
|
/* @__PURE__ */ jsx(FieldAffix, {
|
|
@@ -56,4 +57,4 @@ const Search = ({ className, onSubmit, onReset, clearAriaLabel = "Clear", size =
|
|
|
56
57
|
|
|
57
58
|
//#endregion
|
|
58
59
|
export { Search };
|
|
59
|
-
//# sourceMappingURL=search-
|
|
60
|
+
//# sourceMappingURL=search-CdV5su_L.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-
|
|
1
|
+
{"version":3,"file":"search-CdV5su_L.js","names":["e: React.FormEvent<HTMLFormElement>"],"sources":["../src/components/search/search.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport { Field, FieldAffixes, FieldAffix } from '../field';\nimport { Input, type InputProps } from '../input';\nimport { BiIconCrossSmall, BiIconMagnefyingGlass } from '@bi-digital/icons-react';\nimport type { MergeRight } from '../../utilities';\nimport { Button } from '../button';\n\nexport type SearchProps = MergeRight<\n Omit<InputProps, 'type' | 'size'>,\n {\n /**\n * Size of the search.\n * @default 'medium'\n */\n size?: 'medium' | 'large';\n /** Called when the user presses enter. You can use this to for example navigate on submit. */\n onSubmit?: (value: string) => void;\n /** Called when the user resets the search input. */\n onReset?: (value: string) => void;\n /**\n * Aria-label for the clear button.\n * @defaultValue 'Clear'\n */\n clearAriaLabel?: string;\n }\n>;\n\nexport const Search = ({\n className,\n onSubmit,\n onReset,\n clearAriaLabel = 'Clear',\n size = 'medium',\n ref,\n dark,\n style,\n ...props\n}: SearchProps) => {\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n if (onSubmit) {\n const input = e.currentTarget.querySelector('input');\n onSubmit(input?.value || '');\n }\n };\n const handleReset = () => {\n if (onReset) {\n onReset('');\n }\n };\n return (\n <Field className={clsx('bi-search', className)} data-dark={dark} style={style} asChild>\n <form onSubmit={handleSubmit} onReset={handleReset}>\n <FieldAffixes>\n <FieldAffix>\n <BiIconMagnefyingGlass size={size} />\n </FieldAffix>\n <Input type='text' ref={ref} size={size} dark={dark} {...props} />\n <FieldAffix aria-hidden='false'>\n <Button aria-label={clearAriaLabel} icon size={size} dark={dark} variant='text' type='reset'>\n <BiIconCrossSmall size={size} aria-hidden='true' />\n </Button>\n </FieldAffix>\n </FieldAffixes>\n </form>\n </Field>\n );\n};\n"],"mappings":";;;;;;;;;AA2BA,MAAa,SAAS,CAAC,EACrB,WACA,UACA,SACA,iBAAiB,SACjB,OAAO,UACP,KACA,MACA,MACA,GAAG,OACS,KAAK;CACjB,MAAM,eAAe,CAACA,MAAwC;AAC5D,IAAE,gBAAgB;AAClB,MAAI,UAAU;GACZ,MAAM,QAAQ,EAAE,cAAc,cAAc,QAAQ;AACpD,YAAS,OAAO,SAAS,GAAG;EAC7B;CACF;CACD,MAAM,cAAc,MAAM;AACxB,MAAI,QACF,SAAQ,GAAG;CAEd;AACD,wBACE,IAAC;EAAM,WAAW,KAAK,aAAa,UAAU;EAAE,aAAW;EAAa;EAAO;4BAC7E,IAAC;GAAK,UAAU;GAAc,SAAS;6BACrC,KAAC;oBACC,IAAC,wCACC,IAAC,yBAA4B,OAAQ,GAC1B;oBACb,IAAC;KAAM,MAAK;KAAY;KAAW;KAAY;KAAM,GAAI;MAAS;oBAClE,IAAC;KAAW,eAAY;+BACtB,IAAC;MAAO,cAAY;MAAgB;MAAW;MAAY;MAAM,SAAQ;MAAO,MAAK;gCACnF,IAAC;OAAuB;OAAM,eAAY;QAAS;OAC5C;MACE;OACA;IACV;GACD;AAEX"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime64 from "react/jsx-runtime";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/sticky-header/sticky-header.d.ts
|
|
@@ -13,7 +13,7 @@ type StickyHeaderProps = {
|
|
|
13
13
|
*/
|
|
14
14
|
declare const StickyHeader: ({
|
|
15
15
|
children
|
|
16
|
-
}: StickyHeaderProps) =>
|
|
16
|
+
}: StickyHeaderProps) => react_jsx_runtime64.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { StickyHeader, StickyHeaderProps };
|
|
19
|
-
//# sourceMappingURL=sticky-header-
|
|
19
|
+
//# sourceMappingURL=sticky-header-DxtaS2U0.d.ts.map
|
|
@@ -39,12 +39,14 @@ const Textfield = ({ dark, label, description, error, multiline, prefix, suffix,
|
|
|
39
39
|
ref,
|
|
40
40
|
"aria-invalid": Boolean(error) || void 0,
|
|
41
41
|
"aria-describedby": ariaDescribedBy,
|
|
42
|
+
dark,
|
|
42
43
|
...props
|
|
43
44
|
}) : /* @__PURE__ */ jsx(Input, {
|
|
44
45
|
id,
|
|
45
46
|
ref,
|
|
46
47
|
"aria-invalid": Boolean(error) || void 0,
|
|
47
48
|
"aria-describedby": ariaDescribedBy,
|
|
49
|
+
dark,
|
|
48
50
|
...props
|
|
49
51
|
}),
|
|
50
52
|
suffix && /* @__PURE__ */ jsx(FieldAffix, { children: suffix })
|
|
@@ -59,4 +61,4 @@ const Textfield = ({ dark, label, description, error, multiline, prefix, suffix,
|
|
|
59
61
|
|
|
60
62
|
//#endregion
|
|
61
63
|
export { Textfield };
|
|
62
|
-
//# sourceMappingURL=textfield-
|
|
64
|
+
//# sourceMappingURL=textfield-CdqVq5R0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textfield-
|
|
1
|
+
{"version":3,"file":"textfield-CdqVq5R0.js","names":[],"sources":["../src/components/textfield/textfield.tsx"],"sourcesContent":["import { useId, type ReactNode, type Ref } from 'react';\n\nimport type { DefaultProps, LabelRequiredProps } from '../../types';\nimport { Field, FieldAffix, FieldAffixes, FieldDescription } from '../field';\nimport { Input, type InputProps } from '../input';\nimport { Label } from '../label';\nimport { Textarea, type TextareaProps } from '../textarea';\nimport { ValidationMessage } from '../validation-message';\n\ntype InputPropsFiltered = Omit<InputProps, 'prefix' | 'className' | 'style'>;\ntype TextareaPropsFiltered = Omit<TextareaProps, 'prefix' | 'className' | 'style'>;\n\ntype BaseTextfieldProps = LabelRequiredProps &\n DefaultProps & {\n /** Label */\n label?: ReactNode;\n /** Description */\n description?: ReactNode;\n /** Prefix */\n prefix?: string;\n /** Suffix */\n suffix?: string;\n /** Error message for field */\n error?: ReactNode;\n /** `className` for the `Field` element */\n className?: InputProps['className'];\n /** `style` for the `Field` element */\n style?: InputProps['style'];\n };\n\ntype TextfieldTextareaProps = {\n /** Render `Textarea` instead of a `Input`. The `Textarea` has support for multiple rows of input. */\n multiline: true;\n} & TextareaPropsFiltered;\n\ntype TextfieldInputProps = {\n /** Render `Textarea` instead of a `Input`. The `Textarea` has support for multiple rows of input. */\n multiline?: never | false;\n} & InputPropsFiltered;\n\nexport type TextfieldProps = BaseTextfieldProps &\n // We use either Textarea or Input props, depending on the `multiline` prop.\n (TextfieldTextareaProps | TextfieldInputProps) & {\n ref?: Ref<HTMLInputElement | HTMLTextAreaElement>;\n };\n\nexport const Textfield = ({\n dark,\n label,\n description,\n error,\n multiline,\n prefix,\n suffix,\n style,\n className,\n ref,\n id: idProp,\n 'aria-describedby': ariaDescribedByProp,\n ...props\n}: TextfieldProps) => {\n const generatedId = useId();\n const descriptionId = useId();\n const validationId = useId();\n const id = idProp || generatedId;\n\n const ariaDescribedBy =\n [description ? descriptionId : '', error ? validationId : '', ariaDescribedByProp].join(' ').trim() || undefined;\n return (\n <Field className={className} data-dark={dark} style={style}>\n {label && <Label htmlFor={id}>{label}</Label>}\n {description && <FieldDescription id={descriptionId}>{description}</FieldDescription>}\n <FieldAffixes>\n {prefix && <FieldAffix>{prefix}</FieldAffix>}\n {multiline ? (\n <Textarea\n id={id}\n ref={ref as Ref<HTMLTextAreaElement>}\n aria-invalid={Boolean(error) || undefined}\n aria-describedby={ariaDescribedBy}\n dark={dark}\n {...(props as TextareaPropsFiltered)}\n />\n ) : (\n <Input\n id={id}\n ref={ref as Ref<HTMLInputElement>}\n aria-invalid={Boolean(error) || undefined}\n aria-describedby={ariaDescribedBy}\n dark={dark}\n {...(props as InputPropsFiltered)}\n />\n )}\n {suffix && <FieldAffix>{suffix}</FieldAffix>}\n </FieldAffixes>\n {!!error && <ValidationMessage id={validationId}>{error}</ValidationMessage>}\n </Field>\n );\n};\n"],"mappings":";;;;;;;;;;;AA8CA,MAAa,YAAY,CAAC,EACxB,MACA,OACA,aACA,OACA,WACA,QACA,QACA,OACA,WACA,KACA,IAAI,QACJ,oBAAoB,oBACpB,GAAG,OACY,KAAK;CACpB,MAAM,cAAc,OAAO;CAC3B,MAAM,gBAAgB,OAAO;CAC7B,MAAM,eAAe,OAAO;CAC5B,MAAM,KAAK,UAAU;CAErB,MAAM,kBACJ;EAAC,cAAc,gBAAgB;EAAI,QAAQ,eAAe;EAAI;CAAoB,EAAC,KAAK,IAAI,CAAC,MAAM;AACrG,wBACE,KAAC;EAAiB;EAAW,aAAW;EAAa;;GAClD,yBAAS,IAAC;IAAM,SAAS;cAAK;KAAc;GAC5C,+BAAe,IAAC;IAAiB,IAAI;cAAgB;KAA+B;mBACrF,KAAC;IACE,0BAAU,IAAC,wBAAY,SAAoB;IAC3C,4BACC,IAAC;KACK;KACC;KACL,gBAAc,QAAQ,MAAM;KAC5B,oBAAkB;KACZ;KACN,GAAK;MACL,mBAEF,IAAC;KACK;KACC;KACL,gBAAc,QAAQ,MAAM;KAC5B,oBAAkB;KACZ;KACN,GAAK;MACL;IAEH,0BAAU,IAAC,wBAAY,SAAoB;OAC/B;KACZ,yBAAS,IAAC;IAAkB,IAAI;cAAe;KAA0B;;GACtE;AAEX"}
|
|
@@ -2,16 +2,16 @@ import { UseCheckboxGroupOptions, useCheckboxGroup } from "../../useCheckboxGrou
|
|
|
2
2
|
import { useIsomorphicLayoutEffect } from "../../useIsomorphicLayoutEffect-BMdz-mee.js";
|
|
3
3
|
import { useMergeRefs } from "../../useMergeRefs-iCenhgmf.js";
|
|
4
4
|
import "../../types-Mj1poXVf.js";
|
|
5
|
-
import { UsePaginationProps, usePagination } from "../../alert-footer-
|
|
6
|
-
import "../../dialog-trigger-context-
|
|
7
|
-
import "../../drawer-trigger-context-
|
|
8
|
-
import "../../popover-trigger-context-
|
|
9
|
-
import "../../dropdown-item-
|
|
10
|
-
import "../../dropdown-list-
|
|
11
|
-
import "../../dropdown-trigger-context-
|
|
12
|
-
import "../../footer-links-
|
|
13
|
-
import "../../pagination-item-
|
|
14
|
-
import "../../sticky-header-
|
|
5
|
+
import { UsePaginationProps, usePagination } from "../../alert-footer-CmqpWEov.js";
|
|
6
|
+
import "../../dialog-trigger-context-CedfUYNj.js";
|
|
7
|
+
import "../../drawer-trigger-context-V67j5GyK.js";
|
|
8
|
+
import "../../popover-trigger-context-CQKQbCmr.js";
|
|
9
|
+
import "../../dropdown-item-CnQfwJGB.js";
|
|
10
|
+
import "../../dropdown-list-DK4FJAqB.js";
|
|
11
|
+
import "../../dropdown-trigger-context-C51vPffs.js";
|
|
12
|
+
import "../../footer-links-C9v9gcuW.js";
|
|
13
|
+
import "../../pagination-item-CEfdaSuS.js";
|
|
14
|
+
import "../../sticky-header-DxtaS2U0.js";
|
|
15
15
|
import "../../index-CTw2zfCM.js";
|
|
16
16
|
import "../../types-DC-FPmDA.js";
|
|
17
17
|
export { UseCheckboxGroupOptions, UsePaginationProps, useCheckboxGroup, useIsomorphicLayoutEffect, useMergeRefs, usePagination };
|
|
@@ -2,16 +2,16 @@ import "../../../useCheckboxGroup-DRhqch1m.js";
|
|
|
2
2
|
import "../../../useIsomorphicLayoutEffect-BMdz-mee.js";
|
|
3
3
|
import "../../../useMergeRefs-iCenhgmf.js";
|
|
4
4
|
import "../../../types-Mj1poXVf.js";
|
|
5
|
-
import { UsePaginationProps, usePagination } from "../../../alert-footer-
|
|
6
|
-
import "../../../dialog-trigger-context-
|
|
7
|
-
import "../../../drawer-trigger-context-
|
|
8
|
-
import "../../../popover-trigger-context-
|
|
9
|
-
import "../../../dropdown-item-
|
|
10
|
-
import "../../../dropdown-list-
|
|
11
|
-
import "../../../dropdown-trigger-context-
|
|
12
|
-
import "../../../footer-links-
|
|
13
|
-
import "../../../pagination-item-
|
|
14
|
-
import "../../../sticky-header-
|
|
5
|
+
import { UsePaginationProps, usePagination } from "../../../alert-footer-CmqpWEov.js";
|
|
6
|
+
import "../../../dialog-trigger-context-CedfUYNj.js";
|
|
7
|
+
import "../../../drawer-trigger-context-V67j5GyK.js";
|
|
8
|
+
import "../../../popover-trigger-context-CQKQbCmr.js";
|
|
9
|
+
import "../../../dropdown-item-CnQfwJGB.js";
|
|
10
|
+
import "../../../dropdown-list-DK4FJAqB.js";
|
|
11
|
+
import "../../../dropdown-trigger-context-C51vPffs.js";
|
|
12
|
+
import "../../../footer-links-C9v9gcuW.js";
|
|
13
|
+
import "../../../pagination-item-CEfdaSuS.js";
|
|
14
|
+
import "../../../sticky-header-DxtaS2U0.js";
|
|
15
15
|
import "../../../index-CTw2zfCM.js";
|
|
16
16
|
import "../../../types-DC-FPmDA.js";
|
|
17
17
|
export { UsePaginationProps, usePagination };
|
|
@@ -2,16 +2,16 @@ import { UseCheckboxGroupOptions, useCheckboxGroup } from "../useCheckboxGroup-D
|
|
|
2
2
|
import { useIsomorphicLayoutEffect } from "../useIsomorphicLayoutEffect-BMdz-mee.js";
|
|
3
3
|
import "../useMergeRefs-iCenhgmf.js";
|
|
4
4
|
import "../types-Mj1poXVf.js";
|
|
5
|
-
import { UsePaginationProps, usePagination } from "../alert-footer-
|
|
6
|
-
import "../dialog-trigger-context-
|
|
7
|
-
import "../drawer-trigger-context-
|
|
8
|
-
import "../popover-trigger-context-
|
|
9
|
-
import "../dropdown-item-
|
|
10
|
-
import "../dropdown-list-
|
|
11
|
-
import "../dropdown-trigger-context-
|
|
12
|
-
import "../footer-links-
|
|
13
|
-
import "../pagination-item-
|
|
14
|
-
import "../sticky-header-
|
|
5
|
+
import { UsePaginationProps, usePagination } from "../alert-footer-CmqpWEov.js";
|
|
6
|
+
import "../dialog-trigger-context-CedfUYNj.js";
|
|
7
|
+
import "../drawer-trigger-context-V67j5GyK.js";
|
|
8
|
+
import "../popover-trigger-context-CQKQbCmr.js";
|
|
9
|
+
import "../dropdown-item-CnQfwJGB.js";
|
|
10
|
+
import "../dropdown-list-DK4FJAqB.js";
|
|
11
|
+
import "../dropdown-trigger-context-C51vPffs.js";
|
|
12
|
+
import "../footer-links-C9v9gcuW.js";
|
|
13
|
+
import "../pagination-item-CEfdaSuS.js";
|
|
14
|
+
import "../sticky-header-DxtaS2U0.js";
|
|
15
15
|
import "../index-CTw2zfCM.js";
|
|
16
16
|
import { MergeRight } from "../types-DC-FPmDA.js";
|
|
17
17
|
export { MergeRight, UseCheckboxGroupOptions, UsePaginationProps, useCheckboxGroup, useIsomorphicLayoutEffect, usePagination };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bi-digital/react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React components from BI Digital",
|
|
6
6
|
"author": "BI Digital",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"tsdown": "^0.12.7",
|
|
48
48
|
"typescript": "^5.7.2",
|
|
49
49
|
"vitest": "^3.2.1",
|
|
50
|
-
"@bi-digital/icons-react": "0.2.
|
|
50
|
+
"@bi-digital/icons-react": "0.2.22"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": "^19",
|
|
54
54
|
"react-dom": "^19",
|
|
55
|
-
"@bi-digital/css": "0.2.
|
|
56
|
-
"@bi-digital/icons-react": "0.2.
|
|
55
|
+
"@bi-digital/css": "0.2.22",
|
|
56
|
+
"@bi-digital/icons-react": "0.2.22"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsdown",
|