wave-ui 1.68.1 → 1.69.0
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/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.es.js +120 -47
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +14 -14
- package/src/wave-ui/components/w-button/button.vue +4 -1
- package/src/wave-ui/components/w-checkbox.vue +3 -2
- package/src/wave-ui/components/w-checkboxes.vue +4 -1
- package/src/wave-ui/components/w-input.vue +2 -0
- package/src/wave-ui/components/w-list.vue +7 -7
- package/src/wave-ui/components/w-menu.vue +12 -1
- package/src/wave-ui/components/w-select.vue +28 -14
- package/src/wave-ui/components/w-table.vue +1 -1
- package/src/wave-ui/components/w-textarea.vue +1 -0
- package/src/wave-ui/components/w-toolbar.vue +1 -2
- package/src/wave-ui/components/w-tooltip.vue +44 -10
- package/src/wave-ui/core.js +36 -2
- package/src/wave-ui/mixins/detachable.js +27 -6
- package/src/wave-ui/scss/_base.scss +18 -0
- package/src/wave-ui/scss/_variables.scss +102 -8
- package/src/wave-ui/scss/index.scss +0 -1
- package/src/wave-ui/utils/dynamic-css.js +19 -8
|
@@ -5,6 +5,39 @@
|
|
|
5
5
|
// @return $a / $b;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
// THEME COLORS.
|
|
9
|
+
// ========================================================
|
|
10
|
+
// These colors are defined by a list of RBG channels only, so you can later apply any alpha channel.
|
|
11
|
+
// If you don't need themes, you can leave this as is and override the global defaults.
|
|
12
|
+
$theme-light: (
|
|
13
|
+
base-bg-color-rgb: (255, 255, 255), // #fff.
|
|
14
|
+
base-color-rgb: (0, 0, 0), // #000.
|
|
15
|
+
contrast-bg-color-rgb: (0, 0, 0), // #000.
|
|
16
|
+
contrast-color-rgb: (255, 255, 255), // #fff.
|
|
17
|
+
caption-color-rgb: (80, 80, 80, 0.7), // #505050.
|
|
18
|
+
disabled-color-rgb: (204, 204, 204), // #ccc.
|
|
19
|
+
) !default;
|
|
20
|
+
|
|
21
|
+
$theme-dark: (
|
|
22
|
+
base-bg-color-rgb: (34, 34, 34), // #222.
|
|
23
|
+
base-color-rgb: (255, 255, 255), // #fff.
|
|
24
|
+
contrast-bg-color-rgb: (255, 255, 255), // #fff.
|
|
25
|
+
contrast-color-rgb: (0, 0, 0), // #000.
|
|
26
|
+
caption-color-rgb: (175, 175, 175, 0.7), // #afafaf.
|
|
27
|
+
disabled-color-rgb: (74, 74, 74), // #4a4a4a.
|
|
28
|
+
) !default;
|
|
29
|
+
|
|
30
|
+
// These variables are filled up with the current theme colors for you to use.
|
|
31
|
+
$primary: var(--w-primary-color);
|
|
32
|
+
$secondary: var(--w-secondary-color);
|
|
33
|
+
$base-bg-color: rgb(var(--w-base-bg-color-rgb));
|
|
34
|
+
$base-color: rgb(var(--w-base-color-rgb));
|
|
35
|
+
$contrast-bg-color: rgb(var(--w-contrast-bg-color-rgb));
|
|
36
|
+
$contrast-color: rgb(var(--w-contrast-color-rgb));
|
|
37
|
+
$caption-color: rgb(var(--w-caption-color-rgb));
|
|
38
|
+
// When a form element is disabled (checkbox, radio, input, select list).
|
|
39
|
+
$disabled-color: rgb(var(--w-disabled-color-rgb));
|
|
40
|
+
|
|
8
41
|
// GLOBAL DEFAULTS.
|
|
9
42
|
// ========================================================
|
|
10
43
|
$css-scope: '.w-app' !default; // Allows control on CSS rules priority.
|
|
@@ -15,7 +48,7 @@ $base-font-size: 14px !default; // Must be a px unit.
|
|
|
15
48
|
$base-increment: round(divide($base-font-size, 4)) !default;
|
|
16
49
|
$layout-padding: $base-increment * 4 !default; // Applied on the .content-wrap tag.
|
|
17
50
|
$border-radius: 3px !default;
|
|
18
|
-
$border-color: rgba(
|
|
51
|
+
$border-color: rgba(var(--w-contrast-bg-color-rgb), 0.12) !default;
|
|
19
52
|
$border: 1px solid $border-color !default;
|
|
20
53
|
$transition-duration: 0.25s !default;
|
|
21
54
|
$fast-transition-duration: 0.15s !default;
|
|
@@ -28,34 +61,95 @@ $form-field-height: round(2 * $base-font-size) !default;
|
|
|
28
61
|
// Always an even number for better vertical alignment. (Used in checkbox, radio, switch)
|
|
29
62
|
$small-form-el-size: round(divide(1.3 * $base-font-size, 2)) * 2 !default;
|
|
30
63
|
|
|
64
|
+
// Detachable elements are: w-tooltip, w-menu, w-confirm.
|
|
65
|
+
$detachable-bg-color: $base-bg-color !default;
|
|
66
|
+
$detachable-color: $base-color !default;
|
|
67
|
+
|
|
31
68
|
// COMPONENTS DEFAULTS.
|
|
32
69
|
// ========================================================
|
|
70
|
+
// w-confirm.
|
|
71
|
+
// --------------------------------------------------------
|
|
72
|
+
$confirm-bg-color: $detachable-bg-color !default;
|
|
73
|
+
$confirm-color: $detachable-color !default;
|
|
74
|
+
// --------------------------------------------------------
|
|
75
|
+
|
|
76
|
+
// w-dialog.
|
|
77
|
+
// --------------------------------------------------------
|
|
78
|
+
$dialog-bg-color: $base-bg-color !default;
|
|
79
|
+
// --------------------------------------------------------
|
|
80
|
+
|
|
81
|
+
// w-divider.
|
|
82
|
+
// --------------------------------------------------------
|
|
83
|
+
$divider-color: $border-color !default;
|
|
84
|
+
// --------------------------------------------------------
|
|
85
|
+
|
|
33
86
|
// w-drawer.
|
|
87
|
+
// --------------------------------------------------------
|
|
34
88
|
$drawer-max-size: 380px !default;
|
|
89
|
+
$drawer-bg-color: $base-bg-color !default;
|
|
90
|
+
// --------------------------------------------------------
|
|
91
|
+
|
|
92
|
+
// w-menu.
|
|
93
|
+
// --------------------------------------------------------
|
|
94
|
+
$menu-bg-color: $detachable-bg-color !default;
|
|
95
|
+
$menu-color: $detachable-color !default;
|
|
96
|
+
// --------------------------------------------------------
|
|
97
|
+
|
|
98
|
+
// w-progress.
|
|
99
|
+
// --------------------------------------------------------
|
|
100
|
+
$progress-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.15) !default;
|
|
101
|
+
// --------------------------------------------------------
|
|
102
|
+
|
|
103
|
+
// w-rating.
|
|
104
|
+
// --------------------------------------------------------
|
|
105
|
+
$rating-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.25) !default;
|
|
35
106
|
// --------------------------------------------------------
|
|
36
107
|
|
|
37
108
|
// w-slider.
|
|
38
109
|
// --------------------------------------------------------
|
|
39
110
|
$slider-height: $base-increment !default;
|
|
40
|
-
$slider-track-color:
|
|
111
|
+
$slider-track-color: rgba(var(--w-contrast-bg-color-rgb), 0.15) !default;
|
|
112
|
+
$slider-thumb-button-bg-color: $base-bg-color !default;
|
|
113
|
+
$slider-thumb-label-bg-color: $base-bg-color !default;
|
|
114
|
+
$slider-thumb-label-color: rgba(var(--w-base-color-rgb), 0.75) !default;
|
|
115
|
+
$slider-step-label-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.2) !default;
|
|
116
|
+
$slider-step-label-color: rgba(var(--w-base-color-rgb), 0.5) !default;
|
|
117
|
+
|
|
118
|
+
// w-switch.
|
|
119
|
+
// --------------------------------------------------------
|
|
120
|
+
$switch-inactive-color: rgba(var(--w-contrast-bg-color-rgb), 0.25) !default;
|
|
121
|
+
$switch-thumb-color: #fff !default;
|
|
41
122
|
// --------------------------------------------------------
|
|
42
123
|
|
|
43
124
|
// w-table.
|
|
44
125
|
// --------------------------------------------------------
|
|
45
|
-
$table-tr-odd-color: rgba(0, 0, 0, 0.02);
|
|
46
|
-
$table-tr-hover-color: rgba(0, 0, 0, 0.05);
|
|
47
|
-
$table-color: rgba(
|
|
126
|
+
$table-tr-odd-color: rgba(0, 0, 0, 0.02) !default;
|
|
127
|
+
$table-tr-hover-color: rgba(0, 0, 0, 0.05) !default;
|
|
128
|
+
$table-color: rgba(var(--w-contrast-color-rgb), 0.7) !default;
|
|
48
129
|
// --------------------------------------------------------
|
|
49
130
|
|
|
50
131
|
// w-textarea.
|
|
51
132
|
// --------------------------------------------------------
|
|
52
|
-
$textarea-line-height: 1.2;
|
|
133
|
+
$textarea-line-height: 1.2 !default;
|
|
134
|
+
// --------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
// w-timeline.
|
|
137
|
+
// --------------------------------------------------------
|
|
138
|
+
$timeline-bullet-color: $base-bg-color !default;
|
|
139
|
+
$timeline-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.25) !default;
|
|
140
|
+
// --------------------------------------------------------
|
|
141
|
+
|
|
142
|
+
// w-toolbar.
|
|
143
|
+
// --------------------------------------------------------
|
|
144
|
+
$toolbar-max-size: 380px !default;
|
|
145
|
+
$toolbar-bg-color: $base-bg-color !default;
|
|
53
146
|
// --------------------------------------------------------
|
|
54
147
|
|
|
55
148
|
// w-tooltip.
|
|
56
149
|
// --------------------------------------------------------
|
|
57
|
-
$tooltip-bg-color:
|
|
58
|
-
$tooltip-color:
|
|
150
|
+
$tooltip-bg-color: $detachable-bg-color !default;
|
|
151
|
+
$tooltip-color: $detachable-color !default;
|
|
152
|
+
$tooltip-border-color: $border-color !default;
|
|
59
153
|
// --------------------------------------------------------
|
|
60
154
|
|
|
61
155
|
// Mixins.
|
|
@@ -7,15 +7,18 @@ const cssVars = {
|
|
|
7
7
|
|
|
8
8
|
const generateColors = config => {
|
|
9
9
|
let styles = ''
|
|
10
|
+
const cssVariables = {}
|
|
10
11
|
const { cssScope } = cssVars
|
|
11
12
|
|
|
12
13
|
// Extract status colors and place them after the other colors.
|
|
13
14
|
const { info, warning, success, error, ...colors } = config.colors
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
// User custom colors.
|
|
17
|
+
// ------------------------------------------------------
|
|
18
|
+
for (const colorName in colors) {
|
|
16
19
|
styles +=
|
|
17
|
-
`${cssScope} .${
|
|
18
|
-
`${cssScope} .${
|
|
20
|
+
`${cssScope} .${colorName}--bg{background-color:${config.colors[colorName]}}` +
|
|
21
|
+
`${cssScope} .${colorName}{color:${config.colors[colorName]}}`
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
// Color shades are generated in core.js, if the option is on.
|
|
@@ -36,12 +39,19 @@ const generateColors = config => {
|
|
|
36
39
|
`${cssScope} .${color}{color:${config.colors[color]}}`
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
// Creating CSS3 variables.
|
|
43
|
+
// ------------------------------------------------------
|
|
44
|
+
// Create a CSS variable for each color for theming and reuse in components.
|
|
45
|
+
// Status colors must remain after the other colors so they have priority in form validations.
|
|
46
|
+
// That only makes sense when there are 2 colors on the same element: e.g. `span.primary.error`.
|
|
47
|
+
const allColors = { ...colors, info, warning, success, error }
|
|
48
|
+
for (const colorName in allColors) cssVariables[colorName] = allColors[colorName]
|
|
49
|
+
let cssVariablesString = ''
|
|
50
|
+
Object.entries(cssVariables).forEach(([colorName, colorHex]) => {
|
|
51
|
+
cssVariablesString += `--w-${colorName}-color: ${colorHex};`
|
|
52
|
+
})
|
|
43
53
|
|
|
44
|
-
return styles
|
|
54
|
+
return `:root{${cssVariablesString}}${styles}`
|
|
45
55
|
}
|
|
46
56
|
|
|
47
57
|
// Generate the layout grid. E.g. xs1, xs2, ..., xl12.
|
|
@@ -153,6 +163,7 @@ const genBreakpointLayoutClasses = breakpoints => {
|
|
|
153
163
|
'text-nowrap{white-space:nowrap}',
|
|
154
164
|
'row{flex-direction:row}',
|
|
155
165
|
'column{flex-direction:column}',
|
|
166
|
+
'column-reverse{flex-direction:column-reverse}',
|
|
156
167
|
'grow{flex-grow:1;flex-basis:auto}',
|
|
157
168
|
'no-grow{flex-grow:0}',
|
|
158
169
|
'shrink{flex-shrink:1;margin-left:auto;margin-right:auto}',
|