lapikit 0.0.0-insiders.cee8a41 → 0.0.0-insiders.cfec658
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/configuration.js +298 -0
- package/bin/helper.js +23 -0
- package/bin/index.js +41 -0
- package/bin/lapikit.js +37 -5
- package/bin/legacy.js +34 -0
- package/bin/modules/adapter.js +3 -3
- package/bin/modules/plugin.js +223 -0
- package/bin/presets.js +25 -0
- package/bin/prompts.js +100 -0
- package/dist/actions/index.d.ts +2 -0
- package/dist/actions/index.js +2 -0
- package/dist/assets/icons/arrow-down.svelte +12 -0
- package/dist/assets/icons/arrow-down.svelte.d.ts +18 -0
- package/dist/assets/icons/arrow-up.svelte +12 -0
- package/dist/assets/icons/arrow-up.svelte.d.ts +18 -0
- package/dist/assets/icons/close-fill.svelte +12 -0
- package/dist/assets/icons/close-fill.svelte.d.ts +18 -0
- 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 +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 +137 -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 +1 -1
- package/dist/components/app/app.svelte +33 -3
- package/dist/components/appbar/appbar.css +48 -0
- package/dist/components/appbar/appbar.svelte +40 -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 +47 -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 +165 -194
- package/dist/components/button/button.svelte +39 -31
- package/dist/components/button/button.svelte.d.ts +2 -2
- package/dist/components/button/types.d.ts +7 -5
- package/dist/components/card/card.css +115 -0
- package/dist/components/card/card.svelte +63 -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 +231 -0
- package/dist/components/chip/chip.svelte +131 -0
- package/dist/components/chip/chip.svelte.d.ts +4 -0
- package/dist/components/chip/types.d.ts +32 -0
- package/dist/components/chip/types.js +1 -0
- package/dist/components/dialog/dialog.css +5 -3
- package/dist/components/dropdown/dropdown.css +4 -4
- package/dist/components/icon/icon.css +14 -11
- package/dist/components/index.d.ts +12 -1
- package/dist/components/index.js +12 -1
- package/dist/components/list/list.css +145 -117
- 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 +18 -13
- 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/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/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 +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 +4 -4
- package/dist/index.d.ts +10 -1
- package/dist/index.js +13 -3
- package/dist/internal/assets.svelte.js +2 -0
- package/dist/internal/deepMerge.d.ts +44 -0
- package/dist/internal/deepMerge.js +80 -0
- package/dist/internal/mediaQueries.d.ts +20 -0
- package/dist/internal/mediaQueries.js +88 -0
- package/dist/internal/ripple.d.ts +12 -0
- package/dist/internal/ripple.js +93 -0
- package/dist/internal/unit.d.ts +1 -0
- package/dist/internal/unit.js +11 -0
- package/dist/preset.js +2 -2
- package/dist/stores/breakpoints.d.ts +6 -0
- package/dist/stores/breakpoints.js +23 -0
- package/dist/stores/index.d.ts +7 -3
- package/dist/stores/index.js +12 -4
- package/dist/stores/viewports.d.ts +2 -0
- package/dist/stores/viewports.js +5 -0
- package/dist/style/animation.css +42 -0
- package/dist/style/normalize.css +2 -0
- package/dist/style/parser/color.js +2 -2
- package/dist/style/parser/device.js +31 -19
- package/package.json +10 -3
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { get, derived } from 'svelte/store';
|
|
2
|
+
import { breakpoints } from '../stores/breakpoints.js';
|
|
3
|
+
import { viewportWidth } from '../stores/viewports.js';
|
|
4
|
+
// Converts rem/em/px to number of pixels
|
|
5
|
+
function toPx(value) {
|
|
6
|
+
if (typeof value === 'number')
|
|
7
|
+
return value;
|
|
8
|
+
if (typeof value === 'string') {
|
|
9
|
+
if (value.endsWith('rem')) {
|
|
10
|
+
return parseFloat(value) * 16;
|
|
11
|
+
}
|
|
12
|
+
if (value.endsWith('em')) {
|
|
13
|
+
return parseFloat(value) * 16;
|
|
14
|
+
}
|
|
15
|
+
if (value.endsWith('px')) {
|
|
16
|
+
return parseFloat(value);
|
|
17
|
+
}
|
|
18
|
+
return parseFloat(value);
|
|
19
|
+
}
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Non-reactive media queries function
|
|
24
|
+
* Use this in JavaScript code when you need a one-time check
|
|
25
|
+
* @param {...Array<["min"|"max", string]>} args - ex: [ ["min", "xs"], ["max", "lg"] ]
|
|
26
|
+
* @returns {boolean}
|
|
27
|
+
*/
|
|
28
|
+
export function mediaQueries(...args) {
|
|
29
|
+
const bp = get(breakpoints);
|
|
30
|
+
const width = get(viewportWidth) || (typeof window !== 'undefined' ? window.innerWidth : 0);
|
|
31
|
+
// Parse arguments
|
|
32
|
+
let queries = [];
|
|
33
|
+
if (Array.isArray(args[0]) && typeof args[0][0] === 'string') {
|
|
34
|
+
queries = args;
|
|
35
|
+
}
|
|
36
|
+
else if (typeof args[0] === 'string') {
|
|
37
|
+
queries = [args];
|
|
38
|
+
}
|
|
39
|
+
let result = true;
|
|
40
|
+
for (const [type, key] of queries) {
|
|
41
|
+
const value = bp[key];
|
|
42
|
+
const px = toPx(value);
|
|
43
|
+
if (type === 'min') {
|
|
44
|
+
result = result && width >= px;
|
|
45
|
+
}
|
|
46
|
+
else if (type === 'max') {
|
|
47
|
+
result = result && width <= px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Reactive media queries that returns a store
|
|
54
|
+
* Use this in Svelte templates for automatic reactivity
|
|
55
|
+
* @param {...Array<["min"|"max", string]>} args - ex: [ ["min", "xs"], ["max", "lg"] ]
|
|
56
|
+
* @returns {import('svelte/store').Readable<boolean>}
|
|
57
|
+
*/
|
|
58
|
+
export function mediaQueriesReactive(...args) {
|
|
59
|
+
return derived([breakpoints, viewportWidth], ([$breakpoints, $viewportWidth]) => {
|
|
60
|
+
const width = $viewportWidth || (typeof window !== 'undefined' ? window.innerWidth : 0);
|
|
61
|
+
// Parse arguments same way as non-reactive version
|
|
62
|
+
let queries = [];
|
|
63
|
+
if (Array.isArray(args[0]) && typeof args[0][0] === 'string') {
|
|
64
|
+
queries = args;
|
|
65
|
+
}
|
|
66
|
+
else if (typeof args[0] === 'string') {
|
|
67
|
+
queries = [args];
|
|
68
|
+
}
|
|
69
|
+
let result = true;
|
|
70
|
+
for (const [type, key] of queries) {
|
|
71
|
+
const value = $breakpoints[key];
|
|
72
|
+
const px = toPx(value);
|
|
73
|
+
if (type === 'min') {
|
|
74
|
+
result = result && width >= px;
|
|
75
|
+
}
|
|
76
|
+
else if (type === 'max') {
|
|
77
|
+
result = result && width <= px;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Convenient function for direct use in Svelte templates
|
|
85
|
+
* Returns a readable store that updates automatically
|
|
86
|
+
* Usage: $mediaQuery(['min', 'md']) in template
|
|
87
|
+
*/
|
|
88
|
+
export const mediaQuery = mediaQueriesReactive;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface RippleOptions {
|
|
2
|
+
component?: string;
|
|
3
|
+
center?: boolean;
|
|
4
|
+
color?: string;
|
|
5
|
+
duration?: number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function ripple(el: HTMLElement, options?: RippleOptions): {
|
|
9
|
+
destroy(): void;
|
|
10
|
+
update(newOptions: RippleOptions): void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const triggerEvents = ['pointerdown', 'touchstart', 'keydown'];
|
|
2
|
+
const cancelEvents = ['mouseleave', 'dragleave', 'touchmove', 'touchcancel', 'pointerup', 'keyup'];
|
|
3
|
+
export function ripple(el, options = {}) {
|
|
4
|
+
const rippleContainer = document.createElement('div');
|
|
5
|
+
addClasses();
|
|
6
|
+
setOptions(options);
|
|
7
|
+
function addClasses(center) {
|
|
8
|
+
const shouldBeCentered = center || options.center;
|
|
9
|
+
if (!rippleContainer.classList.contains('kit-ripple--effect')) {
|
|
10
|
+
rippleContainer.classList.add('kit-ripple--effect');
|
|
11
|
+
}
|
|
12
|
+
if (!shouldBeCentered && rippleContainer.classList.contains('kit-ripple--center')) {
|
|
13
|
+
rippleContainer.classList.remove('kit-ripple--center');
|
|
14
|
+
}
|
|
15
|
+
if (shouldBeCentered) {
|
|
16
|
+
rippleContainer.classList.add('kit-ripple--center');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function setOptions(options) {
|
|
20
|
+
if (options.disabled || el.hasAttribute('aria-disabled')) {
|
|
21
|
+
rippleContainer.remove();
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
el.appendChild(rippleContainer);
|
|
25
|
+
}
|
|
26
|
+
if (options.duration && options.duration < 0) {
|
|
27
|
+
options.duration = undefined;
|
|
28
|
+
}
|
|
29
|
+
if (options.component) {
|
|
30
|
+
rippleContainer.style.setProperty('--ripple-radius', `var(--${options.component}-radius)`);
|
|
31
|
+
}
|
|
32
|
+
if (options.color) {
|
|
33
|
+
rippleContainer.style.setProperty('--ripple-color', options.color);
|
|
34
|
+
}
|
|
35
|
+
if (options.duration) {
|
|
36
|
+
rippleContainer.style.setProperty('--ripple-duration', `${options.duration}ms`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function createRipple(e, center) {
|
|
40
|
+
if (options.disabled || el.hasAttribute('aria-disabled')) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (e instanceof KeyboardEvent) {
|
|
44
|
+
if (!['Enter', 'Space'].includes(e.code) || e.repeat) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
const click = new PointerEvent('pointerdown');
|
|
49
|
+
createRipple(click, true);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
addClasses(center);
|
|
53
|
+
const rect = el.getBoundingClientRect();
|
|
54
|
+
const clientX = window.TouchEvent && e instanceof TouchEvent
|
|
55
|
+
? e.touches[0].clientX
|
|
56
|
+
: e.clientX;
|
|
57
|
+
const clientY = window.TouchEvent && e instanceof TouchEvent
|
|
58
|
+
? e.touches[0].clientY
|
|
59
|
+
: e.clientY;
|
|
60
|
+
const x = clientX - rect.left > el.offsetWidth / 2 ? 0 : el.offsetWidth;
|
|
61
|
+
const y = clientY - rect.top > el.offsetHeight / 2 ? 0 : el.offsetHeight;
|
|
62
|
+
const radius = Math.hypot(x - (clientX - rect.left), y - (clientY - rect.top));
|
|
63
|
+
const ripple = document.createElement('div');
|
|
64
|
+
ripple.classList.add('kit-ripple');
|
|
65
|
+
ripple.style.left = `${clientX - rect.left - radius}px`;
|
|
66
|
+
ripple.style.top = `${clientY - rect.top - radius}px`;
|
|
67
|
+
ripple.style.width = ripple.style.height = `${radius * 2}px`;
|
|
68
|
+
rippleContainer.appendChild(ripple);
|
|
69
|
+
function removeRipple() {
|
|
70
|
+
if (ripple === null) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
ripple.style.opacity = '0';
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
ripple.remove();
|
|
76
|
+
}, options.duration || 1000);
|
|
77
|
+
cancelEvents.forEach((event) => el.removeEventListener(event, removeRipple));
|
|
78
|
+
}
|
|
79
|
+
cancelEvents.forEach((event) => el.addEventListener(event, removeRipple, { passive: true }));
|
|
80
|
+
}
|
|
81
|
+
triggerEvents.forEach((event) => el.addEventListener(event, createRipple, { passive: event === 'touchstart' }));
|
|
82
|
+
return {
|
|
83
|
+
destroy() {
|
|
84
|
+
triggerEvents.forEach((event) => {
|
|
85
|
+
el.removeEventListener(event, createRipple);
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
update(newOptions) {
|
|
89
|
+
options = newOptions;
|
|
90
|
+
setOptions(newOptions);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setUnit: (value: string | number) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const setUnit = (value) => {
|
|
2
|
+
if (typeof value === 'number')
|
|
3
|
+
return `${value}px`;
|
|
4
|
+
if (typeof value === 'string') {
|
|
5
|
+
const cleaned = value.trim();
|
|
6
|
+
const isOnlyNumericLike = /^[\d.,]+$/.test(cleaned);
|
|
7
|
+
if (isOnlyNumericLike)
|
|
8
|
+
return `${value}px`;
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
};
|
package/dist/preset.js
CHANGED
|
@@ -4,7 +4,7 @@ export const config = {
|
|
|
4
4
|
minify: false // true | false
|
|
5
5
|
},
|
|
6
6
|
theme: {
|
|
7
|
-
colorScheme: '
|
|
7
|
+
colorScheme: 'system', // 'light' | 'dark' | 'system'
|
|
8
8
|
colors: {
|
|
9
9
|
primary: { light: 'oklch(45% 0.24 277.023)', dark: 'oklch(45% 0.24 277.023)' },
|
|
10
10
|
'on-primary': { light: 'oklch(14% 0.005 285.823)', dark: 'oklch(14% 0.005 285.823)' },
|
|
@@ -35,7 +35,7 @@ export const config = {
|
|
|
35
35
|
breakpoints: {
|
|
36
36
|
mobileBreakpoint: 'sm',
|
|
37
37
|
tabletBreakpoint: 'md',
|
|
38
|
-
laptopBreakpoint: '
|
|
38
|
+
laptopBreakpoint: 'lg',
|
|
39
39
|
thresholds: {
|
|
40
40
|
_default: 0, // 0px
|
|
41
41
|
xs: '28rem', //448px
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// store breakpoints and thresholds
|
|
2
|
+
import { writable } from 'svelte/store';
|
|
3
|
+
// presets
|
|
4
|
+
const ref = {
|
|
5
|
+
base: 0, // 0px
|
|
6
|
+
xs: '28rem', //448px
|
|
7
|
+
sm: '40rem', //640px
|
|
8
|
+
md: '48rem', //768px
|
|
9
|
+
lg: '64rem', //1024px
|
|
10
|
+
xl: '80rem', //1280px
|
|
11
|
+
'2xl': '96rem', //1536px
|
|
12
|
+
'3xl': '112rem' //1792px
|
|
13
|
+
};
|
|
14
|
+
export const breakpoints = writable(ref);
|
|
15
|
+
// export function setBreakpoints(newBreakpoints: Breakpoints) {
|
|
16
|
+
// breakpoints.set(newBreakpoints);
|
|
17
|
+
// }
|
|
18
|
+
// export function updateBreakpoint(key: string, value: number) {
|
|
19
|
+
// breakpoints.update((bp) => ({
|
|
20
|
+
// ...bp,
|
|
21
|
+
// [key]: value
|
|
22
|
+
// }));
|
|
23
|
+
// }
|
package/dist/stores/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { type Writable } from 'svelte/store';
|
|
2
|
-
export declare const colorScheme: Writable<'
|
|
2
|
+
export declare const colorScheme: Writable<'system' | 'dark' | 'light'>;
|
|
3
|
+
export declare const colorSchemeSystem: Writable<'dark' | 'light'>;
|
|
3
4
|
export declare const modalOpen: Writable<boolean | 'persistent'>;
|
|
4
5
|
export declare const modalStack: Writable<string[]>;
|
|
5
|
-
export declare function updateThemeStore(update: '
|
|
6
|
-
export declare function setColorScheme(scheme: '
|
|
6
|
+
export declare function updateThemeStore(update: 'system' | 'dark' | 'light'): void;
|
|
7
|
+
export declare function setColorScheme(scheme: 'system' | 'dark' | 'light'): void;
|
|
7
8
|
export declare function setOpenModal(state: boolean | 'persistent'): void;
|
|
8
9
|
export declare const pushModal: (id: string) => void;
|
|
9
10
|
export declare const popModal: (id: string) => void;
|
|
11
|
+
export * from './breakpoints.js';
|
|
12
|
+
export * from './viewports.js';
|
|
13
|
+
export { mediaQueries, mediaQueriesReactive, mediaQuery } from '../internal/mediaQueries.js';
|
package/dist/stores/index.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { disabledScroll } from '../internal/scroll.js';
|
|
1
2
|
import { writable } from 'svelte/store';
|
|
2
3
|
// states
|
|
3
|
-
const colorScheme_default = '
|
|
4
|
+
const colorScheme_default = 'system';
|
|
4
5
|
const modalOpen_default = false;
|
|
5
6
|
const isBrowser = typeof window !== 'undefined';
|
|
6
7
|
export const colorScheme = writable(colorScheme_default);
|
|
8
|
+
export const colorSchemeSystem = writable('light');
|
|
7
9
|
export const modalOpen = writable(modalOpen_default);
|
|
8
10
|
export const modalStack = writable([]);
|
|
9
11
|
export function updateThemeStore(update) {
|
|
10
12
|
colorScheme.update(() => {
|
|
11
13
|
if (isBrowser) {
|
|
12
14
|
const ref = document.documentElement.classList;
|
|
13
|
-
if (update === '
|
|
15
|
+
if (update === 'system')
|
|
14
16
|
ref.remove('light', 'dark');
|
|
15
17
|
else {
|
|
16
18
|
ref.remove(update === 'dark' ? 'light' : 'dark');
|
|
@@ -29,14 +31,20 @@ export function setOpenModal(state) {
|
|
|
29
31
|
}
|
|
30
32
|
export const pushModal = (id) => {
|
|
31
33
|
modalStack.update((stack) => {
|
|
34
|
+
let values = stack;
|
|
32
35
|
if (!stack.includes(id))
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
values = [...stack, id];
|
|
37
|
+
disabledScroll(values.length !== 0 ? true : false);
|
|
38
|
+
return values;
|
|
35
39
|
});
|
|
36
40
|
};
|
|
37
41
|
export const popModal = (id) => {
|
|
38
42
|
modalStack.update((stack) => {
|
|
39
43
|
const newStack = stack.filter((m) => m !== id);
|
|
44
|
+
disabledScroll(newStack.length !== 0 ? true : false);
|
|
40
45
|
return newStack.length === 0 ? [] : newStack;
|
|
41
46
|
});
|
|
42
47
|
};
|
|
48
|
+
export * from './breakpoints.js';
|
|
49
|
+
export * from './viewports.js';
|
|
50
|
+
export { mediaQueries, mediaQueriesReactive, mediaQuery } from '../internal/mediaQueries.js';
|
package/dist/style/animation.css
CHANGED
|
@@ -18,3 +18,45 @@
|
|
|
18
18
|
transform: rotate(380deg);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
.kit-ripple {
|
|
23
|
+
background-color: currentColor;
|
|
24
|
+
opacity: 0.1;
|
|
25
|
+
position: absolute;
|
|
26
|
+
border-radius: 50%;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
-webkit-transition: 0.6s;
|
|
29
|
+
transition: 0.6s;
|
|
30
|
+
-webkit-animation: lapikit-ripple var(--ripple-duration, 0.4s) cubic-bezier(0.4, 0, 0.2, 1);
|
|
31
|
+
animation: lapikit-ripple var(--ripple-duration, 0.4s) cubic-bezier(0.4, 0, 0.2, 1);
|
|
32
|
+
border-radius: var(--ripple-radius);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.kit-ripple--center {
|
|
36
|
+
top: 50% !important;
|
|
37
|
+
left: 50% !important;
|
|
38
|
+
translate: -50% -50% !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.kit-ripple--effect {
|
|
42
|
+
position: absolute;
|
|
43
|
+
left: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
top: 0;
|
|
46
|
+
bottom: 0;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
background: none;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
z-index: 999;
|
|
51
|
+
border-radius: var(--ripple-radius);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@keyframes lapikit-ripple {
|
|
55
|
+
from {
|
|
56
|
+
scale: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
to {
|
|
60
|
+
scale: 1;
|
|
61
|
+
}
|
|
62
|
+
}
|
package/dist/style/normalize.css
CHANGED
|
@@ -38,7 +38,7 @@ export const colors = (config) => {
|
|
|
38
38
|
}
|
|
39
39
|
cssVariables += `}\n`;
|
|
40
40
|
cssVariables += `.${inversed} {\n`;
|
|
41
|
-
cssVariables += `color-scheme: ${
|
|
41
|
+
cssVariables += `color-scheme: ${inversed};\n`;
|
|
42
42
|
for (const [colorName, colorValue] of Object.entries(schemes[inversed])) {
|
|
43
43
|
cssVariables += `--kit-${colorName}: ${colorValue};\n`;
|
|
44
44
|
}
|
|
@@ -56,7 +56,7 @@ export const colors = (config) => {
|
|
|
56
56
|
}
|
|
57
57
|
cssVariables += `}\n`;
|
|
58
58
|
cssVariables += `.${inversed} {\n`;
|
|
59
|
-
cssVariables += `color-scheme: ${
|
|
59
|
+
cssVariables += `color-scheme: ${inversed};\n`;
|
|
60
60
|
for (const [colorName, colorValue] of Object.entries(schemes[inversed])) {
|
|
61
61
|
cssVariables += `--kit-${colorName}: ${colorValue};\n`;
|
|
62
62
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setUnit } from '../../internal/unit.js';
|
|
1
2
|
export const devices = (config) => {
|
|
2
3
|
let css = ``;
|
|
3
4
|
const list = {
|
|
@@ -5,24 +6,35 @@ export const devices = (config) => {
|
|
|
5
6
|
tablet: config.breakpoints.tabletBreakpoint,
|
|
6
7
|
laptop: config.breakpoints.laptopBreakpoint
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
9
|
+
css += `@media screen and (max-width: ${setUnit(config.breakpoints.thresholds[list.mobile])}) {\n`;
|
|
10
|
+
css += `.hidden-mobile {\n`;
|
|
11
|
+
css += `display: none !important;\n`;
|
|
12
|
+
css += `}\n`;
|
|
13
|
+
css += `}\n`;
|
|
14
|
+
css += `@media screen and (min-width: ${setUnit(config.breakpoints.thresholds[list.mobile])}) {\n`;
|
|
15
|
+
css += `.display-mobile {\n`;
|
|
16
|
+
css += `display: none !important;\n`;
|
|
17
|
+
css += `}\n`;
|
|
18
|
+
css += `}\n`;
|
|
19
|
+
css += `@media screen and (min-width: ${setUnit(config.breakpoints.thresholds[list.tablet])}) and (max-width: ${setUnit(config.breakpoints.thresholds[list.laptop])}) {\n`;
|
|
20
|
+
css += `.hidden-tablet {\n`;
|
|
21
|
+
css += `display: none !important;\n`;
|
|
22
|
+
css += `}\n`;
|
|
23
|
+
css += `}\n`;
|
|
24
|
+
css += `@media screen and (max-width: ${setUnit(config.breakpoints.thresholds[list.tablet])}) and (min-width: ${setUnit(config.breakpoints.thresholds[list.laptop])}){\n`;
|
|
25
|
+
css += `.display-tablet {\n`;
|
|
26
|
+
css += `display: none !important;\n`;
|
|
27
|
+
css += `}\n`;
|
|
28
|
+
css += `}\n`;
|
|
29
|
+
css += `@media screen and (min-width: ${setUnit(config.breakpoints.thresholds[list.laptop])}) {\n`;
|
|
30
|
+
css += `.hidden-laptop {\n`;
|
|
31
|
+
css += `display: none !important;\n`;
|
|
32
|
+
css += `}\n`;
|
|
33
|
+
css += `}\n`;
|
|
34
|
+
css += `@media screen and (max-width: ${setUnit(config.breakpoints.thresholds[list.laptop])}) {\n`;
|
|
35
|
+
css += `.display-laptop {\n`;
|
|
36
|
+
css += `display: none !important;\n`;
|
|
37
|
+
css += `}\n`;
|
|
38
|
+
css += `}\n`;
|
|
27
39
|
return css;
|
|
28
40
|
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lapikit",
|
|
3
|
-
"version": "0.0.0-insiders.
|
|
3
|
+
"version": "0.0.0-insiders.cfec658",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
+
"homepage": "https://lapikit.dev",
|
|
8
9
|
"repository": {
|
|
9
10
|
"type": "git",
|
|
10
11
|
"url": "git+https://github.com/Nycolaide/lapikit.git",
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"**/*.css"
|
|
36
37
|
],
|
|
37
38
|
"bin": {
|
|
38
|
-
"lapikit": "bin/
|
|
39
|
+
"lapikit": "bin/index.js"
|
|
39
40
|
},
|
|
40
41
|
"svelte": "./dist/index.js",
|
|
41
42
|
"types": "./dist/index.d.ts",
|
|
@@ -55,6 +56,9 @@
|
|
|
55
56
|
"./stores": {
|
|
56
57
|
"default": "./dist/stores/index.js"
|
|
57
58
|
},
|
|
59
|
+
"./actions": {
|
|
60
|
+
"default": "./dist/actions/index.js"
|
|
61
|
+
},
|
|
58
62
|
"./css": "./dist/styles.css"
|
|
59
63
|
},
|
|
60
64
|
"peerDependencies": {
|
|
@@ -86,5 +90,8 @@
|
|
|
86
90
|
},
|
|
87
91
|
"keywords": [
|
|
88
92
|
"svelte"
|
|
89
|
-
]
|
|
93
|
+
],
|
|
94
|
+
"dependencies": {
|
|
95
|
+
"prompts": "^2.4.2"
|
|
96
|
+
}
|
|
90
97
|
}
|