Comparing version 3.12.1 to 3.13.0
@@ -8,3 +8,3 @@ import React, { ChangeEventHandler, InputHTMLAttributes, RefAttributes } from 'react'; | ||
} | ||
export declare const Toggle: React.ForwardRefExoticComponent<Pick<ToggleProps, "type" | "color" | "form" | "slot" | "style" | "title" | "pattern" | "list" | "width" | "height" | "src" | "role" | "alt" | "className" | "translate" | "hidden" | "size" | "multiple" | "disabled" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "step" | "value" | "max" | "min" | "name" | "crossOrigin" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "checked" | "accept" | "autoComplete" | "capture" | "enterKeyHint" | "maxLength" | "minLength" | "readOnly" | "required"> & React.RefAttributes<HTMLInputElement>>; | ||
export declare const Toggle: React.ForwardRefExoticComponent<Pick<ToggleProps, "type" | "color" | "form" | "slot" | "style" | "title" | "pattern" | "list" | "width" | "height" | "src" | "role" | "alt" | "className" | "translate" | "hidden" | "size" | "multiple" | "disabled" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "step" | "value" | "max" | "min" | "name" | "crossOrigin" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "checked" | "accept" | "autoComplete" | "capture" | "enterKeyHint" | "maxLength" | "minLength" | "readOnly" | "required"> & React.RefAttributes<HTMLInputElement>>; | ||
export {}; |
const DEFAULT_FONT_DISPLAY = 'swap'; | ||
const unsupportedFontLocales = ['vi-vn']; | ||
const unsupportedFontLocales = ['vi-vn', 'az-az']; | ||
export function isUnsupportedFontLocale(locale) { | ||
@@ -4,0 +4,0 @@ return typeof locale === 'string' && unsupportedFontLocales.includes(locale.toLowerCase()); |
@@ -7,3 +7,3 @@ import darkTokens from '@volvo-cars/ui-design-tokens/build/web/volvo-dark/tokens.json'; | ||
import { getTokens } from './getTokens'; | ||
import { fontTypes, getTypeScale } from './getTypeScale'; | ||
import { getFontTypes, getTypeScale } from './getTypeScale'; | ||
function isRtlLocale(locale) { | ||
@@ -40,3 +40,3 @@ return typeof locale === 'string' && (locale.startsWith('ar') || locale.startsWith('he')); | ||
fontsPath: `${domainName}/static/shared/fonts/`, | ||
fontTypes, | ||
fontTypes: getFontTypes(locale), | ||
logoImagesPath: `${domainName}/static/shared/images/`, | ||
@@ -43,0 +43,0 @@ iconsPath, |
import { lineHeightToNumber } from '../utils/line-height-to-number'; | ||
import { sizeToRem } from '../utils/size-to-rem'; | ||
import { isUnsupportedFontLocale } from './fonts'; | ||
const UNSUPPORTED_LOCL_FEATURE_SETTINGS_LOCALES = ['bg-bg']; | ||
@@ -9,7 +10,9 @@ function getLoclFeatureSettings(locale) { | ||
} | ||
export const fontTypes = { | ||
BROAD: 'Volvo Broad, Arial Black, sans-serif', | ||
NOVUM: 'Volvo Novum, Arial, sans-serif', | ||
SERIF: 'Volvo Serif, serif' | ||
}; | ||
export function getFontTypes(locale) { | ||
return { | ||
BROAD: 'Volvo Broad, Arial Black, sans-serif', | ||
NOVUM: isUnsupportedFontLocale(locale) ? 'Arial, sans-serif' : 'Volvo Novum, Arial, sans-serif', | ||
SERIF: 'Volvo Serif, serif' | ||
}; | ||
} | ||
export const FONT_WEIGHTS = { | ||
@@ -23,2 +26,3 @@ semiLight: 300, | ||
const loclFeatureSettings = getLoclFeatureSettings(locale); | ||
const fontTypes = getFontTypes(locale); | ||
return { | ||
@@ -25,0 +29,0 @@ /** |
@@ -9,3 +9,3 @@ "use strict"; | ||
const DEFAULT_FONT_DISPLAY = 'swap'; | ||
const unsupportedFontLocales = ['vi-vn']; | ||
const unsupportedFontLocales = ['vi-vn', 'az-az']; | ||
function isUnsupportedFontLocale(locale) { | ||
@@ -12,0 +12,0 @@ return typeof locale === 'string' && unsupportedFontLocales.includes(locale.toLowerCase()); |
@@ -46,3 +46,3 @@ "use strict"; | ||
fontsPath: `${domainName}/static/shared/fonts/`, | ||
fontTypes: _getTypeScale.fontTypes, | ||
fontTypes: (0, _getTypeScale.getFontTypes)(locale), | ||
logoImagesPath: `${domainName}/static/shared/images/`, | ||
@@ -49,0 +49,0 @@ iconsPath, |
import { CurrentTheme } from '../types/shared'; | ||
export declare const fontTypes: { | ||
export declare function getFontTypes(locale?: string): { | ||
BROAD: string; | ||
@@ -4,0 +4,0 @@ NOVUM: string; |
@@ -6,6 +6,8 @@ "use strict"; | ||
}); | ||
exports.fontTypes = exports.FONT_WEIGHTS = void 0; | ||
exports.FONT_WEIGHTS = void 0; | ||
exports.getFontTypes = getFontTypes; | ||
exports.getTypeScale = getTypeScale; | ||
var _lineHeightToNumber = require("../utils/line-height-to-number"); | ||
var _sizeToRem = require("../utils/size-to-rem"); | ||
var _fonts = require("./fonts"); | ||
const UNSUPPORTED_LOCL_FEATURE_SETTINGS_LOCALES = ['bg-bg']; | ||
@@ -17,8 +19,9 @@ function getLoclFeatureSettings(locale) { | ||
} | ||
const fontTypes = { | ||
BROAD: 'Volvo Broad, Arial Black, sans-serif', | ||
NOVUM: 'Volvo Novum, Arial, sans-serif', | ||
SERIF: 'Volvo Serif, serif' | ||
}; | ||
exports.fontTypes = fontTypes; | ||
function getFontTypes(locale) { | ||
return { | ||
BROAD: 'Volvo Broad, Arial Black, sans-serif', | ||
NOVUM: (0, _fonts.isUnsupportedFontLocale)(locale) ? 'Arial, sans-serif' : 'Volvo Novum, Arial, sans-serif', | ||
SERIF: 'Volvo Serif, serif' | ||
}; | ||
} | ||
const FONT_WEIGHTS = { | ||
@@ -33,2 +36,3 @@ semiLight: 300, | ||
const loclFeatureSettings = getLoclFeatureSettings(locale); | ||
const fontTypes = getFontTypes(locale); | ||
return { | ||
@@ -35,0 +39,0 @@ /** |
{ | ||
"name": "vcc-ui", | ||
"version": "3.12.1", | ||
"version": "3.13.0", | ||
"license": "UNLICENSED", | ||
@@ -71,3 +71,3 @@ "description": "A React library for building user interfaces at Volvo Cars", | ||
"@storybook/react": "6.5.16", | ||
"@types/react": "17.0.53", | ||
"@types/react": "18.0.27", | ||
"@volvo-cars/browserslist-config": "workspace:*", | ||
@@ -85,6 +85,6 @@ "babel-core": "7.0.0-bridge.0", | ||
"prop-types": "15.8.1", | ||
"react": "17.0.2", | ||
"react": "18.2.0", | ||
"react-docgen": "5.4.3", | ||
"react-docgen-typescript": "2.2.2", | ||
"react-test-renderer": "17.0.2", | ||
"react-test-renderer": "18.2.0", | ||
"shelljs": "0.8.5", | ||
@@ -91,0 +91,0 @@ "typescript": "4.9.5", |
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
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
533343
15374