@lumx/core 3.20.1-alpha.4 → 3.20.1-alpha.40

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.
Files changed (130) hide show
  1. package/CONTRIBUTING.md +1 -5
  2. package/js/constants/design-tokens.d.ts +5421 -0
  3. package/js/constants/design-tokens.js +1 -5
  4. package/js/constants/index.d.ts +232 -0
  5. package/js/constants/index.js +2 -35
  6. package/js/constants/keycodes.d.ts +36 -0
  7. package/js/constants/keycodes.js +1 -13
  8. package/js/custom-colors.d.ts +25 -0
  9. package/js/custom-colors.js +1 -6
  10. package/js/types/Callback.js +0 -1
  11. package/js/types/Falsy.js +0 -1
  12. package/js/types/{GenericProps.ts → GenericProps.d.ts} +0 -1
  13. package/js/types/GenericProps.js +0 -1
  14. package/js/types/HasAriaLabelOrLabelledBy.d.ts +17 -0
  15. package/js/types/HasAriaLabelOrLabelledBy.js +0 -1
  16. package/js/types/HasClassName.js +0 -1
  17. package/js/types/HasCloseMode.js +0 -1
  18. package/js/types/{HasTheme.ts → HasTheme.d.ts} +0 -1
  19. package/js/types/HasTheme.js +0 -1
  20. package/js/types/HeadingElement.js +0 -1
  21. package/js/types/Point.d.ts +7 -0
  22. package/js/types/Point.js +0 -1
  23. package/js/types/Predicate.js +0 -1
  24. package/js/types/RectSize.d.ts +7 -0
  25. package/js/types/RectSize.js +0 -1
  26. package/js/types/{TextElement.ts → TextElement.d.ts} +0 -1
  27. package/js/types/TextElement.js +0 -1
  28. package/js/types/ValueOf.js +0 -1
  29. package/js/types/index.js +0 -1
  30. package/js/utils/className/fontColorClass.d.ts +6 -0
  31. package/js/utils/className/fontColorClass.js +4 -9
  32. package/js/utils/className/getBasicClass.d.ts +13 -0
  33. package/js/utils/className/getBasicClass.js +7 -16
  34. package/js/utils/className/{getRootClassName.ts → getRootClassName.d.ts} +1 -15
  35. package/js/utils/className/getRootClassName.js +4 -13
  36. package/js/utils/className/{getTypographyClassName.ts → getTypographyClassName.d.ts} +1 -4
  37. package/js/utils/className/getTypographyClassName.js +1 -5
  38. package/js/utils/className/handleBasicClasses.d.ts +15 -0
  39. package/js/utils/className/handleBasicClasses.js +9 -20
  40. package/js/utils/className/index.js +6 -25
  41. package/js/utils/className/resolveColorWithVariants.d.ts +3 -0
  42. package/js/utils/className/resolveColorWithVariants.js +1 -5
  43. package/js/utils/events/index.d.ts +2 -0
  44. package/js/utils/events/index.js +2 -0
  45. package/js/utils/events/keyboard.d.ts +24 -0
  46. package/js/utils/events/keyboard.js +44 -0
  47. package/js/utils/events/swipe.d.ts +6 -0
  48. package/js/utils/events/swipe.js +79 -0
  49. package/js/utils/index.d.ts +2 -0
  50. package/js/utils/index.js +8 -223
  51. package/lumx.css +7 -6
  52. package/package.json +10 -14
  53. package/scss/components/list/_index.scss +10 -4
  54. package/js/components/Icon/Stories.js +0 -40
  55. package/js/components/Icon/Tests.tsx +0 -120
  56. package/js/components/Icon/index.tsx +0 -134
  57. package/js/constants/design-tokens.min.js +0 -1
  58. package/js/constants/design-tokens.ts +0 -2324
  59. package/js/constants/index.min.js +0 -1
  60. package/js/constants/index.ts +0 -231
  61. package/js/constants/keycodes.min.js +0 -1
  62. package/js/constants/keycodes.ts +0 -44
  63. package/js/custom-colors.min.js +0 -1
  64. package/js/custom-colors.ts +0 -56
  65. package/js/date-picker.js +0 -71
  66. package/js/date-picker.min.js +0 -1
  67. package/js/date-picker.ts +0 -77
  68. package/js/types/Callback.min.js +0 -1
  69. package/js/types/Falsy.min.js +0 -1
  70. package/js/types/GenericProps.min.js +0 -1
  71. package/js/types/HasAriaLabelOrLabelledBy.min.js +0 -1
  72. package/js/types/HasAriaLabelOrLabelledBy.ts +0 -19
  73. package/js/types/HasClassName.min.js +0 -1
  74. package/js/types/HasCloseMode.min.js +0 -1
  75. package/js/types/HasTheme.min.js +0 -1
  76. package/js/types/HeadingElement.min.js +0 -1
  77. package/js/types/Point.min.js +0 -1
  78. package/js/types/Point.ts +0 -4
  79. package/js/types/Predicate.min.js +0 -1
  80. package/js/types/RectSize.min.js +0 -1
  81. package/js/types/RectSize.ts +0 -4
  82. package/js/types/TextElement.min.js +0 -1
  83. package/js/types/ValueOf.min.js +0 -1
  84. package/js/types/index.min.js +0 -1
  85. package/js/utils/className/fontColorClass.min.js +0 -1
  86. package/js/utils/className/fontColorClass.test.js +0 -18
  87. package/js/utils/className/fontColorClass.test.min.js +0 -1
  88. package/js/utils/className/fontColorClass.test.ts +0 -15
  89. package/js/utils/className/fontColorClass.ts +0 -12
  90. package/js/utils/className/getBasicClass.min.js +0 -1
  91. package/js/utils/className/getBasicClass.test.js +0 -22
  92. package/js/utils/className/getBasicClass.test.min.js +0 -1
  93. package/js/utils/className/getBasicClass.test.ts +0 -20
  94. package/js/utils/className/getBasicClass.ts +0 -36
  95. package/js/utils/className/getRootClassName.min.js +0 -1
  96. package/js/utils/className/getRootClassName.test.js +0 -15
  97. package/js/utils/className/getRootClassName.test.min.js +0 -1
  98. package/js/utils/className/getRootClassName.test.ts +0 -11
  99. package/js/utils/className/getTypographyClassName.min.js +0 -1
  100. package/js/utils/className/getTypographyClassName.test.js +0 -9
  101. package/js/utils/className/getTypographyClassName.test.min.js +0 -1
  102. package/js/utils/className/getTypographyClassName.test.ts +0 -7
  103. package/js/utils/className/handleBasicClasses.min.js +0 -1
  104. package/js/utils/className/handleBasicClasses.test.js +0 -35
  105. package/js/utils/className/handleBasicClasses.test.min.js +0 -1
  106. package/js/utils/className/handleBasicClasses.test.ts +0 -28
  107. package/js/utils/className/handleBasicClasses.ts +0 -44
  108. package/js/utils/className/index.min.js +0 -1
  109. package/js/utils/className/resolveColorWithVariants.min.js +0 -1
  110. package/js/utils/className/resolveColorWithVariants.test.js +0 -30
  111. package/js/utils/className/resolveColorWithVariants.test.min.js +0 -1
  112. package/js/utils/className/resolveColorWithVariants.test.ts +0 -33
  113. package/js/utils/className/resolveColorWithVariants.ts +0 -11
  114. package/js/utils/index.min.js +0 -1
  115. package/js/utils/index.ts +0 -221
  116. package/lumx.min.css +0 -1
  117. package/stories/controls/color.ts +0 -7
  118. package/stories/controls/icons.ts +0 -126
  119. package/stories/controls/selectArgType.ts +0 -8
  120. package/stories/controls/withUndefined.ts +0 -1
  121. package/testing/utils/queries.ts +0 -19
  122. /package/js/types/{Callback.ts → Callback.d.ts} +0 -0
  123. /package/js/types/{Falsy.ts → Falsy.d.ts} +0 -0
  124. /package/js/types/{HasClassName.ts → HasClassName.d.ts} +0 -0
  125. /package/js/types/{HasCloseMode.ts → HasCloseMode.d.ts} +0 -0
  126. /package/js/types/{HeadingElement.ts → HeadingElement.d.ts} +0 -0
  127. /package/js/types/{Predicate.ts → Predicate.d.ts} +0 -0
  128. /package/js/types/{ValueOf.ts → ValueOf.d.ts} +0 -0
  129. /package/js/types/{index.ts → index.d.ts} +0 -0
  130. /package/js/utils/className/{index.ts → index.d.ts} +0 -0
@@ -1,7 +1,3 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
1
  /**
6
2
  * Do not edit directly
7
3
  * Generated on Mon, 13 Jan 2025 09:24:38 GMT
@@ -2326,4 +2322,4 @@ const DESIGN_TOKENS = {
2326
2322
  },
2327
2323
  };
2328
2324
 
2329
- exports.DESIGN_TOKENS = DESIGN_TOKENS;
2325
+ export { DESIGN_TOKENS };
@@ -0,0 +1,232 @@
1
+ import { ValueOf } from '../types/ValueOf';
2
+ /**
3
+ * The prefix to use for the CSS classes.
4
+ */
5
+ export declare const CSS_PREFIX = "lumx";
6
+ /**
7
+ * Key codes.
8
+ */
9
+ export * from './keycodes';
10
+ /**
11
+ * Animation duration constants. Take into consideration that if you change one of these variables,
12
+ * you need to update their scss counterpart as well
13
+ */
14
+ export declare const DIALOG_TRANSITION_DURATION = 400;
15
+ export declare const EXPANSION_PANEL_TRANSITION_DURATION = 400;
16
+ export declare const NOTIFICATION_TRANSITION_DURATION = 200;
17
+ export declare const SLIDESHOW_TRANSITION_DURATION = 5000;
18
+ /**
19
+ * Delay on hover after which we open or close the tooltip.
20
+ * Only applies to devices supporting pointer hover.
21
+ */
22
+ export declare const TOOLTIP_HOVER_DELAY: {
23
+ open: number;
24
+ close: number;
25
+ };
26
+ /**
27
+ * Delay on long press after which we open or close the tooltip.
28
+ * Only applies to devices not supporting pointer hover.
29
+ */
30
+ export declare const TOOLTIP_LONG_PRESS_DELAY: {
31
+ open: number;
32
+ close: number;
33
+ };
34
+ /**
35
+ * Alignments.
36
+ */
37
+ export declare const Alignment: {
38
+ readonly bottom: "bottom";
39
+ readonly center: "center";
40
+ readonly end: "end";
41
+ readonly left: "left";
42
+ readonly right: "right";
43
+ readonly spaceAround: "space-around";
44
+ readonly spaceBetween: "space-between";
45
+ readonly spaceEvenly: "space-evenly";
46
+ readonly start: "start";
47
+ readonly top: "top";
48
+ };
49
+ export type Alignment = ValueOf<typeof Alignment>;
50
+ export type VerticalAlignment = Extract<Alignment, 'top' | 'center' | 'bottom'>;
51
+ export type HorizontalAlignment = Extract<Alignment, 'right' | 'center' | 'left'>;
52
+ export declare const Theme: {
53
+ readonly light: "light";
54
+ readonly dark: "dark";
55
+ };
56
+ export type Theme = ValueOf<typeof Theme>;
57
+ export declare const Size: {
58
+ readonly xxs: "xxs";
59
+ readonly xs: "xs";
60
+ readonly s: "s";
61
+ readonly m: "m";
62
+ readonly l: "l";
63
+ readonly xl: "xl";
64
+ readonly xxl: "xxl";
65
+ readonly tiny: "tiny";
66
+ readonly regular: "regular";
67
+ readonly medium: "medium";
68
+ readonly big: "big";
69
+ readonly huge: "huge";
70
+ };
71
+ export type Size = ValueOf<typeof Size>;
72
+ export type GlobalSize = Extract<Size, 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'>;
73
+ export declare const Orientation: {
74
+ readonly horizontal: "horizontal";
75
+ readonly vertical: "vertical";
76
+ };
77
+ export type Orientation = ValueOf<typeof Orientation>;
78
+ export declare const Emphasis: {
79
+ readonly low: "low";
80
+ readonly medium: "medium";
81
+ readonly high: "high";
82
+ };
83
+ export type Emphasis = ValueOf<typeof Emphasis>;
84
+ /**
85
+ * List of typographies that can't be customized.
86
+ */
87
+ export declare const TypographyInterface: {
88
+ readonly overline: "overline";
89
+ readonly caption: "caption";
90
+ readonly body1: "body1";
91
+ readonly body2: "body2";
92
+ readonly subtitle1: "subtitle1";
93
+ readonly subtitle2: "subtitle2";
94
+ readonly title: "title";
95
+ readonly headline: "headline";
96
+ readonly display1: "display1";
97
+ };
98
+ export type TypographyInterface = ValueOf<typeof TypographyInterface>;
99
+ /**
100
+ * List of title typographies that can be customized (via CSS variables).
101
+ */
102
+ export declare const TypographyTitleCustom: {
103
+ readonly title1: "custom-title1";
104
+ readonly title2: "custom-title2";
105
+ readonly title3: "custom-title3";
106
+ readonly title4: "custom-title4";
107
+ readonly title5: "custom-title5";
108
+ readonly title6: "custom-title6";
109
+ };
110
+ export type TypographyTitleCustom = ValueOf<typeof TypographyTitleCustom>;
111
+ /**
112
+ * List of typographies that can be customized (via CSS variables).
113
+ */
114
+ export declare const TypographyCustom: {
115
+ readonly intro: "custom-intro";
116
+ readonly 'body-large': "custom-body-large";
117
+ readonly body: "custom-body";
118
+ readonly quote: "custom-quote";
119
+ readonly 'publish-info': "custom-publish-info";
120
+ readonly button: "custom-button";
121
+ readonly title1: "custom-title1";
122
+ readonly title2: "custom-title2";
123
+ readonly title3: "custom-title3";
124
+ readonly title4: "custom-title4";
125
+ readonly title5: "custom-title5";
126
+ readonly title6: "custom-title6";
127
+ };
128
+ export type TypographyCustom = ValueOf<typeof TypographyCustom>;
129
+ /**
130
+ * List of all typographies.
131
+ */
132
+ export declare const Typography: {
133
+ readonly custom: {
134
+ readonly intro: "custom-intro";
135
+ readonly 'body-large': "custom-body-large";
136
+ readonly body: "custom-body";
137
+ readonly quote: "custom-quote";
138
+ readonly 'publish-info': "custom-publish-info";
139
+ readonly button: "custom-button";
140
+ readonly title1: "custom-title1";
141
+ readonly title2: "custom-title2";
142
+ readonly title3: "custom-title3";
143
+ readonly title4: "custom-title4";
144
+ readonly title5: "custom-title5";
145
+ readonly title6: "custom-title6";
146
+ };
147
+ readonly overline: "overline";
148
+ readonly caption: "caption";
149
+ readonly body1: "body1";
150
+ readonly body2: "body2";
151
+ readonly subtitle1: "subtitle1";
152
+ readonly subtitle2: "subtitle2";
153
+ readonly title: "title";
154
+ readonly headline: "headline";
155
+ readonly display1: "display1";
156
+ };
157
+ export type Typography = TypographyInterface | TypographyCustom;
158
+ /**
159
+ * All available aspect ratios.
160
+ */
161
+ export declare const AspectRatio: {
162
+ /** Intrinsic content ratio. */
163
+ readonly original: "original";
164
+ /** Ratio 3:1 */
165
+ readonly panoramic: "panoramic";
166
+ /** Ratio 16:9 */
167
+ readonly wide: "wide";
168
+ /** Ratio 3:2 */
169
+ readonly horizontal: "horizontal";
170
+ /** Ratio 3:2 */
171
+ readonly vertical: "vertical";
172
+ /** Ratio 1:1 */
173
+ readonly square: "square";
174
+ /** Ratio constrained by the parent. */
175
+ readonly free: "free";
176
+ };
177
+ export type AspectRatio = ValueOf<typeof AspectRatio>;
178
+ /**
179
+ * Semantic info about the purpose of the component
180
+ */
181
+ export declare const Kind: {
182
+ readonly info: "info";
183
+ readonly success: "success";
184
+ readonly warning: "warning";
185
+ readonly error: "error";
186
+ };
187
+ export type Kind = ValueOf<typeof Kind>;
188
+ /**
189
+ * All available white-space values
190
+ * */
191
+ export declare const WhiteSpace: {
192
+ normal: string;
193
+ nowrap: string;
194
+ pre: string;
195
+ 'pre-wrap': string;
196
+ 'pre-line': string;
197
+ 'break-spaces': string;
198
+ };
199
+ export type WhiteSpace = ValueOf<typeof WhiteSpace>;
200
+ /**
201
+ * See SCSS variable $lumx-color-palette
202
+ */
203
+ export declare const ColorPalette: {
204
+ readonly primary: "primary";
205
+ readonly secondary: "secondary";
206
+ readonly blue: "blue";
207
+ readonly dark: "dark";
208
+ readonly green: "green";
209
+ readonly yellow: "yellow";
210
+ readonly red: "red";
211
+ readonly light: "light";
212
+ readonly grey: "grey";
213
+ };
214
+ export type ColorPalette = ValueOf<typeof ColorPalette>;
215
+ export type Color = ColorPalette | string;
216
+ /**
217
+ * See SCSS variable $lumx-color-variants
218
+ */
219
+ export declare const ColorVariant: {
220
+ readonly D1: "D1";
221
+ readonly D2: "D2";
222
+ readonly L1: "L1";
223
+ readonly L2: "L2";
224
+ readonly L3: "L3";
225
+ readonly L4: "L4";
226
+ readonly L5: "L5";
227
+ readonly L6: "L6";
228
+ readonly N: "N";
229
+ };
230
+ export type ColorVariant = ValueOf<typeof ColorVariant>;
231
+ /** ColorPalette with all possible color variant combination */
232
+ export type ColorWithVariants = ColorPalette | Exclude<`${ColorPalette}-${ColorVariant}`, `light-D${number}` | `dark-D${number}`>;
@@ -1,8 +1,4 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var js_constants_keycodes = require('./keycodes.js');
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.js';
6
2
 
7
3
  /**
8
4
  * The prefix to use for the CSS classes.
@@ -186,33 +182,4 @@ const ColorVariant = {
186
182
  N: 'N',
187
183
  };
188
184
 
189
- exports.BACKSPACE_KEY_CODE = js_constants_keycodes.BACKSPACE_KEY_CODE;
190
- exports.DOWN_KEY_CODE = js_constants_keycodes.DOWN_KEY_CODE;
191
- exports.ENTER_KEY_CODE = js_constants_keycodes.ENTER_KEY_CODE;
192
- exports.ESCAPE_KEY_CODE = js_constants_keycodes.ESCAPE_KEY_CODE;
193
- exports.LEFT_KEY_CODE = js_constants_keycodes.LEFT_KEY_CODE;
194
- exports.RIGHT_KEY_CODE = js_constants_keycodes.RIGHT_KEY_CODE;
195
- exports.SPACE_KEY_CODE = js_constants_keycodes.SPACE_KEY_CODE;
196
- exports.TAB_KEY_CODE = js_constants_keycodes.TAB_KEY_CODE;
197
- exports.UP_KEY_CODE = js_constants_keycodes.UP_KEY_CODE;
198
- exports.Alignment = Alignment;
199
- exports.AspectRatio = AspectRatio;
200
- exports.CSS_PREFIX = CSS_PREFIX;
201
- exports.ColorPalette = ColorPalette;
202
- exports.ColorVariant = ColorVariant;
203
- exports.DIALOG_TRANSITION_DURATION = DIALOG_TRANSITION_DURATION;
204
- exports.EXPANSION_PANEL_TRANSITION_DURATION = EXPANSION_PANEL_TRANSITION_DURATION;
205
- exports.Emphasis = Emphasis;
206
- exports.Kind = Kind;
207
- exports.NOTIFICATION_TRANSITION_DURATION = NOTIFICATION_TRANSITION_DURATION;
208
- exports.Orientation = Orientation;
209
- exports.SLIDESHOW_TRANSITION_DURATION = SLIDESHOW_TRANSITION_DURATION;
210
- exports.Size = Size;
211
- exports.TOOLTIP_HOVER_DELAY = TOOLTIP_HOVER_DELAY;
212
- exports.TOOLTIP_LONG_PRESS_DELAY = TOOLTIP_LONG_PRESS_DELAY;
213
- exports.Theme = Theme;
214
- exports.Typography = Typography;
215
- exports.TypographyCustom = TypographyCustom;
216
- exports.TypographyInterface = TypographyInterface;
217
- exports.TypographyTitleCustom = TypographyTitleCustom;
218
- exports.WhiteSpace = WhiteSpace;
185
+ export { Alignment, AspectRatio, CSS_PREFIX, ColorPalette, ColorVariant, DIALOG_TRANSITION_DURATION, EXPANSION_PANEL_TRANSITION_DURATION, Emphasis, Kind, NOTIFICATION_TRANSITION_DURATION, Orientation, SLIDESHOW_TRANSITION_DURATION, Size, TOOLTIP_HOVER_DELAY, TOOLTIP_LONG_PRESS_DELAY, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The down key code.
3
+ */
4
+ export declare const DOWN_KEY_CODE = 40;
5
+ /**
6
+ * The enter/return key code.
7
+ */
8
+ export declare const ENTER_KEY_CODE = 13;
9
+ /**
10
+ * The space key code.
11
+ */
12
+ export declare const SPACE_KEY_CODE = 32;
13
+ /**
14
+ * The escape key code.
15
+ */
16
+ export declare const ESCAPE_KEY_CODE = 27;
17
+ /**
18
+ * The left key code.
19
+ */
20
+ export declare const LEFT_KEY_CODE = 37;
21
+ /**
22
+ * The right key code.
23
+ */
24
+ export declare const RIGHT_KEY_CODE = 39;
25
+ /**
26
+ * The tab key code.
27
+ */
28
+ export declare const TAB_KEY_CODE = 9;
29
+ /**
30
+ * The up key code.
31
+ */
32
+ export declare const UP_KEY_CODE = 38;
33
+ /**
34
+ * The up key code.
35
+ */
36
+ export declare const BACKSPACE_KEY_CODE = 8;
@@ -1,7 +1,3 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
1
  /**
6
2
  * The down key code.
7
3
  */
@@ -39,12 +35,4 @@ const UP_KEY_CODE = 38;
39
35
  */
40
36
  const BACKSPACE_KEY_CODE = 8;
41
37
 
42
- exports.BACKSPACE_KEY_CODE = BACKSPACE_KEY_CODE;
43
- exports.DOWN_KEY_CODE = DOWN_KEY_CODE;
44
- exports.ENTER_KEY_CODE = ENTER_KEY_CODE;
45
- exports.ESCAPE_KEY_CODE = ESCAPE_KEY_CODE;
46
- exports.LEFT_KEY_CODE = LEFT_KEY_CODE;
47
- exports.RIGHT_KEY_CODE = RIGHT_KEY_CODE;
48
- exports.SPACE_KEY_CODE = SPACE_KEY_CODE;
49
- exports.TAB_KEY_CODE = TAB_KEY_CODE;
50
- exports.UP_KEY_CODE = UP_KEY_CODE;
38
+ 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 };
@@ -0,0 +1,25 @@
1
+ interface Variants {
2
+ D2?: string;
3
+ D1?: string;
4
+ N?: string;
5
+ L1?: string;
6
+ L2?: string;
7
+ L3?: string;
8
+ L4?: string;
9
+ L5?: string;
10
+ L6?: string;
11
+ }
12
+ type ColorPalette = Partial<Record<'primary' | 'secondary', Variants>>;
13
+ /**
14
+ * Generate CSS variables for the given color palette.
15
+ */
16
+ export declare function generateCSSColorVariables(palette: ColorPalette): string;
17
+ /**
18
+ * Set primary and secondary custom colors.
19
+ *
20
+ * @param sheet The sheet to insert the custom rules in.
21
+ * @param colorPalette The custom color palette.
22
+ * @param selector The selector used to scope the custom colors (defaults to ':root').
23
+ */
24
+ export declare function setCustomColors(sheet: CSSStyleSheet, colorPalette: ColorPalette, selector?: string): void;
25
+ export {};
@@ -1,7 +1,3 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
1
  /**
6
2
  * Generate CSS variables for the given color palette.
7
3
  */
@@ -44,5 +40,4 @@ function setCustomColors(sheet, colorPalette, selector = ':root') {
44
40
  _addCSSRule(sheet, selector, rules, 0);
45
41
  }
46
42
 
47
- exports.generateCSSColorVariables = generateCSSColorVariables;
48
- exports.setCustomColors = setCustomColors;
43
+ export { generateCSSColorVariables, setCustomColors };
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
package/js/types/Falsy.js CHANGED
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -1,5 +1,4 @@
1
1
  import type { HasClassName } from './HasClassName';
2
-
3
2
  /**
4
3
  * Define a generic props types.
5
4
  */
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Require either `aria-label` or `arial-labelledby` prop.
3
+ * If none are set, the order will prioritize `aria-labelledby` over `aria-label` as it
4
+ * needs a visible element.
5
+ */
6
+ export type HasAriaLabelOrLabelledBy<T = string | undefined> = T extends string ? {
7
+ /**
8
+ * The id of the element to use as title of the dialog. Can be within or out of the dialog.
9
+ * Although it is not recommended, aria-label can be used instead if no visible element is available.
10
+ */
11
+ 'aria-labelledby': T;
12
+ /** The label of the dialog. */
13
+ 'aria-label'?: undefined;
14
+ } : {
15
+ 'aria-label': string;
16
+ 'aria-labelledby'?: undefined;
17
+ };
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -1,5 +1,4 @@
1
1
  import type { Theme } from '../constants';
2
-
3
2
  export interface HasTheme {
4
3
  /**
5
4
  * Theme adapting the component to light or dark background.
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A point coordinate in 2D space
3
+ */
4
+ export type Point = {
5
+ x: number;
6
+ y: number;
7
+ };
package/js/types/Point.js CHANGED
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Rectangle size
3
+ */
4
+ export type RectSize = {
5
+ width: number;
6
+ height: number;
7
+ };
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -1,4 +1,3 @@
1
1
  import type { HeadingElement } from './HeadingElement';
2
-
3
2
  /** Union type of all text elements */
4
3
  export type TextElement = 'span' | 'p' | HeadingElement;
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
package/js/types/index.js CHANGED
@@ -1,2 +1 @@
1
- 'use strict';
2
1
 
@@ -0,0 +1,6 @@
1
+ import { ColorVariant, ColorWithVariants } from '../../constants';
2
+ /**
3
+ * Returns the classname associated to the given color and variant.
4
+ * For example, for 'dark' and 'L2' it returns `lumx-color-font-dark-L2`
5
+ */
6
+ export declare function fontColorClass(propColor?: ColorWithVariants, propColorVariant?: ColorVariant): string | undefined;
@@ -1,10 +1,5 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var js_constants_index = require('../../constants/index.js');
6
- var js_utils_className_resolveColorWithVariants = require('./resolveColorWithVariants.js');
7
- require('../../constants/keycodes.js');
1
+ import { ColorVariant } from '../../constants/index.js';
2
+ import { resolveColorWithVariants } from './resolveColorWithVariants.js';
8
3
 
9
4
  /**
10
5
  * Returns the classname associated to the given color and variant.
@@ -13,8 +8,8 @@ require('../../constants/keycodes.js');
13
8
  function fontColorClass(propColor, propColorVariant) {
14
9
  if (!propColor)
15
10
  return undefined;
16
- const [color, colorVariant = js_constants_index.ColorVariant.N] = js_utils_className_resolveColorWithVariants.resolveColorWithVariants(propColor, propColorVariant);
11
+ const [color, colorVariant = ColorVariant.N] = resolveColorWithVariants(propColor, propColorVariant);
17
12
  return `lumx-color-font-${color}-${colorVariant}`;
18
13
  }
19
14
 
20
- exports.fontColorClass = fontColorClass;
15
+ export { fontColorClass };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Get the basic CSS class for the given type.
3
+ *
4
+ * @param prefix The class name prefix for the generated CSS class.
5
+ * @param type The type of CSS class we want to generate (e.g.: 'color', 'variant', ...).
6
+ * @param value The value of the type of the CSS class (e.g.: 'primary', 'button', ...).
7
+ * @return The basic CSS class.
8
+ */
9
+ export declare function getBasicClass({ prefix, type, value, }: {
10
+ prefix: string;
11
+ type: string;
12
+ value: string | number | boolean | undefined;
13
+ }): string;
@@ -1,14 +1,5 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var isBoolean = require('lodash/isBoolean');
6
- var kebabCase = require('lodash/kebabCase');
7
-
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var isBoolean__default = /*#__PURE__*/_interopDefaultLegacy(isBoolean);
11
- var kebabCase__default = /*#__PURE__*/_interopDefaultLegacy(kebabCase);
1
+ import isBoolean from 'lodash/isBoolean';
2
+ import kebabCase from 'lodash/kebabCase';
12
3
 
13
4
  /**
14
5
  * Get the basic CSS class for the given type.
@@ -19,18 +10,18 @@ var kebabCase__default = /*#__PURE__*/_interopDefaultLegacy(kebabCase);
19
10
  * @return The basic CSS class.
20
11
  */
21
12
  function getBasicClass({ prefix, type, value, }) {
22
- if (isBoolean__default["default"](value)) {
13
+ if (isBoolean(value)) {
23
14
  if (!value) {
24
15
  // False value should not return a class.
25
16
  return '';
26
17
  }
27
18
  const booleanPrefixes = ['has', 'is'];
28
19
  if (booleanPrefixes.some((booleanPrefix) => type.toString().startsWith(booleanPrefix))) {
29
- return `${prefix}--${kebabCase__default["default"](type)}`;
20
+ return `${prefix}--${kebabCase(type)}`;
30
21
  }
31
- return `${prefix}--is-${kebabCase__default["default"](type)}`;
22
+ return `${prefix}--is-${kebabCase(type)}`;
32
23
  }
33
- return `${prefix}--${kebabCase__default["default"](type)}-${value}`;
24
+ return `${prefix}--${kebabCase(type)}-${value}`;
34
25
  }
35
26
 
36
- exports.getBasicClass = getBasicClass;
27
+ export { getBasicClass };
@@ -1,10 +1,3 @@
1
- import kebabCase from 'lodash/kebabCase';
2
-
3
- import { CSS_PREFIX } from '../../constants';
4
-
5
- // See https://regex101.com/r/YjS1uI/3
6
- const LAST_PART_CLASSNAME = /^(.*)-(.+)$/gi;
7
-
8
1
  /**
9
2
  * Get the name of the root CSS class of a component based on its name.
10
3
  *
@@ -15,11 +8,4 @@ const LAST_PART_CLASSNAME = /^(.*)-(.+)$/gi;
15
8
  * @return The name of the root CSS class. This classname include the CSS classname prefix and is written in
16
9
  * lower-snake-case.
17
10
  */
18
- export function getRootClassName(componentName: string, subComponent?: boolean): string {
19
- const formattedClassName = `${CSS_PREFIX}-${kebabCase(componentName)}`;
20
-
21
- if (subComponent) {
22
- return formattedClassName.replace(LAST_PART_CLASSNAME, '$1__$2');
23
- }
24
- return formattedClassName;
25
- }
11
+ export declare function getRootClassName(componentName: string, subComponent?: boolean): string;
@@ -1,14 +1,5 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var kebabCase = require('lodash/kebabCase');
6
- var js_constants_index = require('../../constants/index.js');
7
- require('../../constants/keycodes.js');
8
-
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var kebabCase__default = /*#__PURE__*/_interopDefaultLegacy(kebabCase);
1
+ import kebabCase from 'lodash/kebabCase';
2
+ import { CSS_PREFIX } from '../../constants/index.js';
12
3
 
13
4
  // See https://regex101.com/r/YjS1uI/3
14
5
  const LAST_PART_CLASSNAME = /^(.*)-(.+)$/gi;
@@ -23,11 +14,11 @@ const LAST_PART_CLASSNAME = /^(.*)-(.+)$/gi;
23
14
  * lower-snake-case.
24
15
  */
25
16
  function getRootClassName(componentName, subComponent) {
26
- const formattedClassName = `${js_constants_index.CSS_PREFIX}-${kebabCase__default["default"](componentName)}`;
17
+ const formattedClassName = `${CSS_PREFIX}-${kebabCase(componentName)}`;
27
18
  if (subComponent) {
28
19
  return formattedClassName.replace(LAST_PART_CLASSNAME, '$1__$2');
29
20
  }
30
21
  return formattedClassName;
31
22
  }
32
23
 
33
- exports.getRootClassName = getRootClassName;
24
+ export { getRootClassName };
@@ -1,9 +1,6 @@
1
1
  import { Typography } from '../../constants';
2
-
3
2
  /**
4
3
  * Returns the classname associated to the given typography.
5
4
  * For example, for `Typography.title` it returns `lumx-typography-title`
6
5
  */
7
- export const getTypographyClassName = (typography: Typography) => {
8
- return `lumx-typography-${typography}`;
9
- };
6
+ export declare const getTypographyClassName: (typography: Typography) => string;