lapikit 0.0.0-insiders.f206df2 → 0.0.0-insiders.f325e60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/components/accordion/accordion.svelte +118 -0
  2. package/dist/components/alert/alert.svelte +122 -0
  3. package/dist/components/app/app.svelte +18 -0
  4. package/dist/components/appbar/appbar.css +4 -4
  5. package/dist/components/appbar/appbar.svelte +45 -0
  6. package/dist/components/aspect-ratio/aspect-ratio.svelte +23 -4
  7. package/dist/components/avatar/avatar.svelte +114 -0
  8. package/dist/components/button/button.css +14 -14
  9. package/dist/components/button/button.svelte +230 -0
  10. package/dist/components/card/card.css +4 -4
  11. package/dist/components/card/card.svelte +108 -0
  12. package/dist/components/chip/chip.css +9 -9
  13. package/dist/components/chip/chip.svelte +211 -0
  14. package/dist/components/dialog/dialog.svelte +144 -0
  15. package/dist/components/dropdown/dropdown.svelte +24 -0
  16. package/dist/components/icon/icon.css +5 -3
  17. package/dist/components/icon/icon.svelte +89 -0
  18. package/dist/components/list/list.css +8 -8
  19. package/dist/components/list/list.svelte +199 -0
  20. package/dist/components/list/modules/list-item.svelte +199 -0
  21. package/dist/components/modal/modal.svelte +135 -0
  22. package/dist/components/popover/popover.svelte +24 -0
  23. package/dist/components/separator/separator.svelte +48 -0
  24. package/dist/components/spacer/spacer.svelte +5 -0
  25. package/dist/components/textfield/textfield.css +8 -8
  26. package/dist/components/textfield/textfield.svelte +270 -0
  27. package/dist/components/toolbar/toolbar.css +9 -9
  28. package/dist/components/toolbar/toolbar.svelte +135 -0
  29. package/dist/components/tooltip/tooltip.svelte +127 -0
  30. package/dist/internal/config/presets.d.ts +125 -0
  31. package/dist/internal/config/presets.js +138 -0
  32. package/dist/internal/config/variables.d.ts +6 -0
  33. package/dist/internal/config/variables.js +6 -0
  34. package/dist/internal/core/formatter/component.d.ts +5 -0
  35. package/dist/internal/core/formatter/component.js +63 -0
  36. package/dist/internal/core/formatter/device.d.ts +5 -0
  37. package/dist/internal/core/formatter/device.js +65 -0
  38. package/dist/internal/core/formatter/index.d.ts +7 -0
  39. package/dist/internal/core/formatter/index.js +35 -0
  40. package/dist/internal/core/formatter/style.d.ts +4 -0
  41. package/dist/internal/core/formatter/style.js +15 -0
  42. package/dist/internal/core/formatter/theme.d.ts +5 -0
  43. package/dist/internal/core/formatter/theme.js +28 -0
  44. package/dist/internal/core/formatter/typography.d.ts +5 -0
  45. package/dist/internal/core/formatter/typography.js +12 -0
  46. package/dist/internal/helpers/parser.d.ts +10 -0
  47. package/dist/internal/helpers/parser.js +92 -0
  48. package/dist/internal/plugins/vite.d.ts +8 -0
  49. package/dist/internal/plugins/vite.js +31 -0
  50. package/dist/internal/ripple.js +3 -3
  51. package/dist/internal/types/configuration.d.ts +40 -0
  52. package/dist/internal/types/configuration.js +1 -0
  53. package/dist/internal/types/index.d.ts +1 -0
  54. package/dist/internal/types/index.js +1 -0
  55. package/dist/labs/index.d.ts +4 -0
  56. package/dist/labs/index.js +5 -0
  57. package/dist/labs/my-component-style-global.svelte +6 -0
  58. package/dist/labs/my-component-style-global.svelte.d.ts +18 -0
  59. package/dist/labs/my-component-style-import.svelte +15 -0
  60. package/dist/labs/my-component-style-import.svelte.d.ts +18 -0
  61. package/dist/labs/my-component-style-mixed.svelte +23 -0
  62. package/dist/labs/my-component-style-mixed.svelte.d.ts +18 -0
  63. package/dist/labs/my-component.svelte +16 -0
  64. package/dist/labs/my-component.svelte.d.ts +18 -0
  65. package/dist/labs/style-mixed.css +7 -0
  66. package/dist/labs/style.css +7 -0
  67. package/dist/labs.css +1 -0
  68. package/dist/plugin/css.js +0 -6
  69. package/dist/styles/animation.css +33 -0
  70. package/dist/styles/keyframes.css +30 -0
  71. package/dist/styles/reset.css +131 -0
  72. package/package.json +9 -2
@@ -0,0 +1,31 @@
1
+ import { fileURLToPath } from 'url';
2
+ import { dirname } from 'path';
3
+ import { terminal } from '../terminal.js';
4
+ import { css } from '../core/formatter/index.js';
5
+ import { parserConfigLapikit } from '../helpers/parser.js';
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = dirname(__filename);
8
+ import fsPromises from 'fs/promises';
9
+ import path from 'path';
10
+ const app = process.cwd();
11
+ export async function lapikit({ config } = {}) {
12
+ return {
13
+ name: 'lapikit/vite',
14
+ async config() {
15
+ if (config) {
16
+ const configuration = await parserConfigLapikit(app, config);
17
+ // generate styles
18
+ const styles = await css(configuration);
19
+ fsPromises.writeFile(path.resolve(__dirname, '../../labs.css'), styles?.themes +
20
+ '\n\n' +
21
+ styles?.typography +
22
+ '\n\n' +
23
+ styles?.styles +
24
+ '\n\n' +
25
+ styles?.devices || '');
26
+ console.log('styles', styles, __dirname);
27
+ }
28
+ terminal('info', 'lapikit is up!');
29
+ }
30
+ };
31
+ }
@@ -27,13 +27,13 @@ export function ripple(el, options = {}) {
27
27
  options.duration = undefined;
28
28
  }
29
29
  if (options.component) {
30
- rippleContainer.style.setProperty('--ripple-radius', `var(--${options.component}-radius)`);
30
+ rippleContainer.style.setProperty('--system-ripple-radius', `var(--${options.component}-radius)`);
31
31
  }
32
32
  if (options.color) {
33
- rippleContainer.style.setProperty('--ripple-color', options.color);
33
+ rippleContainer.style.setProperty('--system-ripple-color', options.color);
34
34
  }
35
35
  if (options.duration) {
36
- rippleContainer.style.setProperty('--ripple-duration', `${options.duration}ms`);
36
+ rippleContainer.style.setProperty('--system-animation-ripple-duration', `${options.duration}ms`);
37
37
  }
38
38
  }
39
39
  function createRipple(e, center) {
@@ -0,0 +1,40 @@
1
+ export interface DevConfiguration {
2
+ breakpoints?: {
3
+ devices?: {
4
+ [key: string]: number | string;
5
+ };
6
+ thresholds?: {
7
+ [key: string]: number | string;
8
+ };
9
+ };
10
+ theme?: {
11
+ defaultTheme?: string;
12
+ themes?: FragThemes;
13
+ };
14
+ typography?: {
15
+ defaultTypography?: string;
16
+ fonts?: FragTypography;
17
+ };
18
+ styles?: FragStyles;
19
+ }
20
+ export interface FragThemes {
21
+ [key: string]: {
22
+ dark?: boolean;
23
+ colors?: {
24
+ [key: string]: string;
25
+ };
26
+ variables?: {
27
+ [key: string]: string | number;
28
+ };
29
+ };
30
+ }
31
+ export interface FragTypography {
32
+ [key: string]: {
33
+ [key: string]: string | string[];
34
+ };
35
+ }
36
+ export interface FragStyles {
37
+ [key: string]: string | number | {
38
+ [key: string]: string | number;
39
+ };
40
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './configuration.js';
@@ -0,0 +1 @@
1
+ export * from './configuration.js';
@@ -0,0 +1,4 @@
1
+ export { default as CompoGlobal } from './my-component-style-global.svelte';
2
+ export { default as CompoMixed } from './my-component-style-mixed.svelte';
3
+ export { default as CompoLocal } from './my-component.svelte';
4
+ export { default as CompoImport } from './my-component-style-import.svelte';
@@ -0,0 +1,5 @@
1
+ // components
2
+ export { default as CompoGlobal } from './my-component-style-global.svelte';
3
+ export { default as CompoMixed } from './my-component-style-mixed.svelte';
4
+ export { default as CompoLocal } from './my-component.svelte';
5
+ export { default as CompoImport } from './my-component-style-import.svelte';
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ </script>
3
+
4
+ <div class="my-compo-style-global">
5
+ <h1>Hello World Lapikit Global</h1>
6
+ </div>
@@ -0,0 +1,18 @@
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> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const MyComponentStyleGlobal: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type MyComponentStyleGlobal = InstanceType<typeof MyComponentStyleGlobal>;
18
+ export default MyComponentStyleGlobal;
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ </script>
3
+
4
+ <div class="my-compo-style-import">
5
+ <h1>Hello World Lapikit (import styles)</h1>
6
+ </div>
7
+
8
+ <style>.my-compo-style-import {
9
+ padding: 2.5rem;
10
+ }
11
+
12
+ .my-compo-style-import h1 {
13
+ color: orangered;
14
+ }
15
+ </style>
@@ -0,0 +1,18 @@
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> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const MyComponentStyleImport: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type MyComponentStyleImport = InstanceType<typeof MyComponentStyleImport>;
18
+ export default MyComponentStyleImport;
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ </script>
3
+
4
+ <div class="my-compo-style-mixed">
5
+ <h1>Hello World Lapikit Mixed</h1>
6
+ </div>
7
+
8
+ <style>.my-compo-style-mixed {
9
+ padding: 5.5rem;
10
+ }
11
+
12
+ .my-compo-style-mixed h1 {
13
+ color: rgb(101, 52, 218);
14
+ }
15
+
16
+ div {
17
+ padding: 2rem;
18
+ }
19
+
20
+ h1 {
21
+ color: rgb(101, 52, 218);
22
+ }
23
+ </style>
@@ -0,0 +1,18 @@
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> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const MyComponentStyleMixed: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type MyComponentStyleMixed = InstanceType<typeof MyComponentStyleMixed>;
18
+ export default MyComponentStyleMixed;
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ </script>
3
+
4
+ <div class="my-compo-style-local">
5
+ <h1>Hello World Lapikit</h1>
6
+ </div>
7
+
8
+ <style>
9
+ div {
10
+ padding: 2rem;
11
+ }
12
+
13
+ h1 {
14
+ color: purple;
15
+ }
16
+ </style>
@@ -0,0 +1,18 @@
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> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const MyComponent: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type MyComponent = InstanceType<typeof MyComponent>;
18
+ export default MyComponent;
@@ -0,0 +1,7 @@
1
+ .my-compo-style-mixed {
2
+ padding: 5.5rem;
3
+ }
4
+
5
+ .my-compo-style-mixed h1 {
6
+ color: rgb(101, 52, 218);
7
+ }
@@ -0,0 +1,7 @@
1
+ .my-compo-style-import {
2
+ padding: 2.5rem;
3
+ }
4
+
5
+ .my-compo-style-import h1 {
6
+ color: orangered;
7
+ }
package/dist/labs.css ADDED
@@ -0,0 +1 @@
1
+ /* The future of css lapikit */
@@ -59,12 +59,6 @@ export async function css(configuration) {
59
59
  else {
60
60
  css += ` --prism-${name}: ${parser(values)};\n`;
61
61
  }
62
- for (const [styleName, styleValue] of Object.entries(values || {})) {
63
- console.log('VALUE', styleName, styleValue, typeof styleValue);
64
- for (const [subStyleName, subStyleValue] of Object.entries(styleValue)) {
65
- css += ` --prism-${styleName}-${subStyleName}: ${parser(subStyleValue)};\n`;
66
- }
67
- }
68
62
  response += css;
69
63
  }
70
64
  response += '}\n';
@@ -0,0 +1,33 @@
1
+ .kit-ripple {
2
+ background-color: currentColor;
3
+ opacity: 0.1;
4
+ position: absolute;
5
+ border-radius: 50%;
6
+ pointer-events: none;
7
+ -webkit-transition: 0.6s;
8
+ transition: 0.6s;
9
+ -webkit-animation: animation-l-ripple var(--system-animation-ripple-duration, 0.4s)
10
+ cubic-bezier(0.4, 0, 0.2, 1);
11
+ animation: animation-l-ripple var(--system-animation-ripple-duration, 0.4s)
12
+ cubic-bezier(0.4, 0, 0.2, 1);
13
+ border-radius: var(--system-ripple-radius);
14
+ }
15
+
16
+ .kit-ripple--center {
17
+ top: 50% !important;
18
+ left: 50% !important;
19
+ translate: -50% -50% !important;
20
+ }
21
+
22
+ .kit-ripple--effect {
23
+ position: absolute;
24
+ left: 0;
25
+ right: 0;
26
+ top: 0;
27
+ bottom: 0;
28
+ overflow: hidden;
29
+ background: none;
30
+ pointer-events: none;
31
+ z-index: 999;
32
+ border-radius: var(--system-ripple-radius);
33
+ }
@@ -0,0 +1,30 @@
1
+ @keyframes button-click {
2
+ 0% {
3
+ transform: scale(0.98);
4
+ }
5
+ 40% {
6
+ transform: scale(1.02);
7
+ }
8
+ 100% {
9
+ transform: scale(1);
10
+ }
11
+ }
12
+
13
+ @keyframes icon-rotate {
14
+ 0% {
15
+ transform: rotate(10deg);
16
+ }
17
+ 100% {
18
+ transform: rotate(380deg);
19
+ }
20
+ }
21
+
22
+ @keyframes animation-l-ripple {
23
+ from {
24
+ scale: 0;
25
+ }
26
+
27
+ to {
28
+ scale: 1;
29
+ }
30
+ }
@@ -0,0 +1,131 @@
1
+ html {
2
+ -webkit-text-size-adjust: 100%;
3
+ tab-size: 4;
4
+ line-height: 1.5;
5
+ font-family: var(--kit-font-sans);
6
+ background-color: var(--system-background);
7
+ color: var(--system-label);
8
+ }
9
+
10
+ pre,
11
+ code {
12
+ font-family: var(--kit-font-mono);
13
+ }
14
+
15
+ body {
16
+ margin: 0;
17
+ -webkit-font-smoothing: antialiased;
18
+ }
19
+
20
+ main {
21
+ display: block;
22
+ }
23
+
24
+ button,
25
+ input,
26
+ optgroup,
27
+ select,
28
+ textarea {
29
+ font: inherit;
30
+ }
31
+
32
+ button {
33
+ overflow: visible;
34
+ }
35
+
36
+ button,
37
+ [type='button'],
38
+ [type='reset'],
39
+ [type='submit'],
40
+ [role='button'] {
41
+ cursor: pointer;
42
+ color: inherit;
43
+ }
44
+
45
+ *:not(body) {
46
+ outline: none;
47
+ }
48
+
49
+ *,
50
+ ::after,
51
+ ::before,
52
+ ::backdrop {
53
+ box-sizing: border-box;
54
+ margin: 0;
55
+ padding: 0;
56
+ border: 0 solid;
57
+ }
58
+
59
+ *,
60
+ ::before,
61
+ ::after {
62
+ background-repeat: no-repeat;
63
+ box-sizing: inherit;
64
+ }
65
+
66
+ ::before,
67
+ ::after {
68
+ text-decoration: inherit;
69
+ vertical-align: inherit;
70
+ }
71
+
72
+ [type='search'] {
73
+ -webkit-appearance: textfield;
74
+ appearance: textfield;
75
+ outline-offset: -2px;
76
+ }
77
+
78
+ ol,
79
+ ul,
80
+ menu {
81
+ list-style: initial;
82
+ margin-left: calc(var(--system-spacing) * 5);
83
+ }
84
+
85
+ ol ul,
86
+ ol ol,
87
+ ul ul,
88
+ ul ol {
89
+ padding-left: 1rem;
90
+ }
91
+
92
+ code {
93
+ border-radius: 0.25rem;
94
+ padding-block: 0.125rem;
95
+ padding-inline: 0.375rem;
96
+ position: relative;
97
+ }
98
+
99
+ sub,
100
+ sup {
101
+ font-size: 75%;
102
+ line-height: 0;
103
+ position: relative;
104
+ vertical-align: baseline;
105
+ }
106
+
107
+ sup {
108
+ top: -0.5em;
109
+ }
110
+
111
+ sub {
112
+ bottom: -0.25em;
113
+ }
114
+
115
+ img {
116
+ border-style: none;
117
+ }
118
+
119
+ button,
120
+ input,
121
+ select,
122
+ textarea {
123
+ background-color: transparent;
124
+ border-style: none;
125
+ }
126
+
127
+ @media (prefers-reduced-motion: no-preference) {
128
+ html {
129
+ interpolate-size: allow-keywords;
130
+ }
131
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lapikit",
3
- "version": "0.0.0-insiders.f206df2",
3
+ "version": "0.0.0-insiders.f325e60",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -50,6 +50,10 @@
50
50
  "svelte": "./dist/components/index.js",
51
51
  "default": "./dist/components/index.js"
52
52
  },
53
+ "./labs": {
54
+ "svelte": "./dist/labs/index.js",
55
+ "default": "./dist/labs/index.js"
56
+ },
53
57
  "./vite": {
54
58
  "default": "./dist/plugin/vitejs.js"
55
59
  },
@@ -60,7 +64,10 @@
60
64
  "default": "./dist/actions/index.js"
61
65
  },
62
66
  "./css": "./dist/styles.css",
63
- "./styles": "./dist/colors.css"
67
+ "./styles": "./dist/labs.css",
68
+ "./viteLab": {
69
+ "default": "./dist/internal/plugins/vite.js"
70
+ }
64
71
  },
65
72
  "peerDependencies": {
66
73
  "svelte": "^5.0.0"