@nasa-jpl/stellar-svelte 2.0.0-alpha.12
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 +7 -0
- package/README.md +58 -0
- package/dist/components/ui/alert/alert-description.svelte +8 -0
- package/dist/components/ui/alert/alert-description.svelte.d.ts +19 -0
- package/dist/components/ui/alert/alert-title.svelte +13 -0
- package/dist/components/ui/alert/alert-title.svelte.d.ts +22 -0
- package/dist/components/ui/alert/alert.svelte +10 -0
- package/dist/components/ui/alert/alert.svelte.d.ts +22 -0
- package/dist/components/ui/alert/index.d.ts +43 -0
- package/dist/components/ui/alert/index.js +19 -0
- package/dist/components/ui/alert-dialog/alert-dialog-action.svelte +16 -0
- package/dist/components/ui/alert-dialog/alert-dialog-action.svelte.d.ts +23 -0
- package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte +16 -0
- package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte.d.ts +23 -0
- package/dist/components/ui/alert-dialog/alert-dialog-content.svelte +23 -0
- package/dist/components/ui/alert-dialog/alert-dialog-content.svelte.d.ts +19 -0
- package/dist/components/ui/alert-dialog/alert-dialog-description.svelte +12 -0
- package/dist/components/ui/alert-dialog/alert-dialog-description.svelte.d.ts +19 -0
- package/dist/components/ui/alert-dialog/alert-dialog-footer.svelte +11 -0
- package/dist/components/ui/alert-dialog/alert-dialog-footer.svelte.d.ts +19 -0
- package/dist/components/ui/alert-dialog/alert-dialog-header.svelte +8 -0
- package/dist/components/ui/alert-dialog/alert-dialog-header.svelte.d.ts +19 -0
- package/dist/components/ui/alert-dialog/alert-dialog-overlay.svelte +17 -0
- package/dist/components/ui/alert-dialog/alert-dialog-overlay.svelte.d.ts +17 -0
- package/dist/components/ui/alert-dialog/alert-dialog-portal.svelte +6 -0
- package/dist/components/ui/alert-dialog/alert-dialog-portal.svelte.d.ts +19 -0
- package/dist/components/ui/alert-dialog/alert-dialog-title.svelte +10 -0
- package/dist/components/ui/alert-dialog/alert-dialog-title.svelte.d.ts +19 -0
- package/dist/components/ui/alert-dialog/index.d.ts +13 -0
- package/dist/components/ui/alert-dialog/index.js +15 -0
- package/dist/components/ui/aspect-ratio/aspect-ratio.svelte +7 -0
- package/dist/components/ui/aspect-ratio/aspect-ratio.svelte.d.ts +19 -0
- package/dist/components/ui/aspect-ratio/index.d.ts +2 -0
- package/dist/components/ui/aspect-ratio/index.js +2 -0
- package/dist/components/ui/badge/badge.svelte +16 -0
- package/dist/components/ui/badge/badge.svelte.d.ts +24 -0
- package/dist/components/ui/badge/index.d.ts +53 -0
- package/dist/components/ui/badge/index.js +16 -0
- package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +17 -0
- package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte.d.ts +19 -0
- package/dist/components/ui/breadcrumb/breadcrumb-item.svelte +9 -0
- package/dist/components/ui/breadcrumb/breadcrumb-item.svelte.d.ts +21 -0
- package/dist/components/ui/breadcrumb/breadcrumb-link.svelte +21 -0
- package/dist/components/ui/breadcrumb/breadcrumb-link.svelte.d.ts +24 -0
- package/dist/components/ui/breadcrumb/breadcrumb-list.svelte +16 -0
- package/dist/components/ui/breadcrumb/breadcrumb-list.svelte.d.ts +21 -0
- package/dist/components/ui/breadcrumb/breadcrumb-page.svelte +16 -0
- package/dist/components/ui/breadcrumb/breadcrumb-page.svelte.d.ts +23 -0
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +18 -0
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte.d.ts +21 -0
- package/dist/components/ui/breadcrumb/breadcrumb.svelte +8 -0
- package/dist/components/ui/breadcrumb/breadcrumb.svelte.d.ts +21 -0
- package/dist/components/ui/breadcrumb/index.d.ts +8 -0
- package/dist/components/ui/breadcrumb/index.js +10 -0
- package/dist/components/ui/button/button.svelte +20 -0
- package/dist/components/ui/button/button.svelte.d.ts +16 -0
- package/dist/components/ui/button/index.d.ts +117 -0
- package/dist/components/ui/button/index.js +28 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +30 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +15 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +22 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +15 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +24 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +17 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +13 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +23 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +7 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +19 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +30 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +15 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +10 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +17 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +8 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +19 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +25 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +15 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +25 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +21 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +16 -0
- package/dist/components/ui/dropdown-menu/index.js +18 -0
- package/dist/components/ui/popover/index.d.ts +6 -0
- package/dist/components/ui/popover/index.js +8 -0
- package/dist/components/ui/popover/popover-content.svelte +19 -0
- package/dist/components/ui/popover/popover-content.svelte.d.ts +19 -0
- package/dist/components/ui/theme-switcher/button.svelte +20 -0
- package/dist/components/ui/theme-switcher/button.svelte.d.ts +14 -0
- package/dist/components/ui/theme-switcher/index.d.ts +4 -0
- package/dist/components/ui/theme-switcher/index.js +4 -0
- package/dist/components/ui/theme-switcher/theme-switcher-button.svelte +15 -0
- package/dist/components/ui/theme-switcher/theme-switcher-button.svelte.d.ts +16 -0
- package/dist/components/ui/theme-switcher/theme-switcher-dropdown.svelte +25 -0
- package/dist/components/ui/theme-switcher/theme-switcher-dropdown.svelte.d.ts +16 -0
- package/dist/components/ui/typography/H1.svelte +8 -0
- package/dist/components/ui/typography/H1.svelte.d.ts +21 -0
- package/dist/components/ui/typography/H2.svelte +8 -0
- package/dist/components/ui/typography/H2.svelte.d.ts +21 -0
- package/dist/components/ui/typography/H3.svelte +8 -0
- package/dist/components/ui/typography/H3.svelte.d.ts +21 -0
- package/dist/components/ui/typography/H4.svelte +8 -0
- package/dist/components/ui/typography/H4.svelte.d.ts +21 -0
- package/dist/components/ui/typography/P.svelte +8 -0
- package/dist/components/ui/typography/P.svelte.d.ts +21 -0
- package/dist/components/ui/typography/index.d.ts +6 -0
- package/dist/components/ui/typography/index.js +6 -0
- package/dist/index.css +1792 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +12 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.js +38 -0
- package/eslint.config.js +33 -0
- package/package.json +70 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Button } from './components/ui/button/index.js';
|
|
2
|
+
import * as Popover from './components/ui/popover/index.js';
|
|
3
|
+
import * as DropdownMenu from './components/ui/dropdown-menu/index.js';
|
|
4
|
+
import * as AlertDialog from './components/ui/alert-dialog/index.js';
|
|
5
|
+
import { Badge } from './components/ui/badge/index.js';
|
|
6
|
+
import { ThemeSwitcherButton, ThemeSwitcherDropdown, ModeWatcher } from './components/ui/theme-switcher/index.js';
|
|
7
|
+
import { H1, H2, H3, H4, P } from './components/ui/typography/index.js';
|
|
8
|
+
import * as Alert from './components/ui/alert/index.js';
|
|
9
|
+
import { AspectRatio } from './components/ui/aspect-ratio/index.js';
|
|
10
|
+
import * as Breadcrumb from './components/ui/breadcrumb/index.js';
|
|
11
|
+
export { Alert, AlertDialog, AspectRatio, Button, Breadcrumb, Popover, DropdownMenu, Badge, H1, H2, H3, H4, P, ThemeSwitcherButton, ThemeSwitcherDropdown, ModeWatcher, };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Reexport your entry components here
|
|
2
|
+
import { Button } from './components/ui/button/index.js';
|
|
3
|
+
import * as Popover from './components/ui/popover/index.js';
|
|
4
|
+
import * as DropdownMenu from './components/ui/dropdown-menu/index.js';
|
|
5
|
+
import * as AlertDialog from './components/ui/alert-dialog/index.js';
|
|
6
|
+
import { Badge } from './components/ui/badge/index.js';
|
|
7
|
+
import { ThemeSwitcherButton, ThemeSwitcherDropdown, ModeWatcher } from './components/ui/theme-switcher/index.js';
|
|
8
|
+
import { H1, H2, H3, H4, P } from './components/ui/typography/index.js';
|
|
9
|
+
import * as Alert from './components/ui/alert/index.js';
|
|
10
|
+
import { AspectRatio } from './components/ui/aspect-ratio/index.js';
|
|
11
|
+
import * as Breadcrumb from './components/ui/breadcrumb/index.js';
|
|
12
|
+
export { Alert, AlertDialog, AspectRatio, Button, Breadcrumb, Popover, DropdownMenu, Badge, H1, H2, H3, H4, P, ThemeSwitcherButton, ThemeSwitcherDropdown, ModeWatcher, };
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ClassValue } from "clsx";
|
|
2
|
+
import type { TransitionConfig } from "svelte/transition";
|
|
3
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
4
|
+
type FlyAndScaleParams = {
|
|
5
|
+
y?: number;
|
|
6
|
+
x?: number;
|
|
7
|
+
start?: number;
|
|
8
|
+
duration?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const flyAndScale: (node: Element, params?: FlyAndScaleParams) => TransitionConfig;
|
|
11
|
+
export {};
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
import { cubicOut } from "svelte/easing";
|
|
4
|
+
export function cn(...inputs) {
|
|
5
|
+
return twMerge(clsx(inputs));
|
|
6
|
+
}
|
|
7
|
+
export const flyAndScale = (node, params = { y: -8, x: 0, start: 0.95, duration: 150 }) => {
|
|
8
|
+
const style = getComputedStyle(node);
|
|
9
|
+
const transform = style.transform === "none" ? "" : style.transform;
|
|
10
|
+
const scaleConversion = (valueA, scaleA, scaleB) => {
|
|
11
|
+
const [minA, maxA] = scaleA;
|
|
12
|
+
const [minB, maxB] = scaleB;
|
|
13
|
+
const percentage = (valueA - minA) / (maxA - minA);
|
|
14
|
+
const valueB = percentage * (maxB - minB) + minB;
|
|
15
|
+
return valueB;
|
|
16
|
+
};
|
|
17
|
+
const styleToString = (style) => {
|
|
18
|
+
return Object.keys(style).reduce((str, key) => {
|
|
19
|
+
if (style[key] === undefined)
|
|
20
|
+
return str;
|
|
21
|
+
return str + `${key}:${style[key]};`;
|
|
22
|
+
}, "");
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
duration: params.duration ?? 200,
|
|
26
|
+
delay: 0,
|
|
27
|
+
css: (t) => {
|
|
28
|
+
const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0]);
|
|
29
|
+
const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0]);
|
|
30
|
+
const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1]);
|
|
31
|
+
return styleToString({
|
|
32
|
+
transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`,
|
|
33
|
+
opacity: t
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
easing: cubicOut
|
|
37
|
+
};
|
|
38
|
+
};
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import ts from 'typescript-eslint';
|
|
3
|
+
import svelte from 'eslint-plugin-svelte';
|
|
4
|
+
import prettier from 'eslint-config-prettier';
|
|
5
|
+
import globals from 'globals';
|
|
6
|
+
|
|
7
|
+
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
8
|
+
export default [
|
|
9
|
+
js.configs.recommended,
|
|
10
|
+
...ts.configs.recommended,
|
|
11
|
+
...svelte.configs['flat/recommended'],
|
|
12
|
+
prettier,
|
|
13
|
+
...svelte.configs['flat/prettier'],
|
|
14
|
+
{
|
|
15
|
+
languageOptions: {
|
|
16
|
+
globals: {
|
|
17
|
+
...globals.browser,
|
|
18
|
+
...globals.node
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
files: ['**/*.svelte'],
|
|
24
|
+
languageOptions: {
|
|
25
|
+
parserOptions: {
|
|
26
|
+
parser: ts.parser
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
ignores: ['build/', '.svelte-kit/', 'dist/']
|
|
32
|
+
}
|
|
33
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
"bits-ui": "^0.21.10",
|
|
5
|
+
"clsx": "^2.1.1",
|
|
6
|
+
"inter-ui": "^4.0.2",
|
|
7
|
+
"lucide-svelte": "^0.394.0",
|
|
8
|
+
"mode-watcher": "^0.3.1",
|
|
9
|
+
"tailwind-merge": "^2.3.0",
|
|
10
|
+
"tailwind-variants": "^0.2.1"
|
|
11
|
+
},
|
|
12
|
+
"description": "Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).",
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@nasa-jpl/stellar": "file:../css/dist",
|
|
15
|
+
"@sveltejs/adapter-node": "^5.0.1",
|
|
16
|
+
"@sveltejs/kit": "^2.0.0",
|
|
17
|
+
"@sveltejs/package": "^2.0.0",
|
|
18
|
+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
|
19
|
+
"autoprefixer": "^10.4.19",
|
|
20
|
+
"eslint-plugin-svelte": "^2.36.0",
|
|
21
|
+
"globals": "^15.0.0",
|
|
22
|
+
"postcss": "^8.4.38",
|
|
23
|
+
"prettier-plugin-svelte": "^3.1.2",
|
|
24
|
+
"prettier-plugin-tailwindcss": "^0.5.14",
|
|
25
|
+
"publint": "^0.1.9",
|
|
26
|
+
"svelte": "^4.2.7",
|
|
27
|
+
"svelte-check": "^3.6.0",
|
|
28
|
+
"tailwindcss": "^3.4.3",
|
|
29
|
+
"tslib": "^2.4.1"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
"./svelte": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"svelte": "./dist/index.js",
|
|
35
|
+
"default": "./dist/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"!dist/**/*.test.*",
|
|
41
|
+
"!dist/**/*.spec.*",
|
|
42
|
+
"package.json"
|
|
43
|
+
],
|
|
44
|
+
"license": "ISC",
|
|
45
|
+
"main": "eslint.config.js",
|
|
46
|
+
"name": "@nasa-jpl/stellar-svelte",
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"svelte": "^4.0.0"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "vite build && npm run package && npm run build:css",
|
|
55
|
+
"build:css": "tailwind build src/index.css -o dist/index.css",
|
|
56
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
57
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
58
|
+
"dev": "vite dev",
|
|
59
|
+
"format": "prettier --write .",
|
|
60
|
+
"lint": "prettier --check . && eslint .",
|
|
61
|
+
"package": "svelte-kit sync && svelte-package && publint",
|
|
62
|
+
"prepublishOnly": "npm run build",
|
|
63
|
+
"preview": "vite preview"
|
|
64
|
+
},
|
|
65
|
+
"svelte": "./dist/index.js",
|
|
66
|
+
"type": "module",
|
|
67
|
+
"types": "./dist/index.d.ts",
|
|
68
|
+
"version": "2.0.0-alpha.12",
|
|
69
|
+
"gitHead": "44701a5e9d4e93e20c655e6c34d736c8bb4d6ffb"
|
|
70
|
+
}
|