@iabbb/bds-react 0.46.6 → 0.47.1
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/Button/index.cjs +22 -34
- package/Button/index.cjs.map +1 -1
- package/Button/index.mjs +22 -34
- package/Button/index.mjs.map +1 -1
- package/CallToAction/index.cjs +22 -34
- package/CallToAction/index.cjs.map +1 -1
- package/CallToAction/index.mjs +22 -34
- package/CallToAction/index.mjs.map +1 -1
- package/ErrorMessage/index.cjs +22 -34
- package/ErrorMessage/index.cjs.map +1 -1
- package/ErrorMessage/index.mjs +22 -34
- package/ErrorMessage/index.mjs.map +1 -1
- package/ErrorSummary/index.cjs +22 -34
- package/ErrorSummary/index.cjs.map +1 -1
- package/ErrorSummary/index.mjs +22 -34
- package/ErrorSummary/index.mjs.map +1 -1
- package/FieldCheckbox/index.cjs +43 -56
- package/FieldCheckbox/index.cjs.map +1 -1
- package/FieldCheckbox/index.mjs +43 -56
- package/FieldCheckbox/index.mjs.map +1 -1
- package/FieldRadio/index.cjs +43 -56
- package/FieldRadio/index.cjs.map +1 -1
- package/FieldRadio/index.mjs +43 -56
- package/FieldRadio/index.mjs.map +1 -1
- package/FieldSelect/FieldSelect.d.ts +10 -0
- package/FieldSelect/index.cjs +110 -0
- package/FieldSelect/index.cjs.map +1 -0
- package/FieldSelect/index.d.ts +1 -0
- package/FieldSelect/index.mjs +87 -0
- package/FieldSelect/index.mjs.map +1 -0
- package/FieldSelect/package.json +7 -0
- package/FieldTextInput/index.cjs +22 -34
- package/FieldTextInput/index.cjs.map +1 -1
- package/FieldTextInput/index.mjs +22 -34
- package/FieldTextInput/index.mjs.map +1 -1
- package/FieldTextarea/index.cjs +22 -34
- package/FieldTextarea/index.cjs.map +1 -1
- package/FieldTextarea/index.mjs +22 -34
- package/FieldTextarea/index.mjs.map +1 -1
- package/Fieldset/index.cjs +22 -34
- package/Fieldset/index.cjs.map +1 -1
- package/Fieldset/index.mjs +22 -34
- package/Fieldset/index.mjs.map +1 -1
- package/Pagination/index.cjs +43 -56
- package/Pagination/index.cjs.map +1 -1
- package/Pagination/index.mjs +43 -56
- package/Pagination/index.mjs.map +1 -1
- package/Typography/index.cjs +22 -34
- package/Typography/index.cjs.map +1 -1
- package/Typography/index.mjs +22 -34
- package/Typography/index.mjs.map +1 -1
- package/index.cjs +43 -56
- package/index.cjs.map +1 -1
- package/index.mjs +43 -56
- package/index.mjs.map +1 -1
- package/package.json +10 -10
package/FieldRadio/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/FieldRadio/FieldRadio.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport type FieldRadioProps = {\n label: React.ReactNode | string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldRadio = React.forwardRef<HTMLInputElement, FieldRadioProps>(({ id, label, ...props }, ref) => {\n const [isEnhanced, setIsEnhanced] = React.useState(false);\n\n const fallbackId = React.useId();\n\n const inputId = id ?? fallbackId;\n\n React.useEffect(() => {\n setIsEnhanced(true);\n }, []);\n\n return (\n <div className=\"bds-form-group\">\n <div className=\"bds-radio\" data-enhanced={isEnhanced ? '' : undefined}>\n <input {...props} id={inputId} ref={ref} type=\"radio\" />\n {isEnhanced && (\n <svg width=\"32\" height=\"32\" viewBox=\"-2 -2 40 40\" aria-hidden=\"true\" focusable=\"false\">\n <circle\n className=\"background\"\n cx=\"18\"\n cy=\"18\"\n r=\"18\"\n stroke=\"currentColor\"\n fill=\"none\"\n strokeWidth=\"1\"\n vectorEffect=\"non-scaling-stroke\"\n />\n <circle className=\"radio\" cx=\"18\" cy=\"18\" r=\"12\" fill=\"currentColor\" />\n </svg>\n )}\n <label htmlFor={inputId}>{label}</label>\n </div>\n </div>\n );\n});\n\nexport default FieldRadio;\n"],"names":["FieldRadio","React","forwardRef","_ref","ref","id","label","props","_objectWithoutProperties","_excluded","_React$useState","useState","_React$useState2","_slicedToArray","isEnhanced","setIsEnhanced","fallbackId","useId","inputId","useEffect","createElement","className","undefined","_extends","type","width","height","viewBox","focusable","cx","cy","r","stroke","fill","strokeWidth","vectorEffect","htmlFor"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/FieldRadio/FieldRadio.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport type FieldRadioProps = {\n label: React.ReactNode | string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldRadio = React.forwardRef<HTMLInputElement, FieldRadioProps>(({ id, label, ...props }, ref) => {\n const [isEnhanced, setIsEnhanced] = React.useState(false);\n\n const fallbackId = React.useId();\n\n const inputId = id ?? fallbackId;\n\n React.useEffect(() => {\n setIsEnhanced(true);\n }, []);\n\n return (\n <div className=\"bds-form-group\">\n <div className=\"bds-radio\" data-enhanced={isEnhanced ? '' : undefined}>\n <input {...props} id={inputId} ref={ref} type=\"radio\" />\n {isEnhanced && (\n <svg width=\"32\" height=\"32\" viewBox=\"-2 -2 40 40\" aria-hidden=\"true\" focusable=\"false\">\n <circle\n className=\"background\"\n cx=\"18\"\n cy=\"18\"\n r=\"18\"\n stroke=\"currentColor\"\n fill=\"none\"\n strokeWidth=\"1\"\n vectorEffect=\"non-scaling-stroke\"\n />\n <circle className=\"radio\" cx=\"18\" cy=\"18\" r=\"12\" fill=\"currentColor\" />\n </svg>\n )}\n <label htmlFor={inputId}>{label}</label>\n </div>\n </div>\n );\n});\n\nexport default FieldRadio;\n"],"names":["FieldRadio","React","forwardRef","_ref","ref","id","label","props","_objectWithoutProperties","_excluded","_React$useState","useState","_React$useState2","_slicedToArray","isEnhanced","setIsEnhanced","fallbackId","useId","inputId","useEffect","createElement","className","undefined","_extends","type","width","height","viewBox","focusable","cx","cy","r","stroke","fill","strokeWidth","vectorEffect","htmlFor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EACvDV,UAAU,iBACTb,gBAAA,CAAAmB,aAAA,CAAA,KAAA,EAAA;AAAKK,IAAAA,KAAK,EAAC,IAAI;AAACC,IAAAA,MAAM,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAC,aAAa;AAAC,IAAA,aAAA,EAAY,MAAM;AAACC,IAAAA,SAAS,EAAC,OAAA;GAC7E3B,eAAAA,gBAAA,CAAAmB,aAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,YAAY;AACtBQ,IAAAA,EAAE,EAAC,IAAI;AACPC,IAAAA,EAAE,EAAC,IAAI;AACPC,IAAAA,CAAC,EAAC,IAAI;AACNC,IAAAA,MAAM,EAAC,cAAc;AACrBC,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,WAAW,EAAC,GAAG;AACfC,IAAAA,YAAY,EAAC,oBAAA;AAAoB,GAClC,CAAC,eACFlC,gBAAA,CAAAmB,aAAA,CAAA,QAAA,EAAA;AAAQC,IAAAA,SAAS,EAAC,OAAO;AAACQ,IAAAA,EAAE,EAAC,IAAI;AAACC,IAAAA,EAAE,EAAC,IAAI;AAACC,IAAAA,CAAC,EAAC,IAAI;AAACE,IAAAA,IAAI,EAAC,cAAA;AAAc,GAAE,CACnE,CACN,eACDhC,gBAAA,CAAAmB,aAAA,CAAA,OAAA,EAAA;AAAOgB,IAAAA,OAAO,EAAElB,OAAAA;GAAUZ,EAAAA,KAAa,CACpC,CACF,CAAC,CAAA;AAEV,CAAC;;;;"}
|
package/FieldRadio/index.mjs
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
+
function _arrayLikeToArray(r, a) {
|
|
4
|
+
(null == a || a > r.length) && (a = r.length);
|
|
5
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
6
|
+
return n;
|
|
7
|
+
}
|
|
8
|
+
function _arrayWithHoles(r) {
|
|
9
|
+
if (Array.isArray(r)) return r;
|
|
10
|
+
}
|
|
11
|
+
function _extends() {
|
|
12
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
13
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
14
|
+
var t = arguments[e];
|
|
15
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
16
|
+
}
|
|
17
|
+
return n;
|
|
18
|
+
}, _extends.apply(null, arguments);
|
|
19
|
+
}
|
|
3
20
|
function _iterableToArrayLimit(r, l) {
|
|
4
21
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
5
22
|
if (null != t) {
|
|
@@ -24,68 +41,38 @@ function _iterableToArrayLimit(r, l) {
|
|
|
24
41
|
return a;
|
|
25
42
|
}
|
|
26
43
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
30
|
-
var source = arguments[i];
|
|
31
|
-
for (var key in source) {
|
|
32
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
33
|
-
target[key] = source[key];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return target;
|
|
38
|
-
};
|
|
39
|
-
return _extends.apply(this, arguments);
|
|
40
|
-
}
|
|
41
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
42
|
-
if (source == null) return {};
|
|
43
|
-
var target = {};
|
|
44
|
-
var sourceKeys = Object.keys(source);
|
|
45
|
-
var key, i;
|
|
46
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
47
|
-
key = sourceKeys[i];
|
|
48
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
49
|
-
target[key] = source[key];
|
|
50
|
-
}
|
|
51
|
-
return target;
|
|
44
|
+
function _nonIterableRest() {
|
|
45
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
52
46
|
}
|
|
53
|
-
function _objectWithoutProperties(
|
|
54
|
-
if (
|
|
55
|
-
var
|
|
56
|
-
|
|
47
|
+
function _objectWithoutProperties(e, t) {
|
|
48
|
+
if (null == e) return {};
|
|
49
|
+
var o,
|
|
50
|
+
r,
|
|
51
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
57
52
|
if (Object.getOwnPropertySymbols) {
|
|
58
|
-
var
|
|
59
|
-
for (
|
|
60
|
-
key = sourceSymbolKeys[i];
|
|
61
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
62
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
|
-
target[key] = source[key];
|
|
64
|
-
}
|
|
53
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
54
|
+
for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
65
55
|
}
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
function _slicedToArray(arr, i) {
|
|
69
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
70
|
-
}
|
|
71
|
-
function _arrayWithHoles(arr) {
|
|
72
|
-
if (Array.isArray(arr)) return arr;
|
|
56
|
+
return i;
|
|
73
57
|
}
|
|
74
|
-
function
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
var n
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
58
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
59
|
+
if (null == r) return {};
|
|
60
|
+
var t = {};
|
|
61
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
62
|
+
if (e.indexOf(n) >= 0) continue;
|
|
63
|
+
t[n] = r[n];
|
|
64
|
+
}
|
|
65
|
+
return t;
|
|
81
66
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
84
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
85
|
-
return arr2;
|
|
67
|
+
function _slicedToArray(r, e) {
|
|
68
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
86
69
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
70
|
+
function _unsupportedIterableToArray(r, a) {
|
|
71
|
+
if (r) {
|
|
72
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
73
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
74
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
75
|
+
}
|
|
89
76
|
}
|
|
90
77
|
|
|
91
78
|
var _excluded = ["id", "label"];
|
package/FieldRadio/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/FieldRadio/FieldRadio.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport type FieldRadioProps = {\n label: React.ReactNode | string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldRadio = React.forwardRef<HTMLInputElement, FieldRadioProps>(({ id, label, ...props }, ref) => {\n const [isEnhanced, setIsEnhanced] = React.useState(false);\n\n const fallbackId = React.useId();\n\n const inputId = id ?? fallbackId;\n\n React.useEffect(() => {\n setIsEnhanced(true);\n }, []);\n\n return (\n <div className=\"bds-form-group\">\n <div className=\"bds-radio\" data-enhanced={isEnhanced ? '' : undefined}>\n <input {...props} id={inputId} ref={ref} type=\"radio\" />\n {isEnhanced && (\n <svg width=\"32\" height=\"32\" viewBox=\"-2 -2 40 40\" aria-hidden=\"true\" focusable=\"false\">\n <circle\n className=\"background\"\n cx=\"18\"\n cy=\"18\"\n r=\"18\"\n stroke=\"currentColor\"\n fill=\"none\"\n strokeWidth=\"1\"\n vectorEffect=\"non-scaling-stroke\"\n />\n <circle className=\"radio\" cx=\"18\" cy=\"18\" r=\"12\" fill=\"currentColor\" />\n </svg>\n )}\n <label htmlFor={inputId}>{label}</label>\n </div>\n </div>\n );\n});\n\nexport default FieldRadio;\n"],"names":["FieldRadio","React","forwardRef","_ref","ref","id","label","props","_objectWithoutProperties","_excluded","_React$useState","useState","_React$useState2","_slicedToArray","isEnhanced","setIsEnhanced","fallbackId","useId","inputId","useEffect","createElement","className","undefined","_extends","type","width","height","viewBox","focusable","cx","cy","r","stroke","fill","strokeWidth","vectorEffect","htmlFor"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/FieldRadio/FieldRadio.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport type FieldRadioProps = {\n label: React.ReactNode | string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldRadio = React.forwardRef<HTMLInputElement, FieldRadioProps>(({ id, label, ...props }, ref) => {\n const [isEnhanced, setIsEnhanced] = React.useState(false);\n\n const fallbackId = React.useId();\n\n const inputId = id ?? fallbackId;\n\n React.useEffect(() => {\n setIsEnhanced(true);\n }, []);\n\n return (\n <div className=\"bds-form-group\">\n <div className=\"bds-radio\" data-enhanced={isEnhanced ? '' : undefined}>\n <input {...props} id={inputId} ref={ref} type=\"radio\" />\n {isEnhanced && (\n <svg width=\"32\" height=\"32\" viewBox=\"-2 -2 40 40\" aria-hidden=\"true\" focusable=\"false\">\n <circle\n className=\"background\"\n cx=\"18\"\n cy=\"18\"\n r=\"18\"\n stroke=\"currentColor\"\n fill=\"none\"\n strokeWidth=\"1\"\n vectorEffect=\"non-scaling-stroke\"\n />\n <circle className=\"radio\" cx=\"18\" cy=\"18\" r=\"12\" fill=\"currentColor\" />\n </svg>\n )}\n <label htmlFor={inputId}>{label}</label>\n </div>\n </div>\n );\n});\n\nexport default FieldRadio;\n"],"names":["FieldRadio","React","forwardRef","_ref","ref","id","label","props","_objectWithoutProperties","_excluded","_React$useState","useState","_React$useState2","_slicedToArray","isEnhanced","setIsEnhanced","fallbackId","useId","inputId","useEffect","createElement","className","undefined","_extends","type","width","height","viewBox","focusable","cx","cy","r","stroke","fill","strokeWidth","vectorEffect","htmlFor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMMA,IAAAA,UAAU,gBAAGC,KAAK,CAACC,UAAU,CAAoC,UAAAC,IAAA,EAA0BC,GAAG,EAAK;AAAA,EAAA,IAA/BC,EAAE,GAAAF,IAAA,CAAFE,EAAE;IAAEC,KAAK,GAAAH,IAAA,CAALG,KAAK;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA,CAAA;AAC3F,EAAA,IAAAC,eAAA,GAAoCT,KAAK,CAACU,QAAQ,CAAC,KAAK,CAAC;IAAAC,gBAAA,GAAAC,cAAA,CAAAH,eAAA,EAAA,CAAA,CAAA;AAAlDI,IAAAA,UAAU,GAAAF,gBAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,aAAa,GAAAH,gBAAA,CAAA,CAAA,CAAA,CAAA;AAEhC,EAAA,IAAMI,UAAU,GAAGf,KAAK,CAACgB,KAAK,EAAE,CAAA;EAEhC,IAAMC,OAAO,GAAGb,EAAE,KAAA,IAAA,IAAFA,EAAE,KAAFA,KAAAA,CAAAA,GAAAA,EAAE,GAAIW,UAAU,CAAA;EAEhCf,KAAK,CAACkB,SAAS,CAAC,YAAM;IACpBJ,aAAa,CAAC,IAAI,CAAC,CAAA;GACpB,EAAE,EAAE,CAAC,CAAA;EAEN,oBACEd,KAAA,CAAAmB,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,gBAAA;GACbpB,eAAAA,KAAA,CAAAmB,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,WAAW;IAAC,eAAeP,EAAAA,UAAU,GAAG,EAAE,GAAGQ,SAAAA;AAAU,G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hint?: React.ReactNode | string;
|
|
5
|
+
id?: string;
|
|
6
|
+
isOptional?: boolean;
|
|
7
|
+
label: React.ReactNode | string;
|
|
8
|
+
};
|
|
9
|
+
declare const FieldSelect: React.ForwardRefExoticComponent<FieldSelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
10
|
+
export default FieldSelect;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
var n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
Object.keys(e).forEach(function (k) {
|
|
11
|
+
if (k !== 'default') {
|
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return e[k]; }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
25
|
+
|
|
26
|
+
function _extends() {
|
|
27
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
28
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
29
|
+
var t = arguments[e];
|
|
30
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
31
|
+
}
|
|
32
|
+
return n;
|
|
33
|
+
}, _extends.apply(null, arguments);
|
|
34
|
+
}
|
|
35
|
+
function _objectWithoutProperties(e, t) {
|
|
36
|
+
if (null == e) return {};
|
|
37
|
+
var o,
|
|
38
|
+
r,
|
|
39
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
40
|
+
if (Object.getOwnPropertySymbols) {
|
|
41
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
42
|
+
for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
43
|
+
}
|
|
44
|
+
return i;
|
|
45
|
+
}
|
|
46
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
47
|
+
if (null == r) return {};
|
|
48
|
+
var t = {};
|
|
49
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
50
|
+
if (e.indexOf(n) >= 0) continue;
|
|
51
|
+
t[n] = r[n];
|
|
52
|
+
}
|
|
53
|
+
return t;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var _excluded$1 = ["className", "children"];
|
|
57
|
+
function ErrorMessage(_ref) {
|
|
58
|
+
var className = _ref.className,
|
|
59
|
+
children = _ref.children,
|
|
60
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
61
|
+
return /*#__PURE__*/React__namespace.createElement("span", _extends({
|
|
62
|
+
className: ['bds-error', className].filter(function (x) {
|
|
63
|
+
return x;
|
|
64
|
+
}).join(' ')
|
|
65
|
+
}, props), /*#__PURE__*/React__namespace.createElement("svg", {
|
|
66
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
67
|
+
viewBox: "0 0 512 512",
|
|
68
|
+
"aria-hidden": "true",
|
|
69
|
+
height: "1em",
|
|
70
|
+
width: "1em",
|
|
71
|
+
fill: "currentColor"
|
|
72
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
73
|
+
d: "M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z"
|
|
74
|
+
})), children);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var _excluded = ["error", "hint", "id", "isOptional", "label"];
|
|
78
|
+
var FieldSelect = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
79
|
+
var _id;
|
|
80
|
+
var error = _ref.error,
|
|
81
|
+
hint = _ref.hint,
|
|
82
|
+
id = _ref.id,
|
|
83
|
+
_ref$isOptional = _ref.isOptional,
|
|
84
|
+
isOptional = _ref$isOptional === void 0 ? false : _ref$isOptional,
|
|
85
|
+
label = _ref.label,
|
|
86
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
87
|
+
id = (_id = id) !== null && _id !== void 0 ? _id : props.name;
|
|
88
|
+
var errorId = React__namespace.useId();
|
|
89
|
+
var hintId = React__namespace.useId();
|
|
90
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
91
|
+
className: "bds-form-group"
|
|
92
|
+
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
93
|
+
htmlFor: id
|
|
94
|
+
}, label, isOptional && ' (optional)'), hint && /*#__PURE__*/React__namespace.createElement("span", {
|
|
95
|
+
className: "bds-hint",
|
|
96
|
+
id: hintId
|
|
97
|
+
}, hint), error && /*#__PURE__*/React__namespace.createElement(ErrorMessage, {
|
|
98
|
+
id: errorId
|
|
99
|
+
}, error), /*#__PURE__*/React__namespace.createElement("div", {
|
|
100
|
+
className: "bds-select"
|
|
101
|
+
}, /*#__PURE__*/React__namespace.createElement("select", _extends({
|
|
102
|
+
"aria-invalid": error ? true : undefined,
|
|
103
|
+
"aria-describedby": error && hint ? "".concat(hintId, " ").concat(errorId) : error ? errorId : hint ? hintId : undefined,
|
|
104
|
+
id: id,
|
|
105
|
+
ref: ref
|
|
106
|
+
}, props))));
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
exports.default = FieldSelect;
|
|
110
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldSelect/FieldSelect.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default function ErrorMessage({ className, children, ...props }: React.ComponentPropsWithoutRef<'span'>) {\n return (\n <span className={['bds-error', className].filter((x) => x).join(' ')} {...props}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-hidden=\"true\"\n height=\"1em\"\n width=\"1em\"\n fill=\"currentColor\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z\" />\n </svg>\n {children}\n </span>\n );\n}\n","import * as React from 'react';\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldSelectProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: React.ReactNode | string;\n};\n\nconst FieldSelect = React.forwardRef<HTMLSelectElement, FieldSelectProps>(\n ({ error, hint, id, isOptional = false, label, ...props }, ref) => {\n id = id ?? props.name;\n\n const errorId = React.useId();\n const hintId = React.useId();\n\n return (\n <div className=\"bds-form-group\">\n <label htmlFor={id}>\n {label}\n {isOptional && ' (optional)'}\n </label>\n {hint && (\n <span className=\"bds-hint\" id={hintId}>\n {hint}\n </span>\n )}\n {error && <ErrorMessage id={errorId}>{error}</ErrorMessage>}\n <div className=\"bds-select\">\n <select\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n id={id}\n ref={ref}\n {...props}\n />\n </div>\n </div>\n );\n },\n);\n\nexport default FieldSelect;\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldSelect","forwardRef","ref","_id","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEe,SAASA,YAAYA,CAAAC,IAAA,EAA4E;AAAA,EAAA,IAAzEC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,WAAA,CAAA,CAAA;AAClE,EAAA,oBACEC,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAAC,QAAA,CAAA;IAAMP,SAAS,EAAE,CAAC,WAAW,EAAEA,SAAS,CAAC,CAACQ,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAKA,CAAC,CAAA;KAAC,CAAA,CAACC,IAAI,CAAC,GAAG,CAAA;AAAE,GAAA,EAAKR,KAAK,CAAA,eAC7EG,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEK,IAAAA,KAAK,EAAC,4BAA4B;AAClCC,IAAAA,OAAO,EAAC,aAAa;AACrB,IAAA,aAAA,EAAY,MAAM;AAClBC,IAAAA,MAAM,EAAC,KAAK;AACZC,IAAAA,KAAK,EAAC,KAAK;AACXC,IAAAA,IAAI,EAAC,cAAA;GAELV,eAAAA,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC,4UAAA;AAA4U,GAAE,CACnV,CAAC,EACLf,QACG,CAAC,CAAA;AAEX;;;ACPMgB,IAAAA,WAAW,gBAAGZ,gBAAK,CAACa,UAAU,CAClC,UAAAnB,IAAA,EAA2DoB,G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EAAA;AAAKN,IAAAA,SAAS,EAAC,YAAA;AAAY,GAAA,eACzBK,gBAAA,CAAAC,aAAA,CAAA,QAAA,EAAAC,QAAA,CAAA;AACE,IAAA,cAAA,EAAcc,KAAK,GAAG,IAAI,GAAGW,SAAU;IACvC,kBAAkBX,EAAAA,KAAK,IAAIC,IAAI,GAAA,EAAA,CAAAW,MAAA,CAAMH,MAAM,OAAAG,MAAA,CAAIL,OAAO,CAAKP,GAAAA,KAAK,GAAGO,OAAO,GAAGN,IAAI,GAAGQ,MAAM,GAAGE,SAAU;AACvGT,IAAAA,EAAE,EAAEA,EAAG;AACPJ,IAAAA,GAAG,EAAEA,GAAAA;AAAI,GAAA,EACLjB,KAAK,CACV,CACE,CACF,CAAC,CAAA;AAEV,CACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './FieldSelect';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
function _extends() {
|
|
4
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
5
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
6
|
+
var t = arguments[e];
|
|
7
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
8
|
+
}
|
|
9
|
+
return n;
|
|
10
|
+
}, _extends.apply(null, arguments);
|
|
11
|
+
}
|
|
12
|
+
function _objectWithoutProperties(e, t) {
|
|
13
|
+
if (null == e) return {};
|
|
14
|
+
var o,
|
|
15
|
+
r,
|
|
16
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
17
|
+
if (Object.getOwnPropertySymbols) {
|
|
18
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
19
|
+
for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
20
|
+
}
|
|
21
|
+
return i;
|
|
22
|
+
}
|
|
23
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
24
|
+
if (null == r) return {};
|
|
25
|
+
var t = {};
|
|
26
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
27
|
+
if (e.indexOf(n) >= 0) continue;
|
|
28
|
+
t[n] = r[n];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var _excluded$1 = ["className", "children"];
|
|
34
|
+
function ErrorMessage(_ref) {
|
|
35
|
+
var className = _ref.className,
|
|
36
|
+
children = _ref.children,
|
|
37
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
38
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
39
|
+
className: ['bds-error', className].filter(function (x) {
|
|
40
|
+
return x;
|
|
41
|
+
}).join(' ')
|
|
42
|
+
}, props), /*#__PURE__*/React.createElement("svg", {
|
|
43
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
44
|
+
viewBox: "0 0 512 512",
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
height: "1em",
|
|
47
|
+
width: "1em",
|
|
48
|
+
fill: "currentColor"
|
|
49
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
50
|
+
d: "M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z"
|
|
51
|
+
})), children);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var _excluded = ["error", "hint", "id", "isOptional", "label"];
|
|
55
|
+
var FieldSelect = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
56
|
+
var _id;
|
|
57
|
+
var error = _ref.error,
|
|
58
|
+
hint = _ref.hint,
|
|
59
|
+
id = _ref.id,
|
|
60
|
+
_ref$isOptional = _ref.isOptional,
|
|
61
|
+
isOptional = _ref$isOptional === void 0 ? false : _ref$isOptional,
|
|
62
|
+
label = _ref.label,
|
|
63
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
64
|
+
id = (_id = id) !== null && _id !== void 0 ? _id : props.name;
|
|
65
|
+
var errorId = React.useId();
|
|
66
|
+
var hintId = React.useId();
|
|
67
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: "bds-form-group"
|
|
69
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
70
|
+
htmlFor: id
|
|
71
|
+
}, label, isOptional && ' (optional)'), hint && /*#__PURE__*/React.createElement("span", {
|
|
72
|
+
className: "bds-hint",
|
|
73
|
+
id: hintId
|
|
74
|
+
}, hint), error && /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
75
|
+
id: errorId
|
|
76
|
+
}, error), /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: "bds-select"
|
|
78
|
+
}, /*#__PURE__*/React.createElement("select", _extends({
|
|
79
|
+
"aria-invalid": error ? true : undefined,
|
|
80
|
+
"aria-describedby": error && hint ? "".concat(hintId, " ").concat(errorId) : error ? errorId : hint ? hintId : undefined,
|
|
81
|
+
id: id,
|
|
82
|
+
ref: ref
|
|
83
|
+
}, props))));
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export { FieldSelect as default };
|
|
87
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldSelect/FieldSelect.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default function ErrorMessage({ className, children, ...props }: React.ComponentPropsWithoutRef<'span'>) {\n return (\n <span className={['bds-error', className].filter((x) => x).join(' ')} {...props}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-hidden=\"true\"\n height=\"1em\"\n width=\"1em\"\n fill=\"currentColor\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z\" />\n </svg>\n {children}\n </span>\n );\n}\n","import * as React from 'react';\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldSelectProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: React.ReactNode | string;\n};\n\nconst FieldSelect = React.forwardRef<HTMLSelectElement, FieldSelectProps>(\n ({ error, hint, id, isOptional = false, label, ...props }, ref) => {\n id = id ?? props.name;\n\n const errorId = React.useId();\n const hintId = React.useId();\n\n return (\n <div className=\"bds-form-group\">\n <label htmlFor={id}>\n {label}\n {isOptional && ' (optional)'}\n </label>\n {hint && (\n <span className=\"bds-hint\" id={hintId}>\n {hint}\n </span>\n )}\n {error && <ErrorMessage id={errorId}>{error}</ErrorMessage>}\n <div className=\"bds-select\">\n <select\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n id={id}\n ref={ref}\n {...props}\n />\n </div>\n </div>\n );\n },\n);\n\nexport default FieldSelect;\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldSelect","forwardRef","ref","_id","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAI,GAAGQ,MAAM,GAAGE,SAAU;AACvGT,IAAAA,EAAE,EAAEA,EAAG;AACPJ,IAAAA,GAAG,EAAEA,GAAAA;AAAI,GAAA,EACLjB,KAAK,CACV,CACE,CACF,CAAC,CAAA;AAEV,CACF;;;;"}
|
package/FieldTextInput/index.cjs
CHANGED
|
@@ -24,45 +24,33 @@ function _interopNamespaceDefault(e) {
|
|
|
24
24
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
25
25
|
|
|
26
26
|
function _extends() {
|
|
27
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
28
|
-
for (var
|
|
29
|
-
var
|
|
30
|
-
for (var
|
|
31
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
32
|
-
target[key] = source[key];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
27
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
28
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
29
|
+
var t = arguments[e];
|
|
30
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
35
31
|
}
|
|
36
|
-
return
|
|
37
|
-
};
|
|
38
|
-
return _extends.apply(this, arguments);
|
|
32
|
+
return n;
|
|
33
|
+
}, _extends.apply(null, arguments);
|
|
39
34
|
}
|
|
40
|
-
function
|
|
41
|
-
if (
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
target[key] = source[key];
|
|
35
|
+
function _objectWithoutProperties(e, t) {
|
|
36
|
+
if (null == e) return {};
|
|
37
|
+
var o,
|
|
38
|
+
r,
|
|
39
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
40
|
+
if (Object.getOwnPropertySymbols) {
|
|
41
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
42
|
+
for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
49
43
|
}
|
|
50
|
-
return
|
|
44
|
+
return i;
|
|
51
45
|
}
|
|
52
|
-
function
|
|
53
|
-
if (
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
59
|
-
key = sourceSymbolKeys[i];
|
|
60
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
61
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
62
|
-
target[key] = source[key];
|
|
63
|
-
}
|
|
46
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
47
|
+
if (null == r) return {};
|
|
48
|
+
var t = {};
|
|
49
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
50
|
+
if (e.indexOf(n) >= 0) continue;
|
|
51
|
+
t[n] = r[n];
|
|
64
52
|
}
|
|
65
|
-
return
|
|
53
|
+
return t;
|
|
66
54
|
}
|
|
67
55
|
|
|
68
56
|
var _excluded$1 = ["className", "children"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextInput/FieldTextInput.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default function ErrorMessage({ className, children, ...props }: React.ComponentPropsWithoutRef<'span'>) {\n return (\n <span className={['bds-error', className].filter((x) => x).join(' ')} {...props}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-hidden=\"true\"\n height=\"1em\"\n width=\"1em\"\n fill=\"currentColor\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z\" />\n </svg>\n {children}\n </span>\n );\n}\n","import * as React from 'react';\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextInputProps<C> = {\n as?: C;\n error?: string;\n hint?: string;\n id?: string;\n isOptional?: boolean;\n label: string;\n};\n\nexport default function FieldTextInput<C extends React.ElementType>({\n as,\n className,\n error,\n hint,\n id,\n isOptional = false,\n label,\n ...props\n}: FieldTextInputProps<C> & React.ComponentPropsWithoutRef<C>) {\n id = id ?? props.name;\n\n const errorId = React.useId();\n const hintId = React.useId();\n\n const InputComponent = as ?? 'input';\n\n return (\n <div className=\"bds-form-group\">\n <label htmlFor={id}>\n {label}\n {isOptional && ' (optional)'}\n </label>\n {hint && (\n <span className=\"bds-hint\" id={hintId}>\n {hint}\n </span>\n )}\n {error && <ErrorMessage id={errorId}>{error}</ErrorMessage>}\n <InputComponent\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n className={['bds-text-input', className].filter((x) => x).join(' ')}\n id={id}\n {...props}\n />\n </div>\n );\n}\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldTextInput","_id","as","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","InputComponent","htmlFor","undefined","concat"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextInput/FieldTextInput.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default function ErrorMessage({ className, children, ...props }: React.ComponentPropsWithoutRef<'span'>) {\n return (\n <span className={['bds-error', className].filter((x) => x).join(' ')} {...props}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-hidden=\"true\"\n height=\"1em\"\n width=\"1em\"\n fill=\"currentColor\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z\" />\n </svg>\n {children}\n </span>\n );\n}\n","import * as React from 'react';\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextInputProps<C> = {\n as?: C;\n error?: string;\n hint?: string;\n id?: string;\n isOptional?: boolean;\n label: string;\n};\n\nexport default function FieldTextInput<C extends React.ElementType>({\n as,\n className,\n error,\n hint,\n id,\n isOptional = false,\n label,\n ...props\n}: FieldTextInputProps<C> & React.ComponentPropsWithoutRef<C>) {\n id = id ?? props.name;\n\n const errorId = React.useId();\n const hintId = React.useId();\n\n const InputComponent = as ?? 'input';\n\n return (\n <div className=\"bds-form-group\">\n <label htmlFor={id}>\n {label}\n {isOptional && ' (optional)'}\n </label>\n {hint && (\n <span className=\"bds-hint\" id={hintId}>\n {hint}\n </span>\n )}\n {error && <ErrorMessage id={errorId}>{error}</ErrorMessage>}\n <InputComponent\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n className={['bds-text-input', className].filter((x) => x).join(' ')}\n id={id}\n {...props}\n />\n </div>\n );\n}\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldTextInput","_id","as","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","InputComponent","htmlFor","undefined","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,CAAMJ,MAAM,OAAAI,MAAA,CAAIN,OAAO,CAAKP,GAAAA,KAAK,GAAGO,OAAO,GAAGN,IAAI,GAAGQ,MAAM,GAAGG,SAAU;IACvGhC,SAAS,EAAE,CAAC,gBAAgB,EAAEA,SAAS,CAAC,CAACQ,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAKA,CAAC,CAAA;AAAA,KAAA,CAAC,CAACC,IAAI,CAAC,GAAG,CAAE;AACpEY,IAAAA,EAAE,EAAEA,EAAAA;GACApB,EAAAA,KAAK,CACV,CACE,CAAC,CAAA;AAEV;;;;"}
|
package/FieldTextInput/index.mjs
CHANGED
|
@@ -1,45 +1,33 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
function _extends() {
|
|
4
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
5
|
-
for (var
|
|
6
|
-
var
|
|
7
|
-
for (var
|
|
8
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9
|
-
target[key] = source[key];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
4
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
5
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
6
|
+
var t = arguments[e];
|
|
7
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
12
8
|
}
|
|
13
|
-
return
|
|
14
|
-
};
|
|
15
|
-
return _extends.apply(this, arguments);
|
|
9
|
+
return n;
|
|
10
|
+
}, _extends.apply(null, arguments);
|
|
16
11
|
}
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
target[key] = source[key];
|
|
12
|
+
function _objectWithoutProperties(e, t) {
|
|
13
|
+
if (null == e) return {};
|
|
14
|
+
var o,
|
|
15
|
+
r,
|
|
16
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
17
|
+
if (Object.getOwnPropertySymbols) {
|
|
18
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
19
|
+
for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
26
20
|
}
|
|
27
|
-
return
|
|
21
|
+
return i;
|
|
28
22
|
}
|
|
29
|
-
function
|
|
30
|
-
if (
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
36
|
-
key = sourceSymbolKeys[i];
|
|
37
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
38
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39
|
-
target[key] = source[key];
|
|
40
|
-
}
|
|
23
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
24
|
+
if (null == r) return {};
|
|
25
|
+
var t = {};
|
|
26
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
27
|
+
if (e.indexOf(n) >= 0) continue;
|
|
28
|
+
t[n] = r[n];
|
|
41
29
|
}
|
|
42
|
-
return
|
|
30
|
+
return t;
|
|
43
31
|
}
|
|
44
32
|
|
|
45
33
|
var _excluded$1 = ["className", "children"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextInput/FieldTextInput.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default function ErrorMessage({ className, children, ...props }: React.ComponentPropsWithoutRef<'span'>) {\n return (\n <span className={['bds-error', className].filter((x) => x).join(' ')} {...props}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-hidden=\"true\"\n height=\"1em\"\n width=\"1em\"\n fill=\"currentColor\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z\" />\n </svg>\n {children}\n </span>\n );\n}\n","import * as React from 'react';\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextInputProps<C> = {\n as?: C;\n error?: string;\n hint?: string;\n id?: string;\n isOptional?: boolean;\n label: string;\n};\n\nexport default function FieldTextInput<C extends React.ElementType>({\n as,\n className,\n error,\n hint,\n id,\n isOptional = false,\n label,\n ...props\n}: FieldTextInputProps<C> & React.ComponentPropsWithoutRef<C>) {\n id = id ?? props.name;\n\n const errorId = React.useId();\n const hintId = React.useId();\n\n const InputComponent = as ?? 'input';\n\n return (\n <div className=\"bds-form-group\">\n <label htmlFor={id}>\n {label}\n {isOptional && ' (optional)'}\n </label>\n {hint && (\n <span className=\"bds-hint\" id={hintId}>\n {hint}\n </span>\n )}\n {error && <ErrorMessage id={errorId}>{error}</ErrorMessage>}\n <InputComponent\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n className={['bds-text-input', className].filter((x) => x).join(' ')}\n id={id}\n {...props}\n />\n </div>\n );\n}\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldTextInput","_id","as","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","InputComponent","htmlFor","undefined","concat"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextInput/FieldTextInput.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default function ErrorMessage({ className, children, ...props }: React.ComponentPropsWithoutRef<'span'>) {\n return (\n <span className={['bds-error', className].filter((x) => x).join(' ')} {...props}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-hidden=\"true\"\n height=\"1em\"\n width=\"1em\"\n fill=\"currentColor\"\n >\n <path d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7.2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8.2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32z\" />\n </svg>\n {children}\n </span>\n );\n}\n","import * as React from 'react';\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextInputProps<C> = {\n as?: C;\n error?: string;\n hint?: string;\n id?: string;\n isOptional?: boolean;\n label: string;\n};\n\nexport default function FieldTextInput<C extends React.ElementType>({\n as,\n className,\n error,\n hint,\n id,\n isOptional = false,\n label,\n ...props\n}: FieldTextInputProps<C> & React.ComponentPropsWithoutRef<C>) {\n id = id ?? props.name;\n\n const errorId = React.useId();\n const hintId = React.useId();\n\n const InputComponent = as ?? 'input';\n\n return (\n <div className=\"bds-form-group\">\n <label htmlFor={id}>\n {label}\n {isOptional && ' (optional)'}\n </label>\n {hint && (\n <span className=\"bds-hint\" id={hintId}>\n {hint}\n </span>\n )}\n {error && <ErrorMessage id={errorId}>{error}</ErrorMessage>}\n <InputComponent\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n className={['bds-text-input', className].filter((x) => x).join(' ')}\n id={id}\n {...props}\n />\n </div>\n );\n}\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldTextInput","_id","as","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","InputComponent","htmlFor","undefined","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEe,SAASA,YAAYA,CAAAC,IAAA,EAA4E;AAAA,EAAA,IAAzEC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,WAAA,CAAA,CAAA;AAClE,EAAA,oBACEC,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAAC,QAAA,CAAA;IAAMP,SAAS,EAAE,CAAC,WAAW,EAAEA,SAAS,CAAC,CAACQ,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAKA,CAAC,CAAA;KAAC,CAAA,CAACC,IAAI,CAAC,GAAG,CAAA;AAAE,GAAA,EAAKR,KAAK,CAAA,eAC7EG,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEK,IAAAA,KAAK,EAAC,4BAA4B;AAClCC,IAAAA,OAAO,EAAC,aAAa;AACrB,IAAA,aAAA,EAAY,MAAM;AAClBC,IAAAA,MAAM,EAAC,KAAK;AACZC,IAAAA,KAAK,EAAC,KAAK;AACXC,IAAAA,IAAI,EAAC,cAAA;GAELV,eAAAA,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC,4UAAA;AAA4U,GAAE,CACnV,CAAC,EACLf,QACG,CAAC,CAAA;AAEX;;;ACNe,SAASgB,cAAcA,CAAAlB,IAAA,EASyB;AAAA,EAAA,IAAAmB,GAAA,CAAA;AAAA,EAAA,IAR7DC,EAAE,GAAApB,IAAA,CAAFoB,EAAE;IACFnB,SAAS,GAAAD,IAAA,CAATC,SAAS;IACToB,KAAK,GAAArB,IAAA,CAALqB,KAAK;IACLC,IAAI,GAA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