@telus-uds/components-base 3.23.0 → 3.25.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 +25 -1
- package/lib/cjs/Button/ButtonGroup.js +9 -2
- package/lib/cjs/Card/CardBase.js +97 -17
- package/lib/cjs/Card/PressableCardBase.js +12 -8
- package/lib/cjs/Carousel/Carousel.js +35 -4
- package/lib/cjs/FlexGrid/FlexGrid.js +31 -35
- package/lib/cjs/HorizontalScroll/HorizontalScroll.js +5 -2
- package/lib/cjs/Icon/Icon.js +3 -0
- package/lib/cjs/IconButton/IconButton.js +15 -5
- package/lib/cjs/Listbox/GroupControl.js +12 -6
- package/lib/cjs/Listbox/Listbox.js +41 -7
- package/lib/cjs/Listbox/ListboxGroup.js +139 -8
- package/lib/cjs/Listbox/ListboxOverlay.js +10 -5
- package/lib/cjs/Listbox/SecondLevelHeader.js +201 -0
- package/lib/cjs/Listbox/dictionary.js +14 -0
- package/lib/cjs/Shortcuts/Shortcuts.js +169 -0
- package/lib/cjs/Shortcuts/ShortcutsItem.js +280 -0
- package/lib/cjs/Shortcuts/index.js +16 -0
- package/lib/cjs/TextInput/TextInputBase.js +2 -3
- package/lib/cjs/Tooltip/Tooltip.native.js +2 -0
- package/lib/cjs/index.js +15 -0
- package/lib/cjs/utils/index.js +9 -1
- package/lib/cjs/utils/resolveContentMaxWidth.js +30 -0
- package/lib/esm/Button/ButtonGroup.js +9 -2
- package/lib/esm/Card/CardBase.js +97 -17
- package/lib/esm/Card/PressableCardBase.js +10 -8
- package/lib/esm/Carousel/Carousel.js +37 -6
- package/lib/esm/FlexGrid/FlexGrid.js +31 -35
- package/lib/esm/HorizontalScroll/HorizontalScroll.js +6 -3
- package/lib/esm/Icon/Icon.js +3 -0
- package/lib/esm/IconButton/IconButton.js +15 -5
- package/lib/esm/Listbox/GroupControl.js +12 -6
- package/lib/esm/Listbox/Listbox.js +41 -7
- package/lib/esm/Listbox/ListboxGroup.js +141 -10
- package/lib/esm/Listbox/ListboxOverlay.js +10 -5
- package/lib/esm/Listbox/SecondLevelHeader.js +194 -0
- package/lib/esm/Listbox/dictionary.js +8 -0
- package/lib/esm/Shortcuts/Shortcuts.js +160 -0
- package/lib/esm/Shortcuts/ShortcutsItem.js +273 -0
- package/lib/esm/Shortcuts/index.js +3 -0
- package/lib/esm/TextInput/TextInputBase.js +2 -3
- package/lib/esm/Tooltip/Tooltip.native.js +2 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/utils/index.js +2 -1
- package/lib/esm/utils/resolveContentMaxWidth.js +24 -0
- package/lib/package.json +2 -2
- package/package.json +2 -2
- package/src/Button/ButtonGroup.jsx +20 -3
- package/src/Card/CardBase.jsx +113 -14
- package/src/Card/PressableCardBase.jsx +17 -5
- package/src/Carousel/Carousel.jsx +38 -6
- package/src/FlexGrid/FlexGrid.jsx +30 -39
- package/src/HorizontalScroll/HorizontalScroll.jsx +6 -3
- package/src/Icon/Icon.jsx +3 -0
- package/src/IconButton/IconButton.jsx +12 -5
- package/src/Listbox/GroupControl.jsx +41 -33
- package/src/Listbox/Listbox.jsx +41 -2
- package/src/Listbox/ListboxGroup.jsx +158 -26
- package/src/Listbox/ListboxOverlay.jsx +18 -5
- package/src/Listbox/SecondLevelHeader.jsx +182 -0
- package/src/Listbox/dictionary.js +8 -0
- package/src/Shortcuts/Shortcuts.jsx +174 -0
- package/src/Shortcuts/ShortcutsItem.jsx +297 -0
- package/src/Shortcuts/index.js +4 -0
- package/src/TextInput/TextInputBase.jsx +2 -2
- package/src/Tooltip/Tooltip.native.jsx +2 -1
- package/src/index.js +1 -0
- package/src/utils/index.js +1 -0
- package/src/utils/resolveContentMaxWidth.js +28 -0
- package/types/Listbox.d.ts +24 -0
- package/types/Shortcuts.d.ts +136 -0
- package/types/Status.d.ts +42 -0
- package/types/index.d.ts +15 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react'
|
|
2
|
+
import type { IconVariant } from './Icon'
|
|
3
|
+
|
|
4
|
+
export interface ShortcutsProps {
|
|
5
|
+
/**
|
|
6
|
+
* ShortcutsItem components to render as shortcuts.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode
|
|
9
|
+
/**
|
|
10
|
+
* Shortcuts variant options.
|
|
11
|
+
*/
|
|
12
|
+
variant?: ShortcutsVariant
|
|
13
|
+
/**
|
|
14
|
+
* Custom tokens for styling the Shortcuts container.
|
|
15
|
+
*/
|
|
16
|
+
tokens?: ShortcutsTokens
|
|
17
|
+
/**
|
|
18
|
+
* Hide labels for all shortcuts items globally.
|
|
19
|
+
* Can be overridden by individual ShortcutsItem hideLabel prop.
|
|
20
|
+
*/
|
|
21
|
+
hideLabels?: boolean
|
|
22
|
+
/**
|
|
23
|
+
* Icon variant to apply to all shortcuts items.
|
|
24
|
+
* Can be overridden by individual ShortcutsItem iconVariant prop.
|
|
25
|
+
*/
|
|
26
|
+
iconVariant?: IconVariant
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type ShortcutsVariant = {
|
|
30
|
+
/**
|
|
31
|
+
* Width distribution of shortcuts items.
|
|
32
|
+
* - 'equal': All items have equal width (default)
|
|
33
|
+
* - 'dynamic': Items size based on content
|
|
34
|
+
*/
|
|
35
|
+
width?: 'equal' | 'dynamic'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ShortcutsTokens {
|
|
39
|
+
mainContainerGap?: number
|
|
40
|
+
mainContainerPaddingHorizontal?: number
|
|
41
|
+
mainContainerPaddingVertical?: number
|
|
42
|
+
itemContainerMinHeight?: number
|
|
43
|
+
itemContainerPaddingHorizontal?: number
|
|
44
|
+
itemContainerPaddingVertical?: number
|
|
45
|
+
itemContainerBackgroundColor?: string
|
|
46
|
+
itemContainerBorderRadius?: number
|
|
47
|
+
labelFontColor?: string
|
|
48
|
+
labelFontSize?: number
|
|
49
|
+
labelFontWeight?: number
|
|
50
|
+
labelLineHeight?: number
|
|
51
|
+
labelMarginTop?: number
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface ShortcutsItemProps {
|
|
55
|
+
/**
|
|
56
|
+
* Label text for the shortcut item.
|
|
57
|
+
*/
|
|
58
|
+
label: string
|
|
59
|
+
/**
|
|
60
|
+
* Icon component to display.
|
|
61
|
+
*/
|
|
62
|
+
icon?: ComponentType<any>
|
|
63
|
+
/**
|
|
64
|
+
* Image to display instead of icon.
|
|
65
|
+
*/
|
|
66
|
+
image?: ShortcutsItemImage
|
|
67
|
+
/**
|
|
68
|
+
* URL to navigate to when pressed.
|
|
69
|
+
*/
|
|
70
|
+
href?: string
|
|
71
|
+
/**
|
|
72
|
+
* Function to call when the item is pressed.
|
|
73
|
+
*/
|
|
74
|
+
onPress?: () => void
|
|
75
|
+
/**
|
|
76
|
+
* Hide the label for this specific item.
|
|
77
|
+
* Overrides parent Shortcuts hideLabels prop.
|
|
78
|
+
*/
|
|
79
|
+
hideLabel?: boolean
|
|
80
|
+
/**
|
|
81
|
+
* Icon variant for this specific item.
|
|
82
|
+
* Overrides parent Shortcuts iconVariant prop.
|
|
83
|
+
*/
|
|
84
|
+
iconVariant?: IconVariant
|
|
85
|
+
/**
|
|
86
|
+
* Custom tokens for styling this item.
|
|
87
|
+
*/
|
|
88
|
+
tokens?: ShortcutsItemTokens
|
|
89
|
+
/**
|
|
90
|
+
* Variant options for this item.
|
|
91
|
+
*/
|
|
92
|
+
variant?: ShortcutsItemVariant
|
|
93
|
+
/**
|
|
94
|
+
* Callback function that receives the pressable state.
|
|
95
|
+
* Can be used to dynamically set iconVariant based on press state.
|
|
96
|
+
*/
|
|
97
|
+
onPressableStateChange?: (state: PressableState) => IconVariant | void
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type ShortcutsItemImage = {
|
|
101
|
+
src: string
|
|
102
|
+
alt: string
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export type ShortcutsItemVariant = {
|
|
106
|
+
/**
|
|
107
|
+
* Whether the item is in a pressed state.
|
|
108
|
+
*/
|
|
109
|
+
pressed?: boolean
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface ShortcutsItemTokens {
|
|
113
|
+
containerMinHeight?: number
|
|
114
|
+
containerPaddingHorizontal?: number
|
|
115
|
+
containerPaddingVertical?: number
|
|
116
|
+
containerBackgroundColor?: string
|
|
117
|
+
containerBorderRadius?: number
|
|
118
|
+
labelFontColor?: string
|
|
119
|
+
labelFontSize?: number
|
|
120
|
+
labelFontWeight?: number
|
|
121
|
+
labelLineHeight?: number
|
|
122
|
+
labelMarginTop?: number
|
|
123
|
+
iconSize?: number
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type PressableState = {
|
|
127
|
+
pressed: boolean
|
|
128
|
+
hovered?: boolean
|
|
129
|
+
focused?: boolean
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
declare const Shortcuts: ComponentType<ShortcutsProps>
|
|
133
|
+
declare const ShortcutsItem: ComponentType<ShortcutsItemProps>
|
|
134
|
+
|
|
135
|
+
export { Shortcuts, ShortcutsItem }
|
|
136
|
+
export default Shortcuts
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Variant } from '../../components-web/types/common'
|
|
2
|
+
import { ComponentType, ReactNode } from 'react'
|
|
3
|
+
|
|
4
|
+
import { IconProps } from './Icon'
|
|
5
|
+
|
|
6
|
+
export type StatusTokensProps = {
|
|
7
|
+
backgroundColor: string
|
|
8
|
+
backgroundGradient: string
|
|
9
|
+
borderColor: string
|
|
10
|
+
borderRadius: number | string
|
|
11
|
+
borderWidth: number | string
|
|
12
|
+
fontName: string
|
|
13
|
+
fontSize: number | string
|
|
14
|
+
fontWeight: number | string
|
|
15
|
+
icon: IconProps
|
|
16
|
+
iconColor: string
|
|
17
|
+
iconGradient: string
|
|
18
|
+
marginLeft: string | number
|
|
19
|
+
paddingBottom: string | number
|
|
20
|
+
paddingLeft: string | number
|
|
21
|
+
paddingRight: string | number
|
|
22
|
+
paddingTop: string | number
|
|
23
|
+
textColor: string
|
|
24
|
+
textLineHeight: string | number
|
|
25
|
+
iconSize: number | string
|
|
26
|
+
iconPaddingTop: number | string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface StatusProps {
|
|
30
|
+
children: ReactNode
|
|
31
|
+
variant?: Variant
|
|
32
|
+
tokens?: Partial<StatusTokensProps>
|
|
33
|
+
customGradient?: (
|
|
34
|
+
gradient: { colors: string[]; start: { x: number; y: number }; end: { x: number; y: number } },
|
|
35
|
+
styles: Record<string, unknown>,
|
|
36
|
+
content: ReactNode
|
|
37
|
+
) => ReactNode
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare const Status: ComponentType<StatusProps>
|
|
41
|
+
|
|
42
|
+
export default Status
|
package/types/index.d.ts
CHANGED
|
@@ -51,6 +51,18 @@ export { SearchTokens, SearchProps } from './Search'
|
|
|
51
51
|
export { default as Select } from './Select'
|
|
52
52
|
export { SelectTokens, SelectProps, SelectItemProps, SelectGroupProps } from './Select'
|
|
53
53
|
|
|
54
|
+
export { default as Shortcuts, ShortcutsItem } from './Shortcuts'
|
|
55
|
+
export {
|
|
56
|
+
ShortcutsProps,
|
|
57
|
+
ShortcutsTokens,
|
|
58
|
+
ShortcutsVariant,
|
|
59
|
+
ShortcutsItemProps,
|
|
60
|
+
ShortcutsItemTokens,
|
|
61
|
+
ShortcutsItemVariant,
|
|
62
|
+
ShortcutsItemImage,
|
|
63
|
+
PressableState
|
|
64
|
+
} from './Shortcuts'
|
|
65
|
+
|
|
54
66
|
export { default as Spacer } from './Spacer'
|
|
55
67
|
export { SpacerProps } from './Spacer'
|
|
56
68
|
|
|
@@ -78,4 +90,7 @@ export { PortalProps } from './Portal'
|
|
|
78
90
|
export { default as Listbox } from './Listbox'
|
|
79
91
|
export { ListboxProps, ListboxTokens } from './Listbox'
|
|
80
92
|
|
|
93
|
+
export { default as Status } from './Status'
|
|
94
|
+
export { StatusProps, StatusTokensProps } from './Status'
|
|
95
|
+
|
|
81
96
|
export * from './Common'
|