@tekkare/romulus 0.1.0
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/dist/module.cjs +5 -0
- package/dist/module.d.mts +13 -0
- package/dist/module.d.ts +13 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +28 -0
- package/dist/runtime/assets/styles/base.css +1 -0
- package/dist/runtime/assets/styles/tokens.css +1 -0
- package/dist/runtime/components/Button.vue +46 -0
- package/dist/runtime/components/Card.vue +47 -0
- package/dist/runtime/components/Input.vue +52 -0
- package/dist/runtime/composables/useRomulus.d.ts +6 -0
- package/dist/runtime/composables/useRomulus.js +17 -0
- package/dist/runtime/utils/index.d.ts +4 -0
- package/dist/runtime/utils/index.js +3 -0
- package/dist/types.d.mts +7 -0
- package/dist/types.d.ts +7 -0
- package/package.json +36 -0
package/dist/module.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
|
|
3
|
+
interface RomulusModuleOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Prefix for all Romulus components.
|
|
6
|
+
* @default 'R'
|
|
7
|
+
*/
|
|
8
|
+
prefix?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: _nuxt_schema.NuxtModule<RomulusModuleOptions, RomulusModuleOptions, false>;
|
|
11
|
+
|
|
12
|
+
export { _default as default };
|
|
13
|
+
export type { RomulusModuleOptions };
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
|
|
3
|
+
interface RomulusModuleOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Prefix for all Romulus components.
|
|
6
|
+
* @default 'R'
|
|
7
|
+
*/
|
|
8
|
+
prefix?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: _nuxt_schema.NuxtModule<RomulusModuleOptions, RomulusModuleOptions, false>;
|
|
11
|
+
|
|
12
|
+
export { _default as default };
|
|
13
|
+
export type { RomulusModuleOptions };
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir } from '@nuxt/kit';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
const module = defineNuxtModule({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "@tekkare/romulus",
|
|
7
|
+
configKey: "romulus",
|
|
8
|
+
compatibility: {
|
|
9
|
+
nuxt: ">=3.16.0"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaults: {
|
|
13
|
+
prefix: "R"
|
|
14
|
+
},
|
|
15
|
+
async setup(options, nuxt) {
|
|
16
|
+
const { resolve } = createResolver(import.meta.url);
|
|
17
|
+
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
|
|
18
|
+
nuxt.options.css.push(resolve(runtimeDir, "assets/styles/tokens.css"));
|
|
19
|
+
nuxt.options.css.push(resolve(runtimeDir, "assets/styles/base.css"));
|
|
20
|
+
await addComponentsDir({
|
|
21
|
+
path: resolve(runtimeDir, "components"),
|
|
22
|
+
prefix: options.prefix
|
|
23
|
+
});
|
|
24
|
+
addImportsDir(resolve(runtimeDir, "composables"));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export { module as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:after,:before{box-sizing:border-box;margin:0;padding:0}html{color:var(--r-color-gray-900);font-family:var(--r-font-family);font-size:16px;line-height:var(--r-leading-normal);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}body{background-color:var(--r-color-white);min-height:100vh}img,svg,video{display:block;max-width:100%}button,input,select,textarea{color:inherit;font:inherit}button{background:none;border:none;cursor:pointer}a{color:inherit;text-decoration:none}h1,h2,h3,h4,h5,h6{font-weight:var(--r-font-weight-semibold);line-height:var(--r-leading-tight)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--r-color-primary-50:#eef2ff;--r-color-primary-100:#e0e7ff;--r-color-primary-200:#c7d2fe;--r-color-primary-300:#a5b4fc;--r-color-primary-400:#818cf8;--r-color-primary-500:#6366f1;--r-color-primary-600:#4f46e5;--r-color-primary-700:#4338ca;--r-color-primary-800:#3730a3;--r-color-primary-900:#312e81;--r-color-gray-50:#f9fafb;--r-color-gray-100:#f3f4f6;--r-color-gray-200:#e5e7eb;--r-color-gray-300:#d1d5db;--r-color-gray-400:#9ca3af;--r-color-gray-500:#6b7280;--r-color-gray-600:#4b5563;--r-color-gray-700:#374151;--r-color-gray-800:#1f2937;--r-color-gray-900:#111827;--r-color-gray-950:#030712;--r-color-success-500:#22c55e;--r-color-success-600:#16a34a;--r-color-warning-500:#f59e0b;--r-color-warning-600:#d97706;--r-color-danger-500:#ef4444;--r-color-danger-600:#dc2626;--r-color-white:#fff;--r-color-black:#000;--r-font-family:"Inter",ui-sans-serif,system-ui,-apple-system,sans-serif;--r-font-mono:"JetBrains Mono",ui-monospace,"Cascadia Code",monospace;--r-text-xs:0.75rem;--r-text-sm:0.875rem;--r-text-base:1rem;--r-text-lg:1.125rem;--r-text-xl:1.25rem;--r-text-2xl:1.5rem;--r-text-3xl:1.875rem;--r-text-4xl:2.25rem;--r-font-weight-normal:400;--r-font-weight-medium:500;--r-font-weight-semibold:600;--r-font-weight-bold:700;--r-leading-tight:1.25;--r-leading-normal:1.5;--r-leading-relaxed:1.75;--r-space-0:0;--r-space-1:0.25rem;--r-space-2:0.5rem;--r-space-3:0.75rem;--r-space-4:1rem;--r-space-5:1.25rem;--r-space-6:1.5rem;--r-space-8:2rem;--r-space-10:2.5rem;--r-space-12:3rem;--r-space-16:4rem;--r-space-20:5rem;--r-radius-none:0;--r-radius-sm:0.25rem;--r-radius-md:0.375rem;--r-radius-lg:0.5rem;--r-radius-xl:0.75rem;--r-radius-2xl:1rem;--r-radius-full:9999px;--r-shadow-xs:0 1px 2px 0 rgba(0,0,0,.05);--r-shadow-sm:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--r-shadow-md:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--r-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--r-shadow-xl:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--r-transition-fast:150ms cubic-bezier(0.4,0,0.2,1);--r-transition-base:200ms cubic-bezier(0.4,0,0.2,1);--r-transition-slow:300ms cubic-bezier(0.4,0,0.2,1)}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
export interface RButtonProps {
|
|
3
|
+
/** Visual style variant */
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'outline' | 'ghost'
|
|
5
|
+
/** Size of the button */
|
|
6
|
+
size?: 'sm' | 'md' | 'lg'
|
|
7
|
+
/** Whether the button is disabled */
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
/** Render as a full-width button */
|
|
10
|
+
block?: boolean
|
|
11
|
+
/** HTML button type attribute */
|
|
12
|
+
type?: 'button' | 'submit' | 'reset'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
withDefaults(defineProps<RButtonProps>(), {
|
|
16
|
+
variant: 'primary',
|
|
17
|
+
size: 'md',
|
|
18
|
+
disabled: false,
|
|
19
|
+
block: false,
|
|
20
|
+
type: 'button',
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
defineEmits<{
|
|
24
|
+
click: [event: MouseEvent]
|
|
25
|
+
}>()
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<button
|
|
30
|
+
:type="type"
|
|
31
|
+
:disabled="disabled"
|
|
32
|
+
:class="[
|
|
33
|
+
'r-button',
|
|
34
|
+
`r-button--${variant}`,
|
|
35
|
+
`r-button--${size}`,
|
|
36
|
+
{ 'r-button--block': block },
|
|
37
|
+
]"
|
|
38
|
+
@click="$emit('click', $event)"
|
|
39
|
+
>
|
|
40
|
+
<slot />
|
|
41
|
+
</button>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<style scoped>
|
|
45
|
+
.r-button{align-items:center;border:1px solid transparent;border-radius:var(--r-radius-lg);cursor:pointer;display:inline-flex;font-weight:var(--r-font-weight-medium);gap:var(--r-space-2);justify-content:center;transition:all var(--r-transition-fast);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.r-button:focus-visible{outline:2px solid var(--r-color-primary-500);outline-offset:2px}.r-button:disabled{cursor:not-allowed;opacity:.5}.r-button--sm{font-size:var(--r-text-sm);height:2rem;padding:var(--r-space-1) var(--r-space-3)}.r-button--md{font-size:var(--r-text-sm);height:2.5rem;padding:var(--r-space-2) var(--r-space-4)}.r-button--lg{font-size:var(--r-text-base);height:3rem;padding:var(--r-space-3) var(--r-space-6)}.r-button--primary{background-color:var(--r-color-primary-600);color:var(--r-color-white)}.r-button--primary:hover:not(:disabled){background-color:var(--r-color-primary-700)}.r-button--primary:active:not(:disabled){background-color:var(--r-color-primary-800)}.r-button--secondary{background-color:var(--r-color-gray-100);color:var(--r-color-gray-800)}.r-button--secondary:hover:not(:disabled){background-color:var(--r-color-gray-200)}.r-button--secondary:active:not(:disabled){background-color:var(--r-color-gray-300)}.r-button--outline{background-color:transparent;border-color:var(--r-color-gray-300);color:var(--r-color-gray-700)}.r-button--outline:hover:not(:disabled){background-color:var(--r-color-gray-50);border-color:var(--r-color-gray-400)}.r-button--outline:active:not(:disabled){background-color:var(--r-color-gray-100)}.r-button--ghost{background-color:transparent;color:var(--r-color-gray-700)}.r-button--ghost:hover:not(:disabled){background-color:var(--r-color-gray-100)}.r-button--ghost:active:not(:disabled){background-color:var(--r-color-gray-200)}.r-button--block{width:100%}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
export interface RCardProps {
|
|
3
|
+
/** Add padding to the card body */
|
|
4
|
+
padding?: 'none' | 'sm' | 'md' | 'lg'
|
|
5
|
+
/** Add a subtle border */
|
|
6
|
+
bordered?: boolean
|
|
7
|
+
/** Card shadow level */
|
|
8
|
+
shadow?: 'none' | 'sm' | 'md' | 'lg'
|
|
9
|
+
/** Make the card hoverable with a lift effect */
|
|
10
|
+
hoverable?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
withDefaults(defineProps<RCardProps>(), {
|
|
14
|
+
padding: 'md',
|
|
15
|
+
bordered: true,
|
|
16
|
+
shadow: 'sm',
|
|
17
|
+
hoverable: false,
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div
|
|
23
|
+
:class="[
|
|
24
|
+
'r-card',
|
|
25
|
+
`r-card--padding-${padding}`,
|
|
26
|
+
`r-card--shadow-${shadow}`,
|
|
27
|
+
{
|
|
28
|
+
'r-card--bordered': bordered,
|
|
29
|
+
'r-card--hoverable': hoverable,
|
|
30
|
+
},
|
|
31
|
+
]"
|
|
32
|
+
>
|
|
33
|
+
<div v-if="$slots.header" class="r-card__header">
|
|
34
|
+
<slot name="header" />
|
|
35
|
+
</div>
|
|
36
|
+
<div class="r-card__body">
|
|
37
|
+
<slot />
|
|
38
|
+
</div>
|
|
39
|
+
<div v-if="$slots.footer" class="r-card__footer">
|
|
40
|
+
<slot name="footer" />
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<style scoped>
|
|
46
|
+
.r-card{background-color:var(--r-color-white);border-radius:var(--r-radius-xl);overflow:hidden;transition:all var(--r-transition-base)}.r-card--bordered{border:1px solid var(--r-color-gray-200)}.r-card--shadow-none{box-shadow:none}.r-card--shadow-sm{box-shadow:var(--r-shadow-sm)}.r-card--shadow-md{box-shadow:var(--r-shadow-md)}.r-card--hoverable:hover,.r-card--shadow-lg{box-shadow:var(--r-shadow-lg)}.r-card--hoverable:hover{transform:translateY(-2px)}.r-card--padding-none .r-card__body{padding:0}.r-card--padding-sm .r-card__body{padding:var(--r-space-3)}.r-card--padding-md .r-card__body{padding:var(--r-space-5)}.r-card--padding-lg .r-card__body{padding:var(--r-space-8)}.r-card__header{border-bottom:1px solid var(--r-color-gray-200);font-weight:var(--r-font-weight-semibold)}.r-card__footer,.r-card__header{padding:var(--r-space-4) var(--r-space-5)}.r-card__footer{background-color:var(--r-color-gray-50);border-top:1px solid var(--r-color-gray-200)}
|
|
47
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
export interface RInputProps {
|
|
3
|
+
/** The v-model value */
|
|
4
|
+
modelValue?: string
|
|
5
|
+
/** Label text displayed above the input */
|
|
6
|
+
label?: string
|
|
7
|
+
/** Placeholder text */
|
|
8
|
+
placeholder?: string
|
|
9
|
+
/** Error message to display */
|
|
10
|
+
error?: string
|
|
11
|
+
/** Whether the input is disabled */
|
|
12
|
+
disabled?: boolean
|
|
13
|
+
/** HTML input type */
|
|
14
|
+
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'
|
|
15
|
+
/** Whether the field is required */
|
|
16
|
+
required?: boolean
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
withDefaults(defineProps<RInputProps>(), {
|
|
20
|
+
modelValue: '',
|
|
21
|
+
type: 'text',
|
|
22
|
+
disabled: false,
|
|
23
|
+
required: false,
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
defineEmits<{
|
|
27
|
+
'update:modelValue': [value: string]
|
|
28
|
+
}>()
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div class="r-input-wrapper">
|
|
33
|
+
<label v-if="label" class="r-input-label">
|
|
34
|
+
{{ label }}
|
|
35
|
+
<span v-if="required" class="r-input-required">*</span>
|
|
36
|
+
</label>
|
|
37
|
+
<input
|
|
38
|
+
:type="type"
|
|
39
|
+
:value="modelValue"
|
|
40
|
+
:placeholder="placeholder"
|
|
41
|
+
:disabled="disabled"
|
|
42
|
+
:required="required"
|
|
43
|
+
:class="['r-input', { 'r-input--error': error }]"
|
|
44
|
+
@input="$emit('update:modelValue', ($event.target as HTMLInputElement).value)"
|
|
45
|
+
/>
|
|
46
|
+
<p v-if="error" class="r-input-error">{{ error }}</p>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<style scoped>
|
|
51
|
+
.r-input-wrapper{display:flex;flex-direction:column;gap:var(--r-space-1)}.r-input-label{color:var(--r-color-gray-700);font-size:var(--r-text-sm);font-weight:var(--r-font-weight-medium)}.r-input-required{color:var(--r-color-danger-500);margin-left:2px}.r-input{background-color:var(--r-color-white);border:1px solid var(--r-color-gray-300);border-radius:var(--r-radius-lg);color:var(--r-color-gray-900);font-size:var(--r-text-sm);height:2.5rem;line-height:var(--r-leading-normal);padding:var(--r-space-2) var(--r-space-3);transition:all var(--r-transition-fast);width:100%}.r-input::-moz-placeholder{color:var(--r-color-gray-400)}.r-input::placeholder{color:var(--r-color-gray-400)}.r-input:hover:not(:disabled){border-color:var(--r-color-gray-400)}.r-input:focus{border-color:var(--r-color-primary-500);box-shadow:0 0 0 3px var(--r-color-primary-100);outline:none}.r-input:disabled{background-color:var(--r-color-gray-50);cursor:not-allowed;opacity:.5}.r-input--error,.r-input--error:focus{border-color:var(--r-color-danger-500)}.r-input--error:focus{box-shadow:0 0 0 3px rgba(239,68,68,.15)}.r-input-error{color:var(--r-color-danger-500);font-size:var(--r-text-xs);margin-top:var(--r-space-1)}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function useRomulus() {
|
|
2
|
+
function bem(block, element, modifiers) {
|
|
3
|
+
const base = element ? `r-${block}__${element}` : `r-${block}`;
|
|
4
|
+
const classes = [base];
|
|
5
|
+
if (modifiers) {
|
|
6
|
+
for (const [key, value] of Object.entries(modifiers)) {
|
|
7
|
+
if (value) {
|
|
8
|
+
classes.push(`${base}--${key}`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return classes.join(" ");
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
bem
|
|
16
|
+
};
|
|
17
|
+
}
|
package/dist/types.d.mts
ADDED
package/dist/types.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tekkare/romulus",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Romulus Design System - Nuxt module by Tekkare",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/types.d.ts",
|
|
13
|
+
"import": "./dist/module.mjs",
|
|
14
|
+
"require": "./dist/module.cjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"main": "./dist/module.cjs",
|
|
18
|
+
"module": "./dist/module.mjs",
|
|
19
|
+
"types": "./dist/types.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "nuxt-module-build build",
|
|
25
|
+
"dev": "nuxi dev playground",
|
|
26
|
+
"typecheck": "nuxi typecheck"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@nuxt/kit": "^3.16.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@nuxt/module-builder": "^0.8.4",
|
|
33
|
+
"nuxt": "^3.16.0",
|
|
34
|
+
"typescript": "^5.7.3"
|
|
35
|
+
}
|
|
36
|
+
}
|