@iabbb/bds-react 0.59.0 → 0.60.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/Button/index.cjs.map +1 -1
- package/Button/index.mjs.map +1 -1
- package/CallToAction/index.cjs.map +1 -1
- package/CallToAction/index.mjs.map +1 -1
- package/ErrorMessage/index.cjs.map +1 -1
- package/ErrorMessage/index.mjs.map +1 -1
- package/ErrorSummary/index.cjs.map +1 -1
- package/ErrorSummary/index.mjs.map +1 -1
- package/FieldCharacterCountdown/index.cjs.map +1 -1
- package/FieldCharacterCountdown/index.mjs.map +1 -1
- package/FieldCheckbox/index.cjs.map +1 -1
- package/FieldCheckbox/index.mjs.map +1 -1
- package/FieldHoneypot/FieldHoneypot.d.ts +21 -0
- package/FieldHoneypot/index.cjs +92 -0
- package/FieldHoneypot/index.cjs.map +1 -0
- package/FieldHoneypot/index.d.ts +1 -0
- package/FieldHoneypot/index.mjs +69 -0
- package/FieldHoneypot/index.mjs.map +1 -0
- package/FieldHoneypot/package.json +7 -0
- package/FieldPasswordReveal/index.cjs.map +1 -1
- package/FieldPasswordReveal/index.mjs.map +1 -1
- package/FieldRadio/index.cjs.map +1 -1
- package/FieldRadio/index.mjs.map +1 -1
- package/FieldSelect/index.cjs.map +1 -1
- package/FieldSelect/index.mjs.map +1 -1
- package/FieldTextInput/index.cjs.map +1 -1
- package/FieldTextInput/index.mjs.map +1 -1
- package/FieldTextarea/index.cjs.map +1 -1
- package/FieldTextarea/index.mjs.map +1 -1
- package/Fieldset/index.cjs.map +1 -1
- package/Fieldset/index.mjs.map +1 -1
- package/Pagination/index.cjs.map +1 -1
- package/Pagination/index.mjs.map +1 -1
- package/Typography/index.cjs.map +1 -1
- package/Typography/index.mjs.map +1 -1
- package/index.cjs.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,69 @@
|
|
|
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], -1 === t.indexOf(o) && {}.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 (-1 !== e.indexOf(n)) continue;
|
|
28
|
+
t[n] = r[n];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var _excluded = ["className", "id", "label", "name"];
|
|
34
|
+
var DefaultHoneypotFieldName = 'website_w6u0u2c';
|
|
35
|
+
/**
|
|
36
|
+
* A honeypot is a field that is not available to users but a bot would be tricked into filling out and submitting.
|
|
37
|
+
* Since this field is hidden visually, the only time that it would be filled out is by a bot.
|
|
38
|
+
* We can reject any submission that has this field filled out.
|
|
39
|
+
* `aria-hidden` hides the field from screen reader users, `.visually-hidden` hides it from sighted users,
|
|
40
|
+
* and `tabIndex=-1` makes it unfocusable for keyboard users.
|
|
41
|
+
* Read more: https://front-end.social/@heydon/111204680660492741
|
|
42
|
+
* @param props - Props to pass to the <input /> component
|
|
43
|
+
* @returns Input and label for visually hidden, non-focusable honeypot field.
|
|
44
|
+
*/
|
|
45
|
+
var FieldHoneypot = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
46
|
+
_ref.className;
|
|
47
|
+
var id = _ref.id,
|
|
48
|
+
label = _ref.label,
|
|
49
|
+
name = _ref.name,
|
|
50
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
label = label || 'Website';
|
|
52
|
+
name = name || DefaultHoneypotFieldName;
|
|
53
|
+
id = id !== null && id !== void 0 ? id : name;
|
|
54
|
+
return /*#__PURE__*/React.createElement("label", {
|
|
55
|
+
"aria-hidden": true,
|
|
56
|
+
className: "visually-hidden",
|
|
57
|
+
htmlFor: id
|
|
58
|
+
}, label, /*#__PURE__*/React.createElement("input", _extends({
|
|
59
|
+
id: id,
|
|
60
|
+
ref: ref,
|
|
61
|
+
tabIndex: -1,
|
|
62
|
+
name: name,
|
|
63
|
+
autoComplete: "off"
|
|
64
|
+
}, props)));
|
|
65
|
+
});
|
|
66
|
+
FieldHoneypot.displayName = 'FieldHoneypot';
|
|
67
|
+
|
|
68
|
+
export { FieldHoneypot as default };
|
|
69
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/FieldHoneypot/FieldHoneypot.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport const DefaultHoneypotFieldName = 'website_w6u0u2c';\n\nexport type FieldHoneypotProps = {\n id?: string;\n label?: string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\n/**\n * A honeypot is a field that is not available to users but a bot would be tricked into filling out and submitting.\n * Since this field is hidden visually, the only time that it would be filled out is by a bot.\n * We can reject any submission that has this field filled out.\n * `aria-hidden` hides the field from screen reader users, `.visually-hidden` hides it from sighted users,\n * and `tabIndex=-1` makes it unfocusable for keyboard users.\n * Read more: https://front-end.social/@heydon/111204680660492741\n * @param props - Props to pass to the <input /> component\n * @returns Input and label for visually hidden, non-focusable honeypot field.\n */\nconst FieldHoneypot = React.forwardRef<HTMLInputElement, FieldHoneypotProps>(\n ({ className, id, label, name, ...props }, ref) => {\n label = label || 'Website';\n name = name || DefaultHoneypotFieldName;\n id = id ?? name;\n\n return (\n <label aria-hidden className=\"visually-hidden\" htmlFor={id}>\n {label}\n <input id={id} ref={ref} tabIndex={-1} name={name} autoComplete=\"off\" {...props} />\n </label>\n );\n },\n);\n\nFieldHoneypot.displayName = 'FieldHoneypot';\n\nexport default FieldHoneypot;\n"],"names":["DefaultHoneypotFieldName","FieldHoneypot","React","forwardRef","_ref","ref","className","id","label","name","props","_objectWithoutProperties","_excluded","createElement","htmlFor","_extends","tabIndex","autoComplete","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,IAAMA,wBAAwB,GAAG,iBAAiB;AAOzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,aAAa,gBAAGC,KAAK,CAACC,UAAU,CACpC,UAAAC,IAAA,EAA2CC,GAAG,EAAK;AAAA,EAAvCD,IAAA,CAATE,SAAS;QAAEC,EAAE,GAAAH,IAAA,CAAFG,EAAE;IAAEC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IAAEC,IAAI,GAAAL,IAAA,CAAJK,IAAI;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAAP,IAAA,EAAAQ,SAAA;EACrCJ,KAAK,GAAGA,KAAK,IAAI,SAAS;EAC1BC,IAAI,GAAGA,IAAI,IAAIT,wBAAwB;AACvCO,EAAAA,EAAE,GAAGA,EAAE,KAAA,IAAA,IAAFA,EAAE,KAAA,MAAA,GAAFA,EAAE,GAAIE,IAAI;EAEf,oBACEP,KAAA,CAAAW,aAAA,CAAA,OAAA,EAAA;IAAO,aAAA,EAAA,IAAW;AAACP,IAAAA,SAAS,EAAC,iBAAiB;AAACQ,IAAAA,OAAO,EAAEP;AAAG,GAAA,EACxDC,KAAK,eACNN,KAAA,CAAAW,aAAA,UAAAE,QAAA,CAAA;AAAOR,IAAAA,EAAE,EAAEA,EAAG;AAACF,IAAAA,GAAG,EAAEA,GAAI;IAACW,QAAQ,EAAE,EAAG;AAACP,IAAAA,IAAI,EAAEA,IAAK;AAACQ,IAAAA,YAAY,EAAC;GAAK,EAAKP,KAAK,CAAG,CAC7E,CAAC;AAEZ,CACF;AAEAT,aAAa,CAACiB,WAAW,GAAG,eAAe;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldPasswordReveal/FieldPasswordReveal.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldPasswordRevealProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldPasswordReveal = React.forwardRef<HTMLInputElement, FieldPasswordRevealProps>(\n ({ className, error, hint, id, isOptional = false, label, ...props }, ref) => {\n id = id ?? props.name;\n\n const [showPasswordRevealButton, setShowPasswordRevealButton] = React.useState(false);\n const [revealPassword, setRevealPassword] = React.useState(false);\n\n React.useEffect(() => {\n // JavaScript support is not necessarily a given.\n // Instead of showing a button that may not do anything, it's better to wait until JS has loaded.\n setShowPasswordRevealButton(true);\n }, []);\n\n const handleButtonClick = () => {\n setRevealPassword(!revealPassword);\n };\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-password-reveal\">\n <input\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 type={revealPassword ? 'text' : 'password'}\n {...props}\n />\n {showPasswordRevealButton && (\n <button onClick={handleButtonClick} type=\"button\">\n {revealPassword ? (\n <>\n <svg\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n focusable=\"false\"\n viewBox=\"0 0 640 512\"\n width=\"1em\"\n height=\"1em\"\n >\n <path d=\"M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z\" />\n </svg>\n <span className=\"visually-hidden\">Hide password</span>\n </>\n ) : (\n <>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n focusable=\"false\"\n viewBox=\"0 0 576 512\"\n height=\"1em\"\n width=\"1em\"\n >\n <path d=\"M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z\" />\n </svg>\n <span className=\"visually-hidden\">Show password</span>\n </>\n )}\n </button>\n )}\n </div>\n </div>\n );\n },\n);\n\nFieldPasswordReveal.displayName = 'FieldPasswordReveal';\n\nexport default FieldPasswordReveal;\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldPasswordReveal","forwardRef","ref","error","hint","id","_ref$isOptional","isOptional","label","name","_React$useState","useState","_React$useState2","_slicedToArray","showPasswordRevealButton","setShowPasswordRevealButton","_React$useState3","_React$useState4","revealPassword","setRevealPassword","useEffect","handleButtonClick","errorId","useId","hintId","htmlFor","undefined","concat","type","onClick","Fragment","focusable","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;KAAC,CAAA,CAACC,IAAI,CAAC,GAAG;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;GAELV,eAAAA,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC;AAA4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AA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC;AAA8jB,GAAE,CACrkB,CAAC,eACNX,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMN,IAAAA,SAAS,EAAC;AAAiB,GAAA,EAAC,eAAmB,CACrD,CAEE,CAEP,CACF,CAAC;AAEV,CACF;AAEAiB,mBAAmB,CAACgC,WAAW,GAAG,qBAAqB;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldPasswordReveal/FieldPasswordReveal.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldPasswordRevealProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldPasswordReveal = React.forwardRef<HTMLInputElement, FieldPasswordRevealProps>(\n ({ className, error, hint, id, isOptional = false, label, ...props }, ref) => {\n id = id ?? props.name;\n\n const [showPasswordRevealButton, setShowPasswordRevealButton] = React.useState(false);\n const [revealPassword, setRevealPassword] = React.useState(false);\n\n React.useEffect(() => {\n // JavaScript support is not necessarily a given.\n // Instead of showing a button that may not do anything, it's better to wait until JS has loaded.\n setShowPasswordRevealButton(true);\n }, []);\n\n const handleButtonClick = () => {\n setRevealPassword(!revealPassword);\n };\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-password-reveal\">\n <input\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 type={revealPassword ? 'text' : 'password'}\n {...props}\n />\n {showPasswordRevealButton && (\n <button onClick={handleButtonClick} type=\"button\">\n {revealPassword ? (\n <>\n <svg\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n focusable=\"false\"\n viewBox=\"0 0 640 512\"\n width=\"1em\"\n height=\"1em\"\n >\n <path d=\"M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z\" />\n </svg>\n <span className=\"visually-hidden\">Hide password</span>\n </>\n ) : (\n <>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n focusable=\"false\"\n viewBox=\"0 0 576 512\"\n height=\"1em\"\n width=\"1em\"\n >\n <path d=\"M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z\" />\n </svg>\n <span className=\"visually-hidden\">Show password</span>\n </>\n )}\n </button>\n )}\n </div>\n </div>\n );\n },\n);\n\nFieldPasswordReveal.displayName = 'FieldPasswordReveal';\n\nexport default FieldPasswordReveal;\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldPasswordReveal","forwardRef","ref","error","hint","id","_ref$isOptional","isOptional","label","name","_React$useState","useState","_React$useState2","_slicedToArray","showPasswordRevealButton","setShowPasswordRevealButton","_React$useState3","_React$useState4","revealPassword","setRevealPassword","useEffect","handleButtonClick","errorId","useId","hintId","htmlFor","undefined","concat","type","onClick","Fragment","focusable","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG;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;GAAc,eAEnBV,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC;AAA4U,GAAE,CACnV,CAAC,EACLf,QACG,CAAC;AAEX;;;ACPA,IAA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AA8jB,GAAE,CACrkB,CAAC,eACNX,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMN,IAAAA,SAAS,EAAC;AAAiB,GAAA,EAAC,eAAmB,CACrD,CAEE,CAEP,CACF,CAAC;AAEV,CACF;AAEAiB,mBAAmB,CAACgC,WAAW,GAAG,qBAAqB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldPasswordReveal/FieldPasswordReveal.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldPasswordRevealProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldPasswordReveal = React.forwardRef<HTMLInputElement, FieldPasswordRevealProps>(\n ({ className, error, hint, id, isOptional = false, label, ...props }, ref) => {\n id = id ?? props.name;\n\n const [showPasswordRevealButton, setShowPasswordRevealButton] = React.useState(false);\n const [revealPassword, setRevealPassword] = React.useState(false);\n\n React.useEffect(() => {\n // JavaScript support is not necessarily a given.\n // Instead of showing a button that may not do anything, it's better to wait until JS has loaded.\n setShowPasswordRevealButton(true);\n }, []);\n\n const handleButtonClick = () => {\n setRevealPassword(!revealPassword);\n };\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-password-reveal\">\n <input\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 type={revealPassword ? 'text' : 'password'}\n {...props}\n />\n {showPasswordRevealButton && (\n <button onClick={handleButtonClick} type=\"button\">\n {revealPassword ? (\n <>\n <svg\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n focusable=\"false\"\n viewBox=\"0 0 640 512\"\n width=\"1em\"\n height=\"1em\"\n >\n <path d=\"M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z\" />\n </svg>\n <span className=\"visually-hidden\">Hide password</span>\n </>\n ) : (\n <>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n focusable=\"false\"\n viewBox=\"0 0 576 512\"\n height=\"1em\"\n width=\"1em\"\n >\n <path d=\"M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z\" />\n </svg>\n <span className=\"visually-hidden\">Show password</span>\n </>\n )}\n </button>\n )}\n </div>\n </div>\n );\n },\n);\n\nFieldPasswordReveal.displayName = 'FieldPasswordReveal';\n\nexport default FieldPasswordReveal;\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldPasswordReveal","forwardRef","ref","error","hint","id","_ref$isOptional","isOptional","label","name","_React$useState","useState","_React$useState2","_slicedToArray","showPasswordRevealButton","setShowPasswordRevealButton","_React$useState3","_React$useState4","revealPassword","setRevealPassword","useEffect","handleButtonClick","errorId","useId","hintId","htmlFor","undefined","concat","type","onClick","Fragment","focusable","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;KAAC,CAAA,CAACC,IAAI,CAAC,GAAG;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;GAELV,eAAAA,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC;AAA4U,GAAE,CACnV,CAAC,EACLf,QACG,CAAC;AAEX;;;ACPMgB,IAAAA,mBAAmB,gBAAGZ,KAAK,CAACa,UAAU,CAC1C,UAAAnB,IAAA,EA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AiB,GAAA,EAAC,eAAmB,CACrD,CAEE,CAEP,CACF,CAAC;AAEV,CACF;AAEAiB,mBAAmB,CAACgC,WAAW,GAAG,qBAAqB;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldPasswordReveal/FieldPasswordReveal.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldPasswordRevealProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldPasswordReveal = React.forwardRef<HTMLInputElement, FieldPasswordRevealProps>(\n ({ className, error, hint, id, isOptional = false, label, ...props }, ref) => {\n id = id ?? props.name;\n\n const [showPasswordRevealButton, setShowPasswordRevealButton] = React.useState(false);\n const [revealPassword, setRevealPassword] = React.useState(false);\n\n React.useEffect(() => {\n // JavaScript support is not necessarily a given.\n // Instead of showing a button that may not do anything, it's better to wait until JS has loaded.\n setShowPasswordRevealButton(true);\n }, []);\n\n const handleButtonClick = () => {\n setRevealPassword(!revealPassword);\n };\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-password-reveal\">\n <input\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 type={revealPassword ? 'text' : 'password'}\n {...props}\n />\n {showPasswordRevealButton && (\n <button onClick={handleButtonClick} type=\"button\">\n {revealPassword ? (\n <>\n <svg\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n focusable=\"false\"\n viewBox=\"0 0 640 512\"\n width=\"1em\"\n height=\"1em\"\n >\n <path d=\"M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z\" />\n </svg>\n <span className=\"visually-hidden\">Hide password</span>\n </>\n ) : (\n <>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n focusable=\"false\"\n viewBox=\"0 0 576 512\"\n height=\"1em\"\n width=\"1em\"\n >\n <path d=\"M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z\" />\n </svg>\n <span className=\"visually-hidden\">Show password</span>\n </>\n )}\n </button>\n )}\n </div>\n </div>\n );\n },\n);\n\nFieldPasswordReveal.displayName = 'FieldPasswordReveal';\n\nexport default FieldPasswordReveal;\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldPasswordReveal","forwardRef","ref","error","hint","id","_ref$isOptional","isOptional","label","name","_React$useState","useState","_React$useState2","_slicedToArray","showPasswordRevealButton","setShowPasswordRevealButton","_React$useState3","_React$useState4","revealPassword","setRevealPassword","useEffect","handleButtonClick","errorId","useId","hintId","htmlFor","undefined","concat","type","onClick","Fragment","focusable","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG;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;GAAc,eAEnBV,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC;AAA4U,GAAE,CACnV,CAAC,EACLf,QACG,CAAC;AAEX;;;ACPA,IAAMgB,mBAAmB,gBAAGZ,KAAK,CAACa,UAAU,CAC1C,UAAAnB,IAAA,EAAsEoB,GAAG,EAAK;AAAA,EAAA,IAA3EnB,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAEoB,KAAK,GAAArB,IAAA,CAALqB,KAAK;IA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;;;"}
|
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=\"24\" height=\"24\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <circle\n className=\"background\"\n cx=\"12\"\n cy=\"12\"\n /* subtract half of the strokeWidth to get radius. credit: https://stackoverflow.com/questions/64149284/svg-stroke-width-changes-dimensions-of-the-object */\n r=\"11.5\"\n stroke=\"currentColor\"\n fill=\"none\"\n strokeWidth=\"1\"\n vectorEffect=\"non-scaling-stroke\"\n />\n {/* radius set through CSS when selected */}\n <circle className=\"radio\" cx=\"12\" cy=\"12\" fill=\"currentColor\" />\n </svg>\n )}\n <label htmlFor={inputId}>{label}</label>\n </div>\n </div>\n );\n});\n\nFieldRadio.displayName = 'FieldRadio';\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","displayName"],"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=\"24\" height=\"24\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <circle\n className=\"background\"\n cx=\"12\"\n cy=\"12\"\n /* subtract half of the strokeWidth to get radius. credit: https://stackoverflow.com/questions/64149284/svg-stroke-width-changes-dimensions-of-the-object */\n r=\"11.5\"\n stroke=\"currentColor\"\n fill=\"none\"\n strokeWidth=\"1\"\n vectorEffect=\"non-scaling-stroke\"\n />\n {/* radius set through CSS when selected */}\n <circle className=\"radio\" cx=\"12\" cy=\"12\" fill=\"currentColor\" />\n </svg>\n )}\n <label htmlFor={inputId}>{label}</label>\n </div>\n </div>\n );\n});\n\nFieldRadio.displayName = 'FieldRadio';\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","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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O,GAAA,CAAE,CAAC,EACvDV,UAAU,iBACTb,gBAAA,CAAAmB,aAAA,CAAA,KAAA,EAAA;AAAKK,IAAAA,KAAK,EAAC,IAAI;AAACC,IAAAA,MAAM,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAC,WAAW;AAAC,IAAA,aAAA,EAAY,MAAM;AAACC,IAAAA,SAAS,EAAC;GAAO,eAClF3B,gBAAA,CAAAmB,aAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,YAAY;AACtBQ,IAAAA,EAAE,EAAC,IAAI;AACPC,IAAAA,EAAE,EAAC;AACH;AACAC,IAAAA,CAAC,EAAC,MAAM;AACRC,IAAAA,MAAM,EAAC,cAAc;AACrBC,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,WAAW,EAAC,GAAG;AACfC,IAAAA,YAAY,EAAC;AAAoB,GAClC,CAAC,eAEFlC,gBAAA,CAAAmB,aAAA,CAAA,QAAA,EAAA;AAAQC,IAAAA,SAAS,EAAC,OAAO;AAACQ,IAAAA,EAAE,EAAC,IAAI;AAACC,IAAAA,EAAE,EAAC,IAAI;AAACG,IAAAA,IAAI,EAAC;AAAc,GAAE,CAC5D,CACN,eACDhC,gBAAA,CAAAmB,aAAA,CAAA,OAAA,EAAA;AAAOgB,IAAAA,OAAO,EAAElB;GAAQ,EAAEZ,KAAa,CACpC,CACF,CAAC;AAEV,CAAC;AAEDN,UAAU,CAACqC,WAAW,GAAG,YAAY;;;;"}
|
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=\"24\" height=\"24\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <circle\n className=\"background\"\n cx=\"12\"\n cy=\"12\"\n /* subtract half of the strokeWidth to get radius. credit: https://stackoverflow.com/questions/64149284/svg-stroke-width-changes-dimensions-of-the-object */\n r=\"11.5\"\n stroke=\"currentColor\"\n fill=\"none\"\n strokeWidth=\"1\"\n vectorEffect=\"non-scaling-stroke\"\n />\n {/* radius set through CSS when selected */}\n <circle className=\"radio\" cx=\"12\" cy=\"12\" fill=\"currentColor\" />\n </svg>\n )}\n <label htmlFor={inputId}>{label}</label>\n </div>\n </div>\n );\n});\n\nFieldRadio.displayName = 'FieldRadio';\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","displayName"],"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=\"24\" height=\"24\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n <circle\n className=\"background\"\n cx=\"12\"\n cy=\"12\"\n /* subtract half of the strokeWidth to get radius. credit: https://stackoverflow.com/questions/64149284/svg-stroke-width-changes-dimensions-of-the-object */\n r=\"11.5\"\n stroke=\"currentColor\"\n fill=\"none\"\n strokeWidth=\"1\"\n vectorEffect=\"non-scaling-stroke\"\n />\n {/* radius set through CSS when selected */}\n <circle className=\"radio\" cx=\"12\" cy=\"12\" fill=\"currentColor\" />\n </svg>\n )}\n <label htmlFor={inputId}>{label}</label>\n </div>\n </div>\n );\n});\n\nFieldRadio.displayName = 'FieldRadio';\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","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAMA,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;AAC3F,EAAA,IAAAC,eAAA,GAAoCT,KAAK,CAACU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AAA,CAAC,EAAC,MAAM;AACRC,IAAAA,MAAM,EAAC,cAAc;AACrBC,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,WAAW,EAAC,GAAG;AACfC,IAAAA,YAAY,EAAC;AAAoB,GAClC,CAAC,eAEFlC,KAAA,CAAAmB,aAAA,CAAA,QAAA,EAAA;AAAQC,IAAAA,SAAS,EAAC,OAAO;AAACQ,IAAAA,EAAE,EAAC,IAAI;AAACC,IAAAA,EAAE,EAAC,IAAI;AAACG,IAAAA,IAAI,EAAC;AAAc,GAAE,CAC5D,CACN,eACDhC,KAAA,CAAAmB,aAAA,CAAA,OAAA,EAAA;AAAOgB,IAAAA,OAAO,EAAElB;GAAQ,EAAEZ,KAAa,CACpC,CACF,CAAC;AAEV,CAAC;AAEDN,UAAU,CAACqC,WAAW,GAAG,YAAY;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldSelect/FieldSelect.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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} & React.ComponentPropsWithoutRef<'select'>;\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\nFieldSelect.displayName = 'FieldSelect';\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","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldSelect/FieldSelect.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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} & React.ComponentPropsWithoutRef<'select'>;\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\nFieldSelect.displayName = 'FieldSelect';\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","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG;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;GAAc,eAEnBV,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC;AAA4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A;AAAKN,IAAAA,SAAS,EAAC;AAAY,GAAA,eACzBK,gBAAA,CAAAC,aAAA,CAAA,QAAA,EAAAC,QAAA,CAAA;AACE,IAAA,cAAA,EAAca,KAAK,GAAG,IAAI,GAAGW,SAAU;IACvC,kBAAA,EAAkBX,KAAK,IAAIC,IAAI,GAAA,EAAA,CAAAW,MAAA,CAAMH,MAAM,OAAAG,MAAA,CAAIL,OAAO,CAAA,GAAKP,KAAK,GAAGO,OAAO,GAAGN,IAAI,GAAGQ,MAAM,GAAGE,SAAU;AACvGT,IAAAA,EAAE,EAAEA,EAAG;AACPH,IAAAA,GAAG,EAAEA;AAAI,GAAA,EACLjB,KAAK,CACV,CACE,CACF,CAAC;AAEV,CACF;AAEAe,WAAW,CAACgB,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldSelect/FieldSelect.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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} & React.ComponentPropsWithoutRef<'select'>;\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\nFieldSelect.displayName = 'FieldSelect';\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","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldSelect/FieldSelect.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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} & React.ComponentPropsWithoutRef<'select'>;\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\nFieldSelect.displayName = 'FieldSelect';\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","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG;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;GAAc,eAEnBV,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC;AAA4U,GAAE,CACnV,CAAC,EACLf,QACG,CAAC;AAEX;;;ACRA,IAAMgB,WAAW,gBAAGZ,KAAK,CAACa,UA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ACE,IAAA,cAAA,EAAca,KAAK,GAAG,IAAI,GAAGW,SAAU;IACvC,kBAAA,EAAkBX,KAAK,IAAIC,IAAI,GAAA,EAAA,CAAAW,MAAA,CAAMH,MAAM,OAAAG,MAAA,CAAIL,OAAO,CAAA,GAAKP,KAAK,GAAGO,OAAO,GAAGN,IAAI,GAAGQ,MAAM,GAAGE,SAAU;AACvGT,IAAAA,EAAE,EAAEA,EAAG;AACPH,IAAAA,GAAG,EAAEA;AAAI,GAAA,EACLjB,KAAK,CACV,CACE,CACF,CAAC;AAEV,CACF;AAEAe,WAAW,CAACgB,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextInput/FieldTextInput.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextInputProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldTextInput = React.forwardRef<HTMLInputElement, FieldTextInputProps>(\n ({ className, 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 <input\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 ref={ref}\n {...props}\n />\n </div>\n );\n },\n);\n\nFieldTextInput.displayName = 'FieldTextInput';\n\nexport default FieldTextInput;\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldTextInput","forwardRef","ref","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextInput/FieldTextInput.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextInputProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldTextInput = React.forwardRef<HTMLInputElement, FieldTextInputProps>(\n ({ className, 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 <input\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 ref={ref}\n {...props}\n />\n </div>\n );\n },\n);\n\nFieldTextInput.displayName = 'FieldTextInput';\n\nexport default FieldTextInput;\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldTextInput","forwardRef","ref","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG;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;GAAc,eAEnBV,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC;AAA4U,GAAE,CACnV,CAAC,EACLf,QACG,CAAC;AAEX;;;ACPA,IAAMgB,cAAc,gBAAGZ,gBAAK,CAACa,UAAU,CACrC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ACvC,kBAAA,EAAkBX,KAAK,IAAIC,IAAI,GAAA,EAAA,CAAAW,MAAA,CAAMH,MAAM,OAAAG,MAAA,CAAIL,OAAO,CAAA,GAAKP,KAAK,GAAGO,OAAO,GAAGN,IAAI,GAAGQ,MAAM,GAAGE,SAAU;IACvG/B,SAAS,EAAE,CAAC,gBAAgB,EAAEA,SAAS,CAAC,CAACQ,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAKA,CAAC;AAAA,IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG,CAAE;AACpEY,IAAAA,EAAE,EAAEA,EAAG;AACPH,IAAAA,GAAG,EAAEA;GAAI,EACLjB,KAAK,CACV,CACE,CAAC;AAEV,CACF;AAEAe,cAAc,CAACgB,WAAW,GAAG,gBAAgB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextInput/FieldTextInput.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextInputProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldTextInput = React.forwardRef<HTMLInputElement, FieldTextInputProps>(\n ({ className, 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 <input\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 ref={ref}\n {...props}\n />\n </div>\n );\n },\n);\n\nFieldTextInput.displayName = 'FieldTextInput';\n\nexport default FieldTextInput;\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldTextInput","forwardRef","ref","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextInput/FieldTextInput.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextInputProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n} & React.ComponentPropsWithoutRef<'input'>;\n\nconst FieldTextInput = React.forwardRef<HTMLInputElement, FieldTextInputProps>(\n ({ className, 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 <input\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 ref={ref}\n {...props}\n />\n </div>\n );\n },\n);\n\nFieldTextInput.displayName = 'FieldTextInput';\n\nexport default FieldTextInput;\n"],"names":["ErrorMessage","_ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","_extends","filter","x","join","xmlns","viewBox","height","width","fill","d","FieldTextInput","forwardRef","ref","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG;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;GAAc,eAEnBV,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC;AAA4U,GAAE,CACnV,CAAC,EACLf,QACG,CAAC;AAEX;;;ACPA,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EAAca,KAAK,GAAG,IAAI,GAAGW,SAAU;IACvC,kBAAA,EAAkBX,KAAK,IAAIC,IAAI,GAAA,EAAA,CAAAW,MAAA,CAAMH,MAAM,OAAAG,MAAA,CAAIL,OAAO,CAAA,GAAKP,KAAK,GAAGO,OAAO,GAAGN,IAAI,GAAGQ,MAAM,GAAGE,SAAU;IACvG/B,SAAS,EAAE,CAAC,gBAAgB,EAAEA,SAAS,CAAC,CAACQ,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAKA,CAAC;AAAA,IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG,CAAE;AACpEY,IAAAA,EAAE,EAAEA,EAAG;AACPH,IAAAA,GAAG,EAAEA;GAAI,EACLjB,KAAK,CACV,CACE,CAAC;AAEV,CACF;AAEAe,cAAc,CAACgB,WAAW,GAAG,gBAAgB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextarea/FieldTextarea.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextareaProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n};\n\nexport default function FieldTextarea({\n error,\n hint,\n id,\n isOptional = false,\n label,\n ...props\n}: FieldTextareaProps & React.ComponentPropsWithoutRef<'textarea'>) {\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 <textarea\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n className=\"bds-textarea\"\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","FieldTextarea","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextarea/FieldTextarea.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextareaProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n};\n\nexport default function FieldTextarea({\n error,\n hint,\n id,\n isOptional = false,\n label,\n ...props\n}: FieldTextareaProps & React.ComponentPropsWithoutRef<'textarea'>) {\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 <textarea\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n className=\"bds-textarea\"\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","FieldTextarea","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG;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;GAAc,eAEnBV,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMU,IAAAA,CAAC,EAAC;AAA4U,GAAE,CACnV,CAAC,EACLf,QACG,CAAC;AAEX;;;ACPe,SAASgB,aAAaA,CAAAlB,IAAA,EAO+B;AAAA,EAAA,IANlEmB,KAAK,GAAAnB,IAAA,CAALmB,KAAK;IACLC,IAAI,GAAApB,IAAA,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AGE,SAAU;AACvG7B,IAAAA,SAAS,EAAC,cAAc;AACxBoB,IAAAA,EAAE,EAAEA;GAAG,EACHlB,KAAK,CACV,CACE,CAAC;AAEV;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextarea/FieldTextarea.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextareaProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n};\n\nexport default function FieldTextarea({\n error,\n hint,\n id,\n isOptional = false,\n label,\n ...props\n}: FieldTextareaProps & React.ComponentPropsWithoutRef<'textarea'>) {\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 <textarea\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n className=\"bds-textarea\"\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","FieldTextarea","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/FieldTextarea/FieldTextarea.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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';\n\nimport ErrorMessage from '../ErrorMessage';\n\nexport type FieldTextareaProps = {\n error?: string;\n hint?: React.ReactNode | string;\n id?: string;\n isOptional?: boolean;\n label: string;\n};\n\nexport default function FieldTextarea({\n error,\n hint,\n id,\n isOptional = false,\n label,\n ...props\n}: FieldTextareaProps & React.ComponentPropsWithoutRef<'textarea'>) {\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 <textarea\n aria-invalid={error ? true : undefined}\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n className=\"bds-textarea\"\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","FieldTextarea","error","hint","id","_ref$isOptional","isOptional","label","name","errorId","useId","hintId","htmlFor","undefined","concat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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,EAAA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,EAAE;EAE5B,oBACErB,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKN,IAAAA,SAAS,EAAC;GAAgB,eAC7BK,KAAA,CAAAC,aAAA,CAAA,OAAA,EAAA;AAAOsB,IAAAA,OAAO,EAAER;GAAG,EAChBG,KAAK,EACLD,UAAU,IAAI,aACV,CAAC,EACPH,IAAI,iBACHd,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMN,IAAAA,SAAS,EAAC,UAAU;AAACoB,IAAAA,EAAE,EAAEO;GAAO,EACnCR,IACG,CACP,EACAD,KAAK,iBAAIb,KAAA,CAAAC,aAAA,CAACR,YAAY,EAAA;AAACsB,IAAAA,EAAE,EAAEK;AAAQ,GAAA,EAAEP,KAAoB,CAAC,eAC3Db,KAAA,CAAAC,aAAA,aAAAC,QAAA,CAAA;AACE,IAAA,cAAA,EAAcW,KAAK,GAAG,IAAI,GAAGW,SAAU;IACvC,kBAAA,EAAkBX,KAAK,IAAIC,IAAI,GAAA,EAAA,CAAAW,MAAA,CAAMH,MAAM,OAAAG,MAAA,CAAIL,OAAO,CAAA,GAAKP,KAAK,GAAGO,OAAO,GAAGN,IAAI,GAAGQ,MAAM,GAAGE,SAAU;AACvG7B,IAAAA,SAAS,EAAC,cAAc;AACxBoB,IAAAA,EAAE,EAAEA;GAAG,EACHlB,KAAK,CACV,CACE,CAAC;AAEV;;;;"}
|
package/Fieldset/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/Fieldset/Fieldset.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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 FieldsetProps = {\n error?: string;\n hint?: string;\n isOptional?: boolean;\n legend: React.ReactNode | string;\n showOptionsInline?: boolean;\n};\n\nexport default function Fieldset({\n children,\n className,\n error,\n hint,\n isOptional,\n legend,\n showOptionsInline,\n ...props\n}: FieldsetProps & React.ComponentPropsWithoutRef<'fieldset'>) {\n const errorId = React.useId();\n const hintId = React.useId();\n\n return (\n <div className=\"bds-form-group\">\n <fieldset\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n aria-invalid={error ? true : undefined}\n className={['bds-fieldset', className].filter((x) => x).join(' ')}\n {...props}\n >\n <legend>\n {legend}\n {isOptional && ' (optional)'}\n </legend>\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-form-options\" data-inline-options={showOptionsInline ? '' : undefined}>\n {children}\n </div>\n </fieldset>\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","Fieldset","error","hint","isOptional","legend","showOptionsInline","errorId","useId","hintId","concat","undefined","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/Fieldset/Fieldset.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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 FieldsetProps = {\n error?: string;\n hint?: string;\n isOptional?: boolean;\n legend: React.ReactNode | string;\n showOptionsInline?: boolean;\n};\n\nexport default function Fieldset({\n children,\n className,\n error,\n hint,\n isOptional,\n legend,\n showOptionsInline,\n ...props\n}: FieldsetProps & React.ComponentPropsWithoutRef<'fieldset'>) {\n const errorId = React.useId();\n const hintId = React.useId();\n\n return (\n <div className=\"bds-form-group\">\n <fieldset\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n aria-invalid={error ? true : undefined}\n className={['bds-fieldset', className].filter((x) => x).join(' ')}\n {...props}\n >\n <legend>\n {legend}\n {isOptional && ' (optional)'}\n </legend>\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-form-options\" data-inline-options={showOptionsInline ? '' : undefined}>\n {children}\n </div>\n </fieldset>\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","Fieldset","error","hint","isOptional","legend","showOptionsInline","errorId","useId","hintId","concat","undefined","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG;AAAE,GAAA,EAAKR,KAAK,CAAA,eAC7EG,gBAA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AcT,KAAK,GAAG,IAAI,GAAGS,SAAU;IACvC3B,SAAS,EAAE,CAAC,cAAc,EAAEA,SAAS,CAAC,CAACQ,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAKA,CAAC;IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG;AAAE,GAAA,EAC9DR,KAAK,CAAA,eAETG,gBAAA,CAAAC,aAAA,iBACGe,MAAM,EACND,UAAU,IAAI,aACT,CAAC,EACRD,IAAI,iBACHd,gBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMN,IAAAA,SAAS,EAAC,UAAU;AAAC4B,IAAAA,EAAE,EAAEH;GAAO,EACnCN,IACG,CACP,EACAD,KAAK,iBAAIb,gBAAA,CAAAC,aAAA,CAACR,YAAY,EAAA;AAAC8B,IAAAA,EAAE,EAAEL;AAAQ,GAAA,EAAEL,KAAoB,CAAC,eAC3Db,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKN,IAAAA,SAAS,EAAC,kBAAkB;IAAC,qBAAA,EAAqBsB,iBAAiB,GAAG,EAAE,GAAGK;GAAU,EACvF1B,QACE,CACG,CACP,CAAC;AAEV;;;;"}
|
package/Fieldset/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/Fieldset/Fieldset.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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 FieldsetProps = {\n error?: string;\n hint?: string;\n isOptional?: boolean;\n legend: React.ReactNode | string;\n showOptionsInline?: boolean;\n};\n\nexport default function Fieldset({\n children,\n className,\n error,\n hint,\n isOptional,\n legend,\n showOptionsInline,\n ...props\n}: FieldsetProps & React.ComponentPropsWithoutRef<'fieldset'>) {\n const errorId = React.useId();\n const hintId = React.useId();\n\n return (\n <div className=\"bds-form-group\">\n <fieldset\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n aria-invalid={error ? true : undefined}\n className={['bds-fieldset', className].filter((x) => x).join(' ')}\n {...props}\n >\n <legend>\n {legend}\n {isOptional && ' (optional)'}\n </legend>\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-form-options\" data-inline-options={showOptionsInline ? '' : undefined}>\n {children}\n </div>\n </fieldset>\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","Fieldset","error","hint","isOptional","legend","showOptionsInline","errorId","useId","hintId","concat","undefined","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/ErrorMessage/ErrorMessage.tsx","../../src/Fieldset/Fieldset.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: following this rule does not work for some reason\nimport * 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 FieldsetProps = {\n error?: string;\n hint?: string;\n isOptional?: boolean;\n legend: React.ReactNode | string;\n showOptionsInline?: boolean;\n};\n\nexport default function Fieldset({\n children,\n className,\n error,\n hint,\n isOptional,\n legend,\n showOptionsInline,\n ...props\n}: FieldsetProps & React.ComponentPropsWithoutRef<'fieldset'>) {\n const errorId = React.useId();\n const hintId = React.useId();\n\n return (\n <div className=\"bds-form-group\">\n <fieldset\n aria-describedby={error && hint ? `${hintId} ${errorId}` : error ? errorId : hint ? hintId : undefined}\n aria-invalid={error ? true : undefined}\n className={['bds-fieldset', className].filter((x) => x).join(' ')}\n {...props}\n >\n <legend>\n {legend}\n {isOptional && ' (optional)'}\n </legend>\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-form-options\" data-inline-options={showOptionsInline ? '' : undefined}>\n {children}\n </div>\n </fieldset>\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","Fieldset","error","hint","isOptional","legend","showOptionsInline","errorId","useId","hintId","concat","undefined","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,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;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;IAAA,CAAA,CAAC,CAACC,IAAI,CAAC,GAAG;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,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AAE,GAAA,EAC9DR,KAAK,CAAA,eAETG,KAAA,CAAAC,aAAA,iBACGe,MAAM,EACND,UAAU,IAAI,aACT,CAAC,EACRD,IAAI,iBACHd,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMN,IAAAA,SAAS,EAAC,UAAU;AAAC4B,IAAAA,EAAE,EAAEH;GAAO,EACnCN,IACG,CACP,EACAD,KAAK,iBAAIb,KAAA,CAAAC,aAAA,CAACR,YAAY,EAAA;AAAC8B,IAAAA,EAAE,EAAEL;AAAQ,GAAA,EAAEL,KAAoB,CAAC,eAC3Db,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKN,IAAAA,SAAS,EAAC,kBAAkB;IAAC,qBAAA,EAAqBsB,iBAAiB,GAAG,EAAE,GAAGK;GAAU,EACvF1B,QACE,CACG,CACP,CAAC;AAEV;;;;"}
|
package/Pagination/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/Pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport type PaginationProps = {\n buildPageUrl: (page: number) => string;\n currentPage: number;\n onPageClick?: (page: number) => void;\n totalPages: number;\n};\n\nfunction usePages(currentPage: number, totalPages: number) {\n const pages = [1, currentPage - 1, currentPage, currentPage + 1, totalPages].filter(\n (x) => x >= 1 && x <= totalPages,\n );\n return [...new Set(pages)];\n}\n\nexport default function Pagination({\n buildPageUrl,\n className,\n currentPage,\n onPageClick,\n totalPages,\n ...props\n}: PaginationProps & React.ComponentPropsWithoutRef<'nav'>) {\n const pages = usePages(currentPage, totalPages);\n\n return (\n <nav aria-label=\"pagination\" className={['bds-pagination', className].filter((x) => x).join(' ')} {...props}>\n {currentPage !== 1 && (\n <>\n <a href={buildPageUrl(1)} className=\"bds-first-page\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n height=\"1em\"\n width=\"100%\"\n viewBox=\"0 63.95 512 384.1\"\n >\n <path d=\"M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3v83.4l171.5 142.9zM256 352V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29v-64z\" />\n </svg>\n First\n </a>\n <a aria-label=\"previous\" href={buildPageUrl(currentPage - 1)} rel=\"prev\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n width=\"100%\"\n height=\"1em\"\n viewBox=\"0.02 95.9 192.08 320.17\"\n >\n <path d=\"M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6v256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z\" />\n </svg>\n Prev.\n </a>\n </>\n )}\n <ul>\n {pages.map((page, index) => {\n const handlePageClick = () => {\n if (!onPageClick) return;\n\n onPageClick(page);\n };\n\n return (\n <React.Fragment key={page}>\n <li>\n <a\n aria-current={page === currentPage ? 'page' : undefined}\n href={buildPageUrl(page)}\n onClick={handlePageClick}\n >\n <span className=\"visually-hidden\">Page</span> {page}\n </a>\n </li>\n {pages[index + 1] > page + 1 ? <li data-overflow=\"\">...</li> : null}\n </React.Fragment>\n );\n })}\n </ul>\n {currentPage !== totalPages && (\n <>\n <a href={buildPageUrl(currentPage + 1)} rel=\"next\">\n Next\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"63.9 95.9 192.1 320.17\"\n width=\"100%\"\n height=\"1em\"\n >\n <path d=\"M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9S63.9 115 63.9 128v256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z\" />\n </svg>\n </a>\n <a href={buildPageUrl(totalPages)} className=\"bds-last-page\">\n Last\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n width=\"100%\"\n height=\"1em\"\n viewBox=\"0 63.95 512 384.1\"\n >\n <path d=\"M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4L224 214.3v83.4L52.5 440.6zM256 352V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4S256 428.4 256 416v-64z\" />\n </svg>\n </a>\n </>\n )}\n </nav>\n );\n}\n"],"names":["usePages","currentPage","totalPages","pages","filter","x","_toConsumableArray","Set","Pagination","_ref","buildPageUrl","className","onPageClick","props","_objectWithoutProperties","_excluded","React","createElement","_extends","join","Fragment","href","xmlns","focusable","height","width","viewBox","d","rel","map","page","index","handlePageClick","key","undefined","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,QAAQA,CAACC,WAAmB,EAAEC,UAAkB,EAAE;EACzD,IAAMC,KAAK,GAAG,CAAC,CAAC,EAAEF,WAAW,GAAG,CAAC,EAAEA,WAAW,EAAEA,WAAW,GAAG,CAAC,EAAEC,UAAU,CAAC,CAACE,MAAM,CACjF,UAACC,CAAC,EAAA;AAAA,IAAA,OAAKA,CAAC,IAAI,CAAC,IAAIA,CAAC,IAAIH,UAAU;AAAA,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport type PaginationProps = {\n buildPageUrl: (page: number) => string;\n currentPage: number;\n onPageClick?: (page: number) => void;\n totalPages: number;\n};\n\nfunction usePages(currentPage: number, totalPages: number) {\n const pages = [1, currentPage - 1, currentPage, currentPage + 1, totalPages].filter(\n (x) => x >= 1 && x <= totalPages,\n );\n return [...new Set(pages)];\n}\n\nexport default function Pagination({\n buildPageUrl,\n className,\n currentPage,\n onPageClick,\n totalPages,\n ...props\n}: PaginationProps & React.ComponentPropsWithoutRef<'nav'>) {\n const pages = usePages(currentPage, totalPages);\n\n return (\n <nav aria-label=\"pagination\" className={['bds-pagination', className].filter((x) => x).join(' ')} {...props}>\n {currentPage !== 1 && (\n <>\n <a href={buildPageUrl(1)} className=\"bds-first-page\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n height=\"1em\"\n width=\"100%\"\n viewBox=\"0 63.95 512 384.1\"\n >\n <path d=\"M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3v83.4l171.5 142.9zM256 352V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29v-64z\" />\n </svg>\n First\n </a>\n <a aria-label=\"previous\" href={buildPageUrl(currentPage - 1)} rel=\"prev\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n width=\"100%\"\n height=\"1em\"\n viewBox=\"0.02 95.9 192.08 320.17\"\n >\n <path d=\"M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6v256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z\" />\n </svg>\n Prev.\n </a>\n </>\n )}\n <ul>\n {pages.map((page, index) => {\n const handlePageClick = () => {\n if (!onPageClick) return;\n\n onPageClick(page);\n };\n\n return (\n <React.Fragment key={page}>\n <li>\n <a\n aria-current={page === currentPage ? 'page' : undefined}\n href={buildPageUrl(page)}\n onClick={handlePageClick}\n >\n <span className=\"visually-hidden\">Page</span> {page}\n </a>\n </li>\n {pages[index + 1] > page + 1 ? <li data-overflow=\"\">...</li> : null}\n </React.Fragment>\n );\n })}\n </ul>\n {currentPage !== totalPages && (\n <>\n <a href={buildPageUrl(currentPage + 1)} rel=\"next\">\n Next\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"63.9 95.9 192.1 320.17\"\n width=\"100%\"\n height=\"1em\"\n >\n <path d=\"M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9S63.9 115 63.9 128v256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z\" />\n </svg>\n </a>\n <a href={buildPageUrl(totalPages)} className=\"bds-last-page\">\n Last\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n width=\"100%\"\n height=\"1em\"\n viewBox=\"0 63.95 512 384.1\"\n >\n <path d=\"M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4L224 214.3v83.4L52.5 440.6zM256 352V96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4S256 428.4 256 416v-64z\" />\n </svg>\n </a>\n </>\n )}\n </nav>\n );\n}\n"],"names":["usePages","currentPage","totalPages","pages","filter","x","_toConsumableArray","Set","Pagination","_ref","buildPageUrl","className","onPageClick","props","_objectWithoutProperties","_excluded","React","createElement","_extends","join","Fragment","href","xmlns","focusable","height","width","viewBox","d","rel","map","page","index","handlePageClick","key","undefined","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,QAAQA,CAACC,WAAmB,EAAEC,UAAkB,EAAE;EACzD,IAAMC,KAAK,GAAG,CAAC,CAAC,EAAEF,WAAW,GAAG,CAAC,EAAEA,WAAW,EAAEA,WAAW,GAAG,CAAC,EAAEC,UAAU,CAAC,CAACE,MAAM,CACjF,UAACC,CAAC,EAAA;AAAA,IAAA,OAAKA,CAAC,IAAI,CAAC,IAAIA,CAAC,IAAIH,UAAU;AAAA,EAAA,CAClC,CAAC;AACD,EAAA,OAAAI,kBAAA,CAAW,IAAIC,GAAG,CAACJ,KAAK,CAAC,CAAA;AAC3B;AAEe,SAASK,UAAUA,CAAAC,IAAA,EAO0B;AAAA,EAAA,IAN1DC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IACZC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTV,WAAW,GAAAQ,IAAA,CAAXR,WAAW;IACXW,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXV,UAAU,GAAAO,IAAA,CAAVP,UAAU;AACPW,IAAAA,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA;AAER,EAAA,IAAMZ,KAAK,GAAGH,QAAQ,CAACC,WAAW,EAAEC,UAAU,CAAC;AAE/C,EAAA,oBACEc,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,CAAA;AAAK,IAAA,YAAA,EAAW,YAAY;IAACP,SAAS,EAAE,CAAC,gBAAgB,EAAEA,SAAS,CAAC,CAACP,MAAM,CAAC,UAACC,CAAC,EAAA;AAAA,MAAA,OAAKA,CAAC;IAAA,CAAA,CAAC,CAACc,IAAI,CAA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