@lumx/core 4.3.2-alpha.13 → 4.3.2-alpha.14
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/js/constants/enums/index.d.ts +9 -0
- package/js/constants/enums/index.js +10 -1
- package/js/constants/index.js +1 -1
- package/js/types/PartialBy.d.ts +12 -0
- package/js/types/index.d.ts +1 -0
- package/js/types/index.js +1 -0
- package/js/utils/classNames/bem/block.d.ts +3 -2
- package/js/utils/classNames/bem/element.d.ts +3 -2
- package/js/utils/classNames/bem/index.d.ts +5 -4
- package/js/utils/disabledState/index.js +12 -0
- package/js/utils/events/index.js +2 -0
- package/lumx.css +94 -0
- package/package.json +2 -23
- package/scss/_components.scss +1 -0
- package/scss/components/combobox/_index.scss +86 -0
- package/scss/components/combobox/_mixins.scss +63 -0
- package/scss/lumx.scss +1 -0
- package/js/components/Badge/BadgeWrapper.d.ts +0 -13
- package/js/components/Badge/BadgeWrapperStories.d.ts +0 -29
- package/js/components/Badge/BadgeWrapperTests.d.ts +0 -9
- package/js/components/Badge/Stories.d.ts +0 -52
- package/js/components/Badge/Tests.d.ts +0 -12
- package/js/components/Badge/index.d.ts +0 -37
- package/js/components/Button/Button.d.ts +0 -48
- package/js/components/Button/ButtonGroup.d.ts +0 -36
- package/js/components/Button/ButtonGroupStories.d.ts +0 -37
- package/js/components/Button/ButtonRoot.d.ts +0 -55
- package/js/components/Button/ButtonRootTests.d.ts +0 -12
- package/js/components/Button/IconButton.d.ts +0 -45
- package/js/components/Button/IconButtonStories.d.ts +0 -211
- package/js/components/Button/IconButtonTests.d.ts +0 -15
- package/js/components/Button/Stories.d.ts +0 -301
- package/js/components/Button/Tests.d.ts +0 -15
- package/js/components/Checkbox/Stories.d.ts +0 -88
- package/js/components/Checkbox/Tests.d.ts +0 -15
- package/js/components/Checkbox/index.d.ts +0 -49
- package/js/components/Divider/Stories.d.ts +0 -21
- package/js/components/Divider/Tests.d.ts +0 -12
- package/js/components/Divider/index.d.ts +0 -27
- package/js/components/Flag/Stories.d.ts +0 -120
- package/js/components/Flag/Tests.d.ts +0 -14
- package/js/components/Flag/index.d.ts +0 -34
- package/js/components/FlexBox/Stories.d.ts +0 -108
- package/js/components/FlexBox/Tests.d.ts +0 -13
- package/js/components/FlexBox/constants.d.ts +0 -4
- package/js/components/FlexBox/index.d.ts +0 -50
- package/js/components/FlexBox/types.d.ts +0 -7
- package/js/components/Heading/Stories.d.ts +0 -89
- package/js/components/Heading/Tests.d.ts +0 -11
- package/js/components/Heading/constants.d.ts +0 -21
- package/js/components/Heading/index.d.ts +0 -44
- package/js/components/Heading/utils.d.ts +0 -8
- package/js/components/Icon/Stories.d.ts +0 -150
- package/js/components/Icon/Tests.d.ts +0 -14
- package/js/components/Icon/constants.d.ts +0 -1
- package/js/components/Icon/index.d.ts +0 -41
- package/js/components/InputHelper/Stories.d.ts +0 -43
- package/js/components/InputHelper/Tests.d.ts +0 -12
- package/js/components/InputHelper/constants.d.ts +0 -3
- package/js/components/InputHelper/index.d.ts +0 -26
- package/js/components/InputLabel/Stories.d.ts +0 -34
- package/js/components/InputLabel/Tests.d.ts +0 -12
- package/js/components/InputLabel/index.d.ts +0 -25
- package/js/components/Link/Stories.d.ts +0 -93
- package/js/components/Link/Tests.d.ts +0 -15
- package/js/components/Link/index.d.ts +0 -54
- package/js/components/Message/Stories.d.ts +0 -119
- package/js/components/Message/Tests.d.ts +0 -14
- package/js/components/Message/index.d.ts +0 -75
- package/js/components/RadioButton/Stories.d.ts +0 -77
- package/js/components/RadioButton/Tests.d.ts +0 -15
- package/js/components/RadioButton/index.d.ts +0 -45
- package/js/components/RawClickable/Tests.d.ts +0 -14
- package/js/components/RawClickable/index.d.ts +0 -13
- package/js/components/Skeleton/SkeletonCircle.d.ts +0 -32
- package/js/components/Skeleton/SkeletonCircleStories.d.ts +0 -45
- package/js/components/Skeleton/SkeletonCircleTests.d.ts +0 -12
- package/js/components/Skeleton/SkeletonRectangle.d.ts +0 -47
- package/js/components/Skeleton/SkeletonRectangleStories.d.ts +0 -87
- package/js/components/Skeleton/SkeletonRectangleTests.d.ts +0 -13
- package/js/components/Skeleton/SkeletonTypography.d.ts +0 -37
- package/js/components/Skeleton/SkeletonTypographyStories.d.ts +0 -40
- package/js/components/Skeleton/SkeletonTypographyTests.d.ts +0 -13
- package/js/components/Skeleton/index.d.ts +0 -3
- package/js/components/Switch/Stories.d.ts +0 -94
- package/js/components/Switch/Tests.d.ts +0 -15
- package/js/components/Switch/index.d.ts +0 -47
- package/js/components/Table/Stories.d.ts +0 -25
- package/js/components/Table/TableCell.d.ts +0 -55
- package/js/components/Table/TableCellStories.d.ts +0 -44
- package/js/components/Table/TableCellTests.d.ts +0 -11
- package/js/components/Table/TableRowStories.d.ts +0 -23
- package/js/components/Table/Tests.d.ts +0 -11
- package/js/components/Table/constants.d.ts +0 -9
- package/js/components/Table/index.d.ts +0 -27
- package/js/components/Text/Stories.d.ts +0 -167
- package/js/components/Text/Tests.d.ts +0 -10
- package/js/components/Text/index.d.ts +0 -935
- package/js/components/Thumbnail/Stories.d.ts +0 -168
- package/js/components/Thumbnail/Tests.d.ts +0 -11
- package/js/components/Thumbnail/index.d.ts +0 -84
- package/js/components/Thumbnail/types.d.ts +0 -45
- package/js/components/Thumbnail/utils.d.ts +0 -79
- package/stories/controls/color.d.ts +0 -15
- package/stories/controls/element.d.ts +0 -16
- package/stories/controls/focusPoint.d.ts +0 -8
- package/stories/controls/icons.d.ts +0 -66
- package/stories/controls/image.d.ts +0 -96
- package/stories/controls/selectArgType.d.ts +0 -7
- package/stories/controls/theme.d.ts +0 -7
- package/stories/controls/typography.d.ts +0 -8
- package/stories/controls/withUndefined.d.ts +0 -1
- package/stories/types.d.ts +0 -47
- package/stories/utils/combinations.d.ts +0 -100
- package/stories/utils/concatPath.d.ts +0 -10
- package/stories/utils/disableArgTypes.d.ts +0 -7
- package/stories/utils/initDemoShadowDOMPortal.d.ts +0 -5
- package/stories/utils/lorem.d.ts +0 -7
- package/stories/utils/toFlattenProps.d.ts +0 -12
- package/stories/utils/withCategory.d.ts +0 -4
- package/testing/commonTestsSuiteTL.d.ts +0 -87
- package/testing/index.d.ts +0 -1
- package/testing/queries.d.ts +0 -4
|
@@ -198,3 +198,12 @@ export declare const ColorVariant: {
|
|
|
198
198
|
export type ColorVariant = ValueOf<typeof ColorVariant>;
|
|
199
199
|
/** ColorPalette with all possible color variant combination */
|
|
200
200
|
export type ColorWithVariants = ColorPalette | Exclude<`${ColorPalette}-${ColorVariant}`, `light-D${number}` | `dark-D${number}`>;
|
|
201
|
+
export declare const REAL_SIZE_FOR_LUMX_SIZE: {
|
|
202
|
+
xxs: number;
|
|
203
|
+
xs: number;
|
|
204
|
+
s: number;
|
|
205
|
+
m: number;
|
|
206
|
+
l: number;
|
|
207
|
+
xl: number;
|
|
208
|
+
xxl: number;
|
|
209
|
+
};
|
|
@@ -151,5 +151,14 @@ const ColorVariant = {
|
|
|
151
151
|
L6: 'L6',
|
|
152
152
|
N: 'N',
|
|
153
153
|
};
|
|
154
|
+
const REAL_SIZE_FOR_LUMX_SIZE = {
|
|
155
|
+
[Size.xxs]: 14,
|
|
156
|
+
[Size.xs]: 20,
|
|
157
|
+
[Size.s]: 24,
|
|
158
|
+
[Size.m]: 36,
|
|
159
|
+
[Size.l]: 64,
|
|
160
|
+
[Size.xl]: 128,
|
|
161
|
+
[Size.xxl]: 256,
|
|
162
|
+
};
|
|
154
163
|
|
|
155
|
-
export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace };
|
|
164
|
+
export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, REAL_SIZE_FOR_LUMX_SIZE, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace };
|
package/js/constants/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { BACKSPACE_KEY_CODE, DOWN_KEY_CODE, ENTER_KEY_CODE, ESCAPE_KEY_CODE, LEFT_KEY_CODE, RIGHT_KEY_CODE, SPACE_KEY_CODE, TAB_KEY_CODE, UP_KEY_CODE } from './keycodes/index.js';
|
|
2
2
|
export { DIALOG_TRANSITION_DURATION, EXPANSION_PANEL_TRANSITION_DURATION, NOTIFICATION_TRANSITION_DURATION, SLIDESHOW_TRANSITION_DURATION, TOOLTIP_HOVER_DELAY, TOOLTIP_LONG_PRESS_DELAY } from './components/index.js';
|
|
3
|
-
export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace } from './enums/index.js';
|
|
3
|
+
export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, REAL_SIZE_FOR_LUMX_SIZE, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace } from './enums/index.js';
|
|
4
4
|
export { VISUALLY_HIDDEN } from './className/index.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same as `Partial` but for one property only.
|
|
3
|
+
*
|
|
4
|
+
* @example PartialBy<Foo, 'bar'> => produces a type almost identical to `Foo` but with the `bar` property as optional.
|
|
5
|
+
*/
|
|
6
|
+
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
7
|
+
/**
|
|
8
|
+
* Same as `Partial` but for all except some properties only.
|
|
9
|
+
*
|
|
10
|
+
* @example PartialExcept<Foo, 'bar'> => produces a type almost identical to `Foo` but with the `bar` property as it is on the original type.
|
|
11
|
+
*/
|
|
12
|
+
export type PartialExcept<T, K extends keyof T> = Pick<T, K> & Partial<Omit<T, K>>;
|
package/js/types/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ClassValue } from 'classnames/types';
|
|
1
2
|
import { type Modifier } from './modifier';
|
|
2
3
|
/**
|
|
3
4
|
* Generates a BEM block + modifier class name string.
|
|
@@ -11,5 +12,5 @@ import { type Modifier } from './modifier';
|
|
|
11
12
|
* block('button'); // 'button'
|
|
12
13
|
* block('button', { active: true, disabled: false }); // 'button button--active'
|
|
13
14
|
*/
|
|
14
|
-
export declare function block(baseName: string, additionalClasses:
|
|
15
|
-
export declare function block(baseName: string, modifiers?: Modifier, additionalClasses?:
|
|
15
|
+
export declare function block(baseName: string, additionalClasses: ClassValue[]): string;
|
|
16
|
+
export declare function block(baseName: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ClassValue } from 'classnames/types';
|
|
1
2
|
import type { Modifier } from './modifier';
|
|
2
3
|
/**
|
|
3
4
|
* Creates a BEM element class generator function for the given base class.
|
|
@@ -12,5 +13,5 @@ import type { Modifier } from './modifier';
|
|
|
12
13
|
* element('my-button', 'icon'); // 'my-button__icon'
|
|
13
14
|
* element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
|
|
14
15
|
*/
|
|
15
|
-
export declare function element(baseClass: string, elem: string, additionalClasses:
|
|
16
|
-
export declare function element(baseClass: string, elem: string, modifiers?: Modifier, additionalClasses?:
|
|
16
|
+
export declare function element(baseClass: string, elem: string, additionalClasses: ClassValue[]): string;
|
|
17
|
+
export declare function element(baseClass: string, elem: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ClassValue } from 'classnames/types';
|
|
1
2
|
import { block } from './block';
|
|
2
3
|
import { element } from './element';
|
|
3
4
|
import { type Modifier } from './modifier';
|
|
@@ -6,12 +7,12 @@ import { type Modifier } from './modifier';
|
|
|
6
7
|
*/
|
|
7
8
|
export declare function bem(baseName: string): {
|
|
8
9
|
block: {
|
|
9
|
-
(additionalClasses:
|
|
10
|
-
(modifiers?: Modifier, additionalClasses?:
|
|
10
|
+
(additionalClasses: ClassValue[]): string;
|
|
11
|
+
(modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
|
|
11
12
|
};
|
|
12
13
|
element: {
|
|
13
|
-
(elem: string, additionalClasses:
|
|
14
|
-
(elem: string, modifiers?: Modifier, additionalClasses?:
|
|
14
|
+
(elem: string, additionalClasses: ClassValue[]): string;
|
|
15
|
+
(elem: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
|
|
15
16
|
};
|
|
16
17
|
modifier: (modifiers: Modifier) => string;
|
|
17
18
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate the disabled state based on context and props.
|
|
3
|
+
*/
|
|
4
|
+
function getDisabledState(context, props) {
|
|
5
|
+
const { disabled, isDisabled = disabled, 'aria-disabled': ariaDisabled } = props;
|
|
6
|
+
return {
|
|
7
|
+
disabled: context?.state === 'disabled' || !!isDisabled,
|
|
8
|
+
'aria-disabled': ariaDisabled === true || ariaDisabled === 'true',
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { getDisabledState };
|
package/lumx.css
CHANGED
|
@@ -685,6 +685,18 @@
|
|
|
685
685
|
* List of deprecated v2 variables that have been removed or renamed.
|
|
686
686
|
* Warning: These will be removed in the next major version.
|
|
687
687
|
*/
|
|
688
|
+
/**
|
|
689
|
+
* Add styles before & after an element while avoiding having a "before" section display if an "after" section was
|
|
690
|
+
displayed.
|
|
691
|
+
*/
|
|
692
|
+
/**
|
|
693
|
+
* Automatic divider between elements of a list using border before and after the element
|
|
694
|
+
*
|
|
695
|
+
* @param $orientation Required 'vertical'/'horizontal' orientation
|
|
696
|
+
* @param $selector Optional element selector to apply to (default to parent '&' selector)
|
|
697
|
+
* @param $theme Optional 'theme-light'/'theme-dark' (defaults to 'theme-light')
|
|
698
|
+
* @param $spacing Optional spacing around dividers (defaults to $lumx-spacing-unit-regular)
|
|
699
|
+
*/
|
|
688
700
|
/* stylelint-disable custom-property-pattern */
|
|
689
701
|
/** @deprecated: replaced with $lumx-progress-circular-size-map */
|
|
690
702
|
/**
|
|
@@ -5057,6 +5069,88 @@ table {
|
|
|
5057
5069
|
width: 100%;
|
|
5058
5070
|
}
|
|
5059
5071
|
|
|
5072
|
+
/* ==========================================================================
|
|
5073
|
+
Combobox Divider
|
|
5074
|
+
========================================================================== */
|
|
5075
|
+
.lumx-combobox-divider:last-child, .lumx-combobox-divider:first-child {
|
|
5076
|
+
display: none;
|
|
5077
|
+
}
|
|
5078
|
+
|
|
5079
|
+
/* ==========================================================================
|
|
5080
|
+
Combobox Option
|
|
5081
|
+
========================================================================== */
|
|
5082
|
+
.lumx-combobox-option {
|
|
5083
|
+
position: relative;
|
|
5084
|
+
}
|
|
5085
|
+
.lumx-combobox-option__content {
|
|
5086
|
+
gap: 0;
|
|
5087
|
+
}
|
|
5088
|
+
.lumx-combobox-option__content--is-disabled {
|
|
5089
|
+
opacity: 0.5;
|
|
5090
|
+
}
|
|
5091
|
+
.lumx-combobox-option__trigger {
|
|
5092
|
+
color: rgba(0, 0, 0, 0.87);
|
|
5093
|
+
text-decoration: none;
|
|
5094
|
+
overflow: hidden;
|
|
5095
|
+
overflow-wrap: break-word;
|
|
5096
|
+
}
|
|
5097
|
+
.lumx-combobox-option__trigger::before {
|
|
5098
|
+
content: "";
|
|
5099
|
+
cursor: pointer;
|
|
5100
|
+
position: absolute;
|
|
5101
|
+
left: 0;
|
|
5102
|
+
bottom: 0;
|
|
5103
|
+
right: 0;
|
|
5104
|
+
top: 0;
|
|
5105
|
+
z-index: 2;
|
|
5106
|
+
}
|
|
5107
|
+
.lumx-combobox-option__after {
|
|
5108
|
+
z-index: 3;
|
|
5109
|
+
}
|
|
5110
|
+
|
|
5111
|
+
/* ==========================================================================
|
|
5112
|
+
Combobox Listbox
|
|
5113
|
+
========================================================================== */
|
|
5114
|
+
.lumx-combobox-listbox:empty {
|
|
5115
|
+
padding: 0;
|
|
5116
|
+
}
|
|
5117
|
+
.lumx-combobox-listbox__state {
|
|
5118
|
+
text-align: center;
|
|
5119
|
+
margin: 8px;
|
|
5120
|
+
}
|
|
5121
|
+
|
|
5122
|
+
/* ==========================================================================
|
|
5123
|
+
Combobox Option more Info
|
|
5124
|
+
========================================================================== */
|
|
5125
|
+
.lumx-combobox-option-more-info__popover {
|
|
5126
|
+
padding: 16px;
|
|
5127
|
+
max-width: 256px;
|
|
5128
|
+
}
|
|
5129
|
+
|
|
5130
|
+
/* ==========================================================================
|
|
5131
|
+
Combobox Section
|
|
5132
|
+
========================================================================== */
|
|
5133
|
+
.lumx-combobox-section:not(:first-child):not(.lumx-combobox-section + .lumx-combobox-section):not(.visually-hidden + .lumx-combobox-section)::before {
|
|
5134
|
+
content: "";
|
|
5135
|
+
display: block;
|
|
5136
|
+
height: 1px;
|
|
5137
|
+
margin: 0;
|
|
5138
|
+
border: none;
|
|
5139
|
+
background-color: var(--lumx-color-dark-L5);
|
|
5140
|
+
margin-top: 8px;
|
|
5141
|
+
margin-bottom: 8px;
|
|
5142
|
+
}
|
|
5143
|
+
.lumx-combobox-section:not(:last-child):not(:has(+ .visually-hidden)):not(:has(+ [aria-hidden=true]))::after {
|
|
5144
|
+
content: "";
|
|
5145
|
+
display: block;
|
|
5146
|
+
height: 1px;
|
|
5147
|
+
margin: 0;
|
|
5148
|
+
border: none;
|
|
5149
|
+
background-color: var(--lumx-color-dark-L5);
|
|
5150
|
+
margin-top: 8px;
|
|
5151
|
+
margin-bottom: 8px;
|
|
5152
|
+
}
|
|
5153
|
+
|
|
5060
5154
|
/* ==========================================================================
|
|
5061
5155
|
Checkbox
|
|
5062
5156
|
========================================================================== */
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/lumapps/design-system/issues"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@lumx/icons": "^4.3.2-alpha.
|
|
9
|
+
"@lumx/icons": "^4.3.2-alpha.14",
|
|
10
10
|
"classnames": "^2.3.2",
|
|
11
11
|
"focus-visible": "^5.0.2",
|
|
12
12
|
"lodash": "4.17.23",
|
|
@@ -22,27 +22,6 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"type": "module",
|
|
24
24
|
"name": "@lumx/core",
|
|
25
|
-
"exports": {
|
|
26
|
-
"./js/constants": {
|
|
27
|
-
"default": "./js/constants/index.js",
|
|
28
|
-
"types": "./js/constants/index.d.ts"
|
|
29
|
-
},
|
|
30
|
-
"./js/types": {
|
|
31
|
-
"types": "./js/types/index.d.ts"
|
|
32
|
-
},
|
|
33
|
-
"./js/utils/classNames": {
|
|
34
|
-
"default": "./js/utils/classNames/index.js",
|
|
35
|
-
"types": "./js/utils/classNames/index.d.ts"
|
|
36
|
-
},
|
|
37
|
-
"./js/utils/selectors": {
|
|
38
|
-
"default": "./js/utils/selectors/index.js",
|
|
39
|
-
"types": "./js/utils/selectors/index.d.ts"
|
|
40
|
-
},
|
|
41
|
-
"./js/utils": {
|
|
42
|
-
"default": "./js/utils/index.js",
|
|
43
|
-
"types": "./js/utils/index.d.ts"
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
25
|
"publishConfig": {
|
|
47
26
|
"directory": "dist"
|
|
48
27
|
},
|
|
@@ -58,7 +37,7 @@
|
|
|
58
37
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
59
38
|
},
|
|
60
39
|
"sideEffects": false,
|
|
61
|
-
"version": "4.3.2-alpha.
|
|
40
|
+
"version": "4.3.2-alpha.14",
|
|
62
41
|
"devDependencies": {
|
|
63
42
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
64
43
|
"@testing-library/dom": "^10.4.1",
|
package/scss/_components.scss
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@import "./components/checkbox/mixins";
|
|
4
4
|
@import "./components/chip/variables";
|
|
5
5
|
@import "./components/chip/mixins";
|
|
6
|
+
@import "./components/combobox/mixins";
|
|
6
7
|
@import "./components/dialog/variables";
|
|
7
8
|
@import "./components/divider/variables";
|
|
8
9
|
@import "./components/divider/mixins";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Combobox Divider
|
|
3
|
+
========================================================================== */
|
|
4
|
+
|
|
5
|
+
.#{$lumx-base-prefix}-combobox-divider {
|
|
6
|
+
// Hide if first or last in list
|
|
7
|
+
&:last-child,
|
|
8
|
+
&:first-child {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* ==========================================================================
|
|
14
|
+
Combobox Option
|
|
15
|
+
========================================================================== */
|
|
16
|
+
|
|
17
|
+
.#{$lumx-base-prefix}-combobox-option {
|
|
18
|
+
position: relative;
|
|
19
|
+
|
|
20
|
+
&__content {
|
|
21
|
+
// TODO: migrate away from using lumx-list-item styles https://lumapps.atlassian.net/browse/DSW-288
|
|
22
|
+
gap: 0;
|
|
23
|
+
|
|
24
|
+
&--is-disabled {
|
|
25
|
+
opacity: .5;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&__trigger {
|
|
30
|
+
color: $lumx-color-dark-N;
|
|
31
|
+
text-decoration: none;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
overflow-wrap: break-word;
|
|
34
|
+
|
|
35
|
+
// Make the whole item clickable
|
|
36
|
+
&::before {
|
|
37
|
+
content: '';
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
position: absolute;
|
|
40
|
+
left: 0;
|
|
41
|
+
bottom: 0;
|
|
42
|
+
right: 0;
|
|
43
|
+
top: 0;
|
|
44
|
+
z-index: 2;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&__after {
|
|
49
|
+
z-index: 3;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ==========================================================================
|
|
54
|
+
Combobox Listbox
|
|
55
|
+
========================================================================== */
|
|
56
|
+
|
|
57
|
+
.#{$lumx-base-prefix}-combobox-listbox {
|
|
58
|
+
&:empty {
|
|
59
|
+
padding: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&__state {
|
|
63
|
+
text-align: center;
|
|
64
|
+
margin: $lumx-spacing-unit-regular;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ==========================================================================
|
|
69
|
+
Combobox Option more Info
|
|
70
|
+
========================================================================== */
|
|
71
|
+
|
|
72
|
+
.#{$lumx-base-prefix}-combobox-option-more-info {
|
|
73
|
+
&__popover {
|
|
74
|
+
padding: $lumx-spacing-unit-big;
|
|
75
|
+
max-width: $lumx-size-xxl;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
/* ==========================================================================
|
|
81
|
+
Combobox Section
|
|
82
|
+
========================================================================== */
|
|
83
|
+
|
|
84
|
+
.#{$lumx-base-prefix}-combobox-section {
|
|
85
|
+
@include auto-list-divider($orientation: 'vertical');
|
|
86
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add styles before & after an element while avoiding having a "before" section display if an "after" section was
|
|
3
|
+
displayed.
|
|
4
|
+
*/
|
|
5
|
+
@mixin between($selector) {
|
|
6
|
+
&:not(:first-child):not(#{$selector} + #{$selector}):not(.visually-hidden + #{$selector}) {
|
|
7
|
+
@content('before')
|
|
8
|
+
}
|
|
9
|
+
&:not(:last-child):not(:has(+ .visually-hidden)):not(:has(+ [aria-hidden=true])) {
|
|
10
|
+
@content('after')
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@mixin vertical-divider($color: 'theme-light') {
|
|
15
|
+
@include lumx-divider($color);
|
|
16
|
+
height: 20px;
|
|
17
|
+
margin: auto 0;
|
|
18
|
+
width: 1px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Automatic divider between elements of a list using border before and after the element
|
|
23
|
+
*
|
|
24
|
+
* @param $orientation Required 'vertical'/'horizontal' orientation
|
|
25
|
+
* @param $selector Optional element selector to apply to (default to parent '&' selector)
|
|
26
|
+
* @param $theme Optional 'theme-light'/'theme-dark' (defaults to 'theme-light')
|
|
27
|
+
* @param $spacing Optional spacing around dividers (defaults to $lumx-spacing-unit-regular)
|
|
28
|
+
*/
|
|
29
|
+
@mixin auto-list-divider($orientation, $selector: &, $theme: 'theme-light', $spacing: $lumx-spacing-unit-regular) {
|
|
30
|
+
$start: if($orientation == 'vertical', 'top', 'left');
|
|
31
|
+
$end: if($orientation == 'vertical', 'bottom', 'right');
|
|
32
|
+
|
|
33
|
+
@include between($selector) using($position) {
|
|
34
|
+
@if $position == 'before' {
|
|
35
|
+
&::before {
|
|
36
|
+
content: '';
|
|
37
|
+
display: block;
|
|
38
|
+
@if $orientation == 'horizontal' {
|
|
39
|
+
@include vertical-divider($theme);
|
|
40
|
+
}
|
|
41
|
+
@if $orientation == 'vertical' {
|
|
42
|
+
@include lumx-divider($theme);
|
|
43
|
+
}
|
|
44
|
+
margin-#{$start}: $spacing;
|
|
45
|
+
margin-#{$end}: $spacing;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
@if $position == 'after' {
|
|
49
|
+
&::after {
|
|
50
|
+
content: '';
|
|
51
|
+
display: block;
|
|
52
|
+
@if $orientation == 'horizontal' {
|
|
53
|
+
@include vertical-divider($theme);
|
|
54
|
+
}
|
|
55
|
+
@if $orientation == 'vertical' {
|
|
56
|
+
@include lumx-divider($theme);
|
|
57
|
+
}
|
|
58
|
+
margin-#{$start}: $spacing;
|
|
59
|
+
margin-#{$end}: $spacing;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
package/scss/lumx.scss
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
@import "./components/avatar/index";
|
|
21
21
|
@import "./components/badge/index";
|
|
22
22
|
@import "./components/button/index";
|
|
23
|
+
@import "./components/combobox/index";
|
|
23
24
|
@import "./components/checkbox/index";
|
|
24
25
|
@import "./components/chip/index";
|
|
25
26
|
@import "./components/comment-block/index";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
|
-
export interface BadgeWrapperProps extends HasClassName {
|
|
3
|
-
/** Badge element to display */
|
|
4
|
-
badge?: JSXElement;
|
|
5
|
-
/** Content to wrap with badge */
|
|
6
|
-
children?: JSXElement;
|
|
7
|
-
/** Ref forwarding */
|
|
8
|
-
ref?: CommonRef;
|
|
9
|
-
}
|
|
10
|
-
export declare const COMPONENT_NAME = "BadgeWrapper";
|
|
11
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
12
|
-
export declare const DEFAULT_PROPS: Partial<BadgeWrapperProps>;
|
|
13
|
-
export declare const BadgeWrapper: (props: BadgeWrapperProps) => import("react").JSX.Element;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
export declare function setup({ component, render, overrides, }: SetupStoriesOptions<{
|
|
3
|
-
overrides: 'WithIcon' | 'WithButton';
|
|
4
|
-
decorators?: never;
|
|
5
|
-
}>): {
|
|
6
|
-
meta: {
|
|
7
|
-
component: any;
|
|
8
|
-
render: any;
|
|
9
|
-
argTypes: {
|
|
10
|
-
children: {
|
|
11
|
-
control: boolean;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
args: {
|
|
15
|
-
badge?: import("react").ReactNode;
|
|
16
|
-
children?: import("react").ReactNode;
|
|
17
|
-
ref?: import("../../types").CommonRef;
|
|
18
|
-
className?: string | undefined;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
/** Using badge wrapper with icon */
|
|
22
|
-
WithIcon: {
|
|
23
|
-
[x: string]: any;
|
|
24
|
-
};
|
|
25
|
-
/** Using badge wrapper with button */
|
|
26
|
-
WithButton: {
|
|
27
|
-
[x: string]: any;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SetupOptions } from '../../../testing';
|
|
2
|
-
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
3
|
-
props: any;
|
|
4
|
-
badgeWrapper: HTMLElement;
|
|
5
|
-
div: HTMLElement;
|
|
6
|
-
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
9
|
-
export default _default;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
import { ColorPalette } from '../../constants';
|
|
3
|
-
/**
|
|
4
|
-
* Setup Badge stories for a specific framework (React or Vue).
|
|
5
|
-
* This function creates all the stories with the appropriate decorators.
|
|
6
|
-
*/
|
|
7
|
-
export declare function setup({ component, render, decorators: { withCombinations }, overrides, }: SetupStoriesOptions<{
|
|
8
|
-
overrides: 'WithIcon';
|
|
9
|
-
decorators: 'withCombinations';
|
|
10
|
-
}>): {
|
|
11
|
-
meta: {
|
|
12
|
-
component: any;
|
|
13
|
-
render: any;
|
|
14
|
-
argTypes: {
|
|
15
|
-
color: {
|
|
16
|
-
control: {
|
|
17
|
-
type: "select" | "inline-radio";
|
|
18
|
-
};
|
|
19
|
-
options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined)[];
|
|
20
|
-
mapping: Record<string, "light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined> | undefined;
|
|
21
|
-
};
|
|
22
|
-
children: {
|
|
23
|
-
control: boolean;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
args: {
|
|
27
|
-
children?: import("react").ReactNode;
|
|
28
|
-
color?: ColorPalette | undefined;
|
|
29
|
-
ref?: import("../../types").CommonRef;
|
|
30
|
-
className?: string | undefined;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
/** Using badge with text children */
|
|
34
|
-
WithText: {
|
|
35
|
-
args: {
|
|
36
|
-
children: string;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
/** Using badge with icon children - Icon component provided via overrides */
|
|
40
|
-
WithIcon: {
|
|
41
|
-
[x: string]: any;
|
|
42
|
-
};
|
|
43
|
-
/** All combinations of colors and children types */
|
|
44
|
-
AllColors: {
|
|
45
|
-
argTypes: {
|
|
46
|
-
color: {
|
|
47
|
-
control: boolean;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
decorators: ((story: any, context: any) => any)[];
|
|
51
|
-
};
|
|
52
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SetupOptions } from '../../../testing';
|
|
2
|
-
/**
|
|
3
|
-
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
4
|
-
*/
|
|
5
|
-
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
6
|
-
props: any;
|
|
7
|
-
badge: HTMLElement;
|
|
8
|
-
div: HTMLElement;
|
|
9
|
-
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
10
|
-
};
|
|
11
|
-
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
12
|
-
export default _default;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ColorPalette } from '../../constants';
|
|
2
|
-
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
3
|
-
/**
|
|
4
|
-
* Defines the props of the component.
|
|
5
|
-
*/
|
|
6
|
-
export interface BadgeProps extends HasClassName {
|
|
7
|
-
/** Badge content. */
|
|
8
|
-
children?: JSXElement;
|
|
9
|
-
/** Color variant. */
|
|
10
|
-
color?: ColorPalette;
|
|
11
|
-
/** reference to the root element */
|
|
12
|
-
ref?: CommonRef;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Component display name.
|
|
16
|
-
*/
|
|
17
|
-
export declare const COMPONENT_NAME = "Badge";
|
|
18
|
-
/**
|
|
19
|
-
* Component default class name and class prefix.
|
|
20
|
-
*/
|
|
21
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
22
|
-
/**
|
|
23
|
-
* Component default props.
|
|
24
|
-
*/
|
|
25
|
-
export declare const DEFAULT_PROPS: Partial<BadgeProps>;
|
|
26
|
-
/**
|
|
27
|
-
* Badge component.
|
|
28
|
-
*
|
|
29
|
-
* @param props Component props.
|
|
30
|
-
* @return JSX element.
|
|
31
|
-
*/
|
|
32
|
-
export declare const Badge: {
|
|
33
|
-
(props: BadgeProps): import("react").JSX.Element;
|
|
34
|
-
displayName: string;
|
|
35
|
-
className: "lumx-badge";
|
|
36
|
-
defaultProps: Partial<BadgeProps>;
|
|
37
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { JSXElement, LumxClassName } from '../../types';
|
|
2
|
-
import { BaseButtonProps } from './ButtonRoot';
|
|
3
|
-
/**
|
|
4
|
-
* Button emphasis definition.
|
|
5
|
-
* @deprecated Use Emphasis instead.
|
|
6
|
-
*/
|
|
7
|
-
export declare const ButtonEmphasis: {
|
|
8
|
-
readonly low: "low";
|
|
9
|
-
readonly medium: "medium";
|
|
10
|
-
readonly high: "high";
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Defines the props of the component.
|
|
14
|
-
*/
|
|
15
|
-
export interface ButtonProps extends BaseButtonProps {
|
|
16
|
-
/** Left icon (SVG path). */
|
|
17
|
-
leftIcon?: string;
|
|
18
|
-
/** Right icon (SVG path). */
|
|
19
|
-
rightIcon?: string;
|
|
20
|
-
/** When `true`, the button gets as large as possible. */
|
|
21
|
-
fullWidth?: boolean;
|
|
22
|
-
/** Children */
|
|
23
|
-
children?: JSXElement;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Component display name.
|
|
27
|
-
*/
|
|
28
|
-
export declare const COMPONENT_NAME = "Button";
|
|
29
|
-
/**
|
|
30
|
-
* Component default class name and class prefix.
|
|
31
|
-
*/
|
|
32
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
33
|
-
/**
|
|
34
|
-
* Component default props.
|
|
35
|
-
*/
|
|
36
|
-
export declare const DEFAULT_PROPS: Partial<ButtonProps>;
|
|
37
|
-
/**
|
|
38
|
-
* Button component.
|
|
39
|
-
*
|
|
40
|
-
* @param props Component props.
|
|
41
|
-
* @return JSX element.
|
|
42
|
-
*/
|
|
43
|
-
export declare const Button: {
|
|
44
|
-
(props: ButtonProps): import("react").JSX.Element;
|
|
45
|
-
displayName: string;
|
|
46
|
-
className: "lumx-button";
|
|
47
|
-
defaultProps: Partial<ButtonProps>;
|
|
48
|
-
};
|