@veracity/vui 2.10.0 → 2.12.0-beta.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/dist/cjs/accordion/accordion.types.d.ts +4 -2
- package/dist/cjs/accordion/accordion.types.d.ts.map +1 -1
- package/dist/cjs/accordion/accordionItem.d.ts.map +1 -1
- package/dist/cjs/accordion/accordionItem.js +2 -2
- package/dist/cjs/accordion/accordionItemArrow.d.ts +1 -1
- package/dist/cjs/accordion/accordionItemArrow.d.ts.map +1 -1
- package/dist/cjs/accordion/accordionItemArrow.js +15 -1
- package/dist/cjs/accordion/accordionItemHorizontal.d.ts.map +1 -1
- package/dist/cjs/accordion/accordionItemHorizontal.js +2 -2
- package/dist/cjs/button/button.d.ts.map +1 -1
- package/dist/cjs/button/button.js +9 -15
- package/dist/cjs/button/buttonIcon.d.ts.map +1 -1
- package/dist/cjs/button/buttonIcon.js +4 -2
- package/dist/cjs/button/consts.d.ts +5 -0
- package/dist/cjs/button/consts.d.ts.map +1 -1
- package/dist/cjs/button/consts.js +7 -6
- package/dist/cjs/core/vuiProvider/consts.d.ts +2 -0
- package/dist/cjs/core/vuiProvider/consts.d.ts.map +1 -0
- package/dist/cjs/core/vuiProvider/consts.js +4 -0
- package/dist/cjs/core/vuiProvider/globalStyle.d.ts.map +1 -1
- package/dist/cjs/core/vuiProvider/globalStyle.js +8 -0
- package/dist/cjs/core/vuiProvider/index.d.ts +2 -0
- package/dist/cjs/core/vuiProvider/index.d.ts.map +1 -1
- package/dist/cjs/core/vuiProvider/index.js +2 -0
- package/dist/cjs/core/vuiProvider/useBodyScrollLock.d.ts +7 -0
- package/dist/cjs/core/vuiProvider/useBodyScrollLock.d.ts.map +1 -0
- package/dist/cjs/core/vuiProvider/useBodyScrollLock.js +18 -0
- package/dist/cjs/core/vuiProvider/vuiProvider.d.ts.map +1 -1
- package/dist/cjs/core/vuiProvider/vuiProvider.js +0 -2
- package/dist/cjs/definition/definition.d.ts +9 -0
- package/dist/cjs/definition/definition.d.ts.map +1 -0
- package/dist/cjs/definition/definition.js +85 -0
- package/dist/cjs/definition/definition.types.d.ts +24 -0
- package/dist/cjs/definition/definition.types.d.ts.map +1 -0
- package/dist/cjs/definition/definitionContent.d.ts +6 -0
- package/dist/cjs/definition/definitionContent.d.ts.map +1 -0
- package/dist/cjs/definition/definitionContent.js +46 -0
- package/dist/cjs/definition/index.d.ts +3 -0
- package/dist/cjs/definition/index.d.ts.map +1 -0
- package/dist/cjs/definition/index.js +23 -0
- package/dist/cjs/definition/theme.d.ts +65 -0
- package/dist/cjs/definition/theme.d.ts.map +1 -0
- package/dist/cjs/definition/theme.js +70 -0
- package/dist/cjs/dialog/consts.d.ts +0 -1
- package/dist/cjs/dialog/consts.d.ts.map +1 -1
- package/dist/cjs/dialog/consts.js +1 -2
- package/dist/cjs/focusLock/focusLock.d.ts +11 -0
- package/dist/cjs/focusLock/focusLock.d.ts.map +1 -0
- package/dist/cjs/{modal → focusLock}/focusLock.js +3 -3
- package/dist/cjs/focusLock/focusLock.types.d.ts.map +1 -0
- package/dist/cjs/focusLock/focusLock.types.js +2 -0
- package/dist/cjs/focusLock/index.d.ts +4 -0
- package/dist/cjs/focusLock/index.d.ts.map +1 -0
- package/dist/cjs/focusLock/index.js +24 -0
- package/dist/cjs/footer/footer.d.ts.map +1 -1
- package/dist/cjs/footer/footer.js +5 -1
- package/dist/cjs/footer/footer.types.d.ts +2 -1
- package/dist/cjs/footer/footer.types.d.ts.map +1 -1
- package/dist/cjs/header/headerAccountUserInfo.d.ts.map +1 -1
- package/dist/cjs/header/headerAccountUserInfo.js +3 -3
- package/dist/cjs/header/headerLinkItem.d.ts.map +1 -1
- package/dist/cjs/header/headerLinkItem.js +7 -3
- package/dist/cjs/header/headerNotifications.d.ts.map +1 -1
- package/dist/cjs/header/headerNotifications.js +3 -3
- package/dist/cjs/header/headerSignIn.d.ts.map +1 -1
- package/dist/cjs/header/headerSignIn.js +1 -1
- package/dist/cjs/header/theme.d.ts +2 -0
- package/dist/cjs/header/theme.d.ts.map +1 -1
- package/dist/cjs/header/theme.js +2 -0
- package/dist/cjs/icons/baseIcons/conc/conCard.d.ts +4 -0
- package/dist/cjs/icons/baseIcons/conc/conCard.d.ts.map +1 -0
- package/dist/cjs/icons/baseIcons/conc/conCard.js +8 -0
- package/dist/cjs/icons/baseIcons/conc/conEmptyBox.d.ts +4 -0
- package/dist/cjs/icons/baseIcons/conc/conEmptyBox.d.ts.map +1 -0
- package/dist/cjs/icons/baseIcons/conc/conEmptyBox.js +7 -0
- package/dist/cjs/icons/baseIcons/icons.d.ts +2 -0
- package/dist/cjs/icons/baseIcons/icons.d.ts.map +1 -1
- package/dist/cjs/icons/baseIcons/icons.js +12 -8
- package/dist/cjs/icons/baseIcons/types.d.ts +1 -1
- package/dist/cjs/icons/baseIcons/types.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/input/consts.d.ts +6 -0
- package/dist/cjs/input/consts.d.ts.map +1 -1
- package/dist/cjs/input/consts.js +7 -1
- package/dist/cjs/input/input.d.ts.map +1 -1
- package/dist/cjs/input/input.js +3 -3
- package/dist/cjs/input/input.types.d.ts +2 -0
- package/dist/cjs/input/input.types.d.ts.map +1 -1
- package/dist/cjs/modal/index.d.ts +2 -2
- package/dist/cjs/modal/index.d.ts.map +1 -1
- package/dist/cjs/modal/index.js +2 -2
- package/dist/cjs/modal/modal.d.ts.map +1 -1
- package/dist/cjs/modal/modal.js +1 -1
- package/dist/cjs/modal/modal.types.d.ts +1 -1
- package/dist/cjs/modal/modal.types.d.ts.map +1 -1
- package/dist/cjs/modal/modalManager.d.ts +2 -2
- package/dist/cjs/modal/modalManager.d.ts.map +1 -1
- package/dist/cjs/modal/modalManager.js +6 -9
- package/dist/cjs/onedesign-tokens/dist/js/rem/button.d.ts +85 -0
- package/dist/cjs/onedesign-tokens/dist/js/rem/button.d.ts.map +1 -0
- package/dist/cjs/onedesign-tokens/dist/js/rem/button.js +88 -0
- package/dist/cjs/sidemenu/sidemenu.d.ts +0 -1
- package/dist/cjs/sidemenu/sidemenu.d.ts.map +1 -1
- package/dist/cjs/sidemenu/sidemenu.js +10 -11
- package/dist/cjs/sidemenu/sidemenu.types.d.ts +4 -0
- package/dist/cjs/sidemenu/sidemenu.types.d.ts.map +1 -1
- package/dist/cjs/sidemenu/sidemenuItem.d.ts.map +1 -1
- package/dist/cjs/sidemenu/sidemenuItem.js +11 -6
- package/dist/cjs/spinner/spinner.d.ts.map +1 -1
- package/dist/cjs/spinner/spinner.js +2 -2
- package/dist/cjs/spinner/spinner.types.d.ts +2 -1
- package/dist/cjs/spinner/spinner.types.d.ts.map +1 -1
- package/dist/cjs/spinner/theme.d.ts +26 -5
- package/dist/cjs/spinner/theme.d.ts.map +1 -1
- package/dist/cjs/spinner/theme.js +34 -13
- package/dist/cjs/theme/components.d.ts +91 -5
- package/dist/cjs/theme/components.d.ts.map +1 -1
- package/dist/cjs/theme/components.js +70 -68
- package/dist/cjs/theme/defaultTheme.d.ts +92 -5
- package/dist/cjs/theme/defaultTheme.d.ts.map +1 -1
- package/dist/cjs/theme/foundations/colors.js +1 -1
- package/dist/cjs/theme/foundations/index.d.ts +1 -0
- package/dist/cjs/theme/foundations/index.d.ts.map +1 -1
- package/dist/cjs/theme/foundations/screens.d.ts +1 -0
- package/dist/cjs/theme/foundations/screens.d.ts.map +1 -1
- package/dist/cjs/theme/foundations/screens.js +2 -1
- package/dist/esm/accordion/accordion.types.d.ts +4 -2
- package/dist/esm/accordion/accordion.types.d.ts.map +1 -1
- package/dist/esm/accordion/accordionItem.d.ts.map +1 -1
- package/dist/esm/accordion/accordionItem.js +2 -2
- package/dist/esm/accordion/accordionItemArrow.d.ts +1 -1
- package/dist/esm/accordion/accordionItemArrow.d.ts.map +1 -1
- package/dist/esm/accordion/accordionItemArrow.js +1 -1
- package/dist/esm/accordion/accordionItemHorizontal.d.ts.map +1 -1
- package/dist/esm/accordion/accordionItemHorizontal.js +2 -2
- package/dist/esm/button/button.d.ts.map +1 -1
- package/dist/esm/button/button.js +10 -16
- package/dist/esm/button/buttonIcon.d.ts.map +1 -1
- package/dist/esm/button/buttonIcon.js +4 -2
- package/dist/esm/button/consts.d.ts +5 -0
- package/dist/esm/button/consts.d.ts.map +1 -1
- package/dist/esm/button/consts.js +6 -5
- package/dist/esm/core/vuiProvider/consts.d.ts +2 -0
- package/dist/esm/core/vuiProvider/consts.d.ts.map +1 -0
- package/dist/esm/core/vuiProvider/consts.js +1 -0
- package/dist/esm/core/vuiProvider/globalStyle.d.ts.map +1 -1
- package/dist/esm/core/vuiProvider/globalStyle.js +8 -0
- package/dist/esm/core/vuiProvider/index.d.ts +2 -0
- package/dist/esm/core/vuiProvider/index.d.ts.map +1 -1
- package/dist/esm/core/vuiProvider/index.js +2 -0
- package/dist/esm/core/vuiProvider/useBodyScrollLock.d.ts +7 -0
- package/dist/esm/core/vuiProvider/useBodyScrollLock.d.ts.map +1 -0
- package/dist/esm/core/vuiProvider/useBodyScrollLock.js +14 -0
- package/dist/esm/core/vuiProvider/vuiProvider.d.ts.map +1 -1
- package/dist/esm/core/vuiProvider/vuiProvider.js +0 -2
- package/dist/esm/definition/definition.d.ts +9 -0
- package/dist/esm/definition/definition.d.ts.map +1 -0
- package/dist/esm/definition/definition.js +68 -0
- package/dist/esm/definition/definition.types.d.ts +24 -0
- package/dist/esm/definition/definition.types.d.ts.map +1 -0
- package/dist/esm/definition/definitionContent.d.ts +6 -0
- package/dist/esm/definition/definitionContent.d.ts.map +1 -0
- package/dist/esm/definition/definitionContent.js +26 -0
- package/dist/esm/definition/index.d.ts +3 -0
- package/dist/esm/definition/index.d.ts.map +1 -0
- package/dist/esm/definition/index.js +2 -0
- package/dist/esm/definition/theme.d.ts +65 -0
- package/dist/esm/definition/theme.d.ts.map +1 -0
- package/dist/esm/definition/theme.js +68 -0
- package/dist/esm/dialog/consts.d.ts +0 -1
- package/dist/esm/dialog/consts.d.ts.map +1 -1
- package/dist/esm/dialog/consts.js +0 -1
- package/dist/esm/focusLock/focusLock.d.ts +11 -0
- package/dist/esm/focusLock/focusLock.d.ts.map +1 -0
- package/dist/esm/{modal → focusLock}/focusLock.js +3 -3
- package/dist/esm/focusLock/focusLock.types.d.ts.map +1 -0
- package/dist/esm/focusLock/focusLock.types.js +1 -0
- package/dist/esm/focusLock/index.d.ts +4 -0
- package/dist/esm/focusLock/index.d.ts.map +1 -0
- package/dist/esm/focusLock/index.js +3 -0
- package/dist/esm/footer/footer.d.ts.map +1 -1
- package/dist/esm/footer/footer.js +5 -1
- package/dist/esm/footer/footer.types.d.ts +2 -1
- package/dist/esm/footer/footer.types.d.ts.map +1 -1
- package/dist/esm/header/headerAccountUserInfo.d.ts.map +1 -1
- package/dist/esm/header/headerAccountUserInfo.js +3 -3
- package/dist/esm/header/headerLinkItem.d.ts.map +1 -1
- package/dist/esm/header/headerLinkItem.js +7 -3
- package/dist/esm/header/headerNotifications.d.ts.map +1 -1
- package/dist/esm/header/headerNotifications.js +3 -3
- package/dist/esm/header/headerSignIn.d.ts.map +1 -1
- package/dist/esm/header/headerSignIn.js +1 -1
- package/dist/esm/header/theme.d.ts +2 -0
- package/dist/esm/header/theme.d.ts.map +1 -1
- package/dist/esm/header/theme.js +2 -0
- package/dist/esm/icons/baseIcons/conc/conCard.d.ts +4 -0
- package/dist/esm/icons/baseIcons/conc/conCard.d.ts.map +1 -0
- package/dist/esm/icons/baseIcons/conc/conCard.js +6 -0
- package/dist/esm/icons/baseIcons/conc/conEmptyBox.d.ts +4 -0
- package/dist/esm/icons/baseIcons/conc/conEmptyBox.d.ts.map +1 -0
- package/dist/esm/icons/baseIcons/conc/conEmptyBox.js +5 -0
- package/dist/esm/icons/baseIcons/icons.d.ts +2 -0
- package/dist/esm/icons/baseIcons/icons.d.ts.map +1 -1
- package/dist/esm/icons/baseIcons/icons.js +2 -0
- package/dist/esm/icons/baseIcons/types.d.ts +1 -1
- package/dist/esm/icons/baseIcons/types.d.ts.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/input/consts.d.ts +6 -0
- package/dist/esm/input/consts.d.ts.map +1 -1
- package/dist/esm/input/consts.js +6 -0
- package/dist/esm/input/input.d.ts.map +1 -1
- package/dist/esm/input/input.js +4 -4
- package/dist/esm/input/input.types.d.ts +2 -0
- package/dist/esm/input/input.types.d.ts.map +1 -1
- package/dist/esm/modal/index.d.ts +2 -2
- package/dist/esm/modal/index.d.ts.map +1 -1
- package/dist/esm/modal/index.js +2 -2
- package/dist/esm/modal/modal.d.ts.map +1 -1
- package/dist/esm/modal/modal.js +1 -1
- package/dist/esm/modal/modal.types.d.ts +1 -1
- package/dist/esm/modal/modal.types.d.ts.map +1 -1
- package/dist/esm/modal/modalManager.d.ts +2 -2
- package/dist/esm/modal/modalManager.d.ts.map +1 -1
- package/dist/esm/modal/modalManager.js +6 -9
- package/dist/esm/onedesign-tokens/dist/js/rem/button.d.ts +85 -0
- package/dist/esm/onedesign-tokens/dist/js/rem/button.d.ts.map +1 -0
- package/dist/esm/onedesign-tokens/dist/js/rem/button.js +84 -0
- package/dist/esm/sidemenu/sidemenu.d.ts +0 -1
- package/dist/esm/sidemenu/sidemenu.d.ts.map +1 -1
- package/dist/esm/sidemenu/sidemenu.js +9 -11
- package/dist/esm/sidemenu/sidemenu.types.d.ts +4 -0
- package/dist/esm/sidemenu/sidemenu.types.d.ts.map +1 -1
- package/dist/esm/sidemenu/sidemenuItem.d.ts.map +1 -1
- package/dist/esm/sidemenu/sidemenuItem.js +29 -6
- package/dist/esm/spinner/spinner.d.ts.map +1 -1
- package/dist/esm/spinner/spinner.js +2 -2
- package/dist/esm/spinner/spinner.types.d.ts +2 -1
- package/dist/esm/spinner/spinner.types.d.ts.map +1 -1
- package/dist/esm/spinner/theme.d.ts +26 -5
- package/dist/esm/spinner/theme.d.ts.map +1 -1
- package/dist/esm/spinner/theme.js +34 -13
- package/dist/esm/theme/components.d.ts +91 -5
- package/dist/esm/theme/components.d.ts.map +1 -1
- package/dist/esm/theme/components.js +2 -0
- package/dist/esm/theme/defaultTheme.d.ts +92 -5
- package/dist/esm/theme/defaultTheme.d.ts.map +1 -1
- package/dist/esm/theme/foundations/colors.js +1 -1
- package/dist/esm/theme/foundations/index.d.ts +1 -0
- package/dist/esm/theme/foundations/index.d.ts.map +1 -1
- package/dist/esm/theme/foundations/screens.d.ts +1 -0
- package/dist/esm/theme/foundations/screens.d.ts.map +1 -1
- package/dist/esm/theme/foundations/screens.js +2 -1
- package/package.json +1 -1
- package/src/accordion/accordion.types.ts +4 -2
- package/src/accordion/accordionItem.tsx +6 -2
- package/src/accordion/accordionItemArrow.tsx +10 -2
- package/src/accordion/accordionItemHorizontal.tsx +11 -2
- package/src/button/button.tsx +18 -19
- package/src/button/buttonIcon.tsx +6 -3
- package/src/button/consts.ts +7 -5
- package/src/core/vuiProvider/consts.ts +1 -0
- package/src/core/vuiProvider/globalStyle.tsx +8 -0
- package/src/core/vuiProvider/index.ts +2 -0
- package/src/core/vuiProvider/useBodyScrollLock.tsx +17 -0
- package/src/core/vuiProvider/vuiProvider.tsx +0 -2
- package/src/definition/definition.tsx +83 -0
- package/src/definition/definition.types.ts +24 -0
- package/src/definition/definitionContent.tsx +61 -0
- package/src/definition/index.ts +2 -0
- package/src/definition/theme.ts +73 -0
- package/src/dialog/consts.ts +0 -2
- package/src/{modal → focusLock}/focusLock.tsx +4 -3
- package/src/focusLock/index.ts +3 -0
- package/src/footer/footer.tsx +29 -1
- package/src/footer/footer.types.ts +2 -1
- package/src/header/headerAccountUserInfo.tsx +7 -3
- package/src/header/headerLinkItem.tsx +7 -3
- package/src/header/headerNotifications.tsx +7 -3
- package/src/header/headerSignIn.tsx +1 -0
- package/src/header/theme.ts +2 -0
- package/src/icons/baseIcons/conc/conCard.ts +9 -0
- package/src/icons/baseIcons/conc/conEmptyBox.ts +8 -0
- package/src/icons/baseIcons/icons.ts +2 -0
- package/src/icons/baseIcons/types.ts +2 -0
- package/src/index.ts +2 -0
- package/src/input/consts.ts +7 -0
- package/src/input/input.tsx +66 -55
- package/src/input/input.types.ts +2 -0
- package/src/modal/index.ts +2 -2
- package/src/modal/modal.tsx +1 -2
- package/src/modal/modal.types.ts +1 -1
- package/src/modal/modalManager.ts +6 -9
- package/src/onedesign-tokens/dist/js/rem/button.js +85 -0
- package/src/sidemenu/sidemenu.tsx +23 -13
- package/src/sidemenu/sidemenu.types.ts +4 -0
- package/src/sidemenu/sidemenuItem.tsx +49 -36
- package/src/spinner/spinner.tsx +3 -4
- package/src/spinner/spinner.types.ts +3 -1
- package/src/spinner/theme.ts +34 -13
- package/src/theme/components.ts +2 -0
- package/src/theme/foundations/colors.ts +1 -1
- package/src/theme/foundations/screens.ts +2 -1
- package/dist/cjs/modal/focusLock.d.ts +0 -11
- package/dist/cjs/modal/focusLock.d.ts.map +0 -1
- package/dist/cjs/modal/focusLock.types.d.ts.map +0 -1
- package/dist/cjs/modal/modalStyle.d.ts +0 -3
- package/dist/cjs/modal/modalStyle.d.ts.map +0 -1
- package/dist/cjs/modal/modalStyle.js +0 -10
- package/dist/esm/modal/focusLock.d.ts +0 -11
- package/dist/esm/modal/focusLock.d.ts.map +0 -1
- package/dist/esm/modal/focusLock.types.d.ts.map +0 -1
- package/dist/esm/modal/modalStyle.d.ts +0 -3
- package/dist/esm/modal/modalStyle.d.ts.map +0 -1
- package/dist/esm/modal/modalStyle.js +0 -8
- package/src/modal/modalStyle.ts +0 -9
- /package/dist/cjs/{modal/focusLock.types.js → definition/definition.types.js} +0 -0
- /package/dist/cjs/{modal → focusLock}/focusLock.types.d.ts +0 -0
- /package/dist/esm/{modal/focusLock.types.js → definition/definition.types.js} +0 -0
- /package/dist/esm/{modal → focusLock}/focusLock.types.d.ts +0 -0
- /package/src/{modal → focusLock}/focusLock.types.ts +0 -0
package/src/input/input.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { styled, useStyleConfig, vui, VuiComponent } from '../core'
|
|
|
4
4
|
import { T } from '../t'
|
|
5
5
|
import { ChangeEvent, cs, filterUndefined, isString } from '../utils'
|
|
6
6
|
import AutoCompletePopover from './autoCompletePopover'
|
|
7
|
-
import { inputColors, inputStateMapping } from './consts'
|
|
7
|
+
import { displayValueOnlyTextSize, inputColors, inputStateMapping } from './consts'
|
|
8
8
|
import { InputProvider } from './context'
|
|
9
9
|
import { getInitialCount } from './helpers'
|
|
10
10
|
import HelpText from './helpText'
|
|
@@ -67,7 +67,8 @@ export const Input = vui<'div', InputProps>((props, ref) => {
|
|
|
67
67
|
readOnly,
|
|
68
68
|
required,
|
|
69
69
|
showCount,
|
|
70
|
-
|
|
70
|
+
displayValueOnly,
|
|
71
|
+
size = 'lg',
|
|
71
72
|
state = '',
|
|
72
73
|
stateMapping,
|
|
73
74
|
step,
|
|
@@ -113,59 +114,69 @@ export const Input = vui<'div', InputProps>((props, ref) => {
|
|
|
113
114
|
|
|
114
115
|
return (
|
|
115
116
|
<InputProvider value={context}>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
117
|
+
{displayValueOnly ? (
|
|
118
|
+
<T
|
|
119
|
+
className={cs('vui-input-value', className)}
|
|
120
|
+
size={displayValueOnlyTextSize[size] as 'xs' | 'md' | 'sm' | 'lg'}
|
|
121
|
+
>
|
|
122
|
+
{value || defaultValue}
|
|
123
|
+
</T>
|
|
124
|
+
) : (
|
|
125
|
+
<AutoCompletePopover
|
|
126
|
+
autoCompleteMaxHeight={autoCompleteMaxHeight}
|
|
127
|
+
autoCompleteOptions={autoCompleteOptions}
|
|
128
|
+
filterAutoCompleteOptions={filterAutoCompleteOptions}
|
|
129
|
+
onAutoCompleteSelect={onAutoCompleteSelect}
|
|
130
|
+
>
|
|
131
|
+
<InputBase className={cs('vui-input', className)} ref={ref} {...styles.container} {...aliasedProps} {...rest}>
|
|
132
|
+
{itemLeft}
|
|
133
|
+
{isString(iconLeft) ? <InputIcon ml={1} name={iconLeft} /> : iconLeft}
|
|
134
|
+
{children ?? input ?? (
|
|
135
|
+
<InputInput
|
|
136
|
+
ref={inputRef}
|
|
137
|
+
{...{
|
|
138
|
+
autoFocus,
|
|
139
|
+
defaultValue,
|
|
140
|
+
disabled,
|
|
141
|
+
id,
|
|
142
|
+
max,
|
|
143
|
+
maxLength,
|
|
144
|
+
min,
|
|
145
|
+
name,
|
|
146
|
+
onBlur,
|
|
147
|
+
onChange,
|
|
148
|
+
onFocus,
|
|
149
|
+
pattern,
|
|
150
|
+
placeholder,
|
|
151
|
+
readOnly,
|
|
152
|
+
required,
|
|
153
|
+
step,
|
|
154
|
+
type
|
|
155
|
+
}}
|
|
156
|
+
autoComplete={autoCompleteOptions?.length ? 'off' : autoComplete}
|
|
157
|
+
value={valueInternal}
|
|
158
|
+
{...inputProps}
|
|
159
|
+
/>
|
|
160
|
+
)}
|
|
161
|
+
{isString(iconRight) ? <InputIcon mr={1} name={iconRight} /> : iconRight}
|
|
162
|
+
{itemRight}
|
|
163
|
+
{state && <InputIcon mr={1} {...states[state]?.iconProps} />}
|
|
164
|
+
{showCount && (
|
|
165
|
+
<T
|
|
166
|
+
className="vui-inputCount"
|
|
167
|
+
color={maxLength && count > maxLength ? inputColors.error : inputColors.helpText}
|
|
168
|
+
position="absolute"
|
|
169
|
+
right={0}
|
|
170
|
+
size="sm"
|
|
171
|
+
top="calc(100% + 1px)"
|
|
172
|
+
>
|
|
173
|
+
{count} {maxLength ? `/ ${maxLength}` : null}
|
|
174
|
+
</T>
|
|
175
|
+
)}
|
|
176
|
+
</InputBase>
|
|
177
|
+
</AutoCompletePopover>
|
|
178
|
+
)}
|
|
179
|
+
|
|
169
180
|
{!!helpText && <HelpText>{helpText}</HelpText>}
|
|
170
181
|
{!!errorText && <HelpText isError>{errorText}</HelpText>}
|
|
171
182
|
</InputProvider>
|
package/src/input/input.types.ts
CHANGED
|
@@ -68,6 +68,8 @@ export type InputProps = SystemProps &
|
|
|
68
68
|
required?: boolean
|
|
69
69
|
/** Displays length of input value if also using maxLength. */
|
|
70
70
|
showCount?: boolean
|
|
71
|
+
/** Displays the provided value. */
|
|
72
|
+
displayValueOnly?: boolean
|
|
71
73
|
/** Modifies Input style and content based on the given state. */
|
|
72
74
|
state?: InputState
|
|
73
75
|
/** Object definition of styles and content for each state. */
|
package/src/modal/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './context'
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
2
|
+
export * from '../focusLock/focusLock'
|
|
3
|
+
export * from '../focusLock/focusLock.types'
|
|
4
4
|
export * from './modal'
|
|
5
5
|
export { default as Modal } from './modal'
|
|
6
6
|
export * from './modal.types'
|
package/src/modal/modal.tsx
CHANGED
|
@@ -2,10 +2,10 @@ import React, { cloneElement, useRef } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import Box from '../box'
|
|
4
4
|
import { vui, VuiComponent } from '../core'
|
|
5
|
+
import FocusLock from '../focusLock'
|
|
5
6
|
import Portal from '../portal'
|
|
6
7
|
import { callAll, cs, KeyboardEvent, mergeRefs, MouseEvent } from '../utils'
|
|
7
8
|
import { ModalProvider } from './context'
|
|
8
|
-
import FocusLock from './focusLock'
|
|
9
9
|
import { ModalProps } from './modal.types'
|
|
10
10
|
import ModalBackdrop from './modalBackdrop'
|
|
11
11
|
import ModalContent from './modalContent'
|
|
@@ -95,7 +95,6 @@ export const Modal = vui<'div', ModalProps>((props, ref) => {
|
|
|
95
95
|
onMouseDown={callAll(props.onMouseDown, onMouseDown)}
|
|
96
96
|
>
|
|
97
97
|
{!hideBackdrop && <ModalBackdrop />}
|
|
98
|
-
|
|
99
98
|
<FocusLock
|
|
100
99
|
autoFocus={!disableAutoFocus}
|
|
101
100
|
finalFocusRef={finalFocusRef}
|
package/src/modal/modal.types.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactElement } from 'react'
|
|
2
2
|
|
|
3
|
+
import { FocusableElement } from '../focusLock/focusLock.types'
|
|
3
4
|
import { SystemProps } from '../system'
|
|
4
5
|
import { ThemingProps } from '../theme'
|
|
5
6
|
import { MouseEvent } from '../utils'
|
|
6
|
-
import { FocusableElement } from './focusLock.types'
|
|
7
7
|
|
|
8
8
|
export type ModalBackdropProps = SystemProps
|
|
9
9
|
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { Ref, useEffect } from 'react'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useBodyScrollLock } from '../core'
|
|
4
4
|
|
|
5
5
|
/** State management for nested modals. */
|
|
6
6
|
class ModalManager {
|
|
7
7
|
modals: any[] = []
|
|
8
8
|
|
|
9
|
-
add = (modal: any) =>
|
|
10
|
-
this.modals.push(modal)
|
|
11
|
-
}
|
|
9
|
+
add = (modal: any) => this.modals.push(modal)
|
|
12
10
|
|
|
13
|
-
remove = (modal: any) =>
|
|
14
|
-
this.modals = this.modals.filter(m => m !== modal)
|
|
15
|
-
}
|
|
11
|
+
remove = (modal: any) => (this.modals = this.modals.filter(m => m !== modal))
|
|
16
12
|
|
|
17
13
|
isTopModal = (modal: any) => {
|
|
18
14
|
const topmostModal = this.modals[this.modals.length - 1]
|
|
@@ -24,15 +20,16 @@ export const manager = new ModalManager()
|
|
|
24
20
|
|
|
25
21
|
/** Refs of new modals will be automatically added/removed from the state when rendering. */
|
|
26
22
|
export function useModalManager(ref: Ref<any>, isOpen?: boolean, disableScrollLock?: boolean) {
|
|
23
|
+
const { setIsScrollLocked } = useBodyScrollLock()
|
|
27
24
|
useEffect(() => {
|
|
28
25
|
if (isOpen) {
|
|
29
26
|
manager.add(ref)
|
|
30
|
-
if (!disableScrollLock)
|
|
27
|
+
if (!disableScrollLock) setIsScrollLocked(true)
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
return () => {
|
|
34
31
|
manager.remove(ref)
|
|
35
|
-
if (!disableScrollLock)
|
|
32
|
+
if (!disableScrollLock) setIsScrollLocked(false)
|
|
36
33
|
}
|
|
37
34
|
}, [isOpen, ref])
|
|
38
35
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly
|
|
3
|
+
* Generated on Wed, 22 Mar 2023 12:31:05 GMT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const buttonSizeLargeFontSize = "1.125rem";
|
|
7
|
+
export const buttonSizeLargeLineHeight = "1.75rem";
|
|
8
|
+
export const buttonSizeLargePadding = "0.5rem 1rem";
|
|
9
|
+
export const buttonSizeMediumFontSize = "1rem";
|
|
10
|
+
export const buttonSizeMediumLineHeight = "1.5rem";
|
|
11
|
+
export const buttonSizeMediumPadding = "0.25rem calc(0.25rem * 3)";
|
|
12
|
+
export const buttonSizeSmallFontSize = "0.875rem";
|
|
13
|
+
export const buttonSizeSmallLineHeight = "1.25rem";
|
|
14
|
+
export const buttonSizeSmallPadding = "calc(0.25rem / 2) 0.5rem";
|
|
15
|
+
export const buttonSizeDefaultFontSize = "1rem";
|
|
16
|
+
export const buttonSizeDefaultLineHeight = "1.5rem";
|
|
17
|
+
export const buttonSizeDefaultPadding = "0.25rem calc(0.25rem * 3)";
|
|
18
|
+
export const buttonTypePrimaryDefaultBorderColorDark = "hsla(0, 0%, 0%, 0)";
|
|
19
|
+
export const buttonTypePrimaryDefaultBorderColorLight = "hsla(0, 0%, 0%, 0)";
|
|
20
|
+
export const buttonTypePrimaryDefaultBackgroundColorDark = "hsla(218, 100%, 28%, 1)";
|
|
21
|
+
export const buttonTypePrimaryDefaultBackgroundColorLight = "hsla(139, 100%, 78%, 1)";
|
|
22
|
+
export const buttonTypePrimaryDefaultTextColorDark = "hsla(40, 3%, 100%, 1)";
|
|
23
|
+
export const buttonTypePrimaryDefaultTextColorLight = "hsla(223, 67%, 18%, 1)";
|
|
24
|
+
export const buttonTypePrimaryHoverBorderColorDark = "hsla(0, 0%, 0%, 0)";
|
|
25
|
+
export const buttonTypePrimaryHoverBorderColorLight = "hsla(0, 0%, 0%, 0)";
|
|
26
|
+
export const buttonTypePrimaryHoverBackgroundColorDark = "hsla(218, 100%, 20%, 1)";
|
|
27
|
+
export const buttonTypePrimaryHoverBackgroundColorLight = "hsla(139, 100%, 70%, 1)";
|
|
28
|
+
export const buttonTypePrimaryHoverTextColorDark = "hsla(40, 3%, 100%, 1)";
|
|
29
|
+
export const buttonTypePrimaryHoverTextColorLight = "hsla(223, 67%, 18%, 1)";
|
|
30
|
+
export const buttonTypePrimaryActiveBorderColorDark = "hsla(0, 0%, 0%, 0)";
|
|
31
|
+
export const buttonTypePrimaryActiveBorderColorLight = "hsla(0, 0%, 0%, 0)";
|
|
32
|
+
export const buttonTypePrimaryActiveBackgroundColorDark = "hsla(218, 100%, 35%, 1)";
|
|
33
|
+
export const buttonTypePrimaryActiveBackgroundColorLight = "hsla(139, 100%, 85%, 1)";
|
|
34
|
+
export const buttonTypePrimaryActiveTextColorDark = "hsla(40, 3%, 100%, 1)";
|
|
35
|
+
export const buttonTypePrimaryActiveTextColorLight = "hsla(223, 67%, 18%, 1)";
|
|
36
|
+
export const buttonTypePrimaryFocusOutline = "0.25rem solid hsla(196, 100%, 43%, 1)";
|
|
37
|
+
export const buttonTypeSecondaryDefaultBorderColorDark = "hsla(218, 100%, 28%, 1)";
|
|
38
|
+
export const buttonTypeSecondaryDefaultBorderColorLight = "hsla(139, 100%, 78%, 1)";
|
|
39
|
+
export const buttonTypeSecondaryDefaultBackgroundColorDark = "hsla(0, 0%, 0%, 0)";
|
|
40
|
+
export const buttonTypeSecondaryDefaultBackgroundColorLight = "hsla(0, 0%, 0%, 0)";
|
|
41
|
+
export const buttonTypeSecondaryDefaultTextColorDark = "hsla(218, 100%, 28%, 1)";
|
|
42
|
+
export const buttonTypeSecondaryDefaultTextColorLight = "hsla(139, 100%, 78%, 1)";
|
|
43
|
+
export const buttonTypeSecondaryHoverBorderColorDark = "hsla(218, 100%, 28%, 1)";
|
|
44
|
+
export const buttonTypeSecondaryHoverBorderColorLight = "hsla(139, 100%, 78%, 1)";
|
|
45
|
+
export const buttonTypeSecondaryHoverBackgroundColorDark = "hsla(196, 74%, 80%, 1)";
|
|
46
|
+
export const buttonTypeSecondaryHoverBackgroundColorLight = "hsla(218, 100%, 25%, 1)";
|
|
47
|
+
export const buttonTypeSecondaryHoverTextColorDark = "hsla(218, 100%, 28%, 1)";
|
|
48
|
+
export const buttonTypeSecondaryHoverTextColorLight = "hsla(139, 100%, 78%, 1)";
|
|
49
|
+
export const buttonTypeSecondaryActiveBorderColorDark = "hsla(218, 100%, 28%, 1)";
|
|
50
|
+
export const buttonTypeSecondaryActiveBorderColorLight = "hsla(139, 100%, 78%, 1)";
|
|
51
|
+
export const buttonTypeSecondaryActiveBackgroundColorDark = "hsla(196, 74%, 85%, 1)";
|
|
52
|
+
export const buttonTypeSecondaryActiveBackgroundColorLight = "hsla(218, 100%, 35%, 1)";
|
|
53
|
+
export const buttonTypeSecondaryActiveTextColorDark = "hsla(218, 100%, 28%, 1)";
|
|
54
|
+
export const buttonTypeSecondaryActiveTextColorLight = "hsla(139, 100%, 78%, 1)";
|
|
55
|
+
export const buttonTypeSecondaryFocusOutline = "0.25rem solid hsla(196, 100%, 43%, 1)";
|
|
56
|
+
export const buttonTypeTertiaryDefaultBorderColorDark = "hsla(0, 0%, 0%, 0)";
|
|
57
|
+
export const buttonTypeTertiaryDefaultBorderColorLight = "hsla(0, 0%, 0%, 0)";
|
|
58
|
+
export const buttonTypeTertiaryDefaultBackgroundColorDark = "hsla(0, 0%, 0%, 0)";
|
|
59
|
+
export const buttonTypeTertiaryDefaultBackgroundColorLight = "hsla(0, 0%, 0%, 0)";
|
|
60
|
+
export const buttonTypeTertiaryDefaultTextColorDark = "hsla(218, 100%, 28%, 1)";
|
|
61
|
+
export const buttonTypeTertiaryDefaultTextColorLight = "hsla(139, 100%, 78%, 1)";
|
|
62
|
+
export const buttonTypeTertiaryHoverBorderColorDark = "hsla(0, 0%, 0%, 0)";
|
|
63
|
+
export const buttonTypeTertiaryHoverBorderColorLight = "hsla(0, 0%, 0%, 0)";
|
|
64
|
+
export const buttonTypeTertiaryHoverBackgroundColorDark = "hsla(196, 74%, 80%, 1)";
|
|
65
|
+
export const buttonTypeTertiaryHoverBackgroundColorLight = "hsla(218, 100%, 25%, 1)";
|
|
66
|
+
export const buttonTypeTertiaryHoverTextColorDark = "hsla(218, 100%, 28%, 1)";
|
|
67
|
+
export const buttonTypeTertiaryHoverTextColorLight = "hsla(139, 100%, 78%, 1)";
|
|
68
|
+
export const buttonTypeTertiaryActiveBorderColorDark = "hsla(0, 0%, 0%, 0)";
|
|
69
|
+
export const buttonTypeTertiaryActiveBorderColorLight = "hsla(0, 0%, 0%, 0)";
|
|
70
|
+
export const buttonTypeTertiaryActiveBackgroundColorDark = "hsla(196, 74%, 85%, 1)";
|
|
71
|
+
export const buttonTypeTertiaryActiveBackgroundColorLight = "hsla(218, 100%, 35%, 1)";
|
|
72
|
+
export const buttonTypeTertiaryActiveTextColorDark = "hsla(218, 100%, 28%, 1)";
|
|
73
|
+
export const buttonTypeTertiaryActiveTextColorLight = "hsla(139, 100%, 78%, 1)";
|
|
74
|
+
export const buttonTypeTertiaryFocusOutline = "0.25rem solid hsla(196, 100%, 43%, 1)";
|
|
75
|
+
export const buttonDisabledCursor = "default";
|
|
76
|
+
export const buttonDisabledOpacity = "0.5";
|
|
77
|
+
export const buttonBorderStyle = "solid";
|
|
78
|
+
export const buttonBorderWidth = "calc(0.125rem / 2)";
|
|
79
|
+
export const buttonFontFamily = "'Avenir Next', Arial, sans-serif";
|
|
80
|
+
export const buttonFontSize = "1rem";
|
|
81
|
+
export const buttonLineHeight = "1.5rem";
|
|
82
|
+
export const buttonFontWeight = "500";
|
|
83
|
+
export const buttonPadding = "calc(0.25rem * 1.5) calc(0.25rem * 3)";
|
|
84
|
+
export const buttonTransition = "all 0.15s ease-in-out";
|
|
85
|
+
export const buttonCursor = "pointer";
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useMemo, useState } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import Box from '../box'
|
|
4
4
|
import Button from '../button'
|
|
5
|
-
import {
|
|
5
|
+
import { useStyleConfig, vui, VuiComponent } from '../core'
|
|
6
6
|
import Icon from '../icon'
|
|
7
7
|
import { cs, filterUndefined } from '../utils'
|
|
8
8
|
import { expandedWidth } from './consts'
|
|
@@ -11,17 +11,9 @@ import { SidemenuItemProps, SidemenuProps } from './sidemenu.types'
|
|
|
11
11
|
import SidemenuItem from './sidemenuItem'
|
|
12
12
|
import SidemenuTop from './sidemenuTop'
|
|
13
13
|
|
|
14
|
-
export const SidemenuBase = styled.divBox`
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
min-width: 0;
|
|
18
|
-
transition-duration: normal;
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
`
|
|
21
|
-
|
|
22
14
|
/** A collapsible side menu for navigation. */
|
|
23
15
|
export const Sidemenu = vui<'div', SidemenuProps>((props, ref) => {
|
|
24
|
-
const { children, className, items, isExpanded = false, size, variant, width = 280, ...rest } = props
|
|
16
|
+
const { children, className, items, isExpanded = false, size, variant, width = 280, onNavigate, ...rest } = props
|
|
25
17
|
|
|
26
18
|
const [isExpandedInternal, setIsExpandedInternal] = useState(isExpanded)
|
|
27
19
|
const context = useMemo(
|
|
@@ -43,12 +35,30 @@ export const Sidemenu = vui<'div', SidemenuProps>((props, ref) => {
|
|
|
43
35
|
const icon = `falArrow${isExpandedInternal ? 'Left' : 'Right'}`
|
|
44
36
|
const justifyContent = isExpandedInternal ? 'flex-end' : 'center'
|
|
45
37
|
|
|
38
|
+
function onItemClick(item: SidemenuItemProps) {
|
|
39
|
+
item?.onClick?.()
|
|
40
|
+
if (item?.path) onNavigate?.(item.path)
|
|
41
|
+
}
|
|
42
|
+
|
|
46
43
|
return (
|
|
47
44
|
<SidemenuProvider value={context}>
|
|
48
|
-
<
|
|
45
|
+
<Box
|
|
46
|
+
className={cs('vui-sidemenu', className)}
|
|
47
|
+
elevation="3"
|
|
48
|
+
flexDirection="column"
|
|
49
|
+
minWidth={0}
|
|
50
|
+
overflowX="hidden"
|
|
51
|
+
ref={ref}
|
|
52
|
+
transitionDuration="normal"
|
|
53
|
+
w={w}
|
|
54
|
+
{...styles.container}
|
|
55
|
+
{...rest}
|
|
56
|
+
>
|
|
49
57
|
<Box flexDirection="column" flexGrow={1} overflowX="hidden" overflowY="auto" w="100%">
|
|
50
58
|
{items
|
|
51
|
-
? items?.map?.((item: SidemenuItemProps, key: number) =>
|
|
59
|
+
? items?.map?.((item: SidemenuItemProps, key: number) => (
|
|
60
|
+
<SidemenuItem key={key} {...item} onClick={() => onItemClick(item)} />
|
|
61
|
+
))
|
|
52
62
|
: children}
|
|
53
63
|
</Box>
|
|
54
64
|
<Box className="vui-sidemenu-bottom" w="100%" {...styles.bottom}>
|
|
@@ -63,7 +73,7 @@ export const Sidemenu = vui<'div', SidemenuProps>((props, ref) => {
|
|
|
63
73
|
<Icon name={icon} />
|
|
64
74
|
</Button>
|
|
65
75
|
</Box>
|
|
66
|
-
</
|
|
76
|
+
</Box>
|
|
67
77
|
</SidemenuProvider>
|
|
68
78
|
)
|
|
69
79
|
}) as VuiComponent<'div', SidemenuProps> & {
|
|
@@ -13,6 +13,8 @@ export type SidemenuProps = SystemProps &
|
|
|
13
13
|
items?: SidemenuItemProps[]
|
|
14
14
|
/** Whether the menu is expanded @default false */
|
|
15
15
|
isExpanded?: boolean
|
|
16
|
+
/** External callback for navigation to the item path, could be a custom function or React Router hook: https://reactrouter.com/en/main/hooks/use-navigate */
|
|
17
|
+
onNavigate?: (to: string) => void
|
|
16
18
|
/** With of the container when the side menu is expanded @default 280 */
|
|
17
19
|
width?: number
|
|
18
20
|
}
|
|
@@ -30,6 +32,8 @@ export type SidemenuItemProps = BoxProps & {
|
|
|
30
32
|
isActive?: boolean
|
|
31
33
|
/** On click callback */
|
|
32
34
|
onClick?: () => void
|
|
35
|
+
/** Router path */
|
|
36
|
+
path?: string
|
|
33
37
|
/** Title */
|
|
34
38
|
title: string
|
|
35
39
|
}
|
|
@@ -4,6 +4,7 @@ import Box from '../box'
|
|
|
4
4
|
import Button from '../button'
|
|
5
5
|
import { omitThemingProps, useStyleConfig, vui, VuiComponent } from '../core'
|
|
6
6
|
import Icon from '../icon'
|
|
7
|
+
import { Popover } from '../popover'
|
|
7
8
|
import T from '../t'
|
|
8
9
|
import { cs } from '../utils'
|
|
9
10
|
import { useSidemenuContext } from './context'
|
|
@@ -19,17 +20,13 @@ export const SidemenuItem = vui<'button', SidemenuItemProps>((props, ref) => {
|
|
|
19
20
|
const isDark = variant === 'dark'
|
|
20
21
|
const hasChildrenExpanded = !!children && isExpandedInternal
|
|
21
22
|
|
|
22
|
-
const innerContent =
|
|
23
|
+
const innerContent = (
|
|
23
24
|
<Box centerV px={2} py={1} w="100%" whiteSpace="pre">
|
|
24
25
|
<Icon ml={iconSize === 'sm' ? '4px' : 0} name={icon} size={iconSize} />
|
|
25
26
|
<T isTruncated ml={2}>
|
|
26
27
|
{title}
|
|
27
28
|
</T>
|
|
28
29
|
</Box>
|
|
29
|
-
) : (
|
|
30
|
-
<Box centerV px={2} py={1} w="100%">
|
|
31
|
-
<Icon ml={iconSize === 'sm' ? '4px' : 0} name={icon} size={iconSize} />
|
|
32
|
-
</Box>
|
|
33
30
|
)
|
|
34
31
|
|
|
35
32
|
const toggle = (e: MouseEvent<HTMLButtonElement>) => {
|
|
@@ -38,39 +35,55 @@ export const SidemenuItem = vui<'button', SidemenuItemProps>((props, ref) => {
|
|
|
38
35
|
setDisplayChildren(!displayChildren)
|
|
39
36
|
}
|
|
40
37
|
|
|
38
|
+
const buttonStyles = {
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
border: 'none',
|
|
41
|
+
borderRadius: 0,
|
|
42
|
+
borderLeft: '3px solid transparent',
|
|
43
|
+
borderLeftColor: isActive ? (isDark ? 'digiGreen.main' : 'seaBlue.main') : undefined,
|
|
44
|
+
bg: isDark ? 'darkBlue.main' : isActive ? 'skyBlue.95' : 'white',
|
|
45
|
+
color: hasChildrenExpanded ? 'seaBlue.main' : isDark ? 'digiGreen.main' : 'sandstone.10',
|
|
46
|
+
h: 'auto',
|
|
47
|
+
justifyContent: 'space-between',
|
|
48
|
+
onClick: () => onClick?.(),
|
|
49
|
+
p: 0,
|
|
50
|
+
variant: isDark ? 'tertiaryLight' : 'tertiaryDark',
|
|
51
|
+
w: '100%',
|
|
52
|
+
...styles.item,
|
|
53
|
+
minH: size === 'lg' ? '56px' : '40px',
|
|
54
|
+
hoverBg: isDark ? 'seaBlue.main' : 'skyBlue.90',
|
|
55
|
+
...rest
|
|
56
|
+
}
|
|
57
|
+
|
|
41
58
|
return (
|
|
42
59
|
<Box flexDirection="column" ref={ref} w="100%">
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/>
|
|
71
|
-
)}
|
|
72
|
-
</Button>
|
|
73
|
-
{!!children && displayChildren && (
|
|
60
|
+
{!hasChildrenExpanded && children ? (
|
|
61
|
+
<Popover offset={[0, 0]} placement="right-start" trigger="mouseenter">
|
|
62
|
+
<Popover.Trigger className={cs('vui-sidemenu-item-popover', className)} {...buttonStyles}>
|
|
63
|
+
<Box borderLeft={`3px solid ${isDark ? 'digiGreen.main' : 'seaBlue.main'}`}>{innerContent}</Box>
|
|
64
|
+
</Popover.Trigger>
|
|
65
|
+
<Popover.Content shadow={'none'}>
|
|
66
|
+
<Box flexDirection="column" justifyContent="start" w="100%">
|
|
67
|
+
{children}
|
|
68
|
+
</Box>
|
|
69
|
+
</Popover.Content>
|
|
70
|
+
</Popover>
|
|
71
|
+
) : (
|
|
72
|
+
<Button className={cs('vui-sidemenu-item', className)} {...buttonStyles}>
|
|
73
|
+
{innerContent}
|
|
74
|
+
{hasChildrenExpanded && (
|
|
75
|
+
<Button
|
|
76
|
+
className="vui-sidemenu-item-expand"
|
|
77
|
+
icon={displayChildren ? 'falChevronUp' : 'falChevronDown'}
|
|
78
|
+
mr={1}
|
|
79
|
+
onClick={toggle}
|
|
80
|
+
size="sm"
|
|
81
|
+
variant={isDark ? 'tertiaryLight' : 'tertiaryDark'}
|
|
82
|
+
/>
|
|
83
|
+
)}
|
|
84
|
+
</Button>
|
|
85
|
+
)}
|
|
86
|
+
{!!children && hasChildrenExpanded && displayChildren && (
|
|
74
87
|
<Box flexDirection="column" justifyContent="start" w="100%">
|
|
75
88
|
{children}
|
|
76
89
|
</Box>
|
package/src/spinner/spinner.tsx
CHANGED
|
@@ -29,8 +29,8 @@ export const Spinner = vui<'div', SpinnerProps>((props, ref) => {
|
|
|
29
29
|
thickness,
|
|
30
30
|
...rest
|
|
31
31
|
} = props
|
|
32
|
-
const styles = useStyleConfig('Spinner', props)
|
|
33
32
|
|
|
33
|
+
const styles = useStyleConfig('Spinner', props)
|
|
34
34
|
const isCustomSize = typeof size === 'number'
|
|
35
35
|
const positionProps = spinnerPositionMapping[textPosition]
|
|
36
36
|
const speed = spinnerSpeedMapping[speedProp] ?? speedProp
|
|
@@ -49,8 +49,8 @@ export const Spinner = vui<'div', SpinnerProps>((props, ref) => {
|
|
|
49
49
|
gap={1}
|
|
50
50
|
ref={ref}
|
|
51
51
|
transitionDuration="fast"
|
|
52
|
-
{...styles.container}
|
|
53
52
|
{...positionProps.container}
|
|
53
|
+
{...styles.container}
|
|
54
54
|
{...rest}
|
|
55
55
|
>
|
|
56
56
|
<SpinnerCircle
|
|
@@ -59,8 +59,7 @@ export const Spinner = vui<'div', SpinnerProps>((props, ref) => {
|
|
|
59
59
|
{...styles.circle}
|
|
60
60
|
{...circleProps}
|
|
61
61
|
/>
|
|
62
|
-
|
|
63
|
-
{text && (
|
|
62
|
+
{!!text && (
|
|
64
63
|
<T className="vui-spinnerText" {...styles.text}>
|
|
65
64
|
{text}
|
|
66
65
|
</T>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ReactNode } from 'react'
|
|
2
|
+
|
|
1
3
|
import { BoxProps } from '../box'
|
|
2
4
|
import { ThemingProps } from '../theme'
|
|
3
5
|
|
|
@@ -14,7 +16,7 @@ export type SpinnerProps = Omit<BoxProps, 'size' | 'variant'> &
|
|
|
14
16
|
/** Theme size or a number defining height and width. */
|
|
15
17
|
size?: ThemingProps<'Spinner'>['size'] | number
|
|
16
18
|
/** Displays given text next to the spinner. */
|
|
17
|
-
text?:
|
|
19
|
+
text?: ReactNode
|
|
18
20
|
/** Text placement relative to the spinner. */
|
|
19
21
|
textPosition?: 'bottom' | 'left' | 'right' | 'top'
|
|
20
22
|
/** Thickness of the spinner circle in pixels. */
|
package/src/spinner/theme.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
const baseStyle = {
|
|
1
|
+
const baseStyle = {
|
|
2
|
+
container: {
|
|
3
|
+
padding: 1
|
|
4
|
+
}
|
|
5
|
+
}
|
|
2
6
|
|
|
3
7
|
const defaultProps = {
|
|
4
|
-
size: '
|
|
5
|
-
variant: '
|
|
8
|
+
size: 'xxxl',
|
|
9
|
+
variant: 'light'
|
|
6
10
|
}
|
|
7
11
|
|
|
8
12
|
const parts = ['container', 'circle', 'text']
|
|
@@ -10,9 +14,9 @@ const parts = ['container', 'circle', 'text']
|
|
|
10
14
|
const sizes = {
|
|
11
15
|
xs: {
|
|
12
16
|
circle: {
|
|
13
|
-
borderWidth:
|
|
14
|
-
h:
|
|
15
|
-
w:
|
|
17
|
+
borderWidth: 2,
|
|
18
|
+
h: 20,
|
|
19
|
+
w: 20
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
sm: {
|
|
@@ -36,24 +40,38 @@ const sizes = {
|
|
|
36
40
|
w: 40
|
|
37
41
|
}
|
|
38
42
|
},
|
|
39
|
-
|
|
43
|
+
xl: {
|
|
44
|
+
circle: {
|
|
45
|
+
borderWidth: 3,
|
|
46
|
+
h: 48,
|
|
47
|
+
w: 48
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
xxl: {
|
|
40
51
|
circle: {
|
|
41
52
|
borderWidth: 4,
|
|
42
53
|
h: 60,
|
|
43
54
|
w: 60
|
|
44
55
|
}
|
|
45
56
|
},
|
|
46
|
-
|
|
57
|
+
xxxl: {
|
|
47
58
|
circle: {
|
|
48
59
|
borderWidth: 5,
|
|
49
60
|
h: 80,
|
|
50
61
|
w: 80
|
|
51
62
|
}
|
|
63
|
+
},
|
|
64
|
+
xxxxl: {
|
|
65
|
+
circle: {
|
|
66
|
+
borderWidth: 5,
|
|
67
|
+
h: 120,
|
|
68
|
+
w: 120
|
|
69
|
+
}
|
|
52
70
|
}
|
|
53
71
|
}
|
|
54
72
|
|
|
55
73
|
const variants = {
|
|
56
|
-
|
|
74
|
+
light: {
|
|
57
75
|
circle: {
|
|
58
76
|
borderColor: 'seaBlue.80',
|
|
59
77
|
borderTopColor: 'seaBlue.main'
|
|
@@ -62,13 +80,16 @@ const variants = {
|
|
|
62
80
|
color: 'seaBlue.main'
|
|
63
81
|
}
|
|
64
82
|
},
|
|
65
|
-
|
|
83
|
+
dark: {
|
|
84
|
+
container: {
|
|
85
|
+
bg: 'darkBlue.main'
|
|
86
|
+
},
|
|
66
87
|
circle: {
|
|
67
|
-
borderColor: '
|
|
68
|
-
borderTopColor: 'digiGreen.
|
|
88
|
+
borderColor: 'hsl(139, 100%, 78%, 0.4)',
|
|
89
|
+
borderTopColor: 'digiGreen.main'
|
|
69
90
|
},
|
|
70
91
|
text: {
|
|
71
|
-
color: 'digiGreen.
|
|
92
|
+
color: 'digiGreen.main'
|
|
72
93
|
}
|
|
73
94
|
}
|
|
74
95
|
}
|