@vev/silke 1.0.31 → 1.1.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/index.js +22 -22
  3. package/dist/styles.css +49 -49
  4. package/dist/types/components/silke-conditions-input/utils.d.ts +1 -1
  5. package/dist/types/components/silke-form-schema/fields/audio-field.d.ts +3 -0
  6. package/dist/types/components/silke-gradient-picker/silke-gradient-picker.d.ts +2 -5
  7. package/dist/types/icons.d.ts +7 -0
  8. package/jest.config.js +1 -0
  9. package/package.json +5 -29
  10. package/project.json +0 -9
  11. package/src/components/silke-autocomplete-field/autocomplete-item.tsx +1 -0
  12. package/src/components/silke-card/silke-card.tsx +12 -1
  13. package/src/components/silke-css-number-field/silke-css-number-field.tsx +2 -1
  14. package/src/components/silke-form-schema/fields/audio-field.tsx +77 -0
  15. package/src/components/silke-form-schema/fields/select-field.tsx +1 -1
  16. package/src/components/silke-form-schema/silke-schema-field.tsx +2 -3
  17. package/src/components/silke-gradient-picker/silke-gradient-picker.tsx +33 -16
  18. package/src/components/silke-icon-picker/icons-tab.tsx +1 -1
  19. package/src/icons.tsx +44 -0
  20. package/tsconfig.build.tsbuildinfo +1 -1
  21. package/dist/types/docs/app.d.ts +0 -3
  22. package/dist/types/docs/components/code-block/code-block.d.ts +0 -5
  23. package/dist/types/docs/components/code-block/index.d.ts +0 -1
  24. package/dist/types/docs/components/state-table/index.d.ts +0 -1
  25. package/dist/types/docs/components/state-table/state-table.d.ts +0 -13
  26. package/dist/types/docs/data/app/actions.d.ts +0 -1
  27. package/dist/types/docs/data/app/constants.d.ts +0 -5
  28. package/dist/types/docs/data/app/index.d.ts +0 -3
  29. package/dist/types/docs/data/app/store.d.ts +0 -8
  30. package/dist/types/docs/data/flux/action-decorator.d.ts +0 -5
  31. package/dist/types/docs/data/flux/action-utils.d.ts +0 -7
  32. package/dist/types/docs/data/flux/controller.d.ts +0 -24
  33. package/dist/types/docs/data/flux/dispatcher.d.ts +0 -7
  34. package/dist/types/docs/data/flux/index.d.ts +0 -6
  35. package/dist/types/docs/data/flux/store.d.ts +0 -15
  36. package/dist/types/docs/data/flux/use-store.d.ts +0 -2
  37. package/dist/types/docs/docs-provider.d.ts +0 -6
  38. package/dist/types/docs/index.d.ts +0 -2
  39. package/dist/types/docs/ipsum-generator.d.ts +0 -7
  40. package/dist/types/docs/parser.d.ts +0 -0
  41. package/dist/types/main.d.ts +0 -1
  42. package/public/index.html +0 -23
  43. package/src/docs/app.tsx +0 -166
  44. package/src/docs/components/code-block/code-block.scss +0 -15
  45. package/src/docs/components/code-block/code-block.tsx +0 -55
  46. package/src/docs/components/code-block/index.ts +0 -1
  47. package/src/docs/components/state-table/index.ts +0 -1
  48. package/src/docs/components/state-table/state-table.scss +0 -10
  49. package/src/docs/components/state-table/state-table.tsx +0 -57
  50. package/src/docs/data/app/actions.ts +0 -17
  51. package/src/docs/data/app/constants.ts +0 -5
  52. package/src/docs/data/app/index.ts +0 -3
  53. package/src/docs/data/app/store.ts +0 -14
  54. package/src/docs/data/flux/action-decorator.ts +0 -16
  55. package/src/docs/data/flux/action-utils.ts +0 -19
  56. package/src/docs/data/flux/controller.ts +0 -76
  57. package/src/docs/data/flux/dispatcher.ts +0 -79
  58. package/src/docs/data/flux/index.ts +0 -10
  59. package/src/docs/data/flux/store.ts +0 -44
  60. package/src/docs/data/flux/use-store.ts +0 -57
  61. package/src/docs/docs-provider.tsx +0 -24
  62. package/src/docs/index.ts +0 -3
  63. package/src/docs/ipsum-generator.tsx +0 -86
  64. package/src/docs/parser.ts +0 -1345
  65. package/src/index.mdx +0 -69
  66. package/src/main.tsx +0 -11
  67. package/src/playground.mdx +0 -65
  68. package/webpack.docs.ts +0 -248
package/src/index.mdx DELETED
@@ -1,69 +0,0 @@
1
- # Vev Silke UI Design Kit
2
-
3
- This document is the Vev design language & system.
4
-
5
- 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).
6
-
7
- ## Solid colors
8
-
9
- These are the solid colors we have in Silke.
10
- The easiest way to use them is to use the **bg** and **color** props on the **SilkeBox** and **SilkeText** components.
11
- 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.
12
-
13
- You should never use a HEX color directly in your code, always use the CSS variables.
14
-
15
- {[
16
- "neutral",
17
- "accent",
18
- "error",
19
- "warning",
20
- "success",
21
- "support-primary",
22
- "support-secondary",
23
- "support-tertiary",
24
- "support-quaternary",
25
- "brand-primary",
26
- "brand-secondary",
27
- "brand-tertiary",
28
- "brand-quaternary",
29
- ].map((color) => (
30
-
31
- <div key={color}>
32
- <h3>{color}</h3>
33
- <div style={{ display: 'flex', flexWrap: 'wrap' }}>
34
- {[0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100].map((i) =>
35
- color !== 'neutral' && (i > 60 || i < 10) ? null : (
36
- <div
37
- key={i}
38
- style={{
39
- background: 'var(--color-' + color + '-' + i + ')',
40
- color: 'var(--color-neutral-' + (i < 40 ? 100 : 0) + ')',
41
- width: 200,
42
- height: 80,
43
- fontSize: 12,
44
- padding: 10,
45
- }}
46
- >
47
- {color + '-' + i}
48
- <br />
49
- var(--color-{color + '-' + i})
50
- </div>
51
- ),
52
- )}
53
- </div>
54
- </div>
55
- ))}
56
-
57
- ## Example usage with SilkeBox
58
-
59
- ```js
60
- () => (
61
- <SilkeBox>
62
- {[0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100].map((i) => (
63
- <SilkeBox key={i} size="xxl" bg={'neutral-' + i} align="center">
64
- <SilkeText color={i < 60 ? 'neutral-100' : 'neutral-0'}>neutral-{i}</SilkeText>
65
- </SilkeBox>
66
- ))}
67
- </SilkeBox>
68
- );
69
- ```
package/src/main.tsx DELETED
@@ -1,11 +0,0 @@
1
- import './styles/core.scss';
2
- import React from 'react';
3
- import { createRoot } from 'react-dom/client';
4
-
5
- (async function () {
6
- const container = document.getElementById('root');
7
- if (!container) return;
8
- const root = createRoot(container);
9
- const { App } = await import('./docs');
10
- root.render(<App />);
11
- })();
@@ -1,65 +0,0 @@
1
- # Playground
2
-
3
- ```js
4
- () => {
5
- const tags = ipsum.list((key) => ({ label: ipsum.name(1), value: key }));
6
- const [tag, setTag] = React.useState(0);
7
- const [search, setSearch] = React.useState('');
8
- const [loading, setLoading] = React.useState(true);
9
-
10
- React.useEffect(() => {
11
- sleep(2000).then(() => setLoading(false));
12
- }, []);
13
-
14
- return (
15
- <SilkeBox bg="ui-background" column style={{ border: '5px solid white' }}>
16
- <SilkeToolbar size="xl" bg="ui-1">
17
- <img src="https://editor.vev.design/static/logo.svg" width={100} alt="Vev logo" />
18
- </SilkeToolbar>
19
-
20
- <SilkeBox>
21
- <SilkeBox style={{ width: 244, borderRight: '1px solid rgba(255,255,255,0.2)' }} bg="ui-1">
22
- Maybe implement a SilkeSidebar
23
- </SilkeBox>
24
-
25
- <SilkeBox column flex bg="ui-1">
26
- <SilkeToolbar hPad="xxl" bg="ui-background">
27
- <SilkeTabs container>
28
- <SilkeTab label="Personal templates" active />
29
- <SilkeTab label="Account templates" />
30
- </SilkeTabs>
31
- </SilkeToolbar>
32
-
33
- <SilkeToolbar hPad="xxl">
34
- <SilkeSelectField label="Tags" items={tags} value={tag} onChange={setTag} />
35
- <SilkeBox flex column>
36
- <SilkeTextField placeholder="Search" flex value={search} onChange={setSearch} />
37
- </SilkeBox>
38
- <SilkeButton label="Add project" icon="add" />
39
- </SilkeToolbar>
40
-
41
- <SilkeCardGrid pad="xxl" loading={loading}>
42
- {search
43
- ? 'No result'
44
- : ipsum.list(5, (key) => (
45
- <SilkeCard
46
- key={key}
47
- title={ipsum.name()}
48
- subTitle={ipsum.name(5)}
49
- text={ipsum.text()}
50
- image={ipsum.image()}
51
- menu={[{ label: 'Item 1' }, { label: 'Item 2' }]}
52
- >
53
- <SilkeButtonSet>
54
- <SilkeButton label="Button 1" />
55
- <SilkeButton label="Button 2" />
56
- </SilkeButtonSet>
57
- </SilkeCard>
58
- ))}
59
- </SilkeCardGrid>
60
- </SilkeBox>
61
- </SilkeBox>
62
- </SilkeBox>
63
- );
64
- };
65
- ```
package/webpack.docs.ts DELETED
@@ -1,248 +0,0 @@
1
- import ReactRefreshPlugin from '@pmmmwh/react-refresh-webpack-plugin';
2
- import autoprefixer from 'autoprefixer';
3
- import { execSync } from 'child_process';
4
- import CopyWebpackPlugin from 'copy-webpack-plugin';
5
- import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
6
- import HtmlWebpackPlugin from 'html-webpack-plugin';
7
- import MiniCssExtractPlugin from 'mini-css-extract-plugin';
8
- import * as path from 'path';
9
- import * as webpack from 'webpack';
10
- import { WebpackConfiguration } from 'webpack-dev-server';
11
- import babelrc from '../../babel.config.json';
12
- // import remarkGfm from 'remark-gfm';
13
-
14
- type Env = {
15
- production?: boolean;
16
- release?: boolean;
17
- WEBPACK_SERVE?: boolean;
18
- };
19
- export default async function (env: Env) {
20
- const isRelease = env.release;
21
- const mode = isRelease || env.production ? 'production' : 'development';
22
-
23
- console.log('Build silke: ' + mode);
24
- const isDev = mode === 'development';
25
- const releaseHash = execSync('git rev-parse --short HEAD').toString().trim();
26
-
27
- // Timestamp from last commit
28
- const releaseTime = execSync('git show -s --format="%ct" HEAD').toString().trim();
29
-
30
- const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
31
-
32
- const srcDir = path.join(__dirname, './src');
33
- const distDir = path.resolve(__dirname, './dist');
34
- const config = {
35
- mode,
36
- context: path.resolve('.'),
37
- stats: 'errors-only',
38
- cache: {
39
- name: 'silke-docs-' + mode,
40
- type: 'filesystem',
41
- cacheDirectory: path.resolve(__dirname, '../../.cache'),
42
- },
43
- entry: './src/main.tsx',
44
- devtool: isRelease ? 'hidden-source-map' : env.WEBPACK_SERVE ? 'source-map' : 'eval-source-map',
45
- output: {
46
- filename: isDev ? '[name].js' : '[name].[contenthash].js',
47
- path: distDir,
48
- publicPath: '/',
49
- globalObject: 'this',
50
- },
51
-
52
- devServer: {
53
- port: 3002,
54
- hot: isDev,
55
- open: '/',
56
- devMiddleware: {
57
- writeToDisk: true,
58
- },
59
- client: {
60
- overlay: {
61
- errors: true,
62
- warnings: false,
63
- },
64
- },
65
-
66
- static: ['./public', path.join(__dirname, 'dist')],
67
- // contentBase: path.join(srcDir, 'static'),
68
- historyApiFallback: {
69
- rewrites: [
70
- {
71
- from: /^(?!static\/).*/,
72
- to() {
73
- return '/';
74
- },
75
- },
76
- ],
77
- },
78
- },
79
-
80
- resolve: {
81
- extensions: ['.ts', '.tsx', '.js', '.jsx'],
82
- modules: ['node_modules', path.resolve('./src')],
83
- },
84
-
85
- module: {
86
- // REQUIRED to avoid issue "Uncaught TypeError: BrowserFS.BFSRequire is not a function"
87
- // See: https://github.com/jvilk/BrowserFS/issues/201
88
- rules: [
89
- {
90
- test: /\.mdx$/,
91
- use: [
92
- {
93
- loader: 'babel-loader',
94
- options: {
95
- presets: ['@babel/preset-env'],
96
- },
97
- },
98
- {
99
- loader: '@mdx-js/loader',
100
- options: {
101
- providerImportSource: '@mdx-js/react',
102
- // remarkPlugins: [remarkGfm],
103
- },
104
- },
105
- ],
106
- },
107
- {
108
- // Ts loader does not work when import d.ts, so only include .ts and tsx files
109
- test: /(?<!\.d)\.tsx?$/,
110
- exclude: [/node_modules/, /\.worker\.ts/],
111
- use: [
112
- {
113
- loader: 'babel-loader',
114
- options: {
115
- cacheDirectory: true,
116
- presets: babelrc.presets,
117
- plugins: isDev ? ['react-refresh/babel', ...babelrc.plugins] : babelrc.plugins,
118
- },
119
- },
120
- ].filter(Boolean),
121
- },
122
- {
123
- test: /\.css$/,
124
- use: [MiniCssExtractPlugin.loader, 'css-loader'].filter(Boolean),
125
- },
126
- {
127
- test: /\.scss$/,
128
- use: [
129
- isDev ? 'style-loader' : MiniCssExtractPlugin.loader,
130
-
131
- {
132
- loader: 'css-loader',
133
- options: {
134
- sourceMap: true,
135
- url: false,
136
- modules: {
137
- localIdentName: '[name]-[local]__[hash:base64:5]',
138
- localIdentContext: path.resolve(__dirname, 'src'),
139
- },
140
- },
141
- },
142
- !isDev && {
143
- loader: 'postcss-loader',
144
- options: {
145
- postcssOptions: {
146
- plugins: ['autoprefixer'],
147
- },
148
- },
149
- },
150
- {
151
- loader: 'sass-loader',
152
- options: {
153
- sourceMap: true,
154
- },
155
- },
156
- ].filter(Boolean),
157
- },
158
- {
159
- test: /\.raw\..+$/i,
160
- use: 'raw-loader',
161
- },
162
- ],
163
- },
164
-
165
- optimization: {
166
- chunkIds: isDev ? 'named' : 'deterministic',
167
- moduleIds: isDev ? 'named' : 'deterministic',
168
- // runtimeChunk: 'single',
169
- splitChunks: {
170
- chunks: 'all',
171
- cacheGroups: {
172
- commons: {
173
- minChunks: 2,
174
- minSize: 0,
175
- chunks: 'initial',
176
- },
177
- core: {
178
- // Note the usage of `[\\/]` as a path separator for cross-platform compatibility.
179
- test: /[\\/]src[\\/](main-libs)/,
180
- },
181
- },
182
- },
183
- },
184
-
185
- plugins: [
186
- progress(),
187
- new webpack.DefinePlugin({
188
- 'process.env': {
189
- NODE_ENV: JSON.stringify(mode),
190
- BRANCH: JSON.stringify(branch),
191
- RELEASE_HASH: JSON.stringify(releaseHash),
192
- RELEASE_TIME: JSON.stringify(releaseTime),
193
- },
194
- }),
195
- new HtmlWebpackPlugin({
196
- filename: 'index.html',
197
- inject: 'body',
198
- chunksSortMode: 'auto',
199
- template: './public/index.html',
200
- }),
201
-
202
- new ForkTsCheckerWebpackPlugin({
203
- async: isDev,
204
- devServer: false,
205
- typescript: {
206
- configFile: path.resolve(__dirname, 'tsconfig.build.json'),
207
- diagnosticOptions: {
208
- semantic: true,
209
- syntactic: true,
210
- },
211
- },
212
- }),
213
-
214
- /*
215
- * DEV PLUGINS
216
- */
217
- isDev && new ReactRefreshPlugin(),
218
- isDev && new webpack.HotModuleReplacementPlugin(),
219
-
220
- /*
221
- * PROD PLUGINS
222
- */
223
- new MiniCssExtractPlugin({
224
- filename: '[name].[contenthash].css',
225
- chunkFilename: '[id].[contenthash].css',
226
- }),
227
- isRelease &&
228
- new CopyWebpackPlugin({
229
- patterns: [{ context: 'public', from: 'static/**/*' }],
230
- }),
231
- ].filter(Boolean),
232
- } as WebpackConfiguration;
233
-
234
- return config;
235
- }
236
-
237
- function progress() {
238
- let lastMsg: string;
239
- return new webpack.ProgressPlugin({
240
- percentBy: 'entries',
241
- handler(percent, message) {
242
- if (lastMsg !== message) {
243
- lastMsg = message;
244
- console.log(`${Math.round(percent * 100)}% | ${message}`);
245
- }
246
- },
247
- });
248
- }