@arc-ui/components 11.5.0 → 11.6.0
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/Breadcrumbs/Breadcrumbs.cjs.d.ts +1 -61
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +9 -641
- package/dist/Breadcrumbs/Breadcrumbs.esm.d.ts +1 -61
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +8 -640
- package/dist/Button/Button.cjs.d.ts +1 -1
- package/dist/Button/Button.cjs.js +2 -1
- package/dist/Button/Button.esm.d.ts +1 -1
- package/dist/Button/Button.esm.js +2 -1
- package/dist/Card/Card.cjs.d.ts +1 -130
- package/dist/Card/Card.cjs.js +12 -119
- package/dist/Card/Card.esm.d.ts +1 -130
- package/dist/Card/Card.esm.js +11 -118
- package/dist/Checkbox/Checkbox.cjs.d.ts +1 -64
- package/dist/Checkbox/Checkbox.cjs.js +10 -59
- package/dist/Checkbox/Checkbox.esm.d.ts +1 -64
- package/dist/Checkbox/Checkbox.esm.js +9 -58
- package/dist/Columns/Columns.cjs.d.ts +1 -76
- package/dist/Columns/Columns.cjs.js +6 -52
- package/dist/Columns/Columns.esm.d.ts +1 -76
- package/dist/Columns/Columns.esm.js +5 -51
- package/dist/DisclosureMini/DisclosureMini.cjs.d.ts +1 -1
- package/dist/DisclosureMini/DisclosureMini.cjs.js +1 -1
- package/dist/DisclosureMini/DisclosureMini.esm.d.ts +1 -1
- package/dist/DisclosureMini/DisclosureMini.esm.js +1 -1
- package/dist/Filter/Filter.cjs.d.ts +1 -0
- package/dist/Filter/Filter.cjs.js +13 -0
- package/dist/Filter/Filter.esm.d.ts +1 -0
- package/dist/Filter/Filter.esm.js +5 -0
- package/dist/Filter/package.json +7 -0
- package/dist/FormControl/FormControl.cjs.d.ts +1 -1
- package/dist/FormControl/FormControl.cjs.js +2 -3
- package/dist/FormControl/FormControl.esm.d.ts +1 -1
- package/dist/FormControl/FormControl.esm.js +2 -3
- package/dist/Group/Group.cjs.d.ts +1 -46
- package/dist/Group/Group.cjs.js +6 -43
- package/dist/Group/Group.esm.d.ts +1 -46
- package/dist/Group/Group.esm.js +5 -42
- package/dist/Pagination/Pagination.cjs.d.ts +20 -0
- package/dist/Pagination/Pagination.cjs.js +87 -0
- package/dist/Pagination/Pagination.esm.d.ts +20 -0
- package/dist/Pagination/Pagination.esm.js +79 -0
- package/dist/Pagination/package.json +7 -0
- package/dist/PaginationSimple/PaginationSimple.cjs.d.ts +28 -0
- package/dist/PaginationSimple/PaginationSimple.cjs.js +47 -0
- package/dist/PaginationSimple/PaginationSimple.esm.d.ts +28 -0
- package/dist/PaginationSimple/PaginationSimple.esm.js +39 -0
- package/dist/PaginationSimple/package.json +7 -0
- package/dist/Poster/Poster.cjs.d.ts +1 -81
- package/dist/Poster/Poster.cjs.js +8 -45
- package/dist/Poster/Poster.esm.d.ts +1 -81
- package/dist/Poster/Poster.esm.js +7 -44
- package/dist/RadioGroup/RadioGroup.cjs.d.ts +1 -85
- package/dist/RadioGroup/RadioGroup.cjs.js +8 -67
- package/dist/RadioGroup/RadioGroup.esm.d.ts +1 -85
- package/dist/RadioGroup/RadioGroup.esm.js +7 -66
- package/dist/ScrollToTop/ScrollToTop.cjs.d.ts +25 -0
- package/dist/ScrollToTop/ScrollToTop.cjs.js +68 -0
- package/dist/ScrollToTop/ScrollToTop.esm.d.ts +25 -0
- package/dist/ScrollToTop/ScrollToTop.esm.js +60 -0
- package/dist/ScrollToTop/package.json +7 -0
- package/dist/Select/Select.cjs.d.ts +2 -2
- package/dist/Select/Select.cjs.js +2 -3
- package/dist/Select/Select.esm.d.ts +2 -2
- package/dist/Select/Select.esm.js +2 -3
- package/dist/SiteFooter/SiteFooter.cjs.d.ts +2 -62
- package/dist/SiteFooter/SiteFooter.cjs.js +10 -65
- package/dist/SiteFooter/SiteFooter.esm.d.ts +2 -62
- package/dist/SiteFooter/SiteFooter.esm.js +12 -66
- package/dist/SiteHeader/SiteHeader.cjs.d.ts +2 -260
- package/dist/SiteHeader/SiteHeader.cjs.js +16 -668
- package/dist/SiteHeader/SiteHeader.esm.d.ts +2 -260
- package/dist/SiteHeader/SiteHeader.esm.js +14 -666
- package/dist/Switch/Switch.cjs.d.ts +2 -2
- package/dist/Switch/Switch.cjs.js +2 -2
- package/dist/Switch/Switch.esm.d.ts +2 -2
- package/dist/Switch/Switch.esm.js +2 -2
- package/dist/TextArea/TextArea.cjs.d.ts +61 -0
- package/dist/TextArea/TextArea.cjs.js +87 -0
- package/dist/TextArea/TextArea.esm.d.ts +61 -0
- package/dist/TextArea/TextArea.esm.js +79 -0
- package/dist/TextArea/package.json +7 -0
- package/dist/TextInput/TextInput.cjs.d.ts +1 -75
- package/dist/TextInput/TextInput.cjs.js +9 -75
- package/dist/TextInput/TextInput.esm.d.ts +1 -75
- package/dist/TextInput/TextInput.esm.js +8 -74
- package/dist/UniversalHeader/UniversalHeader.cjs.d.ts +1 -26
- package/dist/UniversalHeader/UniversalHeader.cjs.js +5 -30
- package/dist/UniversalHeader/UniversalHeader.esm.d.ts +1 -26
- package/dist/UniversalHeader/UniversalHeader.esm.js +4 -29
- package/dist/_shared/cjs/Breadcrumbs-8b554370.d.ts +61 -0
- package/dist/_shared/cjs/Breadcrumbs-8b554370.js +106 -0
- package/dist/_shared/cjs/BtIconChevronLeftMid-df952a3e.js +31 -0
- package/dist/_shared/cjs/{Button-5dff284a.js → Button-27512fee.js} +6 -27
- package/dist/_shared/cjs/Card-804ab0e5.d.ts +136 -0
- package/dist/_shared/cjs/Card-804ab0e5.js +124 -0
- package/dist/_shared/cjs/Checkbox-21d3c4f6.d.ts +64 -0
- package/dist/_shared/cjs/Checkbox-21d3c4f6.js +62 -0
- package/dist/_shared/cjs/Columns-e90798f8.d.ts +76 -0
- package/dist/_shared/cjs/Columns-e90798f8.js +57 -0
- package/dist/_shared/cjs/{DisclosureMini-5af13d3c.js → DisclosureMini-067e0319.js} +3 -1
- package/dist/_shared/cjs/Filter-f7d2fbda.d.ts +83 -0
- package/dist/_shared/cjs/Filter-f7d2fbda.js +121 -0
- package/dist/_shared/cjs/{FormControl-42360ae8.d.ts → FormControl-9aaddd54.d.ts} +4 -0
- package/dist/_shared/cjs/{FormControl-42360ae8.js → FormControl-9aaddd54.js} +9 -9
- package/dist/_shared/cjs/Group-d83f8c2e.d.ts +46 -0
- package/dist/_shared/cjs/Group-d83f8c2e.js +48 -0
- package/dist/_shared/cjs/ItemGroup-5af4d600.d.ts +27 -0
- package/dist/_shared/cjs/NavItem-df20237c.d.ts +43 -0
- package/dist/_shared/cjs/NavItemWithSubNav-65f21828.d.ts +49 -0
- package/dist/_shared/cjs/Poster-e05bbe13.d.ts +81 -0
- package/dist/_shared/cjs/Poster-e05bbe13.js +50 -0
- package/dist/_shared/cjs/RadioGroup-81805ef9.d.ts +97 -0
- package/dist/_shared/cjs/RadioGroup-81805ef9.js +70 -0
- package/dist/_shared/cjs/SiteFooter-c540b5f1.d.ts +62 -0
- package/dist/_shared/cjs/SiteFooter-c540b5f1.js +73 -0
- package/dist/_shared/cjs/SiteHeader-c25ee36e.d.ts +78 -0
- package/dist/_shared/cjs/SiteHeader.rehydrator-f7fa2efe.d.ts +78 -0
- package/dist/_shared/cjs/SiteHeader.rehydrator-f7fa2efe.js +673 -0
- package/dist/_shared/cjs/SubNavItem-a84d1bf4.d.ts +48 -0
- package/dist/_shared/cjs/TextInput-33314fc4.d.ts +10 -0
- package/dist/_shared/cjs/TextInput-33314fc4.js +78 -0
- package/dist/_shared/cjs/TextInput-7ed03a48.d.ts +75 -0
- package/dist/_shared/cjs/UniversalHeader-cc1d9e5a.d.ts +26 -0
- package/dist/_shared/cjs/UniversalHeader-cc1d9e5a.js +35 -0
- package/dist/_shared/cjs/debounce-506538c5.js +544 -0
- package/dist/_shared/cjs/index-699086a7.d.ts +2 -0
- package/dist/_shared/cjs/index-74488a9f.d.ts +2 -0
- package/dist/_shared/cjs/index-c81c9401.d.ts +3 -3
- package/dist/_shared/cjs/index-e340924e.d.ts +2 -0
- package/dist/_shared/cjs/index-e6d20018.d.ts +3 -0
- package/dist/_shared/cjs/index-eb06f640.d.ts +2 -0
- package/dist/_shared/cjs/index-f419cf04.d.ts +2 -0
- package/dist/_shared/esm/Breadcrumbs-04590057.d.ts +61 -0
- package/dist/_shared/esm/Breadcrumbs-04590057.js +100 -0
- package/dist/_shared/esm/BtIconChevronLeftMid-9f4f3a3d.js +25 -0
- package/dist/_shared/esm/{Button-61241dd0.js → Button-d319fa11.js} +2 -23
- package/dist/_shared/esm/Card-e79eb6c8.d.ts +136 -0
- package/dist/_shared/esm/Card-e79eb6c8.js +118 -0
- package/dist/_shared/esm/Checkbox-94300d8c.d.ts +64 -0
- package/dist/_shared/esm/Checkbox-94300d8c.js +56 -0
- package/dist/_shared/esm/Columns-8704515b.d.ts +76 -0
- package/dist/_shared/esm/Columns-8704515b.js +51 -0
- package/dist/_shared/esm/{DisclosureMini-322fccc0.js → DisclosureMini-022beae3.js} +3 -1
- package/dist/_shared/esm/Filter-41b391e3.d.ts +83 -0
- package/dist/_shared/esm/Filter-41b391e3.js +115 -0
- package/dist/_shared/esm/{FormControl-0744f93f.d.ts → FormControl-5e3fdca3.d.ts} +4 -0
- package/dist/_shared/esm/{FormControl-0744f93f.js → FormControl-5e3fdca3.js} +9 -9
- package/dist/_shared/esm/Group-d62c3f56.d.ts +46 -0
- package/dist/_shared/esm/Group-d62c3f56.js +42 -0
- package/dist/_shared/esm/ItemGroup-5af4d600.d.ts +27 -0
- package/dist/_shared/esm/NavItem-df20237c.d.ts +43 -0
- package/dist/_shared/esm/NavItemWithSubNav-65f21828.d.ts +49 -0
- package/dist/_shared/esm/Poster-107d6954.d.ts +81 -0
- package/dist/_shared/esm/Poster-107d6954.js +44 -0
- package/dist/_shared/esm/RadioGroup-1fd0f389.d.ts +97 -0
- package/dist/_shared/esm/RadioGroup-1fd0f389.js +64 -0
- package/dist/_shared/esm/SiteFooter-8075a9bd.d.ts +62 -0
- package/dist/_shared/esm/SiteFooter-8075a9bd.js +67 -0
- package/dist/_shared/esm/SiteHeader-c25ee36e.d.ts +78 -0
- package/dist/_shared/esm/SiteHeader.rehydrator-4da8ac64.d.ts +78 -0
- package/dist/_shared/esm/SiteHeader.rehydrator-4da8ac64.js +666 -0
- package/dist/_shared/esm/SubNavItem-a84d1bf4.d.ts +48 -0
- package/dist/_shared/esm/TextInput-1631dbc4.d.ts +10 -0
- package/dist/_shared/esm/TextInput-1631dbc4.js +72 -0
- package/dist/_shared/esm/TextInput-7ed03a48.d.ts +75 -0
- package/dist/_shared/esm/UniversalHeader-7926abde.d.ts +26 -0
- package/dist/_shared/esm/UniversalHeader-7926abde.js +29 -0
- package/dist/_shared/esm/debounce-e228705f.js +542 -0
- package/dist/_shared/esm/index-699086a7.d.ts +2 -0
- package/dist/_shared/esm/index-74488a9f.d.ts +2 -0
- package/dist/_shared/esm/index-c81c9401.d.ts +3 -3
- package/dist/_shared/esm/index-e340924e.d.ts +2 -0
- package/dist/_shared/esm/index-e6d20018.d.ts +3 -0
- package/dist/_shared/esm/index-eb06f640.d.ts +2 -0
- package/dist/_shared/esm/index-f419cf04.d.ts +2 -0
- package/dist/index.es.js +178 -27
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +179 -26
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/Filter/Filter.d.ts +38 -0
- package/dist/types/components/Filter/FilterControls/FilterControl/FilterControl.d.ts +16 -0
- package/dist/types/components/Filter/FilterControls/FilterControls.d.ts +12 -0
- package/dist/types/components/Filter/FilterItems/FilterItem/FilterItem.d.ts +12 -0
- package/dist/types/components/Filter/FilterItems/FilterItems.d.ts +12 -0
- package/dist/types/components/Filter/index.d.ts +1 -0
- package/dist/types/components/FormControl/FormControl.d.ts +4 -0
- package/dist/types/components/Pagination/Pagination.d.ts +19 -0
- package/dist/types/components/Pagination/index.d.ts +1 -0
- package/dist/types/components/PaginationSimple/PaginationSimple.d.ts +27 -0
- package/dist/types/components/PaginationSimple/index.d.ts +1 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/types/components/ScrollToTop/ScrollToTop.d.ts +24 -0
- package/dist/types/components/ScrollToTop/index.d.ts +1 -0
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/Switch/Switch.d.ts +1 -1
- package/dist/types/components/TextArea/TextArea.d.ts +60 -0
- package/dist/types/components/TextArea/index.d.ts +1 -0
- package/dist/types/components/TextInput/TextInput.d.ts +1 -1
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/hooks/use-pagination.d.ts +1 -0
- package/dist/types/styles.d.ts +7 -2
- package/package.json +4 -4
- /package/dist/_shared/cjs/{Button-5dff284a.d.ts → Button-27512fee.d.ts} +0 -0
- /package/dist/_shared/cjs/{DisclosureMini-5af13d3c.d.ts → DisclosureMini-067e0319.d.ts} +0 -0
- /package/dist/_shared/esm/{Button-61241dd0.d.ts → Button-d319fa11.d.ts} +0 -0
- /package/dist/_shared/esm/{DisclosureMini-322fccc0.d.ts → DisclosureMini-022beae3.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { SwitchProps as RadixSwitchProps } from "@radix-ui/react-switch";
|
|
3
|
-
import { FormControlProps } from "../_shared/cjs/FormControl-
|
|
3
|
+
import { FormControlProps } from "../_shared/cjs/FormControl-9aaddd54";
|
|
4
4
|
/** Use `Switch` to toggle between checked and not checked. */
|
|
5
5
|
declare const Switch: FC<SwitchProps>;
|
|
6
|
-
interface SwitchProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "disclosureText" | "disclosureTitle" | "onClickDisclosure" | "helper"> {
|
|
6
|
+
interface SwitchProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "disclosureText" | "disclosureTitle" | "onClickDisclosure" | "helper" | "supplementaryInfo"> {
|
|
7
7
|
/**
|
|
8
8
|
* Hide Label above toggle?
|
|
9
9
|
*/
|
|
@@ -8,14 +8,14 @@ var index_module = require('../_shared/cjs/index.module-af7c85f2.js');
|
|
|
8
8
|
var Icon = require('../_shared/cjs/Icon-9ae8dbe1.js');
|
|
9
9
|
var BtIconTickAlt2Px = require('../_shared/cjs/BtIconTickAlt2Px-bdf06f8c.js');
|
|
10
10
|
var Surface = require('../_shared/cjs/Surface-6da0a78e.js');
|
|
11
|
-
var FormControl = require('../_shared/cjs/FormControl-
|
|
11
|
+
var FormControl = require('../_shared/cjs/FormControl-9aaddd54.js');
|
|
12
12
|
var VerticalSpace = require('../_shared/cjs/VerticalSpace-86f697e7.js');
|
|
13
13
|
var Text = require('../_shared/cjs/Text-6f2827e6.js');
|
|
14
14
|
require('react-dom');
|
|
15
15
|
require('../_shared/cjs/filter-data-attrs-a30dcf5f.js');
|
|
16
16
|
require('../_shared/cjs/suffix-modifier-1ee2da04.js');
|
|
17
17
|
require('../_shared/cjs/BtIconAlert-637db790.js');
|
|
18
|
-
require('../_shared/cjs/DisclosureMini-
|
|
18
|
+
require('../_shared/cjs/DisclosureMini-067e0319.js');
|
|
19
19
|
require('../_shared/cjs/BtIconChevronDown2Px-8fb4e2eb.js');
|
|
20
20
|
|
|
21
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { SwitchProps as RadixSwitchProps } from "@radix-ui/react-switch";
|
|
3
|
-
import { FormControlProps } from "../_shared/esm/FormControl-
|
|
3
|
+
import { FormControlProps } from "../_shared/esm/FormControl-5e3fdca3";
|
|
4
4
|
/** Use `Switch` to toggle between checked and not checked. */
|
|
5
5
|
declare const Switch: FC<SwitchProps>;
|
|
6
|
-
interface SwitchProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "disclosureText" | "disclosureTitle" | "onClickDisclosure" | "helper"> {
|
|
6
|
+
interface SwitchProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "disclosureText" | "disclosureTitle" | "onClickDisclosure" | "helper" | "supplementaryInfo"> {
|
|
7
7
|
/**
|
|
8
8
|
* Hide Label above toggle?
|
|
9
9
|
*/
|
|
@@ -4,14 +4,14 @@ import { g as $9f79659886946c16$export$e5c5a5f917a5871c, $ as $c512c27ab02ef895$
|
|
|
4
4
|
import { I as Icon } from '../_shared/esm/Icon-fd247973.js';
|
|
5
5
|
import { B as BtIconTickAlt2Px_2 } from '../_shared/esm/BtIconTickAlt2Px-da97e9ae.js';
|
|
6
6
|
import { C as Context } from '../_shared/esm/Surface-bb100ef8.js';
|
|
7
|
-
import { F as FormControl } from '../_shared/esm/FormControl-
|
|
7
|
+
import { F as FormControl } from '../_shared/esm/FormControl-5e3fdca3.js';
|
|
8
8
|
import { V as VerticalSpace } from '../_shared/esm/VerticalSpace-93980c9c.js';
|
|
9
9
|
import { T as Text } from '../_shared/esm/Text-00e9743b.js';
|
|
10
10
|
import 'react-dom';
|
|
11
11
|
import '../_shared/esm/filter-data-attrs-afdb7d32.js';
|
|
12
12
|
import '../_shared/esm/suffix-modifier-7e640670.js';
|
|
13
13
|
import '../_shared/esm/BtIconAlert-55a6ed5c.js';
|
|
14
|
-
import '../_shared/esm/DisclosureMini-
|
|
14
|
+
import '../_shared/esm/DisclosureMini-022beae3.js';
|
|
15
15
|
import '../_shared/esm/BtIconChevronDown2Px-782876e2.js';
|
|
16
16
|
|
|
17
17
|
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FormControlProps } from "../_shared/cjs/FormControl-9aaddd54";
|
|
4
|
+
type EventType = React.ChangeEvent<HTMLTextAreaElement>;
|
|
5
|
+
declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
6
|
+
interface TextAreaProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "helperUnderLabel"> {
|
|
7
|
+
/**
|
|
8
|
+
* Uncontrolled default value of the TextArea. If the TextArea is controlled
|
|
9
|
+
* via `value`/`onChange`, `defaultValue` will be ignored.
|
|
10
|
+
*/
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
/**
|
|
13
|
+
* ID for the TextArea.
|
|
14
|
+
*/
|
|
15
|
+
id: string;
|
|
16
|
+
/**
|
|
17
|
+
* Should the control be disabled?
|
|
18
|
+
*/
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Should the control be read-only?
|
|
22
|
+
*/
|
|
23
|
+
isReadOnly?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Should the control be required?
|
|
26
|
+
*/
|
|
27
|
+
isRequired?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Maximum number of characters.
|
|
30
|
+
*/
|
|
31
|
+
maxLength?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Shows the current character count and maxLength. Ignored if maxLength is undefined.
|
|
34
|
+
*/
|
|
35
|
+
showCharacterCount?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Name of the input.
|
|
38
|
+
*/
|
|
39
|
+
name?: string;
|
|
40
|
+
/**
|
|
41
|
+
* `none` will prevent any resizing.
|
|
42
|
+
* `manual` will allow the user to resize the TextArea.
|
|
43
|
+
* `auto` will resize the text area as needed when the user types.
|
|
44
|
+
*/
|
|
45
|
+
resize?: "none" | "manual" | "auto";
|
|
46
|
+
/**
|
|
47
|
+
* Function to call when the TextArea loses focus.
|
|
48
|
+
*/
|
|
49
|
+
onBlur?: (e: EventType) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Callback function commonly used to update the TextArea's controlled
|
|
52
|
+
* `value`, for example `e => setValue(e.target.value)`.
|
|
53
|
+
*/
|
|
54
|
+
onChange?: (e: EventType) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Current value of the TextArea. Must be controlled via an
|
|
57
|
+
* `onChange` callback function. Otherwise, use `defaultValue` (or `isReadOnly`).
|
|
58
|
+
*/
|
|
59
|
+
value?: string;
|
|
60
|
+
}
|
|
61
|
+
export { TextArea };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var filterDataAttrs = require('../_shared/cjs/filter-data-attrs-a30dcf5f.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var index = require('../_shared/cjs/index-45bfb67b.js');
|
|
8
|
+
require('../_shared/cjs/Base-569e4334.js');
|
|
9
|
+
require('../_shared/cjs/Breadcrumbs-8b554370.js');
|
|
10
|
+
var Surface = require('../_shared/cjs/Surface-6da0a78e.js');
|
|
11
|
+
require('../_shared/cjs/Button-27512fee.js');
|
|
12
|
+
require('../_shared/cjs/Card-804ab0e5.js');
|
|
13
|
+
require('../_shared/cjs/Checkbox-21d3c4f6.js');
|
|
14
|
+
require('../_shared/cjs/Columns-e90798f8.js');
|
|
15
|
+
require('../_shared/cjs/Heading-d45f6a7f.js');
|
|
16
|
+
var FormControl = require('../_shared/cjs/FormControl-9aaddd54.js');
|
|
17
|
+
require('../_shared/cjs/Filter-f7d2fbda.js');
|
|
18
|
+
require('../_shared/cjs/Group-d83f8c2e.js');
|
|
19
|
+
require('../_shared/cjs/Image-3bf4b4f3.js');
|
|
20
|
+
require('../_shared/cjs/UniversalHeader-cc1d9e5a.js');
|
|
21
|
+
require('../_shared/cjs/Poster-e05bbe13.js');
|
|
22
|
+
require('../_shared/cjs/RadioGroup-81805ef9.js');
|
|
23
|
+
require('../_shared/cjs/SiteFooter-c540b5f1.js');
|
|
24
|
+
require('../_shared/cjs/SiteHeader.rehydrator-f7fa2efe.js');
|
|
25
|
+
var Text = require('../_shared/cjs/Text-6f2827e6.js');
|
|
26
|
+
require('../_shared/cjs/TextInput-33314fc4.js');
|
|
27
|
+
require('../_shared/cjs/debounce-506538c5.js');
|
|
28
|
+
require('../_shared/cjs/BtIconChevronRight2Px-a8e40136.js');
|
|
29
|
+
require('../_shared/cjs/Icon-9ae8dbe1.js');
|
|
30
|
+
require('../_shared/cjs/suffix-modifier-1ee2da04.js');
|
|
31
|
+
require('../_shared/cjs/handle-link-click-17a44cf4.js');
|
|
32
|
+
require('../_shared/cjs/BtIconChevronLeftMid-df952a3e.js');
|
|
33
|
+
require('../_shared/cjs/BtIconChevronRightMid-5a38d855.js');
|
|
34
|
+
require('../_shared/cjs/BtIconTickAlt2Px-bdf06f8c.js');
|
|
35
|
+
require('../_shared/cjs/BtIconAlert-637db790.js');
|
|
36
|
+
require('../_shared/cjs/DisclosureMini-067e0319.js');
|
|
37
|
+
require('../_shared/cjs/BtIconChevronDown2Px-8fb4e2eb.js');
|
|
38
|
+
require('../_shared/cjs/index.es-77def0c9.js');
|
|
39
|
+
require('../_shared/cjs/BrandLogo-8008f0c4.js');
|
|
40
|
+
require('../_shared/cjs/Curve-b05589d8.js');
|
|
41
|
+
require('../_shared/cjs/Section-48aca5f5.js');
|
|
42
|
+
require('../_shared/cjs/VisuallyHidden-e2c8b291.js');
|
|
43
|
+
|
|
44
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
45
|
+
|
|
46
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
47
|
+
|
|
48
|
+
var TextArea = React.forwardRef(function (_a, ref) {
|
|
49
|
+
var _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, _c = _a.resize, resize = _c === void 0 ? "manual" : _c, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isReadOnly, isReadOnly = _e === void 0 ? false : _e, _f = _a.isRequired, isRequired = _f === void 0 ? false : _f, _g = _a.showCharacterCount, showCharacterCount = _g === void 0 ? true : _g, label = _a.label, _h = _a.labelSize, labelSize = _h === void 0 ? "l" : _h, maxLength = _a.maxLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, props = filterDataAttrs.__rest(_a, ["defaultValue", "errorMessage", "helper", "id", "resize", "isDisabled", "isReadOnly", "isRequired", "showCharacterCount", "label", "labelSize", "maxLength", "name", "onBlur", "onChange", "onClickDisclosure", "value", "disclosureTitle", "disclosureText"]);
|
|
50
|
+
var surface = React.useContext(Surface.Context).surface;
|
|
51
|
+
var ourRef = React.useRef(null);
|
|
52
|
+
var _j = React.useState((value && value.length) || (defaultValue && defaultValue.length) || 0), characterCount = _j[0], setCharacterCount = _j[1];
|
|
53
|
+
var setSmartHeight = function (el) {
|
|
54
|
+
el.style.height = "auto";
|
|
55
|
+
el.style.height = "".concat(parseInt(getComputedStyle(el).getPropertyValue("border-width")) *
|
|
56
|
+
2 +
|
|
57
|
+
el.scrollHeight, "px");
|
|
58
|
+
};
|
|
59
|
+
var getTextAreaRef = function (elementRef) {
|
|
60
|
+
ourRef.current = elementRef;
|
|
61
|
+
if (ref && typeof ref === "object") {
|
|
62
|
+
ref.current = elementRef;
|
|
63
|
+
}
|
|
64
|
+
if (ref && typeof ref === "function") {
|
|
65
|
+
ref(elementRef);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var handleOnChange = function (e) {
|
|
69
|
+
resize === "auto" && ourRef.current && setSmartHeight(ourRef.current);
|
|
70
|
+
onChange && onChange(e);
|
|
71
|
+
setCharacterCount(e.target.value.length);
|
|
72
|
+
};
|
|
73
|
+
return (React__default["default"].createElement(FormControl.FormControl, filterDataAttrs.__assign({ errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure, supplementaryInfo: maxLength &&
|
|
74
|
+
showCharacterCount && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
75
|
+
React__default["default"].createElement(Text.Text, { tone: isDisabled ? "muted" : "default" },
|
|
76
|
+
React__default["default"].createElement("span", { className: "arc-TextArea-characterCount" },
|
|
77
|
+
characterCount,
|
|
78
|
+
" / ",
|
|
79
|
+
maxLength)))) }, filterDataAttrs.filterDataAttrs(props)),
|
|
80
|
+
React__default["default"].createElement("textarea", { id: id, className: index.classNames("arc-TextArea", {
|
|
81
|
+
"arc-TextArea--noResize": resize !== "manual",
|
|
82
|
+
"arc-TextArea--onDarkSurface": surface === "dark",
|
|
83
|
+
"arc-TextArea--invalid": errorMessage
|
|
84
|
+
}), defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, value: value, readOnly: isReadOnly, maxLength: maxLength, name: name, onChange: handleOnChange, onBlur: onBlur, ref: getTextAreaRef })));
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
exports.TextArea = TextArea;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FormControlProps } from "../_shared/esm/FormControl-5e3fdca3";
|
|
4
|
+
type EventType = React.ChangeEvent<HTMLTextAreaElement>;
|
|
5
|
+
declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
6
|
+
interface TextAreaProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "helperUnderLabel"> {
|
|
7
|
+
/**
|
|
8
|
+
* Uncontrolled default value of the TextArea. If the TextArea is controlled
|
|
9
|
+
* via `value`/`onChange`, `defaultValue` will be ignored.
|
|
10
|
+
*/
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
/**
|
|
13
|
+
* ID for the TextArea.
|
|
14
|
+
*/
|
|
15
|
+
id: string;
|
|
16
|
+
/**
|
|
17
|
+
* Should the control be disabled?
|
|
18
|
+
*/
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Should the control be read-only?
|
|
22
|
+
*/
|
|
23
|
+
isReadOnly?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Should the control be required?
|
|
26
|
+
*/
|
|
27
|
+
isRequired?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Maximum number of characters.
|
|
30
|
+
*/
|
|
31
|
+
maxLength?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Shows the current character count and maxLength. Ignored if maxLength is undefined.
|
|
34
|
+
*/
|
|
35
|
+
showCharacterCount?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Name of the input.
|
|
38
|
+
*/
|
|
39
|
+
name?: string;
|
|
40
|
+
/**
|
|
41
|
+
* `none` will prevent any resizing.
|
|
42
|
+
* `manual` will allow the user to resize the TextArea.
|
|
43
|
+
* `auto` will resize the text area as needed when the user types.
|
|
44
|
+
*/
|
|
45
|
+
resize?: "none" | "manual" | "auto";
|
|
46
|
+
/**
|
|
47
|
+
* Function to call when the TextArea loses focus.
|
|
48
|
+
*/
|
|
49
|
+
onBlur?: (e: EventType) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Callback function commonly used to update the TextArea's controlled
|
|
52
|
+
* `value`, for example `e => setValue(e.target.value)`.
|
|
53
|
+
*/
|
|
54
|
+
onChange?: (e: EventType) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Current value of the TextArea. Must be controlled via an
|
|
57
|
+
* `onChange` callback function. Otherwise, use `defaultValue` (or `isReadOnly`).
|
|
58
|
+
*/
|
|
59
|
+
value?: string;
|
|
60
|
+
}
|
|
61
|
+
export { TextArea };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/esm/filter-data-attrs-afdb7d32.js';
|
|
2
|
+
import React__default, { forwardRef, useContext, useRef, useState } from 'react';
|
|
3
|
+
import { c as classNames } from '../_shared/esm/index-2ae58626.js';
|
|
4
|
+
import '../_shared/esm/Base-6c01e0ec.js';
|
|
5
|
+
import '../_shared/esm/Breadcrumbs-04590057.js';
|
|
6
|
+
import { C as Context } from '../_shared/esm/Surface-bb100ef8.js';
|
|
7
|
+
import '../_shared/esm/Button-d319fa11.js';
|
|
8
|
+
import '../_shared/esm/Card-e79eb6c8.js';
|
|
9
|
+
import '../_shared/esm/Checkbox-94300d8c.js';
|
|
10
|
+
import '../_shared/esm/Columns-8704515b.js';
|
|
11
|
+
import '../_shared/esm/Heading-b61432fb.js';
|
|
12
|
+
import { F as FormControl } from '../_shared/esm/FormControl-5e3fdca3.js';
|
|
13
|
+
import '../_shared/esm/Filter-41b391e3.js';
|
|
14
|
+
import '../_shared/esm/Group-d62c3f56.js';
|
|
15
|
+
import '../_shared/esm/Image-3596ce55.js';
|
|
16
|
+
import '../_shared/esm/UniversalHeader-7926abde.js';
|
|
17
|
+
import '../_shared/esm/Poster-107d6954.js';
|
|
18
|
+
import '../_shared/esm/RadioGroup-1fd0f389.js';
|
|
19
|
+
import '../_shared/esm/SiteFooter-8075a9bd.js';
|
|
20
|
+
import '../_shared/esm/SiteHeader.rehydrator-4da8ac64.js';
|
|
21
|
+
import { T as Text } from '../_shared/esm/Text-00e9743b.js';
|
|
22
|
+
import '../_shared/esm/TextInput-1631dbc4.js';
|
|
23
|
+
import '../_shared/esm/debounce-e228705f.js';
|
|
24
|
+
import '../_shared/esm/BtIconChevronRight2Px-b8e7b4ad.js';
|
|
25
|
+
import '../_shared/esm/Icon-fd247973.js';
|
|
26
|
+
import '../_shared/esm/suffix-modifier-7e640670.js';
|
|
27
|
+
import '../_shared/esm/handle-link-click-f64f55a2.js';
|
|
28
|
+
import '../_shared/esm/BtIconChevronLeftMid-9f4f3a3d.js';
|
|
29
|
+
import '../_shared/esm/BtIconChevronRightMid-d9b11761.js';
|
|
30
|
+
import '../_shared/esm/BtIconTickAlt2Px-da97e9ae.js';
|
|
31
|
+
import '../_shared/esm/BtIconAlert-55a6ed5c.js';
|
|
32
|
+
import '../_shared/esm/DisclosureMini-022beae3.js';
|
|
33
|
+
import '../_shared/esm/BtIconChevronDown2Px-782876e2.js';
|
|
34
|
+
import '../_shared/esm/index.es-00cb3bcb.js';
|
|
35
|
+
import '../_shared/esm/BrandLogo-56699561.js';
|
|
36
|
+
import '../_shared/esm/Curve-3e87b1bc.js';
|
|
37
|
+
import '../_shared/esm/Section-b8038d66.js';
|
|
38
|
+
import '../_shared/esm/VisuallyHidden-b9eebf71.js';
|
|
39
|
+
|
|
40
|
+
var TextArea = forwardRef(function (_a, ref) {
|
|
41
|
+
var _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, _c = _a.resize, resize = _c === void 0 ? "manual" : _c, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isReadOnly, isReadOnly = _e === void 0 ? false : _e, _f = _a.isRequired, isRequired = _f === void 0 ? false : _f, _g = _a.showCharacterCount, showCharacterCount = _g === void 0 ? true : _g, label = _a.label, _h = _a.labelSize, labelSize = _h === void 0 ? "l" : _h, maxLength = _a.maxLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "id", "resize", "isDisabled", "isReadOnly", "isRequired", "showCharacterCount", "label", "labelSize", "maxLength", "name", "onBlur", "onChange", "onClickDisclosure", "value", "disclosureTitle", "disclosureText"]);
|
|
42
|
+
var surface = useContext(Context).surface;
|
|
43
|
+
var ourRef = useRef(null);
|
|
44
|
+
var _j = useState((value && value.length) || (defaultValue && defaultValue.length) || 0), characterCount = _j[0], setCharacterCount = _j[1];
|
|
45
|
+
var setSmartHeight = function (el) {
|
|
46
|
+
el.style.height = "auto";
|
|
47
|
+
el.style.height = "".concat(parseInt(getComputedStyle(el).getPropertyValue("border-width")) *
|
|
48
|
+
2 +
|
|
49
|
+
el.scrollHeight, "px");
|
|
50
|
+
};
|
|
51
|
+
var getTextAreaRef = function (elementRef) {
|
|
52
|
+
ourRef.current = elementRef;
|
|
53
|
+
if (ref && typeof ref === "object") {
|
|
54
|
+
ref.current = elementRef;
|
|
55
|
+
}
|
|
56
|
+
if (ref && typeof ref === "function") {
|
|
57
|
+
ref(elementRef);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
var handleOnChange = function (e) {
|
|
61
|
+
resize === "auto" && ourRef.current && setSmartHeight(ourRef.current);
|
|
62
|
+
onChange && onChange(e);
|
|
63
|
+
setCharacterCount(e.target.value.length);
|
|
64
|
+
};
|
|
65
|
+
return (React__default.createElement(FormControl, __assign({ errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure, supplementaryInfo: maxLength &&
|
|
66
|
+
showCharacterCount && (React__default.createElement(React__default.Fragment, null,
|
|
67
|
+
React__default.createElement(Text, { tone: isDisabled ? "muted" : "default" },
|
|
68
|
+
React__default.createElement("span", { className: "arc-TextArea-characterCount" },
|
|
69
|
+
characterCount,
|
|
70
|
+
" / ",
|
|
71
|
+
maxLength)))) }, filterDataAttrs(props)),
|
|
72
|
+
React__default.createElement("textarea", { id: id, className: classNames("arc-TextArea", {
|
|
73
|
+
"arc-TextArea--noResize": resize !== "manual",
|
|
74
|
+
"arc-TextArea--onDarkSurface": surface === "dark",
|
|
75
|
+
"arc-TextArea--invalid": errorMessage
|
|
76
|
+
}), defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, value: value, readOnly: isReadOnly, maxLength: maxLength, name: name, onChange: handleOnChange, onBlur: onBlur, ref: getTextAreaRef })));
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export { TextArea };
|
|
@@ -1,75 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { FC } from "react";
|
|
4
|
-
import { FormControlProps } from "../_shared/cjs/FormControl-42360ae8";
|
|
5
|
-
type EventType = React.ChangeEvent<HTMLInputElement>;
|
|
6
|
-
/**
|
|
7
|
-
* Use `TextInput` to allow custom user text entry with a keyboard.
|
|
8
|
-
*/
|
|
9
|
-
declare const TextInput: FC<TextInputProps>;
|
|
10
|
-
interface TextInputProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "helperUnderLabel"> {
|
|
11
|
-
/**
|
|
12
|
-
* Uncontrolled default value of the TextInput. If the TextInput is controlled
|
|
13
|
-
* via `value`/`onChange`, `defaultValue` will be ignored.
|
|
14
|
-
*/
|
|
15
|
-
defaultValue?: string;
|
|
16
|
-
/**
|
|
17
|
-
* ID for the TextInput.
|
|
18
|
-
*/
|
|
19
|
-
id: string;
|
|
20
|
-
/**
|
|
21
|
-
* Mode for the input. If not defined, inferred by type.
|
|
22
|
-
*/
|
|
23
|
-
inputMode?: "email" | "numeric" | "tel" | "url";
|
|
24
|
-
/**
|
|
25
|
-
* Should the control be disabled?
|
|
26
|
-
*/
|
|
27
|
-
isDisabled?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Should the control be read-only?
|
|
30
|
-
*/
|
|
31
|
-
isReadOnly?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Should the control be required?
|
|
34
|
-
*/
|
|
35
|
-
isRequired?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Maximum number of characters.
|
|
38
|
-
*/
|
|
39
|
-
maxLength?: number;
|
|
40
|
-
/**
|
|
41
|
-
* Minimum number of characters.
|
|
42
|
-
*/
|
|
43
|
-
minLength?: number;
|
|
44
|
-
/**
|
|
45
|
-
* Name of the input.
|
|
46
|
-
*/
|
|
47
|
-
name?: string;
|
|
48
|
-
/**
|
|
49
|
-
* Function to call when the TextInput loses focus.
|
|
50
|
-
*/
|
|
51
|
-
onBlur?: (e: EventType) => void;
|
|
52
|
-
/**
|
|
53
|
-
* Callback function commonly used to update the TextInput's controlled
|
|
54
|
-
* `value`, for example `e => setValue(e.target.value)`.
|
|
55
|
-
*/
|
|
56
|
-
onChange?: (e: EventType) => void;
|
|
57
|
-
/**
|
|
58
|
-
* Validation regex pattern.
|
|
59
|
-
*/
|
|
60
|
-
pattern?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Enable button to toggle TextInput type from `Selected Type` to `Text`
|
|
63
|
-
*/
|
|
64
|
-
showPassword?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Type for the input. `number` will be changed to `text` and set the `numeric` inputMode.
|
|
67
|
-
*/
|
|
68
|
-
type?: "email" | "number" | "password" | "tel" | "text" | "url";
|
|
69
|
-
/**
|
|
70
|
-
* Current value of the TextInput. Must be controlled via an
|
|
71
|
-
* `onChange` callback function. Otherwise, use `defaultValue` (or `isReadOnly`).
|
|
72
|
-
*/
|
|
73
|
-
value?: string;
|
|
74
|
-
}
|
|
75
|
-
export { TextInput };
|
|
1
|
+
export { TextInput } from "../_shared/cjs/TextInput-7ed03a48";
|
|
@@ -2,85 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var VisuallyHidden = require('../_shared/cjs/VisuallyHidden-e2c8b291.js');
|
|
5
|
+
var TextInput = require('../_shared/cjs/TextInput-33314fc4.js');
|
|
6
|
+
require('../_shared/cjs/filter-data-attrs-a30dcf5f.js');
|
|
7
|
+
require('../_shared/cjs/index-45bfb67b.js');
|
|
8
|
+
require('react');
|
|
9
|
+
require('../_shared/cjs/FormControl-9aaddd54.js');
|
|
11
10
|
require('../_shared/cjs/BtIconAlert-637db790.js');
|
|
12
|
-
require('../_shared/cjs/
|
|
11
|
+
require('../_shared/cjs/Surface-6da0a78e.js');
|
|
12
|
+
require('../_shared/cjs/DisclosureMini-067e0319.js');
|
|
13
13
|
require('../_shared/cjs/BtIconChevronDown2Px-8fb4e2eb.js');
|
|
14
14
|
require('../_shared/cjs/Text-6f2827e6.js');
|
|
15
15
|
require('../_shared/cjs/suffix-modifier-1ee2da04.js');
|
|
16
|
-
require('../_shared/cjs/
|
|
16
|
+
require('../_shared/cjs/VisuallyHidden-e2c8b291.js');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
18
|
|
|
20
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
* Infer the correct inputMode, pattern and type if specifying a `number` type.
|
|
24
|
-
*/
|
|
25
|
-
var useNumericInput = function (props) {
|
|
26
|
-
var type = props.type === "number" ? "text" : props.type;
|
|
27
|
-
var inputMode = props.inputMode;
|
|
28
|
-
if (!props.inputMode) {
|
|
29
|
-
if (props.type === "email") {
|
|
30
|
-
inputMode = "email";
|
|
31
|
-
}
|
|
32
|
-
else if (props.type === "number") {
|
|
33
|
-
inputMode = "numeric";
|
|
34
|
-
}
|
|
35
|
-
else if (props.type === "tel") {
|
|
36
|
-
inputMode = "tel";
|
|
37
|
-
}
|
|
38
|
-
else if (props.type === "url") {
|
|
39
|
-
inputMode = "url";
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
var pattern = props.pattern;
|
|
43
|
-
if (!props.pattern && props.type === "number") {
|
|
44
|
-
pattern = "[0-9]*";
|
|
45
|
-
}
|
|
46
|
-
return { inputMode: inputMode, pattern: pattern, type: type };
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Use `TextInput` to allow custom user text entry with a keyboard.
|
|
51
|
-
*/
|
|
52
|
-
var TextInput = React.forwardRef(function (_a, ref) {
|
|
53
|
-
var _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, inputMode = _a.inputMode, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isReadOnly, isReadOnly = _d === void 0 ? false : _d, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, label = _a.label, _f = _a.labelSize, labelSize = _f === void 0 ? "l" : _f, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, pattern = _a.pattern, _g = _a.type, type = _g === void 0 ? "text" : _g, _h = _a.showPassword, showPassword = _h === void 0 ? false : _h, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, props = filterDataAttrs.__rest(_a, ["defaultValue", "errorMessage", "helper", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText"]);
|
|
54
|
-
var surface = React.useContext(Surface.Context).surface;
|
|
55
|
-
var _j = React.useState(false), showPasswordToggle = _j[0], setShowPasswordToggle = _j[1];
|
|
56
|
-
var inferredInputProps = useNumericInput({
|
|
57
|
-
inputMode: inputMode,
|
|
58
|
-
pattern: pattern,
|
|
59
|
-
type: showPasswordToggle ? "text" : type
|
|
60
|
-
});
|
|
61
|
-
// Although this is used within FormControlWrapper, it's deterministic so we can call it here too
|
|
62
|
-
var ariaDescribedby = FormControl.useAriaDescribedby({
|
|
63
|
-
errorMessage: errorMessage,
|
|
64
|
-
id: id,
|
|
65
|
-
helper: helper,
|
|
66
|
-
disclosureText: disclosureText
|
|
67
|
-
}).ariaDescribedby;
|
|
68
|
-
return (React__default["default"].createElement("div", filterDataAttrs.__assign({ className: index.classNames({
|
|
69
|
-
"arc-TextInput": true,
|
|
70
|
-
"arc-TextInput--withPasswordToggle": showPassword,
|
|
71
|
-
"arc-TextInput--invalid": errorMessage,
|
|
72
|
-
"arc-TextInput--onDarkSurface": surface === "dark"
|
|
73
|
-
}) }, filterDataAttrs.filterDataAttrs(props)),
|
|
74
|
-
React__default["default"].createElement(FormControl.FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure },
|
|
75
|
-
React__default["default"].createElement("div", { className: "arc-TextInput-inputWrapper" },
|
|
76
|
-
React__default["default"].createElement("input", filterDataAttrs.__assign({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-TextInput-input", defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, id: id, maxLength: maxLength, minLength: minLength, name: name, onChange: onChange, onBlur: onBlur, readOnly: isReadOnly, ref: ref, required: isRequired, value: typeof value !== "undefined" ? value : undefined }, inferredInputProps)),
|
|
77
|
-
showPassword && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
78
|
-
React__default["default"].createElement("button", { className: "arc-TextInput-passwordToggle", onClick: function () { return setShowPasswordToggle(function (p) { return !p; }); }, type: "button" }, showPasswordToggle ? "Hide" : "Show"),
|
|
79
|
-
React__default["default"].createElement(VisuallyHidden.VisuallyHidden, null,
|
|
80
|
-
React__default["default"].createElement("div", { "aria-live": "polite" },
|
|
81
|
-
React__default["default"].createElement("p", null, showPasswordToggle
|
|
82
|
-
? "Your password is shown"
|
|
83
|
-
: "Your password is hidden")))))))));
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
exports.TextInput = TextInput;
|
|
20
|
+
exports.TextInput = TextInput.TextInput;
|
|
@@ -1,75 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { FC } from "react";
|
|
4
|
-
import { FormControlProps } from "../_shared/esm/FormControl-0744f93f";
|
|
5
|
-
type EventType = React.ChangeEvent<HTMLInputElement>;
|
|
6
|
-
/**
|
|
7
|
-
* Use `TextInput` to allow custom user text entry with a keyboard.
|
|
8
|
-
*/
|
|
9
|
-
declare const TextInput: FC<TextInputProps>;
|
|
10
|
-
interface TextInputProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "helperUnderLabel"> {
|
|
11
|
-
/**
|
|
12
|
-
* Uncontrolled default value of the TextInput. If the TextInput is controlled
|
|
13
|
-
* via `value`/`onChange`, `defaultValue` will be ignored.
|
|
14
|
-
*/
|
|
15
|
-
defaultValue?: string;
|
|
16
|
-
/**
|
|
17
|
-
* ID for the TextInput.
|
|
18
|
-
*/
|
|
19
|
-
id: string;
|
|
20
|
-
/**
|
|
21
|
-
* Mode for the input. If not defined, inferred by type.
|
|
22
|
-
*/
|
|
23
|
-
inputMode?: "email" | "numeric" | "tel" | "url";
|
|
24
|
-
/**
|
|
25
|
-
* Should the control be disabled?
|
|
26
|
-
*/
|
|
27
|
-
isDisabled?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Should the control be read-only?
|
|
30
|
-
*/
|
|
31
|
-
isReadOnly?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Should the control be required?
|
|
34
|
-
*/
|
|
35
|
-
isRequired?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Maximum number of characters.
|
|
38
|
-
*/
|
|
39
|
-
maxLength?: number;
|
|
40
|
-
/**
|
|
41
|
-
* Minimum number of characters.
|
|
42
|
-
*/
|
|
43
|
-
minLength?: number;
|
|
44
|
-
/**
|
|
45
|
-
* Name of the input.
|
|
46
|
-
*/
|
|
47
|
-
name?: string;
|
|
48
|
-
/**
|
|
49
|
-
* Function to call when the TextInput loses focus.
|
|
50
|
-
*/
|
|
51
|
-
onBlur?: (e: EventType) => void;
|
|
52
|
-
/**
|
|
53
|
-
* Callback function commonly used to update the TextInput's controlled
|
|
54
|
-
* `value`, for example `e => setValue(e.target.value)`.
|
|
55
|
-
*/
|
|
56
|
-
onChange?: (e: EventType) => void;
|
|
57
|
-
/**
|
|
58
|
-
* Validation regex pattern.
|
|
59
|
-
*/
|
|
60
|
-
pattern?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Enable button to toggle TextInput type from `Selected Type` to `Text`
|
|
63
|
-
*/
|
|
64
|
-
showPassword?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Type for the input. `number` will be changed to `text` and set the `numeric` inputMode.
|
|
67
|
-
*/
|
|
68
|
-
type?: "email" | "number" | "password" | "tel" | "text" | "url";
|
|
69
|
-
/**
|
|
70
|
-
* Current value of the TextInput. Must be controlled via an
|
|
71
|
-
* `onChange` callback function. Otherwise, use `defaultValue` (or `isReadOnly`).
|
|
72
|
-
*/
|
|
73
|
-
value?: string;
|
|
74
|
-
}
|
|
75
|
-
export { TextInput };
|
|
1
|
+
export { TextInput } from "../_shared/esm/TextInput-7ed03a48";
|