@lumx/core 4.3.2-alpha.0 → 4.3.2-alpha.1

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/CONTRIBUTING.md CHANGED
@@ -41,18 +41,6 @@ Before opening a Pull Request, please see the Submission Guidelines below.
41
41
  You can request a new feature by submitting an issue to our [GitHub Repository](https://github.com/lumapps/design-system/issues).
42
42
  If you would like to implement a new feature then consider what kind of change it is, discuss it with us before hand in your issue, so that we can better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project.
43
43
 
44
- ## <a name="create-a-new-react-component-"></a> Want to create a new React Component?
45
-
46
- The first step to create a new React component is to run:
47
-
48
- ```
49
- yarn scaffold
50
- ```
51
-
52
- This script will generate a TSX file for the component code, a TSX file for the component tests and an MDX file to demo this component.
53
-
54
- To export your component into the `@lumx/react` NPM package, you also have to make sure to update the `src/index.tsx` file.
55
-
56
44
  ## <a name="submission-guidelines"></a> Submission guidelines
57
45
 
58
46
  ### Submitting an issue
@@ -198,12 +198,3 @@ 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,14 +151,5 @@ 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
- };
163
154
 
164
- export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, REAL_SIZE_FOR_LUMX_SIZE, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace };
155
+ export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace };
@@ -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, REAL_SIZE_FOR_LUMX_SIZE, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace } from './enums/index.js';
3
+ export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace } from './enums/index.js';
4
4
  export { VISUALLY_HIDDEN } from './className/index.js';
@@ -0,0 +1,6 @@
1
+ export interface HasChecked<C = boolean> {
2
+ /** Component checked state. */
3
+ isChecked?: C;
4
+ /** @alias isChecked */
5
+ checked?: boolean;
6
+ }
@@ -0,0 +1,6 @@
1
+ export interface HasDisabled {
2
+ /** Whether the component is disabled or not. */
3
+ isDisabled?: boolean;
4
+ /** @alias isDisabled */
5
+ disabled?: boolean;
6
+ }
@@ -21,6 +21,7 @@ export type { HasRequiredLinkHref } from './HasRequiredLinkHref';
21
21
  export type { HasPolymorphicAs } from './HasPolymorphicAs';
22
22
  export type { CommonRef } from './CommonRef';
23
23
  export type { HasAriaDisabled } from './HasAriaDisabled';
24
+ export type { HasChecked } from './HasChecked';
25
+ export type { HasDisabled } from './HasDisabled';
24
26
  export type { AriaAttributes } from './AriaAttributes';
25
27
  export type { Selector } from './Selector';
26
- export type { PartialBy, PartialExcept } from './PartialBy';
@@ -1,4 +1,3 @@
1
- import { ClassValue } from 'classnames/types';
2
1
  import { type Modifier } from './modifier';
3
2
  /**
4
3
  * Generates a BEM block + modifier class name string.
@@ -12,5 +11,5 @@ import { type Modifier } from './modifier';
12
11
  * block('button'); // 'button'
13
12
  * block('button', { active: true, disabled: false }); // 'button button--active'
14
13
  */
15
- export declare function block(baseName: string, additionalClasses: ClassValue[]): string;
16
- export declare function block(baseName: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
14
+ export declare function block(baseName: string, additionalClasses: string[]): string;
15
+ export declare function block(baseName: string, modifiers?: Modifier, additionalClasses?: string[]): string;
@@ -1,4 +1,3 @@
1
- import { ClassValue } from 'classnames/types';
2
1
  import type { Modifier } from './modifier';
3
2
  /**
4
3
  * Creates a BEM element class generator function for the given base class.
@@ -13,5 +12,5 @@ import type { Modifier } from './modifier';
13
12
  * element('my-button', 'icon'); // 'my-button__icon'
14
13
  * element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
15
14
  */
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;
15
+ export declare function element(baseClass: string, elem: string, additionalClasses: string[]): string;
16
+ export declare function element(baseClass: string, elem: string, modifiers?: Modifier, additionalClasses?: string[]): string;
@@ -1,4 +1,3 @@
1
- import { ClassValue } from 'classnames/types';
2
1
  import { block } from './block';
3
2
  import { element } from './element';
4
3
  import { type Modifier } from './modifier';
@@ -7,12 +6,12 @@ import { type Modifier } from './modifier';
7
6
  */
8
7
  export declare function bem(baseName: string): {
9
8
  block: {
10
- (additionalClasses: ClassValue[]): string;
11
- (modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
9
+ (additionalClasses: string[]): string;
10
+ (modifiers?: Modifier, additionalClasses?: string[]): string;
12
11
  };
13
12
  element: {
14
- (elem: string, additionalClasses: ClassValue[]): string;
15
- (elem: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
13
+ (elem: string, additionalClasses: string[]): string;
14
+ (elem: string, modifiers?: Modifier, additionalClasses?: string[]): string;
16
15
  };
17
16
  modifier: (modifiers: Modifier) => string;
18
17
  };
package/lumx.css CHANGED
@@ -685,18 +685,6 @@
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
- */
700
688
  /* stylelint-disable custom-property-pattern */
701
689
  /** @deprecated: replaced with $lumx-progress-circular-size-map */
702
690
  /**
@@ -5069,88 +5057,6 @@ table {
5069
5057
  width: 100%;
5070
5058
  }
5071
5059
 
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
-
5154
5060
  /* ==========================================================================
5155
5061
  Checkbox
5156
5062
  ========================================================================== */
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.0",
9
+ "@lumx/icons": "^4.3.2-alpha.1",
10
10
  "classnames": "^2.3.2",
11
11
  "focus-visible": "^5.0.2",
12
12
  "lodash": "4.17.23",
@@ -37,7 +37,7 @@
37
37
  "update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
38
38
  },
39
39
  "sideEffects": false,
40
- "version": "4.3.2-alpha.0",
40
+ "version": "4.3.2-alpha.1",
41
41
  "devDependencies": {
42
42
  "@rollup/plugin-typescript": "^12.3.0",
43
43
  "@testing-library/dom": "^10.4.1",
@@ -61,5 +61,5 @@
61
61
  "vite-tsconfig-paths": "^5.1.4",
62
62
  "vitest": "^4.0.18"
63
63
  },
64
- "stableVersion": "4.3.0"
64
+ "stableVersion": "4.3.1"
65
65
  }
@@ -3,7 +3,6 @@
3
3
  @import "./components/checkbox/mixins";
4
4
  @import "./components/chip/variables";
5
5
  @import "./components/chip/mixins";
6
- @import "./components/combobox/mixins";
7
6
  @import "./components/dialog/variables";
8
7
  @import "./components/divider/variables";
9
8
  @import "./components/divider/mixins";
package/scss/lumx.scss CHANGED
@@ -20,7 +20,6 @@
20
20
  @import "./components/avatar/index";
21
21
  @import "./components/badge/index";
22
22
  @import "./components/button/index";
23
- @import "./components/combobox/index";
24
23
  @import "./components/checkbox/index";
25
24
  @import "./components/chip/index";
26
25
  @import "./components/comment-block/index";
@@ -1,12 +0,0 @@
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>>;
@@ -1,86 +0,0 @@
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
- }
@@ -1,63 +0,0 @@
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
- }