@telus-uds/components-base 1.60.0 → 1.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -2
- package/component-docs.json +281 -70
- package/lib/Autocomplete/Autocomplete.js +483 -0
- package/lib/Autocomplete/Loading.js +51 -0
- package/lib/Autocomplete/Suggestions.js +85 -0
- package/lib/Autocomplete/constants.js +14 -0
- package/lib/Autocomplete/dictionary.js +19 -0
- package/lib/Autocomplete/index.js +13 -0
- package/lib/Listbox/GroupControl.js +121 -0
- package/lib/Listbox/Listbox.js +198 -0
- package/lib/Listbox/ListboxGroup.js +142 -0
- package/lib/Listbox/ListboxItem.js +97 -0
- package/lib/Listbox/ListboxOverlay.js +106 -0
- package/lib/Listbox/PressableItem.js +0 -2
- package/lib/Listbox/index.js +5 -24
- package/lib/TextInput/TextInputBase.js +2 -0
- package/lib/index.js +17 -13
- package/lib/utils/useOverlaidPosition.js +6 -4
- package/lib-module/Autocomplete/Autocomplete.js +448 -0
- package/lib-module/Autocomplete/Loading.js +36 -0
- package/lib-module/Autocomplete/Suggestions.js +66 -0
- package/lib-module/Autocomplete/constants.js +4 -0
- package/lib-module/Autocomplete/dictionary.js +12 -0
- package/lib-module/Autocomplete/index.js +2 -0
- package/lib-module/Listbox/GroupControl.js +102 -0
- package/lib-module/Listbox/Listbox.js +172 -0
- package/lib-module/Listbox/ListboxGroup.js +117 -0
- package/lib-module/Listbox/ListboxItem.js +71 -0
- package/lib-module/Listbox/ListboxOverlay.js +80 -0
- package/lib-module/Listbox/PressableItem.js +0 -2
- package/lib-module/Listbox/index.js +2 -2
- package/lib-module/TextInput/TextInputBase.js +2 -0
- package/lib-module/index.js +2 -1
- package/lib-module/utils/useOverlaidPosition.js +5 -4
- package/package.json +4 -2
- package/src/Autocomplete/Autocomplete.jsx +411 -0
- package/src/Autocomplete/Loading.jsx +18 -0
- package/src/Autocomplete/Suggestions.jsx +54 -0
- package/src/Autocomplete/constants.js +4 -0
- package/src/Autocomplete/dictionary.js +12 -0
- package/src/Autocomplete/index.js +3 -0
- package/src/Listbox/GroupControl.jsx +93 -0
- package/src/Listbox/Listbox.jsx +165 -0
- package/src/Listbox/ListboxGroup.jsx +120 -0
- package/src/Listbox/ListboxItem.jsx +76 -0
- package/src/Listbox/ListboxOverlay.jsx +82 -0
- package/src/Listbox/PressableItem.jsx +0 -2
- package/src/Listbox/index.js +3 -2
- package/src/TextInput/TextInputBase.jsx +2 -0
- package/src/index.js +2 -1
- package/src/utils/useOverlaidPosition.js +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on Tue, 12 Sep 2023
|
|
3
|
+
This log was last generated on Tue, 12 Sep 2023 23:35:19 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.61.0
|
|
8
|
+
|
|
9
|
+
Tue, 12 Sep 2023 23:35:19 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- autocomplete from web to multi-platform (srikanthkhari@gmail.com)
|
|
14
|
+
|
|
7
15
|
## 1.60.0
|
|
8
16
|
|
|
9
|
-
Tue, 12 Sep 2023 15:
|
|
17
|
+
Tue, 12 Sep 2023 15:37:54 GMT
|
|
10
18
|
|
|
11
19
|
### Minor changes
|
|
12
20
|
|
package/component-docs.json
CHANGED
|
@@ -3972,6 +3972,166 @@
|
|
|
3972
3972
|
}
|
|
3973
3973
|
}
|
|
3974
3974
|
},
|
|
3975
|
+
"Autocomplete": {
|
|
3976
|
+
"docs": {
|
|
3977
|
+
"description": "",
|
|
3978
|
+
"props": {
|
|
3979
|
+
"copy": {
|
|
3980
|
+
"defaultValue": {
|
|
3981
|
+
"value": "'en'",
|
|
3982
|
+
"computed": false
|
|
3983
|
+
},
|
|
3984
|
+
"type": {
|
|
3985
|
+
"name": "union",
|
|
3986
|
+
"value": [
|
|
3987
|
+
{
|
|
3988
|
+
"name": "enum",
|
|
3989
|
+
"value": [
|
|
3990
|
+
{
|
|
3991
|
+
"value": "'en'",
|
|
3992
|
+
"computed": false
|
|
3993
|
+
},
|
|
3994
|
+
{
|
|
3995
|
+
"value": "'fr'",
|
|
3996
|
+
"computed": false
|
|
3997
|
+
}
|
|
3998
|
+
]
|
|
3999
|
+
},
|
|
4000
|
+
{
|
|
4001
|
+
"name": "custom",
|
|
4002
|
+
"raw": "dictionaryContentShape"
|
|
4003
|
+
}
|
|
4004
|
+
]
|
|
4005
|
+
},
|
|
4006
|
+
"required": false,
|
|
4007
|
+
"description": "Copy language identifier"
|
|
4008
|
+
},
|
|
4009
|
+
"fullWidth": {
|
|
4010
|
+
"defaultValue": {
|
|
4011
|
+
"value": "true",
|
|
4012
|
+
"computed": false
|
|
4013
|
+
},
|
|
4014
|
+
"required": false
|
|
4015
|
+
},
|
|
4016
|
+
"isLoading": {
|
|
4017
|
+
"defaultValue": {
|
|
4018
|
+
"value": "false",
|
|
4019
|
+
"computed": false
|
|
4020
|
+
},
|
|
4021
|
+
"type": {
|
|
4022
|
+
"name": "bool"
|
|
4023
|
+
},
|
|
4024
|
+
"required": false,
|
|
4025
|
+
"description": "Set to true in order to display the loading indicator instead of results"
|
|
4026
|
+
},
|
|
4027
|
+
"maxSuggestions": {
|
|
4028
|
+
"defaultValue": {
|
|
4029
|
+
"value": "5",
|
|
4030
|
+
"computed": false
|
|
4031
|
+
},
|
|
4032
|
+
"type": {
|
|
4033
|
+
"name": "number"
|
|
4034
|
+
},
|
|
4035
|
+
"required": false,
|
|
4036
|
+
"description": "Maximum number of suggestions provided at the same time"
|
|
4037
|
+
},
|
|
4038
|
+
"minToSuggestion": {
|
|
4039
|
+
"defaultValue": {
|
|
4040
|
+
"value": "1",
|
|
4041
|
+
"computed": false
|
|
4042
|
+
},
|
|
4043
|
+
"type": {
|
|
4044
|
+
"name": "number"
|
|
4045
|
+
},
|
|
4046
|
+
"required": false,
|
|
4047
|
+
"description": "Minimum number of characters typed for a list of suggestions to appear"
|
|
4048
|
+
},
|
|
4049
|
+
"helpText": {
|
|
4050
|
+
"defaultValue": {
|
|
4051
|
+
"value": "''",
|
|
4052
|
+
"computed": false
|
|
4053
|
+
},
|
|
4054
|
+
"type": {
|
|
4055
|
+
"name": "string"
|
|
4056
|
+
},
|
|
4057
|
+
"required": false,
|
|
4058
|
+
"description": "Help text to display when the input is focused and empty"
|
|
4059
|
+
},
|
|
4060
|
+
"children": {
|
|
4061
|
+
"type": {
|
|
4062
|
+
"name": "func"
|
|
4063
|
+
},
|
|
4064
|
+
"required": false,
|
|
4065
|
+
"description": "Can be used to provide a function that renders a custom input:\n<Autocomplete items={items} value={currentValue}>\n {({ inputId, inputRef, onChange, onKeyPress, readOnly, tokens, value }) => (\n <Search\n nativeID={inputId}\n ref={inputRef}\n onChange={onChange}\n onKeyPress={onKeyPress}\n readOnly={readOnly}\n tokens={tokens}\n value={value}\n />\n )}\n</Autocomplete>"
|
|
4066
|
+
},
|
|
4067
|
+
"items": {
|
|
4068
|
+
"type": {
|
|
4069
|
+
"name": "arrayOf",
|
|
4070
|
+
"value": {
|
|
4071
|
+
"name": "shape",
|
|
4072
|
+
"value": {
|
|
4073
|
+
"id": {
|
|
4074
|
+
"name": "string",
|
|
4075
|
+
"required": false
|
|
4076
|
+
},
|
|
4077
|
+
"label": {
|
|
4078
|
+
"name": "string",
|
|
4079
|
+
"required": false
|
|
4080
|
+
}
|
|
4081
|
+
}
|
|
4082
|
+
}
|
|
4083
|
+
},
|
|
4084
|
+
"required": false,
|
|
4085
|
+
"description": "List of items to display as suggestions"
|
|
4086
|
+
},
|
|
4087
|
+
"loadingLabel": {
|
|
4088
|
+
"type": {
|
|
4089
|
+
"name": "string"
|
|
4090
|
+
},
|
|
4091
|
+
"required": false,
|
|
4092
|
+
"description": "Label to display alongside the spinner when in a loading state"
|
|
4093
|
+
},
|
|
4094
|
+
"noResults": {
|
|
4095
|
+
"type": {
|
|
4096
|
+
"name": "node"
|
|
4097
|
+
},
|
|
4098
|
+
"required": false,
|
|
4099
|
+
"description": "Text or JSX to render when no results are available"
|
|
4100
|
+
},
|
|
4101
|
+
"onChange": {
|
|
4102
|
+
"type": {
|
|
4103
|
+
"name": "func"
|
|
4104
|
+
},
|
|
4105
|
+
"required": false,
|
|
4106
|
+
"description": "Handler function to be called when the input value changes"
|
|
4107
|
+
},
|
|
4108
|
+
"onClear": {
|
|
4109
|
+
"type": {
|
|
4110
|
+
"name": "func"
|
|
4111
|
+
},
|
|
4112
|
+
"required": false,
|
|
4113
|
+
"description": "Handler function to be called when the clear button (appears if the handler is passed) is pressed"
|
|
4114
|
+
},
|
|
4115
|
+
"onSelect": {
|
|
4116
|
+
"type": {
|
|
4117
|
+
"name": "func"
|
|
4118
|
+
},
|
|
4119
|
+
"required": false,
|
|
4120
|
+
"description": "Callback function to be called when an item is selected from the list"
|
|
4121
|
+
},
|
|
4122
|
+
"value": {
|
|
4123
|
+
"type": {
|
|
4124
|
+
"name": "string"
|
|
4125
|
+
},
|
|
4126
|
+
"required": false,
|
|
4127
|
+
"description": "Input value for controlled usage"
|
|
4128
|
+
}
|
|
4129
|
+
},
|
|
4130
|
+
"attributes": {
|
|
4131
|
+
"acceptsRNA11yProps": false
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
},
|
|
3975
4135
|
"BaseProvider": {
|
|
3976
4136
|
"docs": {
|
|
3977
4137
|
"description": "",
|
|
@@ -7142,6 +7302,127 @@
|
|
|
7142
7302
|
}
|
|
7143
7303
|
}
|
|
7144
7304
|
},
|
|
7305
|
+
"Listbox": {
|
|
7306
|
+
"docs": {
|
|
7307
|
+
"description": "",
|
|
7308
|
+
"props": {
|
|
7309
|
+
"items": {
|
|
7310
|
+
"defaultValue": {
|
|
7311
|
+
"value": "[]",
|
|
7312
|
+
"computed": false
|
|
7313
|
+
},
|
|
7314
|
+
"type": {
|
|
7315
|
+
"name": "array"
|
|
7316
|
+
},
|
|
7317
|
+
"required": false,
|
|
7318
|
+
"description": "`Listbox` items"
|
|
7319
|
+
},
|
|
7320
|
+
"firstItemRef": {
|
|
7321
|
+
"defaultValue": {
|
|
7322
|
+
"value": "null",
|
|
7323
|
+
"computed": false
|
|
7324
|
+
},
|
|
7325
|
+
"type": {
|
|
7326
|
+
"name": "object"
|
|
7327
|
+
},
|
|
7328
|
+
"required": false,
|
|
7329
|
+
"description": "Focus will be moved to the item with this ref once within the menu."
|
|
7330
|
+
},
|
|
7331
|
+
"parentRef": {
|
|
7332
|
+
"defaultValue": {
|
|
7333
|
+
"value": "null",
|
|
7334
|
+
"computed": false
|
|
7335
|
+
},
|
|
7336
|
+
"type": {
|
|
7337
|
+
"name": "object"
|
|
7338
|
+
},
|
|
7339
|
+
"required": false,
|
|
7340
|
+
"description": "Focus will be returned to the dropdown control with this ref after leaving\nthe last menu item."
|
|
7341
|
+
},
|
|
7342
|
+
"LinkRouter": {
|
|
7343
|
+
"type": {
|
|
7344
|
+
"name": "elementType"
|
|
7345
|
+
},
|
|
7346
|
+
"required": false,
|
|
7347
|
+
"description": ""
|
|
7348
|
+
},
|
|
7349
|
+
"linkRouterProps": {
|
|
7350
|
+
"type": {
|
|
7351
|
+
"name": "object"
|
|
7352
|
+
},
|
|
7353
|
+
"required": false,
|
|
7354
|
+
"description": ""
|
|
7355
|
+
},
|
|
7356
|
+
"selectedId": {
|
|
7357
|
+
"type": {
|
|
7358
|
+
"name": "string"
|
|
7359
|
+
},
|
|
7360
|
+
"required": false,
|
|
7361
|
+
"description": "To select an item by default"
|
|
7362
|
+
},
|
|
7363
|
+
"onClose": {
|
|
7364
|
+
"type": {
|
|
7365
|
+
"name": "func"
|
|
7366
|
+
},
|
|
7367
|
+
"required": false,
|
|
7368
|
+
"description": "onClose event"
|
|
7369
|
+
},
|
|
7370
|
+
"tokens": {
|
|
7371
|
+
"type": {
|
|
7372
|
+
"name": "custom",
|
|
7373
|
+
"raw": {
|
|
7374
|
+
"groupBorderRadius": "radius",
|
|
7375
|
+
"groupBorderWidth": "border",
|
|
7376
|
+
"groupFontSize": "size",
|
|
7377
|
+
"groupFontName": "fontName",
|
|
7378
|
+
"groupFontWeight": "fontWeight",
|
|
7379
|
+
"groupColor": "color",
|
|
7380
|
+
"groupBorderColor": "color",
|
|
7381
|
+
"groupBackgroundColor": "color",
|
|
7382
|
+
"groupPaddingTop": "size",
|
|
7383
|
+
"groupPaddingBottom": "size",
|
|
7384
|
+
"groupPaddingLeft": "size",
|
|
7385
|
+
"groupPaddingRight": "size",
|
|
7386
|
+
"groupIcon": "icon",
|
|
7387
|
+
"itemDisplay": "show",
|
|
7388
|
+
"itemFontName": "fontName",
|
|
7389
|
+
"itemFontWeight": "fontWeight",
|
|
7390
|
+
"itemFontSize": "size",
|
|
7391
|
+
"itemPaddingTop": "size",
|
|
7392
|
+
"itemPaddingBottom": "size",
|
|
7393
|
+
"itemPaddingLeft": "size",
|
|
7394
|
+
"itemPaddingRight": "size",
|
|
7395
|
+
"itemColor": "color",
|
|
7396
|
+
"itemBackgroundColor": "color",
|
|
7397
|
+
"itemBorderLeftColor": "color",
|
|
7398
|
+
"itemBorderLeftWidth": "border",
|
|
7399
|
+
"itemBorderWidth": "border",
|
|
7400
|
+
"itemTextDecoration": "textLine",
|
|
7401
|
+
"itemOutline": "border",
|
|
7402
|
+
"shadow": "shadow",
|
|
7403
|
+
"itemBorderRightColor": "color",
|
|
7404
|
+
"itemBorderBottomColor": "color",
|
|
7405
|
+
"itemBorderTopColor": "color",
|
|
7406
|
+
"itemBorderRightWidth": "border",
|
|
7407
|
+
"itemBorderBottomWidth": "border",
|
|
7408
|
+
"itemBorderTopWidth": "border",
|
|
7409
|
+
"itemBorderRadius": "radius",
|
|
7410
|
+
"minWidth": "size",
|
|
7411
|
+
"minHeight": "size",
|
|
7412
|
+
"itemHeight": "size",
|
|
7413
|
+
"groupHeight": "size",
|
|
7414
|
+
"lineHeight": "lineHeight"
|
|
7415
|
+
}
|
|
7416
|
+
},
|
|
7417
|
+
"required": false,
|
|
7418
|
+
"description": ""
|
|
7419
|
+
}
|
|
7420
|
+
},
|
|
7421
|
+
"attributes": {
|
|
7422
|
+
"acceptsRNA11yProps": false
|
|
7423
|
+
}
|
|
7424
|
+
}
|
|
7425
|
+
},
|
|
7145
7426
|
"Modal": {
|
|
7146
7427
|
"docs": {
|
|
7147
7428
|
"description": "A modal window is a secondary window that opens on top of the main one.\nUsers have to interact with it before they can carry out their task and return to the main window.\nUse to reveal additional information to a user after they have performed an explicit interaction.\nThey are a strongly discouraged pattern; it's preferred to have all relevant information within a page,\nand irrelevant information either linked externally or omitted.\n\n- Must only appear after a customer interaction, not on page load or any other circumstance\n- Open a modal based on explicit customer action e.g. clicking on a button/link/form field\n- Only one modal should be \"current\" at any time\n- Read [WebAIM's documentation](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html) to create accessible modals\n- Don’t use modals to reinforce or repeat information already available in the parent page or view\n- Don’t use modals consecutively",
|
|
@@ -13363,76 +13644,6 @@
|
|
|
13363
13644
|
}
|
|
13364
13645
|
}
|
|
13365
13646
|
},
|
|
13366
|
-
"PressableItem": {
|
|
13367
|
-
"docs": {
|
|
13368
|
-
"description": "",
|
|
13369
|
-
"props": {
|
|
13370
|
-
"isChild": {
|
|
13371
|
-
"defaultValue": {
|
|
13372
|
-
"value": "false",
|
|
13373
|
-
"computed": false
|
|
13374
|
-
},
|
|
13375
|
-
"type": {
|
|
13376
|
-
"name": "bool"
|
|
13377
|
-
},
|
|
13378
|
-
"required": false,
|
|
13379
|
-
"description": ""
|
|
13380
|
-
},
|
|
13381
|
-
"tabIndex": {
|
|
13382
|
-
"defaultValue": {
|
|
13383
|
-
"value": "0",
|
|
13384
|
-
"computed": false
|
|
13385
|
-
},
|
|
13386
|
-
"required": false
|
|
13387
|
-
},
|
|
13388
|
-
"href": {
|
|
13389
|
-
"type": {
|
|
13390
|
-
"name": "string"
|
|
13391
|
-
},
|
|
13392
|
-
"required": false,
|
|
13393
|
-
"description": ""
|
|
13394
|
-
},
|
|
13395
|
-
"children": {
|
|
13396
|
-
"type": {
|
|
13397
|
-
"name": "node"
|
|
13398
|
-
},
|
|
13399
|
-
"required": true,
|
|
13400
|
-
"description": ""
|
|
13401
|
-
},
|
|
13402
|
-
"onBlur": {
|
|
13403
|
-
"type": {
|
|
13404
|
-
"name": "func"
|
|
13405
|
-
},
|
|
13406
|
-
"required": false,
|
|
13407
|
-
"description": ""
|
|
13408
|
-
},
|
|
13409
|
-
"onPress": {
|
|
13410
|
-
"type": {
|
|
13411
|
-
"name": "func"
|
|
13412
|
-
},
|
|
13413
|
-
"required": false,
|
|
13414
|
-
"description": ""
|
|
13415
|
-
},
|
|
13416
|
-
"nextItemRef": {
|
|
13417
|
-
"type": {
|
|
13418
|
-
"name": "object"
|
|
13419
|
-
},
|
|
13420
|
-
"required": false,
|
|
13421
|
-
"description": ""
|
|
13422
|
-
},
|
|
13423
|
-
"prevItemRef": {
|
|
13424
|
-
"type": {
|
|
13425
|
-
"name": "object"
|
|
13426
|
-
},
|
|
13427
|
-
"required": false,
|
|
13428
|
-
"description": ""
|
|
13429
|
-
}
|
|
13430
|
-
},
|
|
13431
|
-
"attributes": {
|
|
13432
|
-
"acceptsRNA11yProps": false
|
|
13433
|
-
}
|
|
13434
|
-
}
|
|
13435
|
-
},
|
|
13436
13647
|
"CheckboxGroup": {
|
|
13437
13648
|
"docs": {
|
|
13438
13649
|
"description": "A group of Checkboxs that behave as a fieldset. Use when users select any number of choices from options.\n\n## Component API\n\nUse the `items` prop to pass an array of objects describing each Checkbox in the group:\n\n - `label`: main text passed to CheckboxGroup's `label` prop\n - `id`: identifier used to store which CheckboxGroup is selected (uses `label` if undefinded)\n - `onChange`: optional function called on selection, in addition to updating the group's selection state\n\n### Controlled version\n\nIf the selection state is controlled from outside, it needs to receive `checkedId` and `onChange` props.\n\n### Uncontrolled version\n\nIf the CheckboxGroup manages its own state, you can use `initialCheckedId` prop to provide the initial value.\nWhenever the radio card gets toggled, it calls the `onChange` callback with the new value (string).\n\n### Use in forms\n\nFor web forms, the `name` prop may be used to define the name of the group's `fieldset` and input elements.\n\n### Validation\n\nValidation state may be set by passing 'error' or 'success' to the `validation` prop.\n\n## A11y guidelines\n\nCheckboxGroup accepts all the common accessibility props, and controls the accessibility state\nof children like Checkbox and Feedback based on current state.\n\n@example\n```jsx\n<CheckboxGroup\n initialCheckedIds=\"check1\"\n items={[\n { label: 'Checkbox 1', id: 'check1' },\n { label: 'Checkbox 2', id: 'check2' },\n { label: 'Checkbox 3', id: 'check3' }\n ]}\n legend=\"Checkboxes\"\n hint=\"Choose from these options\"\n/>\n```",
|