lapikit 0.0.0-insiders.c501032 → 0.0.0-insiders.d9491fb
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/LICENSE +21 -0
- package/bin/helper.js +41 -32
- package/bin/lapikit.js +7 -7
- package/bin/modules/adapter.js +2 -2
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +1 -0
- package/dist/assets/icons/arrow-down.svelte +10 -0
- package/dist/assets/icons/arrow-down.svelte.d.ts +26 -0
- package/dist/assets/icons/arrow-up.svelte +10 -0
- package/dist/assets/icons/arrow-up.svelte.d.ts +26 -0
- package/dist/assets/icons/close-fill.svelte +10 -0
- package/dist/assets/icons/close-fill.svelte.d.ts +26 -0
- package/dist/assets/icons/loading-fill.svelte +29 -0
- package/dist/assets/icons/loading-fill.svelte.d.ts +26 -0
- package/dist/components/accordion/accordion.css +113 -0
- package/dist/components/accordion/accordion.svelte +37 -0
- package/dist/components/accordion/accordion.svelte.d.ts +4 -0
- package/dist/components/accordion/accordion.svelte.js +24 -0
- package/dist/components/accordion/modules/accordion-item.svelte +94 -0
- package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
- package/dist/components/accordion/types.d.ts +33 -0
- package/dist/components/accordion/types.js +1 -0
- package/dist/components/alert/alert.css +127 -0
- package/dist/components/alert/alert.svelte +89 -0
- package/dist/components/alert/alert.svelte.d.ts +4 -0
- package/dist/components/alert/types.d.ts +28 -0
- package/dist/components/alert/types.js +1 -0
- package/dist/components/app/app.css +16 -0
- package/dist/components/app/app.svelte +23 -0
- package/dist/components/app/app.svelte.d.ts +7 -0
- package/dist/components/app/types.d.ts +4 -0
- package/dist/components/app/types.js +1 -0
- package/dist/components/appbar/appbar.css +49 -0
- package/dist/components/appbar/appbar.svelte +41 -0
- package/dist/components/appbar/appbar.svelte.d.ts +4 -0
- package/dist/components/appbar/types.d.ts +15 -0
- package/dist/components/appbar/types.js +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
- package/dist/components/aspect-ratio/aspect-ratio.svelte +48 -0
- package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
- package/dist/components/aspect-ratio/types.d.ts +5 -0
- package/dist/components/aspect-ratio/types.js +1 -0
- package/dist/components/avatar/avatar.css +109 -0
- package/dist/components/avatar/avatar.svelte +46 -0
- package/dist/components/avatar/avatar.svelte.d.ts +4 -0
- package/dist/components/avatar/types.d.ts +22 -0
- package/dist/components/avatar/types.js +1 -0
- package/dist/components/button/button.css +276 -0
- package/dist/components/button/button.svelte +94 -0
- package/dist/components/button/button.svelte.d.ts +4 -0
- package/dist/components/button/types.d.ts +27 -0
- package/dist/components/button/types.js +1 -0
- package/dist/components/card/card.css +109 -0
- package/dist/components/card/card.svelte +50 -0
- package/dist/components/card/card.svelte.d.ts +4 -0
- package/dist/components/card/types.d.ts +18 -0
- package/dist/components/card/types.js +1 -0
- package/dist/components/chip/chip.css +199 -0
- package/dist/components/chip/chip.svelte +118 -0
- package/dist/components/chip/chip.svelte.d.ts +4 -0
- package/dist/components/chip/types.d.ts +30 -0
- package/dist/components/chip/types.js +1 -0
- package/dist/components/dialog/dialog.css +134 -0
- package/dist/components/dialog/dialog.svelte +67 -0
- package/dist/components/dialog/dialog.svelte.d.ts +4 -0
- package/dist/components/dialog/types.d.ts +24 -0
- package/dist/components/dialog/types.js +1 -0
- package/dist/components/dropdown/dropdown.css +22 -0
- package/dist/components/dropdown/dropdown.svelte +116 -0
- package/dist/components/dropdown/dropdown.svelte.d.ts +4 -0
- package/dist/components/dropdown/dropdown.svelte.js +148 -0
- package/dist/components/dropdown/types.d.ts +26 -0
- package/dist/components/dropdown/types.js +1 -0
- package/dist/components/icon/icon.css +76 -0
- package/dist/components/icon/icon.svelte +49 -0
- package/dist/components/icon/icon.svelte.d.ts +4 -0
- package/dist/components/icon/types.d.ts +16 -0
- package/dist/components/icon/types.js +1 -0
- package/dist/components/index.d.ts +21 -0
- package/dist/components/index.js +22 -0
- package/dist/components/list/list.css +195 -0
- package/dist/components/list/list.svelte +46 -0
- package/dist/components/list/list.svelte.d.ts +4 -0
- package/dist/components/list/modules/list-item.svelte +68 -0
- package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
- package/dist/components/list/types.d.ts +36 -0
- package/dist/components/list/types.js +1 -0
- package/dist/components/modal/modal.css +140 -0
- package/dist/components/modal/modal.svelte +112 -0
- package/dist/components/modal/modal.svelte.d.ts +4 -0
- package/dist/components/modal/types.d.ts +26 -0
- package/dist/components/modal/types.js +1 -0
- package/dist/components/popover/popover.css +22 -0
- package/dist/components/popover/popover.svelte +73 -0
- package/dist/components/popover/popover.svelte.d.ts +4 -0
- package/dist/components/popover/popover.svelte.js +134 -0
- package/dist/components/popover/types.d.ts +20 -0
- package/dist/components/popover/types.js +1 -0
- package/dist/components/separator/separator.css +46 -0
- package/dist/components/separator/separator.svelte +37 -0
- package/dist/components/separator/separator.svelte.d.ts +4 -0
- package/dist/components/separator/types.d.ts +11 -0
- package/dist/components/separator/types.js +1 -0
- package/dist/components/spacer/spacer.css +3 -0
- package/dist/components/spacer/spacer.svelte +7 -0
- package/dist/components/spacer/spacer.svelte.d.ts +4 -0
- package/dist/components/spacer/types.d.ts +4 -0
- package/dist/components/spacer/types.js +1 -0
- package/dist/components/toolbar/toolbar.css +129 -0
- package/dist/components/toolbar/toolbar.svelte +47 -0
- package/dist/components/toolbar/toolbar.svelte.d.ts +4 -0
- package/dist/components/toolbar/types.d.ts +27 -0
- package/dist/components/toolbar/types.js +1 -0
- package/dist/components/tooltip/tooltip.css +124 -0
- package/dist/components/tooltip/tooltip.svelte +113 -0
- package/dist/components/tooltip/tooltip.svelte.d.ts +4 -0
- package/dist/components/tooltip/tooltip.svelte.js +131 -0
- package/dist/components/tooltip/types.d.ts +23 -0
- package/dist/components/tooltip/types.js +1 -0
- package/dist/internal/assets.svelte.d.ts +8 -0
- package/dist/internal/assets.svelte.js +52 -0
- package/dist/internal/clickOutside.d.ts +9 -0
- package/dist/internal/clickOutside.js +34 -0
- package/dist/internal/index.d.ts +2 -0
- package/dist/internal/index.js +2 -0
- package/dist/internal/scroll.d.ts +1 -0
- package/dist/internal/scroll.js +6 -0
- package/dist/internal/types.d.ts +13 -0
- package/dist/internal/unit.d.ts +1 -0
- package/dist/internal/unit.js +11 -0
- package/dist/preset.js +14 -2
- package/dist/stores/index.d.ts +9 -0
- package/dist/stores/index.js +46 -0
- package/dist/style/animation.css +20 -0
- package/dist/style/css.js +6 -3
- package/dist/style/parser/color.js +13 -2
- package/dist/style/parser/device.js +31 -19
- package/dist/style/variable.css +12 -0
- package/dist/utils/x11.d.ts +1 -1
- package/package.json +14 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Nycolaide <https://github.com/Nycolaide>.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/bin/helper.js
CHANGED
|
@@ -1,43 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
red: `\x1b[31m${text}\x1b[0m`,
|
|
3
|
-
green: `\x1b[32m${text}\x1b[0m`,
|
|
4
|
-
yellow: `\x1b[33m${text}\x1b[0m`,
|
|
5
|
-
blue: `\x1b[34m${text}\x1b[0m`,
|
|
6
|
-
purple: `\x1b[35m${text}\x1b[0m`,
|
|
7
|
-
cyan: `\x1b[36m${text}\x1b[0m`
|
|
1
|
+
const color = {
|
|
2
|
+
red: (text) => `\x1b[31m${text}\x1b[0m`,
|
|
3
|
+
green: (text) => `\x1b[32m${text}\x1b[0m`,
|
|
4
|
+
yellow: (text) => `\x1b[33m${text}\x1b[0m`,
|
|
5
|
+
blue: (text) => `\x1b[34m${text}\x1b[0m`,
|
|
6
|
+
purple: (text) => `\x1b[35m${text}\x1b[0m`,
|
|
7
|
+
cyan: (text) => `\x1b[36m${text}\x1b[0m`
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
bold: `\x1b[1m${text}\x1b[0m`,
|
|
12
|
-
underline: `\x1b[4m${text}\x1b[0m`,
|
|
13
|
-
inverse: `\x1b[7m${text}\x1b[0m`
|
|
10
|
+
const variant = {
|
|
11
|
+
bold: (text) => `\x1b[1m${text}\x1b[0m`,
|
|
12
|
+
underline: (text) => `\x1b[4m${text}\x1b[0m`,
|
|
13
|
+
inverse: (text) => `\x1b[7m${text}\x1b[0m`
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
red: `\x1b[1m\x1b[31m${text}\x1b[0m`,
|
|
18
|
-
green: `\x1b[1m\x1b[32m${text}\x1b[0m`,
|
|
19
|
-
yellow: `\x1b[1m\x1b[33m${text}\x1b[0m`,
|
|
20
|
-
blue: `\x1b[1m\x1b[34m${text}\x1b[0m`,
|
|
21
|
-
purple: `\x1b[1m\x1b[35m${text}\x1b[0m`,
|
|
22
|
-
cyan: `\x1b[1m\x1b[36m${text}\x1b[0m`
|
|
16
|
+
const bold = {
|
|
17
|
+
red: (text) => `\x1b[1m\x1b[31m${text}\x1b[0m`,
|
|
18
|
+
green: (text) => `\x1b[1m\x1b[32m${text}\x1b[0m`,
|
|
19
|
+
yellow: (text) => `\x1b[1m\x1b[33m${text}\x1b[0m`,
|
|
20
|
+
blue: (text) => `\x1b[1m\x1b[34m${text}\x1b[0m`,
|
|
21
|
+
purple: (text) => `\x1b[1m\x1b[35m${text}\x1b[0m`,
|
|
22
|
+
cyan: (text) => `\x1b[1m\x1b[36m${text}\x1b[0m`
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
red: `\x1b[7m\x1b[31m${text}\x1b[0m`,
|
|
27
|
-
green: `\x1b[7m\x1b[32m${text}\x1b[0m`,
|
|
28
|
-
yellow: `\x1b[7m\x1b[33m${text}\x1b[0m`,
|
|
29
|
-
blue: `\x1b[7m\x1b[34m${text}\x1b[0m`,
|
|
30
|
-
purple: `\x1b[7m\x1b[35m${text}\x1b[0m`,
|
|
31
|
-
cyan: `\x1b[7m\x1b[36m${text}\x1b[0m`
|
|
25
|
+
const inverse = {
|
|
26
|
+
red: (text) => `\x1b[7m\x1b[31m${text}\x1b[0m`,
|
|
27
|
+
green: (text) => `\x1b[7m\x1b[32m${text}\x1b[0m`,
|
|
28
|
+
yellow: (text) => `\x1b[7m\x1b[33m${text}\x1b[0m`,
|
|
29
|
+
blue: (text) => `\x1b[7m\x1b[34m${text}\x1b[0m`,
|
|
30
|
+
purple: (text) => `\x1b[7m\x1b[35m${text}\x1b[0m`,
|
|
31
|
+
cyan: (text) => `\x1b[7m\x1b[36m${text}\x1b[0m`
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
red: `\x1b[4m\x1b[31m${text}\x1b[0m`,
|
|
36
|
-
green: `\x1b[4m\x1b[32m${text}\x1b[0m`,
|
|
37
|
-
yellow: `\x1b[4m\x1b[33m${text}\x1b[0m`,
|
|
38
|
-
blue: `\x1b[4m\x1b[34m${text}\x1b[0m`,
|
|
39
|
-
purple: `\x1b[4m\x1b[35m${text}\x1b[0m`,
|
|
40
|
-
cyan: `\x1b[4m\x1b[36m${text}\x1b[0m`
|
|
34
|
+
const underline = {
|
|
35
|
+
red: (text) => `\x1b[4m\x1b[31m${text}\x1b[0m`,
|
|
36
|
+
green: (text) => `\x1b[4m\x1b[32m${text}\x1b[0m`,
|
|
37
|
+
yellow: (text) => `\x1b[4m\x1b[33m${text}\x1b[0m`,
|
|
38
|
+
blue: (text) => `\x1b[4m\x1b[34m${text}\x1b[0m`,
|
|
39
|
+
purple: (text) => `\x1b[4m\x1b[35m${text}\x1b[0m`,
|
|
40
|
+
cyan: (text) => `\x1b[4m\x1b[36m${text}\x1b[0m`
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const ansi = {
|
|
44
|
+
color,
|
|
45
|
+
variant,
|
|
46
|
+
bold,
|
|
47
|
+
inverse,
|
|
48
|
+
underline
|
|
41
49
|
};
|
|
42
50
|
|
|
43
51
|
export const terminal = (type = 'info', msg) => {
|
|
@@ -46,6 +54,7 @@ export const terminal = (type = 'info', msg) => {
|
|
|
46
54
|
if (type === 'error') console.error(name, ansi.bold.red('[error]'), msg);
|
|
47
55
|
else if (type === 'warn') console.warn(name, ansi.bold.yellow('[warn]'), msg);
|
|
48
56
|
else if (type === 'success') console.warn(name, ansi.bold.green('[success]'), msg);
|
|
57
|
+
else if (type === 'none') console.log(msg);
|
|
49
58
|
else console.log(name, ansi.bold.blue('[info]'), msg);
|
|
50
59
|
};
|
|
51
60
|
|
package/bin/lapikit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { promises as fs } from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import {
|
|
4
|
+
import { ansi, terminal, envTypescript } from './helper.js';
|
|
5
5
|
import { preset } from './modules/preset.js';
|
|
6
6
|
import { adapterCSSConfig, adapterViteConfig } from './modules/adapter.js';
|
|
7
7
|
|
|
@@ -11,8 +11,8 @@ const typescriptEnabled = envTypescript();
|
|
|
11
11
|
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
12
12
|
terminal(
|
|
13
13
|
'info',
|
|
14
|
-
`usage: ${color.yellow('npx lapikit init {cssPath}')}\n\n ${variant.bold('options:')}\n
|
|
15
|
-
- {cssPath}: (${color.cyan('src/app.css')}) customize path on your origin css file.\n\n`
|
|
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.\n\n`
|
|
16
16
|
);
|
|
17
17
|
process.exit(0);
|
|
18
18
|
} else if (command === 'init') {
|
|
@@ -23,9 +23,9 @@ if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
|
23
23
|
console.log(' | |___| (_| | |_) | | <| | |_ ');
|
|
24
24
|
console.log(' |______\\__,_| .__/|_|_|\\_\\_|\\__|');
|
|
25
25
|
console.log(' | | ');
|
|
26
|
-
console.log(' |_| ');
|
|
26
|
+
console.log(' |_| \n');
|
|
27
27
|
|
|
28
|
-
terminal('
|
|
28
|
+
terminal('none', `${ansi.bold.blue('LAPIKIT')} - Component Library for Svelte\n\n`);
|
|
29
29
|
|
|
30
30
|
const configPath = path.resolve(process.cwd(), 'lapikit.config.js');
|
|
31
31
|
try {
|
|
@@ -44,11 +44,11 @@ if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
|
44
44
|
|
|
45
45
|
terminal(
|
|
46
46
|
'info',
|
|
47
|
-
`${bold.blue('Thank to use lapikit, discover all posibility with lapikit on https://localhost:3000/docs')}\n\n`
|
|
47
|
+
`${ansi.bold.blue('Thank to use lapikit, discover all posibility with lapikit on https://localhost:3000/docs')}\n\n`
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
console.log('Github: https://github.com/nycolaide/lapikit');
|
|
51
51
|
console.log('Support the developement: https://buymeacoffee.com/nycolaide');
|
|
52
52
|
} else {
|
|
53
|
-
terminal('error', `Command not recognized. Try 'npx lapikit
|
|
53
|
+
terminal('error', `Command not recognized. Try 'npx lapikit -h'`);
|
|
54
54
|
}
|
package/bin/modules/adapter.js
CHANGED
|
@@ -28,7 +28,7 @@ export async function adapterViteConfig(typescript) {
|
|
|
28
28
|
} catch (error) {
|
|
29
29
|
terminal(
|
|
30
30
|
'error',
|
|
31
|
-
`lapikit encountered a problem while editing vite.config.(js|ts)
|
|
31
|
+
`lapikit() encountered a problem while editing vite.config.(js|ts):\n ${error}.\n\n`
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -46,7 +46,7 @@ export async function adapterCSSConfig() {
|
|
|
46
46
|
} catch (error) {
|
|
47
47
|
terminal(
|
|
48
48
|
'error',
|
|
49
|
-
`lapikit encountered a problem while editing ${cssPath}:\n
|
|
49
|
+
`lapikit/css encountered a problem while editing ${cssPath}:\n ${error.message}.\n\n`
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../components/accordion/accordion.svelte.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../components/accordion/accordion.svelte.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
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("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
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("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
|
|
2
|
+
><title>close_fill</title><g id="close_fill" fill="none" fill-rule="evenodd"
|
|
3
|
+
><path
|
|
4
|
+
d="M24 0v24H0V0zM12.593 23.258l-.011.002-.071.035-.02.004-.014-.004-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01-.017.428.005.02.01.013.104.074.015.004.012-.004.104-.074.012-.016.004-.017-.017-.427c-.002-.01-.009-.017-.017-.018m.265-.113-.013.002-.185.093-.01.01-.003.011.018.43.005.012.008.007.201.093c.012.004.023 0 .029-.008l.004-.014-.034-.614c-.003-.012-.01-.02-.02-.022m-.715.002a.023.023 0 0 0-.027.006l-.006.014-.034.614c0 .012.007.02.017.024l.015-.002.201-.093.01-.008.004-.011.017-.43-.003-.012-.01-.01z"
|
|
5
|
+
/><path
|
|
6
|
+
fill="currentColor"
|
|
7
|
+
d="m12 14.122 5.303 5.303a1.5 1.5 0 0 0 2.122-2.122L14.12 12l5.304-5.303a1.5 1.5 0 1 0-2.122-2.121L12 9.879 6.697 4.576a1.5 1.5 0 1 0-2.122 2.12L9.88 12l-5.304 5.304a1.5 1.5 0 1 0 2.122 2.12z"
|
|
8
|
+
/></g
|
|
9
|
+
></svg
|
|
10
|
+
>
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
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("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
|
|
2
|
+
><defs
|
|
3
|
+
><linearGradient id="a" x1="50%" x2="50%" y1="5.271%" y2="91.793%"
|
|
4
|
+
><stop offset="0%" stop-color="currentColor" /><stop
|
|
5
|
+
offset="100%"
|
|
6
|
+
stop-color="currentColor"
|
|
7
|
+
stop-opacity=".55"
|
|
8
|
+
/></linearGradient
|
|
9
|
+
><linearGradient id="b" x1="50%" x2="50%" y1="15.24%" y2="87.15%"
|
|
10
|
+
><stop offset="0%" stop-color="currentColor" stop-opacity="0" /><stop
|
|
11
|
+
offset="100%"
|
|
12
|
+
stop-color="currentColor"
|
|
13
|
+
stop-opacity=".55"
|
|
14
|
+
/></linearGradient
|
|
15
|
+
></defs
|
|
16
|
+
><g fill="none"
|
|
17
|
+
><path
|
|
18
|
+
d="M24 0v24H0V0zM12.593 23.258l-.011.002-.071.035-.02.004-.014-.004-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01-.017.428.005.02.01.013.104.074.015.004.012-.004.104-.074.012-.016.004-.017-.017-.427c-.002-.01-.009-.017-.017-.018m.265-.113-.013.002-.185.093-.01.01-.003.011.018.43.005.012.008.007.201.093c.012.004.023 0 .029-.008l.004-.014-.034-.614c-.003-.012-.01-.02-.02-.022m-.715.002a.023.023 0 0 0-.027.006l-.006.014-.034.614c0 .012.007.02.017.024l.015-.002.201-.093.01-.008.004-.011.017-.43-.003-.012-.01-.01z"
|
|
19
|
+
/><path
|
|
20
|
+
fill="url(#a)"
|
|
21
|
+
d="M8.749.021a1.5 1.5 0 0 1 .497 2.958A7.502 7.502 0 0 0 3 10.375a7.5 7.5 0 0 0 7.5 7.5v3c-5.799 0-10.5-4.7-10.5-10.5C0 5.23 3.726.865 8.749.021"
|
|
22
|
+
transform="translate(1.5 1.625)"
|
|
23
|
+
/><path
|
|
24
|
+
fill="url(#b)"
|
|
25
|
+
d="M15.392 2.673a1.5 1.5 0 0 1 2.119-.115A10.475 10.475 0 0 1 21 10.375c0 5.8-4.701 10.5-10.5 10.5v-3a7.5 7.5 0 0 0 5.007-13.084 1.5 1.5 0 0 1-.115-2.118"
|
|
26
|
+
transform="translate(1.5 1.625)"
|
|
27
|
+
/></g
|
|
28
|
+
></svg
|
|
29
|
+
>
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
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("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
.kit-accordion {
|
|
2
|
+
--accordion-color: var(--on, var(--kit-on-neutral));
|
|
3
|
+
--accordion-background: var(--base, var(--kit-neutral));
|
|
4
|
+
--accordion-radius: var(--shape, var(--kit-radius-md));
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
list-style-type: none;
|
|
10
|
+
padding: 0;
|
|
11
|
+
width: 100%;
|
|
12
|
+
position: relative;
|
|
13
|
+
z-index: 1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.kit-accordion.kit-accordion--spacer .kit-accordion-item:first-child.kit-accordion-item--active {
|
|
17
|
+
margin-bottom: 1rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.kit-accordion.kit-accordion--spacer
|
|
21
|
+
.kit-accordion-item:not(:first-child):not(:last-child).kit-accordion-item--active {
|
|
22
|
+
margin-bottom: 1rem;
|
|
23
|
+
margin-top: 1rem;
|
|
24
|
+
}
|
|
25
|
+
.kit-accordion.kit-accordion--spacer .kit-accordion-item:last-child.kit-accordion-item--active {
|
|
26
|
+
margin-top: 1rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.kit-accordion.kit-accordion--hide-icon
|
|
30
|
+
.kit-accordion-item
|
|
31
|
+
.kit-accordion-item--title
|
|
32
|
+
> .kit-accordion-item--icon {
|
|
33
|
+
display: none !important;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.kit-accordion.kit-accordion--hide-icon .kit-accordion-item .kit-accordion-item--title {
|
|
37
|
+
cursor: default;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
user-select: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* item */
|
|
43
|
+
.kit-accordion .kit-accordion-item {
|
|
44
|
+
flex: 1 0 100%;
|
|
45
|
+
max-width: 100%;
|
|
46
|
+
position: relative;
|
|
47
|
+
transition: 0.3s all cubic-bezier(0.4, 0, 0.2, 1);
|
|
48
|
+
transition-property: margin-top, border-radius, border, max-width;
|
|
49
|
+
border-radius: var(--shape, var(--accordion-radius, var(--kit-radius-md)));
|
|
50
|
+
color: var(--on, var(--accordion-color, var(--kit-on-neutral)));
|
|
51
|
+
background-color: var(--base, var(--accordion-background, var(--kit-neutral)));
|
|
52
|
+
transition:
|
|
53
|
+
color 0.5s,
|
|
54
|
+
background-color 0.5s;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.kit-accordion .kit-accordion-item > button,
|
|
58
|
+
.kit-accordion .kit-accordion-item > [type='button'] {
|
|
59
|
+
font: inherit;
|
|
60
|
+
overflow: visible;
|
|
61
|
+
background-color: transparent;
|
|
62
|
+
border-style: none;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
color: inherit;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.kit-accordion .kit-accordion-item .kit-accordion-item--title {
|
|
68
|
+
align-items: center;
|
|
69
|
+
text-align: start;
|
|
70
|
+
border-radius: inherit;
|
|
71
|
+
display: flex;
|
|
72
|
+
font-size: 0.9375rem;
|
|
73
|
+
min-height: 3rem;
|
|
74
|
+
outline: none;
|
|
75
|
+
padding: 1rem 1.5rem;
|
|
76
|
+
position: relative;
|
|
77
|
+
transition: 0.3s min-height margin-bottom margin-top border-radius cubic-bezier(0.4, 0, 0.2, 1);
|
|
78
|
+
width: 100%;
|
|
79
|
+
justify-content: space-between;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.kit-accordion .kit-accordion-item .kit-accordion-item--text {
|
|
83
|
+
display: flex;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.kit-accordion .kit-accordion-item .kit-accordion-item--text .kit-accordion-item--text-wrapper {
|
|
87
|
+
padding: 0.5rem 1.5rem 1rem;
|
|
88
|
+
flex: 1 1 auto;
|
|
89
|
+
max-width: 100%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.kit-accordion .kit-accordion-item .kit-accordion-item--icon {
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
margin-bottom: -0.25rem;
|
|
95
|
+
margin-top: -0.25rem;
|
|
96
|
+
-webkit-user-select: none;
|
|
97
|
+
user-select: none;
|
|
98
|
+
margin-inline-start: auto;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* disabled */
|
|
102
|
+
.kit-accordion .kit-accordion-item .kit-accordion-item--title.kit-accordion-item--disabled,
|
|
103
|
+
.kit-accordion .kit-accordion-item .kit-accordion-item--title[disabled],
|
|
104
|
+
.kit-accordion .kit-accordion-item .kit-accordion-item--title:disabled {
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
user-select: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.kit-accordion .kit-accordion-item .kit-accordion-item--title.kit-accordion-item--disabled > *,
|
|
110
|
+
.kit-accordion .kit-accordion-item .kit-accordion-item--title[disabled] > *,
|
|
111
|
+
.kit-accordion .kit-accordion-item .kit-accordion-item--title:disabled > * {
|
|
112
|
+
opacity: 0.6;
|
|
113
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getAssets } from '../../internal/assets.svelte.js';
|
|
3
|
+
import type { AccordionProps } from './types.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(),
|
|
7
|
+
children,
|
|
8
|
+
is = 'div',
|
|
9
|
+
dark,
|
|
10
|
+
light,
|
|
11
|
+
color,
|
|
12
|
+
background,
|
|
13
|
+
spacer,
|
|
14
|
+
hideIcon,
|
|
15
|
+
...rest
|
|
16
|
+
}: AccordionProps = $props();
|
|
17
|
+
|
|
18
|
+
const assets = getAssets();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<svelte:element
|
|
22
|
+
this={is}
|
|
23
|
+
bind:this={ref}
|
|
24
|
+
{...rest}
|
|
25
|
+
class={[
|
|
26
|
+
'kit-accordion',
|
|
27
|
+
spacer && 'kit-accordion--spacer',
|
|
28
|
+
hideIcon && 'kit-accordion--hide-icon',
|
|
29
|
+
light && 'light',
|
|
30
|
+
dark && 'dark',
|
|
31
|
+
rest.class
|
|
32
|
+
]}
|
|
33
|
+
style:--base={assets.color(background)}
|
|
34
|
+
style:--on={assets.color(color)}
|
|
35
|
+
>
|
|
36
|
+
{@render children?.()}
|
|
37
|
+
</svelte:element>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function useAccordion({ multiple = false, readOnly = false } = {}) {
|
|
2
|
+
// state
|
|
3
|
+
let openIndex = $state([10]);
|
|
4
|
+
return {
|
|
5
|
+
get values() {
|
|
6
|
+
return openIndex;
|
|
7
|
+
},
|
|
8
|
+
toggle(id) {
|
|
9
|
+
if (!readOnly) {
|
|
10
|
+
if (multiple) {
|
|
11
|
+
if (openIndex.includes(id)) {
|
|
12
|
+
openIndex = openIndex.filter((i) => i !== id);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
openIndex = [...openIndex, id];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
openIndex = openIndex.includes(id) ? [] : [id];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getAssets } from '../../../internal/assets.svelte.js';
|
|
3
|
+
import type { AccordionItemProps, ModelAccordionItemProps } from '../types.js';
|
|
4
|
+
|
|
5
|
+
// components
|
|
6
|
+
import Icon from '../../icon/icon.svelte';
|
|
7
|
+
|
|
8
|
+
// assets
|
|
9
|
+
import ArrowUp from '../../../assets/icons/arrow-up.svelte';
|
|
10
|
+
import ArrowDown from '../../../assets/icons/arrow-down.svelte';
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
activator,
|
|
14
|
+
children,
|
|
15
|
+
indicator,
|
|
16
|
+
ref = $bindable(),
|
|
17
|
+
text,
|
|
18
|
+
is = 'div',
|
|
19
|
+
dark,
|
|
20
|
+
light,
|
|
21
|
+
rounded,
|
|
22
|
+
color,
|
|
23
|
+
background,
|
|
24
|
+
index,
|
|
25
|
+
open,
|
|
26
|
+
toggle,
|
|
27
|
+
disabled,
|
|
28
|
+
readOnly,
|
|
29
|
+
...rest
|
|
30
|
+
}: AccordionItemProps = $props();
|
|
31
|
+
|
|
32
|
+
const assets = getAssets();
|
|
33
|
+
|
|
34
|
+
let model: ModelAccordionItemProps = {
|
|
35
|
+
get open() {
|
|
36
|
+
return open !== undefined ? open : false;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<svelte:element
|
|
42
|
+
this={is}
|
|
43
|
+
bind:this={ref}
|
|
44
|
+
{...rest}
|
|
45
|
+
class={[
|
|
46
|
+
'kit-accordion-item',
|
|
47
|
+
light && 'light',
|
|
48
|
+
dark && 'dark',
|
|
49
|
+
open && 'kit-accordion-item--active',
|
|
50
|
+
rest.class
|
|
51
|
+
]}
|
|
52
|
+
style:--base={assets.color(background)}
|
|
53
|
+
style:--on={assets.color(color)}
|
|
54
|
+
style:--shape={assets.shape(rounded)}
|
|
55
|
+
>
|
|
56
|
+
<button
|
|
57
|
+
class={[
|
|
58
|
+
'kit-accordion-item--title',
|
|
59
|
+
disabled && 'kit-accordion-item--disabled',
|
|
60
|
+
dark && 'dark',
|
|
61
|
+
open && 'kit-accordion-item--active',
|
|
62
|
+
rest.class
|
|
63
|
+
]}
|
|
64
|
+
onclick={() => toggle && !readOnly && !disabled && toggle(index)}
|
|
65
|
+
aria-expanded={open}
|
|
66
|
+
type="button"
|
|
67
|
+
{disabled}
|
|
68
|
+
>
|
|
69
|
+
{#if activator}
|
|
70
|
+
{@render activator?.()}
|
|
71
|
+
{:else}
|
|
72
|
+
{text}
|
|
73
|
+
{/if}
|
|
74
|
+
|
|
75
|
+
<span class="kit-accordion-item--icon">
|
|
76
|
+
{#if indicator}
|
|
77
|
+
{@render indicator?.(model)}
|
|
78
|
+
{:else if open}
|
|
79
|
+
<Icon>
|
|
80
|
+
<ArrowUp />
|
|
81
|
+
</Icon>
|
|
82
|
+
{:else}
|
|
83
|
+
<Icon>
|
|
84
|
+
<ArrowDown />
|
|
85
|
+
</Icon>
|
|
86
|
+
{/if}
|
|
87
|
+
</span>
|
|
88
|
+
</button>
|
|
89
|
+
<div class="kit-accordion-item--text" style:display={!open ? 'none' : ''}>
|
|
90
|
+
<div class="kit-accordion-item--text-wrapper">
|
|
91
|
+
{@render children?.()}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</svelte:element>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Component } from '../../internal/types.js';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
export interface AccordionProps extends Component {
|
|
4
|
+
ref?: HTMLElement | null;
|
|
5
|
+
is?: 'div';
|
|
6
|
+
text?: string;
|
|
7
|
+
dark?: boolean;
|
|
8
|
+
light?: boolean;
|
|
9
|
+
color?: string;
|
|
10
|
+
background?: string;
|
|
11
|
+
spacer?: boolean;
|
|
12
|
+
hideIcon?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface AccordionItemProps extends Component {
|
|
15
|
+
index: number | string;
|
|
16
|
+
indicator?: Snippet<[ModelAccordionItemProps]>;
|
|
17
|
+
activator?: Snippet;
|
|
18
|
+
ref?: HTMLElement | null;
|
|
19
|
+
is?: 'div';
|
|
20
|
+
text?: string;
|
|
21
|
+
dark?: boolean;
|
|
22
|
+
light?: boolean;
|
|
23
|
+
rounded?: string;
|
|
24
|
+
color?: string;
|
|
25
|
+
background?: string;
|
|
26
|
+
readOnly?: boolean;
|
|
27
|
+
open?: boolean;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
toggle?: (index: number | string) => void;
|
|
30
|
+
}
|
|
31
|
+
export type ModelAccordionItemProps = {
|
|
32
|
+
open: boolean;
|
|
33
|
+
};
|