@1001-digital/layers.base 0.0.1

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 (55) hide show
  1. package/.editorconfig +12 -0
  2. package/.nuxtrc +1 -0
  3. package/.playground/app.config.ts +5 -0
  4. package/.playground/app.vue +3 -0
  5. package/.playground/nuxt.config.ts +12 -0
  6. package/.playground/pages/index.vue +626 -0
  7. package/AGENTS.md +51 -0
  8. package/README.md +13 -0
  9. package/app/app.vue +3 -0
  10. package/app/assets/styles/base/base.css +52 -0
  11. package/app/assets/styles/base/forms.css +129 -0
  12. package/app/assets/styles/base/reset.css +159 -0
  13. package/app/assets/styles/index.css +28 -0
  14. package/app/assets/styles/utilities/animations.css +77 -0
  15. package/app/assets/styles/utilities/utilities.css +58 -0
  16. package/app/assets/styles/variables/borders.css +18 -0
  17. package/app/assets/styles/variables/colors.css +75 -0
  18. package/app/assets/styles/variables/components/alerts.css +13 -0
  19. package/app/assets/styles/variables/components/buttons.css +18 -0
  20. package/app/assets/styles/variables/components/cards.css +7 -0
  21. package/app/assets/styles/variables/components/dialogs.css +7 -0
  22. package/app/assets/styles/variables/components/forms.css +5 -0
  23. package/app/assets/styles/variables/components/images.css +5 -0
  24. package/app/assets/styles/variables/components/index.css +6 -0
  25. package/app/assets/styles/variables/effects.css +3 -0
  26. package/app/assets/styles/variables/fonts.css +36 -0
  27. package/app/assets/styles/variables/index.css +15 -0
  28. package/app/assets/styles/variables/layout.css +7 -0
  29. package/app/assets/styles/variables/sizes.css +24 -0
  30. package/app/assets/styles/variables/timing.css +5 -0
  31. package/app/assets/styles/variables/ui.css +18 -0
  32. package/app/assets/styles/variables/z-index.css +7 -0
  33. package/app/components/Actions.vue +57 -0
  34. package/app/components/Alert.vue +78 -0
  35. package/app/components/Button.vue +196 -0
  36. package/app/components/Card.vue +62 -0
  37. package/app/components/Dialog.client.vue +217 -0
  38. package/app/components/Form/Form.vue +27 -0
  39. package/app/components/Form/FormCheckbox.vue +88 -0
  40. package/app/components/Form/FormGroup.vue +36 -0
  41. package/app/components/Form/FormInputGroup.vue +55 -0
  42. package/app/components/Form/FormItem.vue +53 -0
  43. package/app/components/Form/FormLabel.vue +39 -0
  44. package/app/components/Form/FormRadioGroup.vue +109 -0
  45. package/app/components/Form/FormSelect.vue +155 -0
  46. package/app/components/HelloWorld.vue +10 -0
  47. package/app/components/Icon.vue +48 -0
  48. package/app/components/Loading.vue +58 -0
  49. package/app/components/Tag.vue +47 -0
  50. package/app/components/Tags.vue +13 -0
  51. package/app.config.ts +14 -0
  52. package/eslint.config.js +3 -0
  53. package/nuxt.config.ts +19 -0
  54. package/package.json +29 -0
  55. package/tsconfig.json +3 -0
@@ -0,0 +1,155 @@
1
+ <template>
2
+ <SelectRoot v-model="model" :multiple="multiple" :disabled="disabled" :name="name">
3
+ <SelectTrigger class="form-select-trigger">
4
+ <SelectValue :placeholder="placeholder" />
5
+ <SelectIcon class="form-select-icon">
6
+ <Icon type="chevron-down" />
7
+ </SelectIcon>
8
+ </SelectTrigger>
9
+
10
+ <SelectPortal>
11
+ <SelectContent position="popper" :side-offset="4" class="form-select-content">
12
+ <SelectViewport class="form-select-viewport">
13
+ <SelectItem
14
+ v-for="option in options"
15
+ :key="option[valueKey]"
16
+ :value="option[valueKey]"
17
+ class="form-select-item"
18
+ >
19
+ <SelectItemText>{{ option[labelKey] }}</SelectItemText>
20
+ <SelectItemIndicator class="form-select-indicator">
21
+ <Icon type="check" />
22
+ </SelectItemIndicator>
23
+ </SelectItem>
24
+ </SelectViewport>
25
+ </SelectContent>
26
+ </SelectPortal>
27
+ </SelectRoot>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ import {
32
+ SelectContent,
33
+ SelectIcon,
34
+ SelectItem,
35
+ SelectItemIndicator,
36
+ SelectItemText,
37
+ SelectPortal,
38
+ SelectRoot,
39
+ SelectTrigger,
40
+ SelectValue,
41
+ SelectViewport,
42
+ } from 'reka-ui'
43
+
44
+ const model = defineModel<string | string[]>()
45
+
46
+ defineProps({
47
+ options: {
48
+ type: Array as () => Record<string, any>[],
49
+ default: () => [],
50
+ },
51
+ placeholder: {
52
+ type: String,
53
+ default: 'Select...',
54
+ },
55
+ multiple: {
56
+ type: Boolean,
57
+ default: false,
58
+ },
59
+ disabled: {
60
+ type: Boolean,
61
+ default: false,
62
+ },
63
+ valueKey: {
64
+ type: String,
65
+ default: 'value',
66
+ },
67
+ labelKey: {
68
+ type: String,
69
+ default: 'label',
70
+ },
71
+ name: {
72
+ type: String,
73
+ default: undefined,
74
+ },
75
+ })
76
+ </script>
77
+
78
+ <style scoped>
79
+ .form-select-trigger {
80
+ border: none;
81
+ background: transparent;
82
+ padding: var(--ui-padding-block) var(--ui-padding-inline);
83
+ font-family: var(--ui-font-family);
84
+ font-size: var(--ui-font-size);
85
+ color: var(--color);
86
+ inline-size: 100%;
87
+ display: flex;
88
+ align-items: center;
89
+ justify-content: space-between;
90
+ gap: var(--size-2);
91
+ cursor: pointer;
92
+
93
+ &[data-placeholder] {
94
+ color: var(--muted);
95
+ }
96
+
97
+ &[data-disabled] {
98
+ cursor: not-allowed;
99
+ opacity: 0.5;
100
+ }
101
+ }
102
+
103
+ .form-select-icon {
104
+ color: var(--muted);
105
+ transition: transform var(--speed);
106
+
107
+ [data-state='open'] > & {
108
+ transform: rotate(180deg);
109
+ }
110
+ }
111
+
112
+ :global(.form-select-content) {
113
+ background: var(--background);
114
+ border: var(--border);
115
+ border-radius: var(--border-radius);
116
+ box-shadow: var(--shadow-lg);
117
+ z-index: var(--z-index-dropdown);
118
+ min-width: var(--reka-select-trigger-width);
119
+ max-height: var(--reka-select-content-available-height);
120
+ overflow: hidden;
121
+ }
122
+
123
+ :global(.form-select-viewport) {
124
+ padding: var(--size-1);
125
+ }
126
+
127
+ :global(.form-select-item) {
128
+ padding: var(--size-2) var(--size-3);
129
+ border-radius: calc(var(--border-radius) / 2);
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: space-between;
133
+ gap: var(--size-2);
134
+ cursor: pointer;
135
+ outline: none;
136
+ user-select: none;
137
+
138
+ &[data-highlighted] {
139
+ background: var(--button-background-highlight);
140
+ }
141
+
142
+ &[data-state='checked'] {
143
+ font-weight: 500;
144
+ }
145
+
146
+ &[data-disabled] {
147
+ opacity: 0.5;
148
+ cursor: not-allowed;
149
+ }
150
+ }
151
+
152
+ :global(.form-select-indicator) {
153
+ color: var(--accent);
154
+ }
155
+ </style>
@@ -0,0 +1,10 @@
1
+ <script setup lang="ts">
2
+ const { myLayer } = useAppConfig()
3
+ </script>
4
+
5
+ <template>
6
+ <div>
7
+ <h1>Hello World!</h1>
8
+ <pre>{{ myLayer }}</pre>
9
+ </div>
10
+ </template>
@@ -0,0 +1,48 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{ type: string }>()
3
+
4
+ const ICON_MAP: Record<string, string> = {
5
+ add: 'lucide:plus',
6
+ check: 'lucide:check',
7
+ 'chevron-down': 'lucide:chevron-down',
8
+ 'chevron-left': 'lucide:chevron-left',
9
+ 'chevron-right': 'lucide:chevron-right',
10
+ 'chevron-up': 'lucide:chevron-up',
11
+ close: 'lucide:x',
12
+ copy: 'lucide:copy',
13
+ code: 'lucide:code',
14
+ discord: 'simple-icons:discord',
15
+ edit: 'lucide:pencil',
16
+ email: 'lucide:mail',
17
+ folder: 'lucide:folder',
18
+ github: 'simple-icons:github',
19
+ home: 'lucide:home',
20
+ help: 'lucide:circle-question-mark',
21
+ image: 'lucide:image',
22
+ link: 'lucide:link',
23
+ loader: 'lucide:loader-2',
24
+ maximize: 'lucide:maximize',
25
+ times: 'lucide:x',
26
+ trash: 'lucide:trash-2',
27
+ twitter: 'simple-icons:x',
28
+ user: 'lucide:user',
29
+ website: 'lucide:globe',
30
+ withdraw: 'lucide:undo',
31
+ }
32
+
33
+ const iconName = computed(() => ICON_MAP[props.type] || props.type)
34
+ </script>
35
+
36
+ <template>
37
+ <NuxtIcon v-if="iconName" :name="iconName" class="icon" />
38
+ </template>
39
+
40
+ <style scoped>
41
+ .icon {
42
+ display: inline-flex;
43
+ width: 1em;
44
+ height: 1em;
45
+ align-items: center;
46
+ justify-content: center;
47
+ }
48
+ </style>
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <div class="loader">
3
+ <span v-if="spinner" class="spinner" aria-hidden="true"></span>
4
+ <span v-if="txt" class="text">{{ txt }}</span>
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ withDefaults(defineProps<{
10
+ txt?: string
11
+ spinner?: boolean
12
+ }>(), {
13
+ txt: 'Loading...',
14
+ spinner: false,
15
+ })
16
+ </script>
17
+
18
+ <style scoped>
19
+ .loader {
20
+ position: relative;
21
+ z-index: var(--z-index-ui);
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: center;
25
+ gap: var(--spacer-sm);
26
+
27
+ .spinner {
28
+ width: var(--size-3);
29
+ height: var(--size-3);
30
+ border: 2px solid var(--muted);
31
+ border-top-color: transparent;
32
+ border-radius: 50%;
33
+ animation: spin var(--speed-slow, 1s) linear infinite;
34
+ }
35
+
36
+ .text {
37
+ @mixin ui-font;
38
+ color: var(--muted);
39
+ }
40
+
41
+ &:not(.inline) {
42
+ text-align: center;
43
+ margin: calc(var(--size-6)) 0;
44
+ }
45
+
46
+ &.inline {
47
+ display: inline-flex;
48
+ gap: var(--size-1);
49
+ margin-left: var(--size-1);
50
+ }
51
+ }
52
+
53
+ @keyframes spin {
54
+ to {
55
+ transform: rotate(360deg);
56
+ }
57
+ }
58
+ </style>
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <span class="tag">
3
+ <span>
4
+ <slot />
5
+ </span>
6
+ <Button v-if="dismissable" @click="emit('dismiss')">
7
+ <Icon type="close" />
8
+ </Button>
9
+ </span>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ defineProps<{
14
+ dismissable?: boolean
15
+ }>()
16
+
17
+ const emit = defineEmits<{
18
+ dismiss: []
19
+ }>()
20
+ </script>
21
+
22
+ <style scoped>
23
+ .tag {
24
+ box-shadow: var(--border-shadow);
25
+ font-family: var(--ui-font-family);
26
+ font-size: var(--font-sm);
27
+ font-weight: var(--ui-font-weight);
28
+ text-transform: var(--ui-text-transform);
29
+ letter-spacing: var(--ui-letter-spacing);
30
+ line-height: var(--ui-line-height);
31
+ color: var(--ui-color);
32
+ display: flex;
33
+ align-items: center;
34
+
35
+ >span {
36
+ padding: var(--spacer-sm) var(--spacer);
37
+
38
+ +button {
39
+ padding: var(--spacer-sm);
40
+
41
+ &:is(:hover, :active, :focus, .active) {
42
+ background: var(--gray-z-1);
43
+ }
44
+ }
45
+ }
46
+ }
47
+ </style>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="tags">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <style scoped>
8
+ .tags {
9
+ display: flex;
10
+ flex-wrap: wrap;
11
+ gap: var(--spacer-sm);
12
+ }
13
+ </style>
package/app.config.ts ADDED
@@ -0,0 +1,14 @@
1
+ export default defineAppConfig({
2
+ myLayer: {
3
+ name: 'Hello from Nuxt layer'
4
+ }
5
+ })
6
+
7
+ declare module '@nuxt/schema' {
8
+ interface AppConfigInput {
9
+ myLayer?: {
10
+ /** Project name */
11
+ name?: string
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,3 @@
1
+ import withNuxt from './.playground/.nuxt/eslint.config.mjs'
2
+
3
+ export default withNuxt()
package/nuxt.config.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { fileURLToPath } from 'node:url'
2
+ import { dirname, join } from 'node:path'
3
+
4
+ const currentDir = dirname(fileURLToPath(import.meta.url))
5
+
6
+ // https://nuxt.com/docs/api/configuration/nuxt-config
7
+ export default defineNuxtConfig({
8
+ devtools: { enabled: true },
9
+
10
+ modules: ['@nuxt/icon'],
11
+
12
+ icon: {
13
+ componentName: 'NuxtIcon',
14
+ },
15
+
16
+ css: [
17
+ join(currentDir, './app/assets/styles/index.css'),
18
+ ],
19
+ })
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@1001-digital/layers.base",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "main": "./nuxt.config.ts",
6
+ "devDependencies": {
7
+ "@iconify-json/lucide": "^1.2.81",
8
+ "@iconify-json/simple-icons": "^1.2.63",
9
+ "@nuxt/eslint": "latest",
10
+ "@types/node": "^24.10.1",
11
+ "eslint": "^9.39.1",
12
+ "nuxt": "^4.2.2",
13
+ "typescript": "^5.9.3",
14
+ "vue": "latest"
15
+ },
16
+ "dependencies": {
17
+ "@nuxt/icon": "^1.10.3",
18
+ "modern-normalize": "^3.0.1",
19
+ "reka-ui": "^2.6.1"
20
+ },
21
+ "scripts": {
22
+ "dev": "nuxi dev .playground",
23
+ "dev:prepare": "nuxt prepare .playground",
24
+ "build": "nuxt build .playground",
25
+ "generate": "nuxt generate .playground",
26
+ "preview": "nuxt preview .playground",
27
+ "lint": "eslint ."
28
+ }
29
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "./.playground/.nuxt/tsconfig.json"
3
+ }