lapikit 0.0.0-insiders.f502b02 → 0.0.0-insiders.f8b6426
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/bin/helper.js +23 -0
- package/bin/lapikit.js +30 -5
- package/bin/modules/plugin.js +66 -0
- package/dist/assets/icons/arrow-down.svelte +2 -0
- package/dist/assets/icons/arrow-down.svelte.d.ts +6 -14
- package/dist/assets/icons/arrow-up.svelte +2 -0
- package/dist/assets/icons/arrow-up.svelte.d.ts +6 -14
- package/dist/assets/icons/close-fill.svelte +2 -0
- package/dist/assets/icons/close-fill.svelte.d.ts +6 -14
- package/dist/assets/icons/loading-fill.svelte +2 -0
- package/dist/assets/icons/loading-fill.svelte.d.ts +6 -14
- package/dist/components/accordion/accordion.css +6 -6
- package/dist/components/alert/alert.css +19 -9
- package/dist/components/app/app.css +1 -1
- package/dist/components/appbar/appbar.css +2 -2
- package/dist/components/appbar/appbar.svelte +0 -1
- package/dist/components/aspect-ratio/aspect-ratio.svelte +0 -1
- package/dist/components/avatar/avatar.css +5 -5
- package/dist/components/button/button.css +28 -25
- package/dist/components/button/button.svelte +8 -12
- package/dist/components/button/types.d.ts +2 -2
- package/dist/components/card/card.css +64 -58
- package/dist/components/card/card.svelte +14 -1
- package/dist/components/card/types.d.ts +1 -1
- package/dist/components/chip/chip.css +114 -82
- package/dist/components/chip/chip.svelte +18 -7
- package/dist/components/chip/types.d.ts +2 -1
- package/dist/components/dialog/dialog.css +2 -2
- package/dist/components/dropdown/dropdown.css +4 -4
- package/dist/components/icon/icon.css +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/list/list.css +145 -119
- package/dist/components/list/list.svelte +1 -3
- package/dist/components/list/modules/list-item.svelte +9 -1
- package/dist/components/list/types.d.ts +2 -5
- package/dist/components/modal/modal.css +10 -6
- package/dist/components/modal/modal.svelte +1 -0
- package/dist/components/popover/popover.css +4 -4
- package/dist/components/separator/separator.css +1 -1
- package/dist/components/textfield/textfield.css +305 -0
- package/dist/components/textfield/textfield.svelte +193 -0
- package/dist/components/textfield/textfield.svelte.d.ts +4 -0
- package/dist/components/textfield/types.d.ts +37 -0
- package/dist/components/textfield/types.js +1 -0
- package/dist/components/toolbar/toolbar.css +6 -6
- package/dist/components/tooltip/tooltip.css +4 -4
- package/dist/internal/assets.svelte.js +2 -0
- package/dist/internal/ripple.d.ts +1 -0
- package/dist/internal/ripple.js +3 -0
- package/dist/style/animation.css +2 -0
- package/dist/style/normalize.css +2 -0
- package/dist/style/parser/color.js +2 -2
- package/package.json +2 -1
package/bin/helper.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
1
4
|
const color = {
|
|
2
5
|
red: (text) => `\x1b[31m${text}\x1b[0m`,
|
|
3
6
|
green: (text) => `\x1b[32m${text}\x1b[0m`,
|
|
@@ -63,6 +66,26 @@ export function getCssPathFromArgs() {
|
|
|
63
66
|
return args[1] || 'src/app.css';
|
|
64
67
|
}
|
|
65
68
|
|
|
69
|
+
export function getLapikitPathFromArgs() {
|
|
70
|
+
const args = process.argv.slice(2);
|
|
71
|
+
// Search argument after --plugin-path or -p
|
|
72
|
+
const pluginPathIndex = args.findIndex((arg) => arg === '--plugin-path' || arg === '-p');
|
|
73
|
+
if (pluginPathIndex !== -1 && args[pluginPathIndex + 1]) {
|
|
74
|
+
return args[pluginPathIndex + 1];
|
|
75
|
+
}
|
|
76
|
+
return 'src/plugin';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function validatePluginPath(pluginPath) {
|
|
80
|
+
if (!pluginPath.startsWith('src/')) {
|
|
81
|
+
return {
|
|
82
|
+
valid: false,
|
|
83
|
+
error: 'The path must start with "src/"'
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return { valid: true };
|
|
87
|
+
}
|
|
88
|
+
|
|
66
89
|
export async function envTypescript() {
|
|
67
90
|
const directory = process.cwd();
|
|
68
91
|
try {
|
package/bin/lapikit.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { promises as fs } from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ansi,
|
|
6
|
+
terminal,
|
|
7
|
+
envTypescript,
|
|
8
|
+
getLapikitPathFromArgs,
|
|
9
|
+
validatePluginPath
|
|
10
|
+
} from './helper.js';
|
|
5
11
|
import { preset } from './modules/preset.js';
|
|
6
12
|
import { adapterCSSConfig, adapterViteConfig } from './modules/adapter.js';
|
|
13
|
+
import { createPluginStructure } from './modules/plugin.js';
|
|
7
14
|
|
|
8
15
|
const [, , command] = process.argv;
|
|
9
16
|
const typescriptEnabled = envTypescript();
|
|
@@ -11,8 +18,9 @@ const typescriptEnabled = envTypescript();
|
|
|
11
18
|
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
12
19
|
terminal(
|
|
13
20
|
'info',
|
|
14
|
-
`usage: ${ansi.color.yellow('npx lapikit init {cssPath}')}\n\n ${ansi.variant.bold('options:')}\n
|
|
15
|
-
- {cssPath}: (${ansi.color.cyan('src/app.css')}) customize path on your origin css file
|
|
21
|
+
`usage: ${ansi.color.yellow('npx lapikit init {cssPath} [--plugin-path {pluginPath}]')}\n\n ${ansi.variant.bold('options:')}\n
|
|
22
|
+
- {cssPath}: (${ansi.color.cyan('src/app.css')}) customize path on your origin css file.
|
|
23
|
+
- --plugin-path, -p: (${ansi.color.cyan('src/plugin')}) customize path for the plugin directory.\n\n`
|
|
16
24
|
);
|
|
17
25
|
process.exit(0);
|
|
18
26
|
} else if (command === 'init') {
|
|
@@ -27,6 +35,15 @@ if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
|
27
35
|
|
|
28
36
|
terminal('none', `${ansi.bold.blue('LAPIKIT')} - Component Library for Svelte\n\n`);
|
|
29
37
|
|
|
38
|
+
// Récupérer et valider le chemin du plugin
|
|
39
|
+
const pluginPath = getLapikitPathFromArgs();
|
|
40
|
+
const pathValidation = validatePluginPath(pluginPath);
|
|
41
|
+
|
|
42
|
+
if (!pathValidation.valid) {
|
|
43
|
+
terminal('error', `Chemin incorrect: ${pathValidation.error}`);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
30
47
|
const configPath = path.resolve(process.cwd(), 'lapikit.config.js');
|
|
31
48
|
try {
|
|
32
49
|
await fs.writeFile(configPath, preset.trim() + '\n', 'utf8');
|
|
@@ -35,18 +52,26 @@ if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
|
35
52
|
terminal('error', `failed to create configuration file:\n\n ${error}`);
|
|
36
53
|
terminal(
|
|
37
54
|
'warn',
|
|
38
|
-
`you can create lapikit.config.js manually, please visite https://
|
|
55
|
+
`you can create lapikit.config.js manually, please visite https://lapikit.dev/docs/getting-started for more information`
|
|
39
56
|
);
|
|
40
57
|
}
|
|
41
58
|
|
|
59
|
+
// Create plugin structure
|
|
60
|
+
try {
|
|
61
|
+
await createPluginStructure(pluginPath, typescriptEnabled);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
terminal('error', `Create plugin structure not working : ${error.message}`);
|
|
64
|
+
}
|
|
65
|
+
|
|
42
66
|
await adapterViteConfig(typescriptEnabled);
|
|
43
67
|
await adapterCSSConfig();
|
|
44
68
|
|
|
45
69
|
terminal(
|
|
46
70
|
'info',
|
|
47
|
-
`${ansi.bold.blue('Thank to use lapikit, discover all posibility with lapikit on https://
|
|
71
|
+
`${ansi.bold.blue('Thank to use lapikit, discover all posibility with lapikit on https://lapikit.dev')}\n\n`
|
|
48
72
|
);
|
|
49
73
|
|
|
74
|
+
console.log('Website: https://lapikit.dev');
|
|
50
75
|
console.log('Github: https://github.com/nycolaide/lapikit');
|
|
51
76
|
console.log('Support the developement: https://buymeacoffee.com/nycolaide');
|
|
52
77
|
} else {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { terminal } from '../helper.js';
|
|
4
|
+
|
|
5
|
+
const lapikitTsTemplate = `import type { Config } from 'lapikit';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Custom configuration for Lapikit
|
|
9
|
+
* @see https://lapikit.dev/docs/customize
|
|
10
|
+
*/
|
|
11
|
+
const config: Config = {
|
|
12
|
+
theme: {
|
|
13
|
+
colorScheme: 'light',
|
|
14
|
+
colors: {
|
|
15
|
+
primary: '#3b82f6',
|
|
16
|
+
secondary: '#6b7280'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default config;
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const lapikitJsTemplate = `/**
|
|
25
|
+
* Custom configuration for Lapikit
|
|
26
|
+
* @see https://lapikit.dev/docs/customize
|
|
27
|
+
* @type {import('lapikit').Config}
|
|
28
|
+
*/
|
|
29
|
+
const config = {
|
|
30
|
+
theme: {
|
|
31
|
+
colorScheme: 'light',
|
|
32
|
+
colors: {
|
|
33
|
+
primary: '#3b82f6',
|
|
34
|
+
secondary: '#6b7280'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default config;
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
export async function createPluginStructure(pluginPath, isTypescript) {
|
|
43
|
+
const resolvedPluginPath = path.resolve(process.cwd(), pluginPath);
|
|
44
|
+
const lapikitFileName = isTypescript ? 'lapikit.ts' : 'lapikit.js';
|
|
45
|
+
const lapikitFilePath = path.join(resolvedPluginPath, lapikitFileName);
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
// Verify plugin directory
|
|
49
|
+
try {
|
|
50
|
+
await fs.access(resolvedPluginPath);
|
|
51
|
+
terminal('info', `Le dossier ${pluginPath} existe déjà.`);
|
|
52
|
+
} catch {
|
|
53
|
+
await fs.mkdir(resolvedPluginPath, { recursive: true });
|
|
54
|
+
terminal('success', `Dossier ${pluginPath} créé avec succès.`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Create lapikit.ts or lapikit.js
|
|
58
|
+
const template = isTypescript ? lapikitTsTemplate : lapikitJsTemplate;
|
|
59
|
+
await fs.writeFile(lapikitFilePath, template.trim() + '\n', 'utf8');
|
|
60
|
+
|
|
61
|
+
terminal('success', `File ${lapikitFileName} created in ${pluginPath}.`);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
terminal('error', `Error creating plugin structure: ${error.message}`);
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
export default ArrowDown;
|
|
2
|
-
type ArrowDown = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const ArrowDown: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
1
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import(
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
16
3
|
$$bindings?: Bindings;
|
|
17
4
|
} & Exports;
|
|
18
5
|
(internal: unknown, props: {
|
|
@@ -24,3 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
24
11
|
};
|
|
25
12
|
z_$$bindings?: Bindings;
|
|
26
13
|
}
|
|
14
|
+
declare const ArrowDown: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type ArrowDown = InstanceType<typeof ArrowDown>;
|
|
18
|
+
export default ArrowDown;
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
export default ArrowUp;
|
|
2
|
-
type ArrowUp = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const ArrowUp: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
1
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import(
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
16
3
|
$$bindings?: Bindings;
|
|
17
4
|
} & Exports;
|
|
18
5
|
(internal: unknown, props: {
|
|
@@ -24,3 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
24
11
|
};
|
|
25
12
|
z_$$bindings?: Bindings;
|
|
26
13
|
}
|
|
14
|
+
declare const ArrowUp: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type ArrowUp = InstanceType<typeof ArrowUp>;
|
|
18
|
+
export default ArrowUp;
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
export default CloseFill;
|
|
2
|
-
type CloseFill = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const CloseFill: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
1
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import(
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
16
3
|
$$bindings?: Bindings;
|
|
17
4
|
} & Exports;
|
|
18
5
|
(internal: unknown, props: {
|
|
@@ -24,3 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
24
11
|
};
|
|
25
12
|
z_$$bindings?: Bindings;
|
|
26
13
|
}
|
|
14
|
+
declare const CloseFill: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type CloseFill = InstanceType<typeof CloseFill>;
|
|
18
|
+
export default CloseFill;
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
export default LoadingFill;
|
|
2
|
-
type LoadingFill = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const LoadingFill: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
1
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import(
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
16
3
|
$$bindings?: Bindings;
|
|
17
4
|
} & Exports;
|
|
18
5
|
(internal: unknown, props: {
|
|
@@ -24,3 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
24
11
|
};
|
|
25
12
|
z_$$bindings?: Bindings;
|
|
26
13
|
}
|
|
14
|
+
declare const LoadingFill: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type LoadingFill = InstanceType<typeof LoadingFill>;
|
|
18
|
+
export default LoadingFill;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.kit-accordion {
|
|
2
|
-
--accordion-color: var(--on, var(--kit-on-
|
|
3
|
-
--accordion-background: var(--base, var(--kit-
|
|
2
|
+
--accordion-color: var(--on, var(--kit-on-container));
|
|
3
|
+
--accordion-background: var(--base, var(--kit-container));
|
|
4
4
|
--accordion-radius: var(--shape, var(--kit-radius-md));
|
|
5
5
|
|
|
6
6
|
display: flex;
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
transition: 0.3s all cubic-bezier(0.4, 0, 0.2, 1);
|
|
48
48
|
transition-property: margin-top, border-radius, border, max-width;
|
|
49
49
|
border-radius: var(--shape, var(--accordion-radius, var(--kit-radius-md)));
|
|
50
|
-
color: var(--on, var(--accordion-color, var(--kit-on-
|
|
51
|
-
background-color: var(--base, var(--accordion-background, var(--kit-
|
|
52
|
-
transition:
|
|
50
|
+
color: var(--on, var(--accordion-color, var(--kit-on-container)));
|
|
51
|
+
background-color: var(--base, var(--accordion-background, var(--kit-container)));
|
|
52
|
+
/* transition:
|
|
53
53
|
color 0.5s,
|
|
54
|
-
background-color 0.5s;
|
|
54
|
+
background-color 0.5s; */
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.kit-accordion .kit-accordion-item > button,
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
/* root */
|
|
1
2
|
.kit-alert {
|
|
2
|
-
--alert-color: var(--on, var(--kit-on-
|
|
3
|
-
--alert-background: var(--base, var(--kit-
|
|
3
|
+
--alert-color: var(--on, var(--kit-on-container));
|
|
4
|
+
--alert-background: var(--base, var(--kit-container));
|
|
4
5
|
--alert-radius: var(--shape, var(--kit-radius-md));
|
|
6
|
+
}
|
|
5
7
|
|
|
8
|
+
.kit-alert {
|
|
6
9
|
display: grid;
|
|
7
10
|
flex: 1 1;
|
|
8
11
|
grid-template-areas:
|
|
9
12
|
'prepend content append close'
|
|
10
13
|
'. content . .';
|
|
11
|
-
grid-template-columns: max-content
|
|
14
|
+
grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
|
|
12
15
|
position: relative;
|
|
13
16
|
padding: 1rem;
|
|
14
17
|
overflow: hidden;
|
|
15
18
|
color: var(--alert-color);
|
|
16
19
|
background-color: var(--alert-background);
|
|
17
20
|
border-radius: var(--alert-radius);
|
|
18
|
-
|
|
19
|
-
color 0.5s,
|
|
20
|
-
background-color 0.5s;
|
|
21
|
+
line-height: 0;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
.kit-alert .kit-alert--underlay {
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
padding-top: 0.75rem;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
.kit-alert .kit-alert
|
|
57
|
+
.kit-alert .kit-alert--prepend {
|
|
57
58
|
align-self: flex-start;
|
|
58
59
|
display: flex;
|
|
59
60
|
align-items: center;
|
|
@@ -61,10 +62,11 @@
|
|
|
61
62
|
margin-inline-end: 1rem;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
.kit-alert .kit-alert
|
|
65
|
-
align-self:
|
|
65
|
+
.kit-alert .kit-alert--content {
|
|
66
|
+
align-self: flex-start;
|
|
66
67
|
grid-area: content;
|
|
67
68
|
overflow: hidden;
|
|
69
|
+
line-height: normal;
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
.kit-alert .kit-alert--close {
|
|
@@ -74,6 +76,14 @@
|
|
|
74
76
|
grid-area: close;
|
|
75
77
|
}
|
|
76
78
|
|
|
79
|
+
.kit-alert .kit-alert--append {
|
|
80
|
+
align-self: flex-start;
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
grid-area: append;
|
|
84
|
+
margin-inline-start: 1rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
77
87
|
/* state */
|
|
78
88
|
.kit-alert.kit-alert--info:not([class*='alert--variant-']) {
|
|
79
89
|
--on: var(--kit-on-info);
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
color: var(--appbar-color);
|
|
16
16
|
background-color: var(--appbar-background);
|
|
17
17
|
border-color: var(--appbar-background);
|
|
18
|
-
transition:
|
|
18
|
+
/* transition:
|
|
19
19
|
color 0.5s,
|
|
20
20
|
border-color 0.5s,
|
|
21
|
-
background-color 0.5s;
|
|
21
|
+
background-color 0.5s; */
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/* wrapper */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.kit-avatar {
|
|
2
|
-
--avatar-color: var(--on, var(--kit-on-
|
|
3
|
-
--avatar-background: var(--base, var(--kit-
|
|
2
|
+
--avatar-color: var(--on, var(--kit-on-container));
|
|
3
|
+
--avatar-background: var(--base, var(--kit-container));
|
|
4
4
|
--avatar-radius: var(--shape, var(--kit-radius-full));
|
|
5
5
|
|
|
6
6
|
display: flex;
|
|
@@ -91,19 +91,19 @@
|
|
|
91
91
|
|
|
92
92
|
/* variant */
|
|
93
93
|
.kit-avatar[breakpoint]kit-avatar--variant-outline {
|
|
94
|
-
--avatar-color: var(--base, var(--kit-
|
|
94
|
+
--avatar-color: var(--base, var(--kit-container));
|
|
95
95
|
background-color: transparent;
|
|
96
96
|
border: 1px solid currentColor;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
.kit-avatar[breakpoint]kit-avatar--variant-text {
|
|
100
|
-
--avatar-color: var(--base, var(--kit-
|
|
100
|
+
--avatar-color: var(--base, var(--kit-container));
|
|
101
101
|
background-color: transparent;
|
|
102
102
|
border-color: transparent;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
.kit-avatar[breakpoint]kit-avatar--variant-dash {
|
|
106
|
-
--avatar-color: var(--base, var(--kit-
|
|
106
|
+
--avatar-color: var(--base, var(--kit-container));
|
|
107
107
|
background-color: transparent;
|
|
108
108
|
border: 1px dashed currentColor;
|
|
109
109
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* root */
|
|
2
2
|
.kit-button {
|
|
3
|
-
--button-color: var(--on, var(--kit-on-
|
|
4
|
-
--button-background: var(--base, var(--kit-
|
|
3
|
+
--button-color: var(--on, var(--kit-on-container));
|
|
4
|
+
--button-background: var(--base, var(--kit-container));
|
|
5
5
|
--button-radius: var(--shape, var(--kit-radius-md));
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
padding-left: var(--button-spacing-y);
|
|
17
17
|
border-radius: var(--button-radius);
|
|
18
18
|
color: var(--button-color);
|
|
19
|
-
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
text-decoration: none;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
.kit-button,
|
|
@@ -141,9 +142,13 @@
|
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
/* variant */
|
|
145
|
+
.kit-button[breakpoint]kit-button--variant-filled {
|
|
146
|
+
background-color: var(--button-background);
|
|
147
|
+
}
|
|
148
|
+
|
|
144
149
|
.kit-button[breakpoint]kit-button--variant-outline {
|
|
145
|
-
--button-color: var(--
|
|
146
|
-
background-color:
|
|
150
|
+
--button-color: var(--on, var(--kit-on-container));
|
|
151
|
+
background-color: var(--button-background);
|
|
147
152
|
}
|
|
148
153
|
.kit-button[breakpoint]kit-button--variant-outline::before {
|
|
149
154
|
content: '';
|
|
@@ -155,51 +160,49 @@
|
|
|
155
160
|
}
|
|
156
161
|
|
|
157
162
|
.kit-button[breakpoint]kit-button--variant-text {
|
|
158
|
-
--button-color: var(--base, var(--kit-
|
|
163
|
+
--button-color: var(--base, var(--kit-on-container));
|
|
159
164
|
background-color: transparent;
|
|
160
165
|
border: none;
|
|
161
166
|
}
|
|
162
167
|
|
|
163
168
|
/* state */
|
|
164
|
-
.kit-button.kit-button--info
|
|
169
|
+
.kit-button.kit-button--info[class*='button--variant-filled'] {
|
|
165
170
|
--on: var(--kit-on-info);
|
|
166
171
|
--base: var(--kit-info);
|
|
167
172
|
}
|
|
168
|
-
.kit-button.kit-button--info[class*='button--variant-'] {
|
|
173
|
+
.kit-button.kit-button--info[class*='button--variant-']:not([class*='variant-filled']) {
|
|
169
174
|
--base: var(--kit-info);
|
|
170
175
|
}
|
|
171
|
-
.kit-button.kit-button--success
|
|
176
|
+
.kit-button.kit-button--success[class*='button--variant-filled'] {
|
|
172
177
|
--on: var(--kit-on-success);
|
|
173
178
|
--base: var(--kit-success);
|
|
174
179
|
}
|
|
175
|
-
.kit-button.kit-button--success[class*='button--variant-'] {
|
|
180
|
+
.kit-button.kit-button--success[class*='button--variant-']:not([class*='variant-filled']) {
|
|
176
181
|
--base: var(--kit-success);
|
|
177
182
|
}
|
|
178
|
-
.kit-button.kit-button--warning
|
|
183
|
+
.kit-button.kit-button--warning[class*='button--variant-filled'] {
|
|
179
184
|
--on: var(--kit-on-warning);
|
|
180
185
|
--base: var(--kit-warning);
|
|
181
186
|
}
|
|
182
|
-
.kit-button.kit-button--warning[class*='button--variant-'] {
|
|
187
|
+
.kit-button.kit-button--warning[class*='button--variant-']:not([class*='variant-filled']) {
|
|
183
188
|
--base: var(--kit-warning);
|
|
184
189
|
}
|
|
185
|
-
.kit-button.kit-button--error
|
|
190
|
+
.kit-button.kit-button--error[class*='button--variant-filled'] {
|
|
186
191
|
--on: var(--kit-on-error);
|
|
187
192
|
--base: var(--kit-error);
|
|
188
193
|
}
|
|
189
|
-
.kit-button.kit-button--error[class*='button--variant-'] {
|
|
194
|
+
.kit-button.kit-button--error[class*='button--variant-']:not([class*='variant-filled']) {
|
|
190
195
|
--base: var(--kit-error);
|
|
191
196
|
}
|
|
192
197
|
|
|
193
198
|
/* events */
|
|
194
|
-
.kit-button
|
|
195
|
-
.kit-button.kit-button--active
|
|
199
|
+
.kit-button[class*='button--variant-filled']:active,
|
|
200
|
+
.kit-button.kit-button--active[class*='button--variant-filled'] {
|
|
196
201
|
background-color: color-mix(in oklab, var(--button-background) 90%, var(--kit-scrim));
|
|
197
|
-
border-color: color-mix(in oklab, var(--button-background) 90%, var(--kit-scrim));
|
|
198
202
|
}
|
|
199
|
-
.kit-button.kit-button--active[class*='button--variant-']:active,
|
|
200
|
-
.kit-button.kit-button--active[class*='button--variant-'] {
|
|
203
|
+
.kit-button.kit-button--active[class*='button--variant-']:not([class*='variant-filled']):active,
|
|
204
|
+
.kit-button.kit-button--active[class*='button--variant-']:not([class*='variant-filled']) {
|
|
201
205
|
background-color: color-mix(in oklab, currentColor 15%, transparent);
|
|
202
|
-
border-color: color-mix(in oklab, currentColor 15%, transparent);
|
|
203
206
|
}
|
|
204
207
|
|
|
205
208
|
/* icon */
|
|
@@ -216,16 +219,16 @@
|
|
|
216
219
|
user-select: none;
|
|
217
220
|
cursor: default;
|
|
218
221
|
}
|
|
219
|
-
.kit-button
|
|
222
|
+
.kit-button[class*='button--variant-filled'].kit-button--disabled {
|
|
220
223
|
color: color-mix(in oklab, var(--button-color) 40%, transparent) !important;
|
|
221
224
|
background-color: color-mix(in oklab, var(--button-background) 70%, transparent) !important;
|
|
222
|
-
border-color: color-mix(in oklab, var(--button-background) 70%, transparent) !important;
|
|
223
225
|
}
|
|
224
|
-
.kit-button
|
|
226
|
+
.kit-button[class*='button--variant-filled'].kit-button--disabled i:before {
|
|
225
227
|
color: color-mix(in oklab, var(--button-color) 40%, transparent) !important;
|
|
226
228
|
}
|
|
227
|
-
.kit-button[class*='button--variant-'].kit-button--disabled,
|
|
228
|
-
.kit-button[class*='button--variant-'].kit-button--disabled
|
|
229
|
+
.kit-button[class*='button--variant-']:not([class*='variant-filled']).kit-button--disabled,
|
|
230
|
+
.kit-button[class*='button--variant-']:not([class*='variant-filled']).kit-button--disabled
|
|
231
|
+
i::before {
|
|
229
232
|
color: color-mix(in oklab, var(--button-background) 40%, transparent) !important;
|
|
230
233
|
}
|
|
231
234
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
dark,
|
|
18
18
|
light,
|
|
19
19
|
active,
|
|
20
|
-
variant,
|
|
20
|
+
variant = 'filled',
|
|
21
21
|
error,
|
|
22
22
|
info,
|
|
23
23
|
success,
|
|
@@ -37,11 +37,6 @@
|
|
|
37
37
|
}: ButtonProps = $props();
|
|
38
38
|
|
|
39
39
|
const assets = getAssets();
|
|
40
|
-
|
|
41
|
-
$effect(() => {
|
|
42
|
-
if (type === 'submit') is = 'input';
|
|
43
|
-
if (type === 'reset') is = 'input';
|
|
44
|
-
});
|
|
45
40
|
</script>
|
|
46
41
|
|
|
47
42
|
<svelte:element
|
|
@@ -70,6 +65,7 @@
|
|
|
70
65
|
disabled={href ? undefined : disabled}
|
|
71
66
|
type={href ? undefined : type}
|
|
72
67
|
use:ripple={{
|
|
68
|
+
component: 'button',
|
|
73
69
|
disabled: noRipple || disabled
|
|
74
70
|
}}
|
|
75
71
|
style:--base={assets.color(background)}
|
|
@@ -89,18 +85,18 @@
|
|
|
89
85
|
{/if}
|
|
90
86
|
|
|
91
87
|
{#if prepend}
|
|
92
|
-
<
|
|
88
|
+
<div class="kit-button-prepend">
|
|
93
89
|
{@render prepend?.()}
|
|
94
|
-
</
|
|
90
|
+
</div>
|
|
95
91
|
{/if}
|
|
96
92
|
|
|
97
|
-
<
|
|
93
|
+
<div class="kit-button-content">
|
|
98
94
|
{@render children?.()}
|
|
99
|
-
</
|
|
95
|
+
</div>
|
|
100
96
|
|
|
101
97
|
{#if append}
|
|
102
|
-
<
|
|
98
|
+
<div class="kit-button-append">
|
|
103
99
|
{@render append?.()}
|
|
104
|
-
</
|
|
100
|
+
</div>
|
|
105
101
|
{/if}
|
|
106
102
|
</svelte:element>
|