ropav 0.7.0 → 0.8.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/components/badge/badge-auto-label.d.ts +2 -14
- package/dist/components/badge/badge-auto-label.js +3 -16
- package/dist/components/badge/badge.types.d.ts +4 -4
- package/dist/components/chip/chip-auto-label.d.ts +3 -19
- package/dist/components/chip/chip-auto-label.js +4 -21
- package/dist/components/chip/chip.types.d.ts +2 -2
- package/dist/components/icons/icon-overlay-arrow.js +1 -1
- package/dist/components/meter/meter.types.d.ts +2 -0
- package/dist/components/progress-bar/progress-bar.types.d.ts +2 -0
- package/dist/components/progress-circle/progress-circle.types.d.ts +2 -0
- package/dist/composables/use-color-field.js +1 -1
- package/dist/ropav.min.css +2 -0
- package/dist/utils/auto-label.d.ts +24 -0
- package/dist/utils/auto-label.js +48 -0
- package/dist/utils/block.js +11 -1
- package/dist/version.js +1 -1
- package/package.json +6 -3
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* handling without executing the default slot more than once.
|
|
4
|
-
*
|
|
5
|
-
* The slot has already rendered by the time it returns its block. Inspecting that block therefore
|
|
6
|
-
* preserves its effects and lets the exact same text nodes move into the label component.
|
|
7
|
-
* A slot forwarded from a VDOM host is filled only when inserted, so it cannot be inspected here;
|
|
8
|
-
* those callers (including runtime-compiled stories) must render `BadgeLabel` explicitly.
|
|
9
|
-
*/
|
|
10
|
-
declare const BadgeAutoLabel: import("vue").DefineVaporSetupFnComponent<Record<string, any>, {}, {
|
|
11
|
-
[x: string]: import("vue").VaporSlot;
|
|
12
|
-
}, Record<string, any>, import("vue").DynamicFragment | Node | import("vue").VaporComponentInstance<{}, {}, {
|
|
13
|
-
[x: string]: import("vue").VaporSlot;
|
|
14
|
-
}, Record<string, any>, import("vue").Block, Record<string, any>> | import("vue").VaporFragment<import("vue").Block>, Record<string, any> & {} & import("vue").ReservedProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps>;
|
|
1
|
+
/** Wraps a badge's bare text in `BadgeLabel`. */
|
|
2
|
+
declare const BadgeAutoLabel: import("vue").Component;
|
|
15
3
|
export default BadgeAutoLabel;
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import badge_label_default from "./badge-label.js";
|
|
2
|
-
import {
|
|
3
|
-
import { createComponent, defineVaporComponent } from "vue";
|
|
2
|
+
import { createAutoLabel } from "../../utils/auto-label.js";
|
|
4
3
|
//#region src/components/badge/badge-auto-label.ts
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
* handling without executing the default slot more than once.
|
|
8
|
-
*
|
|
9
|
-
* The slot has already rendered by the time it returns its block. Inspecting that block therefore
|
|
10
|
-
* preserves its effects and lets the exact same text nodes move into the label component.
|
|
11
|
-
* A slot forwarded from a VDOM host is filled only when inserted, so it cannot be inspected here;
|
|
12
|
-
* those callers (including runtime-compiled stories) must render `BadgeLabel` explicitly.
|
|
13
|
-
*/
|
|
14
|
-
var BadgeAutoLabel = defineVaporComponent((_props, { slots }) => {
|
|
15
|
-
const block = slots["default"]?.();
|
|
16
|
-
if (block === void 0 || !isTextOnlyBlock(flattenBlock(block))) return block ?? [];
|
|
17
|
-
return createComponent(badge_label_default, null, { default: () => block });
|
|
18
|
-
}, { name: "Ropav.Badge.AutoLabel" });
|
|
4
|
+
/** Wraps a badge's bare text in `BadgeLabel`. */
|
|
5
|
+
var BadgeAutoLabel = createAutoLabel(badge_label_default, "Ropav.Badge.AutoLabel");
|
|
19
6
|
//#endregion
|
|
20
7
|
export { BadgeAutoLabel as default };
|
|
@@ -4,13 +4,13 @@ export interface BadgeAnchorProps {
|
|
|
4
4
|
}
|
|
5
5
|
export interface BadgeRootProps {
|
|
6
6
|
class?: string;
|
|
7
|
-
/** Badge color. */
|
|
7
|
+
/** Badge color. @default "default" */
|
|
8
8
|
color?: BadgeVariants["color"];
|
|
9
|
-
/** Badge placement. */
|
|
9
|
+
/** Badge placement. @default "top-right" */
|
|
10
10
|
placement?: BadgeVariants["placement"];
|
|
11
|
-
/** Badge size. */
|
|
11
|
+
/** Badge size. @default "md" */
|
|
12
12
|
size?: BadgeVariants["size"];
|
|
13
|
-
/** Badge variant. */
|
|
13
|
+
/** Badge variant. @default "primary" */
|
|
14
14
|
variant?: BadgeVariants["variant"];
|
|
15
15
|
}
|
|
16
16
|
export interface BadgeLabelProps {
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* The point is that `<Chip>Label</Chip>` and `<Chip><ChipLabel>Label</ChipLabel></Chip>`
|
|
5
|
-
* produce the same DOM. A template cannot ask whether its children are bare text, but a slot
|
|
6
|
-
* function can be answered: it returns
|
|
7
|
-
* the block it just rendered, and a lone text child resolves to a single text node while
|
|
8
|
-
* markup resolves to elements or component instances.
|
|
9
|
-
*
|
|
10
|
-
* The slot is called exactly once and the very block it returns is what gets inserted, so
|
|
11
|
-
* nothing is rendered twice and no effect is registered and thrown away — which is the
|
|
12
|
-
* actual hazard with slots in Vapor, rather than reading them at all.
|
|
13
|
-
*
|
|
14
|
-
* Written as a Vapor component rather than an SFC because only a hand-written `setup` gets
|
|
15
|
-
* to hold the block; an SFC's `<slot />` is inserted before there is anywhere to intervene.
|
|
2
|
+
* Wraps a chip's bare text in `ChipLabel`, so that `<Chip>Label</Chip>` and
|
|
3
|
+
* `<Chip><ChipLabel>Label</ChipLabel></Chip>` produce the same DOM.
|
|
16
4
|
*/
|
|
17
|
-
declare const ChipAutoLabel: import("vue").
|
|
18
|
-
[x: string]: import("vue").VaporSlot;
|
|
19
|
-
}, Record<string, any>, import("vue").DynamicFragment | Node | import("vue").VaporComponentInstance<{}, {}, {
|
|
20
|
-
[x: string]: import("vue").VaporSlot;
|
|
21
|
-
}, Record<string, any>, import("vue").Block, Record<string, any>> | import("vue").VaporFragment<import("vue").Block>, Record<string, any> & {} & import("vue").ReservedProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps>;
|
|
5
|
+
declare const ChipAutoLabel: import("vue").Component;
|
|
22
6
|
export default ChipAutoLabel;
|
|
@@ -1,27 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAutoLabel } from "../../utils/auto-label.js";
|
|
2
2
|
import chip_label_default from "./chip-label.js";
|
|
3
|
-
import { createComponent, defineVaporComponent } from "vue";
|
|
4
3
|
//#region src/components/chip/chip-auto-label.ts
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The point is that `<Chip>Label</Chip>` and `<Chip><ChipLabel>Label</ChipLabel></Chip>`
|
|
9
|
-
* produce the same DOM. A template cannot ask whether its children are bare text, but a slot
|
|
10
|
-
* function can be answered: it returns
|
|
11
|
-
* the block it just rendered, and a lone text child resolves to a single text node while
|
|
12
|
-
* markup resolves to elements or component instances.
|
|
13
|
-
*
|
|
14
|
-
* The slot is called exactly once and the very block it returns is what gets inserted, so
|
|
15
|
-
* nothing is rendered twice and no effect is registered and thrown away — which is the
|
|
16
|
-
* actual hazard with slots in Vapor, rather than reading them at all.
|
|
17
|
-
*
|
|
18
|
-
* Written as a Vapor component rather than an SFC because only a hand-written `setup` gets
|
|
19
|
-
* to hold the block; an SFC's `<slot />` is inserted before there is anywhere to intervene.
|
|
5
|
+
* Wraps a chip's bare text in `ChipLabel`, so that `<Chip>Label</Chip>` and
|
|
6
|
+
* `<Chip><ChipLabel>Label</ChipLabel></Chip>` produce the same DOM.
|
|
20
7
|
*/
|
|
21
|
-
var ChipAutoLabel =
|
|
22
|
-
const block = slots["default"]?.();
|
|
23
|
-
if (block === void 0 || !isTextOnlyBlock(flattenBlock(block))) return block ?? [];
|
|
24
|
-
return createComponent(chip_label_default, null, { default: () => block });
|
|
25
|
-
}, { name: "Ropav.Chip.AutoLabel" });
|
|
8
|
+
var ChipAutoLabel = createAutoLabel(chip_label_default, "Ropav.Chip.AutoLabel");
|
|
26
9
|
//#endregion
|
|
27
10
|
export { ChipAutoLabel as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ChipVariants } from "@ropav/styles";
|
|
2
2
|
export interface ChipRootProps {
|
|
3
3
|
class?: string;
|
|
4
|
-
/** Chip color. */
|
|
4
|
+
/** Chip color. @default "default" */
|
|
5
5
|
color?: ChipVariants["color"];
|
|
6
6
|
/** Chip size. */
|
|
7
7
|
size?: ChipVariants["size"];
|
|
8
|
-
/** Chip variant. */
|
|
8
|
+
/** Chip variant. @default "secondary" */
|
|
9
9
|
variant?: ChipVariants["variant"];
|
|
10
10
|
}
|
|
11
11
|
export interface ChipLabelProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineVaporComponent, renderEffect, setClass, template } from "vue";
|
|
2
2
|
//#region src/components/icons/icon-overlay-arrow.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
3
|
-
var t0 = template("<svg fill=none height=12 viewBox=\"0 0 12 12\" width=12 xmlns=http://www.w3.org/2000/svg><path d=\"M1 0V2C3.2 2 4.3 8 6 8C7.7 8 8.8 2 11 2V0Z\">", 1, 1);
|
|
3
|
+
var t0 = template("<svg aria-hidden=true fill=none height=12 role=presentation viewBox=\"0 0 12 12\" width=12 xmlns=http://www.w3.org/2000/svg><path d=\"M1 0V2C3.2 2 4.3 8 6 8C7.7 8 8.8 2 11 2V0Z\">", 1, 1);
|
|
4
4
|
var icon_overlay_arrow_vue_vue_type_script_setup_true_vapor_true_lang_default = /*@__PURE__*/ defineVaporComponent({
|
|
5
5
|
__name: "icon-overlay-arrow",
|
|
6
6
|
props: { class: {} },
|
|
@@ -2,7 +2,9 @@ import type { MeterVariants } from "@ropav/styles";
|
|
|
2
2
|
import type { CSSProperties } from "vue";
|
|
3
3
|
export interface MeterRootProps {
|
|
4
4
|
class?: string;
|
|
5
|
+
/** Meter color. @default "accent" */
|
|
5
6
|
color?: MeterVariants["color"];
|
|
7
|
+
/** Meter size. @default "md" */
|
|
6
8
|
size?: MeterVariants["size"];
|
|
7
9
|
/** Current quantity. @default 0 */
|
|
8
10
|
value?: number;
|
|
@@ -2,7 +2,9 @@ import type { ProgressBarVariants } from "@ropav/styles";
|
|
|
2
2
|
import type { CSSProperties } from "vue";
|
|
3
3
|
export interface ProgressBarRootProps {
|
|
4
4
|
class?: string;
|
|
5
|
+
/** Progress bar color. @default "accent" */
|
|
5
6
|
color?: ProgressBarVariants["color"];
|
|
7
|
+
/** Progress bar size. @default "md" */
|
|
6
8
|
size?: ProgressBarVariants["size"];
|
|
7
9
|
/** Whether a diagonal band is laid over the fill. */
|
|
8
10
|
isStriped?: boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ProgressCircleVariants } from "@ropav/styles";
|
|
2
2
|
export interface ProgressCircleRootProps {
|
|
3
3
|
class?: string;
|
|
4
|
+
/** Progress circle color. @default "accent" */
|
|
4
5
|
color?: ProgressCircleVariants["color"];
|
|
6
|
+
/** Progress circle size. @default "md" */
|
|
5
7
|
size?: ProgressCircleVariants["size"];
|
|
6
8
|
/** Current progress. @default 0 */
|
|
7
9
|
value?: number;
|
|
@@ -53,7 +53,7 @@ var useColorField = (options = {}) => {
|
|
|
53
53
|
validationState: state,
|
|
54
54
|
value: () => state.inputValue.value
|
|
55
55
|
});
|
|
56
|
-
const element = computed(() => field.element.value instanceof HTMLInputElement ? field.element.value : null);
|
|
56
|
+
const element = computed(() => typeof document !== "undefined" && field.element.value instanceof HTMLInputElement ? field.element.value : null);
|
|
57
57
|
const spin = useSpinButton({
|
|
58
58
|
isDisabled,
|
|
59
59
|
isReadOnly,
|