@instructure/ui-utils
Advanced tools
Comparing version 10.4.1 to 10.4.2-pr-snapshot-1730913754131
@@ -6,2 +6,13 @@ # Change Log | ||
## [10.4.2-pr-snapshot-1730913754131](https://github.com/instructure/instructure-ui/compare/v10.4.1...v10.4.2-pr-snapshot-1730913754131) (2024-11-06) | ||
### Bug Fixes | ||
* **ui-options,ui-utils:** subgroup titles in Options are not announced by TalkBack and iOS VoiceOver ([ebdf8f0](https://github.com/instructure/instructure-ui/commit/ebdf8f047cf8541723d494b16432c8248ef5fe1e)) | ||
## [10.4.1](https://github.com/instructure/instructure-ui/compare/v10.4.0...v10.4.1) (2024-10-28) | ||
@@ -8,0 +19,0 @@ |
@@ -62,2 +62,8 @@ /* | ||
}; | ||
export { getBrowser, isSafari, isEdge, isIE, isFirefox, isChromium }; | ||
const isAndroidOrIOS = () => { | ||
const parser = new UAParser(); | ||
const result = parser.getResult(); | ||
const device = parser.getDevice(); | ||
return result.os.name === 'Android' || device.model === 'iPhone' || device.model === 'iPad' ? true : false; | ||
}; | ||
export { getBrowser, isSafari, isEdge, isIE, isFirefox, isChromium, isAndroidOrIOS }; |
@@ -26,2 +26,9 @@ /* | ||
const baseThemeProps = ['borders', 'breakpoints', 'colors', 'forms', 'media', 'shadows', 'spacing', 'stacking', 'transitions', 'typography']; | ||
/** | ||
* Checks if the given param is an object with all the keys needed for an | ||
* Instructure theme. | ||
* @param theme Anything. This function will throw an error if it's not a theme | ||
* object. | ||
*/ | ||
const isBaseTheme = theme => { | ||
@@ -28,0 +35,0 @@ if (Array.isArray(theme) || typeof theme === 'function') { |
@@ -7,3 +7,3 @@ "use strict"; | ||
}); | ||
exports.isSafari = exports.isIE = exports.isFirefox = exports.isEdge = exports.isChromium = exports.getBrowser = void 0; | ||
exports.isSafari = exports.isIE = exports.isFirefox = exports.isEdge = exports.isChromium = exports.isAndroidOrIOS = exports.getBrowser = void 0; | ||
var _uaParserJs = _interopRequireDefault(require("ua-parser-js")); | ||
@@ -74,2 +74,9 @@ /* | ||
}; | ||
exports.isFirefox = isFirefox; | ||
exports.isFirefox = isFirefox; | ||
const isAndroidOrIOS = () => { | ||
const parser = new _uaParserJs.default(); | ||
const result = parser.getResult(); | ||
const device = parser.getDevice(); | ||
return result.os.name === 'Android' || device.model === 'iPhone' || device.model === 'iPad' ? true : false; | ||
}; | ||
exports.isAndroidOrIOS = isAndroidOrIOS; |
@@ -32,2 +32,9 @@ "use strict"; | ||
const baseThemeProps = ['borders', 'breakpoints', 'colors', 'forms', 'media', 'shadows', 'spacing', 'stacking', 'transitions', 'typography']; | ||
/** | ||
* Checks if the given param is an object with all the keys needed for an | ||
* Instructure theme. | ||
* @param theme Anything. This function will throw an error if it's not a theme | ||
* object. | ||
*/ | ||
const isBaseTheme = theme => { | ||
@@ -34,0 +41,0 @@ if (Array.isArray(theme) || typeof theme === 'function') { |
{ | ||
"name": "@instructure/ui-utils", | ||
"version": "10.4.1", | ||
"version": "10.4.2-pr-snapshot-1730913754131", | ||
"description": "A collection of utilities for UI components", | ||
@@ -25,3 +25,3 @@ "author": "Instructure, Inc. Engineering and Product Design", | ||
"devDependencies": { | ||
"@instructure/ui-babel-preset": "10.4.1", | ||
"@instructure/ui-babel-preset": "10.4.2-pr-snapshot-1730913754131", | ||
"@testing-library/jest-dom": "^6.4.6", | ||
@@ -34,5 +34,5 @@ "@testing-library/react": "^16.0.1", | ||
"@babel/runtime": "^7.25.6", | ||
"@instructure/console": "10.4.1", | ||
"@instructure/shared-types": "10.4.1", | ||
"@instructure/ui-dom-utils": "10.4.1", | ||
"@instructure/console": "10.4.2-pr-snapshot-1730913754131", | ||
"@instructure/shared-types": "10.4.2-pr-snapshot-1730913754131", | ||
"@instructure/ui-dom-utils": "10.4.2-pr-snapshot-1730913754131", | ||
"@types/ua-parser-js": "^0.7.39", | ||
@@ -39,0 +39,0 @@ "fast-deep-equal": "^3.1.3", |
@@ -66,2 +66,21 @@ /* | ||
export { getBrowser, isSafari, isEdge, isIE, isFirefox, isChromium } | ||
const isAndroidOrIOS = (): boolean => { | ||
const parser = new UAParser() | ||
const result = parser.getResult() | ||
const device = parser.getDevice() | ||
return result.os.name === 'Android' || | ||
device.model === 'iPhone' || | ||
device.model === 'iPad' | ||
? true | ||
: false | ||
} | ||
export { | ||
getBrowser, | ||
isSafari, | ||
isEdge, | ||
isIE, | ||
isFirefox, | ||
isChromium, | ||
isAndroidOrIOS | ||
} |
@@ -42,2 +42,8 @@ /* | ||
/** | ||
* Checks if the given param is an object with all the keys needed for an | ||
* Instructure theme. | ||
* @param theme Anything. This function will throw an error if it's not a theme | ||
* object. | ||
*/ | ||
const isBaseTheme = (theme: any): theme is BaseTheme => { | ||
@@ -44,0 +50,0 @@ if (Array.isArray(theme) || typeof theme === 'function') { |
@@ -17,3 +17,4 @@ import UAParser from 'ua-parser-js'; | ||
declare const isFirefox: () => boolean; | ||
export { getBrowser, isSafari, isEdge, isIE, isFirefox, isChromium }; | ||
declare const isAndroidOrIOS: () => boolean; | ||
export { getBrowser, isSafari, isEdge, isIE, isFirefox, isChromium, isAndroidOrIOS }; | ||
//# sourceMappingURL=getBrowser.d.ts.map |
import type { BaseTheme } from '@instructure/shared-types'; | ||
/** | ||
* Checks if the given param is an object with all the keys needed for an | ||
* Instructure theme. | ||
* @param theme Anything. This function will throw an error if it's not a theme | ||
* object. | ||
*/ | ||
declare const isBaseTheme: (theme: any) => theme is BaseTheme; | ||
@@ -3,0 +9,0 @@ export default isBaseTheme; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
400115
22512
6456
36
39
294
1
69
+ Added@instructure/console@10.4.2-pr-snapshot-1730913754131(transitive)
+ Added@instructure/shared-types@10.4.2-pr-snapshot-1730913754131(transitive)
+ Added@instructure/ui-dom-utils@10.4.2-pr-snapshot-1730913754131(transitive)
- Removed@instructure/console@10.4.1(transitive)
- Removed@instructure/shared-types@10.4.1(transitive)
- Removed@instructure/ui-dom-utils@10.4.1(transitive)
Updated@instructure/console@10.4.2-pr-snapshot-1730913754131
Updated@instructure/shared-types@10.4.2-pr-snapshot-1730913754131
Updated@instructure/ui-dom-utils@10.4.2-pr-snapshot-1730913754131