@nu-art/ts-styles 0.400.4 → 0.400.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/icons/icons.d.ts +3 -0
- package/icons/icons.js +3 -1
- package/icons/svgs/icon__dash.svg +3 -0
- package/icons/svgs/icon__v.svg +1 -1
- package/icons/svgs/icon__x.svg +1 -1
- package/package.json +2 -2
- package/styles/index.scss +0 -1
- package/styles/mixin/index.scss +2 -1
- package/styles/mixin/mouse.scss +21 -71
- package/styles/mixin/svgs.scss +36 -0
- package/styles/palette/_palette.scss +19 -1
- package/styles/palette/palettes.scss +13 -13
- package/styles/transitioning/color-transitions.scss +2 -2
- package/styles/colors/index.scss +0 -1
- package/styles/colors/svgs.scss +0 -13
- package/styles/consts.scss +0 -1
package/icons/icons.d.ts
CHANGED
|
@@ -38,6 +38,9 @@ export declare const TS_Icons: {
|
|
|
38
38
|
x: {
|
|
39
39
|
component: (props: IconAttributes) => import("react/jsx-runtime").JSX.Element;
|
|
40
40
|
};
|
|
41
|
+
dash: {
|
|
42
|
+
component: (props: IconAttributes) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
};
|
|
41
44
|
gear: {
|
|
42
45
|
component: (props: IconAttributes) => import("react/jsx-runtime").JSX.Element;
|
|
43
46
|
};
|
package/icons/icons.js
CHANGED
|
@@ -8,9 +8,11 @@ import { ReactComponent as Bell } from './svgs/icon__bell.svg';
|
|
|
8
8
|
import { ReactComponent as Bin } from './svgs/icon__bin.svg';
|
|
9
9
|
import { ReactComponent as X } from './svgs/icon__x.svg';
|
|
10
10
|
import { ReactComponent as V } from './svgs/icon__v.svg';
|
|
11
|
+
import { ReactComponent as Dash } from './svgs/icon__dash.svg';
|
|
11
12
|
import { ReactComponent as More } from './svgs/icon__more.svg';
|
|
12
13
|
import { ReactComponent as Collapse } from './svgs/icon__treeCollapse.svg';
|
|
13
14
|
import { ReactComponent as Gear } from './svgs/icon__gear.svg';
|
|
15
|
+
import { ReactComponent as User } from './svgs/icon__user.svg';
|
|
14
16
|
import { ReactComponent as Information } from './svgs/icon__information.svg';
|
|
15
17
|
import { ReactComponent as FilterStop } from './svgs/icon__filter-stop.svg';
|
|
16
18
|
import { ReactComponent as Clear } from './svgs/icon__clear.svg';
|
|
@@ -20,7 +22,6 @@ import { ReactComponent as Google } from './svgs/icon__google.svg';
|
|
|
20
22
|
import { ReactComponent as Download } from './svgs/icon__download.svg';
|
|
21
23
|
import { ReactComponent as Copy } from './svgs/icon__copy.svg';
|
|
22
24
|
import { ReactComponent as AddImage } from './svgs/icon__add-image.svg';
|
|
23
|
-
import { ReactComponent as User } from './svgs/icon__user.svg';
|
|
24
25
|
class RenderIcon extends React.Component {
|
|
25
26
|
render() {
|
|
26
27
|
const className = 'icon--wrapper ' + (this.props.className ?? '');
|
|
@@ -43,6 +44,7 @@ export const TS_Icons = {
|
|
|
43
44
|
treeCollapse: { component: genIcon(Collapse) },
|
|
44
45
|
v: { component: genIcon(V) },
|
|
45
46
|
x: { component: genIcon(X) },
|
|
47
|
+
dash: { component: genIcon(Dash) },
|
|
46
48
|
gear: { component: genIcon(Gear) },
|
|
47
49
|
information: { component: genIcon(Information) },
|
|
48
50
|
filterStop: { component: genIcon(FilterStop) },
|
package/icons/svgs/icon__v.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 24" stroke-width="0">
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 24" stroke-width="0" class="v">
|
|
2
2
|
<path fill="#000" fill-rule="evenodd" stroke="#000" stroke-width="1"
|
|
3
3
|
d="M24.71 1.084a.844.844 0 0 0-1.192.208L9.978 20.81l-7.59-7.75a.842.842 0 0 0-1.209 0 .886.886 0 0 0 0 1.236l8.114 8.285a.839.839 0 0 0 .766.495.85.85 0 0 0 .698-.368L24.914 2.3a.886.886 0 0 0-.203-1.217"/>
|
|
4
4
|
</svg>
|
package/icons/svgs/icon__x.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" stroke-width="0">
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" stroke-width="0" class="x">
|
|
2
2
|
<path fill="#000" fill-rule="evenodd"
|
|
3
3
|
d="M8.3.757L5 4.057 1.7.757a.667.667 0 0 0-.943.943l3.3 3.3-3.3 3.3a.667.667 0 0 0 .943.943l3.3-3.3 3.3 3.3a.667.667 0 0 0 .943-.943L5.943 5l3.3-3.3A.667.667 0 0 0 8.3.757"/>
|
|
4
4
|
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nu-art/ts-styles",
|
|
3
|
-
"version": "0.400.
|
|
3
|
+
"version": "0.400.6",
|
|
4
4
|
"author": "nu-art",
|
|
5
5
|
"description": "Styles by Cipher",
|
|
6
6
|
"type": "module",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"linkDirectory": true
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@nu-art/ts-common": "0.400.
|
|
16
|
+
"@nu-art/ts-common": "0.400.6",
|
|
17
17
|
"react": "^18.0.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
package/styles/index.scss
CHANGED
package/styles/mixin/index.scss
CHANGED
package/styles/mixin/mouse.scss
CHANGED
|
@@ -1,100 +1,50 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use './svgs' as *;
|
|
2
2
|
|
|
3
|
-
@mixin
|
|
3
|
+
@mixin mouse-interactive-background($background, $hoverBackground: $background, $activeBackground: $hoverBackground) {
|
|
4
4
|
& {
|
|
5
5
|
background: $background;
|
|
6
|
-
cursor: pointer;
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
&:hover {
|
|
10
8
|
background: $hoverBackground;
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
&:active {
|
|
14
11
|
background: $activeBackground;
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
14
|
|
|
18
|
-
@mixin
|
|
15
|
+
@mixin mouse-interactive-text($c,$c-h: $c,$c-a:$c-h) {
|
|
19
16
|
& {
|
|
20
|
-
|
|
21
|
-
cursor: pointer;
|
|
17
|
+
color: $c;
|
|
22
18
|
}
|
|
23
|
-
|
|
24
19
|
&:hover {
|
|
25
|
-
|
|
20
|
+
color: $c-h;
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
&:active {
|
|
29
|
-
|
|
23
|
+
color: $c-a;
|
|
30
24
|
}
|
|
31
25
|
}
|
|
32
26
|
|
|
33
|
-
@mixin
|
|
27
|
+
@mixin mouse-interactive-border-color($border, $hoverBorder: $border, $activeBorder: $hoverBorder) {
|
|
34
28
|
& {
|
|
35
|
-
|
|
36
|
-
cursor: pointer;
|
|
29
|
+
border: $border;
|
|
37
30
|
}
|
|
38
|
-
|
|
39
31
|
&:hover {
|
|
40
|
-
|
|
32
|
+
border: $hoverBorder;
|
|
41
33
|
}
|
|
42
34
|
&:active {
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Sets color for vector elements based on mouse interaction
|
|
48
|
-
//
|
|
49
|
-
// Will work on any vector element that doesn't have a corresponding "data-no-{rule}" attribute.
|
|
50
|
-
// To avoid coloring the fill of the element set data-no-fill=true attribute
|
|
51
|
-
// To avoid coloring the stroke of the element set data-no-stroke=true attribute
|
|
52
|
-
//
|
|
53
|
-
// @param $color - base background
|
|
54
|
-
// @param $hoverColor - background when mouse hover
|
|
55
|
-
// @param $activeColor - background when mouse click
|
|
56
|
-
//
|
|
57
|
-
@mixin mouseInteractiveIcon($color,$hoverColor:$color,$activeColor:$hoverColor,$transition: 0) {
|
|
58
|
-
$rules: fill, stroke;
|
|
59
|
-
|
|
60
|
-
@if $transition != 0 {
|
|
61
|
-
$transitionRules: '';
|
|
62
|
-
@each $rule in $rules {
|
|
63
|
-
$i: index($rules, $rule);
|
|
64
|
-
$transitionRules: $transitionRules + #{$rule $transition};
|
|
65
|
-
@if $i != length($rules) {
|
|
66
|
-
$transitionRules: $transitionRules + ', ';
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
*:not(g) {
|
|
70
|
-
transition: #{$transitionRules};
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
& {
|
|
75
|
-
cursor: pointer;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@each $rule in $rules {
|
|
79
|
-
@include colors.setIconProp($rule, $color);
|
|
80
|
-
&:hover {
|
|
81
|
-
@include colors.setIconProp($rule, $hoverColor)
|
|
82
|
-
}
|
|
83
|
-
&:active {
|
|
84
|
-
@include colors.setIconProp($rule, $activeColor)
|
|
85
|
-
}
|
|
35
|
+
border: $activeBorder;
|
|
86
36
|
}
|
|
87
37
|
}
|
|
88
38
|
|
|
89
|
-
@mixin
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
39
|
+
@mixin edge-fade($girth, $color) {
|
|
40
|
+
mask-image: linear-gradient(to top, transparent, #{$color} #{$girth}),
|
|
41
|
+
linear-gradient(to bottom, transparent, #{$color} #{$girth}),
|
|
42
|
+
linear-gradient(to left, transparent, #{$color} #{$girth}),
|
|
43
|
+
linear-gradient(to right, transparent, #{$color} #{$girth});
|
|
44
|
+
mask-composite: intersect;
|
|
45
|
+
-webkit-mask-image: linear-gradient(to top, transparent, #{$color} #{$girth}),
|
|
46
|
+
linear-gradient(to bottom, transparent, #{$color} #{$girth}),
|
|
47
|
+
linear-gradient(to left, transparent, #{$color} #{$girth}),
|
|
48
|
+
linear-gradient(to right, transparent, #{$color} #{$girth});
|
|
49
|
+
-webkit-mask-composite: destination-in;
|
|
100
50
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
$svg-prop-rules: fill, stroke;
|
|
2
|
+
|
|
3
|
+
@mixin setIconProp($prop,$value) {
|
|
4
|
+
*:not([data-no-#{$prop}="true"]):not(g):not(svg) {
|
|
5
|
+
#{$prop}: $value;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@mixin color-svg($color) {
|
|
10
|
+
@each $rule in $svg-prop-rules {
|
|
11
|
+
@include setIconProp($rule, $color);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/// Sets color for vector elements based on mouse interaction
|
|
16
|
+
///
|
|
17
|
+
/// Will work on any vector element that doesn't have a corresponding "data-no-{rule}" attribute.
|
|
18
|
+
/// To avoid coloring the fill of the element set data-no-fill=true attribute
|
|
19
|
+
/// To avoid coloring the stroke of the element set data-no-stroke=true attribute
|
|
20
|
+
///
|
|
21
|
+
/// @param $bg - base background
|
|
22
|
+
/// @param $bgh - background when mouse hover
|
|
23
|
+
/// @param $bga - background when mouse click
|
|
24
|
+
///
|
|
25
|
+
|
|
26
|
+
@mixin mouse-interactive-icon($color, $color-h: $color, $color-a: $color-h) {
|
|
27
|
+
@each $rule in $svg-prop-rules {
|
|
28
|
+
@include setIconProp($rule, $color);
|
|
29
|
+
&:hover {
|
|
30
|
+
@include setIconProp($rule, $color-h);
|
|
31
|
+
}
|
|
32
|
+
&:active {
|
|
33
|
+
@include setIconProp($rule, $color-a);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
@use 'sass:math';
|
|
2
2
|
@use 'sass:color';
|
|
3
3
|
@use 'sass:list';
|
|
4
|
+
@use 'sass:meta';
|
|
4
5
|
|
|
5
6
|
@function paletteBuilder($baseColor, $steps) {
|
|
6
7
|
$colorsList: ();
|
|
7
8
|
@for $i from 0 to $steps {
|
|
8
9
|
$lightness: math.percentage(math.div($i, $steps));
|
|
9
10
|
$newColor: color.scale($baseColor, $lightness: $lightness);
|
|
10
|
-
$colorsList: list.append($colorsList,
|
|
11
|
+
$colorsList: list.append($colorsList, $newColor);
|
|
11
12
|
}
|
|
12
13
|
@return $colorsList
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/// Returns the color with the given alpha (0..1)
|
|
17
|
+
/// Accepts any Sass color: hex, rgb(), hsl(), etc.
|
|
18
|
+
@function colorWithAlpha($color, $alpha: 1) {
|
|
19
|
+
@if meta.type-of($color) != 'color' {
|
|
20
|
+
@error "Expected a color, got #{meta.type-of($color)}: #{$color}";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@if meta.type-of($alpha) != 'number' or not ($alpha >= 0 and $alpha <= 1) {
|
|
24
|
+
@error "Alpha must be a number between 0 and 1. Got: #{$alpha}.";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
$r: color.channel($color, "red", $space: rgb);
|
|
28
|
+
$g: color.channel($color, "green", $space: rgb);
|
|
29
|
+
$b: color.channel($color, "blue", $space: rgb);
|
|
30
|
+
@return rgba($r, $g, $b, $alpha);
|
|
13
31
|
}
|
|
@@ -17,53 +17,53 @@ $_monochromatic: paletteBuilder(#9CAEB7, $colorChunks);
|
|
|
17
17
|
$_green: paletteBuilder(#2AA10F, $colorChunks);
|
|
18
18
|
|
|
19
19
|
@function monochromatic($i) {
|
|
20
|
-
@return
|
|
20
|
+
@return list.nth($_monochromatic, $i);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
@function black($i) {
|
|
24
|
-
@return
|
|
24
|
+
@return list.nth($_black, $i);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
@function gray-blue($i) {
|
|
28
|
-
@return
|
|
28
|
+
@return list.nth($_gray-blue, $i);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
@function dark-blue($i) {
|
|
32
|
-
@return
|
|
32
|
+
@return list.nth($_dark-blue, $i);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
@function dark-green($i) {
|
|
36
|
-
@return
|
|
36
|
+
@return list.nth($_dark-green, $i);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
@function green($i) {
|
|
40
|
-
@return
|
|
40
|
+
@return list.nth($_green, $i);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
@function purple($i) {
|
|
44
|
-
@return
|
|
44
|
+
@return list.nth($_purple, $i);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
@function pink($i) {
|
|
48
|
-
@return
|
|
48
|
+
@return list.nth($_pink, $i);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
@function ochre($i) {
|
|
52
|
-
@return
|
|
52
|
+
@return list.nth($_ochre, $i);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
@function orange($i) {
|
|
56
|
-
@return
|
|
56
|
+
@return list.nth($_orange, $i);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
@function red($i) {
|
|
60
|
-
@return
|
|
60
|
+
@return list.nth($_red, $i);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
@function gray($i) {
|
|
64
|
-
@return
|
|
64
|
+
@return list.nth($_gray, $i);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
@function light-gray($i) {
|
|
68
|
-
@return
|
|
68
|
+
@return list.nth($_light-gray, $i);
|
|
69
69
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use 'sass:list';
|
|
2
|
-
@use '../
|
|
2
|
+
@use '../mixin' as M;
|
|
3
3
|
@use './general' as general;
|
|
4
4
|
|
|
5
5
|
@function background-transition($time: 200, $style: ease-out) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
@function svg-color-transition($time:200 , $style: ease-out) {
|
|
10
10
|
$transitions: ();
|
|
11
|
-
@each $rule in
|
|
11
|
+
@each $rule in M.$svg-prop-rules {
|
|
12
12
|
$transitions: list.append($transitions, $rule #{$time}ms $style, comma);
|
|
13
13
|
}
|
|
14
14
|
|
package/styles/colors/index.scss
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@forward "svgs";
|
package/styles/colors/svgs.scss
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
@use '../consts' as consts;
|
|
2
|
-
|
|
3
|
-
@mixin setIconProp($prop,$value) {
|
|
4
|
-
*:not(svg):not(g):not([data-no-#{$prop}="true"]) {
|
|
5
|
-
#{$prop}: $value;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@mixin color-svg($color) {
|
|
10
|
-
@each $rule in consts.$svg-prop-rules {
|
|
11
|
-
@include setIconProp($rule, $color);
|
|
12
|
-
}
|
|
13
|
-
}
|
package/styles/consts.scss
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
$svg-prop-rules: fill, stroke;
|