@lanaco/lnc-react-ui 4.0.3 → 4.0.6
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/dist/Avatar.cjs +1 -1
- package/dist/Avatar.js +5 -6
- package/dist/Button.cjs +2 -2
- package/dist/Button.js +0 -1
- package/dist/CheckBoxInput.js +2 -2
- package/dist/Chip.cjs +1 -1
- package/dist/Chip.js +10 -9
- package/dist/ColorInput.js +18 -18
- package/dist/ConfirmationForm.cjs +5 -5
- package/dist/ConfirmationForm.js +16 -16
- package/dist/DataView.cjs +1 -1
- package/dist/DataView.js +35 -35
- package/dist/DecimalInput.js +41 -41
- package/dist/DoubleRangeSlider.js +30 -30
- package/dist/DragAndDropFile.js +162 -162
- package/dist/DragDropFiles.js +29 -29
- package/dist/Drawer.js +46 -46
- package/dist/Dropdown.js +36 -36
- package/dist/DropdownItem.js +19 -19
- package/dist/DropdownLookup.js +34 -34
- package/dist/DropdownMenu.js +43 -43
- package/dist/FileInput.js +21 -21
- package/dist/FlexGridItem.js +13 -13
- package/dist/Grid.cjs +1 -2
- package/dist/Grid.js +36 -8
- package/dist/GridItem.cjs +1 -1
- package/dist/GridItem.js +27 -7
- package/dist/Icon.cjs +2 -2
- package/dist/Icon.js +5 -6
- package/dist/IconButton.cjs +5 -5
- package/dist/IconButton.js +24 -25
- package/dist/Kanban.js +446 -446
- package/dist/MenuItem.cjs +2 -2
- package/dist/MenuItem.js +59 -58
- package/dist/Modal.js +38 -38
- package/dist/MultiSelectDropdown.js +2 -2
- package/dist/MultiSelectDropdownLookup.js +2 -2
- package/dist/NestedDropdownItem.js +43 -43
- package/dist/NestedMenuItem.js +44 -44
- package/dist/NotificationContainer.cjs +2 -2
- package/dist/NotificationContainer.js +24 -23
- package/dist/NumberInput.js +12 -12
- package/dist/PageLayout.cjs +2 -2
- package/dist/PageLayout.js +18 -18
- package/dist/PasswordInput.js +40 -40
- package/dist/RadioGroup.js +11 -11
- package/dist/RadioInput.js +6 -6
- package/dist/RangeSlider.js +25 -25
- package/dist/SearchBar.js +73 -73
- package/dist/Sidebar.js +11 -11
- package/dist/SwipeableDrawer.js +16 -16
- package/dist/TabItem.js +25 -25
- package/dist/Tabs.js +32 -26
- package/dist/TextAreaInput.js +30 -30
- package/dist/TextInput.js +22 -22
- package/dist/ThemeProvider.js +83 -83
- package/dist/TimeInput.js +4 -4
- package/dist/Toggle.cjs +1 -1
- package/dist/Toggle.js +0 -1
- package/dist/TreeMenu.js +56 -56
- package/dist/style.css +1 -5
- package/package.json +1 -1
- package/bundle-visualization.html +0 -4842
- package/custom-addons/ThemeSelector.js +0 -111
- package/custom-addons/register.js +0 -16
- package/custom-addons/theme-selector.css +0 -17
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// OutlineSelector.js
|
|
2
|
-
|
|
3
|
-
import React, { memo, useState } from "react";
|
|
4
|
-
import { useGlobals } from "@storybook/api";
|
|
5
|
-
import {
|
|
6
|
-
Icons,
|
|
7
|
-
IconButton,
|
|
8
|
-
} from "@storybook/components";
|
|
9
|
-
import { createPortal } from "react-dom";
|
|
10
|
-
import { useRef } from "react";
|
|
11
|
-
import styled from "@emotion/styled";
|
|
12
|
-
import { themes } from "../src/_utils/theme";
|
|
13
|
-
import "./theme-selector.css"
|
|
14
|
-
|
|
15
|
-
const StyledTooltip = styled.div`
|
|
16
|
-
position: absolute;
|
|
17
|
-
width: 180px;
|
|
18
|
-
z-index: 2147483647;
|
|
19
|
-
filter: drop-shadow(0px 5px 5px rgba(0, 0, 0, 0.05))
|
|
20
|
-
drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
|
|
21
|
-
border-radius: 8px;
|
|
22
|
-
font-size: 12px;
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
const Item = styled.div`
|
|
26
|
-
padding: 7px 15px;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
font-weight: 400;
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
const Triangle = styled.div`
|
|
32
|
-
position: absolute;
|
|
33
|
-
border-style: solid;
|
|
34
|
-
-webkit-transform: translate3d(8px, 0px, 0px);
|
|
35
|
-
-moz-transform: translate3d(8px, 0px, 0px);
|
|
36
|
-
-ms-transform: translate3d(8px, 0px, 0px);
|
|
37
|
-
transform: translate3d(8px, 0px, 0px);
|
|
38
|
-
bottom: autopx;
|
|
39
|
-
top: -8px;
|
|
40
|
-
right: autopx;
|
|
41
|
-
left: autopx;
|
|
42
|
-
border-bottom-width: 8px;
|
|
43
|
-
border-top-width: 0px;
|
|
44
|
-
border-right-width: 8px;
|
|
45
|
-
border-left-width: 8px;
|
|
46
|
-
border-top-color: transparent;
|
|
47
|
-
border-left-color: transparent;
|
|
48
|
-
border-right-color: transparent;
|
|
49
|
-
`;
|
|
50
|
-
|
|
51
|
-
export const ThemeSelector = memo(() => {
|
|
52
|
-
const [globals, updateGlobals] = useGlobals();
|
|
53
|
-
const buttonRef = useRef();
|
|
54
|
-
const [toggleTooltip, setToggleTooltip] = useState();
|
|
55
|
-
|
|
56
|
-
const changeTheme = (themeName) => {
|
|
57
|
-
setToggleTooltip((prev) => !prev);
|
|
58
|
-
updateGlobals({
|
|
59
|
-
theme: themeName,
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<div ref={buttonRef}>
|
|
65
|
-
<IconButton
|
|
66
|
-
style={{ position: "relative" }}
|
|
67
|
-
key="outline"
|
|
68
|
-
active={globals["theme"]}
|
|
69
|
-
title="Apply themes to the preview"
|
|
70
|
-
onClick={() => setToggleTooltip((prev) => !prev)}
|
|
71
|
-
>
|
|
72
|
-
<Icons icon="photo" />
|
|
73
|
-
</IconButton>
|
|
74
|
-
{toggleTooltip &&
|
|
75
|
-
createPortal(
|
|
76
|
-
<>
|
|
77
|
-
<Triangle
|
|
78
|
-
className="tooltip-triangle-lnc"
|
|
79
|
-
style={{
|
|
80
|
-
position: "absolute",
|
|
81
|
-
transform: "translate(74px)",
|
|
82
|
-
top: buttonRef?.current?.getBoundingClientRect()?.bottom + 5,
|
|
83
|
-
left: buttonRef?.current?.getBoundingClientRect()?.left - 70,
|
|
84
|
-
}}
|
|
85
|
-
></Triangle>
|
|
86
|
-
<StyledTooltip
|
|
87
|
-
className="tooltip-lnc"
|
|
88
|
-
style={{
|
|
89
|
-
top: buttonRef?.current?.getBoundingClientRect()?.bottom + 12,
|
|
90
|
-
left: buttonRef?.current?.getBoundingClientRect()?.left - 90,
|
|
91
|
-
}}
|
|
92
|
-
>
|
|
93
|
-
{themes.map((theme, i) => (
|
|
94
|
-
<Item
|
|
95
|
-
key={i}
|
|
96
|
-
style={{
|
|
97
|
-
color:
|
|
98
|
-
globals["theme"] === theme?.name ? "#FF4785" : "unset",
|
|
99
|
-
}}
|
|
100
|
-
onClick={() => changeTheme(theme?.name)}
|
|
101
|
-
>
|
|
102
|
-
{theme?.name}
|
|
103
|
-
</Item>
|
|
104
|
-
))}
|
|
105
|
-
</StyledTooltip>
|
|
106
|
-
</>,
|
|
107
|
-
document.body
|
|
108
|
-
)}
|
|
109
|
-
</div>
|
|
110
|
-
);
|
|
111
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { addons, types } from '@storybook/addons';
|
|
4
|
-
|
|
5
|
-
import { ThemeSelector } from './ThemeSelector';
|
|
6
|
-
|
|
7
|
-
const ADDON_ID = 'smyaddon';
|
|
8
|
-
|
|
9
|
-
addons.register(ADDON_ID, () => {
|
|
10
|
-
addons.add(ADDON_ID, {
|
|
11
|
-
title: 'Theme',
|
|
12
|
-
type: types.TOOL,
|
|
13
|
-
match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),
|
|
14
|
-
render: () => <ThemeSelector />,
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.dark .tooltip-lnc {
|
|
2
|
-
background: rgba(0, 0, 0, 0.95);
|
|
3
|
-
color: white;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.light .tooltip-lnc{
|
|
7
|
-
background: rgba(255,255,255,0.95);
|
|
8
|
-
color: black;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.dark .tooltip-triangle-lnc {
|
|
12
|
-
border-bottom-color: rgba(0, 0, 0, 0.95);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.light .tooltip-triangle-lnc{
|
|
16
|
-
border-bottom-color: rgba(255,255,255,0.95);
|
|
17
|
-
}
|