ropav 0.0.4 → 0.0.5
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/README.md +11 -2
- package/dist/base.css +15 -14
- package/dist/button.css +1 -1
- package/dist/button.js +2 -11
- package/dist/button.js.map +1 -1
- package/dist/card.css +88 -0
- package/dist/card.js +71 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.css +12 -1
- package/dist/components/card/card.d.ts +21 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +2 -0
- package/dist/components/card/types.d.ts +11 -0
- package/dist/components/field/field.d.ts +35 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/index.js +2 -0
- package/dist/components/field/types.d.ts +21 -0
- package/dist/components/icon-button/icon-button.d.ts +21 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +2 -0
- package/dist/components/icon-button/types.d.ts +15 -0
- package/dist/field.css +40 -0
- package/dist/field.js +128 -0
- package/dist/field.js.map +1 -0
- package/dist/icon-button.css +339 -0
- package/dist/icon-button.js +63 -0
- package/dist/icon-button.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -1
- package/dist/input.css +2 -2
- package/dist/loader-circle.js +14 -0
- package/dist/loader-circle.js.map +1 -0
- package/dist/select.css +13 -3
- package/dist/switch.css +10 -1
- package/dist/textarea.css +2 -2
- package/package.json +13 -1
- package/src/styles/_tokens.scss +14 -13
- package/src/styles/_variables.scss +2 -1
package/README.md
CHANGED
|
@@ -12,13 +12,22 @@ pnpm add ropav vue
|
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
14
|
import 'ropav/base.css';
|
|
15
|
-
import { Button, Input } from 'ropav';
|
|
15
|
+
import { Button, Card, Field, Input } from 'ropav';
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Deep imports are available for individual components:
|
|
19
19
|
|
|
20
20
|
```ts
|
|
21
|
-
import {
|
|
21
|
+
import { Card } from 'ropav/card';
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Field wrappers can pass accessible ids and state into form controls through slot
|
|
25
|
+
props:
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<Field id="email" label="Email" error="Enter a valid email" v-slot="{ controlProps }">
|
|
29
|
+
<Input v-bind="controlProps" v-model="email" />
|
|
30
|
+
</Field>
|
|
22
31
|
```
|
|
23
32
|
|
|
24
33
|
## Theming and tokens
|
package/dist/base.css
CHANGED
|
@@ -11,20 +11,20 @@
|
|
|
11
11
|
--rp-color-text-secondary: #646464;
|
|
12
12
|
--rp-color-text-disabled: #8d8d8d;
|
|
13
13
|
--rp-color-text-inverted: #ffffff;
|
|
14
|
-
--rp-color-background: #
|
|
15
|
-
--rp-color-surface: #
|
|
14
|
+
--rp-color-background: #f9f9f9;
|
|
15
|
+
--rp-color-surface: #fcfcfc;
|
|
16
16
|
--rp-color-surface-raised: #ffffff;
|
|
17
17
|
--rp-color-surface-muted: #f9f9f9;
|
|
18
18
|
--rp-color-surface-hover: #f0f0f0;
|
|
19
|
-
--rp-color-button-default-bg:
|
|
20
|
-
--rp-color-button-default-bg-hover:
|
|
19
|
+
--rp-color-button-default-bg: var(--rp-color-surface);
|
|
20
|
+
--rp-color-button-default-bg-hover: var(--rp-color-surface-hover);
|
|
21
21
|
--rp-color-button-default-bg-active: #e8e8e8;
|
|
22
22
|
--rp-color-surface-inverted: #202020;
|
|
23
23
|
--rp-color-overlay: rgba(17, 17, 17, 0.55);
|
|
24
24
|
--rp-color-border: #d9d9d9;
|
|
25
25
|
--rp-color-border-hover: #bbbbbb;
|
|
26
26
|
--rp-color-focus-ring: color-mix(in srgb, var(--rp-color-primary) 32%, transparent);
|
|
27
|
-
--rp-color-control-bg:
|
|
27
|
+
--rp-color-control-bg: var(--rp-color-surface);
|
|
28
28
|
--rp-color-control-readonly-bg: var(--rp-color-surface-muted);
|
|
29
29
|
--rp-color-control-fg: var(--rp-color-text);
|
|
30
30
|
--rp-color-control-placeholder: var(--rp-color-text-secondary);
|
|
@@ -126,6 +126,7 @@
|
|
|
126
126
|
--rp-spacing-10: 2.5rem;
|
|
127
127
|
--rp-spacing-12: 3rem;
|
|
128
128
|
--rp-radius-none: 0;
|
|
129
|
+
--rp-radius-xs: 0.25rem;
|
|
129
130
|
--rp-radius-sm: 0.375rem;
|
|
130
131
|
--rp-radius-md: 0.75rem;
|
|
131
132
|
--rp-radius-lg: 1rem;
|
|
@@ -151,20 +152,20 @@ html.dark {
|
|
|
151
152
|
--rp-color-text-secondary: #b4b4b4;
|
|
152
153
|
--rp-color-text-disabled: #6e6e6e;
|
|
153
154
|
--rp-color-text-inverted: #202020;
|
|
154
|
-
--rp-color-background: #
|
|
155
|
-
--rp-color-surface: #
|
|
156
|
-
--rp-color-surface-raised: #
|
|
157
|
-
--rp-color-surface-muted: #
|
|
158
|
-
--rp-color-surface-hover: #
|
|
159
|
-
--rp-color-button-default-bg:
|
|
160
|
-
--rp-color-button-default-bg-hover:
|
|
161
|
-
--rp-color-button-default-bg-active: #
|
|
155
|
+
--rp-color-background: #191919;
|
|
156
|
+
--rp-color-surface: #222222;
|
|
157
|
+
--rp-color-surface-raised: #2a2a2a;
|
|
158
|
+
--rp-color-surface-muted: #222222;
|
|
159
|
+
--rp-color-surface-hover: #2a2a2a;
|
|
160
|
+
--rp-color-button-default-bg: var(--rp-color-surface);
|
|
161
|
+
--rp-color-button-default-bg-hover: var(--rp-color-surface-hover);
|
|
162
|
+
--rp-color-button-default-bg-active: #313131;
|
|
162
163
|
--rp-color-surface-inverted: #f9f9f9;
|
|
163
164
|
--rp-color-overlay: rgba(17, 17, 17, 0.75);
|
|
164
165
|
--rp-color-border: #3a3a3a;
|
|
165
166
|
--rp-color-border-hover: #606060;
|
|
166
167
|
--rp-color-focus-ring: color-mix(in srgb, var(--rp-color-primary) 45%, transparent);
|
|
167
|
-
--rp-color-control-bg:
|
|
168
|
+
--rp-color-control-bg: var(--rp-color-surface);
|
|
168
169
|
--rp-color-control-readonly-bg: var(--rp-color-surface-muted);
|
|
169
170
|
--rp-color-control-fg: #eeeeee;
|
|
170
171
|
--rp-color-control-placeholder: #6e6e6e;
|
package/dist/button.css
CHANGED
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
--_rp-button-font-size: var(--rp-font-size-lg);
|
|
197
197
|
}
|
|
198
198
|
.rp-button--radius-xs[data-v-b8d57358] {
|
|
199
|
-
--_rp-button-radius: var(--rp-radius-
|
|
199
|
+
--_rp-button-radius: var(--rp-radius-xs);
|
|
200
200
|
}
|
|
201
201
|
.rp-button--radius-sm[data-v-b8d57358] {
|
|
202
202
|
--_rp-button-radius: var(--rp-radius-sm);
|
package/dist/button.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import './button.css';
|
|
2
|
+
import { t as loader_circle_default } from "./loader-circle.js";
|
|
2
3
|
import { n as bem, t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
3
|
-
import { child, computed, createComponent, createIf, createSlot, defineVaporComponent,
|
|
4
|
-
//#region ~icons/lucide/loader-circle
|
|
5
|
-
var t0$1 = template("<svg viewBox=\"0 0 24 24\"width=1.2em height=1.2em><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d=\"M21 12a9 9 0 1 1-6.219-8.56\">", 3, 1);
|
|
6
|
-
function render(_ctx) {
|
|
7
|
-
return t0$1();
|
|
8
|
-
}
|
|
9
|
-
var loader_circle_default = markRaw(defineVaporComponent({
|
|
10
|
-
name: "lucide-loader-circle",
|
|
11
|
-
render
|
|
12
|
-
}));
|
|
13
|
-
//#endregion
|
|
4
|
+
import { child, computed, createComponent, createIf, createSlot, defineVaporComponent, renderEffect, setClass, setInsertionState, setProp, template, unref } from "vue";
|
|
14
5
|
//#region src/components/button/button.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
15
6
|
var t0 = template("<span data-v-b8d57358 class=rp-button__left>");
|
|
16
7
|
var t1 = template("<span data-v-b8d57358 class=rp-button__right>");
|
package/dist/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../src/components/button/button.vue","../src/components/button/button.vue"],"sourcesContent":["<template>\n <button :class=\"rootClass\" :disabled=\"disabled || isLoading || undefined\" :type=\"type\">\n <IconLoaderCircle v-if=\"isLoading\" class=\"rp-button__spinner\" aria-hidden=\"true\" />\n <span v-if=\"$slots.left && !isLoading\" class=\"rp-button__left\">\n <slot name=\"left\" />\n </span>\n <span class=\"rp-button__label\">\n <slot />\n </span>\n <span v-if=\"$slots.right\" class=\"rp-button__right\">\n <slot name=\"right\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup vapor>\nimport { computed } from 'vue';\nimport IconLoaderCircle from '~icons/lucide/loader-circle';\nimport { bem } from '@/utils/bem';\nimport type { ButtonProps } from './types';\n\ndefineOptions({ name: 'RpButton' });\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n type: 'button',\n disabled: false,\n loading: false,\n});\n\nconst isLoading = computed(() => props.loading && !props.disabled);\n\nconst rootClass = computed(() =>\n bem('rp-button', {\n [props.variant ?? '']: Boolean(props.variant),\n [`color-${props.color}`]: Boolean(props.color),\n [`size-${props.size}`]: Boolean(props.size),\n [`radius-${props.radius}`]: Boolean(props.radius),\n }),\n);\n</script>\n\n<style src=\"./button.scss\" lang=\"scss\" scoped></style>\n","<template>\n <button :class=\"rootClass\" :disabled=\"disabled || isLoading || undefined\" :type=\"type\">\n <IconLoaderCircle v-if=\"isLoading\" class=\"rp-button__spinner\" aria-hidden=\"true\" />\n <span v-if=\"$slots.left && !isLoading\" class=\"rp-button__left\">\n <slot name=\"left\" />\n </span>\n <span class=\"rp-button__label\">\n <slot />\n </span>\n <span v-if=\"$slots.right\" class=\"rp-button__right\">\n <slot name=\"right\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup vapor>\nimport { computed } from 'vue';\nimport IconLoaderCircle from '~icons/lucide/loader-circle';\nimport { bem } from '@/utils/bem';\nimport type { ButtonProps } from './types';\n\ndefineOptions({ name: 'RpButton' });\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n type: 'button',\n disabled: false,\n loading: false,\n});\n\nconst isLoading = computed(() => props.loading && !props.disabled);\n\nconst rootClass = computed(() =>\n bem('rp-button', {\n [props.variant ?? '']: Boolean(props.variant),\n [`color-${props.color}`]: Boolean(props.color),\n [`size-${props.size}`]: Boolean(props.size),\n [`radius-${props.radius}`]: Boolean(props.radius),\n }),\n);\n</script>\n\n<style src=\"./button.scss\" lang=\"scss\" scoped></style>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../src/components/button/button.vue","../src/components/button/button.vue"],"sourcesContent":["<template>\n <button :class=\"rootClass\" :disabled=\"disabled || isLoading || undefined\" :type=\"type\">\n <IconLoaderCircle v-if=\"isLoading\" class=\"rp-button__spinner\" aria-hidden=\"true\" />\n <span v-if=\"$slots.left && !isLoading\" class=\"rp-button__left\">\n <slot name=\"left\" />\n </span>\n <span class=\"rp-button__label\">\n <slot />\n </span>\n <span v-if=\"$slots.right\" class=\"rp-button__right\">\n <slot name=\"right\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup vapor>\nimport { computed } from 'vue';\nimport IconLoaderCircle from '~icons/lucide/loader-circle';\nimport { bem } from '@/utils/bem';\nimport type { ButtonProps } from './types';\n\ndefineOptions({ name: 'RpButton' });\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n type: 'button',\n disabled: false,\n loading: false,\n});\n\nconst isLoading = computed(() => props.loading && !props.disabled);\n\nconst rootClass = computed(() =>\n bem('rp-button', {\n [props.variant ?? '']: Boolean(props.variant),\n [`color-${props.color}`]: Boolean(props.color),\n [`size-${props.size}`]: Boolean(props.size),\n [`radius-${props.radius}`]: Boolean(props.radius),\n }),\n);\n</script>\n\n<style src=\"./button.scss\" lang=\"scss\" scoped></style>\n","<template>\n <button :class=\"rootClass\" :disabled=\"disabled || isLoading || undefined\" :type=\"type\">\n <IconLoaderCircle v-if=\"isLoading\" class=\"rp-button__spinner\" aria-hidden=\"true\" />\n <span v-if=\"$slots.left && !isLoading\" class=\"rp-button__left\">\n <slot name=\"left\" />\n </span>\n <span class=\"rp-button__label\">\n <slot />\n </span>\n <span v-if=\"$slots.right\" class=\"rp-button__right\">\n <slot name=\"right\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup vapor>\nimport { computed } from 'vue';\nimport IconLoaderCircle from '~icons/lucide/loader-circle';\nimport { bem } from '@/utils/bem';\nimport type { ButtonProps } from './types';\n\ndefineOptions({ name: 'RpButton' });\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n type: 'button',\n disabled: false,\n loading: false,\n});\n\nconst isLoading = computed(() => props.loading && !props.disabled);\n\nconst rootClass = computed(() =>\n bem('rp-button', {\n [props.variant ?? '']: Boolean(props.variant),\n [`color-${props.color}`]: Boolean(props.color),\n [`size-${props.size}`]: Boolean(props.size),\n [`radius-${props.radius}`]: Boolean(props.radius),\n }),\n);\n</script>\n\n<style src=\"./button.scss\" lang=\"scss\" scoped></style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,QAAQ;EAMd,MAAM,YAAY,eAAe,MAAM,WAAW,CAAC,MAAM,QAAQ;EAEjE,MAAM,YAAY,eACd,IAAI,aAAa;IACZ,MAAM,WAAW,KAAK,QAAQ,MAAM,OAAO;IAC3C,SAAS,MAAM,UAAU,QAAQ,MAAM,KAAK;IAC5C,QAAQ,MAAM,SAAS,QAAQ,MAAM,IAAI;IACzC,UAAU,MAAM,WAAW,QAAQ,MAAM,MAAM;EACpD,CAAC,CACL;;;;iBArCoB,UAAA,KAAS;gBAAG,YAAU,QAAA,YAAY,UAAA,SAAa,KAAA,CAAS;gBAAG,QAAM,QAAA,IAAI;;;iBACzD,UAAA,aAAS;;IAAE,OAAM;IAAqB,eAAY;;;;iBAC9D,OAAM,QAAA,CAAU,UAAA,aAAS;;;cAC3B,QAAW,MAAA,MAAA,CAAA;;;;;;iBAKT,OAAM,aAAA;;;cACR,SAAY,MAAA,MAAA,CAAA"}
|
package/dist/card.css
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
.rp-card[data-v-c3ae62b7] {
|
|
2
|
+
--_rp-card-bg: var(--rp-color-surface-raised);
|
|
3
|
+
--_rp-card-border: var(--rp-color-border);
|
|
4
|
+
--_rp-card-fg: var(--rp-color-text);
|
|
5
|
+
--_rp-card-padding: var(--rp-spacing-5);
|
|
6
|
+
--_rp-card-radius: var(--rp-radius-sm);
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
min-width: 0;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
font-family: var(--rp-font-family);
|
|
13
|
+
color: var(--_rp-card-fg);
|
|
14
|
+
background-color: var(--_rp-card-bg);
|
|
15
|
+
border: var(--rp-border-width-thin) solid var(--_rp-card-border);
|
|
16
|
+
border-radius: var(--_rp-card-radius);
|
|
17
|
+
transition: background-color var(--rp-transition-fast), border-color var(--rp-transition-fast);
|
|
18
|
+
}
|
|
19
|
+
.rp-card--layer-base[data-v-c3ae62b7] {
|
|
20
|
+
--_rp-card-bg: var(--rp-color-background);
|
|
21
|
+
}
|
|
22
|
+
.rp-card--layer-surface[data-v-c3ae62b7] {
|
|
23
|
+
--_rp-card-bg: var(--rp-color-surface);
|
|
24
|
+
}
|
|
25
|
+
.rp-card--layer-raised[data-v-c3ae62b7] {
|
|
26
|
+
--_rp-card-bg: var(--rp-color-surface-raised);
|
|
27
|
+
}
|
|
28
|
+
.rp-card--borderless[data-v-c3ae62b7] {
|
|
29
|
+
--_rp-card-border: transparent;
|
|
30
|
+
}
|
|
31
|
+
.rp-card--padding-none[data-v-c3ae62b7] {
|
|
32
|
+
--_rp-card-padding: var(--rp-spacing-0);
|
|
33
|
+
}
|
|
34
|
+
.rp-card--padding-sm[data-v-c3ae62b7] {
|
|
35
|
+
--_rp-card-padding: var(--rp-spacing-3);
|
|
36
|
+
}
|
|
37
|
+
.rp-card--padding-md[data-v-c3ae62b7] {
|
|
38
|
+
--_rp-card-padding: var(--rp-spacing-5);
|
|
39
|
+
}
|
|
40
|
+
.rp-card--padding-lg[data-v-c3ae62b7] {
|
|
41
|
+
--_rp-card-padding: var(--rp-spacing-6);
|
|
42
|
+
}
|
|
43
|
+
.rp-card--radius-none[data-v-c3ae62b7] {
|
|
44
|
+
--_rp-card-radius: var(--rp-radius-none);
|
|
45
|
+
}
|
|
46
|
+
.rp-card--radius-xs[data-v-c3ae62b7] {
|
|
47
|
+
--_rp-card-radius: var(--rp-radius-xs);
|
|
48
|
+
}
|
|
49
|
+
.rp-card--radius-sm[data-v-c3ae62b7] {
|
|
50
|
+
--_rp-card-radius: var(--rp-radius-sm);
|
|
51
|
+
}
|
|
52
|
+
.rp-card--radius-md[data-v-c3ae62b7] {
|
|
53
|
+
--_rp-card-radius: var(--rp-radius-md);
|
|
54
|
+
}
|
|
55
|
+
.rp-card--radius-lg[data-v-c3ae62b7] {
|
|
56
|
+
--_rp-card-radius: var(--rp-radius-lg);
|
|
57
|
+
}
|
|
58
|
+
.rp-card--radius-xl[data-v-c3ae62b7] {
|
|
59
|
+
--_rp-card-radius: var(--rp-radius-xl);
|
|
60
|
+
}
|
|
61
|
+
.rp-card__header[data-v-c3ae62b7], .rp-card__body[data-v-c3ae62b7] {
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
padding: var(--_rp-card-padding);
|
|
64
|
+
}
|
|
65
|
+
.rp-card__header[data-v-c3ae62b7] {
|
|
66
|
+
display: grid;
|
|
67
|
+
gap: var(--rp-spacing-1);
|
|
68
|
+
}
|
|
69
|
+
.rp-card__body[data-v-c3ae62b7] {
|
|
70
|
+
flex: 1 1 auto;
|
|
71
|
+
min-width: 0;
|
|
72
|
+
color: var(--rp-color-text);
|
|
73
|
+
font-size: var(--rp-font-size-base);
|
|
74
|
+
line-height: var(--rp-line-height-normal);
|
|
75
|
+
}
|
|
76
|
+
.rp-card__title[data-v-c3ae62b7] {
|
|
77
|
+
margin: 0;
|
|
78
|
+
color: var(--rp-color-text);
|
|
79
|
+
font-size: var(--rp-font-size-lg);
|
|
80
|
+
font-weight: var(--rp-font-weight-semibold);
|
|
81
|
+
line-height: var(--rp-line-height-tight);
|
|
82
|
+
}
|
|
83
|
+
.rp-card__description[data-v-c3ae62b7] {
|
|
84
|
+
margin: 0;
|
|
85
|
+
color: var(--rp-color-text-secondary);
|
|
86
|
+
font-size: var(--rp-font-size-sm);
|
|
87
|
+
line-height: var(--rp-line-height-normal);
|
|
88
|
+
}
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import './card.css';
|
|
2
|
+
import { n as bem, t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
3
|
+
import { computed, createIf, createSlot, defineVaporComponent, renderEffect, setClass, setInsertionState, setText, template, toDisplayString, txt } from "vue";
|
|
4
|
+
//#region src/components/card/card.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
5
|
+
var t0 = template("<div data-v-c3ae62b7 class=rp-card__title> ");
|
|
6
|
+
var t1 = template("<p data-v-c3ae62b7 class=rp-card__description> ");
|
|
7
|
+
var t2 = template("<div data-v-c3ae62b7 class=rp-card__header>");
|
|
8
|
+
var t3 = template("<div data-v-c3ae62b7 class=rp-card__body>");
|
|
9
|
+
var t4 = template("<div data-v-c3ae62b7>", 1);
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/card/card.vue
|
|
12
|
+
var card_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
13
|
+
name: "RpCard",
|
|
14
|
+
__name: "card",
|
|
15
|
+
props: {
|
|
16
|
+
layer: {},
|
|
17
|
+
padding: {},
|
|
18
|
+
radius: {},
|
|
19
|
+
border: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true
|
|
22
|
+
},
|
|
23
|
+
title: { default: "" },
|
|
24
|
+
description: { default: "" }
|
|
25
|
+
},
|
|
26
|
+
setup(__props, { slots: $slots }) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const hasTitle = computed(() => Boolean(props.title));
|
|
29
|
+
const hasDescription = computed(() => Boolean(props.description));
|
|
30
|
+
const hasHeader = computed(() => Boolean(hasTitle.value || hasDescription.value));
|
|
31
|
+
const rootClass = computed(() => bem("rp-card", {
|
|
32
|
+
[`layer-${props.layer}`]: Boolean(props.layer),
|
|
33
|
+
[`padding-${props.padding}`]: Boolean(props.padding),
|
|
34
|
+
[`radius-${props.radius}`]: Boolean(props.radius),
|
|
35
|
+
borderless: !props.border
|
|
36
|
+
}));
|
|
37
|
+
const n13 = t4();
|
|
38
|
+
renderEffect(() => setClass(n13, rootClass.value));
|
|
39
|
+
setInsertionState(n13, null, 0);
|
|
40
|
+
createIf(() => hasHeader.value, () => {
|
|
41
|
+
const n8 = t2();
|
|
42
|
+
setInsertionState(n8, null, 0);
|
|
43
|
+
createIf(() => hasTitle.value, () => {
|
|
44
|
+
const n4 = t0();
|
|
45
|
+
const x4 = txt(n4);
|
|
46
|
+
renderEffect(() => setText(x4, toDisplayString(__props.title)));
|
|
47
|
+
return n4;
|
|
48
|
+
});
|
|
49
|
+
setInsertionState(n8, null, 1);
|
|
50
|
+
createIf(() => hasDescription.value, () => {
|
|
51
|
+
const n7 = t1();
|
|
52
|
+
const x7 = txt(n7);
|
|
53
|
+
renderEffect(() => setText(x7, toDisplayString(__props.description)));
|
|
54
|
+
return n7;
|
|
55
|
+
});
|
|
56
|
+
return n8;
|
|
57
|
+
});
|
|
58
|
+
setInsertionState(n13, null, 1);
|
|
59
|
+
createIf(() => $slots.default, () => {
|
|
60
|
+
const n12 = t3();
|
|
61
|
+
setInsertionState(n12, null, 0);
|
|
62
|
+
createSlot("default", null, null, 1);
|
|
63
|
+
return n12;
|
|
64
|
+
});
|
|
65
|
+
return n13;
|
|
66
|
+
}
|
|
67
|
+
}), [["__scopeId", "data-v-c3ae62b7"]]);
|
|
68
|
+
//#endregion
|
|
69
|
+
export { card_default as t };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=card.js.map
|
package/dist/card.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../src/components/card/card.vue","../src/components/card/card.vue"],"sourcesContent":["<template>\n <div :class=\"rootClass\">\n <div v-if=\"hasHeader\" class=\"rp-card__header\">\n <div v-if=\"hasTitle\" class=\"rp-card__title\">\n {{ title }}\n </div>\n <p v-if=\"hasDescription\" class=\"rp-card__description\">\n {{ description }}\n </p>\n </div>\n\n <div v-if=\"$slots.default\" class=\"rp-card__body\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup vapor>\nimport { computed } from 'vue';\nimport { bem } from '@/utils/bem';\nimport type { CardProps } from './types';\n\ndefineOptions({ name: 'RpCard' });\n\nconst props = withDefaults(defineProps<CardProps>(), {\n border: true,\n title: '',\n description: '',\n});\n\nconst hasTitle = computed(() => Boolean(props.title));\nconst hasDescription = computed(() => Boolean(props.description));\nconst hasHeader = computed(() => Boolean(hasTitle.value || hasDescription.value));\n\nconst rootClass = computed(() =>\n bem('rp-card', {\n [`layer-${props.layer}`]: Boolean(props.layer),\n [`padding-${props.padding}`]: Boolean(props.padding),\n [`radius-${props.radius}`]: Boolean(props.radius),\n borderless: !props.border,\n }),\n);\n</script>\n\n<style src=\"./card.scss\" lang=\"scss\" scoped></style>\n","<template>\n <div :class=\"rootClass\">\n <div v-if=\"hasHeader\" class=\"rp-card__header\">\n <div v-if=\"hasTitle\" class=\"rp-card__title\">\n {{ title }}\n </div>\n <p v-if=\"hasDescription\" class=\"rp-card__description\">\n {{ description }}\n </p>\n </div>\n\n <div v-if=\"$slots.default\" class=\"rp-card__body\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup vapor>\nimport { computed } from 'vue';\nimport { bem } from '@/utils/bem';\nimport type { CardProps } from './types';\n\ndefineOptions({ name: 'RpCard' });\n\nconst props = withDefaults(defineProps<CardProps>(), {\n border: true,\n title: '',\n description: '',\n});\n\nconst hasTitle = computed(() => Boolean(props.title));\nconst hasDescription = computed(() => Boolean(props.description));\nconst hasHeader = computed(() => Boolean(hasTitle.value || hasDescription.value));\n\nconst rootClass = computed(() =>\n bem('rp-card', {\n [`layer-${props.layer}`]: Boolean(props.layer),\n [`padding-${props.padding}`]: Boolean(props.padding),\n [`radius-${props.radius}`]: Boolean(props.radius),\n borderless: !props.border,\n }),\n);\n</script>\n\n<style src=\"./card.scss\" lang=\"scss\" scoped></style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,QAAQ;EAMd,MAAM,WAAW,eAAe,QAAQ,MAAM,KAAK,CAAC;EACpD,MAAM,iBAAiB,eAAe,QAAQ,MAAM,WAAW,CAAC;EAChE,MAAM,YAAY,eAAe,QAAQ,SAAS,SAAS,eAAe,KAAK,CAAC;EAEhF,MAAM,YAAY,eACd,IAAI,WAAW;IACV,SAAS,MAAM,UAAU,QAAQ,MAAM,KAAK;IAC5C,WAAW,MAAM,YAAY,QAAQ,MAAM,OAAO;IAClD,UAAU,MAAM,WAAW,QAAQ,MAAM,MAAM;GAChD,YAAY,CAAC,MAAM;EACvB,CAAC,CACL;;mCAxCiB,UAAA,KAAS,CAAA;;iBACP,UAAA,aAAS;;;kBACL,SAAA,aAAQ;;;mDACZ,QAAA,KAAK,CAAA,CAAA;;;;kBAEH,eAAA,aAAc;;;mDAChB,QAAA,WAAW,CAAA,CAAA;;;;;;iBAIX,OAAM,eAAA"}
|
package/dist/checkbox.css
CHANGED
|
@@ -8,11 +8,18 @@
|
|
|
8
8
|
--_checkbox-checked-bg: var(--_checkbox-color);
|
|
9
9
|
--_checkbox-checked-border: var(--_checkbox-color);
|
|
10
10
|
--_checkbox-checked-icon: var(--_checkbox-on-color);
|
|
11
|
+
--_checkbox-invalid-border: var(--rp-color-danger);
|
|
12
|
+
--_checkbox-invalid-ring: color-mix(in srgb, var(--rp-color-danger) 32%, transparent);
|
|
11
13
|
display: inline-flex;
|
|
12
14
|
align-items: center;
|
|
13
15
|
cursor: pointer;
|
|
14
16
|
font-family: var(--rp-font-family);
|
|
15
17
|
user-select: none;
|
|
18
|
+
vertical-align: top;
|
|
19
|
+
}
|
|
20
|
+
html.dark .rp-checkbox[data-v-7333dac7] {
|
|
21
|
+
--_checkbox-invalid-border: var(--rp-color-danger-fg);
|
|
22
|
+
--_checkbox-invalid-ring: color-mix(in srgb, var(--rp-color-danger-fg) 32%, transparent);
|
|
16
23
|
}
|
|
17
24
|
.rp-checkbox--disabled[data-v-7333dac7] {
|
|
18
25
|
opacity: var(--rp-opacity-disabled);
|
|
@@ -55,7 +62,11 @@
|
|
|
55
62
|
border-color: var(--_checkbox-checked-border);
|
|
56
63
|
}
|
|
57
64
|
.rp-checkbox--invalid .rp-checkbox__box[data-v-7333dac7] {
|
|
58
|
-
border-color: var(--
|
|
65
|
+
border-color: var(--_checkbox-invalid-border);
|
|
66
|
+
}
|
|
67
|
+
.rp-checkbox--invalid .rp-checkbox__native:focus-visible + .rp-checkbox__box[data-v-7333dac7] {
|
|
68
|
+
border-color: var(--_checkbox-invalid-border);
|
|
69
|
+
box-shadow: 0 0 0 var(--rp-border-width-medium) var(--_checkbox-invalid-ring);
|
|
59
70
|
}
|
|
60
71
|
.rp-checkbox__icon[data-v-7333dac7] {
|
|
61
72
|
width: var(--_checkbox-icon-size);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CardProps } from './types';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<CardProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
default?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
emit: {};
|
|
12
|
+
}>) => import('vue').VNode & {
|
|
13
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
18
|
+
[K in keyof T]: T[K];
|
|
19
|
+
} : {
|
|
20
|
+
[K in keyof T as K]: T[K];
|
|
21
|
+
}) & {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type CardPadding = 'none' | 'sm' | 'md' | 'lg';
|
|
2
|
+
export type CardRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type CardLayer = 'base' | 'surface' | 'raised';
|
|
4
|
+
export interface CardProps {
|
|
5
|
+
layer?: CardLayer;
|
|
6
|
+
padding?: CardPadding;
|
|
7
|
+
radius?: CardRadius;
|
|
8
|
+
border?: boolean;
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FieldControlProps, FieldProps } from './types';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<FieldProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
label?: (props: {}) => any;
|
|
10
|
+
} & {
|
|
11
|
+
default?: (props: {
|
|
12
|
+
id: string;
|
|
13
|
+
disabled: true | undefined;
|
|
14
|
+
required: true | undefined;
|
|
15
|
+
invalid: true | undefined;
|
|
16
|
+
labelledby: string | undefined;
|
|
17
|
+
describedby: string | undefined;
|
|
18
|
+
controlProps: FieldControlProps;
|
|
19
|
+
}) => any;
|
|
20
|
+
} & {
|
|
21
|
+
description?: (props: {}) => any;
|
|
22
|
+
} & {
|
|
23
|
+
message?: (props: {}) => any;
|
|
24
|
+
};
|
|
25
|
+
emit: {};
|
|
26
|
+
}>) => import('vue').VNode & {
|
|
27
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
28
|
+
};
|
|
29
|
+
declare const _default: typeof __VLS_export;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
32
|
+
[K in keyof T]: T[K];
|
|
33
|
+
} : {
|
|
34
|
+
[K in keyof T as K]: T[K];
|
|
35
|
+
}) & {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface FieldControlProps {
|
|
2
|
+
id: string;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
invalid?: boolean;
|
|
6
|
+
labelledby?: string;
|
|
7
|
+
describedby?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FieldSlotProps extends FieldControlProps {
|
|
10
|
+
controlProps: FieldControlProps;
|
|
11
|
+
}
|
|
12
|
+
export interface FieldProps {
|
|
13
|
+
id?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
message?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IconButtonProps } from './types';
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<IconButtonProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
default?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
emit: {};
|
|
12
|
+
}>) => import('vue').VNode & {
|
|
13
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
18
|
+
[K in keyof T]: T[K];
|
|
19
|
+
} : {
|
|
20
|
+
[K in keyof T as K]: T[K];
|
|
21
|
+
}) & {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ButtonColor, ButtonRadius, ButtonSize, ButtonVariant } from '../button/types';
|
|
2
|
+
export type IconButtonColor = ButtonColor;
|
|
3
|
+
export type IconButtonSize = ButtonSize;
|
|
4
|
+
export type IconButtonRadius = ButtonRadius;
|
|
5
|
+
export type IconButtonVariant = ButtonVariant;
|
|
6
|
+
export interface IconButtonProps {
|
|
7
|
+
ariaLabel: string;
|
|
8
|
+
variant?: IconButtonVariant;
|
|
9
|
+
color?: IconButtonColor;
|
|
10
|
+
size?: IconButtonSize;
|
|
11
|
+
radius?: IconButtonRadius;
|
|
12
|
+
type?: 'button' | 'submit' | 'reset';
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
}
|
package/dist/field.css
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.rp-field[data-v-b8c3dcbe] {
|
|
2
|
+
--_rp-field-danger: var(--rp-color-danger);
|
|
3
|
+
display: grid;
|
|
4
|
+
gap: var(--rp-spacing-1);
|
|
5
|
+
min-width: 0;
|
|
6
|
+
font-family: var(--rp-font-family);
|
|
7
|
+
color: var(--rp-color-text);
|
|
8
|
+
}
|
|
9
|
+
html.dark .rp-field[data-v-b8c3dcbe] {
|
|
10
|
+
--_rp-field-danger: var(--rp-color-danger-fg);
|
|
11
|
+
}
|
|
12
|
+
.rp-field__label[data-v-b8c3dcbe] {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
width: fit-content;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: var(--rp-spacing-1);
|
|
17
|
+
color: var(--rp-color-text);
|
|
18
|
+
font-size: var(--rp-font-size-sm);
|
|
19
|
+
font-weight: var(--rp-font-weight-medium);
|
|
20
|
+
line-height: var(--rp-line-height-normal);
|
|
21
|
+
}
|
|
22
|
+
.rp-field__required[data-v-b8c3dcbe] {
|
|
23
|
+
color: var(--_rp-field-danger);
|
|
24
|
+
line-height: var(--rp-line-height-none);
|
|
25
|
+
}
|
|
26
|
+
.rp-field__control[data-v-b8c3dcbe] {
|
|
27
|
+
min-width: 0;
|
|
28
|
+
}
|
|
29
|
+
.rp-field__description[data-v-b8c3dcbe], .rp-field__message[data-v-b8c3dcbe] {
|
|
30
|
+
margin: 0;
|
|
31
|
+
color: var(--rp-color-text-secondary);
|
|
32
|
+
font-size: var(--rp-font-size-sm);
|
|
33
|
+
line-height: var(--rp-line-height-normal);
|
|
34
|
+
}
|
|
35
|
+
.rp-field--invalid .rp-field__message[data-v-b8c3dcbe] {
|
|
36
|
+
color: var(--_rp-field-danger);
|
|
37
|
+
}
|
|
38
|
+
.rp-field--disabled .rp-field__label[data-v-b8c3dcbe], .rp-field--disabled .rp-field__description[data-v-b8c3dcbe], .rp-field--disabled .rp-field__message[data-v-b8c3dcbe] {
|
|
39
|
+
color: var(--rp-color-text-disabled);
|
|
40
|
+
}
|