@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
package/dist/web.esm.js
CHANGED
|
@@ -188,6 +188,7 @@ var TextComponent = function TextComponent(props) {
|
|
|
188
188
|
var Text = TextComponent;
|
|
189
189
|
|
|
190
190
|
var _excluded$1 = ["justifyContent", "isReversed"];
|
|
191
|
+
// Defines the functional component VerticalView with props specified by VerticalProps
|
|
191
192
|
var VerticalView = function VerticalView(_ref) {
|
|
192
193
|
var _ref$justifyContent = _ref.justifyContent,
|
|
193
194
|
justifyContent = _ref$justifyContent === void 0 ? 'flex-start' : _ref$justifyContent,
|
|
@@ -201,39 +202,46 @@ var VerticalView = function VerticalView(_ref) {
|
|
|
201
202
|
}, props));
|
|
202
203
|
};
|
|
203
204
|
|
|
204
|
-
|
|
205
|
-
* Vertical layout aligns all the elements in a container on the vertical axis.
|
|
206
|
-
*/
|
|
205
|
+
// Defines the VerticalComponent as a functional component with VerticalProps as its props signature.
|
|
207
206
|
var VerticalComponent = function VerticalComponent(props) {
|
|
208
|
-
return
|
|
207
|
+
return (
|
|
208
|
+
// Renders the VerticalView component, passing all of the received props through to it.
|
|
209
|
+
React.createElement(VerticalView, Object.assign({}, props))
|
|
210
|
+
);
|
|
209
211
|
};
|
|
212
|
+
// Exports the VerticalComponent as Vertical for use in other parts of the application.
|
|
210
213
|
var Vertical = VerticalComponent;
|
|
211
214
|
|
|
212
|
-
|
|
213
|
-
* Horizontal layout aligns all the elements in a container on the horizontal axis.
|
|
214
|
-
*/
|
|
215
|
+
// Defines a functional component 'HorizontalComponent' utilizing 'ViewProps'. It leverages flexbox to create a horizontal view, which can be reversed based on a prop.
|
|
215
216
|
var HorizontalComponent = function HorizontalComponent(props) {
|
|
216
217
|
return React.createElement(View$1, Object.assign({
|
|
217
218
|
display: "flex",
|
|
218
219
|
flexDirection: props.isReversed ? 'row-reverse' : 'row'
|
|
219
220
|
}, props));
|
|
220
221
|
};
|
|
222
|
+
// Exports the HorizontalComponent as 'Horizontal', making it available for use in other parts of the application.
|
|
221
223
|
var Horizontal = HorizontalComponent;
|
|
222
224
|
|
|
225
|
+
// Defines a React Functional Component named CenterView which centers its children both horizontally and vertically using flexbox.
|
|
223
226
|
var CenterView = function CenterView(props) {
|
|
224
|
-
return
|
|
225
|
-
display
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
return (
|
|
228
|
+
// Renders a 'View' component with display flex and center alignment applied on both axes, passing all received props.
|
|
229
|
+
React.createElement(View$1, Object.assign({
|
|
230
|
+
display: "flex",
|
|
231
|
+
justifyContent: "center",
|
|
232
|
+
alignItems: "center"
|
|
233
|
+
}, props))
|
|
234
|
+
);
|
|
229
235
|
};
|
|
230
236
|
|
|
231
|
-
|
|
232
|
-
* The Center component is a React functional component that provides a centered layout for its children using flexbox.
|
|
233
|
-
*/
|
|
237
|
+
// Defines a functional component named CenterComponent utilizing React's functional component structure, which expects props of the CenterProps type.
|
|
234
238
|
var CenterComponent = function CenterComponent(props) {
|
|
235
|
-
return
|
|
239
|
+
return (
|
|
240
|
+
// Renders the CenterView component, passing down all the props received by the CenterComponent.
|
|
241
|
+
React.createElement(CenterView, Object.assign({}, props))
|
|
242
|
+
);
|
|
236
243
|
};
|
|
244
|
+
// Exports CenterComponent as Center, making it available for use in other parts of the application.
|
|
237
245
|
var Center = CenterComponent;
|
|
238
246
|
|
|
239
247
|
var _excluded$2 = ["size", "color"];
|
|
@@ -1018,6 +1026,7 @@ var useButtonState = function useButtonState() {
|
|
|
1018
1026
|
};
|
|
1019
1027
|
// The hook returns an object containing 'isHovered' state and the 'setIsHovered' function to enable state management from the consumer component.
|
|
1020
1028
|
|
|
1029
|
+
// This function initializes the Link component's state using the useState hook and exposes its state and setter function.
|
|
1021
1030
|
var useLinkState = function useLinkState() {
|
|
1022
1031
|
var _useState = useState(false),
|
|
1023
1032
|
isHovered = _useState[0],
|
|
@@ -1028,6 +1037,7 @@ var useLinkState = function useLinkState() {
|
|
|
1028
1037
|
};
|
|
1029
1038
|
};
|
|
1030
1039
|
|
|
1040
|
+
// 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.
|
|
1031
1041
|
var IconSizes = {
|
|
1032
1042
|
xs: 12,
|
|
1033
1043
|
sm: 14,
|
|
@@ -1042,6 +1052,7 @@ var IconSizes = {
|
|
|
1042
1052
|
};
|
|
1043
1053
|
|
|
1044
1054
|
var _excluded$g = ["children", "href", "iconSize", "underline", "isHovered", "isExternal", "styles", "setIsHovered"];
|
|
1055
|
+
// Component definition for 'LinkView', a functional component with props defined by 'LinkViewProps'.
|
|
1045
1056
|
var LinkView = function LinkView(_ref) {
|
|
1046
1057
|
var children = _ref.children,
|
|
1047
1058
|
_ref$href = _ref.href,
|
|
@@ -1062,6 +1073,7 @@ var LinkView = function LinkView(_ref) {
|
|
|
1062
1073
|
_ref$setIsHovered = _ref.setIsHovered,
|
|
1063
1074
|
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
1064
1075
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
1076
|
+
// Function to handle mouse enter/leave events to toggle hover state.
|
|
1065
1077
|
var handleHover = function handleHover() {
|
|
1066
1078
|
if (underline === 'hover') setIsHovered(true);
|
|
1067
1079
|
};
|
|
@@ -1082,13 +1094,14 @@ var LinkView = function LinkView(_ref) {
|
|
|
1082
1094
|
}))));
|
|
1083
1095
|
};
|
|
1084
1096
|
|
|
1097
|
+
// Defines the 'LinkComponent' as a functional component with props typed to 'LinkProps'
|
|
1085
1098
|
var LinkComponent = function LinkComponent(props) {
|
|
1099
|
+
// Gets stateful logic and data necessary for the link component via 'useLinkState' hook
|
|
1086
1100
|
var linkStates = useLinkState();
|
|
1101
|
+
// Renders 'LinkView' component passing down link state and props
|
|
1087
1102
|
return React.createElement(LinkView, Object.assign({}, linkStates, props));
|
|
1088
1103
|
};
|
|
1089
|
-
|
|
1090
|
-
* Link allows users to navigate from page to page. It have a similar appearance as the hyperlink.
|
|
1091
|
-
*/
|
|
1104
|
+
// Exports 'LinkComponent' as 'Link' for use in other parts of the application
|
|
1092
1105
|
var Link = LinkComponent;
|
|
1093
1106
|
|
|
1094
1107
|
var ButtonSizes = {
|
|
@@ -1196,6 +1209,8 @@ var IconSizes$1 = {
|
|
|
1196
1209
|
}
|
|
1197
1210
|
};
|
|
1198
1211
|
|
|
1212
|
+
// Defines a mapping of spinning speed labels to their respective duration in seconds for the Loader component animations.
|
|
1213
|
+
// Sets up a scale of sizes, mapping size labels to numerical values to be used for Loader component dimensions.
|
|
1199
1214
|
var DefaultSizes = {
|
|
1200
1215
|
xs: 14,
|
|
1201
1216
|
sm: 18,
|
|
@@ -1208,6 +1223,7 @@ var DefaultSizes = {
|
|
|
1208
1223
|
'5xl': 70,
|
|
1209
1224
|
'6xl': 80
|
|
1210
1225
|
};
|
|
1226
|
+
// Specifies a mapping of spinning speed labels to numerical millisecond values, determining the speed of the Loader component's animation cycles.
|
|
1211
1227
|
var DefaultSpeeds = {
|
|
1212
1228
|
fast: 50,
|
|
1213
1229
|
normal: 100,
|
|
@@ -1391,12 +1407,14 @@ var LoaderView = function LoaderView(_ref4) {
|
|
|
1391
1407
|
}, children));
|
|
1392
1408
|
};
|
|
1393
1409
|
|
|
1410
|
+
// Defines a LoaderComponent as a functional component with props defined by LoaderProps and returns the LoaderView component, passing along any received props.
|
|
1394
1411
|
var LoaderComponent = function LoaderComponent(props) {
|
|
1395
|
-
return
|
|
1412
|
+
return (
|
|
1413
|
+
// Renders the LoaderView component by spreading the received props, which allows for a clean pass-through of properties.
|
|
1414
|
+
React.createElement(LoaderView, Object.assign({}, props))
|
|
1415
|
+
);
|
|
1396
1416
|
};
|
|
1397
|
-
|
|
1398
|
-
* It gives the user an insight about an action being processed. It may have an undefined waiting time or display the process length.
|
|
1399
|
-
*/
|
|
1417
|
+
// Exports the LoaderComponent as Loader, making it available for use in other parts of the application.
|
|
1400
1418
|
var Loader = LoaderComponent;
|
|
1401
1419
|
|
|
1402
1420
|
var _excluded$i = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick", "loaderProps", "loaderPosition", "effect", "isHovered", "setIsHovered"];
|
|
@@ -1582,26 +1600,34 @@ var FileImage = function FileImage(_ref2) {
|
|
|
1582
1600
|
}, props));
|
|
1583
1601
|
};
|
|
1584
1602
|
|
|
1603
|
+
// Initializes the custom hook 'useSelectState' for managing the state of the Select component
|
|
1585
1604
|
var useSelectState = function useSelectState(_ref) {
|
|
1586
1605
|
var placeholder = _ref.placeholder,
|
|
1587
1606
|
isMulti = _ref.isMulti,
|
|
1588
1607
|
options = _ref.options;
|
|
1608
|
+
// 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
|
|
1589
1609
|
var defaultValue = placeholder ? isMulti ? [] : '' : options[0].value;
|
|
1610
|
+
// State hook for managing visibility of the Select dropdown, initially set to hidden
|
|
1590
1611
|
var _React$useState = React.useState(true),
|
|
1591
1612
|
hide = _React$useState[0],
|
|
1592
1613
|
setHide = _React$useState[1];
|
|
1614
|
+
// State hook for tracking mouse hover status over the Select component
|
|
1593
1615
|
var _React$useState2 = React.useState(false),
|
|
1594
1616
|
isHovered = _React$useState2[0],
|
|
1595
1617
|
setIsHovered = _React$useState2[1];
|
|
1618
|
+
// State hook for tracking focus status of the Select input field
|
|
1596
1619
|
var _React$useState3 = React.useState(false),
|
|
1597
1620
|
isFocused = _React$useState3[0],
|
|
1598
1621
|
setIsFocused = _React$useState3[1];
|
|
1622
|
+
// State hook for managing the value(s) selected by the user, initialized with the default value
|
|
1599
1623
|
var _React$useState4 = React.useState(defaultValue),
|
|
1600
1624
|
value = _React$useState4[0],
|
|
1601
1625
|
setValue = _React$useState4[1];
|
|
1626
|
+
// State hook for keeping track of the currently highlighted index in the options list
|
|
1602
1627
|
var _React$useState5 = React.useState(0),
|
|
1603
1628
|
highlightedIndex = _React$useState5[0],
|
|
1604
1629
|
setHighlightedIndex = _React$useState5[1];
|
|
1630
|
+
// Returns an object containing all stateful values and their associated setters to manage the Select component's state
|
|
1605
1631
|
return {
|
|
1606
1632
|
value: value,
|
|
1607
1633
|
setValue: setValue,
|
|
@@ -1615,10 +1641,13 @@ var useSelectState = function useSelectState(_ref) {
|
|
|
1615
1641
|
setHighlightedIndex: setHighlightedIndex
|
|
1616
1642
|
};
|
|
1617
1643
|
};
|
|
1644
|
+
// Initializes another custom hook 'useItemState' for managing the hover state of each Select item
|
|
1618
1645
|
var useItemState = function useItemState() {
|
|
1646
|
+
// State hook for tracking mouse hover status over individual Select item options
|
|
1619
1647
|
var _React$useState6 = React.useState(false),
|
|
1620
1648
|
isHovered = _React$useState6[0],
|
|
1621
1649
|
setIsHovered = _React$useState6[1];
|
|
1650
|
+
// Returns an object with 'isHovered' state and its associated setter from the 'useItemState' hook, for controlling individual Select item hover state
|
|
1622
1651
|
return {
|
|
1623
1652
|
isHovered: isHovered,
|
|
1624
1653
|
setIsHovered: setIsHovered
|
|
@@ -1892,6 +1921,8 @@ var FieldWrapper = function FieldWrapper(_ref) {
|
|
|
1892
1921
|
}, props), children);
|
|
1893
1922
|
};
|
|
1894
1923
|
|
|
1924
|
+
// Defines a mapping of 'Size' types to their corresponding CSSProperties. This allows different size configurations to be provided for the Select component.
|
|
1925
|
+
// Specifies the pixel sizes of icons associated with the Select component based on the predefined 'Size' types allowing for consistent icon scaling.
|
|
1895
1926
|
var IconSizes$2 = {
|
|
1896
1927
|
xs: 8,
|
|
1897
1928
|
sm: 10,
|
|
@@ -1904,6 +1935,7 @@ var _excluded$r = ["isHovered", "setIsHovered", "option", "size", "callback", "s
|
|
|
1904
1935
|
_excluded2$2 = ["id", "name", "value", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
|
|
1905
1936
|
_excluded3$1 = ["option", "size", "removeOption"],
|
|
1906
1937
|
_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"];
|
|
1938
|
+
// Defines a component to render individual selection items within a list.
|
|
1907
1939
|
var Item = function Item(_ref) {
|
|
1908
1940
|
var isHovered = _ref.isHovered,
|
|
1909
1941
|
setIsHovered = _ref.setIsHovered,
|
|
@@ -1914,9 +1946,11 @@ var Item = function Item(_ref) {
|
|
|
1914
1946
|
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
1915
1947
|
style = _ref.style,
|
|
1916
1948
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
1949
|
+
// Handles the click event on an option by invoking the callback with the selected option's value.
|
|
1917
1950
|
var handleOptionClick = function handleOptionClick(option) {
|
|
1918
1951
|
return callback(option);
|
|
1919
1952
|
};
|
|
1953
|
+
// Toggles the hover state on the item.
|
|
1920
1954
|
var handleHover = function handleHover() {
|
|
1921
1955
|
return setIsHovered(!isHovered);
|
|
1922
1956
|
};
|
|
@@ -2059,10 +2093,10 @@ var DropDown = function DropDown(_ref4) {
|
|
|
2059
2093
|
backgroundColor: "white",
|
|
2060
2094
|
maxHeight: "200px",
|
|
2061
2095
|
style: {
|
|
2062
|
-
scrollbarWidth: 'none'
|
|
2063
|
-
msOverflowStyle: 'none'
|
|
2096
|
+
scrollbarWidth: 'none',
|
|
2097
|
+
msOverflowStyle: 'none',
|
|
2064
2098
|
'&::-webkit-scrollbar': {
|
|
2065
|
-
display: 'none'
|
|
2099
|
+
display: 'none'
|
|
2066
2100
|
}
|
|
2067
2101
|
}
|
|
2068
2102
|
}, shadow, styles['dropDown']), options.map(function (option, index) {
|
|
@@ -2256,15 +2290,17 @@ var SelectView = function SelectView(_ref6) {
|
|
|
2256
2290
|
}));
|
|
2257
2291
|
};
|
|
2258
2292
|
|
|
2293
|
+
// Defines a functional component named 'SelectComponent', which is expected to receive 'SelectProps' as properties.
|
|
2259
2294
|
var SelectComponent = function SelectComponent(props) {
|
|
2295
|
+
// Invokes the 'useSelectState' hook with props to obtain stateful logic for the Select component.
|
|
2260
2296
|
var selectStates = useSelectState(props);
|
|
2297
|
+
// Renders the 'SelectView' component, passing along any states controlled by 'useSelectState' and all properties passed to 'SelectComponent'.
|
|
2261
2298
|
return React.createElement(SelectView, Object.assign({}, selectStates, props));
|
|
2262
2299
|
};
|
|
2263
|
-
|
|
2264
|
-
* Select provides a dropdown list of options for the user to choose from.
|
|
2265
|
-
*/
|
|
2300
|
+
// Exports 'SelectComponent' as 'Select', making it available for import in other parts of the application.
|
|
2266
2301
|
var Select = SelectComponent;
|
|
2267
2302
|
|
|
2303
|
+
// 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.
|
|
2268
2304
|
var useSwitchState = function useSwitchState(_ref) {
|
|
2269
2305
|
var isDisabled = _ref.isDisabled,
|
|
2270
2306
|
isChecked = _ref.isChecked;
|
|
@@ -2282,6 +2318,7 @@ var useSwitchState = function useSwitchState(_ref) {
|
|
|
2282
2318
|
};
|
|
2283
2319
|
};
|
|
2284
2320
|
|
|
2321
|
+
// Defines a mapping of size types to their respective knob style properties, specifying the height and width for various predefined sizes.
|
|
2285
2322
|
var KnobSizes = {
|
|
2286
2323
|
xs: {
|
|
2287
2324
|
height: 6,
|
|
@@ -2324,6 +2361,7 @@ var KnobSizes = {
|
|
|
2324
2361
|
width: 33
|
|
2325
2362
|
}
|
|
2326
2363
|
};
|
|
2364
|
+
// Specifies the dimensions of the switch's slider for each predefined size by mapping them to the height and width CSS properties.
|
|
2327
2365
|
var SliderSizes = {
|
|
2328
2366
|
xs: {
|
|
2329
2367
|
height: 16,
|
|
@@ -2366,6 +2404,7 @@ var SliderSizes = {
|
|
|
2366
2404
|
width: 100
|
|
2367
2405
|
}
|
|
2368
2406
|
};
|
|
2407
|
+
// Associates each size type with corresponding padding values for vertical and horizontal spacing, used to adjust the position of the elements within the switch.
|
|
2369
2408
|
var SliderPadding = {
|
|
2370
2409
|
xs: {
|
|
2371
2410
|
paddingVertical: 0,
|
|
@@ -2500,28 +2539,38 @@ var SwitchView = function SwitchView(_ref) {
|
|
|
2500
2539
|
}, KnobSizes[size], styles['circle'])), inActiveChild && !value && React.createElement(View, null, inActiveChild)), labelPosition === 'right' && label && React.createElement(View, null, label));
|
|
2501
2540
|
};
|
|
2502
2541
|
|
|
2542
|
+
// Defines the SwitchComponent as a functional component that takes SwitchProps as props.
|
|
2503
2543
|
var SwitchComponent = function SwitchComponent(props) {
|
|
2544
|
+
// Invokes useSwitchState hook to obtain state for this component, passing props to it.
|
|
2504
2545
|
var switchStates = useSwitchState(props);
|
|
2546
|
+
// Renders the SwitchView component, spreading the switchStates and props to pass all necessary data.
|
|
2505
2547
|
return React.createElement(SwitchView, Object.assign({}, switchStates, props));
|
|
2506
2548
|
};
|
|
2549
|
+
// Exports the SwitchComponent as 'Switch' for use in other parts of the application.
|
|
2507
2550
|
var Switch = SwitchComponent;
|
|
2508
2551
|
|
|
2552
|
+
// Declaration of the useTextAreaState custom hook for managing the text area component state.
|
|
2509
2553
|
var useTextAreaState = function useTextAreaState(_ref) {
|
|
2510
2554
|
var label = _ref.label,
|
|
2511
2555
|
placeholder = _ref.placeholder,
|
|
2512
2556
|
defaultValue = _ref.value;
|
|
2557
|
+
// State hook for the 'hint' value, displaying either the label or placeholder as guidance within the text area.
|
|
2513
2558
|
var _useState = useState(label != null ? label : placeholder),
|
|
2514
2559
|
hint = _useState[0],
|
|
2515
2560
|
setHint = _useState[1];
|
|
2561
|
+
// State hook for tracking whether the text area is hovered over.
|
|
2516
2562
|
var _useState2 = useState(false),
|
|
2517
2563
|
isHovered = _useState2[0],
|
|
2518
2564
|
setIsHovered = _useState2[1];
|
|
2565
|
+
// State hook to manage the current value of the text area, initialized with the default value or an empty string.
|
|
2519
2566
|
var _useState3 = useState(defaultValue || ''),
|
|
2520
2567
|
value = _useState3[0],
|
|
2521
2568
|
setValue = _useState3[1];
|
|
2569
|
+
// State hook to determine if the text area is currently focused.
|
|
2522
2570
|
var _useState4 = useState(false),
|
|
2523
2571
|
isFocused = _useState4[0],
|
|
2524
2572
|
setIsFocused = _useState4[1];
|
|
2573
|
+
// Memoized callback that sets the hint based on focus state and value presence to ensure proper label or placeholder visibility.
|
|
2525
2574
|
useMemo(function () {
|
|
2526
2575
|
setHint(isFocused && !value ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
|
|
2527
2576
|
}, [value, isFocused, label, placeholder]);
|
|
@@ -2535,6 +2584,7 @@ var useTextAreaState = function useTextAreaState(_ref) {
|
|
|
2535
2584
|
isFocused: isFocused,
|
|
2536
2585
|
setIsFocused: setIsFocused
|
|
2537
2586
|
};
|
|
2587
|
+
// Export of the useTextAreaState hook for external usage.
|
|
2538
2588
|
};
|
|
2539
2589
|
|
|
2540
2590
|
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"];
|
|
@@ -2624,7 +2674,6 @@ var TextAreaView = function TextAreaView(_ref) {
|
|
|
2624
2674
|
};
|
|
2625
2675
|
var handleChange = function handleChange(event) {
|
|
2626
2676
|
if (typeof event === 'string') {
|
|
2627
|
-
//for ios and android
|
|
2628
2677
|
setValue(event);
|
|
2629
2678
|
if (onChangeText) onChangeText(event);
|
|
2630
2679
|
} else {
|
|
@@ -2679,34 +2728,44 @@ var TextAreaView = function TextAreaView(_ref) {
|
|
|
2679
2728
|
})))));
|
|
2680
2729
|
};
|
|
2681
2730
|
|
|
2731
|
+
// Defines the TextAreaComponent as a functional component that accepts TextAreaProps for type safety and structure.
|
|
2682
2732
|
var TextAreaComponent = function TextAreaComponent(props) {
|
|
2733
|
+
// Creates a state for the TextAreaComponent using custom hook useTextAreaState which initializes the state with props.
|
|
2683
2734
|
var textAreaState = useTextAreaState(props);
|
|
2735
|
+
// Renders the TextAreaView component, passing along the state and any received props.
|
|
2684
2736
|
return React.createElement(TextAreaView, Object.assign({}, textAreaState, props));
|
|
2685
2737
|
};
|
|
2686
|
-
|
|
2687
|
-
* Text Area is an component used to create a multi-line input field.
|
|
2688
|
-
*/
|
|
2738
|
+
// Exports the TextAreaComponent as TextArea for use in other parts of the application.
|
|
2689
2739
|
var TextArea = TextAreaComponent;
|
|
2690
2740
|
|
|
2741
|
+
// Define a custom hook `useTextFieldState` that creates and manages the state of a text field component based on its properties.
|
|
2691
2742
|
var useTextFieldState = function useTextFieldState(_ref) {
|
|
2692
2743
|
var label = _ref.label,
|
|
2693
2744
|
placeholder = _ref.placeholder,
|
|
2694
2745
|
defaultValue = _ref.value;
|
|
2746
|
+
// Initialize `hint` state with either the label or placeholder text, using label as a priority if it exists.
|
|
2695
2747
|
var _useState = useState(label != null ? label : placeholder),
|
|
2696
2748
|
hint = _useState[0],
|
|
2697
2749
|
setHint = _useState[1];
|
|
2750
|
+
// Set up a boolean state `isFocused` to track if the text field is focused.
|
|
2698
2751
|
var _useState2 = useState(false),
|
|
2699
2752
|
isFocused = _useState2[0],
|
|
2700
2753
|
setIsFocused = _useState2[1];
|
|
2754
|
+
// Introduce a boolean state `isHovered` for tracking mouse hover status over the text field.
|
|
2701
2755
|
var _useState3 = useState(false),
|
|
2702
2756
|
isHovered = _useState3[0],
|
|
2703
2757
|
setIsHovered = _useState3[1];
|
|
2758
|
+
// Manage the `value` state that holds the current value of the text field, initialized with defaultValue.
|
|
2704
2759
|
var _useState4 = useState(defaultValue),
|
|
2705
2760
|
value = _useState4[0],
|
|
2706
2761
|
setValue = _useState4[1];
|
|
2762
|
+
// Use `useMemo` hook to recompute hint text when any dependency changes, updating it based on focus state and presence of value.
|
|
2707
2763
|
useMemo(function () {
|
|
2764
|
+
// Update the `hint` state depending on whether the text field is focused and if value is not present, falling back to placeholder or label.
|
|
2708
2765
|
setHint(isFocused && !value ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
|
|
2766
|
+
// Specify the dependencies for the `useMemo` hook - updating the `hint` text when value, isFocused, label, or placeholder changes.
|
|
2709
2767
|
}, [value, isFocused, label, placeholder]);
|
|
2768
|
+
// Return an object exposing the states and state setter functions for consumer components to use and manage the text field's UI and behavior.
|
|
2710
2769
|
return {
|
|
2711
2770
|
hint: hint,
|
|
2712
2771
|
setHint: setHint,
|
|
@@ -2813,12 +2872,10 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
2813
2872
|
};
|
|
2814
2873
|
var handleChange = function handleChange(event) {
|
|
2815
2874
|
if (typeof event === 'string') {
|
|
2816
|
-
//for ios and android
|
|
2817
2875
|
setValue(event);
|
|
2818
2876
|
if (onChangeText) onChangeText(event);
|
|
2819
2877
|
if (onChange) onChange(event);
|
|
2820
2878
|
} else {
|
|
2821
|
-
//Web
|
|
2822
2879
|
setValue(event.target.value);
|
|
2823
2880
|
if (onChangeText) onChangeText(event.target.value);
|
|
2824
2881
|
if (onChange) onChange(event.target.value);
|
|
@@ -2826,7 +2883,6 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
2826
2883
|
};
|
|
2827
2884
|
var handleClear = function handleClear() {
|
|
2828
2885
|
setValue('');
|
|
2829
|
-
//Web
|
|
2830
2886
|
if (onChange) {
|
|
2831
2887
|
onBlur({
|
|
2832
2888
|
target: {
|
|
@@ -2836,7 +2892,6 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
2836
2892
|
if (onChangeText) onChangeText('');
|
|
2837
2893
|
if (onChange) onChange('');
|
|
2838
2894
|
}
|
|
2839
|
-
//for ios and android
|
|
2840
2895
|
if (typeof document === 'undefined' && onChangeText) onChangeText('');
|
|
2841
2896
|
};
|
|
2842
2897
|
return React.createElement(FieldContainer, {
|
|
@@ -2886,12 +2941,12 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
2886
2941
|
};
|
|
2887
2942
|
|
|
2888
2943
|
var TextFieldComponent = function TextFieldComponent(props) {
|
|
2944
|
+
// Initializes the 'textFieldStates' with state-management logic and relevant properties from 'useTextFieldState' hook, passing current 'props' as the argument
|
|
2889
2945
|
var textFieldStates = useTextFieldState(props);
|
|
2946
|
+
// Renders the 'TextFieldView' component with the spread attributes from both 'textFieldStates' and 'props' to pass all necessary data
|
|
2890
2947
|
return React.createElement(TextFieldView, Object.assign({}, textFieldStates, props));
|
|
2891
2948
|
};
|
|
2892
|
-
|
|
2893
|
-
* TextField is used to capture text data from users.
|
|
2894
|
-
*/
|
|
2949
|
+
// Exports 'TextFieldComponent' as 'TextField' for use in other parts of the application
|
|
2895
2950
|
var TextField = TextFieldComponent;
|
|
2896
2951
|
|
|
2897
2952
|
var useCheckboxState = function useCheckboxState(_ref) {
|
|
@@ -4528,6 +4583,7 @@ var countryList = [
|
|
|
4528
4583
|
}
|
|
4529
4584
|
];
|
|
4530
4585
|
|
|
4586
|
+
// 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.
|
|
4531
4587
|
var useCountryPickerState = function useCountryPickerState(_ref) {
|
|
4532
4588
|
var placeholder = _ref.placeholder;
|
|
4533
4589
|
var _React$useState = React.useState(countryList),
|
|
@@ -4559,6 +4615,7 @@ var useCountryPickerState = function useCountryPickerState(_ref) {
|
|
|
4559
4615
|
};
|
|
4560
4616
|
};
|
|
4561
4617
|
|
|
4618
|
+
// Defines the size of icons based on predefined size categories to maintain design consistency.
|
|
4562
4619
|
var IconSizes$4 = {
|
|
4563
4620
|
xs: 8,
|
|
4564
4621
|
sm: 10,
|
|
@@ -4744,9 +4801,6 @@ var CountryPickerView = function CountryPickerView(_ref5) {
|
|
|
4744
4801
|
onBlur(event);
|
|
4745
4802
|
setIsFocused(false);
|
|
4746
4803
|
};
|
|
4747
|
-
// useEffect(() => {
|
|
4748
|
-
// if (onChange) onChange(value); // Call onChange when valueCountry changes
|
|
4749
|
-
// }, [onChange, value]);
|
|
4750
4804
|
var isWithLabel = !!(isFocused && label);
|
|
4751
4805
|
var fieldStyles = _extends({
|
|
4752
4806
|
margin: 0,
|
|
@@ -4820,13 +4874,14 @@ var CountryPickerView = function CountryPickerView(_ref5) {
|
|
|
4820
4874
|
}));
|
|
4821
4875
|
};
|
|
4822
4876
|
|
|
4877
|
+
// Defines the CountryPickerComponent as a functional component with type 'React.FC' that takes 'CountryPickerProps' as props.
|
|
4823
4878
|
var CountryPickerComponent = function CountryPickerComponent(props) {
|
|
4879
|
+
// Invokes the 'useCountryPickerState' hook to obtain state and methods related to country picking functionality.
|
|
4824
4880
|
var countryPickerStates = useCountryPickerState(props);
|
|
4881
|
+
// Renders the CountryPickerView component passing in state and props for dynamic UI representation.
|
|
4825
4882
|
return React.createElement(CountryPickerView, Object.assign({}, countryPickerStates, props));
|
|
4826
4883
|
};
|
|
4827
|
-
|
|
4828
|
-
* Country picker allows users to select a country from a dropdown list or search field.
|
|
4829
|
-
*/
|
|
4884
|
+
// Exports the CountryPickerComponent for use in other parts of the application as 'CountryPicker'.
|
|
4830
4885
|
var CountryPicker = CountryPickerComponent;
|
|
4831
4886
|
|
|
4832
4887
|
var useDatePickerState = function useDatePickerState() {
|
|
@@ -6011,7 +6066,7 @@ var ModalHeader = function ModalHeader(_ref3) {
|
|
|
6011
6066
|
padding: 0,
|
|
6012
6067
|
margin: 0,
|
|
6013
6068
|
filter: "none",
|
|
6014
|
-
|
|
6069
|
+
width: 0
|
|
6015
6070
|
});
|
|
6016
6071
|
return React.createElement(Horizontal, Object.assign({
|
|
6017
6072
|
justifyContent: buttonPosition === 'none' ? 'center' : 'space-between',
|