@fluentui/react-list 9.2.7 → 9.4.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/dist/index.d.ts +7 -3
  3. package/lib/List.js.map +1 -1
  4. package/lib/ListItem.js.map +1 -1
  5. package/lib/components/List/List.js.map +1 -1
  6. package/lib/components/List/List.types.js.map +1 -1
  7. package/lib/components/List/index.js.map +1 -1
  8. package/lib/components/List/listContext.js +13 -2
  9. package/lib/components/List/listContext.js.map +1 -1
  10. package/lib/components/List/renderList.js +5 -2
  11. package/lib/components/List/renderList.js.map +1 -1
  12. package/lib/components/List/useList.js.map +1 -1
  13. package/lib/components/List/useListContextValues.js +10 -2
  14. package/lib/components/List/useListContextValues.js.map +1 -1
  15. package/lib/components/List/useListStyles.styles.raw.js +18 -0
  16. package/lib/components/List/useListStyles.styles.raw.js.map +1 -0
  17. package/lib/components/ListItem/ListItem.js.map +1 -1
  18. package/lib/components/ListItem/ListItem.types.js.map +1 -1
  19. package/lib/components/ListItem/index.js.map +1 -1
  20. package/lib/components/ListItem/renderListItem.js.map +1 -1
  21. package/lib/components/ListItem/useListItem.js +2 -3
  22. package/lib/components/ListItem/useListItem.js.map +1 -1
  23. package/lib/components/ListItem/useListItemStyles.styles.raw.js +48 -0
  24. package/lib/components/ListItem/useListItemStyles.styles.raw.js.map +1 -0
  25. package/lib/events/ListItemActionEvent.js.map +1 -1
  26. package/lib/hooks/index.js.map +1 -1
  27. package/lib/hooks/types.js.map +1 -1
  28. package/lib/hooks/useListSelection.js.map +1 -1
  29. package/lib/index.js.map +1 -1
  30. package/lib/utils/calculateListItemRoleForListRole.js.map +1 -1
  31. package/lib/utils/calculateListRole.js.map +1 -1
  32. package/lib/utils/index.js.map +1 -1
  33. package/lib/utils/validateGridCellsArePresent.js.map +1 -1
  34. package/lib/utils/validateProperElementTypes.js.map +1 -1
  35. package/lib/utils/validateProperRolesAreUsed.js.map +1 -1
  36. package/lib-commonjs/List.js.map +1 -1
  37. package/lib-commonjs/ListItem.js.map +1 -1
  38. package/lib-commonjs/components/List/List.js.map +1 -1
  39. package/lib-commonjs/components/List/List.types.js.map +1 -1
  40. package/lib-commonjs/components/List/index.js.map +1 -1
  41. package/lib-commonjs/components/List/listContext.js +20 -2
  42. package/lib-commonjs/components/List/listContext.js.map +1 -1
  43. package/lib-commonjs/components/List/renderList.js +4 -1
  44. package/lib-commonjs/components/List/renderList.js.map +1 -1
  45. package/lib-commonjs/components/List/useList.js.map +1 -1
  46. package/lib-commonjs/components/List/useListContextValues.js +11 -2
  47. package/lib-commonjs/components/List/useListContextValues.js.map +1 -1
  48. package/lib-commonjs/components/List/useListStyles.styles.js.map +1 -1
  49. package/lib-commonjs/components/List/useListStyles.styles.raw.js +34 -0
  50. package/lib-commonjs/components/List/useListStyles.styles.raw.js.map +1 -0
  51. package/lib-commonjs/components/ListItem/ListItem.js.map +1 -1
  52. package/lib-commonjs/components/ListItem/ListItem.types.js.map +1 -1
  53. package/lib-commonjs/components/ListItem/index.js.map +1 -1
  54. package/lib-commonjs/components/ListItem/renderListItem.js.map +1 -1
  55. package/lib-commonjs/components/ListItem/useListItem.js +1 -2
  56. package/lib-commonjs/components/ListItem/useListItem.js.map +1 -1
  57. package/lib-commonjs/components/ListItem/useListItemStyles.styles.js.map +1 -1
  58. package/lib-commonjs/components/ListItem/useListItemStyles.styles.raw.js +64 -0
  59. package/lib-commonjs/components/ListItem/useListItemStyles.styles.raw.js.map +1 -0
  60. package/lib-commonjs/events/ListItemActionEvent.js.map +1 -1
  61. package/lib-commonjs/hooks/index.js.map +1 -1
  62. package/lib-commonjs/hooks/types.js.map +1 -1
  63. package/lib-commonjs/hooks/useListSelection.js.map +1 -1
  64. package/lib-commonjs/index.js.map +1 -1
  65. package/lib-commonjs/utils/calculateListItemRoleForListRole.js.map +1 -1
  66. package/lib-commonjs/utils/calculateListRole.js.map +1 -1
  67. package/lib-commonjs/utils/index.js.map +1 -1
  68. package/lib-commonjs/utils/validateGridCellsArePresent.js.map +1 -1
  69. package/lib-commonjs/utils/validateProperElementTypes.js.map +1 -1
  70. package/lib-commonjs/utils/validateProperRolesAreUsed.js.map +1 -1
  71. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/validateProperElementTypes.ts"],"sourcesContent":["/**\n * Validates that the List and ListItem elements are compatible\n * @param listRenderedAs - the type of the parent element\n * @param listItemRenderedAs - the type of the child element\n */\nexport function validateProperElementTypes(listRenderedAs?: string, listItemRenderedAs?: string) {\n if (listItemRenderedAs === 'div' && listRenderedAs !== 'div') {\n throw new Error('ListItem cannot be rendered as a div when its parent is not a div.');\n }\n if (listItemRenderedAs === 'li' && listRenderedAs === 'div') {\n throw new Error('ListItem cannot be rendered as a li when its parent is a div.');\n }\n}\n"],"names":["validateProperElementTypes","listRenderedAs","listItemRenderedAs","Error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;CAIC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,2BAA2BC,cAAuB,EAAEC,kBAA2B;IAC7F,IAAIA,uBAAuB,SAASD,mBAAmB,OAAO;QAC5D,MAAM,IAAIE,MAAM;IAClB;IACA,IAAID,uBAAuB,QAAQD,mBAAmB,OAAO;QAC3D,MAAM,IAAIE,MAAM;IAClB;AACF"}
1
+ {"version":3,"sources":["../src/utils/validateProperElementTypes.ts"],"sourcesContent":["/**\n * Validates that the List and ListItem elements are compatible\n * @param listRenderedAs - the type of the parent element\n * @param listItemRenderedAs - the type of the child element\n */\nexport function validateProperElementTypes(listRenderedAs?: string, listItemRenderedAs?: string) {\n if (listItemRenderedAs === 'div' && listRenderedAs !== 'div') {\n throw new Error('ListItem cannot be rendered as a div when its parent is not a div.');\n }\n if (listItemRenderedAs === 'li' && listRenderedAs === 'div') {\n throw new Error('ListItem cannot be rendered as a li when its parent is a div.');\n }\n}\n"],"names":["validateProperElementTypes","listRenderedAs","listItemRenderedAs","Error"],"mappings":"AAAA;;;;CAIC,GACD;;;;;;;;;;AAAO,SAASA,2BAA2BC,cAAuB,EAAEC,kBAA2B;IAC7F,IAAIA,uBAAuB,SAASD,mBAAmB,OAAO;QAC5D,MAAM,IAAIE,MAAM;IAClB;IACA,IAAID,uBAAuB,QAAQD,mBAAmB,OAAO;QAC3D,MAAM,IAAIE,MAAM;IAClB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/validateProperRolesAreUsed.ts"],"sourcesContent":["/**\n * Validate that the proper roles are used for the given combination of roles and states.\n * If the roles are invalid and we're not running in production mode, an warning will be logged to the console.\n *\n * @param role - the role of the list\n * @param listItemRole - the role of the list item\n * @param hasSelection - whether the list has selection enabled\n * @param hasFocusableChildren - whether the list has focusable children\n * @returns\n */\nexport const validateProperRolesAreUsed = (\n role: string,\n listItemRole: string,\n hasSelection: boolean,\n hasFocusableChildren: boolean,\n) => {\n // Explode when the pair of roles is invalid\n if (role === 'list' && listItemRole !== 'listitem') {\n throw new Error('When the List role is \"list\", ListItem role must be \"listitem\".');\n }\n if (role === 'listbox' && listItemRole !== 'option') {\n throw new Error('When the List role is \"listbox\", ListItem role must be \"option\".');\n }\n if (role === 'grid' && listItemRole !== 'row') {\n throw new Error('When the List role is \"grid\", ListItem role must be \"row\".');\n }\n\n const expectedRole = (() => {\n if (hasFocusableChildren) {\n return 'grid';\n } else {\n if (hasSelection) {\n return 'listbox';\n } else {\n return 'list';\n }\n }\n })();\n\n if (role !== expectedRole) {\n /* eslint-disable-next-line no-console */\n console.warn(`@fluentui/react-list [useList]:\\nThe role \"${role}\" does not match the expected role \"${expectedRole}\".\\nPlease use the \"navigationMode\" property for automatic role assignment and keyboard navigation.\\nIf you are using this role intentionally, make sure to verify screen reader support.\n `);\n }\n};\n"],"names":["validateProperRolesAreUsed","role","listItemRole","hasSelection","hasFocusableChildren","Error","expectedRole","console","warn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;;;;;CASC;;;;+BACYA;;;eAAAA;;;AAAN,MAAMA,6BAA6B,CACxCC,MACAC,cACAC,cACAC;IAEA,4CAA4C;IAC5C,IAAIH,SAAS,UAAUC,iBAAiB,YAAY;QAClD,MAAM,IAAIG,MAAM;IAClB;IACA,IAAIJ,SAAS,aAAaC,iBAAiB,UAAU;QACnD,MAAM,IAAIG,MAAM;IAClB;IACA,IAAIJ,SAAS,UAAUC,iBAAiB,OAAO;QAC7C,MAAM,IAAIG,MAAM;IAClB;IAEA,MAAMC,eAAe,AAAC,CAAA;QACpB,IAAIF,sBAAsB;YACxB,OAAO;QACT,OAAO;YACL,IAAID,cAAc;gBAChB,OAAO;YACT,OAAO;gBACL,OAAO;YACT;QACF;IACF,CAAA;IAEA,IAAIF,SAASK,cAAc;QACzB,uCAAuC,GACvCC,QAAQC,IAAI,CAAC,CAAC,2CAA2C,EAAEP,KAAK,oCAAoC,EAAEK,aAAa;IACnH,CAAC;IACH;AACF"}
1
+ {"version":3,"sources":["../src/utils/validateProperRolesAreUsed.ts"],"sourcesContent":["/**\n * Validate that the proper roles are used for the given combination of roles and states.\n * If the roles are invalid and we're not running in production mode, an warning will be logged to the console.\n *\n * @param role - the role of the list\n * @param listItemRole - the role of the list item\n * @param hasSelection - whether the list has selection enabled\n * @param hasFocusableChildren - whether the list has focusable children\n * @returns\n */\nexport const validateProperRolesAreUsed = (\n role: string,\n listItemRole: string,\n hasSelection: boolean,\n hasFocusableChildren: boolean,\n) => {\n // Explode when the pair of roles is invalid\n if (role === 'list' && listItemRole !== 'listitem') {\n throw new Error('When the List role is \"list\", ListItem role must be \"listitem\".');\n }\n if (role === 'listbox' && listItemRole !== 'option') {\n throw new Error('When the List role is \"listbox\", ListItem role must be \"option\".');\n }\n if (role === 'grid' && listItemRole !== 'row') {\n throw new Error('When the List role is \"grid\", ListItem role must be \"row\".');\n }\n\n const expectedRole = (() => {\n if (hasFocusableChildren) {\n return 'grid';\n } else {\n if (hasSelection) {\n return 'listbox';\n } else {\n return 'list';\n }\n }\n })();\n\n if (role !== expectedRole) {\n /* eslint-disable-next-line no-console */\n console.warn(`@fluentui/react-list [useList]:\\nThe role \"${role}\" does not match the expected role \"${expectedRole}\".\\nPlease use the \"navigationMode\" property for automatic role assignment and keyboard navigation.\\nIf you are using this role intentionally, make sure to verify screen reader support.\n `);\n }\n};\n"],"names":["validateProperRolesAreUsed","role","listItemRole","hasSelection","hasFocusableChildren","Error","expectedRole","console","warn"],"mappings":"AAAA;;;;;;;;;CASC,GACD;;;;;;;;;;AAAO,MAAMA,6BAA6B,CACxCC,MACAC,cACAC,cACAC;IAEA,4CAA4C;IAC5C,IAAIH,SAAS,UAAUC,iBAAiB,YAAY;QAClD,MAAM,IAAIG,MAAM;IAClB;IACA,IAAIJ,SAAS,aAAaC,iBAAiB,UAAU;QACnD,MAAM,IAAIG,MAAM;IAClB;IACA,IAAIJ,SAAS,UAAUC,iBAAiB,OAAO;QAC7C,MAAM,IAAIG,MAAM;IAClB;IAEA,MAAMC,eAAgB;QACpB,IAAIF,sBAAsB;YACxB,OAAO;QACT,OAAO;YACL,IAAID,cAAc;gBAChB,OAAO;YACT,OAAO;gBACL,OAAO;YACT;QACF;KACF,CAAA;IAEA,IAAIF,SAASK,cAAc;QACzB,uCAAuC,GACvCC,QAAQC,IAAI,CAAC,CAAC,2CAA2C,EAAEP,KAAK,oCAAoC,EAAEK,aAAa;IACnH,CAAC;IACH;AACF,EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-list",
3
- "version": "9.2.7",
3
+ "version": "9.4.0",
4
4
  "description": "React List v9",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -26,13 +26,13 @@
26
26
  "@fluentui/scripts-cypress": "*"
27
27
  },
28
28
  "dependencies": {
29
- "@fluentui/react-checkbox": "^9.4.7",
30
- "@fluentui/react-context-selector": "^9.2.2",
31
- "@fluentui/react-jsx-runtime": "^9.1.2",
29
+ "@fluentui/react-checkbox": "^9.5.1",
30
+ "@fluentui/react-context-selector": "^9.2.3",
31
+ "@fluentui/react-jsx-runtime": "^9.1.3",
32
32
  "@fluentui/keyboard-keys": "^9.0.8",
33
- "@fluentui/react-tabster": "^9.25.3",
33
+ "@fluentui/react-tabster": "^9.26.1",
34
34
  "@fluentui/react-theme": "^9.1.24",
35
- "@fluentui/react-utilities": "^9.22.0",
35
+ "@fluentui/react-utilities": "^9.23.0",
36
36
  "@fluentui/react-shared-contexts": "^9.24.0",
37
37
  "@griffel/react": "^1.5.22",
38
38
  "@swc/helpers": "^0.5.1"