@digigov/react-core 1.2.0-mobile → 1.2.0-mobile-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/Base/compat/Input/CheckboxInput/index.js +2 -17
  2. package/Base/compat/Input/CheckboxInput.js.map +2 -2
  3. package/Base/compat/Input/RadioInput/index.js +5 -21
  4. package/Base/compat/Input/RadioInput.js.map +2 -2
  5. package/Base/compat/Input/StringInput/index.js +3 -2
  6. package/Base/compat/Input/StringInput.js.map +2 -2
  7. package/Base/compat/button/index.js +25 -0
  8. package/Base/compat/button/package.json +6 -0
  9. package/Base/compat/button.js.map +7 -0
  10. package/Base/index.native/index.js +6 -40
  11. package/Base/index.native.js.map +3 -3
  12. package/Base/mapping/index.js +4 -16
  13. package/Base/mapping.js.map +2 -2
  14. package/Base/utils/index.js +52 -1
  15. package/Base/utils.d.ts +2 -0
  16. package/Base/utils.js.map +3 -3
  17. package/CheckboxItem/index.js +2 -15
  18. package/CheckboxItem/index.js.map +2 -2
  19. package/CheckboxItemInput/index.d.ts +2 -0
  20. package/CheckboxItemInput/index.js +6 -0
  21. package/CheckboxItemInput/index.js.map +7 -0
  22. package/CheckboxItemInput/index.native/index.js +15 -0
  23. package/CheckboxItemInput/index.native/package.json +6 -0
  24. package/CheckboxItemInput/index.native.d.ts +5 -0
  25. package/CheckboxItemInput/index.native.js.map +7 -0
  26. package/CheckboxItemInput/index.web/index.js +26 -0
  27. package/CheckboxItemInput/index.web/package.json +6 -0
  28. package/CheckboxItemInput/index.web.d.ts +10 -0
  29. package/CheckboxItemInput/index.web.js.map +7 -0
  30. package/CheckboxItemInput/package.json +6 -0
  31. package/CopyToClipboardContainer/index.d.ts +2 -31
  32. package/CopyToClipboardContainer/index.js +3 -40
  33. package/CopyToClipboardContainer/index.js.map +3 -3
  34. package/CopyToClipboardContainer/index.web/index.js +44 -0
  35. package/CopyToClipboardContainer/index.web/package.json +6 -0
  36. package/CopyToClipboardContainer/index.web.d.ts +31 -0
  37. package/CopyToClipboardContainer/index.web.js.map +7 -0
  38. package/CopyToClipboardMessage/index.d.ts +2 -18
  39. package/CopyToClipboardMessage/index.js +3 -21
  40. package/CopyToClipboardMessage/index.js.map +3 -3
  41. package/CopyToClipboardMessage/index.native/index.js +21 -0
  42. package/CopyToClipboardMessage/index.native/package.json +6 -0
  43. package/CopyToClipboardMessage/index.native.d.ts +7 -0
  44. package/CopyToClipboardMessage/index.native.js.map +7 -0
  45. package/CopyToClipboardMessage/index.web/index.js +24 -0
  46. package/CopyToClipboardMessage/index.web/package.json +6 -0
  47. package/CopyToClipboardMessage/index.web.d.ts +18 -0
  48. package/CopyToClipboardMessage/index.web.js.map +7 -0
  49. package/TextInput/index.d.ts +2 -46
  50. package/TextInput/index.js +3 -40
  51. package/TextInput/index.js.map +3 -3
  52. package/TextInput/index.native/index.js +15 -0
  53. package/TextInput/index.native/package.json +6 -0
  54. package/TextInput/index.native.d.ts +5 -0
  55. package/TextInput/index.native.js.map +7 -0
  56. package/TextInput/index.web/index.js +43 -0
  57. package/TextInput/index.web/package.json +6 -0
  58. package/TextInput/index.web.d.ts +46 -0
  59. package/TextInput/index.web.js.map +7 -0
  60. package/cjs/Base/compat/Input/CheckboxInput/index.js +1 -16
  61. package/cjs/Base/compat/Input/CheckboxInput.js.map +2 -2
  62. package/cjs/Base/compat/Input/RadioInput/index.js +4 -20
  63. package/cjs/Base/compat/Input/RadioInput.js.map +2 -2
  64. package/cjs/Base/compat/Input/StringInput/index.js +3 -2
  65. package/cjs/Base/compat/Input/StringInput.js.map +2 -2
  66. package/cjs/Base/compat/button/index.js +60 -0
  67. package/cjs/Base/compat/button.js.map +7 -0
  68. package/cjs/Base/index.native/index.js +5 -39
  69. package/cjs/Base/index.native.js.map +3 -3
  70. package/cjs/Base/mapping/index.js +2 -14
  71. package/cjs/Base/mapping.js.map +3 -3
  72. package/cjs/Base/utils/index.js +54 -2
  73. package/cjs/Base/utils.js.map +4 -4
  74. package/cjs/CheckboxItem/index.js +2 -15
  75. package/cjs/CheckboxItem/index.js.map +3 -3
  76. package/cjs/CheckboxItemInput/index.js +40 -0
  77. package/cjs/CheckboxItemInput/index.js.map +7 -0
  78. package/cjs/CheckboxItemInput/index.native/index.js +48 -0
  79. package/cjs/CheckboxItemInput/index.native.js.map +7 -0
  80. package/cjs/CheckboxItemInput/index.web/index.js +59 -0
  81. package/cjs/CheckboxItemInput/index.web.js.map +7 -0
  82. package/cjs/CopyToClipboardContainer/index.js +5 -41
  83. package/cjs/CopyToClipboardContainer/index.js.map +3 -3
  84. package/cjs/CopyToClipboardContainer/index.web/index.js +77 -0
  85. package/cjs/CopyToClipboardContainer/index.web.js.map +7 -0
  86. package/cjs/CopyToClipboardMessage/index.js +5 -22
  87. package/cjs/CopyToClipboardMessage/index.js.map +3 -3
  88. package/cjs/CopyToClipboardMessage/index.native/index.js +54 -0
  89. package/cjs/CopyToClipboardMessage/index.native.js.map +7 -0
  90. package/cjs/CopyToClipboardMessage/index.web/index.js +57 -0
  91. package/cjs/CopyToClipboardMessage/index.web.js.map +7 -0
  92. package/cjs/TextInput/index.js +5 -41
  93. package/cjs/TextInput/index.js.map +3 -3
  94. package/cjs/TextInput/index.native/index.js +48 -0
  95. package/cjs/TextInput/index.native.js.map +7 -0
  96. package/cjs/TextInput/index.web/index.js +76 -0
  97. package/cjs/TextInput/index.web.js.map +7 -0
  98. package/package.json +4 -2
  99. package/src/Base/compat/Input/CheckboxInput.tsx +6 -22
  100. package/src/Base/compat/Input/RadioInput.tsx +6 -25
  101. package/src/Base/compat/Input/StringInput.tsx +12 -5
  102. package/src/Base/compat/button.tsx +21 -0
  103. package/src/Base/index.native.tsx +132 -155
  104. package/src/Base/mapping.tsx +3 -14
  105. package/src/Base/{utils.ts → utils.tsx} +63 -1
  106. package/src/CheckboxItem/index.tsx +2 -12
  107. package/src/CheckboxItemInput/index.native.tsx +10 -0
  108. package/src/CheckboxItemInput/index.tsx +2 -0
  109. package/src/CheckboxItemInput/index.web.tsx +34 -0
  110. package/src/CopyToClipboardContainer/index.tsx +2 -74
  111. package/src/CopyToClipboardContainer/index.web.tsx +75 -0
  112. package/src/CopyToClipboardMessage/index.native.tsx +24 -0
  113. package/src/CopyToClipboardMessage/index.tsx +2 -41
  114. package/src/CopyToClipboardMessage/index.web.tsx +41 -0
  115. package/src/TextInput/index.native.tsx +10 -0
  116. package/src/TextInput/index.tsx +2 -87
  117. package/src/TextInput/index.web.tsx +87 -0
@@ -1,22 +1,7 @@
1
1
  import React from "react";
2
- import { TouchableOpacity, View, StyleSheet } from "react-native";
2
+ import { TouchableOpacity, View } from "react-native";
3
3
  const CheckboxInput = React.forwardRef(function CheckboxInput2({ checked, onChange, ...props }, ref) {
4
- return /* @__PURE__ */ React.createElement(TouchableOpacity, { ref, onPress: () => onChange({ currentTarget: { checked: !checked } }), ...props }, /* @__PURE__ */ React.createElement(View, { style: styles.checkbox }, checked && /* @__PURE__ */ React.createElement(View, { style: styles.checkmark })));
5
- });
6
- const styles = StyleSheet.create({
7
- checkbox: {
8
- width: 20,
9
- height: 20,
10
- borderWidth: 2,
11
- borderColor: "#000",
12
- justifyContent: "center",
13
- alignItems: "center"
14
- },
15
- checkmark: {
16
- width: 12,
17
- height: 12,
18
- backgroundColor: "#000"
19
- }
4
+ return /* @__PURE__ */ React.createElement(TouchableOpacity, { ref, onPress: () => onChange({ currentTarget: { checked: !checked, value: props.value } }), ...props }, checked && /* @__PURE__ */ React.createElement(View, { className: "ds-checkboxes__input--checked" }));
20
5
  });
21
6
  var CheckboxInput_default = CheckboxInput;
22
7
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/Base/compat/Input/CheckboxInput.tsx"],
4
- "sourcesContent": ["import React, { DetailedHTMLProps, InputHTMLAttributes } from \"react\";\nimport { TouchableOpacity, View, StyleSheet } from \"react-native\";\n\ntype HTMLElementProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n \"ref\"\n>;\nexport const CheckboxInput = React.forwardRef(function CheckboxInput({ checked, onChange, ...props }, ref){\n return (\n <TouchableOpacity ref={ref} onPress={()=>onChange({currentTarget:{checked:!checked}})} {...props}>\n <View style={styles.checkbox}>\n {checked && <View style={styles.checkmark} />}\n </View>\n </TouchableOpacity>\n );\n});\n\nconst styles = StyleSheet.create({\n checkbox: {\n width: 20,\n height: 20,\n borderWidth: 2,\n borderColor: '#000',\n justifyContent: 'center',\n alignItems: 'center',\n },\n checkmark: {\n width: 12,\n height: 12,\n backgroundColor: '#000',\n },\n});\n\nexport default CheckboxInput;\n"],
5
- "mappings": "AAAA,OAAO,WAAuD;AAC9D,SAAS,kBAAkB,MAAM,kBAAkB;AAM5C,MAAM,gBAAgB,MAAM,WAAW,SAASA,eAAc,EAAE,SAAS,UAAU,GAAG,MAAM,GAAG,KAAI;AACxG,SACE,oCAAC,oBAAiB,KAAU,SAAS,MAAI,SAAS,EAAC,eAAc,EAAC,SAAQ,CAAC,QAAO,EAAC,CAAC,GAAI,GAAG,SACzF,oCAAC,QAAK,OAAO,OAAO,YACjB,WAAW,oCAAC,QAAK,OAAO,OAAO,WAAW,CAC7C,CACF;AAEJ,CAAC;AAED,MAAM,SAAS,WAAW,OAAO;AAAA,EAC/B,UAAU;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,YAAY;AAAA,EACd;AAAA,EACA,WAAW;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB;AAAA,EACnB;AACF,CAAC;AAED,IAAO,wBAAQ;",
4
+ "sourcesContent": ["import React, { DetailedHTMLProps, InputHTMLAttributes } from \"react\";\nimport { TouchableOpacity, View } from \"react-native\";\n\ntype HTMLElementProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n \"ref\"\n>;\n\nexport const CheckboxInput = React.forwardRef(function CheckboxInput({ checked, onChange, ...props }, ref) {\n\n return (\n <TouchableOpacity ref={ref} onPress={() => onChange({ currentTarget: { checked: !checked, value: props.value } })} {...props}>\n {checked && <View className=\"ds-checkboxes__input--checked\" />}\n </TouchableOpacity>\n );\n});\n\nexport default CheckboxInput;\n"],
5
+ "mappings": "AAAA,OAAO,WAAuD;AAC9D,SAAS,kBAAkB,YAAY;AAOhC,MAAM,gBAAgB,MAAM,WAAW,SAASA,eAAc,EAAE,SAAS,UAAU,GAAG,MAAM,GAAG,KAAK;AAEzG,SACE,oCAAC,oBAAiB,KAAU,SAAS,MAAM,SAAS,EAAE,eAAe,EAAE,SAAS,CAAC,SAAS,OAAO,MAAM,MAAM,EAAE,CAAC,GAAI,GAAG,SACpH,WAAW,oCAAC,QAAK,WAAU,iCAAgC,CAC9D;AAEJ,CAAC;AAED,IAAO,wBAAQ;",
6
6
  "names": ["CheckboxInput"]
7
7
  }
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
- import { TouchableOpacity, View, StyleSheet } from "react-native";
2
+ import { TouchableOpacity, View } from "react-native";
3
3
  const RadioInput = React.forwardRef(function RadioInput2({
4
4
  value,
5
- checked = false,
6
- onChange
5
+ checked,
6
+ onChange,
7
+ ...props
7
8
  }, ref) {
8
9
  const handlePress = () => {
9
10
  if (onChange) {
@@ -16,26 +17,9 @@ const RadioInput = React.forwardRef(function RadioInput2({
16
17
  onChange(syntheticEvent);
17
18
  }
18
19
  };
19
- return /* @__PURE__ */ React.createElement(TouchableOpacity, { ref, onPress: handlePress }, /* @__PURE__ */ React.createElement(View, { style: styles.outerCircle }, checked && /* @__PURE__ */ React.createElement(View, { style: styles.innerCircle })));
20
+ return /* @__PURE__ */ React.createElement(TouchableOpacity, { ref, onPress: handlePress, ...props }, checked && /* @__PURE__ */ React.createElement(View, { className: "ds-radios__input--checked" }));
20
21
  });
21
22
  var RadioInput_default = RadioInput;
22
- const styles = StyleSheet.create({
23
- outerCircle: {
24
- height: 24,
25
- width: 24,
26
- borderRadius: 12,
27
- borderWidth: 2,
28
- borderColor: "#000",
29
- alignItems: "center",
30
- justifyContent: "center"
31
- },
32
- innerCircle: {
33
- height: 12,
34
- width: 12,
35
- borderRadius: 6,
36
- backgroundColor: "#000"
37
- }
38
- });
39
23
  export {
40
24
  RadioInput,
41
25
  RadioInput_default as default
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/Base/compat/Input/RadioInput.tsx"],
4
- "sourcesContent": ["import React, { DetailedHTMLProps, InputHTMLAttributes } from \"react\";\nimport { TouchableOpacity, View, Text, StyleSheet } from \"react-native\";\n\ntype HTMLElementProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n \"ref\"\n>;\n\nexport const RadioInput = React.forwardRef(function RadioInput({\n value,\n checked = false,\n onChange,\n}: HTMLElementProps, ref) {\n const handlePress = () => {\n if (onChange) {\n const syntheticEvent = {\n target: {\n value,\n checked: true,\n },\n } as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n return (\n <TouchableOpacity ref={ref} onPress={handlePress}>\n <View style={styles.outerCircle}>\n {checked && <View style={styles.innerCircle} />}\n </View>\n </TouchableOpacity>\n );\n});\n\nexport default RadioInput;\n\nconst styles = StyleSheet.create({\n outerCircle: {\n height: 24,\n width: 24,\n borderRadius: 12,\n borderWidth: 2,\n borderColor: '#000',\n alignItems: 'center',\n justifyContent: 'center',\n },\n innerCircle: {\n height: 12,\n width: 12,\n borderRadius: 6,\n backgroundColor: '#000',\n },\n});\n"],
5
- "mappings": "AAAA,OAAO,WAAuD;AAC9D,SAAS,kBAAkB,MAAY,kBAAkB;AAOlD,MAAM,aAAa,MAAM,WAAW,SAASA,YAAW;AAAA,EAC7D;AAAA,EACA,UAAU;AAAA,EACV;AACF,GAAqB,KAAK;AACxB,QAAM,cAAc,MAAM;AACxB,QAAI,UAAU;AACZ,YAAM,iBAAiB;AAAA,QACrB,QAAQ;AAAA,UACN;AAAA,UACA,SAAS;AAAA,QACX;AAAA,MACF;AACA,eAAS,cAAc;AAAA,IACzB;AAAA,EACF;AACA,SACE,oCAAC,oBAAiB,KAAU,SAAS,eACnC,oCAAC,QAAK,OAAO,OAAO,eACjB,WAAW,oCAAC,QAAK,OAAO,OAAO,aAAa,CAC/C,CACF;AAEJ,CAAC;AAED,IAAO,qBAAQ;AAEf,MAAM,SAAS,WAAW,OAAO;AAAA,EAC/B,aAAa;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,cAAc;AAAA,IACd,aAAa;AAAA,IACb,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,gBAAgB;AAAA,EAClB;AAAA,EACA,aAAa;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,cAAc;AAAA,IACd,iBAAiB;AAAA,EACnB;AACF,CAAC;",
4
+ "sourcesContent": ["import React, { DetailedHTMLProps, InputHTMLAttributes } from \"react\";\nimport { TouchableOpacity, View } from \"react-native\";\n\ntype HTMLElementProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n \"ref\"\n>;\n\nexport const RadioInput = React.forwardRef(function RadioInput({\n value,\n checked,\n onChange,\n ...props\n}, ref) {\n const handlePress = () => {\n if (onChange) {\n const syntheticEvent = {\n target: {\n value,\n checked: true,\n },\n } as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n return (\n <TouchableOpacity ref={ref} onPress={handlePress} {...props}>\n {checked && <View className=\"ds-radios__input--checked\" />}\n </TouchableOpacity>\n );\n});\n\nexport default RadioInput;\n"],
5
+ "mappings": "AAAA,OAAO,WAAuD;AAC9D,SAAS,kBAAkB,YAAY;AAOhC,MAAM,aAAa,MAAM,WAAW,SAASA,YAAW;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,KAAK;AACN,QAAM,cAAc,MAAM;AACxB,QAAI,UAAU;AACZ,YAAM,iBAAiB;AAAA,QACrB,QAAQ;AAAA,UACN;AAAA,UACA,SAAS;AAAA,QACX;AAAA,MACF;AACA,eAAS,cAAc;AAAA,IACzB;AAAA,EACF;AACA,SACE,oCAAC,oBAAiB,KAAU,SAAS,aAAc,GAAG,SACnD,WAAW,oCAAC,QAAK,WAAU,6BAA4B,CAC1D;AAEJ,CAAC;AAED,IAAO,qBAAQ;",
6
6
  "names": ["RadioInput"]
7
7
  }
@@ -1,6 +1,7 @@
1
1
  import React, { useEffect } from "react";
2
2
  import { TextInput } from "react-native";
3
- const StringInput = React.forwardRef(function StringInput2({
3
+ import { wrap } from "../../utils";
4
+ const StringInput = wrap(React.forwardRef(function StringInput2({
4
5
  type,
5
6
  onChange,
6
7
  onBlur,
@@ -59,7 +60,7 @@ const StringInput = React.forwardRef(function StringInput2({
59
60
  ...props
60
61
  }
61
62
  );
62
- });
63
+ }));
63
64
  export {
64
65
  StringInput
65
66
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/Base/compat/Input/StringInput.tsx"],
4
- "sourcesContent": ["import React, { DetailedHTMLProps, InputHTMLAttributes, useEffect } from \"react\";\nimport { TextInput } from \"react-native\";\n\ntype HTMLElementProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n \"ref\"\n>;\n\nexport const StringInput = React.forwardRef(function StringInput({type, onChange, onBlur, onFocus, value,maxLength,\n \"aria-activedescendant\": ariaActivedescendant,\n \"aria-owns\": ariaOwns,\n \"aria-autocomplete\": ariaAutocomplete,\n \"aria-expanded\": ariaExpanded,\n \n ...props}: HTMLElementProps, ref) {\n switch (type) {\n case \"email\":\n props.keyboardType = \"email-address\";\n break;\n case \"password\":\n props.secureTextEntry = true;\n break;\n case \"number\":\n props.keyboardType = \"numeric\";\n break;\n case \"tel\":\n props.keyboardType = \"phone-pad\";\n break;\n case \"url\":\n props.keyboardType = \"url\";\n break;\n default:\n props.keyboardType = \"default\";\n }\n const [currentValue, setValue] = React.useState(value);\n useEffect(()=>{\n if(currentValue !== value){\n onChange?.({ target: { value: currentValue } })\n }\n\n },[currentValue])\n useEffect(()=>{\n if(currentValue !== value){\n setValue(value)\n }\n },[value])\n return <TextInput\n ref={ref}\n onChangeText={setValue}\n onBlur={()=>{onBlur?.({ target: { value: currentValue } })}}\n onFocus={()=>{onFocus?.({ target: { value: currentValue } })}}\n value={currentValue}\n maxLength={Number(maxLength) || undefined}\n {...props} />;\n});\n\n"],
5
- "mappings": "AAAA,OAAO,SAAiD,iBAAiB;AACzE,SAAS,iBAAiB;AAOnB,MAAM,cAAc,MAAM,WAAW,SAASA,aAAY;AAAA,EAAC;AAAA,EAAM;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAM;AAAA,EACvG,yBAAyB;AAAA,EACzB,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EAEjB,GAAG;AAAK,GAAqB,KAAK;AAClC,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,YAAM,eAAe;AACrB;AAAA,IACF,KAAK;AACH,YAAM,kBAAkB;AACxB;AAAA,IACF,KAAK;AACH,YAAM,eAAe;AACrB;AAAA,IACF,KAAK;AACH,YAAM,eAAe;AACrB;AAAA,IACF,KAAK;AACH,YAAM,eAAe;AACrB;AAAA,IACF;AACE,YAAM,eAAe;AAAA,EACzB;AACA,QAAM,CAAC,cAAc,QAAQ,IAAI,MAAM,SAAS,KAAK;AACrD,YAAU,MAAI;AACZ,QAAG,iBAAiB,OAAM;AACxB,iBAAW,EAAE,QAAQ,EAAE,OAAO,aAAa,EAAE,CAAC;AAAA,IAChD;AAAA,EAEF,GAAE,CAAC,YAAY,CAAC;AAChB,YAAU,MAAI;AACZ,QAAG,iBAAiB,OAAM;AACxB,eAAS,KAAK;AAAA,IAChB;AAAA,EACF,GAAE,CAAC,KAAK,CAAC;AACT,SAAO;AAAA,IAAC;AAAA;AAAA,MACN;AAAA,MACA,cAAc;AAAA,MACd,QAAQ,MAAI;AAAC,iBAAS,EAAE,QAAQ,EAAE,OAAO,aAAa,EAAE,CAAC;AAAA,MAAC;AAAA,MAC1D,SAAS,MAAI;AAAC,kBAAU,EAAE,QAAQ,EAAE,OAAO,aAAa,EAAE,CAAC;AAAA,MAAC;AAAA,MAC5D,OAAO;AAAA,MACP,WAAW,OAAO,SAAS,KAAK;AAAA,MACjC,GAAG;AAAA;AAAA,EAAO;AACb,CAAC;",
4
+ "sourcesContent": ["import React, { DetailedHTMLProps, InputHTMLAttributes, useEffect } from \"react\";\nimport { TextInput, } from \"react-native\";\nimport { wrap } from \"../../utils\";\n\ntype HTMLElementProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n \"ref\"\n>;\n\nexport const StringInput = wrap(React.forwardRef(function StringInput({\n type, \n onChange, \n onBlur, \n onFocus, \n value,\n maxLength,\n \"aria-activedescendant\": ariaActivedescendant,\n \"aria-owns\": ariaOwns,\n \"aria-autocomplete\": ariaAutocomplete,\n \"aria-expanded\": ariaExpanded,\n ...props\n}: HTMLElementProps, ref) {\n switch (type) {\n case \"email\":\n props.keyboardType = \"email-address\";\n break;\n case \"password\":\n props.secureTextEntry = true;\n break;\n case \"number\":\n props.keyboardType = \"numeric\";\n break;\n case \"tel\":\n props.keyboardType = \"phone-pad\";\n break;\n case \"url\":\n props.keyboardType = \"url\";\n break;\n default:\n props.keyboardType = \"default\";\n }\n const [currentValue, setValue] = React.useState(value);\n useEffect(()=>{\n if(currentValue !== value){\n onChange?.({ target: { value: currentValue } })\n }\n\n },[currentValue])\n useEffect(()=>{\n if(currentValue !== value){\n setValue(value)\n }\n },[value])\n return <TextInput\n ref={ref}\n onChangeText={setValue}\n onBlur={()=>{onBlur?.({ target: { value: currentValue } })}}\n onFocus={()=>{onFocus?.({ target: { value: currentValue } })}}\n value={currentValue}\n maxLength={Number(maxLength) || undefined}\n {...props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ACb,CAAC,CAAC;",
6
6
  "names": ["StringInput"]
7
7
  }
@@ -0,0 +1,25 @@
1
+ import { FormContext } from "@digigov/form/FormContext";
2
+ import { Pressable } from "react-native";
3
+ import React, { useContext } from "react";
4
+ const FormButton = React.forwardRef(function FormButton2({ onClick, ...props }, ref) {
5
+ const formContext = useContext(FormContext);
6
+ return /* @__PURE__ */ React.createElement(CompatButton, { ...props, onClick: () => {
7
+ onClick && onClick();
8
+ formContext?.[props.type]();
9
+ } });
10
+ });
11
+ const CompatButton = React.forwardRef(function CompatButton2({ onClick, ...props }, ref) {
12
+ return /* @__PURE__ */ React.createElement(Pressable, { onPress: onClick, ref, hitSlop: 10, ...props });
13
+ });
14
+ const Button = React.forwardRef(function Button2(props, ref) {
15
+ if (["submit", "reset"].includes(props.type)) {
16
+ return /* @__PURE__ */ React.createElement(FormButton, { ref, ...props });
17
+ }
18
+ return /* @__PURE__ */ React.createElement(CompatButton, { ref, ...props });
19
+ });
20
+ export {
21
+ Button,
22
+ CompatButton,
23
+ FormButton
24
+ };
25
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "types": "./index.d.ts",
5
+ "main": "../../../cjs/Base/compat/button/index.js"
6
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/Base/compat/button.tsx"],
4
+ "sourcesContent": ["import { FormContext } from '@digigov/form/FormContext';\nimport { Pressable } from \"react-native\";\nimport React, { useContext } from 'react';\nexport const FormButton = React.forwardRef(function FormButton({onClick, ...props}, ref) {\n const formContext = useContext(FormContext)\n return <CompatButton {...props} onClick={()=>{\n onClick && onClick();\n formContext?.[props.type]();\n }} />;\n});\n\nexport const CompatButton = React.forwardRef(function CompatButton({onClick, ...props}, ref) {\n return <Pressable onPress={onClick} ref={ref} hitSlop={10} {...props} />;\n});\n\nexport const Button = React.forwardRef(function Button(props, ref) {\n if (['submit', 'reset'].includes(props.type)) {\n return <FormButton ref={ref} {...props} />\n }\n return <CompatButton ref={ref} {...props} />;\n});\n"],
5
+ "mappings": "AAAA,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B,OAAO,SAAS,kBAAkB;AAC3B,MAAM,aAAa,MAAM,WAAW,SAASA,YAAW,EAAC,SAAS,GAAG,MAAK,GAAG,KAAK;AACvF,QAAM,cAAc,WAAW,WAAW;AAC1C,SAAO,oCAAC,gBAAc,GAAG,OAAO,SAAS,MAAI;AAC3C,eAAW,QAAQ;AACnB,kBAAc,MAAM,IAAI,EAAE;AAAA,EAC5B,GAAG;AACL,CAAC;AAEM,MAAM,eAAe,MAAM,WAAW,SAASC,cAAa,EAAC,SAAS,GAAG,MAAK,GAAG,KAAK;AAC3F,SAAO,oCAAC,aAAU,SAAS,SAAS,KAAU,SAAS,IAAK,GAAG,OAAO;AACxE,CAAC;AAEM,MAAM,SAAS,MAAM,WAAW,SAASC,QAAO,OAAO,KAAK;AACjE,MAAI,CAAC,UAAU,OAAO,EAAE,SAAS,MAAM,IAAI,GAAG;AAC5C,WAAO,oCAAC,cAAW,KAAW,GAAG,OAAO;AAAA,EAC1C;AACA,SAAO,oCAAC,gBAAa,KAAW,GAAG,OAAO;AAC5C,CAAC;",
6
+ "names": ["FormButton", "CompatButton", "Button"]
7
+ }
@@ -1,34 +1,7 @@
1
- import React, { useState } from "react";
1
+ import React from "react";
2
2
  import { Text, View } from "react-native";
3
3
  import { mapping } from "@digigov/react-core/Base/mapping";
4
- import clsx from "clsx";
5
- import { basePropGenerator } from "./utils";
6
- const WrapperComponent = ({ classNames, focused, ...props }) => {
7
- const focusedClassNames = focused ? classNames.map((cls) => `${cls}--focus`).join(" ") : " ";
8
- return /* @__PURE__ */ React.createElement(View, { className: clsx(classNames.join(" "), focusedClassNames), ...props });
9
- };
10
- const Focusable = ({ wrapperClassNames, Component }) => {
11
- return React.forwardRef(function Focusable2(props, ref) {
12
- const [focused, setFocused] = useState(false);
13
- return /* @__PURE__ */ React.createElement(WrapperComponent, { classNames: wrapperClassNames, focused }, /* @__PURE__ */ React.createElement(
14
- Component,
15
- {
16
- ref,
17
- onFocus: () => {
18
- if (wrapperClassNames.length) {
19
- setFocused(true);
20
- }
21
- },
22
- onBlur: () => {
23
- if (wrapperClassNames.length) {
24
- setFocused(false);
25
- }
26
- },
27
- ...props
28
- }
29
- ));
30
- });
31
- };
4
+ import { basePropGenerator, wrap } from "@digigov/react-core/Base/utils";
32
5
  const BooleanMapper = {
33
6
  true: true,
34
7
  false: false,
@@ -80,14 +53,7 @@ const Base = React.forwardRef(function Base2({
80
53
  "aria-expanded": ariaExpanded,
81
54
  ...props
82
55
  }, ref) {
83
- const wrapperClassNames = [];
84
- const classNames = (className?.split(" ") || []).filter((cls) => {
85
- if (cls.endsWith("__wrapper")) {
86
- wrapperClassNames.push(cls);
87
- return false;
88
- }
89
- return true;
90
- });
56
+ const classNames = className?.split(" ") || [];
91
57
  if (typeof children === "string") {
92
58
  children = [children];
93
59
  }
@@ -118,8 +84,8 @@ const Base = React.forwardRef(function Base2({
118
84
  });
119
85
  }
120
86
  let Component = mapping[as] || View;
121
- if (wrapperClassNames.length > 0) {
122
- Component = Focusable({ wrapperClassNames, Component });
87
+ if (classNames.find((className2) => className2.match(/__wrapper|__before|__after$/))) {
88
+ Component = wrap(Component);
123
89
  }
124
90
  Object.keys(props).forEach((k) => {
125
91
  if (k.startsWith("aria")) {
@@ -172,7 +138,7 @@ const Base = React.forwardRef(function Base2({
172
138
  mdHidden,
173
139
  lgHidden,
174
140
  xlHidden,
175
- className: (classNames || []).join(" ")
141
+ className
176
142
  })
177
143
  },
178
144
  children
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Base/index.native.tsx"],
4
- "sourcesContent": ["import React, { useRef, useState } from \"react\";\nimport { Text, View, ViewProps } from \"react-native\";\nimport { mapping } from \"@digigov/react-core/Base/mapping\";\nimport { BaseProps as CoreBaseProps } from \"@digigov/react-core/Base/index\";\nimport clsx from 'clsx';\nimport { basePropGenerator } from \"./utils\";\nexport type BaseProps<C extends React.ElementType> = CoreBaseProps<C> &\n ViewProps;\nexport type BaseComponent = <C extends React.ElementType = \"span\">(\n props: BaseProps<C>\n) => React.ReactNode | null;\nconst WrapperComponent = ({classNames, focused, ...props})=>{\n const focusedClassNames = focused ? classNames.map(cls=>`${cls}--focus`).join(' ') :' '\n return <View className={clsx(classNames.join(' '), focusedClassNames)} {...props} />\n}\nconst Focusable = ({ wrapperClassNames, Component}) =>{\n return React.forwardRef(function Focusable(props, ref){\n const [focused, setFocused] = useState(false);\n return <WrapperComponent classNames={wrapperClassNames} focused={focused}>\n <Component\n ref={ref}\n onFocus={() => {\n if (wrapperClassNames.length) {\n setFocused(true)\n }\n }}\n onBlur={() => {\n if (wrapperClassNames.length) {\n setFocused(false)\n }\n }}\n {...props}\n />\n </WrapperComponent>\n })\n}\nconst BooleanMapper = {\n true: true,\n false: false,\n undefined: false,\n null: false,\n \"\": false,\n};\nexport const Base: BaseComponent = React.forwardRef(function Base({\n as,\n children,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n m,\n mt,\n mb,\n ml,\n mr,\n mx,\n my,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n p,\n pt,\n pb,\n pr,\n pl,\n px,\n py,\n printHidden,\n printVisible,\n hidden,\n xsUpHidden,\n smUpHidden,\n mdUpHidden,\n lgUpHidden,\n xlUpHidden,\n xsHidden,\n smHidden,\n mdHidden,\n lgHidden,\n xlHidden,\n className,\n 'aria-expanded': ariaExpanded,\n ...props\n}, ref) {\n const wrapperClassNames: string[] = []\n \n const classNames = (className?.split(\" \") || [])\n .filter((cls) => {\n if (cls.endsWith('__wrapper')){\n wrapperClassNames.push(cls)\n return false\n }\n return true\n })\n \n if (typeof children === \"string\") {\n children = [children];\n }\n if (Array.isArray(children)) {\n const textClassNames = classNames?.map((className) => `${className}__text`).join(\" \")\n children = children.map((child, index) => {\n if(Array.isArray(child)) {\n return child.map((child, index) => {\n if (typeof child === \"string\") {\n return (\n <Text key={index} className={textClassNames}>\n {child}\n </Text>\n );\n }\n return child;\n });\n }else if (typeof child === \"string\") {\n return (\n <Text key={index} className={textClassNames}\n {...props.onClick && {\n onPress: props.onClick\n }}\n >\n {child}\n </Text>\n );\n }\n return child;\n });\n }\n let Component = mapping[as as keyof JSX.IntrinsicElements] || View;\n\n if(wrapperClassNames.length > 0){\n Component = Focusable({wrapperClassNames, Component})\n }\n Object.keys(props).forEach((k)=>{\n if(k.startsWith('aria')){\n if(BooleanMapper[props[k]] !== undefined){\n props[k] = BooleanMapper[props[k]]\n }\n }\n })\n return (\n <Component\n {...props}\n ref={ref}\n aria-expanded={ariaExpanded === 'false'? false : ariaExpanded === true? true: undefined}\n className={\n basePropGenerator({\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n m,\n mt,\n mb,\n ml,\n mr,\n mx,\n my,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n p,\n pt,\n pb,\n pr,\n pl,\n px,\n py,\n printHidden,\n printVisible,\n hidden,\n xsUpHidden,\n smUpHidden,\n mdUpHidden,\n lgUpHidden,\n xlUpHidden,\n xsHidden,\n smHidden,\n mdHidden,\n lgHidden,\n xlHidden,\n className: (classNames|| []).join(' ')\n })\n }\n >\n {children}\n </Component>\n\n );\n});\n\nexport default Base;"],
5
- "mappings": "AAAA,OAAO,SAAiB,gBAAgB;AACxC,SAAS,MAAM,YAAuB;AACtC,SAAS,eAAe;AAExB,OAAO,UAAU;AACjB,SAAS,yBAAyB;AAMlC,MAAM,mBAAmB,CAAC,EAAC,YAAY,SAAS,GAAG,MAAK,MAAI;AAC1D,QAAM,oBAAoB,UAAU,WAAW,IAAI,SAAK,GAAG,GAAG,SAAS,EAAE,KAAK,GAAG,IAAG;AACpF,SAAO,oCAAC,QAAK,WAAW,KAAK,WAAW,KAAK,GAAG,GAAG,iBAAiB,GAAI,GAA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iB,UAAS,QAAQ,iBAAiB,OAAM,OAAM;AAAA,MAC9E,WACE,kBAAkB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAY,cAAa,CAAC,GAAG,KAAK,GAAG;AAAA,MACvC,CAAC;AAAA;AAAA,IAGF;AAAA,EACH;AAGN,CAAC;AAED,IAAO,uBAAQ;",
6
- "names": ["Focusable", "Base", "className", "child", "index"]
4
+ "sourcesContent": ["import React, { useRef, useState } from 'react';\nimport { Text, View, ViewProps } from 'react-native';\nimport { mapping } from '@digigov/react-core/Base/mapping';\nimport { BaseProps as CoreBaseProps } from '@digigov/react-core/Base/index.web';\nimport clsx from 'clsx';\nimport { basePropGenerator, wrap } from '@digigov/react-core/Base/utils';\nexport type BaseProps<C extends React.ElementType> = CoreBaseProps<C> &\n ViewProps;\nexport type BaseComponent = <C extends React.ElementType = 'span'>(\n props: BaseProps<C>\n) => React.ReactNode | null;\n\n\nconst BooleanMapper = {\n true: true,\n false: false,\n undefined: false,\n null: false,\n '': false,\n};\nexport const Base: BaseComponent = React.forwardRef(function Base(\n {\n as,\n children,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n m,\n mt,\n mb,\n ml,\n mr,\n mx,\n my,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n p,\n pt,\n pb,\n pr,\n pl,\n px,\n py,\n printHidden,\n printVisible,\n hidden,\n xsUpHidden,\n smUpHidden,\n mdUpHidden,\n lgUpHidden,\n xlUpHidden,\n xsHidden,\n smHidden,\n mdHidden,\n lgHidden,\n xlHidden,\n className,\n 'aria-expanded': ariaExpanded,\n ...props\n },\n ref\n) {\n const classNames = className?.split(' ') || []\n if (typeof children === 'string') {\n children = [children];\n }\n if (Array.isArray(children)) {\n const textClassNames = classNames\n ?.map((className) => `${className}__text`)\n .join(' ');\n children = children.map((child, index) => {\n if (Array.isArray(child)) {\n return child.map((child, index) => {\n if (typeof child === 'string') {\n return (\n <Text key={index} className={textClassNames}>\n {child}\n </Text>\n );\n }\n return child;\n });\n } else if (typeof child === 'string') {\n return (\n <Text\n key={index}\n className={textClassNames}\n {...(props.onClick && {\n onPress: props.onClick,\n })}\n >\n {child}\n </Text>\n );\n }\n return child;\n });\n }\n let Component = mapping[as as keyof JSX.IntrinsicElements] || View;\n if(classNames.find((className) => className.match(/__wrapper|__before|__after$/))) {\n Component = wrap(Component)\n }\n\n Object.keys(props).forEach((k) => {\n if (k.startsWith('aria')) {\n if (BooleanMapper[props[k]] !== undefined) {\n props[k] = BooleanMapper[props[k]];\n }\n }\n });\n return (\n <Component\n {...props}\n ref={ref}\n aria-expanded={\n ariaExpanded === 'false'\n ? false\n : ariaExpanded === true\n ? true\n : undefined\n }\n className={basePropGenerator({\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n m,\n mt,\n mb,\n ml,\n mr,\n mx,\n my,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n p,\n pt,\n pb,\n pr,\n pl,\n px,\n py,\n printHidden,\n printVisible,\n hidden,\n xsUpHidden,\n smUpHidden,\n mdUpHidden,\n lgUpHidden,\n xlUpHidden,\n xsHidden,\n smHidden,\n mdHidden,\n lgHidden,\n xlHidden,\n className,\n })}\n >\n {children}\n </Component>\n );\n});\n\nexport default Base;\n"],
5
+ "mappings": "AAAA,OAAO,WAAiC;AACxC,SAAS,MAAM,YA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-1,27 +1,15 @@
1
- import { Pressable, Image, TextInput } from "react-native";
2
- import React, { useContext } from "react";
1
+ import { Image, TextInput } from "react-native";
2
+ import React from "react";
3
3
  import BaseInput from "./compat/Input";
4
4
  import CompatDetails from "./compat/details";
5
5
  import Svg, { Path, Circle, Rect, G, Polygon } from "react-native-svg";
6
6
  import { Link } from "expo-router";
7
- import { FormContext } from "@digigov/form/FormContext";
8
7
  import { Ol } from "./compat/ol";
9
- const Button = (props) => {
10
- return /* @__PURE__ */ React.createElement(Pressable, { onPress: props.onClick, hitSlop: 10, ...props });
11
- };
12
- const SubmitButton = (props) => {
13
- const formContext = useContext(FormContext);
14
- return /* @__PURE__ */ React.createElement(Button, { ...props, onClick: formContext?.submit });
15
- };
8
+ import { Button } from "./compat/button";
16
9
  const mapping = {
17
10
  a: Link,
18
11
  img: Image,
19
- button: React.forwardRef(function CompatButton(props, ref) {
20
- if (props.type === "submit") {
21
- return /* @__PURE__ */ React.createElement(SubmitButton, { ref, ...props });
22
- }
23
- return /* @__PURE__ */ React.createElement(Button, { ref, ...props });
24
- }),
12
+ button: Button,
25
13
  input: BaseInput,
26
14
  textarea: React.forwardRef(function TextAreaInput(props, ref) {
27
15
  return /* @__PURE__ */ React.createElement(TextInput, { ref, multiline: true, scrollEnabled: true, ...props });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Base/mapping.tsx"],
4
- "sourcesContent": ["import { Pressable, Image, Text, TextInput, View } from \"react-native\";\nimport React, { useContext } from \"react\";\nimport BaseInput from \"./compat/Input\";\nimport CompatDetails from \"./compat/details\";\nimport Svg, { Path, Circle, Rect, G, Polygon } from \"react-native-svg\";\nimport { Link } from \"expo-router\";\nimport { FormContext } from '@digigov/form/FormContext';\nimport {Li} from \"./compat/li\";\nimport {Ol} from \"./compat/ol\";\nexport type MapProps<T extends keyof JSX.IntrinsicElements> =\n React.ComponentPropsWithoutRef<T>;\nexport type MappingType = {\n [K in keyof JSX.IntrinsicElements]?: (props: MapProps<K>) => JSX.Element;\n};\n\nconst Button = (props) => {\n return <Pressable onPress={props.onClick} hitSlop={10} {...props} />;\n};\nconst SubmitButton = (props) => {\n const formContext = useContext(FormContext)\n return <Button {...props} onClick={formContext?.submit} />;\n};\nexport const mapping: MappingType = {\n a: Link,\n img: Image,\n button: React.forwardRef(function CompatButton(props,ref) {\n if(props.type === 'submit') {\n return <SubmitButton ref={ref} {...props} />\n }\n return <Button ref={ref} {...props} />\n }),\n input: BaseInput,\n textarea: React.forwardRef(function TextAreaInput(props,ref) {\n return <TextInput ref={ref} multiline={true} scrollEnabled={true} {...props} />\n }),\n details: CompatDetails,\n ol: Ol,\n path: Path,\n svg: Svg,\n rect: Rect,\n circle: Circle,\n g: G,\n polygon: Polygon,\n};\n"],
5
- "mappings": "AAAA,SAAS,WAAW,OAAa,iBAAuB;AACxD,OAAO,SAAS,kBAAkB;AAClC,OAAO,eAAe;AACtB,OAAO,mBAAmB;AAC1B,OAAO,OAAO,MAAM,QAAQ,MAAM,GAAG,eAAe;AACpD,SAAS,YAAY;AACrB,SAAS,mBAAmB;AAE5B,SAAQ,UAAS;AAOjB,MAAM,SAAS,CAAC,UAAU;AACxB,SAAO,oCAAC,aAAU,SAAS,MAAM,SAAS,SAAS,IAAK,GAAG,OAAO;AACpE;AACA,MAAM,eAAe,CAAC,UAAU;AAC9B,QAAM,cAAc,WAAW,WAAW;AAC1C,SAAO,oCAAC,UAAQ,GAAG,OAAO,SAAS,aAAa,QAAQ;AAC1D;AACO,MAAM,UAAuB;AAAA,EAClC,GAAG;AAAA,EACH,KAAK;AAAA,EACL,QAAQ,MAAM,WAAW,SAAS,aAAa,OAAM,KAAK;AACxD,QAAG,MAAM,SAAS,UAAU;AAC1B,aAAO,oCAAC,gBAAa,KAAW,GAAG,OAAO;AAAA,IAC5C;AACA,WAAO,oCAAC,UAAO,KAAW,GAAG,OAAO;AAAA,EACtC,CAAC;AAAA,EACD,OAAO;AAAA,EACP,UAAU,MAAM,WAAW,SAAS,cAAc,OAAM,KAAK;AAC3D,WAAO,oCAAC,aAAU,KAAU,WAAW,MAAM,eAAe,MAAO,GAAG,OAAO;AAAA,EAC/E,CAAC;AAAA,EACD,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,GAAG;AAAA,EACH,SAAS;AACX;",
4
+ "sourcesContent": ["import { Pressable, Image, Text, TextInput, View } from \"react-native\";\nimport React, { useContext } from \"react\";\nimport BaseInput from \"./compat/Input\";\nimport CompatDetails from \"./compat/details\";\nimport Svg, { Path, Circle, Rect, G, Polygon } from \"react-native-svg\";\nimport { Link } from \"expo-router\";\nimport {Li} from \"./compat/li\";\nimport {Ol} from \"./compat/ol\";\nimport { Button } from \"./compat/button\";\nexport type MapProps<T extends keyof JSX.IntrinsicElements> =\n React.ComponentPropsWithoutRef<T>;\nexport type MappingType = {\n [K in keyof JSX.IntrinsicElements]?: (props: MapProps<K>) => JSX.Element;\n};\n\n\nexport const mapping: MappingType = {\n a: Link,\n img: Image,\n button: Button,\n input: BaseInput,\n textarea: React.forwardRef(function TextAreaInput(props,ref) {\n return <TextInput ref={ref} multiline={true} scrollEnabled={true} {...props} />\n }),\n details: CompatDetails,\n ol: Ol,\n path: Path,\n svg: Svg,\n rect: Rect,\n circle: Circle,\n g: G,\n polygon: Polygon,\n};\n"],
5
+ "mappings": "AAAA,SAAoB,OAAa,iBAAuB;AACxD,OAAO,WAA2B;AAClC,OAAO,eAAe;AACtB,OAAO,mBAAmB;AAC1B,OAAO,OAAO,MAAM,QAAQ,MAAM,GAAG,eAAe;AACpD,SAAS,YAAY;AAErB,SAAQ,UAAS;AACjB,SAAS,cAAc;AAQhB,MAAM,UAAuB;AAAA,EAClC,GAAG;AAAA,EACH,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU,MAAM,WAAW,SAAS,cAAc,OAAM,KAAK;AAC3D,WAAO,oCAAC,aAAU,KAAU,WAAW,MAAM,eAAe,MAAO,GAAG,OAAO;AAAA,EAC/E,CAAC;AAAA,EACD,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,GAAG;AAAA,EACH,SAAS;AACX;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,6 @@
1
1
  import clsx from "clsx";
2
+ import React, { useContext, useMemo, useState } from "react";
3
+ import { View } from "react-native";
2
4
  const basePropGenerator = ({
3
5
  margin,
4
6
  marginTop,
@@ -78,7 +80,56 @@ const basePropGenerator = ({
78
80
  "ds-hidden-lg": !!lgHidden,
79
81
  "ds-hidden-xl": !!xlHidden
80
82
  });
83
+ const WrapperContext = React.createContext((cls) => {
84
+ return cls;
85
+ });
86
+ const Wrapper = ({ children }) => {
87
+ const [className, setClassName] = useState("");
88
+ return /* @__PURE__ */ React.createElement(WrapperContext.Provider, { value: setClassName }, /* @__PURE__ */ React.createElement(View, { className, focusable: false }, children));
89
+ };
90
+ const wrap = (Component) => {
91
+ const WrappedComponent = React.forwardRef(({ className, onBlur, onFocus, ...props }, ref) => {
92
+ const setClassName = useContext(WrapperContext);
93
+ const wrapperClassNames = [];
94
+ const beforeClassNames = [];
95
+ const afterClassNames = [];
96
+ const focusedWrapperClassNames = [];
97
+ const classNames = useMemo(() => (className?.split(" ") || []).filter((cls) => {
98
+ if (cls.endsWith("__wrapper")) {
99
+ wrapperClassNames.push(cls);
100
+ focusedWrapperClassNames.push(`${cls}--focus`);
101
+ return false;
102
+ } else if (cls.endsWith("__before")) {
103
+ beforeClassNames.push(cls);
104
+ return false;
105
+ } else if (cls.endsWith("__after")) {
106
+ afterClassNames.push(cls);
107
+ return false;
108
+ }
109
+ return true;
110
+ }), []);
111
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, beforeClassNames.length ? /* @__PURE__ */ React.createElement(View, { focusable: false, className: beforeClassNames.join(" ") }) : "", /* @__PURE__ */ React.createElement(
112
+ Component,
113
+ {
114
+ onFocus: (e) => {
115
+ setClassName(focusedWrapperClassNames.join(" "));
116
+ onFocus && onFocus(e);
117
+ },
118
+ onBlur: (e) => {
119
+ setClassName(wrapperClassNames.join(" "));
120
+ onBlur && onBlur(e);
121
+ },
122
+ className: classNames.join(" "),
123
+ ...props
124
+ }
125
+ ), afterClassNames.length ? /* @__PURE__ */ React.createElement(View, { focusable: false, className: afterClassNames.join(" ") }) : "");
126
+ });
127
+ return React.forwardRef(function Wrapped({ ...props }, ref) {
128
+ return /* @__PURE__ */ React.createElement(Wrapper, null, /* @__PURE__ */ React.createElement(WrappedComponent, { ...props, ref }));
129
+ });
130
+ };
81
131
  export {
82
- basePropGenerator
132
+ basePropGenerator,
133
+ wrap
83
134
  };
84
135
  //# sourceMappingURL=utils.js.map
package/Base/utils.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  export declare const basePropGenerator: ({ margin, marginTop, marginBottom, marginLeft, marginRight, m, mt, mb, ml, mr, mx, my, padding, paddingTop, paddingBottom, paddingLeft, paddingRight, p, pt, pb, pr, pl, px, py, printHidden, printVisible, hidden, xsUpHidden, smUpHidden, mdUpHidden, lgUpHidden, xlUpHidden, xsHidden, smHidden, mdHidden, lgHidden, xlHidden, className, }: {
2
3
  margin: any;
3
4
  marginTop: any;
@@ -38,3 +39,4 @@ export declare const basePropGenerator: ({ margin, marginTop, marginBottom, marg
38
39
  xlHidden: any;
39
40
  className: any;
40
41
  }) => string;
42
+ export declare const wrap: (Component: any) => React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
package/Base/utils.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/Base/utils.ts"],
4
- "sourcesContent": ["import clsx from 'clsx';\n\nexport const basePropGenerator = ({\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n m,\n mt,\n mb,\n ml,\n mr,\n mx,\n my,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n p,\n pt,\n pb,\n pr,\n pl,\n px,\n py,\n printHidden,\n printVisible,\n hidden,\n xsUpHidden,\n smUpHidden,\n mdUpHidden,\n lgUpHidden,\n xlUpHidden,\n xsHidden,\n smHidden,\n mdHidden,\n lgHidden,\n xlHidden,\n className,\n}) => clsx(className, {\n [`ds-m-${margin}`]: margin !== undefined ? true : undefined,\n [`ds-mt-${marginTop}`]: marginTop !== undefined ? true : undefined,\n [`ds-mb-${marginBottom}`]:\n marginBottom !== undefined ? true : undefined,\n [`ds-mr-${marginRight}`]: marginRight !== undefined ? true : undefined,\n [`ds-ml-${marginLeft}`]: marginLeft !== undefined ? true : undefined,\n [`ds-m-${m}`]: m !== undefined ? true : undefined,\n [`ds-mt-${mt}`]: mt !== undefined ? true : undefined,\n [`ds-mb-${mb}`]: mb !== undefined ? true : undefined,\n [`ds-mr-${mr}`]: mr !== undefined ? true : undefined,\n [`ds-ml-${ml}`]: ml !== undefined ? true : undefined,\n [`ds-mx-${mx}`]: mx !== undefined ? true : undefined,\n [`ds-my-${my}`]: my !== undefined ? true : undefined,\n [`ds-p-${padding}`]: padding !== undefined ? true : undefined,\n [`ds-pt-${paddingTop}`]: paddingTop !== undefined ? true : undefined,\n [`ds-pb-${paddingBottom}`]:\n paddingBottom !== undefined ? true : undefined,\n [`ds-pr-${paddingRight}`]:\n paddingRight !== undefined ? true : undefined,\n [`ds-pl-${paddingLeft}`]: paddingLeft !== undefined ? true : undefined,\n [`ds-p-${p}`]: p !== undefined ? true : undefined,\n [`ds-pt-${pt}`]: pt !== undefined ? true : undefined,\n [`ds-pb-${pb}`]: pb !== undefined ? true : undefined,\n [`ds-pr-${pr}`]: pr !== undefined ? true : undefined,\n [`ds-pl-${pl}`]: pl !== undefined ? true : undefined,\n [`ds-px-${px}`]: px !== undefined ? true : undefined,\n [`ds-py-${py}`]: py !== undefined ? true : undefined,\n 'ds-print-hidden': !!printHidden,\n 'ds-print-visible-block': printVisible === 'block',\n 'ds-print-visible-inline': printVisible === 'inline',\n 'ds-hidden': !!hidden,\n 'ds-hidden-xs-up': !!xsUpHidden,\n 'ds-hidden-sm-up': !!smUpHidden,\n 'ds-hidden-md-up': !!mdUpHidden,\n 'ds-hidden-lg-up': !!lgUpHidden,\n 'ds-hidden-xl-up': !!xlUpHidden,\n 'ds-hidden-xs': !!xsHidden,\n 'ds-hidden-sm': !!smHidden,\n 'ds-hidden-md': !!mdHidden,\n 'ds-hidden-lg': !!lgHidden,\n 'ds-hidden-xl': !!xlHidden,\n})"],
5
- "mappings": "AAAA,OAAO,UAAU;AAEV,MAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM,KAAK,WAAW;AAAA,EACpB,CAAC,QAAQ,MAAM,EAAE,GAAG,WAAW,SAAY,OAAO;AAAA,EAClD,CAAC,SAAS,SAAS,EAAE,GAAG,cAAc,SAAY,OAAO;AAAA,EACzD,CAAC,SAAS,YAAY,EAAE,GACtB,iBAAiB,SAAY,OAAO;AAAA,EACtC,CAAC,SAAS,WAAW,EAAE,GAAG,gBAAgB,SAAY,OAAO;AAAA,EAC7D,CAAC,SAAS,UAAU,EAAE,GAAG,eAAe,SAAY,OAAO;AAAA,EAC3D,CAAC,QAAQ,CAAC,EAAE,GAAG,MAAM,SAAY,OAAO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;AAAA,EACf,mBAAmB,CAAC,CAAC;AAAA,EACrB,mBAAmB,CAAC,CAAC;AAAA,EACrB,mBAAmB,CAAC,CAAC;AAAA,EACrB,mBAAmB,CAAC,CAAC;AAAA,EACrB,mBAAmB,CAAC,CAAC;AAAA,EACrB,gBAAgB,CAAC,CAAC;AAAA,EAClB,gBAAgB,CAAC,CAAC;AAAA,EAClB,gBAAgB,CAAC,CAAC;AAAA,EAClB,gBAAgB,CAAC,CAAC;AAAA,EAClB,gBAAgB,CAAC,CAAC;AACpB,CAAC;",
3
+ "sources": ["../../src/Base/utils.tsx"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport React, { useContext, useMemo, useState } from 'react';\nimport { View } from 'react-native';\n\nexport const basePropGenerator = ({\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n m,\n mt,\n mb,\n ml,\n mr,\n mx,\n my,\n padding,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n p,\n pt,\n pb,\n pr,\n pl,\n px,\n py,\n printHidden,\n printVisible,\n hidden,\n xsUpHidden,\n smUpHidden,\n mdUpHidden,\n lgUpHidden,\n xlUpHidden,\n xsHidden,\n smHidden,\n mdHidden,\n lgHidden,\n xlHidden,\n className,\n}) => clsx(className, {\n [`ds-m-${margin}`]: margin !== undefined ? true : undefined,\n [`ds-mt-${marginTop}`]: marginTop !== undefined ? true : undefined,\n [`ds-mb-${marginBottom}`]:\n marginBottom !== undefined ? true : undefined,\n [`ds-mr-${marginRight}`]: marginRight !== undefined ? true : undefined,\n [`ds-ml-${marginLeft}`]: marginLeft !== undefined ? true : undefined,\n [`ds-m-${m}`]: m !== undefined ? true : undefined,\n [`ds-mt-${mt}`]: mt !== undefined ? true : undefined,\n [`ds-mb-${mb}`]: mb !== undefined ? true : undefined,\n [`ds-mr-${mr}`]: mr !== undefined ? true : undefined,\n [`ds-ml-${ml}`]: ml !== undefined ? true : undefined,\n [`ds-mx-${mx}`]: mx !== undefined ? true : undefined,\n [`ds-my-${my}`]: my !== undefined ? true : undefined,\n [`ds-p-${padding}`]: padding !== undefined ? true : undefined,\n [`ds-pt-${paddingTop}`]: paddingTop !== undefined ? true : undefined,\n [`ds-pb-${paddingBottom}`]:\n paddingBottom !== undefined ? true : undefined,\n [`ds-pr-${paddingRight}`]:\n paddingRight !== undefined ? true : undefined,\n [`ds-pl-${paddingLeft}`]: paddingLeft !== undefined ? true : undefined,\n [`ds-p-${p}`]: p !== undefined ? true : undefined,\n [`ds-pt-${pt}`]: pt !== undefined ? true : undefined,\n [`ds-pb-${pb}`]: pb !== undefined ? true : undefined,\n [`ds-pr-${pr}`]: pr !== undefined ? true : undefined,\n [`ds-pl-${pl}`]: pl !== undefined ? true : undefined,\n [`ds-px-${px}`]: px !== undefined ? true : undefined,\n [`ds-py-${py}`]: py !== undefined ? true : undefined,\n 'ds-print-hidden': !!printHidden,\n 'ds-print-visible-block': printVisible === 'block',\n 'ds-print-visible-inline': printVisible === 'inline',\n 'ds-hidden': !!hidden,\n 'ds-hidden-xs-up': !!xsUpHidden,\n 'ds-hidden-sm-up': !!smUpHidden,\n 'ds-hidden-md-up': !!mdUpHidden,\n 'ds-hidden-lg-up': !!lgUpHidden,\n 'ds-hidden-xl-up': !!xlUpHidden,\n 'ds-hidden-xs': !!xsHidden,\n 'ds-hidden-sm': !!smHidden,\n 'ds-hidden-md': !!mdHidden,\n 'ds-hidden-lg': !!lgHidden,\n 'ds-hidden-xl': !!xlHidden,\n})\nconst WrapperContext = React.createContext((cls)=>{return cls});\nconst Wrapper = ({children})=>{\n const [className, setClassName] = useState('');\n return <WrapperContext.Provider value={setClassName}>\n <View className={className} focusable={false}>\n {children}\n </View>\n </WrapperContext.Provider>\n}\n\nexport const wrap = (Component) => {\n // @ts-ignore\n const WrappedComponent = React.forwardRef(({className, onBlur, onFocus, ...props}, ref)=>{\n const setClassName = useContext(WrapperContext);\n const wrapperClassNames: string[] = [];\n const beforeClassNames: string[] = [];\n const afterClassNames: string[] = [];\n const focusedWrapperClassNames: string[] = []\n const classNames = useMemo(() => (className?.split(' ') || []).filter((cls) => {\n if (\n cls.endsWith('__wrapper')\n ) {\n wrapperClassNames.push(cls);\n focusedWrapperClassNames.push(`${cls}--focus`);\n return false;\n } else if (cls.endsWith('__before')) {\n beforeClassNames.push(cls);\n return false;\n } else if (cls.endsWith('__after')) {\n afterClassNames.push(cls);\n return false;\n }\n return true;\n }), []);\n return <>\n {beforeClassNames.length ? <View focusable={false} className={beforeClassNames.join(' ')} />: ''}\n <Component\n onFocus={(e) => {\n setClassName(focusedWrapperClassNames.join(' '));\n onFocus && onFocus(e);\n }}\n onBlur={(e) => {\n setClassName(wrapperClassNames.join(' '));\n onBlur && onBlur(e);\n }}\n className={classNames.join(' ')}\n {...props}\n />\n {afterClassNames.length ? <View focusable={false} className={afterClassNames.join(' ')} />: ''}\n\n </>\n })\n return React.forwardRef(function Wrapped({ ...props }, ref) {\n return (\n <Wrapper>\n <WrappedComponent {...props} ref={ref}/>\n </Wrapper>\n );\n });\n};"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAS,YAAY,SAAS,gBAAgB;AACrD,SAAS,YAAY;AAEd,MAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM,KAAK,WAAW;AAAA,EACpB,CAAC,QAAQ,MAAM,EAAE,GAAG,WAAW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CAAC,GAAG,OAAO,CAAC,QAAQ;AAC7E,UACE,IAAI,SAAS,WAAW,GACxB;AACA,0BAAkB,KAAK,GAAG;AAC1B,iCAAyB,KAAK,GAAG,GAAG,SAAS;AAC7C,eAAO;AAAA,MACT,WAAW,IAAI,SAAS,UAAU,GAAG;AACnC,yBAAiB,KAAK,GAAG;AACzB,eAAO;AAAA,MACT,WAAW,IAAI,SAAS,SAAS,GAAG;AAClC,wBAAgB,KAAK,GAAG;AACxB,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT,CAAC,GAAG,CAAC,CAAC;AACN,WAAO,0DACJ,iBAAiB,SAAS,oCAAC,QAAK,WAAW,OAAO,WAAW,iBAAiB,KAAK,GAAG,GAAG,IAAI,IAC9F;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,CAAC,MAAM;AACd,uBAAa,yBAAyB,KAAK,GAAG,CAAC;AAC/C,qBAAW,QAAQ,CAAC;AAAA,QACtB;AAAA,QACA,QAAQ,CAAC,MAAM;AACb,uBAAa,kBAAkB,KAAK,GAAG,CAAC;AACxC,oBAAU,OAAO,CAAC;AAAA,QACpB;AAAA,QACA,WAAW,WAAW,KAAK,GAAG;AAAA,QAC7B,GAAG;AAAA;AAAA,IACN,GACC,gBAAgB,SAAS,oCAAC,QAAK,WAAW,OAAO,WAAW,gBAAgB,KAAK,GAAG,GAAG,IAAI,EAE9F;AAAA,EACF,CAAC;AACD,SAAO,MAAM,WAAW,SAAS,QAAQ,EAAE,GAAG,MAAM,GAAG,KAAK;AAC1D,WACE,oCAAC,eACC,oCAAC,oBAAkB,GAAG,OAAQ,KAAS,CACzC;AAAA,EAEJ,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import clsx from "clsx";
3
3
  import Base from "@digigov/react-core/Base";
4
4
  import ChoiceDividerText from "@digigov/react-core/ChoiceDividerText";
5
+ import CheckboxItemInput from "@digigov/react-core/CheckboxItemInput";
5
6
  import LabelContainer from "@digigov/react-core/LabelContainer";
6
7
  const CheckboxItem = React.forwardRef(function CheckboxItem2({ name, value, dividerText, className, disabled, children, ...props }, ref) {
7
8
  return /* @__PURE__ */ React.createElement(React.Fragment, null, dividerText && /* @__PURE__ */ React.createElement(ChoiceDividerText, null, dividerText), /* @__PURE__ */ React.createElement(
@@ -21,21 +22,7 @@ const CheckboxItem = React.forwardRef(function CheckboxItem2({ name, value, divi
21
22
  })
22
23
  },
23
24
  children,
24
- /* @__PURE__ */ React.createElement(
25
- Base,
26
- {
27
- as: "input",
28
- ref,
29
- type: "checkbox",
30
- name,
31
- value,
32
- className: clsx({
33
- "ds-checkboxes__input": true
34
- }),
35
- disabled,
36
- ...props
37
- }
38
- )
25
+ /* @__PURE__ */ React.createElement(CheckboxItemInput, { ref, name, value, disabled, ...props })
39
26
  )
40
27
  ));
41
28
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/CheckboxItem/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\nimport ChoiceDividerText from '@digigov/react-core/ChoiceDividerText';\nimport LabelContainer from '@digigov/react-core/LabelContainer';\n\nexport interface CheckboxItemProps extends BaseProps<'input'> {\n /**\n * dividerText is optional.\n * Add this prop to add a choice divider on top of a checkbox item.\n * The string is the text that it will appear above this checkbox item.\n */\n dividerText?: string;\n}\n/**\n * Details for the CheckboxItem.\n * CheckboxItem component allows the user to select one or more checkboxes\n * CheckboxItem must be used inside Checkbox component\n */\nexport const CheckboxItem = React.forwardRef<\n HTMLInputElement,\n CheckboxItemProps\n>(function CheckboxItem(\n { name, value, dividerText, className, disabled, children, ...props },\n ref\n) {\n return (\n <>\n {dividerText && <ChoiceDividerText>{dividerText}</ChoiceDividerText>}\n <Base as='div'\n className={clsx(className, {\n 'ds-checkboxes__item': true,\n })}\n >\n <LabelContainer\n className={clsx({\n 'ds-checkboxes__label': true,\n 'ds-checkboxes__label--disabled': disabled,\n })}\n >\n {children}\n <Base\n as=\"input\"\n ref={ref}\n type=\"checkbox\"\n name={name}\n value={value}\n className={clsx({\n 'ds-checkboxes__input': true,\n })}\n disabled={disabled}\n {...props}\n />\n </LabelContainer>\n </Base>\n </>\n );\n});\n\nexport default CheckboxItem;\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAChC,OAAO,uBAAuB;AAC9B,OAAO,oBAAoB;AAepB,MAAM,eAAe,MAAM,WAGhC,SAASA,cACT,EAAE,MAAM,OAAO,aAAa,WAAW,UAAU,UAAU,GAAG,MAAM,GACpE,KACA;AACA,SACE,0DACG,eAAe,oCAAC,yBAAmB,WAAY,GAChD;AAAA,IAAC;AAAA;AAAA,MAAK,IAAG;AAAA,MACP,WAAW,KAAK,WAAW;AAAA,QACzB,uBAAuB;AAAA,MACzB,CAAC;AAAA;AAAA,IAED;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,KAAK;AAAA,UACd,wBAAwB;AAAA,UACxB,kCAAkC;AAAA,QACpC,CAAC;AAAA;AAAA,MAEA;AAAA,MACD;AAAA,QAAC;AAAA;AAAA,UACC,IAAG;AAAA,UACH;AAAA,UACA,MAAK;AAAA,UACL;AAAA,UACA;AAAA,UACA,WAAW,KAAK;AAAA,YACd,wBAAwB;AAAA,UAC1B,CAAC;AAAA,UACD;AAAA,UACC,GAAG;AAAA;AAAA,MACN;AAAA,IACF;AAAA,EACF,CACF;AAEJ,CAAC;AAED,IAAO,uBAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\nimport ChoiceDividerText from '@digigov/react-core/ChoiceDividerText';\nimport CheckboxItemInput from '@digigov/react-core/CheckboxItemInput';\nimport LabelContainer from '@digigov/react-core/LabelContainer';\n\nexport interface CheckboxItemProps extends BaseProps<'input'> {\n /**\n * dividerText is optional.\n * Add this prop to add a choice divider on top of a checkbox item.\n * The string is the text that it will appear above this checkbox item.\n */\n dividerText?: string;\n}\n/**\n * Details for the CheckboxItem.\n * CheckboxItem component allows the user to select one or more checkboxes\n * CheckboxItem must be used inside Checkbox component\n */\nexport const CheckboxItem = React.forwardRef<\n HTMLInputElement,\n CheckboxItemProps\n>(function CheckboxItem(\n { name, value, dividerText, className, disabled, children, ...props },\n ref\n) {\n return (\n <>\n {dividerText && <ChoiceDividerText>{dividerText}</ChoiceDividerText>}\n <Base as='div'\n className={clsx(className, {\n 'ds-checkboxes__item': true,\n })}\n >\n <LabelContainer\n className={clsx({\n 'ds-checkboxes__label': true,\n 'ds-checkboxes__label--disabled': disabled,\n })}\n >\n {children}\n <CheckboxItemInput ref={ref} name={name} value={value} disabled={disabled} {...props} />\n </LabelContainer>\n </Base>\n </>\n );\n});\n\nexport default CheckboxItem;\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAChC,OAAO,uBAAuB;AAC9B,OAAO,uBAAuB;AAC9B,OAAO,oBAAoB;AAepB,MAAM,eAAe,MAAM,WAGhC,SAASA,cACT,EAAE,MAAM,OAAO,aAAa,WAAW,UAAU,UAAU,GAAG,MAAM,GACpE,KACA;AACA,SACE,0DACG,eAAe,oCAAC,yBAAmB,WAAY,GAChD;AAAA,IAAC;AAAA;AAAA,MAAK,IAAG;AAAA,MACP,WAAW,KAAK,WAAW;AAAA,QACzB,uBAAuB;AAAA,MACzB,CAAC;AAAA;AAAA,IAED;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,KAAK;AAAA,UACd,wBAAwB;AAAA,UACxB,kCAAkC;AAAA,QACpC,CAAC;AAAA;AAAA,MAEA;AAAA,MACD,oCAAC,qBAAkB,KAAU,MAAY,OAAc,UAAqB,GAAG,OAAO;AAAA,IACxF;AAAA,EACF,CACF;AAEJ,CAAC;AAED,IAAO,uBAAQ;",
6
6
  "names": ["CheckboxItem"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ export * from '@digigov/react-core/CheckboxItemInput/index.web';
2
+ export { default as default } from '@digigov/react-core/CheckboxItemInput/index.web';
@@ -0,0 +1,6 @@
1
+ export * from "@digigov/react-core/CheckboxItemInput/index.web";
2
+ import { default as default2 } from "@digigov/react-core/CheckboxItemInput/index.web";
3
+ export {
4
+ default2 as default
5
+ };
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/CheckboxItemInput/index.tsx"],
4
+ "sourcesContent": ["export * from '@digigov/react-core/CheckboxItemInput/index.web';\nexport { default as default } from '@digigov/react-core/CheckboxItemInput/index.web';"],
5
+ "mappings": "AAAA,cAAc;AACd,SAAoB,WAAXA,gBAA0B;",
6
+ "names": ["default"]
7
+ }
@@ -0,0 +1,15 @@
1
+ import extend from "@digigov/react-core/utils/extend";
2
+ import CoreCheckboxItemInput from "@digigov/react-core/CheckboxItemInput/index.web";
3
+ import clsx from "clsx";
4
+ const CheckboxItemInput = extend(CoreCheckboxItemInput, ({ className, ...props }) => ({
5
+ ...props,
6
+ className: clsx(className, {
7
+ "ds-checkboxes__input__wrapper": true
8
+ })
9
+ }));
10
+ var index_native_default = CheckboxItemInput;
11
+ export {
12
+ CheckboxItemInput,
13
+ index_native_default as default
14
+ };
15
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "types": "./index.d.ts",
5
+ "main": "../../cjs/CheckboxItemInput/index.native/index.js"
6
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const CheckboxItemInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@digigov/react-core/CheckboxItemInput/index.web").CheckboxItemInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & {
3
+ className?: string | undefined;
4
+ }, "ref"> & import("react").RefAttributes<unknown>>;
5
+ export default CheckboxItemInput;
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/CheckboxItemInput/index.native.tsx"],
4
+ "sourcesContent": ["import extend from '@digigov/react-core/utils/extend';\nimport CoreCheckboxItemInput from '@digigov/react-core/CheckboxItemInput/index.web';\nimport clsx from 'clsx';\nexport const CheckboxItemInput = extend(CoreCheckboxItemInput, ({ className, ...props }) => ({\n ...props,\n className: clsx(className, {\n 'ds-checkboxes__input__wrapper': true\n })\n}))\nexport default CheckboxItemInput;\n"],
5
+ "mappings": "AAAA,OAAO,YAAY;AACnB,OAAO,2BAA2B;AAClC,OAAO,UAAU;AACV,MAAM,oBAAoB,OAAO,uBAAuB,CAAC,EAAE,WAAW,GAAG,MAAM,OAAO;AAAA,EACzF,GAAG;AAAA,EACH,WAAW,KAAK,WAAW;AAAA,IACvB,iCAAiC;AAAA,EACrC,CAAC;AACL,EAAE;AACF,IAAO,uBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import clsx from "clsx";
3
+ import Base from "@digigov/react-core/Base";
4
+ const CheckboxItemInput = React.forwardRef(function CheckboxItemInput2({ name, value, className, disabled, children, ...props }, ref) {
5
+ return /* @__PURE__ */ React.createElement(
6
+ Base,
7
+ {
8
+ as: "input",
9
+ ref,
10
+ type: "checkbox",
11
+ name,
12
+ value,
13
+ className: clsx({
14
+ "ds-checkboxes__input": true
15
+ }),
16
+ disabled,
17
+ ...props
18
+ }
19
+ );
20
+ });
21
+ var index_web_default = CheckboxItemInput;
22
+ export {
23
+ CheckboxItemInput,
24
+ index_web_default as default
25
+ };
26
+ //# sourceMappingURL=index.web.js.map