@app-studio/web 0.8.10 → 0.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Form/CountryPicker/CountryPicker/CountryPicker.props.d.ts +0 -113
- package/dist/components/Form/CountryPicker/CountryPicker.d.ts +0 -3
- package/dist/components/Form/Select/Select/Select.props.d.ts +0 -150
- package/dist/components/Form/Select/Select.d.ts +0 -3
- package/dist/components/Form/Switch/Switch/Switch.props.d.ts +0 -40
- package/dist/components/Form/TextArea/TextArea/TextArea.props.d.ts +0 -99
- package/dist/components/Form/TextArea/TextArea.d.ts +0 -3
- package/dist/components/Form/TextField/TextField/TextField.props.d.ts +0 -80
- package/dist/components/Form/TextField/TextField.d.ts +0 -3
- package/dist/components/Link/Link/Link.props.d.ts +0 -28
- package/dist/components/Link/Link.d.ts +0 -3
- package/dist/components/Loader/Loader/Loader.props.d.ts +0 -51
- package/dist/components/Loader/Loader.d.ts +0 -3
- package/dist/components/Text/Text/Text.props.d.ts +0 -48
- package/dist/docsLoader.d.ts +1 -0
- package/dist/pages/docs/components/LiveCode.component.d.ts +3 -0
- package/dist/pages/docs/components/MarkdownEditor.component.d.ts +5 -0
- package/dist/pages/docs/components/docs.elements.d.ts +3 -0
- package/dist/pages/docs/components/docs.request.d.ts +10 -0
- package/dist/pages/docs/components/docs.states.d.ts +5 -0
- package/dist/pages/docs/docs.page.d.ts +4 -0
- package/dist/web.cjs.development.js +102 -47
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +102 -47
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +102 -47
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +12 -4
- package/dist/bot/Bot.d.ts +0 -14
- package/dist/bot/Cache.d.ts +0 -13
- package/dist/bot/Config.d.ts +0 -13
- package/dist/bot/ContentFetcher.d.ts +0 -9
- package/dist/bot/DocuCode.d.ts +0 -17
- package/dist/bot/FileHandler.d.ts +0 -24
- package/dist/bot/OpenAIConnector.d.ts +0 -27
- package/dist/bot/data.d.ts +0 -19
- package/dist/bot/extractors.d.ts +0 -8
- package/dist/bot/index.d.ts +0 -1
- package/dist/bot/prompt/1-project.d.ts +0 -1
- package/dist/bot/prompt/2-response.d.ts +0 -1
- package/dist/bot/prompt/3-comment.d.ts +0 -1
|
@@ -195,6 +195,7 @@ var TextComponent = function TextComponent(props) {
|
|
|
195
195
|
var Text = TextComponent;
|
|
196
196
|
|
|
197
197
|
var _excluded$1 = ["justifyContent", "isReversed"];
|
|
198
|
+
// Defines the functional component VerticalView with props specified by VerticalProps
|
|
198
199
|
var VerticalView = function VerticalView(_ref) {
|
|
199
200
|
var _ref$justifyContent = _ref.justifyContent,
|
|
200
201
|
justifyContent = _ref$justifyContent === void 0 ? 'flex-start' : _ref$justifyContent,
|
|
@@ -208,39 +209,46 @@ var VerticalView = function VerticalView(_ref) {
|
|
|
208
209
|
}, props));
|
|
209
210
|
};
|
|
210
211
|
|
|
211
|
-
|
|
212
|
-
* Vertical layout aligns all the elements in a container on the vertical axis.
|
|
213
|
-
*/
|
|
212
|
+
// Defines the VerticalComponent as a functional component with VerticalProps as its props signature.
|
|
214
213
|
var VerticalComponent = function VerticalComponent(props) {
|
|
215
|
-
return
|
|
214
|
+
return (
|
|
215
|
+
// Renders the VerticalView component, passing all of the received props through to it.
|
|
216
|
+
React__default.createElement(VerticalView, Object.assign({}, props))
|
|
217
|
+
);
|
|
216
218
|
};
|
|
219
|
+
// Exports the VerticalComponent as Vertical for use in other parts of the application.
|
|
217
220
|
var Vertical = VerticalComponent;
|
|
218
221
|
|
|
219
|
-
|
|
220
|
-
* Horizontal layout aligns all the elements in a container on the horizontal axis.
|
|
221
|
-
*/
|
|
222
|
+
// Defines a functional component 'HorizontalComponent' utilizing 'ViewProps'. It leverages flexbox to create a horizontal view, which can be reversed based on a prop.
|
|
222
223
|
var HorizontalComponent = function HorizontalComponent(props) {
|
|
223
224
|
return React__default.createElement(appStudio.View, Object.assign({
|
|
224
225
|
display: "flex",
|
|
225
226
|
flexDirection: props.isReversed ? 'row-reverse' : 'row'
|
|
226
227
|
}, props));
|
|
227
228
|
};
|
|
229
|
+
// Exports the HorizontalComponent as 'Horizontal', making it available for use in other parts of the application.
|
|
228
230
|
var Horizontal = HorizontalComponent;
|
|
229
231
|
|
|
232
|
+
// Defines a React Functional Component named CenterView which centers its children both horizontally and vertically using flexbox.
|
|
230
233
|
var CenterView = function CenterView(props) {
|
|
231
|
-
return
|
|
232
|
-
display
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
return (
|
|
235
|
+
// Renders a 'View' component with display flex and center alignment applied on both axes, passing all received props.
|
|
236
|
+
React__default.createElement(appStudio.View, Object.assign({
|
|
237
|
+
display: "flex",
|
|
238
|
+
justifyContent: "center",
|
|
239
|
+
alignItems: "center"
|
|
240
|
+
}, props))
|
|
241
|
+
);
|
|
236
242
|
};
|
|
237
243
|
|
|
238
|
-
|
|
239
|
-
* The Center component is a React functional component that provides a centered layout for its children using flexbox.
|
|
240
|
-
*/
|
|
244
|
+
// Defines a functional component named CenterComponent utilizing React's functional component structure, which expects props of the CenterProps type.
|
|
241
245
|
var CenterComponent = function CenterComponent(props) {
|
|
242
|
-
return
|
|
246
|
+
return (
|
|
247
|
+
// Renders the CenterView component, passing down all the props received by the CenterComponent.
|
|
248
|
+
React__default.createElement(CenterView, Object.assign({}, props))
|
|
249
|
+
);
|
|
243
250
|
};
|
|
251
|
+
// Exports CenterComponent as Center, making it available for use in other parts of the application.
|
|
244
252
|
var Center = CenterComponent;
|
|
245
253
|
|
|
246
254
|
var _excluded$2 = ["size", "color"];
|
|
@@ -1025,6 +1033,7 @@ var useButtonState = function useButtonState() {
|
|
|
1025
1033
|
};
|
|
1026
1034
|
// The hook returns an object containing 'isHovered' state and the 'setIsHovered' function to enable state management from the consumer component.
|
|
1027
1035
|
|
|
1036
|
+
// This function initializes the Link component's state using the useState hook and exposes its state and setter function.
|
|
1028
1037
|
var useLinkState = function useLinkState() {
|
|
1029
1038
|
var _useState = React.useState(false),
|
|
1030
1039
|
isHovered = _useState[0],
|
|
@@ -1035,6 +1044,7 @@ var useLinkState = function useLinkState() {
|
|
|
1035
1044
|
};
|
|
1036
1045
|
};
|
|
1037
1046
|
|
|
1047
|
+
// Defines a mapping of various size names (from 'xs' to '6xl') to their respective numeric icon sizes, providing a scalable way to reference icon sizes throughout the component.
|
|
1038
1048
|
var IconSizes = {
|
|
1039
1049
|
xs: 12,
|
|
1040
1050
|
sm: 14,
|
|
@@ -1049,6 +1059,7 @@ var IconSizes = {
|
|
|
1049
1059
|
};
|
|
1050
1060
|
|
|
1051
1061
|
var _excluded$g = ["children", "href", "iconSize", "underline", "isHovered", "isExternal", "styles", "setIsHovered"];
|
|
1062
|
+
// Component definition for 'LinkView', a functional component with props defined by 'LinkViewProps'.
|
|
1052
1063
|
var LinkView = function LinkView(_ref) {
|
|
1053
1064
|
var children = _ref.children,
|
|
1054
1065
|
_ref$href = _ref.href,
|
|
@@ -1069,6 +1080,7 @@ var LinkView = function LinkView(_ref) {
|
|
|
1069
1080
|
_ref$setIsHovered = _ref.setIsHovered,
|
|
1070
1081
|
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
1071
1082
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
1083
|
+
// Function to handle mouse enter/leave events to toggle hover state.
|
|
1072
1084
|
var handleHover = function handleHover() {
|
|
1073
1085
|
if (underline === 'hover') setIsHovered(true);
|
|
1074
1086
|
};
|
|
@@ -1089,13 +1101,14 @@ var LinkView = function LinkView(_ref) {
|
|
|
1089
1101
|
}))));
|
|
1090
1102
|
};
|
|
1091
1103
|
|
|
1104
|
+
// Defines the 'LinkComponent' as a functional component with props typed to 'LinkProps'
|
|
1092
1105
|
var LinkComponent = function LinkComponent(props) {
|
|
1106
|
+
// Gets stateful logic and data necessary for the link component via 'useLinkState' hook
|
|
1093
1107
|
var linkStates = useLinkState();
|
|
1108
|
+
// Renders 'LinkView' component passing down link state and props
|
|
1094
1109
|
return React__default.createElement(LinkView, Object.assign({}, linkStates, props));
|
|
1095
1110
|
};
|
|
1096
|
-
|
|
1097
|
-
* Link allows users to navigate from page to page. It have a similar appearance as the hyperlink.
|
|
1098
|
-
*/
|
|
1111
|
+
// Exports 'LinkComponent' as 'Link' for use in other parts of the application
|
|
1099
1112
|
var Link = LinkComponent;
|
|
1100
1113
|
|
|
1101
1114
|
var ButtonSizes = {
|
|
@@ -1203,6 +1216,8 @@ var IconSizes$1 = {
|
|
|
1203
1216
|
}
|
|
1204
1217
|
};
|
|
1205
1218
|
|
|
1219
|
+
// Defines a mapping of spinning speed labels to their respective duration in seconds for the Loader component animations.
|
|
1220
|
+
// Sets up a scale of sizes, mapping size labels to numerical values to be used for Loader component dimensions.
|
|
1206
1221
|
var DefaultSizes = {
|
|
1207
1222
|
xs: 14,
|
|
1208
1223
|
sm: 18,
|
|
@@ -1215,6 +1230,7 @@ var DefaultSizes = {
|
|
|
1215
1230
|
'5xl': 70,
|
|
1216
1231
|
'6xl': 80
|
|
1217
1232
|
};
|
|
1233
|
+
// Specifies a mapping of spinning speed labels to numerical millisecond values, determining the speed of the Loader component's animation cycles.
|
|
1218
1234
|
var DefaultSpeeds = {
|
|
1219
1235
|
fast: 50,
|
|
1220
1236
|
normal: 100,
|
|
@@ -1398,12 +1414,14 @@ var LoaderView = function LoaderView(_ref4) {
|
|
|
1398
1414
|
}, children));
|
|
1399
1415
|
};
|
|
1400
1416
|
|
|
1417
|
+
// Defines a LoaderComponent as a functional component with props defined by LoaderProps and returns the LoaderView component, passing along any received props.
|
|
1401
1418
|
var LoaderComponent = function LoaderComponent(props) {
|
|
1402
|
-
return
|
|
1419
|
+
return (
|
|
1420
|
+
// Renders the LoaderView component by spreading the received props, which allows for a clean pass-through of properties.
|
|
1421
|
+
React__default.createElement(LoaderView, Object.assign({}, props))
|
|
1422
|
+
);
|
|
1403
1423
|
};
|
|
1404
|
-
|
|
1405
|
-
* It gives the user an insight about an action being processed. It may have an undefined waiting time or display the process length.
|
|
1406
|
-
*/
|
|
1424
|
+
// Exports the LoaderComponent as Loader, making it available for use in other parts of the application.
|
|
1407
1425
|
var Loader = LoaderComponent;
|
|
1408
1426
|
|
|
1409
1427
|
var _excluded$i = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick", "loaderProps", "loaderPosition", "effect", "isHovered", "setIsHovered"];
|
|
@@ -1589,26 +1607,34 @@ var FileImage = function FileImage(_ref2) {
|
|
|
1589
1607
|
}, props));
|
|
1590
1608
|
};
|
|
1591
1609
|
|
|
1610
|
+
// Initializes the custom hook 'useSelectState' for managing the state of the Select component
|
|
1592
1611
|
var useSelectState = function useSelectState(_ref) {
|
|
1593
1612
|
var placeholder = _ref.placeholder,
|
|
1594
1613
|
isMulti = _ref.isMulti,
|
|
1595
1614
|
options = _ref.options;
|
|
1615
|
+
// Determines the default value based on the 'placeholder' and 'isMulti' props, setting to an empty array for multi-select or an empty string/single default option
|
|
1596
1616
|
var defaultValue = placeholder ? isMulti ? [] : '' : options[0].value;
|
|
1617
|
+
// State hook for managing visibility of the Select dropdown, initially set to hidden
|
|
1597
1618
|
var _React$useState = React__default.useState(true),
|
|
1598
1619
|
hide = _React$useState[0],
|
|
1599
1620
|
setHide = _React$useState[1];
|
|
1621
|
+
// State hook for tracking mouse hover status over the Select component
|
|
1600
1622
|
var _React$useState2 = React__default.useState(false),
|
|
1601
1623
|
isHovered = _React$useState2[0],
|
|
1602
1624
|
setIsHovered = _React$useState2[1];
|
|
1625
|
+
// State hook for tracking focus status of the Select input field
|
|
1603
1626
|
var _React$useState3 = React__default.useState(false),
|
|
1604
1627
|
isFocused = _React$useState3[0],
|
|
1605
1628
|
setIsFocused = _React$useState3[1];
|
|
1629
|
+
// State hook for managing the value(s) selected by the user, initialized with the default value
|
|
1606
1630
|
var _React$useState4 = React__default.useState(defaultValue),
|
|
1607
1631
|
value = _React$useState4[0],
|
|
1608
1632
|
setValue = _React$useState4[1];
|
|
1633
|
+
// State hook for keeping track of the currently highlighted index in the options list
|
|
1609
1634
|
var _React$useState5 = React__default.useState(0),
|
|
1610
1635
|
highlightedIndex = _React$useState5[0],
|
|
1611
1636
|
setHighlightedIndex = _React$useState5[1];
|
|
1637
|
+
// Returns an object containing all stateful values and their associated setters to manage the Select component's state
|
|
1612
1638
|
return {
|
|
1613
1639
|
value: value,
|
|
1614
1640
|
setValue: setValue,
|
|
@@ -1622,10 +1648,13 @@ var useSelectState = function useSelectState(_ref) {
|
|
|
1622
1648
|
setHighlightedIndex: setHighlightedIndex
|
|
1623
1649
|
};
|
|
1624
1650
|
};
|
|
1651
|
+
// Initializes another custom hook 'useItemState' for managing the hover state of each Select item
|
|
1625
1652
|
var useItemState = function useItemState() {
|
|
1653
|
+
// State hook for tracking mouse hover status over individual Select item options
|
|
1626
1654
|
var _React$useState6 = React__default.useState(false),
|
|
1627
1655
|
isHovered = _React$useState6[0],
|
|
1628
1656
|
setIsHovered = _React$useState6[1];
|
|
1657
|
+
// Returns an object with 'isHovered' state and its associated setter from the 'useItemState' hook, for controlling individual Select item hover state
|
|
1629
1658
|
return {
|
|
1630
1659
|
isHovered: isHovered,
|
|
1631
1660
|
setIsHovered: setIsHovered
|
|
@@ -1899,6 +1928,8 @@ var FieldWrapper = function FieldWrapper(_ref) {
|
|
|
1899
1928
|
}, props), children);
|
|
1900
1929
|
};
|
|
1901
1930
|
|
|
1931
|
+
// Defines a mapping of 'Size' types to their corresponding CSSProperties. This allows different size configurations to be provided for the Select component.
|
|
1932
|
+
// Specifies the pixel sizes of icons associated with the Select component based on the predefined 'Size' types allowing for consistent icon scaling.
|
|
1902
1933
|
var IconSizes$2 = {
|
|
1903
1934
|
xs: 8,
|
|
1904
1935
|
sm: 10,
|
|
@@ -1911,6 +1942,7 @@ var _excluded$r = ["isHovered", "setIsHovered", "option", "size", "callback", "s
|
|
|
1911
1942
|
_excluded2$2 = ["id", "name", "value", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
|
|
1912
1943
|
_excluded3$1 = ["option", "size", "removeOption"],
|
|
1913
1944
|
_excluded4$1 = ["id", "name", "label", "value", "placeholder", "helperText", "hide", "error", "isMulti", "isFocused", "isHovered", "isDisabled", "isReadOnly", "options", "shadow", "size", "colorScheme", "shape", "variant", "styles", "onChange", "setHide", "setValue", "setIsHovered", "setIsFocused", "setHighlightedIndex", "highlightedIndex"];
|
|
1945
|
+
// Defines a component to render individual selection items within a list.
|
|
1914
1946
|
var Item = function Item(_ref) {
|
|
1915
1947
|
var isHovered = _ref.isHovered,
|
|
1916
1948
|
setIsHovered = _ref.setIsHovered,
|
|
@@ -1921,9 +1953,11 @@ var Item = function Item(_ref) {
|
|
|
1921
1953
|
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
1922
1954
|
style = _ref.style,
|
|
1923
1955
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
1956
|
+
// Handles the click event on an option by invoking the callback with the selected option's value.
|
|
1924
1957
|
var handleOptionClick = function handleOptionClick(option) {
|
|
1925
1958
|
return callback(option);
|
|
1926
1959
|
};
|
|
1960
|
+
// Toggles the hover state on the item.
|
|
1927
1961
|
var handleHover = function handleHover() {
|
|
1928
1962
|
return setIsHovered(!isHovered);
|
|
1929
1963
|
};
|
|
@@ -2066,10 +2100,10 @@ var DropDown = function DropDown(_ref4) {
|
|
|
2066
2100
|
backgroundColor: "white",
|
|
2067
2101
|
maxHeight: "200px",
|
|
2068
2102
|
style: {
|
|
2069
|
-
scrollbarWidth: 'none'
|
|
2070
|
-
msOverflowStyle: 'none'
|
|
2103
|
+
scrollbarWidth: 'none',
|
|
2104
|
+
msOverflowStyle: 'none',
|
|
2071
2105
|
'&::-webkit-scrollbar': {
|
|
2072
|
-
display: 'none'
|
|
2106
|
+
display: 'none'
|
|
2073
2107
|
}
|
|
2074
2108
|
}
|
|
2075
2109
|
}, shadow, styles['dropDown']), options.map(function (option, index) {
|
|
@@ -2263,15 +2297,17 @@ var SelectView = function SelectView(_ref6) {
|
|
|
2263
2297
|
}));
|
|
2264
2298
|
};
|
|
2265
2299
|
|
|
2300
|
+
// Defines a functional component named 'SelectComponent', which is expected to receive 'SelectProps' as properties.
|
|
2266
2301
|
var SelectComponent = function SelectComponent(props) {
|
|
2302
|
+
// Invokes the 'useSelectState' hook with props to obtain stateful logic for the Select component.
|
|
2267
2303
|
var selectStates = useSelectState(props);
|
|
2304
|
+
// Renders the 'SelectView' component, passing along any states controlled by 'useSelectState' and all properties passed to 'SelectComponent'.
|
|
2268
2305
|
return React__default.createElement(SelectView, Object.assign({}, selectStates, props));
|
|
2269
2306
|
};
|
|
2270
|
-
|
|
2271
|
-
* Select provides a dropdown list of options for the user to choose from.
|
|
2272
|
-
*/
|
|
2307
|
+
// Exports 'SelectComponent' as 'Select', making it available for import in other parts of the application.
|
|
2273
2308
|
var Select = SelectComponent;
|
|
2274
2309
|
|
|
2310
|
+
// This file defines a custom hook for managing the state of a Switch component. It allows tracking whether the switch is hovered, and its on/off state based on 'isDisabled' and 'isChecked' properties.
|
|
2275
2311
|
var useSwitchState = function useSwitchState(_ref) {
|
|
2276
2312
|
var isDisabled = _ref.isDisabled,
|
|
2277
2313
|
isChecked = _ref.isChecked;
|
|
@@ -2289,6 +2325,7 @@ var useSwitchState = function useSwitchState(_ref) {
|
|
|
2289
2325
|
};
|
|
2290
2326
|
};
|
|
2291
2327
|
|
|
2328
|
+
// Defines a mapping of size types to their respective knob style properties, specifying the height and width for various predefined sizes.
|
|
2292
2329
|
var KnobSizes = {
|
|
2293
2330
|
xs: {
|
|
2294
2331
|
height: 6,
|
|
@@ -2331,6 +2368,7 @@ var KnobSizes = {
|
|
|
2331
2368
|
width: 33
|
|
2332
2369
|
}
|
|
2333
2370
|
};
|
|
2371
|
+
// Specifies the dimensions of the switch's slider for each predefined size by mapping them to the height and width CSS properties.
|
|
2334
2372
|
var SliderSizes = {
|
|
2335
2373
|
xs: {
|
|
2336
2374
|
height: 16,
|
|
@@ -2373,6 +2411,7 @@ var SliderSizes = {
|
|
|
2373
2411
|
width: 100
|
|
2374
2412
|
}
|
|
2375
2413
|
};
|
|
2414
|
+
// Associates each size type with corresponding padding values for vertical and horizontal spacing, used to adjust the position of the elements within the switch.
|
|
2376
2415
|
var SliderPadding = {
|
|
2377
2416
|
xs: {
|
|
2378
2417
|
paddingVertical: 0,
|
|
@@ -2507,28 +2546,38 @@ var SwitchView = function SwitchView(_ref) {
|
|
|
2507
2546
|
}, KnobSizes[size], styles['circle'])), inActiveChild && !value && React__default.createElement(View, null, inActiveChild)), labelPosition === 'right' && label && React__default.createElement(View, null, label));
|
|
2508
2547
|
};
|
|
2509
2548
|
|
|
2549
|
+
// Defines the SwitchComponent as a functional component that takes SwitchProps as props.
|
|
2510
2550
|
var SwitchComponent = function SwitchComponent(props) {
|
|
2551
|
+
// Invokes useSwitchState hook to obtain state for this component, passing props to it.
|
|
2511
2552
|
var switchStates = useSwitchState(props);
|
|
2553
|
+
// Renders the SwitchView component, spreading the switchStates and props to pass all necessary data.
|
|
2512
2554
|
return React__default.createElement(SwitchView, Object.assign({}, switchStates, props));
|
|
2513
2555
|
};
|
|
2556
|
+
// Exports the SwitchComponent as 'Switch' for use in other parts of the application.
|
|
2514
2557
|
var Switch = SwitchComponent;
|
|
2515
2558
|
|
|
2559
|
+
// Declaration of the useTextAreaState custom hook for managing the text area component state.
|
|
2516
2560
|
var useTextAreaState = function useTextAreaState(_ref) {
|
|
2517
2561
|
var label = _ref.label,
|
|
2518
2562
|
placeholder = _ref.placeholder,
|
|
2519
2563
|
defaultValue = _ref.value;
|
|
2564
|
+
// State hook for the 'hint' value, displaying either the label or placeholder as guidance within the text area.
|
|
2520
2565
|
var _useState = React.useState(label != null ? label : placeholder),
|
|
2521
2566
|
hint = _useState[0],
|
|
2522
2567
|
setHint = _useState[1];
|
|
2568
|
+
// State hook for tracking whether the text area is hovered over.
|
|
2523
2569
|
var _useState2 = React.useState(false),
|
|
2524
2570
|
isHovered = _useState2[0],
|
|
2525
2571
|
setIsHovered = _useState2[1];
|
|
2572
|
+
// State hook to manage the current value of the text area, initialized with the default value or an empty string.
|
|
2526
2573
|
var _useState3 = React.useState(defaultValue || ''),
|
|
2527
2574
|
value = _useState3[0],
|
|
2528
2575
|
setValue = _useState3[1];
|
|
2576
|
+
// State hook to determine if the text area is currently focused.
|
|
2529
2577
|
var _useState4 = React.useState(false),
|
|
2530
2578
|
isFocused = _useState4[0],
|
|
2531
2579
|
setIsFocused = _useState4[1];
|
|
2580
|
+
// Memoized callback that sets the hint based on focus state and value presence to ensure proper label or placeholder visibility.
|
|
2532
2581
|
React.useMemo(function () {
|
|
2533
2582
|
setHint(isFocused && !value ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
|
|
2534
2583
|
}, [value, isFocused, label, placeholder]);
|
|
@@ -2542,6 +2591,7 @@ var useTextAreaState = function useTextAreaState(_ref) {
|
|
|
2542
2591
|
isFocused: isFocused,
|
|
2543
2592
|
setIsFocused: setIsFocused
|
|
2544
2593
|
};
|
|
2594
|
+
// Export of the useTextAreaState hook for external usage.
|
|
2545
2595
|
};
|
|
2546
2596
|
|
|
2547
2597
|
var _excluded$t = ["id", "name", "hint", "error", "value", "label", "shadow", "helperText", "placeholder", "size", "shape", "variant", "colorScheme", "isHovered", "isFocused", "isEditable", "isReadOnly", "isDisabled", "isAutoFocus", "isMultiline", "maxRows", "maxCols", "onBlur", "onChange", "onFocus", "onChangeText", "setHint", "setValue", "setIsFocused", "setIsHovered", "styles"];
|
|
@@ -2631,7 +2681,6 @@ var TextAreaView = function TextAreaView(_ref) {
|
|
|
2631
2681
|
};
|
|
2632
2682
|
var handleChange = function handleChange(event) {
|
|
2633
2683
|
if (typeof event === 'string') {
|
|
2634
|
-
//for ios and android
|
|
2635
2684
|
setValue(event);
|
|
2636
2685
|
if (onChangeText) onChangeText(event);
|
|
2637
2686
|
} else {
|
|
@@ -2686,34 +2735,44 @@ var TextAreaView = function TextAreaView(_ref) {
|
|
|
2686
2735
|
})))));
|
|
2687
2736
|
};
|
|
2688
2737
|
|
|
2738
|
+
// Defines the TextAreaComponent as a functional component that accepts TextAreaProps for type safety and structure.
|
|
2689
2739
|
var TextAreaComponent = function TextAreaComponent(props) {
|
|
2740
|
+
// Creates a state for the TextAreaComponent using custom hook useTextAreaState which initializes the state with props.
|
|
2690
2741
|
var textAreaState = useTextAreaState(props);
|
|
2742
|
+
// Renders the TextAreaView component, passing along the state and any received props.
|
|
2691
2743
|
return React__default.createElement(TextAreaView, Object.assign({}, textAreaState, props));
|
|
2692
2744
|
};
|
|
2693
|
-
|
|
2694
|
-
* Text Area is an component used to create a multi-line input field.
|
|
2695
|
-
*/
|
|
2745
|
+
// Exports the TextAreaComponent as TextArea for use in other parts of the application.
|
|
2696
2746
|
var TextArea = TextAreaComponent;
|
|
2697
2747
|
|
|
2748
|
+
// Define a custom hook `useTextFieldState` that creates and manages the state of a text field component based on its properties.
|
|
2698
2749
|
var useTextFieldState = function useTextFieldState(_ref) {
|
|
2699
2750
|
var label = _ref.label,
|
|
2700
2751
|
placeholder = _ref.placeholder,
|
|
2701
2752
|
defaultValue = _ref.value;
|
|
2753
|
+
// Initialize `hint` state with either the label or placeholder text, using label as a priority if it exists.
|
|
2702
2754
|
var _useState = React.useState(label != null ? label : placeholder),
|
|
2703
2755
|
hint = _useState[0],
|
|
2704
2756
|
setHint = _useState[1];
|
|
2757
|
+
// Set up a boolean state `isFocused` to track if the text field is focused.
|
|
2705
2758
|
var _useState2 = React.useState(false),
|
|
2706
2759
|
isFocused = _useState2[0],
|
|
2707
2760
|
setIsFocused = _useState2[1];
|
|
2761
|
+
// Introduce a boolean state `isHovered` for tracking mouse hover status over the text field.
|
|
2708
2762
|
var _useState3 = React.useState(false),
|
|
2709
2763
|
isHovered = _useState3[0],
|
|
2710
2764
|
setIsHovered = _useState3[1];
|
|
2765
|
+
// Manage the `value` state that holds the current value of the text field, initialized with defaultValue.
|
|
2711
2766
|
var _useState4 = React.useState(defaultValue),
|
|
2712
2767
|
value = _useState4[0],
|
|
2713
2768
|
setValue = _useState4[1];
|
|
2769
|
+
// Use `useMemo` hook to recompute hint text when any dependency changes, updating it based on focus state and presence of value.
|
|
2714
2770
|
React.useMemo(function () {
|
|
2771
|
+
// Update the `hint` state depending on whether the text field is focused and if value is not present, falling back to placeholder or label.
|
|
2715
2772
|
setHint(isFocused && !value ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
|
|
2773
|
+
// Specify the dependencies for the `useMemo` hook - updating the `hint` text when value, isFocused, label, or placeholder changes.
|
|
2716
2774
|
}, [value, isFocused, label, placeholder]);
|
|
2775
|
+
// Return an object exposing the states and state setter functions for consumer components to use and manage the text field's UI and behavior.
|
|
2717
2776
|
return {
|
|
2718
2777
|
hint: hint,
|
|
2719
2778
|
setHint: setHint,
|
|
@@ -2820,12 +2879,10 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
2820
2879
|
};
|
|
2821
2880
|
var handleChange = function handleChange(event) {
|
|
2822
2881
|
if (typeof event === 'string') {
|
|
2823
|
-
//for ios and android
|
|
2824
2882
|
setValue(event);
|
|
2825
2883
|
if (onChangeText) onChangeText(event);
|
|
2826
2884
|
if (onChange) onChange(event);
|
|
2827
2885
|
} else {
|
|
2828
|
-
//Web
|
|
2829
2886
|
setValue(event.target.value);
|
|
2830
2887
|
if (onChangeText) onChangeText(event.target.value);
|
|
2831
2888
|
if (onChange) onChange(event.target.value);
|
|
@@ -2833,7 +2890,6 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
2833
2890
|
};
|
|
2834
2891
|
var handleClear = function handleClear() {
|
|
2835
2892
|
setValue('');
|
|
2836
|
-
//Web
|
|
2837
2893
|
if (onChange) {
|
|
2838
2894
|
onBlur({
|
|
2839
2895
|
target: {
|
|
@@ -2843,7 +2899,6 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
2843
2899
|
if (onChangeText) onChangeText('');
|
|
2844
2900
|
if (onChange) onChange('');
|
|
2845
2901
|
}
|
|
2846
|
-
//for ios and android
|
|
2847
2902
|
if (typeof document === 'undefined' && onChangeText) onChangeText('');
|
|
2848
2903
|
};
|
|
2849
2904
|
return React__default.createElement(FieldContainer, {
|
|
@@ -2893,12 +2948,12 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
2893
2948
|
};
|
|
2894
2949
|
|
|
2895
2950
|
var TextFieldComponent = function TextFieldComponent(props) {
|
|
2951
|
+
// Initializes the 'textFieldStates' with state-management logic and relevant properties from 'useTextFieldState' hook, passing current 'props' as the argument
|
|
2896
2952
|
var textFieldStates = useTextFieldState(props);
|
|
2953
|
+
// Renders the 'TextFieldView' component with the spread attributes from both 'textFieldStates' and 'props' to pass all necessary data
|
|
2897
2954
|
return React__default.createElement(TextFieldView, Object.assign({}, textFieldStates, props));
|
|
2898
2955
|
};
|
|
2899
|
-
|
|
2900
|
-
* TextField is used to capture text data from users.
|
|
2901
|
-
*/
|
|
2956
|
+
// Exports 'TextFieldComponent' as 'TextField' for use in other parts of the application
|
|
2902
2957
|
var TextField = TextFieldComponent;
|
|
2903
2958
|
|
|
2904
2959
|
var useCheckboxState = function useCheckboxState(_ref) {
|
|
@@ -4535,6 +4590,7 @@ var countryList = [
|
|
|
4535
4590
|
}
|
|
4536
4591
|
];
|
|
4537
4592
|
|
|
4593
|
+
// Defines a custom hook for managing the CountryPicker component's state, including options from a country list, selected value, and UI states for hiding, focus, and hover.
|
|
4538
4594
|
var useCountryPickerState = function useCountryPickerState(_ref) {
|
|
4539
4595
|
var placeholder = _ref.placeholder;
|
|
4540
4596
|
var _React$useState = React__default.useState(countryList),
|
|
@@ -4566,6 +4622,7 @@ var useCountryPickerState = function useCountryPickerState(_ref) {
|
|
|
4566
4622
|
};
|
|
4567
4623
|
};
|
|
4568
4624
|
|
|
4625
|
+
// Defines the size of icons based on predefined size categories to maintain design consistency.
|
|
4569
4626
|
var IconSizes$4 = {
|
|
4570
4627
|
xs: 8,
|
|
4571
4628
|
sm: 10,
|
|
@@ -4751,9 +4808,6 @@ var CountryPickerView = function CountryPickerView(_ref5) {
|
|
|
4751
4808
|
onBlur(event);
|
|
4752
4809
|
setIsFocused(false);
|
|
4753
4810
|
};
|
|
4754
|
-
// useEffect(() => {
|
|
4755
|
-
// if (onChange) onChange(value); // Call onChange when valueCountry changes
|
|
4756
|
-
// }, [onChange, value]);
|
|
4757
4811
|
var isWithLabel = !!(isFocused && label);
|
|
4758
4812
|
var fieldStyles = _extends({
|
|
4759
4813
|
margin: 0,
|
|
@@ -4827,13 +4881,14 @@ var CountryPickerView = function CountryPickerView(_ref5) {
|
|
|
4827
4881
|
}));
|
|
4828
4882
|
};
|
|
4829
4883
|
|
|
4884
|
+
// Defines the CountryPickerComponent as a functional component with type 'React.FC' that takes 'CountryPickerProps' as props.
|
|
4830
4885
|
var CountryPickerComponent = function CountryPickerComponent(props) {
|
|
4886
|
+
// Invokes the 'useCountryPickerState' hook to obtain state and methods related to country picking functionality.
|
|
4831
4887
|
var countryPickerStates = useCountryPickerState(props);
|
|
4888
|
+
// Renders the CountryPickerView component passing in state and props for dynamic UI representation.
|
|
4832
4889
|
return React__default.createElement(CountryPickerView, Object.assign({}, countryPickerStates, props));
|
|
4833
4890
|
};
|
|
4834
|
-
|
|
4835
|
-
* Country picker allows users to select a country from a dropdown list or search field.
|
|
4836
|
-
*/
|
|
4891
|
+
// Exports the CountryPickerComponent for use in other parts of the application as 'CountryPicker'.
|
|
4837
4892
|
var CountryPicker = CountryPickerComponent;
|
|
4838
4893
|
|
|
4839
4894
|
var useDatePickerState = function useDatePickerState() {
|
|
@@ -6018,7 +6073,7 @@ var ModalHeader = function ModalHeader(_ref3) {
|
|
|
6018
6073
|
padding: 0,
|
|
6019
6074
|
margin: 0,
|
|
6020
6075
|
filter: "none",
|
|
6021
|
-
|
|
6076
|
+
width: 0
|
|
6022
6077
|
});
|
|
6023
6078
|
return React__default.createElement(Horizontal, Object.assign({
|
|
6024
6079
|
justifyContent: buttonPosition === 'none' ? 'center' : 'space-between',
|