@lumx/react 2.1.0-alpha.14 → 2.1.0-alpha.15
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/esm/_internal/AlertDialog.js +2 -1
- package/esm/_internal/AlertDialog.js.map +1 -1
- package/esm/_internal/AutocompleteMultiple.js +2 -1
- package/esm/_internal/AutocompleteMultiple.js.map +1 -1
- package/esm/_internal/Avatar2.js +2 -1
- package/esm/_internal/Avatar2.js.map +1 -1
- package/esm/_internal/Badge2.js +2 -1
- package/esm/_internal/Badge2.js.map +1 -1
- package/esm/_internal/Button2.js +2 -1
- package/esm/_internal/Button2.js.map +1 -1
- package/esm/_internal/ButtonGroup.js +2 -1
- package/esm/_internal/ButtonGroup.js.map +1 -1
- package/esm/_internal/ButtonRoot.js +2 -1
- package/esm/_internal/ButtonRoot.js.map +1 -1
- package/esm/_internal/Checkbox2.js +2 -1
- package/esm/_internal/Checkbox2.js.map +1 -1
- package/esm/_internal/Chip2.js +2 -1
- package/esm/_internal/Chip2.js.map +1 -1
- package/esm/_internal/ChipGroup.js +2 -1
- package/esm/_internal/ChipGroup.js.map +1 -1
- package/esm/_internal/ClickAwayProvider.js +2 -1
- package/esm/_internal/ClickAwayProvider.js.map +1 -1
- package/esm/_internal/CommentBlock.js +2 -1
- package/esm/_internal/CommentBlock.js.map +1 -1
- package/esm/_internal/DatePickerField.js +2 -1
- package/esm/_internal/DatePickerField.js.map +1 -1
- package/esm/_internal/Dialog2.js +2 -1
- package/esm/_internal/Dialog2.js.map +1 -1
- package/esm/_internal/Divider2.js +2 -1
- package/esm/_internal/Divider2.js.map +1 -1
- package/esm/_internal/DragHandle.js +2 -1
- package/esm/_internal/DragHandle.js.map +1 -1
- package/esm/_internal/Dropdown2.js +2 -1
- package/esm/_internal/Dropdown2.js.map +1 -1
- package/esm/_internal/ExpansionPanel.js +2 -1
- package/esm/_internal/ExpansionPanel.js.map +1 -1
- package/esm/_internal/Flag2.js +2 -1
- package/esm/_internal/Flag2.js.map +1 -1
- package/esm/_internal/FlexBox.js +2 -1
- package/esm/_internal/FlexBox.js.map +1 -1
- package/esm/_internal/GridItem.js +2 -1
- package/esm/_internal/GridItem.js.map +1 -1
- package/esm/_internal/Icon2.js +2 -1
- package/esm/_internal/Icon2.js.map +1 -1
- package/esm/_internal/IconButton.js +2 -1
- package/esm/_internal/IconButton.js.map +1 -1
- package/esm/_internal/ImageBlock.js +2 -1
- package/esm/_internal/ImageBlock.js.map +1 -1
- package/esm/_internal/InputHelper.js +2 -1
- package/esm/_internal/InputHelper.js.map +1 -1
- package/esm/_internal/InputLabel.js +2 -1
- package/esm/_internal/InputLabel.js.map +1 -1
- package/esm/_internal/Lightbox2.js +2 -1
- package/esm/_internal/Lightbox2.js.map +1 -1
- package/esm/_internal/Link2.js +8 -1
- package/esm/_internal/Link2.js.map +1 -1
- package/esm/_internal/LinkPreview.js +2 -1
- package/esm/_internal/LinkPreview.js.map +1 -1
- package/esm/_internal/List2.js +2 -1
- package/esm/_internal/List2.js.map +1 -1
- package/esm/_internal/ListSubheader.js +2 -1
- package/esm/_internal/ListSubheader.js.map +1 -1
- package/esm/_internal/Message2.js +2 -1
- package/esm/_internal/Message2.js.map +1 -1
- package/esm/_internal/Mosaic2.js +2 -1
- package/esm/_internal/Mosaic2.js.map +1 -1
- package/esm/_internal/Notification2.js +2 -1
- package/esm/_internal/Notification2.js.map +1 -1
- package/esm/_internal/Popover2.js +2 -1
- package/esm/_internal/Popover2.js.map +1 -1
- package/esm/_internal/PostBlock.js +2 -1
- package/esm/_internal/PostBlock.js.map +1 -1
- package/esm/_internal/Progress2.js +2 -1
- package/esm/_internal/Progress2.js.map +1 -1
- package/esm/_internal/ProgressTrackerStepPanel.js +2 -1
- package/esm/_internal/ProgressTrackerStepPanel.js.map +1 -1
- package/esm/_internal/RadioGroup.js +2 -1
- package/esm/_internal/RadioGroup.js.map +1 -1
- package/esm/_internal/SelectMultiple.js +2 -1
- package/esm/_internal/SelectMultiple.js.map +1 -1
- package/esm/_internal/SideNavigationItem.js +2 -1
- package/esm/_internal/SideNavigationItem.js.map +1 -1
- package/esm/_internal/SkeletonTypography.js +2 -1
- package/esm/_internal/SkeletonTypography.js.map +1 -1
- package/esm/_internal/Slider2.js +2 -1
- package/esm/_internal/Slider2.js.map +1 -1
- package/esm/_internal/SlideshowControls.js +2 -1
- package/esm/_internal/SlideshowControls.js.map +1 -1
- package/esm/_internal/Switch2.js +2 -1
- package/esm/_internal/Switch2.js.map +1 -1
- package/esm/_internal/TabPanel.js +2 -1
- package/esm/_internal/TabPanel.js.map +1 -1
- package/esm/_internal/TableRow.js +2 -1
- package/esm/_internal/TableRow.js.map +1 -1
- package/esm/_internal/TextField.js +2 -1
- package/esm/_internal/TextField.js.map +1 -1
- package/esm/_internal/Thumbnail2.js +2 -1
- package/esm/_internal/Thumbnail2.js.map +1 -1
- package/esm/_internal/Toolbar2.js +2 -1
- package/esm/_internal/Toolbar2.js.map +1 -1
- package/esm/_internal/Tooltip2.js +2 -1
- package/esm/_internal/Tooltip2.js.map +1 -1
- package/esm/_internal/Uploader2.js +2 -1
- package/esm/_internal/Uploader2.js.map +1 -1
- package/esm/_internal/UserBlock.js +2 -1
- package/esm/_internal/UserBlock.js.map +1 -1
- package/esm/_internal/_rollupPluginBabelHelpers.js +167 -0
- package/esm/_internal/_rollupPluginBabelHelpers.js.map +1 -0
- package/esm/_internal/alert-dialog.js +2 -1
- package/esm/_internal/alert-dialog.js.map +1 -1
- package/esm/_internal/autocomplete.js +2 -1
- package/esm/_internal/autocomplete.js.map +1 -1
- package/esm/_internal/avatar.js +2 -1
- package/esm/_internal/avatar.js.map +1 -1
- package/esm/_internal/badge.js +2 -1
- package/esm/_internal/badge.js.map +1 -1
- package/esm/_internal/button.js +2 -1
- package/esm/_internal/button.js.map +1 -1
- package/esm/_internal/checkbox.js +2 -1
- package/esm/_internal/checkbox.js.map +1 -1
- package/esm/_internal/chip.js +2 -1
- package/esm/_internal/chip.js.map +1 -1
- package/esm/_internal/comment-block.js +2 -1
- package/esm/_internal/comment-block.js.map +1 -1
- package/esm/_internal/components.js +36 -3
- package/esm/_internal/components.js.map +1 -1
- package/esm/_internal/date-picker.js +2 -1
- package/esm/_internal/date-picker.js.map +1 -1
- package/esm/_internal/dialog.js +2 -1
- package/esm/_internal/dialog.js.map +1 -1
- package/esm/_internal/divider.js +2 -1
- package/esm/_internal/divider.js.map +1 -1
- package/esm/_internal/drag-handle.js +2 -1
- package/esm/_internal/drag-handle.js.map +1 -1
- package/esm/_internal/dropdown.js +2 -1
- package/esm/_internal/dropdown.js.map +1 -1
- package/esm/_internal/expansion-panel.js +2 -1
- package/esm/_internal/expansion-panel.js.map +1 -1
- package/esm/_internal/flag.js +2 -1
- package/esm/_internal/flag.js.map +1 -1
- package/esm/_internal/flex-box.js +2 -1
- package/esm/_internal/flex-box.js.map +1 -1
- package/esm/_internal/getRootClassName.js +2 -166
- package/esm/_internal/getRootClassName.js.map +1 -1
- package/esm/_internal/grid.js +2 -1
- package/esm/_internal/grid.js.map +1 -1
- package/esm/_internal/icon.js +2 -1
- package/esm/_internal/icon.js.map +1 -1
- package/esm/_internal/image-block.js +2 -1
- package/esm/_internal/image-block.js.map +1 -1
- package/esm/_internal/input-helper.js +2 -1
- package/esm/_internal/input-helper.js.map +1 -1
- package/esm/_internal/input-label.js +2 -1
- package/esm/_internal/input-label.js.map +1 -1
- package/esm/_internal/lightbox.js +2 -1
- package/esm/_internal/lightbox.js.map +1 -1
- package/esm/_internal/link-preview.js +2 -1
- package/esm/_internal/link-preview.js.map +1 -1
- package/esm/_internal/link.js +2 -1
- package/esm/_internal/link.js.map +1 -1
- package/esm/_internal/list.js +2 -1
- package/esm/_internal/list.js.map +1 -1
- package/esm/_internal/message.js +2 -1
- package/esm/_internal/message.js.map +1 -1
- package/esm/_internal/mosaic.js +2 -1
- package/esm/_internal/mosaic.js.map +1 -1
- package/esm/_internal/notification.js +2 -1
- package/esm/_internal/notification.js.map +1 -1
- package/esm/_internal/popover.js +2 -1
- package/esm/_internal/popover.js.map +1 -1
- package/esm/_internal/post-block.js +2 -1
- package/esm/_internal/post-block.js.map +1 -1
- package/esm/_internal/progress-tracker.js +2 -1
- package/esm/_internal/progress-tracker.js.map +1 -1
- package/esm/_internal/progress.js +2 -1
- package/esm/_internal/progress.js.map +1 -1
- package/esm/_internal/radio-button.js +2 -1
- package/esm/_internal/radio-button.js.map +1 -1
- package/esm/_internal/renderLink.js +1 -1
- package/esm/_internal/select.js +2 -1
- package/esm/_internal/select.js.map +1 -1
- package/esm/_internal/side-navigation.js +2 -1
- package/esm/_internal/side-navigation.js.map +1 -1
- package/esm/_internal/skeleton.js +2 -1
- package/esm/_internal/skeleton.js.map +1 -1
- package/esm/_internal/slider.js +2 -1
- package/esm/_internal/slider.js.map +1 -1
- package/esm/_internal/slideshow.js +2 -1
- package/esm/_internal/slideshow.js.map +1 -1
- package/esm/_internal/switch.js +2 -1
- package/esm/_internal/switch.js.map +1 -1
- package/esm/_internal/table.js +2 -1
- package/esm/_internal/table.js.map +1 -1
- package/esm/_internal/tabs.js +2 -1
- package/esm/_internal/tabs.js.map +1 -1
- package/esm/_internal/text-field.js +2 -1
- package/esm/_internal/text-field.js.map +1 -1
- package/esm/_internal/thumbnail.js +2 -1
- package/esm/_internal/thumbnail.js.map +1 -1
- package/esm/_internal/toolbar.js +2 -1
- package/esm/_internal/toolbar.js.map +1 -1
- package/esm/_internal/tooltip.js +2 -1
- package/esm/_internal/tooltip.js.map +1 -1
- package/esm/_internal/types.js +1 -1
- package/esm/_internal/uploader.js +2 -1
- package/esm/_internal/uploader.js.map +1 -1
- package/esm/_internal/useDelayedVisibility.js +1 -1
- package/esm/_internal/useRovingTabIndex.js +1 -1
- package/esm/_internal/user-block.js +2 -1
- package/esm/_internal/user-block.js.map +1 -1
- package/esm/index.js +3 -2
- package/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/index.ts +39 -3
- package/src/components/link/Link.stories.tsx +24 -8
- package/src/components/link/Link.tsx +8 -2
- package/src/components/skeleton/SkeletonTypography.tsx +2 -2
- package/types.d.ts +60 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-navigation.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"side-navigation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skeleton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/esm/_internal/slider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slideshow.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slideshow.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/esm/_internal/switch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"switch.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/esm/_internal/table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/esm/_internal/tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-field.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thumbnail.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"thumbnail.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
package/esm/_internal/toolbar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toolbar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/esm/_internal/tooltip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
package/esm/_internal/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploader.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uploader.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { e as _toConsumableArray, _ as _objectSpread2, a as _defineProperty, d as _slicedToArray } from './_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { createContext, useContext, useMemo, useEffect, useCallback } from 'react';
|
|
3
3
|
import { u as uid } from '../index2.js';
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-block.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user-block.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import './_internal/_rollupPluginBabelHelpers.js';
|
|
2
|
+
export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, Size, Theme, Typography, TypographyInterface, TypographyTitleCustom } from './_internal/components.js';
|
|
3
3
|
import 'react';
|
|
4
|
+
import './_internal/getRootClassName.js';
|
|
4
5
|
import './_internal/mdi.js';
|
|
5
6
|
import './index2.js';
|
|
6
7
|
import 'lodash/isBoolean';
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@juggle/resize-observer": "^3.2.0",
|
|
10
|
-
"@lumx/core": "^2.1.0-alpha.
|
|
11
|
-
"@lumx/icons": "^2.1.0-alpha.
|
|
10
|
+
"@lumx/core": "^2.1.0-alpha.15",
|
|
11
|
+
"@lumx/icons": "^2.1.0-alpha.15",
|
|
12
12
|
"@popperjs/core": "^2.5.4",
|
|
13
13
|
"body-scroll-lock": "^3.1.5",
|
|
14
14
|
"classnames": "^2.2.6",
|
|
@@ -123,9 +123,9 @@
|
|
|
123
123
|
"storybook": "start-storybook -s ../site-demo/static/ -p 9000"
|
|
124
124
|
},
|
|
125
125
|
"sideEffects": false,
|
|
126
|
-
"version": "2.1.0-alpha.
|
|
126
|
+
"version": "2.1.0-alpha.15",
|
|
127
127
|
"resolutions": {
|
|
128
128
|
"**/style-loader": "^1.0.0"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "a202d8df8a28773fca6fbe6fadffc15f40125f2e"
|
|
131
131
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -87,9 +87,9 @@ export const Emphasis = {
|
|
|
87
87
|
export type Emphasis = ValueOf<typeof Emphasis>;
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
|
-
* List of typographies.
|
|
90
|
+
* List of typographies that can't be customized.
|
|
91
91
|
*/
|
|
92
|
-
export const
|
|
92
|
+
export const TypographyInterface = {
|
|
93
93
|
overline: 'overline',
|
|
94
94
|
caption: 'caption',
|
|
95
95
|
body1: 'body1',
|
|
@@ -100,7 +100,43 @@ export const Typography = {
|
|
|
100
100
|
headline: 'headline',
|
|
101
101
|
display1: 'display1',
|
|
102
102
|
} as const;
|
|
103
|
-
export type
|
|
103
|
+
export type TypographyInterface = ValueOf<typeof TypographyInterface>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* List of title typographies that can be customized (via CSS variables).
|
|
107
|
+
*/
|
|
108
|
+
export const TypographyTitleCustom = {
|
|
109
|
+
title1: 'custom-title1',
|
|
110
|
+
title2: 'custom-title2',
|
|
111
|
+
title3: 'custom-title3',
|
|
112
|
+
title4: 'custom-title4',
|
|
113
|
+
title5: 'custom-title5',
|
|
114
|
+
title6: 'custom-title6',
|
|
115
|
+
} as const;
|
|
116
|
+
export type TypographyTitleCustom = ValueOf<typeof TypographyTitleCustom>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* List of typographies that can be customized (via CSS variables).
|
|
120
|
+
*/
|
|
121
|
+
const TypographyCustom = {
|
|
122
|
+
...TypographyTitleCustom,
|
|
123
|
+
intro: 'intro',
|
|
124
|
+
'body-large': 'body-large',
|
|
125
|
+
body: 'body',
|
|
126
|
+
quote: 'quote',
|
|
127
|
+
'publish-info': 'publish-info',
|
|
128
|
+
button: 'button',
|
|
129
|
+
} as const;
|
|
130
|
+
export type TypographyCustom = ValueOf<typeof TypographyCustom>;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* List of all typographies.
|
|
134
|
+
*/
|
|
135
|
+
export const Typography = {
|
|
136
|
+
...TypographyInterface,
|
|
137
|
+
custom: TypographyCustom,
|
|
138
|
+
} as const;
|
|
139
|
+
export type Typography = TypographyInterface | TypographyCustom;
|
|
104
140
|
|
|
105
141
|
/**
|
|
106
142
|
* All available aspect ratios.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
2
2
|
import { mdiChevronDown, mdiLink } from '@lumx/icons';
|
|
3
|
-
import { ColorPalette, ColorVariant, Link, Typography } from '@lumx/react';
|
|
3
|
+
import { ColorPalette, ColorVariant, Link, Typography, TypographyInterface, TypographyTitleCustom } from '@lumx/react';
|
|
4
4
|
import { boolean, select, text } from '@storybook/addon-knobs';
|
|
5
5
|
import React, { Fragment } from 'react';
|
|
6
6
|
|
|
@@ -8,6 +8,8 @@ export default { title: 'LumX components/link/Link' };
|
|
|
8
8
|
|
|
9
9
|
const onClick = () => console.log('clicked link');
|
|
10
10
|
|
|
11
|
+
const linkTypographies = { ...TypographyInterface, ...TypographyTitleCustom };
|
|
12
|
+
|
|
11
13
|
export const SimpleLink = () => (
|
|
12
14
|
<>
|
|
13
15
|
<Link
|
|
@@ -15,7 +17,7 @@ export const SimpleLink = () => (
|
|
|
15
17
|
target={boolean('target: _blank', false, 'Link 1') ? '_blank' : ''}
|
|
16
18
|
color={select('Color', ColorPalette, ColorPalette.blue, 'Link 1')}
|
|
17
19
|
colorVariant={select('Color Variant', ColorVariant, ColorVariant.N, 'Link 1')}
|
|
18
|
-
typography={select('Typography',
|
|
20
|
+
typography={select('Typography', linkTypographies, Typography.body2, 'Link 1')}
|
|
19
21
|
>
|
|
20
22
|
{text('Value', 'Here is a first link', 'Link 1')}
|
|
21
23
|
</Link>
|
|
@@ -25,7 +27,7 @@ export const SimpleLink = () => (
|
|
|
25
27
|
target={boolean('target: _blank', false, 'Link 2') ? '_blank' : ''}
|
|
26
28
|
color={select('Color', ColorPalette, ColorPalette.blue, 'Link 2')}
|
|
27
29
|
colorVariant={select('Color Variant', ColorVariant, ColorVariant.N, 'Link 2')}
|
|
28
|
-
typography={select('Typography',
|
|
30
|
+
typography={select('Typography', linkTypographies, Typography.body1, 'Link 2')}
|
|
29
31
|
>
|
|
30
32
|
{text('Value', 'Here is a second link', 'Link 2')}
|
|
31
33
|
</Link>
|
|
@@ -35,7 +37,7 @@ export const SimpleLink = () => (
|
|
|
35
37
|
target={boolean('target: _blank', false, 'Link 3') ? '_blank' : ''}
|
|
36
38
|
color={select('Color', ColorPalette, ColorPalette.blue, 'Link 3')}
|
|
37
39
|
colorVariant={select('Color Variant', ColorVariant, ColorVariant.N, 'Link 3')}
|
|
38
|
-
typography={select('Typography',
|
|
40
|
+
typography={select('Typography', linkTypographies, Typography.caption, 'Link 3')}
|
|
39
41
|
>
|
|
40
42
|
{text('Value', 'Here is a third link', 'Link 3')}
|
|
41
43
|
</Link>
|
|
@@ -67,15 +69,16 @@ export const DisabledLink = () => (
|
|
|
67
69
|
|
|
68
70
|
export const WithIcon = () => (
|
|
69
71
|
<>
|
|
70
|
-
{Object.values(
|
|
72
|
+
{Object.values(linkTypographies).map((typography) => (
|
|
71
73
|
<Fragment key={typography}>
|
|
74
|
+
{typography}
|
|
72
75
|
<p>
|
|
73
|
-
<Link rightIcon={mdiLink} href="https://www.google.com" typography={typography}>
|
|
76
|
+
<Link rightIcon={mdiLink} href="https://www.google.com" typography={typography as any}>
|
|
74
77
|
With right icon
|
|
75
78
|
</Link>
|
|
76
79
|
</p>
|
|
77
80
|
<p>
|
|
78
|
-
<Link leftIcon={mdiChevronDown} href="https://www.google.com" typography={typography}>
|
|
81
|
+
<Link leftIcon={mdiChevronDown} href="https://www.google.com" typography={typography as any}>
|
|
79
82
|
With left icon
|
|
80
83
|
</Link>
|
|
81
84
|
</p>
|
|
@@ -84,7 +87,7 @@ export const WithIcon = () => (
|
|
|
84
87
|
leftIcon={mdiChevronDown}
|
|
85
88
|
rightIcon={mdiLink}
|
|
86
89
|
href="https://www.google.com"
|
|
87
|
-
typography={typography}
|
|
90
|
+
typography={typography as any}
|
|
88
91
|
>
|
|
89
92
|
With right and left icon
|
|
90
93
|
</Link>
|
|
@@ -93,3 +96,16 @@ export const WithIcon = () => (
|
|
|
93
96
|
))}
|
|
94
97
|
</>
|
|
95
98
|
);
|
|
99
|
+
|
|
100
|
+
export const WithCustomizableTypography = () => (
|
|
101
|
+
<>
|
|
102
|
+
<style>{`
|
|
103
|
+
:root {
|
|
104
|
+
--lumx-typography-custom-title1-font-size: 5px;
|
|
105
|
+
}
|
|
106
|
+
`}</style>
|
|
107
|
+
<Link typography={Typography.custom.title1} href="https://google.com">
|
|
108
|
+
Link with customizable `body` typography
|
|
109
|
+
</Link>
|
|
110
|
+
</>
|
|
111
|
+
);
|
|
@@ -4,7 +4,7 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
4
4
|
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
|
|
7
|
-
import { Color, ColorVariant, Icon, Size, Typography } from '@lumx/react';
|
|
7
|
+
import { Color, ColorVariant, Icon, Size, Typography, TypographyInterface, TypographyTitleCustom } from '@lumx/react';
|
|
8
8
|
import { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';
|
|
9
9
|
import { renderLink } from '@lumx/react/utils/renderLink';
|
|
10
10
|
|
|
@@ -31,7 +31,7 @@ export interface LinkProps extends GenericProps {
|
|
|
31
31
|
/** Link target. */
|
|
32
32
|
target?: HTMLAnchorProps['target'];
|
|
33
33
|
/** Typography variant. */
|
|
34
|
-
typography?:
|
|
34
|
+
typography?: TypographyInterface | TypographyTitleCustom;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -51,6 +51,12 @@ const getIconSize = (typography?: Typography) => {
|
|
|
51
51
|
|
|
52
52
|
case Typography.headline:
|
|
53
53
|
case Typography.title:
|
|
54
|
+
case Typography.custom.title1:
|
|
55
|
+
case Typography.custom.title2:
|
|
56
|
+
case Typography.custom.title3:
|
|
57
|
+
case Typography.custom.title4:
|
|
58
|
+
case Typography.custom.title5:
|
|
59
|
+
case Typography.custom.title6:
|
|
54
60
|
case Typography.body2:
|
|
55
61
|
case Typography.subtitle2:
|
|
56
62
|
return Size.s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import React, { CSSProperties, forwardRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import { Theme,
|
|
4
|
+
import { Theme, TypographyInterface } from '@lumx/react';
|
|
5
5
|
import { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -11,7 +11,7 @@ export interface SkeletonTypographyProps extends GenericProps {
|
|
|
11
11
|
/** Theme adapting the component to light or dark background. */
|
|
12
12
|
theme?: Theme;
|
|
13
13
|
/** Typography variant. */
|
|
14
|
-
typography:
|
|
14
|
+
typography: TypographyInterface;
|
|
15
15
|
/** Width CSS property. */
|
|
16
16
|
width?: CSSProperties['width'];
|
|
17
17
|
}
|
package/types.d.ts
CHANGED
|
@@ -112,9 +112,65 @@ export declare const Emphasis: {
|
|
|
112
112
|
};
|
|
113
113
|
export declare type Emphasis = ValueOf<typeof Emphasis>;
|
|
114
114
|
/**
|
|
115
|
-
* List of typographies.
|
|
115
|
+
* List of typographies that can't be customized.
|
|
116
|
+
*/
|
|
117
|
+
export declare const TypographyInterface: {
|
|
118
|
+
readonly overline: "overline";
|
|
119
|
+
readonly caption: "caption";
|
|
120
|
+
readonly body1: "body1";
|
|
121
|
+
readonly body2: "body2";
|
|
122
|
+
readonly subtitle1: "subtitle1";
|
|
123
|
+
readonly subtitle2: "subtitle2";
|
|
124
|
+
readonly title: "title";
|
|
125
|
+
readonly headline: "headline";
|
|
126
|
+
readonly display1: "display1";
|
|
127
|
+
};
|
|
128
|
+
export declare type TypographyInterface = ValueOf<typeof TypographyInterface>;
|
|
129
|
+
/**
|
|
130
|
+
* List of title typographies that can be customized (via CSS variables).
|
|
131
|
+
*/
|
|
132
|
+
export declare const TypographyTitleCustom: {
|
|
133
|
+
readonly title1: "custom-title1";
|
|
134
|
+
readonly title2: "custom-title2";
|
|
135
|
+
readonly title3: "custom-title3";
|
|
136
|
+
readonly title4: "custom-title4";
|
|
137
|
+
readonly title5: "custom-title5";
|
|
138
|
+
readonly title6: "custom-title6";
|
|
139
|
+
};
|
|
140
|
+
export declare type TypographyTitleCustom = ValueOf<typeof TypographyTitleCustom>;
|
|
141
|
+
declare const TypographyCustom: {
|
|
142
|
+
readonly intro: "intro";
|
|
143
|
+
readonly "body-large": "body-large";
|
|
144
|
+
readonly body: "body";
|
|
145
|
+
readonly quote: "quote";
|
|
146
|
+
readonly "publish-info": "publish-info";
|
|
147
|
+
readonly button: "button";
|
|
148
|
+
readonly title1: "custom-title1";
|
|
149
|
+
readonly title2: "custom-title2";
|
|
150
|
+
readonly title3: "custom-title3";
|
|
151
|
+
readonly title4: "custom-title4";
|
|
152
|
+
readonly title5: "custom-title5";
|
|
153
|
+
readonly title6: "custom-title6";
|
|
154
|
+
};
|
|
155
|
+
export declare type TypographyCustom = ValueOf<typeof TypographyCustom>;
|
|
156
|
+
/**
|
|
157
|
+
* List of all typographies.
|
|
116
158
|
*/
|
|
117
159
|
export declare const Typography: {
|
|
160
|
+
readonly custom: {
|
|
161
|
+
readonly intro: "intro";
|
|
162
|
+
readonly "body-large": "body-large";
|
|
163
|
+
readonly body: "body";
|
|
164
|
+
readonly quote: "quote";
|
|
165
|
+
readonly "publish-info": "publish-info";
|
|
166
|
+
readonly button: "button";
|
|
167
|
+
readonly title1: "custom-title1";
|
|
168
|
+
readonly title2: "custom-title2";
|
|
169
|
+
readonly title3: "custom-title3";
|
|
170
|
+
readonly title4: "custom-title4";
|
|
171
|
+
readonly title5: "custom-title5";
|
|
172
|
+
readonly title6: "custom-title6";
|
|
173
|
+
};
|
|
118
174
|
readonly overline: "overline";
|
|
119
175
|
readonly caption: "caption";
|
|
120
176
|
readonly body1: "body1";
|
|
@@ -125,7 +181,7 @@ export declare const Typography: {
|
|
|
125
181
|
readonly headline: "headline";
|
|
126
182
|
readonly display1: "display1";
|
|
127
183
|
};
|
|
128
|
-
export declare type Typography =
|
|
184
|
+
export declare type Typography = TypographyInterface | TypographyCustom;
|
|
129
185
|
/**
|
|
130
186
|
* All available aspect ratios.
|
|
131
187
|
*/
|
|
@@ -1333,7 +1389,7 @@ export interface LinkProps extends GenericProps {
|
|
|
1333
1389
|
/** Link target. */
|
|
1334
1390
|
target?: HTMLAnchorProps["target"];
|
|
1335
1391
|
/** Typography variant. */
|
|
1336
|
-
typography?:
|
|
1392
|
+
typography?: TypographyInterface | TypographyTitleCustom;
|
|
1337
1393
|
}
|
|
1338
1394
|
/**
|
|
1339
1395
|
* Link component.
|
|
@@ -1934,7 +1990,7 @@ export interface SkeletonTypographyProps extends GenericProps {
|
|
|
1934
1990
|
/** Theme adapting the component to light or dark background. */
|
|
1935
1991
|
theme?: Theme;
|
|
1936
1992
|
/** Typography variant. */
|
|
1937
|
-
typography:
|
|
1993
|
+
typography: TypographyInterface;
|
|
1938
1994
|
/** Width CSS property. */
|
|
1939
1995
|
width?: CSSProperties["width"];
|
|
1940
1996
|
}
|