@vev/silke 1.0.10 → 1.0.12
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/CHANGELOG.md +9 -0
- package/dist/chunk-4MB64AQL.js +22 -0
- package/dist/chunk-4MB64AQL.js.LEGAL.txt +8 -0
- package/dist/chunk-4MB64AQL.js.map +7 -0
- package/dist/index.js +9 -25
- package/dist/index.js.LEGAL.txt +6 -9
- package/dist/index.js.map +4 -4
- package/dist/silke-code-editor-HZRG3D6C.js +23 -0
- package/dist/silke-code-editor-HZRG3D6C.js.map +7 -0
- package/dist/styles.css +4338 -2599
- package/esbuild.config.mjs +2 -1
- package/jest.config.js +2 -1
- package/package.json +12 -8
- package/src/_variables.scss +121 -1
- package/src/components/index.ts +6 -0
- package/src/components/silke-autocomplete-field/autocomplete-item.tsx +15 -13
- package/src/components/silke-autocomplete-field/autocomplete-tags.tsx +14 -7
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.mdx +31 -4
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +8 -6
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +64 -23
- package/src/components/silke-box/silke-box.scss +21 -47
- package/src/components/silke-box/silke-box.tsx +23 -31
- package/src/components/silke-breadcrumbs/silke-breadcrumb.scss +3 -3
- package/src/components/silke-button/index.ts +3 -1
- package/src/components/silke-button/silke-big-button.scss +38 -0
- package/src/components/silke-button/silke-big-button.tsx +49 -0
- package/src/components/silke-button/silke-button-set.tsx +15 -3
- package/src/components/silke-button/silke-button.mdx +41 -19
- package/src/components/silke-button/silke-button.scss +97 -90
- package/src/components/silke-button/silke-button.tsx +20 -5
- package/src/components/silke-button/silke-file-select-button.tsx +86 -0
- package/src/components/silke-card/silke-card-grid.tsx +9 -9
- package/src/components/silke-card/silke-card.mdx +23 -9
- package/src/components/silke-card/silke-card.scss +92 -39
- package/src/components/silke-card/silke-card.tsx +50 -27
- package/src/components/silke-checkbox/silke-checkbox.scss +39 -17
- package/src/components/silke-checkbox/silke-checkbox.tsx +4 -1
- package/src/components/silke-code-editor/index.tsx +12 -0
- package/src/components/silke-code-editor/silke-code-editor.mdx +97 -0
- package/src/components/silke-code-editor/silke-code-editor.tsx +52 -0
- package/src/components/silke-code-snippet/silke-code-snippet.scss +2 -10
- package/src/components/silke-code-snippet/silke-code-snippet.tsx +10 -3
- package/src/components/silke-color-palettes/silke-color-palette.tsx +11 -2
- package/src/components/silke-color-picker/color-picker.scss +10 -6
- package/src/components/silke-color-picker/silke-color-info.tsx +14 -4
- package/src/components/silke-color-picker/silke-color-picker-button.tsx +4 -3
- package/src/components/silke-color-picker/silke-color-picker.tsx +4 -2
- package/src/components/silke-color-picker/silke-opacity-slider.tsx +11 -12
- package/src/components/silke-color-swatches/silke-color-swatch-button.tsx +10 -4
- package/src/components/silke-color-swatches/silke-swatches.tsx +2 -2
- package/src/components/silke-content-column/index.ts +1 -0
- package/src/components/silke-content-column/silke-content-column.mdx +7 -0
- package/src/components/silke-content-column/silke-content-column.scss +39 -0
- package/src/components/silke-content-column/silke-content-column.tsx +14 -0
- package/src/components/silke-context-menu/silke-context-menu-item.tsx +9 -4
- package/src/components/silke-context-menu/silke-context-menu.mdx +16 -12
- package/src/components/silke-context-menu/silke-context-menu.scss +16 -0
- package/src/components/silke-context-menu/silke-context-menu.tsx +62 -39
- package/src/components/silke-css-number-field/silke-css-context.tsx +1 -0
- package/src/components/silke-css-number-field/silke-css-number-field.scss +18 -3
- package/src/components/silke-css-number-field/silke-css-number-field.tsx +32 -13
- package/src/components/silke-css-number-field/utils.ts +2 -0
- package/src/components/silke-divider/silke-divider.scss +4 -2
- package/src/components/silke-drawer/silke-drawer.scss +3 -3
- package/src/components/silke-drawer/silke-drawer.tsx +3 -3
- package/src/components/silke-form/silke-form.tsx +1 -9
- package/src/components/silke-form-schema/fields/array-field-inline.tsx +2 -3
- package/src/components/silke-form-schema/fields/array-field-modal.tsx +1 -1
- package/src/components/silke-form-schema/fields/array-field.tsx +2 -2
- package/src/components/silke-form-schema/fields/event-field.tsx +120 -0
- package/src/components/silke-form-schema/fields/icon-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/image-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/link-field.tsx +8 -1
- package/src/components/silke-form-schema/fields/number-field.tsx +24 -8
- package/src/components/silke-form-schema/fields/object-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/select-field.tsx +9 -2
- package/src/components/silke-form-schema/fields/styles.scss +2 -2
- package/src/components/silke-form-schema/fields/toggle-field.tsx +14 -13
- package/src/components/silke-form-schema/fields/upload-field.tsx +37 -0
- package/src/components/silke-form-schema/fields/utils/generate-image.ts +3 -4
- package/src/components/silke-form-schema/fields/utils/generate-title.ts +1 -3
- package/src/components/silke-form-schema/index.ts +1 -0
- package/src/components/silke-form-schema/silke-extended-fields-context.tsx +22 -0
- package/src/components/silke-form-schema/silke-schema-field.tsx +19 -6
- package/src/components/silke-icon/silke-icon.scss +3 -2
- package/src/components/silke-icon/silke-icon.tsx +7 -3
- package/src/components/silke-icon/silke-shape.tsx +3 -2
- package/src/components/silke-icon-picker/emoji-tab.tsx +2 -2
- package/src/components/silke-icon-picker/icons-tab.tsx +1 -1
- package/src/components/silke-icon-picker/silke-icon-picker.tsx +1 -1
- package/src/components/silke-iframe-portal/index.ts +4 -0
- package/src/components/silke-iframe-portal/silke-iframe-context.ts +6 -0
- package/src/components/silke-iframe-portal/silke-iframe-css-link.tsx +20 -0
- package/src/components/silke-iframe-portal/silke-iframe-portal.mdx +34 -0
- package/src/components/silke-iframe-portal/silke-iframe-portal.tsx +77 -0
- package/src/components/silke-iframe-portal/silke-iframe-script.tsx +20 -0
- package/src/components/silke-link/silke-link.scss +2 -2
- package/src/components/silke-link/silke-link.tsx +8 -9
- package/src/components/silke-list/silke-list.scss +1 -1
- package/src/components/silke-list-card/index.ts +1 -0
- package/src/components/silke-list-card/silke-list-card.mdx +50 -0
- package/src/components/silke-list-card/silke-list-card.scss +57 -0
- package/src/components/silke-list-card/silke-list-card.tsx +65 -0
- package/src/components/silke-loader/index.ts +1 -0
- package/src/components/silke-loader/silke-loader-overlay.tsx +63 -0
- package/src/components/silke-loader/silke-loader.scss +112 -0
- package/src/components/silke-loader/silke-loader.tsx +1 -0
- package/src/components/silke-modal/silke-confirmation-modal.tsx +1 -1
- package/src/components/silke-modal/silke-modal.mdx +1 -1
- package/src/components/silke-modal/silke-modal.scss +16 -10
- package/src/components/silke-modal/silke-modal.tsx +65 -47
- package/src/components/silke-navigation-link/silke-navigation-link.scss +69 -41
- package/src/components/silke-navigation-link/silke-navigation-link.tsx +26 -14
- package/src/components/silke-notification/confetti.tsx +164 -0
- package/src/components/silke-notification/silke-notification.mdx +137 -20
- package/src/components/silke-notification/silke-notification.scss +116 -89
- package/src/components/silke-notification/silke-notification.tsx +44 -113
- package/src/components/silke-object-field/silke-object-field.tsx +1 -1
- package/src/components/silke-overflow-menu/silke-overflow-menu.mdx +2 -2
- package/src/components/silke-overflow-menu/silke-overflow-menu.scss +12 -4
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +53 -30
- package/src/components/silke-popover/silke-popover.mdx +2 -2
- package/src/components/silke-popover/silke-popover.tsx +23 -5
- package/src/components/silke-progress-indicator/silke-progress-indicator.scss +5 -5
- package/src/components/silke-radio-button/silke-radio-button-group.tsx +1 -1
- package/src/components/silke-radio-button/silke-radio-button.scss +24 -9
- package/src/components/silke-search-field/silke-search-field.tsx +10 -5
- package/src/components/silke-select-field/silke-select-field.mdx +11 -5
- package/src/components/silke-skeleton/silke-skeleton.scss +2 -2
- package/src/components/silke-slider/range-slider.scss +13 -10
- package/src/components/silke-slider/silke-slider.tsx +5 -0
- package/src/components/silke-sortable-list/silke-nested-sortable-item.tsx +105 -0
- package/src/components/silke-sortable-list/silke-nested-sortable-list.scss +37 -25
- package/src/components/silke-sortable-list/silke-nested-sortable-list.tsx +180 -127
- package/src/components/silke-sortable-list/silke-nested-sortable-utils.ts +53 -23
- package/src/components/silke-sortable-list/silke-sortable-item-wrapper.tsx +1 -1
- package/src/components/silke-sortable-list/silke-sortable-list.mdx +12 -16
- package/src/components/silke-sortable-list/silke-sortable-list.scss +39 -29
- package/src/components/silke-sortable-list/silke-sortable-list.tsx +27 -15
- package/src/components/silke-steps/index.ts +1 -0
- package/src/components/silke-steps/silke-steps.mdx +60 -0
- package/src/components/silke-steps/silke-steps.scss +14 -0
- package/src/components/silke-steps/silke-steps.tsx +53 -0
- package/src/components/silke-table/silke-table.mdx +44 -13
- package/src/components/silke-table/silke-table.scss +19 -9
- package/src/components/silke-table/silke-table.tsx +80 -71
- package/src/components/silke-table/table-row.tsx +11 -6
- package/src/components/silke-tabs/silke-tab.tsx +4 -0
- package/src/components/silke-tabs/silke-tabs.scss +18 -15
- package/src/components/silke-tabs/silke-tabs.tsx +4 -7
- package/src/components/silke-tag/silke-tag.mdx +36 -2
- package/src/components/silke-tag/silke-tag.scss +49 -30
- package/src/components/silke-tag/silke-tag.tsx +21 -6
- package/src/components/silke-text/silke-text-types.ts +2 -1
- package/src/components/silke-text/silke-text.mdx +28 -20
- package/src/components/silke-text/silke-text.scss +8 -7
- package/src/components/silke-text/silke-title.scss +1 -1
- package/src/components/silke-text-field/silke-text-field-outline.tsx +4 -4
- package/src/components/silke-text-field/silke-text-field.mdx +32 -14
- package/src/components/silke-text-field/silke-text-field.scss +41 -23
- package/src/components/silke-text-field/silke-text-field.tsx +13 -5
- package/src/components/silke-text-field/text-field-context.tsx +1 -1
- package/src/components/silke-theme-editor/index.ts +1 -0
- package/src/components/silke-theme-editor/silke-theme-editor.tsx +165 -0
- package/src/components/silke-tile/silke-tile.scss +13 -18
- package/src/components/silke-tile/silke-tile.tsx +11 -17
- package/src/components/silke-toggle/silke-toggle.scss +17 -9
- package/src/components/silke-toggle/silke-toggle.tsx +1 -1
- package/src/components/silke-toolbar/silke-toolbar.scss +1 -1
- package/src/components/silke-tooltip/silke-definition-tooltip.tsx +14 -6
- package/src/components/silke-tooltip/silke-icon-tooltip.tsx +48 -34
- package/src/components/silke-tooltip/silke-interactive-tooltip.tsx +5 -3
- package/src/components/silke-tooltip/silke-tooltip.mdx +69 -2
- package/src/components/silke-tooltip/silke-tooltip.scss +71 -46
- package/src/components/silke-tooltip/silke-tooltip.tsx +142 -52
- package/src/components/silke-tooltip/utils.ts +93 -0
- package/src/components/silke-upload-field/silke-upload-field.mdx +14 -0
- package/src/components/silke-upload-field/silke-upload-field.scss +26 -17
- package/src/components/silke-upload-field/silke-upload-field.tsx +37 -14
- package/src/docs/app.tsx +118 -25
- package/src/docs/components/code-block/code-block.scss +0 -2
- package/src/docs/components/code-block/code-block.tsx +17 -9
- package/src/hooks/drag-and-drop/use-drag.tsx +5 -1
- package/src/hooks/drag-and-drop/use-drop.tsx +5 -4
- package/src/icons.tsx +194 -10
- package/src/index.mdx +66 -1
- package/src/main.tsx +5 -2
- package/src/silke-theme-provider.tsx +51 -3
- package/src/styles/core.scss +56 -91
- package/webpack.docs.ts +1 -3
- package/webpack.config.ts +0 -131
package/src/index.mdx
CHANGED
|
@@ -1,5 +1,70 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
# Vev Silke UI Design Kit
|
|
2
4
|
|
|
3
5
|
This document is the Vev design language & system.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
The Figma implementation of the Vev design system is available [here](https://www.figma.com/file/Sp7VVABeoTGZdQl2mTsx2y/Silke-Library?node-id=0-1&t=Vs9W0htcjI7DGxti-0).
|
|
8
|
+
|
|
9
|
+
## Solid colors
|
|
10
|
+
These are the solid colors we have in Silke.
|
|
11
|
+
The easiest way to use them is to use the **bg** and **color** props on the **SilkeBox** and **SilkeText** components.
|
|
12
|
+
But you can also use them in your own components by using the CSS variables, the nameing of the CSS variables can be found in the tiles below.
|
|
13
|
+
|
|
14
|
+
You should never use a HEX color directly in your code, always use the CSS variables.
|
|
15
|
+
|
|
16
|
+
{[
|
|
17
|
+
"neutral",
|
|
18
|
+
"accent",
|
|
19
|
+
"error",
|
|
20
|
+
"warning",
|
|
21
|
+
"success",
|
|
22
|
+
"support-primary",
|
|
23
|
+
"support-secondary",
|
|
24
|
+
"support-tertiary",
|
|
25
|
+
"brand-primary",
|
|
26
|
+
"brand-secondary",
|
|
27
|
+
"brand-tertiary",
|
|
28
|
+
"brand-quaternary",
|
|
29
|
+
].map((color) => (
|
|
30
|
+
<div key={color}>
|
|
31
|
+
<h3>{color}</h3>
|
|
32
|
+
<div style={{display:"flex", flexWrap:"wrap"}}>
|
|
33
|
+
{[0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100].map((i) =>
|
|
34
|
+
(color !== "neutral" && (i > 60 || i < 10)) ? null : (
|
|
35
|
+
<div
|
|
36
|
+
key={i}
|
|
37
|
+
style={{
|
|
38
|
+
background: "var(--color-" + color + "-" + i + ")",
|
|
39
|
+
color:"var(--color-neutral-"+(i < 40 ? 100 : 0)+")",
|
|
40
|
+
width: 200,
|
|
41
|
+
height: 80,
|
|
42
|
+
fontSize:12,
|
|
43
|
+
padding:10
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
{color+"-"+i}<br />
|
|
47
|
+
var(--color-{color+"-"+i})
|
|
48
|
+
</div>
|
|
49
|
+
))}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
))}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Example usage with SilkeBox
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
<SilkeBox>
|
|
59
|
+
{[0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100].map((i) => (
|
|
60
|
+
<SilkeBox key={i} size="xxl" bg={"neutral-" + i} align="center">
|
|
61
|
+
<SilkeText color={i < 60 ? "neutral-100" : "neutral-0"}>
|
|
62
|
+
neutral-{i}
|
|
63
|
+
</SilkeText>
|
|
64
|
+
</SilkeBox>
|
|
65
|
+
))}
|
|
66
|
+
</SilkeBox>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
package/src/main.tsx
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import './styles/core.scss';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
4
|
|
|
5
5
|
(async function () {
|
|
6
|
+
const container = document.getElementById('root');
|
|
7
|
+
if (!container) return;
|
|
8
|
+
const root = createRoot(container);
|
|
6
9
|
const { App } = await import('./docs');
|
|
7
|
-
render(<App
|
|
10
|
+
root.render(<App />);
|
|
8
11
|
})();
|
|
@@ -1,25 +1,73 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
1
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
|
2
|
+
import tinycolor from 'tinycolor2';
|
|
2
3
|
import SilkePopoverProvider from './components/silke-popover/popover-context';
|
|
3
4
|
|
|
5
|
+
type SilkeColorGroup =
|
|
6
|
+
| 'surface'
|
|
7
|
+
| 'accent'
|
|
8
|
+
| 'error'
|
|
9
|
+
| 'warning'
|
|
10
|
+
| 'success'
|
|
11
|
+
| 'neutral'
|
|
12
|
+
| 'support-primary'
|
|
13
|
+
| 'support-secondary'
|
|
14
|
+
| 'support-tertiary'
|
|
15
|
+
| 'brand-primary'
|
|
16
|
+
| 'brand-secondary'
|
|
17
|
+
| 'brand-tertiary'
|
|
18
|
+
| 'brand-quaternary';
|
|
19
|
+
|
|
20
|
+
export type SilkeColor =
|
|
21
|
+
| `${SilkeColorGroup}-${'10' | '20' | '30' | '40' | '50' | '60'}`
|
|
22
|
+
| `neutral-${'0' | '5' | '70' | '80' | '90' | '100'}`
|
|
23
|
+
| `brand-${'primary' | 'secondary' | 'tertiary'}-bright`
|
|
24
|
+
| `surface-${'0' | '1' | '2' | '3' | '4'}`;
|
|
25
|
+
|
|
26
|
+
export type SilkeColorTheme = Partial<Record<`color-${SilkeColor}`, string>>;
|
|
27
|
+
|
|
4
28
|
type SilkeContextModel = {
|
|
5
29
|
/** WHen a overflow menu is mounted this is set, call function to close */
|
|
6
30
|
mountedOverflowMenu?: () => void;
|
|
7
|
-
|
|
31
|
+
colors?: SilkeColorTheme;
|
|
8
32
|
onFileUpload: (file: File) => Promise<string>;
|
|
9
33
|
};
|
|
10
34
|
|
|
11
35
|
type SilkeThemeProviderProps = {
|
|
12
|
-
children: React.
|
|
36
|
+
children: React.ReactElement;
|
|
13
37
|
} & Omit<SilkeContextModel, 'mountedOverflowMenu'>;
|
|
14
38
|
|
|
15
39
|
const SilkeThemeContext = React.createContext<SilkeContextModel>({ onFileUpload: async () => '' });
|
|
40
|
+
|
|
16
41
|
export function useSilkeContext() {
|
|
17
42
|
return useContext(SilkeThemeContext);
|
|
18
43
|
}
|
|
19
44
|
|
|
20
45
|
export function SilkeThemeProvider({ children, ...rest }: SilkeThemeProviderProps) {
|
|
46
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
47
|
+
const { colors } = rest;
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
// We use a non wrapping element so we don't need to care about layout and fill etc, can result in 2 theme providers using same parent element, but very unlikely
|
|
50
|
+
const el = ref.current?.parentElement;
|
|
51
|
+
if (!el || !colors) return;
|
|
52
|
+
for (const key in colors) {
|
|
53
|
+
const color = colors[key as keyof SilkeColorTheme];
|
|
54
|
+
if (color) {
|
|
55
|
+
el?.style.setProperty('--' + key, color);
|
|
56
|
+
const { r, g, b } = tinycolor(color).toRgb();
|
|
57
|
+
el?.style.setProperty(`--${key}-rgb`, `${r},${g},${b}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return () => {
|
|
62
|
+
for (const key in colors) {
|
|
63
|
+
el?.style.removeProperty('--' + key);
|
|
64
|
+
el?.style.removeProperty(`--${key}-rgb`);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}, [colors]);
|
|
21
68
|
return (
|
|
22
69
|
<SilkeThemeContext.Provider value={rest}>
|
|
70
|
+
<div ref={ref} />
|
|
23
71
|
<SilkePopoverProvider>{children}</SilkePopoverProvider>
|
|
24
72
|
</SilkeThemeContext.Provider>
|
|
25
73
|
);
|
package/src/styles/core.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use "../variables" as *;
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
@font-face {
|
|
4
5
|
font-family: "Aeonik";
|
|
5
6
|
src: url("https://cdn.vev.design/font/Uved2MhL9o/Aeonik-Regular.woff2")
|
|
@@ -24,13 +25,19 @@
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
::-webkit-scrollbar-thumb {
|
|
27
|
-
border-radius:
|
|
28
|
-
border:
|
|
29
|
-
|
|
30
|
-
background-color:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
);
|
|
28
|
+
border-radius: 7px;
|
|
29
|
+
border-right: 2px solid rgba(0, 0, 0, 0);
|
|
30
|
+
background-clip: padding-box;
|
|
31
|
+
background-color: transparent;
|
|
32
|
+
}
|
|
33
|
+
*:hover::-webkit-scrollbar-thumb{
|
|
34
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media (hover: none) {
|
|
38
|
+
::-webkit-scrollbar-thumb{
|
|
39
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
40
|
+
}
|
|
34
41
|
}
|
|
35
42
|
|
|
36
43
|
::-webkit-clear-button {
|
|
@@ -39,15 +46,15 @@
|
|
|
39
46
|
|
|
40
47
|
::-webkit-inner-spin-button {
|
|
41
48
|
background-color: rgba(
|
|
42
|
-
var(--color-neutral-
|
|
49
|
+
var(--color-neutral-100-rgb),
|
|
43
50
|
var(--opacity-level-light)
|
|
44
51
|
);
|
|
45
|
-
color: var(--color-neutral-
|
|
52
|
+
color: var(--color-neutral-100);
|
|
46
53
|
display: none;
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
::-webkit-calendar-picker-indicator:hover {
|
|
50
|
-
color: var(--color-brand-primary-
|
|
57
|
+
color: var(--color-brand-primary-60);
|
|
51
58
|
background: none;
|
|
52
59
|
background-color: none;
|
|
53
60
|
}
|
|
@@ -61,7 +68,7 @@
|
|
|
61
68
|
margin: 0;
|
|
62
69
|
padding: 0;
|
|
63
70
|
height: 100%;
|
|
64
|
-
background: var(--color-neutral-
|
|
71
|
+
background: var(--color-neutral-0);
|
|
65
72
|
overflow: hidden;
|
|
66
73
|
text-rendering: geometricPrecision;
|
|
67
74
|
-webkit-font-smoothing: antialiased;
|
|
@@ -74,7 +81,7 @@
|
|
|
74
81
|
}
|
|
75
82
|
|
|
76
83
|
svg {
|
|
77
|
-
fill: var(--color-neutral-
|
|
84
|
+
fill: var(--color-neutral-100);
|
|
78
85
|
}
|
|
79
86
|
|
|
80
87
|
*,
|
|
@@ -93,7 +100,7 @@
|
|
|
93
100
|
|
|
94
101
|
hr {
|
|
95
102
|
background-color: rgba(
|
|
96
|
-
var(--color-neutral-
|
|
103
|
+
var(--color-neutral-100-rgb),
|
|
97
104
|
var(--opacity-level-light)
|
|
98
105
|
);
|
|
99
106
|
border-width: 0;
|
|
@@ -108,7 +115,7 @@
|
|
|
108
115
|
|
|
109
116
|
a[rel="button"],
|
|
110
117
|
a[rel="button"]:hover {
|
|
111
|
-
color: var(--color-neutral-
|
|
118
|
+
color: var(--color-neutral-100);
|
|
112
119
|
}
|
|
113
120
|
|
|
114
121
|
pre {
|
|
@@ -123,7 +130,7 @@
|
|
|
123
130
|
transition: background-color 5s ease-in-out 0s;
|
|
124
131
|
-webkit-box-shadow: 0 0 0 1000px transparent inset !important;
|
|
125
132
|
background-color: transparent !important;
|
|
126
|
-
-webkit-text-fill-color: var(--color-
|
|
133
|
+
-webkit-text-fill-color: var(--color-accent-40) !important;
|
|
127
134
|
}
|
|
128
135
|
|
|
129
136
|
html span[type="button"] {
|
|
@@ -227,84 +234,42 @@
|
|
|
227
234
|
div[data-shadow="level4"] {
|
|
228
235
|
filter: var(--shadow-level-4);
|
|
229
236
|
}
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
@each $name, $color in $colors {
|
|
240
|
+
.bg-#{$name}, .bg-hover-#{$name}:hover {
|
|
241
|
+
background-color: #{$color};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.color-#{$name}, .color-hover-#{$name}:hover {
|
|
245
|
+
color: #{$color};
|
|
246
|
+
}
|
|
247
|
+
}
|
|
230
248
|
}
|
|
231
249
|
|
|
232
250
|
:root {
|
|
233
|
-
|
|
234
|
-
--color-neutral-high-pure: #fcfcfc;
|
|
235
|
-
--color-neutral-high-light: #dadada;
|
|
236
|
-
--color-neutral-high-soft: #c2c2c2;
|
|
237
|
-
--color-neutral-high-medium: #a9a9a9;
|
|
238
|
-
--color-neutral-high-spark: #848484;
|
|
239
|
-
--color-neutral-high-dark: #6c6c6c;
|
|
240
|
-
--color-neutral-low-light: #535353;
|
|
241
|
-
--color-neutral-low-soft: #3E3E3E;
|
|
242
|
-
--color-neutral-low-medium: #2F2F2F;
|
|
243
|
-
--color-neutral-low-spark: #252525;
|
|
244
|
-
--color-neutral-low-dark: #1f1f1f;
|
|
245
|
-
--color-neutral-low-pure: #0b0b0b;
|
|
251
|
+
|
|
246
252
|
|
|
247
253
|
// opacity
|
|
254
|
+
--opacity-level-10: 0.90;
|
|
248
255
|
--opacity-level-semiopaque: 0.72;
|
|
249
256
|
--opacity-level-intense: 0.64;
|
|
250
257
|
--opacity-level-medium: 0.32;
|
|
251
258
|
--opacity-level-light: 0.16;
|
|
259
|
+
--opacity-level-semitransparent: 0.08;
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
/** Creating all the css variables and the rgb variables **/
|
|
265
|
+
@each $name, $color in $colors {
|
|
266
|
+
--color-#{$name} : #{$color};
|
|
267
|
+
--color-#{$name}-rgb: #{red($color)}, #{green($color)}, #{blue($color)};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
|
|
252
271
|
|
|
253
|
-
|
|
254
|
-
--color-support-secondary-light: #e5f2ff;
|
|
255
|
-
--color-support-secondary-soft: #80bfff;
|
|
256
|
-
--color-support-secondary-spark: #0d86ff;
|
|
257
|
-
--color-support-secondary-dark: #0059b2;
|
|
258
|
-
--color-support-secondary-darkest: #003366;
|
|
259
|
-
--color-brand-primary-soft: #fae794;
|
|
260
|
-
--color-brand-primary-bright: #ffff00;
|
|
261
|
-
--color-brand-primary-spark: #ECB54F;
|
|
262
|
-
--color-brand-primary-dark: #5a2820;
|
|
263
|
-
--color-brand-secondary-bright: #01dccd;
|
|
264
|
-
--color-brand-secondary-spark: #57ada1;
|
|
265
|
-
--color-brand-secondary-dark: #173343;
|
|
266
|
-
--color-brand-secondary-soft: #BCDACB;
|
|
267
|
-
--color-feedback-warning-spark: #ee2b3b;
|
|
268
|
-
--color-feedback-warning-medium: #F07580;
|
|
269
|
-
--color-feedback-warning-dark: #981B25;
|
|
270
|
-
--color-brand-tertiary-dark: #4c1726;
|
|
271
|
-
--color-brand-quaternary-soft: #eaceb4;
|
|
272
|
-
--color-brand-quaternary-spark: #a48a7b;
|
|
273
|
-
--color-brand-quaternary-dark: #46372c;
|
|
274
|
-
|
|
275
|
-
// greyscale
|
|
276
|
-
--color-neutral-high-pure-rgb: 243, 243, 243; // #F3F3F3;
|
|
277
|
-
--color-neutral-high-light-rgb: 218, 218, 218; // #DADADA;
|
|
278
|
-
--color-neutral-high-soft-rgb: 194, 194, 194; // #C2C2C2;
|
|
279
|
-
--color-neutral-high-medium-rgb: 169, 169, 169; // #A9A9A9;
|
|
280
|
-
--color-neutral-high-spark-rgb: 132, 132, 132; // #848484;
|
|
281
|
-
--color-neutral-high-dark-rgb: 108, 108, 108; // #6C6C6C;
|
|
282
|
-
--color-neutral-low-light-rgb: 83, 83, 83; // #535353;
|
|
283
|
-
--color-neutral-low-soft-rgb: 62, 62, 62; // #2F2F2F;
|
|
284
|
-
--color-neutral-low-medium-rgb: 47, 47, 47; // #2A2A2A;
|
|
285
|
-
--color-neutral-low-spark-rgb: 37, 37, 37; // #252525;
|
|
286
|
-
--color-neutral-low-dark-rgb: 31, 31, 31; // #1F1F1F;
|
|
287
|
-
--color-neutral-low-pure-rgb: 11, 11, 11; // #0B0B0B;
|
|
288
|
-
|
|
289
|
-
// colors
|
|
290
|
-
--color-support-secondary-light-rgb: 229, 242, 255; // #E5F2FF;
|
|
291
|
-
--color-support-secondary-soft-rgb: 128, 191, 255; // #80BFFF;
|
|
292
|
-
--color-support-secondary-spark-rgb: 13, 134, 255; // #0D86FF;
|
|
293
|
-
--color-support-secondary-dark-rgb: 0, 89, 178; // #0059B2;
|
|
294
|
-
--color-support-secondary-darkest-rgb: 0, 51, 102; // #003366;
|
|
295
|
-
--color-brand-primary-soft-rgb: 250, 231, 148; // #FAE794;
|
|
296
|
-
--color-brand-primary-bright-rgb: 255, 255, 0; // #FFFF00;
|
|
297
|
-
--color-brand-primary-dark-rgb: 90, 40, 32; // #5A2820;
|
|
298
|
-
--color-brand-secondary-bright-rgb: 1, 220, 205; // #01DCCD;
|
|
299
|
-
--color-brand-secondary-spark-rgb: 87, 173, 161; // #57ADA1;
|
|
300
|
-
--color-brand-secondary-dark-rgb: 23, 51, 67; // #173343;
|
|
301
|
-
--color-feedback-warning-spark-rgb: 238, 43, 59; // #EE2B3B;
|
|
302
|
-
--color-feedback-warning-medium-rgb: 240, 117, 128; // #F07580;
|
|
303
|
-
--color-feedback-warning-dark-rgb: 152, 27, 37; // #981B25;
|
|
304
|
-
--color-brand-tertiary-dark-rgb: 76, 23, 38; // #4C1726;
|
|
305
|
-
--color-brand-quaternary-soft-rgb: 234, 206, 180; // #EACEB4;
|
|
306
|
-
--color-brand-quaternary-spark-rgb: 164, 138, 123; // #A48A7B;
|
|
307
|
-
--color-brand-quaternary-dark-rgb: 70, 55, 44; // #46372C;
|
|
272
|
+
--color-dynamic: var(--color-brand-primary-30);
|
|
308
273
|
|
|
309
274
|
--border-radius-tiny: 4px;
|
|
310
275
|
--border-radius-small: 8px;
|
|
@@ -314,12 +279,12 @@
|
|
|
314
279
|
--space-s: 8px;
|
|
315
280
|
--space-m: 16px;
|
|
316
281
|
|
|
317
|
-
--shadow-level-1: drop-shadow(0px 1px 2px rgba(var(--color-neutral-
|
|
318
|
-
drop-shadow(0px 2px 6px rgba(var(--color-neutral-
|
|
319
|
-
--shadow-level-2: drop-shadow(0px 2px 4px rgba(var(--color-neutral-
|
|
320
|
-
drop-shadow(0px 4px 12px rgba(var(--color-neutral-
|
|
321
|
-
--shadow-level-3: drop-shadow(0px 4px 8px rgba(var(--color-neutral-
|
|
322
|
-
drop-shadow(0px 8px 20px rgba(var(--color-neutral-
|
|
323
|
-
--shadow-level-4: drop-shadow(0px 4px 8px rgba(var(--color-neutral-
|
|
324
|
-
drop-shadow(0px 16px 40px rgba(var(--color-neutral-
|
|
282
|
+
--shadow-level-1: drop-shadow(0px 1px 2px rgba(var(--color-neutral-0-rgb), var(--opacity-level-light)))
|
|
283
|
+
drop-shadow(0px 2px 6px rgba(var(--color-neutral-0-rgb), var(--opacity-level-light)));
|
|
284
|
+
--shadow-level-2: drop-shadow(0px 2px 4px rgba(var(--color-neutral-0-rgb), var(--opacity-level-light)))
|
|
285
|
+
drop-shadow(0px 4px 12px rgba(var(--color-neutral-0-rgb), var(--opacity-level-light)));
|
|
286
|
+
--shadow-level-3: drop-shadow(0px 4px 8px rgba(var(--color-neutral-0-rgb), var(--opacity-level-light)))
|
|
287
|
+
drop-shadow(0px 8px 20px rgba(var(--color-neutral-0-rgb), var(--opacity-level-light)));
|
|
288
|
+
--shadow-level-4: drop-shadow(0px 4px 8px rgba(var(--color-neutral-0-rgb), var(--opacity-level-intense)))
|
|
289
|
+
drop-shadow(0px 16px 40px rgba(var(--color-neutral-0-rgb), var(--opacity-level-light)));
|
|
325
290
|
}
|
package/webpack.docs.ts
CHANGED
|
@@ -201,9 +201,7 @@ export default async function (env: Env) {
|
|
|
201
201
|
|
|
202
202
|
new ForkTsCheckerWebpackPlugin({
|
|
203
203
|
async: isDev,
|
|
204
|
-
|
|
205
|
-
devServer: false,
|
|
206
|
-
},
|
|
204
|
+
devServer: false,
|
|
207
205
|
typescript: {
|
|
208
206
|
configFile: path.resolve(__dirname, 'tsconfig.json'),
|
|
209
207
|
diagnosticOptions: {
|
package/webpack.config.ts
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
|
2
|
-
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import webpack from 'webpack';
|
|
5
|
-
import babelrc from '../../babel.config.json';
|
|
6
|
-
import WebpackPackageWatcher from '../../tools/webpack-package-watcher';
|
|
7
|
-
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
8
|
-
import pkg from './package.json';
|
|
9
|
-
|
|
10
|
-
const externals: { [dependency: string]: string } = {};
|
|
11
|
-
for (const key in pkg.peerDependencies) externals[key] = key;
|
|
12
|
-
|
|
13
|
-
type Env = {
|
|
14
|
-
production?: boolean;
|
|
15
|
-
development?: boolean;
|
|
16
|
-
watch?: boolean;
|
|
17
|
-
stats?: boolean;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default function (env: Env = {}) {
|
|
21
|
-
const srcDir = path.join(__dirname, 'src');
|
|
22
|
-
const isDev = !env.production && !env.watch;
|
|
23
|
-
const mode = isDev ? 'development' : 'production';
|
|
24
|
-
console.log('Build silke: ' + mode);
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
mode,
|
|
28
|
-
entry: './src/index',
|
|
29
|
-
cache: {
|
|
30
|
-
type: 'filesystem',
|
|
31
|
-
name: 'silke-' + mode,
|
|
32
|
-
cacheDirectory: path.resolve(__dirname, '../../.cache'),
|
|
33
|
-
},
|
|
34
|
-
watch: false,
|
|
35
|
-
stats: 'errors-only',
|
|
36
|
-
devtool: isDev ? 'eval-source-map' : 'source-map',
|
|
37
|
-
output: {
|
|
38
|
-
path: path.resolve(__dirname, 'dist'),
|
|
39
|
-
libraryTarget: 'commonjs2', // Important
|
|
40
|
-
filename: 'index.js',
|
|
41
|
-
},
|
|
42
|
-
resolve: {
|
|
43
|
-
modules: ['node_modules', path.resolve('./src')],
|
|
44
|
-
extensions: ['.ts', '.tsx', '.js'],
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
externals,
|
|
48
|
-
optimization: {
|
|
49
|
-
// usedExports: true,
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
module: {
|
|
53
|
-
rules: [
|
|
54
|
-
{
|
|
55
|
-
test: /\.scss$/i,
|
|
56
|
-
use: [
|
|
57
|
-
MiniCssExtractPlugin.loader,
|
|
58
|
-
{
|
|
59
|
-
loader: 'css-loader',
|
|
60
|
-
options: {
|
|
61
|
-
sourceMap: true,
|
|
62
|
-
modules: {
|
|
63
|
-
localIdentName: '[name]-[local]__[hash:base64:5]',
|
|
64
|
-
localIdentContext: path.resolve(__dirname, 'src'),
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
// Compiles Sass to CSS
|
|
69
|
-
{
|
|
70
|
-
loader: 'sass-loader',
|
|
71
|
-
options: {
|
|
72
|
-
additionalData: `@import "${path
|
|
73
|
-
.resolve('./src/styles/variables.scss')
|
|
74
|
-
.replace(/\\/g, '/')}";`,
|
|
75
|
-
sourceMap: true,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
// Ts loader does not work when import d.ts, so only include .ts and tsx files
|
|
82
|
-
test: /(?<!\.d)\.tsx?$/,
|
|
83
|
-
exclude: /node_modules/,
|
|
84
|
-
include: srcDir,
|
|
85
|
-
use: [
|
|
86
|
-
{
|
|
87
|
-
loader: 'babel-loader',
|
|
88
|
-
options: {
|
|
89
|
-
cacheDirectory: true,
|
|
90
|
-
...babelrc,
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
plugins: [
|
|
98
|
-
// new LodashPlugin(),
|
|
99
|
-
env.stats && new BundleAnalyzerPlugin(),
|
|
100
|
-
env.watch && new WebpackPackageWatcher(path.resolve(__dirname, 'src')),
|
|
101
|
-
progress(),
|
|
102
|
-
new MiniCssExtractPlugin({
|
|
103
|
-
filename: 'silke.css',
|
|
104
|
-
}),
|
|
105
|
-
|
|
106
|
-
new ForkTsCheckerWebpackPlugin({
|
|
107
|
-
async: isDev,
|
|
108
|
-
typescript: {
|
|
109
|
-
configFile: path.resolve(__dirname, 'tsconfig.json'),
|
|
110
|
-
diagnosticOptions: {
|
|
111
|
-
semantic: true,
|
|
112
|
-
syntactic: true,
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
}),
|
|
116
|
-
].filter(Boolean),
|
|
117
|
-
} as webpack.Configuration;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function progress() {
|
|
121
|
-
let lastMsg: string;
|
|
122
|
-
return new webpack.ProgressPlugin({
|
|
123
|
-
percentBy: 'entries',
|
|
124
|
-
handler(percent, message) {
|
|
125
|
-
if (lastMsg !== message) {
|
|
126
|
-
lastMsg = message;
|
|
127
|
-
console.log(`${Math.round(percent * 100)}% | ${message}`);
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
});
|
|
131
|
-
}
|