@sybilion/uilib 1.6.0 → 1.7.1
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/README.md +2 -1
- package/assets/base.css +3 -4
- package/assets/globals.css +1 -1
- package/dist/esm/src/components/ui/AnalysesSelector/AnalysesSelector.styl.js +1 -1
- package/dist/esm/src/components/ui/AppHeader/AppHeader.styl.js +1 -1
- package/dist/esm/src/components/ui/Breadcrumb/Breadcrumb.styl.js +1 -1
- package/dist/esm/src/components/ui/Button/Button.js +2 -2
- package/dist/esm/src/components/ui/Button/Button.styl.js +2 -2
- package/dist/esm/src/components/ui/Checkbox/Checkbox.styl.js +1 -1
- package/dist/esm/src/components/ui/Chip/Chip.styl.js +1 -1
- package/dist/esm/src/components/ui/DatePicker/DatePicker.styl.js +1 -1
- package/dist/esm/src/components/ui/Dialog/Dialog.styl.js +1 -1
- package/dist/esm/src/components/ui/DropdownMenu/DropdownMenu.styl.js +1 -1
- package/dist/esm/src/components/ui/FileChip/FileChip.styl.js +1 -1
- package/dist/esm/src/components/ui/Input/Input.js +3 -3
- package/dist/esm/src/components/ui/Input/Input.styl.js +2 -2
- package/dist/esm/src/components/ui/LegacyPlatformLink/LegacyPlatformLink.styl.js +1 -1
- package/dist/esm/src/components/ui/Notifications/Notifications.styl.js +1 -1
- package/dist/esm/src/components/ui/RadioGroup/RadioGroup.styl.js +1 -1
- package/dist/esm/src/components/ui/Select/Select.js +5 -5
- package/dist/esm/src/components/ui/Select/Select.styl.js +2 -2
- package/dist/esm/src/components/ui/Sheet/Sheet.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarGroupAction/SidebarGroupAction.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarMenuAction/SidebarMenuAction.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarMenuButton/SidebarMenuButton.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarMenuSubButton/SidebarMenuSubButton.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarRail/SidebarRail.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarResizeHandle/SidebarResizeHandle.styl.js +1 -1
- package/dist/esm/src/components/ui/Slider/Slider.styl.js +1 -1
- package/dist/esm/src/components/ui/SupplyChainMap/SupplyChainMap.styl.js +1 -1
- package/dist/esm/src/components/ui/SupplyChainMap/use-map-base-renderer.js +2 -2
- package/dist/esm/src/components/ui/Switch/Switch.styl.js +1 -1
- package/dist/esm/src/components/ui/Tabs/Tabs.styl.js +1 -1
- package/dist/esm/src/components/ui/Toggle/Toggle.styl.js +1 -1
- package/dist/esm/src/components/ui/ToggleGroup/ToggleGroup.styl.js +1 -1
- package/dist/esm/src/components/ui/WorkspaceAppSwitcher/WorkspaceAppSwitcher.styl.js +1 -1
- package/dist/esm/src/components/widgets/DriverMap/DriverIcon/DriverIcon.styl.js +1 -1
- package/dist/esm/types/src/components/ui/Button/Button.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Button/Button.types.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Input/Input.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Input/Input.types.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Select/Select.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Select/Select.types.d.ts +2 -0
- package/dist/esm/types/src/docs/config/vite.config.d.ts +2 -0
- package/dist/esm/types/tests/buttonStyles.test.d.ts +1 -0
- package/dist/esm/types/tests/focusOutline.test.d.ts +1 -0
- package/package.json +28 -37
- package/src/components/ui/Button/Button.styl +122 -104
- package/src/components/ui/Button/Button.styl.d.ts +1 -0
- package/src/components/ui/Button/Button.tsx +2 -0
- package/src/components/ui/Button/Button.types.ts +2 -0
- package/src/components/ui/Input/Input.styl +4 -0
- package/src/components/ui/Input/Input.styl.d.ts +1 -0
- package/src/components/ui/Input/Input.tsx +34 -20
- package/src/components/ui/Input/Input.types.ts +4 -0
- package/src/components/ui/Select/Select.styl +4 -0
- package/src/components/ui/Select/Select.styl.d.ts +1 -0
- package/src/components/ui/Select/Select.tsx +5 -0
- package/src/components/ui/Select/Select.types.ts +2 -0
- package/src/components/ui/SupplyChainMap/use-map-base-renderer.ts +2 -1
- package/src/docs/config/vite.config.ts +253 -0
- package/src/docs/pages/ButtonPage.tsx +33 -1
- package/src/docs/pages/InputPage.tsx +31 -1
- package/src/docs/pages/SelectPage.tsx +34 -1
- package/src/lib/theme.styl +3 -1
- package/assets/index.html +0 -18
- package/src/docs/config/webpack.config.js +0 -275
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import ReactRefreshPlugin from '@pmmmwh/react-refresh-webpack-plugin';
|
|
2
|
-
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
|
|
3
|
-
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
|
4
|
-
import { config as loadEnv } from 'dotenv';
|
|
5
|
-
import { existsSync } from 'fs';
|
|
6
|
-
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
7
|
-
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
8
|
-
import { createRequire } from 'module';
|
|
9
|
-
import { resolve as pathResolve } from 'path';
|
|
10
|
-
import webpack from 'webpack';
|
|
11
|
-
|
|
12
|
-
import paths from './paths.ts';
|
|
13
|
-
|
|
14
|
-
const require = createRequire(import.meta.url);
|
|
15
|
-
|
|
16
|
-
loadEnv({ path: pathResolve(process.cwd(), '.env') });
|
|
17
|
-
|
|
18
|
-
const FaviconWebpackPlugin = require('favicons-webpack-plugin');
|
|
19
|
-
|
|
20
|
-
const pkg = require('../../../package.json');
|
|
21
|
-
|
|
22
|
-
const themeStyl = pathResolve(paths.src, 'theme.styl');
|
|
23
|
-
const logoSvgPath = pathResolve(paths.assets, 'logo.svg');
|
|
24
|
-
/** Favicon rasterization has no CSS context; currentColor in logo.svg renders black. */
|
|
25
|
-
const faviconLogoSvgPath = pathResolve(paths.assets, 'logo-favicon.svg');
|
|
26
|
-
|
|
27
|
-
/** GitHub Pages project sites live at /<repo>/; set PUBLIC_PATH=/repo-name/ for production deploy. */
|
|
28
|
-
function normalizePublicPath(raw) {
|
|
29
|
-
const v = (raw && String(raw).trim()) || '/';
|
|
30
|
-
if (v === '/') {
|
|
31
|
-
return '/';
|
|
32
|
-
}
|
|
33
|
-
const withLeading = v.startsWith('/') ? v : `/${v}`;
|
|
34
|
-
return withLeading.endsWith('/') ? withLeading : `${withLeading}/`;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function routerBasenameFromPublicPath(publicPath) {
|
|
38
|
-
if (publicPath === '/') {
|
|
39
|
-
return '';
|
|
40
|
-
}
|
|
41
|
-
return publicPath.replace(/\/$/, '');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default (env, argv) => {
|
|
45
|
-
const isDev = argv.mode === 'development';
|
|
46
|
-
const publicPath = normalizePublicPath(process.env.PUBLIC_PATH);
|
|
47
|
-
const docsRouterBasename = routerBasenameFromPublicPath(publicPath);
|
|
48
|
-
const alias = {
|
|
49
|
-
'#uilib': paths.src,
|
|
50
|
-
uilib: paths.src,
|
|
51
|
-
'docs/components': `${paths.docs}/components`,
|
|
52
|
-
};
|
|
53
|
-
if (existsSync(themeStyl)) {
|
|
54
|
-
alias.theme = themeStyl;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const docsHtmlMinify = isDev
|
|
58
|
-
? false
|
|
59
|
-
: {
|
|
60
|
-
removeComments: true,
|
|
61
|
-
collapseWhitespace: true,
|
|
62
|
-
removeRedundantAttributes: true,
|
|
63
|
-
useShortDoctype: true,
|
|
64
|
-
removeEmptyAttributes: true,
|
|
65
|
-
removeStyleLinkTypeAttributes: true,
|
|
66
|
-
keepClosingSlash: true,
|
|
67
|
-
minifyJS: true,
|
|
68
|
-
minifyCSS: true,
|
|
69
|
-
minifyURLs: true,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const docsHtmlPluginBase = {
|
|
73
|
-
lang: 'en',
|
|
74
|
-
baseUrl: publicPath,
|
|
75
|
-
template: `${paths.assets}/index.html`,
|
|
76
|
-
minify: docsHtmlMinify,
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const config = {
|
|
80
|
-
entry: [paths.docs],
|
|
81
|
-
output: {
|
|
82
|
-
path: paths.build,
|
|
83
|
-
publicPath,
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
resolve: {
|
|
87
|
-
modules: [paths.src, paths.docs, 'node_modules'],
|
|
88
|
-
extensions: ['.js', '.ts', '.tsx', '.styl', '.md'],
|
|
89
|
-
alias,
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
optimization: {
|
|
93
|
-
moduleIds: 'named',
|
|
94
|
-
minimize: false,
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
module: {
|
|
98
|
-
rules: [
|
|
99
|
-
{
|
|
100
|
-
test: /\.tsx?$/,
|
|
101
|
-
loader: 'babel-loader',
|
|
102
|
-
include: [paths.src, paths.docs],
|
|
103
|
-
options: {
|
|
104
|
-
plugins: [isDev && require.resolve('react-refresh/babel')].filter(
|
|
105
|
-
Boolean,
|
|
106
|
-
),
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
test: /\.md$/,
|
|
111
|
-
include: [paths.src],
|
|
112
|
-
type: 'asset/source',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
test: /\.css$/,
|
|
116
|
-
use: ['style-loader', 'css-loader'],
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
test: /\.styl$/,
|
|
120
|
-
use: [
|
|
121
|
-
'style-loader',
|
|
122
|
-
{ loader: 'css-modules-typescript-loader' },
|
|
123
|
-
{
|
|
124
|
-
loader: 'css-loader',
|
|
125
|
-
options: {
|
|
126
|
-
modules: {
|
|
127
|
-
localIdentName: '[name]__[local]___[hash:base64:5]',
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
loader: 'postcss-loader',
|
|
133
|
-
options: {
|
|
134
|
-
postcssOptions: {
|
|
135
|
-
ident: 'postcss',
|
|
136
|
-
plugins: [
|
|
137
|
-
['postcss-preset-env', { stage: 3, autoprefixer: true }],
|
|
138
|
-
],
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
loader: 'stylus-loader',
|
|
144
|
-
},
|
|
145
|
-
],
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
test: /\.svg$/i,
|
|
149
|
-
oneOf: [
|
|
150
|
-
{
|
|
151
|
-
resourceQuery: /url/i,
|
|
152
|
-
type: 'asset/resource',
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
include: /components[/\\]ui[/\\]WorldMap[/\\]map\.svg$/,
|
|
156
|
-
type: 'asset/resource',
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
issuer: /\.[jt]sx?$/,
|
|
160
|
-
use: [
|
|
161
|
-
{
|
|
162
|
-
loader: '@svgr/webpack',
|
|
163
|
-
options: {
|
|
164
|
-
icon: true,
|
|
165
|
-
ext: 'tsx',
|
|
166
|
-
typescript: true,
|
|
167
|
-
exportType: 'default',
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
],
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
type: 'asset/resource',
|
|
174
|
-
},
|
|
175
|
-
],
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
test: /\.(woff|woff2|eot|ttf)$/,
|
|
179
|
-
use: {
|
|
180
|
-
loader: 'file-loader',
|
|
181
|
-
options: {
|
|
182
|
-
name: 'static/[name].[ext]',
|
|
183
|
-
outputPath: 'images/',
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
test: /\.(png|jpe?g|gif|webp)$/,
|
|
189
|
-
type: 'asset/resource',
|
|
190
|
-
},
|
|
191
|
-
],
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
plugins: [
|
|
195
|
-
isDev && new ReactRefreshPlugin(),
|
|
196
|
-
new CleanWebpackPlugin(),
|
|
197
|
-
new webpack.ProvidePlugin({
|
|
198
|
-
React: 'react',
|
|
199
|
-
}),
|
|
200
|
-
new webpack.DefinePlugin({
|
|
201
|
-
isDEV: JSON.stringify(isDev),
|
|
202
|
-
VERSION: JSON.stringify(pkg.version),
|
|
203
|
-
DOCS_ROUTER_BASENAME: JSON.stringify(docsRouterBasename),
|
|
204
|
-
}),
|
|
205
|
-
new CopyWebpackPlugin({
|
|
206
|
-
patterns: [
|
|
207
|
-
{
|
|
208
|
-
from: `${paths.assets}/*.css`,
|
|
209
|
-
to: paths.build,
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
from: `${paths.assets}/fonts`,
|
|
213
|
-
to: `${paths.build}/assets/fonts`,
|
|
214
|
-
noErrorOnMissing: true,
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
from: logoSvgPath,
|
|
218
|
-
to: paths.build,
|
|
219
|
-
noErrorOnMissing: true,
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
from: logoSvgPath,
|
|
223
|
-
to: `${paths.assets}/logo.svg`,
|
|
224
|
-
noErrorOnMissing: true,
|
|
225
|
-
},
|
|
226
|
-
],
|
|
227
|
-
}),
|
|
228
|
-
|
|
229
|
-
new HtmlWebpackPlugin({
|
|
230
|
-
...docsHtmlPluginBase,
|
|
231
|
-
filename: 'index.html',
|
|
232
|
-
}),
|
|
233
|
-
/** GitHub Pages serves this for missing paths; same shell as index.html so SPA routes work. */
|
|
234
|
-
new HtmlWebpackPlugin({
|
|
235
|
-
...docsHtmlPluginBase,
|
|
236
|
-
filename: '404.html',
|
|
237
|
-
}),
|
|
238
|
-
existsSync(faviconLogoSvgPath) &&
|
|
239
|
-
new FaviconWebpackPlugin({
|
|
240
|
-
logo: faviconLogoSvgPath,
|
|
241
|
-
mode: 'webapp',
|
|
242
|
-
devMode: 'webapp',
|
|
243
|
-
favicons: {
|
|
244
|
-
appName: 'Sybilion Design System',
|
|
245
|
-
developerName: 'Sybilion',
|
|
246
|
-
developerURL: null,
|
|
247
|
-
background: '#fff',
|
|
248
|
-
theme_color: '#1a1a1a',
|
|
249
|
-
display: 'standalone',
|
|
250
|
-
icons: { coast: false, yandex: false },
|
|
251
|
-
},
|
|
252
|
-
}),
|
|
253
|
-
new MiniCssExtractPlugin({
|
|
254
|
-
filename: isDev ? '[name].css' : '[name].[hash].css',
|
|
255
|
-
chunkFilename: isDev ? '[id].css' : '[id].[hash].css',
|
|
256
|
-
}),
|
|
257
|
-
].filter(Boolean),
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
if (isDev) {
|
|
261
|
-
Object.assign(config, {
|
|
262
|
-
devtool: 'source-map',
|
|
263
|
-
devServer: {
|
|
264
|
-
hot: true,
|
|
265
|
-
port: process.env.PORT || 8181,
|
|
266
|
-
historyApiFallback: true,
|
|
267
|
-
...(publicPath !== '/' && {
|
|
268
|
-
devMiddleware: { publicPath },
|
|
269
|
-
}),
|
|
270
|
-
},
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
return config;
|
|
275
|
-
};
|