fictoan-react 1.10.5 → 1.10.7
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/README.md +5 -1
- package/dist/{Heading-AXmuZ86E.js → Heading-3Es9F3zQ.js} +136 -59
- package/dist/components/Form/BaseInputComponent/constants.d.ts.map +1 -1
- package/dist/components/Form/RadioButton/RadioTabGroup.d.ts.map +1 -1
- package/dist/components/Form/RadioButton/constants.d.ts +3 -0
- package/dist/components/Form/RadioButton/constants.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
- **Flexible**: Easily extend and customise components
|
|
45
45
|
- **Modern Stack**: Built with React 18+ and modern best practices
|
|
46
46
|
|
|
47
|
+
---
|
|
48
|
+
|
|
47
49
|
## Getting started 🚀
|
|
48
50
|
|
|
49
51
|
1. Add Fictoan to your project:
|
|
@@ -78,6 +80,8 @@ export const MyComponent = () => {
|
|
|
78
80
|
}
|
|
79
81
|
```
|
|
80
82
|
|
|
83
|
+
---
|
|
84
|
+
|
|
81
85
|
## Write UI code the way you’d speak 🧠
|
|
82
86
|
Doesn’t get simpler than this—
|
|
83
87
|
```jsx
|
|
@@ -108,7 +112,7 @@ Doesn’t get simpler than this—
|
|
|
108
112
|
## Core principles 🎯
|
|
109
113
|
- **Intuitive props**: Properties that make sense at first glance
|
|
110
114
|
- **Consistent patterns**: Similar components share similar prop patterns
|
|
111
|
-
- **Design-Developer bridge**:
|
|
115
|
+
- **Design-Developer bridge**: Make hand-off painless as possible
|
|
112
116
|
- **Minimal friction**: Get from design to implementation faster
|
|
113
117
|
|
|
114
118
|
---
|
|
@@ -804,25 +804,25 @@ function _typeof$3(o) {
|
|
|
804
804
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
805
805
|
}, _typeof$3(o);
|
|
806
806
|
}
|
|
807
|
-
function _slicedToArray$
|
|
808
|
-
return _arrayWithHoles$
|
|
807
|
+
function _slicedToArray$b(r, e) {
|
|
808
|
+
return _arrayWithHoles$b(r) || _iterableToArrayLimit$b(r, e) || _unsupportedIterableToArray$d(r, e) || _nonIterableRest$b();
|
|
809
809
|
}
|
|
810
|
-
function _nonIterableRest$
|
|
810
|
+
function _nonIterableRest$b() {
|
|
811
811
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
812
812
|
}
|
|
813
|
-
function _unsupportedIterableToArray$
|
|
813
|
+
function _unsupportedIterableToArray$d(r, a) {
|
|
814
814
|
if (r) {
|
|
815
|
-
if ("string" == typeof r) return _arrayLikeToArray$
|
|
815
|
+
if ("string" == typeof r) return _arrayLikeToArray$d(r, a);
|
|
816
816
|
var t = {}.toString.call(r).slice(8, -1);
|
|
817
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$
|
|
817
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$d(r, a) : void 0;
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
|
-
function _arrayLikeToArray$
|
|
820
|
+
function _arrayLikeToArray$d(r, a) {
|
|
821
821
|
(null == a || a > r.length) && (a = r.length);
|
|
822
822
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
823
823
|
return n;
|
|
824
824
|
}
|
|
825
|
-
function _iterableToArrayLimit$
|
|
825
|
+
function _iterableToArrayLimit$b(r, l) {
|
|
826
826
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
827
827
|
if (null != t) {
|
|
828
828
|
var e, n, i, u, a = [], f = true, o = false;
|
|
@@ -843,7 +843,7 @@ function _iterableToArrayLimit$a(r, l) {
|
|
|
843
843
|
return a;
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
function _arrayWithHoles$
|
|
846
|
+
function _arrayWithHoles$b(r) {
|
|
847
847
|
if (Array.isArray(r)) return r;
|
|
848
848
|
}
|
|
849
849
|
function _objectWithoutProperties$F(e, t) {
|
|
@@ -866,10 +866,10 @@ function _objectWithoutPropertiesLoose$F(r, e) {
|
|
|
866
866
|
}
|
|
867
867
|
var CodeBlock = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
868
868
|
var children = _ref.children, source = _ref.source, _ref$language = _ref.language, language = _ref$language === void 0 ? "json" : _ref$language, showCopyButton = _ref.showCopyButton, showLineNumbers = _ref.showLineNumbers, description = _ref.description, _ref$withSyntaxHighli = _ref.withSyntaxHighlighting, withSyntaxHighlighting = _ref$withSyntaxHighli === void 0 ? false : _ref$withSyntaxHighli, _ref$contentEditable = _ref.contentEditable, contentEditable = _ref$contentEditable === void 0 ? false : _ref$contentEditable, onChange = _ref.onChange, props = _objectWithoutProperties$F(_ref, _excluded$F);
|
|
869
|
-
var _useState = useState(false), _useState2 = _slicedToArray$
|
|
870
|
-
var _useState3 = useState(null), _useState4 = _slicedToArray$
|
|
871
|
-
var _useState5 = useState(withSyntaxHighlighting), _useState6 = _slicedToArray$
|
|
872
|
-
var _useState7 = useState(null), _useState8 = _slicedToArray$
|
|
869
|
+
var _useState = useState(false), _useState2 = _slicedToArray$b(_useState, 2), isCodeCopied = _useState2[0], setIsCodeCopied = _useState2[1];
|
|
870
|
+
var _useState3 = useState(null), _useState4 = _slicedToArray$b(_useState3, 2), prismModule = _useState4[0], setPrismModule = _useState4[1];
|
|
871
|
+
var _useState5 = useState(withSyntaxHighlighting), _useState6 = _slicedToArray$b(_useState5, 2), isLoading = _useState6[0], setIsLoading = _useState6[1];
|
|
872
|
+
var _useState7 = useState(null), _useState8 = _slicedToArray$b(_useState7, 2), codeElement = _useState8[0], setCodeElement = _useState8[1];
|
|
873
873
|
var preRef = useRef(null);
|
|
874
874
|
var initialCode = typeof children === "string" ? children : React.Children.toArray(children).join("");
|
|
875
875
|
if (!children) {
|
|
@@ -889,7 +889,7 @@ var CodeBlock = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
889
889
|
return Promise.all([import("prismjs"), language !== "plain" ? import("prismjs/components/prism-".concat(language)) : Promise.resolve()]);
|
|
890
890
|
case 4:
|
|
891
891
|
_yield$Promise$all = _context.sent;
|
|
892
|
-
_yield$Promise$all2 = _slicedToArray$
|
|
892
|
+
_yield$Promise$all2 = _slicedToArray$b(_yield$Promise$all, 1);
|
|
893
893
|
prism = _yield$Promise$all2[0];
|
|
894
894
|
setPrismModule(prism["default"]);
|
|
895
895
|
_context.next = 13;
|
|
@@ -1155,25 +1155,25 @@ function _extends$F() {
|
|
|
1155
1155
|
return n;
|
|
1156
1156
|
}, _extends$F.apply(null, arguments);
|
|
1157
1157
|
}
|
|
1158
|
-
function _slicedToArray$
|
|
1159
|
-
return _arrayWithHoles$
|
|
1158
|
+
function _slicedToArray$a(r, e) {
|
|
1159
|
+
return _arrayWithHoles$a(r) || _iterableToArrayLimit$a(r, e) || _unsupportedIterableToArray$c(r, e) || _nonIterableRest$a();
|
|
1160
1160
|
}
|
|
1161
|
-
function _nonIterableRest$
|
|
1161
|
+
function _nonIterableRest$a() {
|
|
1162
1162
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1163
1163
|
}
|
|
1164
|
-
function _unsupportedIterableToArray$
|
|
1164
|
+
function _unsupportedIterableToArray$c(r, a) {
|
|
1165
1165
|
if (r) {
|
|
1166
|
-
if ("string" == typeof r) return _arrayLikeToArray$
|
|
1166
|
+
if ("string" == typeof r) return _arrayLikeToArray$c(r, a);
|
|
1167
1167
|
var t = {}.toString.call(r).slice(8, -1);
|
|
1168
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$
|
|
1168
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$c(r, a) : void 0;
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
|
-
function _arrayLikeToArray$
|
|
1171
|
+
function _arrayLikeToArray$c(r, a) {
|
|
1172
1172
|
(null == a || a > r.length) && (a = r.length);
|
|
1173
1173
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
1174
1174
|
return n;
|
|
1175
1175
|
}
|
|
1176
|
-
function _iterableToArrayLimit$
|
|
1176
|
+
function _iterableToArrayLimit$a(r, l) {
|
|
1177
1177
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
1178
1178
|
if (null != t) {
|
|
1179
1179
|
var e, n, i, u, a = [], f = true, o = false;
|
|
@@ -1192,7 +1192,7 @@ function _iterableToArrayLimit$9(r, l) {
|
|
|
1192
1192
|
return a;
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
1195
|
-
function _arrayWithHoles$
|
|
1195
|
+
function _arrayWithHoles$a(r) {
|
|
1196
1196
|
if (Array.isArray(r)) return r;
|
|
1197
1197
|
}
|
|
1198
1198
|
function _objectWithoutProperties$D(e, t) {
|
|
@@ -1215,7 +1215,7 @@ function _objectWithoutPropertiesLoose$D(r, e) {
|
|
|
1215
1215
|
}
|
|
1216
1216
|
var Drawer = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
1217
1217
|
var children = _ref.children, openWhen = _ref.openWhen, closeWhen = _ref.closeWhen, closeOnClickOutside = _ref.closeOnClickOutside, padding = _ref.padding, position = _ref.position, size = _ref.size, bgColor = _ref.bgColor, bgColour = _ref.bgColour, _ref$isDismissible = _ref.isDismissible, isDismissible = _ref$isDismissible === void 0 ? true : _ref$isDismissible, _ref$showOverlay = _ref.showOverlay, showOverlay = _ref$showOverlay === void 0 ? false : _ref$showOverlay, label = _ref.label, props = _objectWithoutProperties$D(_ref, _excluded$D);
|
|
1218
|
-
var _useState = useState(openWhen), _useState2 = _slicedToArray$
|
|
1218
|
+
var _useState = useState(openWhen), _useState2 = _slicedToArray$a(_useState, 2), shouldRender = _useState2[0], setShouldRender = _useState2[1];
|
|
1219
1219
|
var drawerRef = useRef(null);
|
|
1220
1220
|
var effectiveRef = ref || drawerRef;
|
|
1221
1221
|
useEffect(function() {
|
|
@@ -2161,7 +2161,7 @@ function _extends$o() {
|
|
|
2161
2161
|
}, _extends$o.apply(null, arguments);
|
|
2162
2162
|
}
|
|
2163
2163
|
function _toConsumableArray$3(r) {
|
|
2164
|
-
return _arrayWithoutHoles$3(r) || _iterableToArray$3(r) || _unsupportedIterableToArray$
|
|
2164
|
+
return _arrayWithoutHoles$3(r) || _iterableToArray$3(r) || _unsupportedIterableToArray$b(r) || _nonIterableSpread$3();
|
|
2165
2165
|
}
|
|
2166
2166
|
function _nonIterableSpread$3() {
|
|
2167
2167
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
@@ -2170,27 +2170,27 @@ function _iterableToArray$3(r) {
|
|
|
2170
2170
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
2171
2171
|
}
|
|
2172
2172
|
function _arrayWithoutHoles$3(r) {
|
|
2173
|
-
if (Array.isArray(r)) return _arrayLikeToArray$
|
|
2173
|
+
if (Array.isArray(r)) return _arrayLikeToArray$b(r);
|
|
2174
2174
|
}
|
|
2175
|
-
function _slicedToArray$
|
|
2176
|
-
return _arrayWithHoles$
|
|
2175
|
+
function _slicedToArray$9(r, e) {
|
|
2176
|
+
return _arrayWithHoles$9(r) || _iterableToArrayLimit$9(r, e) || _unsupportedIterableToArray$b(r, e) || _nonIterableRest$9();
|
|
2177
2177
|
}
|
|
2178
|
-
function _nonIterableRest$
|
|
2178
|
+
function _nonIterableRest$9() {
|
|
2179
2179
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2180
2180
|
}
|
|
2181
|
-
function _unsupportedIterableToArray$
|
|
2181
|
+
function _unsupportedIterableToArray$b(r, a) {
|
|
2182
2182
|
if (r) {
|
|
2183
|
-
if ("string" == typeof r) return _arrayLikeToArray$
|
|
2183
|
+
if ("string" == typeof r) return _arrayLikeToArray$b(r, a);
|
|
2184
2184
|
var t = {}.toString.call(r).slice(8, -1);
|
|
2185
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$
|
|
2185
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$b(r, a) : void 0;
|
|
2186
2186
|
}
|
|
2187
2187
|
}
|
|
2188
|
-
function _arrayLikeToArray$
|
|
2188
|
+
function _arrayLikeToArray$b(r, a) {
|
|
2189
2189
|
(null == a || a > r.length) && (a = r.length);
|
|
2190
2190
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
2191
2191
|
return n;
|
|
2192
2192
|
}
|
|
2193
|
-
function _iterableToArrayLimit$
|
|
2193
|
+
function _iterableToArrayLimit$9(r, l) {
|
|
2194
2194
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
2195
2195
|
if (null != t) {
|
|
2196
2196
|
var e, n, i, u, a = [], f = true, o = false;
|
|
@@ -2209,7 +2209,7 @@ function _iterableToArrayLimit$8(r, l) {
|
|
|
2209
2209
|
return a;
|
|
2210
2210
|
}
|
|
2211
2211
|
}
|
|
2212
|
-
function _arrayWithHoles$
|
|
2212
|
+
function _arrayWithHoles$9(r) {
|
|
2213
2213
|
if (Array.isArray(r)) return r;
|
|
2214
2214
|
}
|
|
2215
2215
|
function _objectWithoutProperties$o(e, t) {
|
|
@@ -2232,10 +2232,10 @@ function _objectWithoutPropertiesLoose$o(r, e) {
|
|
|
2232
2232
|
}
|
|
2233
2233
|
var ListBox = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
2234
2234
|
var options = _ref.options, label = _ref.label, _ref$placeholder = _ref.placeholder, placeholder = _ref$placeholder === void 0 ? "Select an option" : _ref$placeholder, id = _ref.id, defaultValue = _ref.defaultValue, onChange = _ref.onChange, _ref$allowMultiSelect = _ref.allowMultiSelect, allowMultiSelect = _ref$allowMultiSelect === void 0 ? false : _ref$allowMultiSelect, disabled = _ref.disabled, badgeBgColour = _ref.badgeBgColour, badgeBgColor = _ref.badgeBgColor, badgeTextColour = _ref.badgeTextColour, badgeTextColor = _ref.badgeTextColor, selectionLimit = _ref.selectionLimit, _ref$allowCustomEntri = _ref.allowCustomEntries, allowCustomEntries = _ref$allowCustomEntri === void 0 ? false : _ref$allowCustomEntri, props = _objectWithoutProperties$o(_ref, _excluded$o);
|
|
2235
|
-
var _useState = useState(false), _useState2 = _slicedToArray$
|
|
2236
|
-
var _useState3 = useState([]), _useState4 = _slicedToArray$
|
|
2237
|
-
var _useState5 = useState(""), _useState6 = _slicedToArray$
|
|
2238
|
-
var _useState7 = useState(-1), _useState8 = _slicedToArray$
|
|
2235
|
+
var _useState = useState(false), _useState2 = _slicedToArray$9(_useState, 2), isOpen = _useState2[0], setIsOpen = _useState2[1];
|
|
2236
|
+
var _useState3 = useState([]), _useState4 = _slicedToArray$9(_useState3, 2), selectedOptions = _useState4[0], setSelectedOptions = _useState4[1];
|
|
2237
|
+
var _useState5 = useState(""), _useState6 = _slicedToArray$9(_useState5, 2), searchValue = _useState6[0], setSearchValue = _useState6[1];
|
|
2238
|
+
var _useState7 = useState(-1), _useState8 = _slicedToArray$9(_useState7, 2), activeIndex = _useState8[0], setActiveIndex = _useState8[1];
|
|
2239
2239
|
var _useState9 = useState(function() {
|
|
2240
2240
|
if (defaultValue) {
|
|
2241
2241
|
return options.find(function(opt) {
|
|
@@ -2243,7 +2243,7 @@ var ListBox = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
2243
2243
|
}) || null;
|
|
2244
2244
|
}
|
|
2245
2245
|
return null;
|
|
2246
|
-
}), _useState10 = _slicedToArray$
|
|
2246
|
+
}), _useState10 = _slicedToArray$9(_useState9, 2), selectedOption = _useState10[0], setSelectedOption = _useState10[1];
|
|
2247
2247
|
useEffect(function() {
|
|
2248
2248
|
if (defaultValue && onChange) {
|
|
2249
2249
|
onChange(defaultValue);
|
|
@@ -2580,7 +2580,7 @@ function _toPrimitive$2(t, r) {
|
|
|
2580
2580
|
return ("string" === r ? String : Number)(t);
|
|
2581
2581
|
}
|
|
2582
2582
|
function _toConsumableArray$2(r) {
|
|
2583
|
-
return _arrayWithoutHoles$2(r) || _iterableToArray$2(r) || _unsupportedIterableToArray$
|
|
2583
|
+
return _arrayWithoutHoles$2(r) || _iterableToArray$2(r) || _unsupportedIterableToArray$a(r) || _nonIterableSpread$2();
|
|
2584
2584
|
}
|
|
2585
2585
|
function _nonIterableSpread$2() {
|
|
2586
2586
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
@@ -2589,27 +2589,27 @@ function _iterableToArray$2(r) {
|
|
|
2589
2589
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
2590
2590
|
}
|
|
2591
2591
|
function _arrayWithoutHoles$2(r) {
|
|
2592
|
-
if (Array.isArray(r)) return _arrayLikeToArray$
|
|
2592
|
+
if (Array.isArray(r)) return _arrayLikeToArray$a(r);
|
|
2593
2593
|
}
|
|
2594
|
-
function _slicedToArray$
|
|
2595
|
-
return _arrayWithHoles$
|
|
2594
|
+
function _slicedToArray$8(r, e) {
|
|
2595
|
+
return _arrayWithHoles$8(r) || _iterableToArrayLimit$8(r, e) || _unsupportedIterableToArray$a(r, e) || _nonIterableRest$8();
|
|
2596
2596
|
}
|
|
2597
|
-
function _nonIterableRest$
|
|
2597
|
+
function _nonIterableRest$8() {
|
|
2598
2598
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2599
2599
|
}
|
|
2600
|
-
function _unsupportedIterableToArray$
|
|
2600
|
+
function _unsupportedIterableToArray$a(r, a) {
|
|
2601
2601
|
if (r) {
|
|
2602
|
-
if ("string" == typeof r) return _arrayLikeToArray$
|
|
2602
|
+
if ("string" == typeof r) return _arrayLikeToArray$a(r, a);
|
|
2603
2603
|
var t = {}.toString.call(r).slice(8, -1);
|
|
2604
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$
|
|
2604
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$a(r, a) : void 0;
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
2607
|
-
function _arrayLikeToArray$
|
|
2607
|
+
function _arrayLikeToArray$a(r, a) {
|
|
2608
2608
|
(null == a || a > r.length) && (a = r.length);
|
|
2609
2609
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
2610
2610
|
return n;
|
|
2611
2611
|
}
|
|
2612
|
-
function _iterableToArrayLimit$
|
|
2612
|
+
function _iterableToArrayLimit$8(r, l) {
|
|
2613
2613
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
2614
2614
|
if (null != t) {
|
|
2615
2615
|
var e, n, i, u, a = [], f = true, o = false;
|
|
@@ -2628,7 +2628,7 @@ function _iterableToArrayLimit$7(r, l) {
|
|
|
2628
2628
|
return a;
|
|
2629
2629
|
}
|
|
2630
2630
|
}
|
|
2631
|
-
function _arrayWithHoles$
|
|
2631
|
+
function _arrayWithHoles$8(r) {
|
|
2632
2632
|
if (Array.isArray(r)) return r;
|
|
2633
2633
|
}
|
|
2634
2634
|
function _objectWithoutProperties$n(e, t) {
|
|
@@ -2658,10 +2658,10 @@ function validate(value, type) {
|
|
|
2658
2658
|
var PinInputField = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
2659
2659
|
var length = _ref.numberOfFields, onChange = _ref.onChange, _ref$type = _ref.type, type = _ref$type === void 0 ? "number" : _ref$type, _ref$mask = _ref.mask, mask = _ref$mask === void 0 ? false : _ref$mask, _ref$isOTP = _ref.isOTP, isOTP = _ref$isOTP === void 0 ? false : _ref$isOTP, _ref$autoFocus = _ref.autoFocus, autoFocus = _ref$autoFocus === void 0 ? false : _ref$autoFocus, _ref$pasteFromClipboa = _ref.pasteFromClipboard, pasteFromClipboard = _ref$pasteFromClipboa === void 0 ? "enabled" : _ref$pasteFromClipboa, _ref$focusFirstInputO = _ref.focusFirstInputOnReset, focusFirstInputOnReset = _ref$focusFirstInputO === void 0 ? true : _ref$focusFirstInputO, isFullWidth = _ref.isFullWidth, ariaLabel = _ref.ariaLabel, props = _objectWithoutProperties$n(_ref, _excluded$n);
|
|
2660
2660
|
var pinInputFieldRef = useRef(null);
|
|
2661
|
-
var _useState = useState([]), _useState2 = _slicedToArray$
|
|
2662
|
-
var _useState3 = useState([]), _useState4 = _slicedToArray$
|
|
2663
|
-
var _useState5 = useState(true), _useState6 = _slicedToArray$
|
|
2664
|
-
var _useState7 = useState(-1), _useState8 = _slicedToArray$
|
|
2661
|
+
var _useState = useState([]), _useState2 = _slicedToArray$8(_useState, 2), inputRefs = _useState2[0], setInputRefs = _useState2[1];
|
|
2662
|
+
var _useState3 = useState([]), _useState4 = _slicedToArray$8(_useState3, 2), values = _useState4[0], setValues = _useState4[1];
|
|
2663
|
+
var _useState5 = useState(true), _useState6 = _slicedToArray$8(_useState5, 2), moveFocus = _useState6[0], setMoveFocus = _useState6[1];
|
|
2664
|
+
var _useState7 = useState(-1), _useState8 = _slicedToArray$8(_useState7, 2), focusedIndex = _useState8[0], setFocusedIndex = _useState8[1];
|
|
2665
2665
|
var inputGroupId = props.id || "pin-input-".concat(Math.random().toString(36).substring(2, 9));
|
|
2666
2666
|
var inputDescription = ariaLabel || "Enter verification code";
|
|
2667
2667
|
var focus = useCallback(function(index) {
|
|
@@ -2891,7 +2891,7 @@ var Range = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
2891
2891
|
value
|
|
2892
2892
|
}, props)));
|
|
2893
2893
|
});
|
|
2894
|
-
var _excluded$l = ["id", "name", "options", "defaultValue", "value", "required"], _excluded2$3 = ["id"], _excluded3 = ["size"];
|
|
2894
|
+
var _excluded$l = ["id", "name", "options", "defaultValue", "value", "required", "onChange"], _excluded2$3 = ["id"], _excluded3 = ["size"];
|
|
2895
2895
|
function _extends$l() {
|
|
2896
2896
|
return _extends$l = Object.assign ? Object.assign.bind() : function(n) {
|
|
2897
2897
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -2901,6 +2901,46 @@ function _extends$l() {
|
|
|
2901
2901
|
return n;
|
|
2902
2902
|
}, _extends$l.apply(null, arguments);
|
|
2903
2903
|
}
|
|
2904
|
+
function _slicedToArray$7(r, e) {
|
|
2905
|
+
return _arrayWithHoles$7(r) || _iterableToArrayLimit$7(r, e) || _unsupportedIterableToArray$9(r, e) || _nonIterableRest$7();
|
|
2906
|
+
}
|
|
2907
|
+
function _nonIterableRest$7() {
|
|
2908
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2909
|
+
}
|
|
2910
|
+
function _unsupportedIterableToArray$9(r, a) {
|
|
2911
|
+
if (r) {
|
|
2912
|
+
if ("string" == typeof r) return _arrayLikeToArray$9(r, a);
|
|
2913
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
2914
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$9(r, a) : void 0;
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
function _arrayLikeToArray$9(r, a) {
|
|
2918
|
+
(null == a || a > r.length) && (a = r.length);
|
|
2919
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
2920
|
+
return n;
|
|
2921
|
+
}
|
|
2922
|
+
function _iterableToArrayLimit$7(r, l) {
|
|
2923
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
2924
|
+
if (null != t) {
|
|
2925
|
+
var e, n, i, u, a = [], f = true, o = false;
|
|
2926
|
+
try {
|
|
2927
|
+
if (i = (t = t.call(r)).next, 0 === l) ;
|
|
2928
|
+
else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
2929
|
+
} catch (r2) {
|
|
2930
|
+
o = true, n = r2;
|
|
2931
|
+
} finally {
|
|
2932
|
+
try {
|
|
2933
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
2934
|
+
} finally {
|
|
2935
|
+
if (o) throw n;
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2938
|
+
return a;
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
function _arrayWithHoles$7(r) {
|
|
2942
|
+
if (Array.isArray(r)) return r;
|
|
2943
|
+
}
|
|
2904
2944
|
function _objectWithoutProperties$l(e, t) {
|
|
2905
2945
|
if (null == e) return {};
|
|
2906
2946
|
var o, r, i = _objectWithoutPropertiesLoose$l(e, t);
|
|
@@ -2922,15 +2962,48 @@ function _objectWithoutPropertiesLoose$l(r, e) {
|
|
|
2922
2962
|
var RadioTabGroupOptions = function RadioTabGroupOptions2(_ref) {
|
|
2923
2963
|
var id = _ref.id, name = _ref.name, options = _ref.options;
|
|
2924
2964
|
_ref.defaultValue;
|
|
2925
|
-
var value = _ref.value, required = _ref.required, props = _objectWithoutProperties$l(_ref, _excluded$l);
|
|
2965
|
+
var value = _ref.value, required = _ref.required, onChange = _ref.onChange, props = _objectWithoutProperties$l(_ref, _excluded$l);
|
|
2926
2966
|
var derivedName = useMemo(function() {
|
|
2927
2967
|
return name || id;
|
|
2928
2968
|
}, [name, id]);
|
|
2969
|
+
var _useState = useState({
|
|
2970
|
+
width: 0,
|
|
2971
|
+
transform: "translateX(0)"
|
|
2972
|
+
}), _useState2 = _slicedToArray$7(_useState, 2), indicatorPos = _useState2[0], setIndicatorPos = _useState2[1];
|
|
2973
|
+
var labelsRef = useRef([]);
|
|
2974
|
+
useEffect(function() {
|
|
2975
|
+
var selectedIndex = options.findIndex(function(option) {
|
|
2976
|
+
return option.value === value;
|
|
2977
|
+
});
|
|
2978
|
+
if (selectedIndex >= 0) {
|
|
2979
|
+
var label = labelsRef.current[selectedIndex];
|
|
2980
|
+
if (label) {
|
|
2981
|
+
var width = label.offsetWidth;
|
|
2982
|
+
var transform = "translateX(0)";
|
|
2983
|
+
if (selectedIndex > 0) {
|
|
2984
|
+
var offset = labelsRef.current.slice(0, selectedIndex).reduce(function(acc, label2) {
|
|
2985
|
+
return acc + ((label2 === null || label2 === void 0 ? void 0 : label2.offsetWidth) || 0);
|
|
2986
|
+
}, 0);
|
|
2987
|
+
transform = "translateX(".concat(offset, "px)");
|
|
2988
|
+
}
|
|
2989
|
+
setIndicatorPos({
|
|
2990
|
+
width,
|
|
2991
|
+
transform
|
|
2992
|
+
});
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2995
|
+
}, [value, options]);
|
|
2929
2996
|
return /* @__PURE__ */ React.createElement(Div, {
|
|
2930
2997
|
"data-radio-tab-group": true,
|
|
2931
2998
|
name: derivedName,
|
|
2932
2999
|
required
|
|
2933
|
-
},
|
|
3000
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
3001
|
+
className: "indicator",
|
|
3002
|
+
style: {
|
|
3003
|
+
width: "".concat(indicatorPos.width, "px"),
|
|
3004
|
+
transform: indicatorPos.transform
|
|
3005
|
+
}
|
|
3006
|
+
}), options.map(function(option, index) {
|
|
2934
3007
|
var optionId = option.id, optionProps = _objectWithoutProperties$l(option, _excluded2$3);
|
|
2935
3008
|
var finalId = optionId || "".concat(id, "-option-").concat(index);
|
|
2936
3009
|
return /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
@@ -2940,8 +3013,12 @@ var RadioTabGroupOptions = function RadioTabGroupOptions2(_ref) {
|
|
|
2940
3013
|
}, props, optionProps, {
|
|
2941
3014
|
id: finalId,
|
|
2942
3015
|
name: derivedName,
|
|
2943
|
-
checked: value === option.value
|
|
3016
|
+
checked: value === option.value,
|
|
3017
|
+
onChange
|
|
2944
3018
|
})), /* @__PURE__ */ React.createElement("label", {
|
|
3019
|
+
ref: function ref(el) {
|
|
3020
|
+
return labelsRef.current[index] = el;
|
|
3021
|
+
},
|
|
2945
3022
|
htmlFor: finalId
|
|
2946
3023
|
}, option.label));
|
|
2947
3024
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/BaseInputComponent/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/BaseInputComponent/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,MAAM,WAAW,gBAAgB;IAC7B,QAAa,CAAC,EAAG,MAAM,CAAC;IACxB,SAAa,CAAC,EAAG,MAAM,CAAC;IACxB,YAAa,CAAC,EAAG,OAAO,CAAC;IACzB,KAAa,CAAC,EAAG,OAAO,CAAC;IACzB,OAAa,CAAC,EAAG,OAAO,CAAC;CAC5B;AAGD,KAAK,aAAa,GACZ;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,UAAW,CAAC,EAAG,KAAK,CAAA;CAAE,GACnD;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAS,CAAC,EAAG,KAAK,CAAA;CAAE,GAC1C;IAAE,QAAS,CAAC,EAAG,KAAK,CAAC;IAAC,UAAW,CAAC,EAAG,KAAK,CAAA;CAAE,CAAC;AAGnD,KAAK,cAAc,GACb;IAAE,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,WAAY,CAAC,EAAG,KAAK,CAAA;CAAE,GACrD;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAU,CAAC,EAAG,KAAK,CAAA;CAAE,GAC5C;IAAE,SAAU,CAAC,EAAG,KAAK,CAAC;IAAC,WAAY,CAAC,EAAG,KAAK,CAAA;CAAE,CAAC;AAGrD,MAAM,MAAM,cAAc,GAAG;IACzB,QAAY,CAAC,EAAG,KAAK,CAAC;IACtB,SAAY,CAAC,EAAG,KAAK,CAAC;IACtB,UAAY,CAAC,EAAG,KAAK,CAAC;IACtB,WAAY,CAAC,EAAG,KAAK,CAAC;CACzB,CAAC;AAGF,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG,cAAc,CAAC;AAGnE,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,EAAE,IAC5C,YAAY,CAAC,CAAC,CAAC,GACf,qBAAqB,GACrB,gBAAgB,CAAC;AAGrB,MAAM,MAAM,+BAA+B,CAAC,CAAC,SAAS,EAAE,IACpD,uBAAuB,CAAC,CAAC,CAAC,GAC1B,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioTabGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/RadioButton/RadioTabGroup.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"RadioTabGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/RadioButton/RadioTabGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAOjF,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAsB,eAAe,EAA0B,MAAM,aAAa,CAAC;AAiF1F,eAAO,MAAM,aAAa,uJAkBzB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { BaseInputComponentProps } from '../BaseInputComponent/constants';
|
|
2
3
|
import { SpacingTypes } from '../../Element/constants';
|
|
3
4
|
|
|
@@ -10,6 +11,8 @@ export interface RadioGroupOptionProps extends RadioButtonProps {
|
|
|
10
11
|
export interface RadioGroupCustomProps {
|
|
11
12
|
name: string;
|
|
12
13
|
options: RadioGroupOptionProps[];
|
|
14
|
+
value?: string;
|
|
15
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
16
|
}
|
|
14
17
|
export interface RadioTabGroupCustomProps {
|
|
15
18
|
size?: SpacingTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/RadioButton/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC;AACpD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,CAAC;AAE3F,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC3D,EAAE,EAAM,MAAM,CAAC;IACf,KAAK,EAAG,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/RadioButton/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC;AACpD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,CAAC;AAE3F,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC3D,EAAE,EAAM,MAAM,CAAC;IACf,KAAK,EAAG,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAS,MAAM,CAAC;IACpB,OAAO,EAAM,qBAAqB,EAAE,CAAC;IACrC,KAAS,CAAC,EAAG,MAAM,CAAC;IACpB,QAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACpE;AAED,MAAM,WAAW,wBAAwB;IACrC,IAAK,CAAC,EAAG,YAAY,CAAC;CACzB;AAED,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG,qBAAqB,CAAC;AAC5E,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,wBAAwB,CAAC,GAAG,wBAAwB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import { A, g, h, B, i, b, a, C, c, r, d, W, f, e, D, E, p, F, k, l, m, H, a8, a9, aa, ab, ac, ad, I, n, L, M, v, w, N, y, x, O, Q, z, P, G, J, q, R, u, t, K, S, o, Z, X, Y, V, _, $, j, a0, s, a1, a2, ae, T, a3, a6, a5, a7, U, a4 } from "../Heading-
|
|
3
|
+
import { A, g, h, B, i, b, a, C, c, r, d, W, f, e, D, E, p, F, k, l, m, H, a8, a9, aa, ab, ac, ad, I, n, L, M, v, w, N, y, x, O, Q, z, P, G, J, q, R, u, t, K, S, o, Z, X, Y, V, _, $, j, a0, s, a1, a2, ae, T, a3, a6, a5, a7, U, a4 } from "../Heading-3Es9F3zQ.js";
|
|
4
4
|
export {
|
|
5
5
|
A as Accordion,
|
|
6
6
|
g as Article,
|