srcdev-nuxt-components 9.4.9 → 9.4.11
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/.claude/commands/migrate-component.md +38 -6
- package/.claude/component-ledger/audit.json +1 -1
- package/.claude/component-ledger/build.mjs +26 -0
- package/.claude/component-ledger/output.html +8 -3
- package/.claude/component-ledger/template.html +7 -2
- package/.claude/skills/component-dynamic-slots.md +1 -1
- package/.claude/skills/components/alert-mask-core.md +84 -0
- package/.claude/skills/components/canvas-switcher.md +1 -1
- package/.claude/skills/components/carousel-flip.md +112 -168
- package/.claude/skills/components/container-glow.md +123 -0
- package/.claude/skills/components/dashboard-quad-grid.md +98 -0
- package/.claude/skills/components/dashboard-stats-grid.md +103 -0
- package/.claude/skills/components/display-theme-switch.md +60 -0
- package/.claude/skills/components/glowing-border.md +66 -0
- package/.claude/skills/components/input-number-core.md +214 -0
- package/.claude/skills/components/input-range-core.md +142 -0
- package/.claude/skills/components/input-select-core.md +151 -0
- package/.claude/skills/components/input-text-core.md +16 -0
- package/.claude/skills/components/input-textarea-core.md +154 -0
- package/.claude/skills/components/section-parallax.md +32 -10
- package/.claude/skills/components/select-menu.md +195 -0
- package/.claude/skills/components/toggle-switch-core.md +150 -0
- package/.claude/skills/components/ui-block-decorated.md +56 -0
- package/.claude/skills/components/wipe-away-vertical.md +98 -0
- package/.claude/skills/icon-sets.md +1 -1
- package/.claude/skills/index.md +15 -1
- package/.vscode/css-custom-data.json +38 -0
- package/.vscode/settings.json +3 -0
- package/.vscode/srcdev-component-alert-mask-core.code-snippets +31 -0
- package/.vscode/srcdev-component-carousel-flip.code-snippets +41 -0
- package/.vscode/srcdev-component-container-glow.code-snippets +33 -0
- package/.vscode/srcdev-component-dashboard-quad-grid.code-snippets +36 -0
- package/.vscode/srcdev-component-dashboard-stats-grid.code-snippets +35 -0
- package/.vscode/srcdev-component-display-theme-switch.code-snippets +27 -0
- package/.vscode/srcdev-component-glowing-border.code-snippets +23 -0
- package/.vscode/srcdev-component-input-number.code-snippets +65 -0
- package/.vscode/srcdev-component-input-range.code-snippets +85 -0
- package/.vscode/srcdev-component-input-select.code-snippets +42 -0
- package/.vscode/srcdev-component-input-textarea.code-snippets +40 -0
- package/.vscode/srcdev-component-section-parallax.code-snippets +27 -0
- package/.vscode/srcdev-component-select-menu.code-snippets +65 -0
- package/.vscode/srcdev-component-toggle-switch.code-snippets +49 -0
- package/.vscode/srcdev-component-ui-block-decorated.code-snippets +24 -0
- package/.vscode/srcdev-component-wipe-away-vertical.code-snippets +25 -0
- package/README.md +18 -37
- package/app/components/{alert-mask → 01.atoms/alert-mask}/AlertMaskCore.vue +16 -17
- package/app/components/01.atoms/alert-mask/CONSUMER-STYLING.md +46 -0
- package/app/components/01.atoms/alert-mask/stories/AlertMaskCore.stories.ts +79 -0
- package/app/components/{alert-mask → 01.atoms/alert-mask}/tests/AlertMaskCore.spec.ts +10 -10
- package/app/components/01.atoms/animations/container-glow/CONSUMER-STYLING.md +86 -0
- package/app/components/01.atoms/animations/container-glow/ContainerGlow.vue +299 -0
- package/app/components/01.atoms/animations/container-glow/stories/ContainerGlow.stories.ts +175 -0
- package/app/components/01.atoms/animations/container-glow/tests/ContainerGlow.spec.ts +131 -0
- package/app/components/01.atoms/animations/container-glow/tests/__snapshots__/ContainerGlow.spec.ts.snap +14 -0
- package/app/components/01.atoms/animations/glowing-border/CONSUMER-STYLING.md +61 -0
- package/app/components/01.atoms/animations/glowing-border/GlowingBorder.vue +132 -0
- package/app/components/01.atoms/animations/glowing-border/stories/GlowingBorder.stories.ts +165 -0
- package/app/components/01.atoms/animations/glowing-border/tests/GlowingBorder.spec.ts +94 -0
- package/app/components/01.atoms/animations/glowing-border/tests/__snapshots__/GlowingBorder.spec.ts.snap +3 -0
- package/app/components/01.atoms/animations/marquee-scroller/CONSUMER-STYLING.md +1 -1
- package/app/components/01.atoms/animations/marquee-scroller/MarqueeScroller.vue +1 -1
- package/app/components/01.atoms/animations/marquee-scroller/stories/MarqueeScroller.stories.ts +1 -1
- package/app/components/01.atoms/animations/section-parallax/CONSUMER-STYLING.md +44 -0
- package/app/components/{parallax → 01.atoms/animations/section-parallax}/SectionParallax.vue +11 -10
- package/app/components/01.atoms/animations/section-parallax/stories/SectionParallax.stories.ts +98 -0
- package/app/components/01.atoms/animations/section-parallax/tests/SectionParallax.spec.ts +102 -0
- package/app/components/01.atoms/animations/section-parallax/tests/__snapshots__/SectionParallax.spec.ts.snap +9 -0
- package/app/components/01.atoms/animations/view-timeline/CONSUMER-STYLING.md +70 -0
- package/app/components/01.atoms/animations/view-timeline/WipeAwayVertical.vue +181 -0
- package/app/components/01.atoms/animations/view-timeline/stories/WipeAwayVertical.stories.ts +269 -0
- package/app/components/01.atoms/animations/view-timeline/tests/WipeAwayVertical.spec.ts +127 -0
- package/app/components/01.atoms/canvas-switcher/CONSUMER-STYLING.md +3 -3
- package/app/components/01.atoms/canvas-switcher/CanvasSwitcher.vue +2 -2
- package/app/components/01.atoms/canvas-switcher/stories/CanvasSwitcher.stories.ts +1 -1
- package/app/components/01.atoms/card/CardCore.vue +4 -4
- package/app/components/01.atoms/clipped-panel/CONSUMER-STYLING.md +2 -2
- package/app/components/01.atoms/clipped-panel/ClippedPanel.vue +2 -2
- package/app/components/01.atoms/content-wrappers/layout-grid/dashboard-quad-grid/CONSUMER-STYLING.md +42 -0
- package/app/components/{layout-grids/LayoutGridA.vue → 01.atoms/content-wrappers/layout-grid/dashboard-quad-grid/DashboardQuadGrid.vue} +23 -13
- package/app/components/{layout-grids/stories/LayoutGridA.stories.ts → 01.atoms/content-wrappers/layout-grid/dashboard-quad-grid/stories/DashboardQuadGrid.stories.ts} +151 -23
- package/app/components/{layout-grids/tests/LayoutGridA.spec.ts → 01.atoms/content-wrappers/layout-grid/dashboard-quad-grid/tests/DashboardQuadGrid.spec.ts} +25 -25
- package/app/components/01.atoms/content-wrappers/layout-grid/dashboard-stats-grid/CONSUMER-STYLING.md +41 -0
- package/app/components/01.atoms/content-wrappers/layout-grid/dashboard-stats-grid/DashboardStatsGrid.vue +133 -0
- package/app/components/{layout-grids/stories/LayoutGridB.stories.ts → 01.atoms/content-wrappers/layout-grid/dashboard-stats-grid/stories/DashboardStatsGrid.stories.ts} +24 -24
- package/app/components/{layout-grids/tests/LayoutGridB.spec.ts → 01.atoms/content-wrappers/layout-grid/dashboard-stats-grid/tests/DashboardStatsGrid.spec.ts} +23 -23
- package/app/components/01.atoms/display-tooltip/CONSUMER-STYLING.md +8 -8
- package/app/components/01.atoms/display-tooltip/DisplayTooltip.vue +8 -8
- package/app/components/01.atoms/pop-over/CONSUMER-STYLING.md +6 -6
- package/app/components/01.atoms/pop-over/PopOver.vue +6 -6
- package/app/components/01.atoms/ui-block-decorated/CONSUMER-STYLING.md +39 -0
- package/app/components/01.atoms/ui-block-decorated/UiBlockDecorated.vue +141 -0
- package/app/components/01.atoms/ui-block-decorated/stories/UiBlockDecorated.stories.ts +148 -0
- package/app/components/01.atoms/ui-block-decorated/tests/UiBlockDecorated.spec.ts +80 -0
- package/app/components/01.atoms/ui-block-decorated/tests/__snapshots__/UiBlockDecorated.spec.ts.snap +3 -0
- package/app/components/02.molecules/alert-masked-content/tests/AlertMaskedContent.spec.ts +6 -6
- package/app/components/02.molecules/display-theme-switch/CONSUMER-STYLING.md +34 -0
- package/app/components/02.molecules/display-theme-switch/DisplayThemeSwitch.vue +102 -0
- package/app/components/02.molecules/display-theme-switch/stories/DisplayThemeSwitch.stories.ts +115 -0
- package/app/components/02.molecules/display-theme-switch/tests/DisplayThemeSwitch.spec.ts +86 -0
- package/app/components/02.molecules/navigation/deep-expanding-menu/CONSUMER-STYLING.md +1 -1
- package/app/components/02.molecules/navigation/deep-expanding-menu/DeepExpandingMenu.vue +1 -1
- package/app/components/02.molecules/navigation/deep-expanding-menu-classic/CONSUMER-STYLING.md +1 -1
- package/app/components/02.molecules/navigation/deep-expanding-menu-classic/DeepExpandingMenuClassic.vue +1 -1
- package/app/components/02.molecules/select-menu/CONSUMER-STYLING.md +168 -0
- package/app/components/02.molecules/select-menu/SelectMenu.vue +384 -0
- package/app/components/02.molecules/select-menu/stories/SelectMenu.stories.ts +359 -0
- package/app/components/02.molecules/select-menu/tests/SelectMenu.spec.ts +476 -0
- package/app/components/02.molecules/select-menu/tests/__snapshots__/SelectMenu.spec.ts.snap +42 -0
- package/app/components/03.organisms/image-galleries/carousel-flip/CONSUMER-STYLING.md +46 -0
- package/app/components/{carousels → 03.organisms/image-galleries/carousel-flip}/CarouselFlip.vue +63 -42
- package/app/components/{carousels → 03.organisms/image-galleries/carousel-flip}/stories/CarouselFlip.stories.ts +114 -29
- package/app/components/{carousels → 03.organisms/image-galleries/carousel-flip}/tests/CarouselFlip.spec.ts +80 -0
- package/app/components/05.forms/form-field/FormField.vue +1 -1
- package/app/components/05.forms/form-wrapper/FormWrapper.vue +1 -1
- package/app/components/05.forms/input-button/CONSUMER-STYLING.md +2 -7
- package/app/components/05.forms/input-button/InputButtonCore.vue +1 -5
- package/app/components/05.forms/input-number/CONSUMER-STYLING.md +26 -6
- package/app/components/05.forms/input-number/InputNumberCore.vue +125 -85
- package/app/components/05.forms/input-number/stories/InputNumberCore.stories.ts +92 -0
- package/app/components/05.forms/input-number/tests/InputNumberCore.spec.ts +119 -0
- package/app/components/05.forms/input-number/variants/InputNumberDefault.vue +30 -22
- package/app/components/05.forms/input-number/variants/stories/InputNumberDefault.stories.ts +123 -0
- package/app/components/05.forms/input-number/variants/tests/InputNumberDefault.spec.ts +143 -0
- package/app/components/05.forms/input-range/CONSUMER-STYLING.md +45 -0
- package/app/components/05.forms/input-range/InputRangeCore.vue +79 -143
- package/app/components/05.forms/input-range/stories/InputRangeCore.stories.ts +126 -0
- package/app/components/05.forms/input-range/tests/InputRangeCore.spec.ts +124 -0
- package/app/components/05.forms/input-range/variants/InputRangeDefault.vue +9 -32
- package/app/components/05.forms/input-range/variants/stories/InputRangeDefault.stories.ts +108 -0
- package/app/components/05.forms/input-range/variants/tests/InputRangeDefault.spec.ts +140 -0
- package/app/components/05.forms/input-select/InputSelectCore.vue +23 -30
- package/app/components/05.forms/input-select/stories/InputSelectCore.stories.ts +2 -2
- package/app/components/05.forms/input-select/stories/InputSelectWithLabel.stories.ts +115 -0
- package/app/components/05.forms/input-select/tests/InputSelectCore.spec.ts +129 -0
- package/app/components/05.forms/input-select/variants/InputSelectWithLabel.vue +1 -1
- package/app/components/05.forms/input-select/variants/tests/InputSelectWithLabel.spec.ts +87 -0
- package/app/components/05.forms/input-text/tests/InputTextAsNumberWithLabel.spec.ts +14 -0
- package/app/components/05.forms/input-text/variants/InputTextAsNumberWithLabel.vue +1 -1
- package/app/components/05.forms/input-textarea/CONSUMER-STYLING.md +55 -0
- package/app/components/05.forms/input-textarea/InputTextareaCore.vue +24 -16
- package/app/components/05.forms/input-textarea/stories/InputTextareaWithLabel.stories.ts +1 -1
- package/app/components/05.forms/input-textarea/tests/InputTextareaCore.spec.ts +119 -0
- package/app/components/05.forms/input-textarea/variants/InputTextareaWithLabel.vue +3 -13
- package/app/components/05.forms/input-textarea/variants/tests/InputTextareaWithLabel.spec.ts +93 -0
- package/app/components/05.forms/patterns/stories/MigratedFieldsForm.stories.ts +220 -0
- package/app/components/05.forms/toggle-switch/CONSUMER-STYLING.md +29 -0
- package/app/components/05.forms/toggle-switch/ToggleSwitchCore.vue +120 -119
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitchCore.stories.ts +1 -1
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitchWithLabel.stories.ts +1 -1
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitchWithLabelInline.stories.ts +2 -2
- package/app/components/05.forms/toggle-switch/tests/ToggleSwitchCore.spec.ts +101 -0
- package/app/components/05.forms/toggle-switch/variants/ToggleSwitchWithLabel.vue +3 -5
- package/app/components/05.forms/toggle-switch/variants/ToggleSwitchWithLabelInline.vue +1 -2
- package/app/components/05.forms/toggle-switch/variants/tests/ToggleSwitchWithLabel.spec.ts +77 -0
- package/app/components/05.forms/toggle-switch/variants/tests/ToggleSwitchWithLabelInline.spec.ts +66 -0
- package/app/components/05.forms/triple-toggle-switch/CONSUMER-STYLING.md +20 -6
- package/app/components/05.forms/triple-toggle-switch/TripleToggleSwitchCore.vue +12 -10
- package/app/types/components/container-glow.d.ts +8 -0
- package/app/types/components/index.ts +2 -1
- package/app/types/components/select-menu.d.ts +5 -0
- package/package.json +3 -2
- package/.vscode/srcdev-component-toggle-switch-core.code-snippets +0 -13
- package/app/components/05.forms/input-range-fancy/InputRangeFancyCore.vue +0 -426
- package/app/components/05.forms/input-range-fancy/InputRangeFancyWithLabel.vue +0 -94
- package/app/components/carousels/CarouselBasic.vue +0 -317
- package/app/components/carousels/CarouselInfinite.vue +0 -358
- package/app/components/container-glow/ContainerGlowCore.vue +0 -296
- package/app/components/container-glow/stories/ContainerGlowCore.stories.ts +0 -337
- package/app/components/display-theme-switch/DisplayThemeSwitch.vue +0 -189
- package/app/components/display-theme-switch/stories/DisplayThemeSwitch.stories.ts +0 -154
- package/app/components/glowing-border/GlowingBorder.vue +0 -142
- package/app/components/glowing-border/stories/GlowingBorder.stories.ts +0 -141
- package/app/components/layout-grids/LayoutGridB.vue +0 -134
- package/app/components/test-storybook/TestStorybook.vue +0 -49
- package/app/components/test-storybook/stories/TestStorybook.stories.ts +0 -28
- package/app/components/ui-block-decorated/UiBlockDecorated.vue +0 -167
- package/app/components/view-timeline/WipeAwayVertical.vue +0 -180
- package/app/types/components/carousel-basic.d.ts +0 -19
|
@@ -1,426 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div ref="control" class="control">
|
|
3
|
-
<div ref="toolTip" aria-hidden="true" class="tooltip">
|
|
4
|
-
<div ref="toolTipLow" class="range-label range-low-label">
|
|
5
|
-
{{ rangeLowLabel }}
|
|
6
|
-
<span class="value">{{ lowValue }} %</span>
|
|
7
|
-
</div>
|
|
8
|
-
<div ref="toolTipHigh" class="range-label range-high-label">
|
|
9
|
-
<span class="value">{{ highValue }} %</span>
|
|
10
|
-
{{ rangeHighLabel }}
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
<input
|
|
14
|
-
:id
|
|
15
|
-
ref="inputRef"
|
|
16
|
-
v-model="modelValue"
|
|
17
|
-
type="range"
|
|
18
|
-
:name
|
|
19
|
-
:min
|
|
20
|
-
:max
|
|
21
|
-
:step
|
|
22
|
-
@input="update()"
|
|
23
|
-
@pointerdown="update()"
|
|
24
|
-
/>
|
|
25
|
-
|
|
26
|
-
<div ref="controlTrack" class="control__track">
|
|
27
|
-
<div class="control__track-slide">
|
|
28
|
-
<div class="control__fill"></div>
|
|
29
|
-
<div class="control__indicator"></div>
|
|
30
|
-
<div class="control__fill"></div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script setup lang="ts">
|
|
37
|
-
import type { FormUiTheme, FormWeight } from "~/types/forms/types.forms";
|
|
38
|
-
|
|
39
|
-
interface Props {
|
|
40
|
-
id: string;
|
|
41
|
-
name: string;
|
|
42
|
-
min: number;
|
|
43
|
-
max: number;
|
|
44
|
-
step?: number;
|
|
45
|
-
rangeLowLabel: string;
|
|
46
|
-
rangeHighLabel: string;
|
|
47
|
-
placeholder?: string;
|
|
48
|
-
required?: boolean;
|
|
49
|
-
theme?: FormUiTheme;
|
|
50
|
-
weight?: FormWeight;
|
|
51
|
-
fieldHasError?: boolean;
|
|
52
|
-
styleClassPassthrough?: string | string[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
56
|
-
step: 1,
|
|
57
|
-
placeholder: "",
|
|
58
|
-
required: false,
|
|
59
|
-
theme: "default",
|
|
60
|
-
weight: "wght-400",
|
|
61
|
-
fieldHasError: false,
|
|
62
|
-
styleClassPassthrough: () => [],
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const modelValue = defineModel<number | readonly number[]>();
|
|
66
|
-
|
|
67
|
-
const control = ref<HTMLDivElement | null>(null);
|
|
68
|
-
const controlTrack = ref<HTMLDivElement | null>(null);
|
|
69
|
-
const toolTip = ref<HTMLDivElement | null>(null);
|
|
70
|
-
const toolTipLow = ref<HTMLDivElement | null>(null);
|
|
71
|
-
const toolTipHigh = ref<HTMLDivElement | null>(null);
|
|
72
|
-
const inputRef = ref<HTMLInputElement | null>(null);
|
|
73
|
-
|
|
74
|
-
// Box sizes
|
|
75
|
-
const toolTipWidth = ref(0);
|
|
76
|
-
const toolTipLowWidth = ref(0);
|
|
77
|
-
const toolTipHighWidth = ref(0);
|
|
78
|
-
// const toolTipMargin = 20;
|
|
79
|
-
|
|
80
|
-
// const toolTipLowContainerEnd = computed(() => {
|
|
81
|
-
// return Math.floor(((toolTipHighWidth.value + toolTipMargin) / toolTipWidth.value) * 100) + "%";
|
|
82
|
-
// });
|
|
83
|
-
|
|
84
|
-
// const toolTipHighContainerStart = computed(() => {
|
|
85
|
-
// return Math.floor(((toolTipWidth.value - (toolTipHighWidth.value + toolTipMargin)) / toolTipWidth.value) * 100) + "%";
|
|
86
|
-
// });
|
|
87
|
-
|
|
88
|
-
const lowValue = computed(() => {
|
|
89
|
-
return Math.floor(Number(props.max) - Number(highValue.value));
|
|
90
|
-
});
|
|
91
|
-
const highValue = computed(() => {
|
|
92
|
-
return Math.floor((Number(modelValue.value) / props.max) * 100);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const update = () => {
|
|
96
|
-
control.value?.style.setProperty("--value", String(modelValue.value));
|
|
97
|
-
const value = typeof modelValue.value === "number" ? modelValue.value : 0;
|
|
98
|
-
controlTrack.value?.style.setProperty("--shift", value > 40 && value < 68 ? "1" : "0");
|
|
99
|
-
toolTip.value?.style.setProperty("--shift", value > 40 && value < 68 ? "1" : "0");
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const updateBoxSizes = () => {
|
|
103
|
-
toolTipWidth.value = toolTip.value?.offsetWidth || 0;
|
|
104
|
-
toolTipLowWidth.value = toolTipLow.value?.offsetWidth || 0;
|
|
105
|
-
toolTipHighWidth.value = toolTipHigh.value?.offsetWidth || 0;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
onMounted(() => {
|
|
109
|
-
updateBoxSizes();
|
|
110
|
-
if (!CSS.supports("animation-timeline: scroll()")) {
|
|
111
|
-
update();
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
</script>
|
|
115
|
-
|
|
116
|
-
<style lang="css">
|
|
117
|
-
@layer components {
|
|
118
|
-
@layer foundation {
|
|
119
|
-
.control {
|
|
120
|
-
position: relative;
|
|
121
|
-
display: grid;
|
|
122
|
-
place-items: center;
|
|
123
|
-
margin: 0 auto;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.control:focus-within,
|
|
127
|
-
.control:hover {
|
|
128
|
-
--active: 1;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
[type="range"] {
|
|
132
|
-
width: 100%;
|
|
133
|
-
opacity: 0;
|
|
134
|
-
height: 6rem;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
[type="range"]:hover {
|
|
138
|
-
cursor: -webkit-grab;
|
|
139
|
-
}
|
|
140
|
-
[type="range"]:active {
|
|
141
|
-
cursor: -webkit-grabbing;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
[type="range"]:focus-visible {
|
|
145
|
-
outline-offset: var(--form-element-outline-offset-focus);
|
|
146
|
-
outline-color: transparent;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
@property --shift {
|
|
150
|
-
initial-value: 0;
|
|
151
|
-
inherits: true;
|
|
152
|
-
syntax: "<integer>";
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.tooltip {
|
|
156
|
-
font-size: 1rem;
|
|
157
|
-
position: absolute;
|
|
158
|
-
top: 0;
|
|
159
|
-
left: 0;
|
|
160
|
-
right: 0;
|
|
161
|
-
height: 50%;
|
|
162
|
-
pointer-events: none;
|
|
163
|
-
transform: translateY(calc(var(--shift, 0) * 50%));
|
|
164
|
-
transition: transform var(--speed) var(--timing);
|
|
165
|
-
z-index: 2;
|
|
166
|
-
}
|
|
167
|
-
@keyframes shift {
|
|
168
|
-
0%,
|
|
169
|
-
31%,
|
|
170
|
-
61%,
|
|
171
|
-
100% {
|
|
172
|
-
--shift: 0;
|
|
173
|
-
}
|
|
174
|
-
32%,
|
|
175
|
-
60% {
|
|
176
|
-
--shift: 1;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/* .tooltip::after, */
|
|
181
|
-
/* .tooltip::before, */
|
|
182
|
-
.tooltip .range-label {
|
|
183
|
-
display: block;
|
|
184
|
-
font-inputvariant: tabular-nums;
|
|
185
|
-
position: absolute;
|
|
186
|
-
top: 50%;
|
|
187
|
-
translate: 0 -50%;
|
|
188
|
-
font-weight: bold;
|
|
189
|
-
color: white;
|
|
190
|
-
font-weight: 40;
|
|
191
|
-
font-family: monospace;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
[type="range"]::-webkit-slider-thumb {
|
|
195
|
-
appearance: none;
|
|
196
|
-
-webkit-appearance: none;
|
|
197
|
-
height: 6rem;
|
|
198
|
-
width: 4rem;
|
|
199
|
-
margin-top: 0rem;
|
|
200
|
-
opacity: 1;
|
|
201
|
-
}
|
|
202
|
-
[type="range"]::-webkit-slider-runnable-track {
|
|
203
|
-
-webkit-appearance: none;
|
|
204
|
-
height: 6rem;
|
|
205
|
-
/* background: hsl(10 80% 50% / 0.5); */
|
|
206
|
-
margin-top: 0rem; /* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
|
|
207
|
-
box-shadow:
|
|
208
|
-
0.1rem 0.1rem 0.1rem #000000,
|
|
209
|
-
0rem 0rem 0.1rem #0d0d0d;
|
|
210
|
-
}
|
|
211
|
-
[type="range"]::-moz-range-track {
|
|
212
|
-
height: 6rem;
|
|
213
|
-
/* background: hsl(10 80% 50% / 0.5); */
|
|
214
|
-
margin-top: 0rem; /* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
|
|
215
|
-
box-shadow:
|
|
216
|
-
0.1rem 0.1rem 0.1rem #000000,
|
|
217
|
-
0rem 0rem 0.1rem #0d0d0d;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
@layer scrolls {
|
|
222
|
-
@property --value {
|
|
223
|
-
initial-value: 0;
|
|
224
|
-
syntax: "<integer>";
|
|
225
|
-
inherits: true;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
@keyframes sync {
|
|
229
|
-
to {
|
|
230
|
-
--value: 100;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
[type="range"] {
|
|
235
|
-
overflow: hidden;
|
|
236
|
-
opacity: 0;
|
|
237
|
-
touch-action: none;
|
|
238
|
-
/* extras */
|
|
239
|
-
accent-color: hsl(24 74% calc(24% + (30% * ((100 - var(--value, 0)) / 100)) / 1) / 0.4);
|
|
240
|
-
outline: 0.2rem dashed #0000;
|
|
241
|
-
transition-property: outline-color, opacity, translate;
|
|
242
|
-
transition-duration: 0.25s;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
[data-reveal="true"] [type="range"] {
|
|
246
|
-
opacity: 1;
|
|
247
|
-
translate: 0 -150%;
|
|
248
|
-
outline-color: white;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.control {
|
|
252
|
-
width: 100%;
|
|
253
|
-
animation:
|
|
254
|
-
sync both linear reverse,
|
|
255
|
-
shift both linear;
|
|
256
|
-
animation-timeline: --thumb;
|
|
257
|
-
animation-range: contain;
|
|
258
|
-
container-type: inline-size;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.control__track {
|
|
262
|
-
--coffee: hsl(24 74% calc(24% + (30% * ((100 - var(--value, 0)) / 100)) / 1) / 0.4);
|
|
263
|
-
--milk: hsl(0 0% 100% / calc(0.1 + (0.4 * ((100 - var(--value, 0)) / 100))));
|
|
264
|
-
height: calc(50% + (var(--shift) * 50%));
|
|
265
|
-
width: 100%;
|
|
266
|
-
position: absolute;
|
|
267
|
-
bottom: 0;
|
|
268
|
-
pointer-events: none;
|
|
269
|
-
transition: height var(--speed) var(--timing);
|
|
270
|
-
z-index: 5;
|
|
271
|
-
clip-path: inset(0 -0.25rem 0 -0.25rem round 0.6rem);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
[data-reveal="true"] .control__track {
|
|
275
|
-
clip-path: unset;
|
|
276
|
-
outline: 0.2rem dashed white;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.control__track-slide {
|
|
280
|
-
height: 100%;
|
|
281
|
-
width: 100%;
|
|
282
|
-
position: relative;
|
|
283
|
-
translate: calc(-50% + (var(--value) * 1cqi)) 0;
|
|
284
|
-
transition: translate var(--update);
|
|
285
|
-
}
|
|
286
|
-
.control__fill {
|
|
287
|
-
width: 100%;
|
|
288
|
-
height: 100%;
|
|
289
|
-
position: absolute;
|
|
290
|
-
border-radius: 0.6rem;
|
|
291
|
-
|
|
292
|
-
&:nth-of-type(1) {
|
|
293
|
-
background: var(--coffee);
|
|
294
|
-
right: calc(50% + 0.5rem);
|
|
295
|
-
}
|
|
296
|
-
&:nth-of-type(3) {
|
|
297
|
-
background: var(--milk);
|
|
298
|
-
left: calc(50% + 0.5rem);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.control__indicator {
|
|
303
|
-
height: 75%;
|
|
304
|
-
border-radius: 0.4rem;
|
|
305
|
-
width: 0.4rem;
|
|
306
|
-
position: absolute;
|
|
307
|
-
top: 50%;
|
|
308
|
-
left: 50%;
|
|
309
|
-
background: hsl(0 0% 100% / calc((var(--active, 0) * 0.5) + 0.5));
|
|
310
|
-
/* left: calc(var(--value, 0) * 1%); */
|
|
311
|
-
z-index: 2;
|
|
312
|
-
translate: -50% -50%;
|
|
313
|
-
/* transition: left var(--update); */
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
:where(html) {
|
|
317
|
-
--speed: 0.65s;
|
|
318
|
-
--update: 0s;
|
|
319
|
-
--timing: linear(
|
|
320
|
-
0,
|
|
321
|
-
0.5007 7.21%,
|
|
322
|
-
0.7803 12.29%,
|
|
323
|
-
0.8883 14.93%,
|
|
324
|
-
0.9724 17.63%,
|
|
325
|
-
1.0343 20.44%,
|
|
326
|
-
1.0754 23.44%,
|
|
327
|
-
1.0898 25.22%,
|
|
328
|
-
1.0984 27.11%,
|
|
329
|
-
1.1014 29.15%,
|
|
330
|
-
1.0989 31.4%,
|
|
331
|
-
1.0854 35.23%,
|
|
332
|
-
1.0196 48.86%,
|
|
333
|
-
1.0043 54.06%,
|
|
334
|
-
0.9956 59.6%,
|
|
335
|
-
0.9925 68.11%,
|
|
336
|
-
1
|
|
337
|
-
);
|
|
338
|
-
timeline-scope: --thumb;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
@supports (animation-timeline: scroll()) {
|
|
342
|
-
:where(html) {
|
|
343
|
-
--speed: 0.65s;
|
|
344
|
-
--update: 0.1s;
|
|
345
|
-
--timing: linear(
|
|
346
|
-
0,
|
|
347
|
-
0.5007 7.21%,
|
|
348
|
-
0.7803 12.29%,
|
|
349
|
-
0.8883 14.93%,
|
|
350
|
-
0.9724 17.63%,
|
|
351
|
-
1.0343 20.44%,
|
|
352
|
-
1.0754 23.44%,
|
|
353
|
-
1.0898 25.22%,
|
|
354
|
-
1.0984 27.11%,
|
|
355
|
-
1.1014 29.15%,
|
|
356
|
-
1.0989 31.4%,
|
|
357
|
-
1.0854 35.23%,
|
|
358
|
-
1.0196 48.86%,
|
|
359
|
-
1.0043 54.06%,
|
|
360
|
-
0.9956 59.6%,
|
|
361
|
-
0.9925 68.11%,
|
|
362
|
-
1
|
|
363
|
-
);
|
|
364
|
-
timeline-scope: --thumb;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
[type="range"]::-webkit-slider-thumb {
|
|
368
|
-
view-timeline-name: --thumb;
|
|
369
|
-
view-timeline-axis: inline;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
@layer tip {
|
|
375
|
-
.tooltip {
|
|
376
|
-
counter-set: low var(--value) high calc(100 - var(--value));
|
|
377
|
-
z-index: 6;
|
|
378
|
-
|
|
379
|
-
/* .tooltip::before {
|
|
380
|
-
--range: calc((70 - (var(--value) / 100 * 10)) * 1%);
|
|
381
|
-
color: hsl(24 74% 54%);
|
|
382
|
-
content: 'COFFEE ' counter(low) '%';
|
|
383
|
-
mask: linear-gradient(90deg, hsl(0 0% 100% / 0.6) var(--range), hsl(0 0% 100% / 1) var(--range));
|
|
384
|
-
left: 0.5rem;
|
|
385
|
-
} */
|
|
386
|
-
/* .tooltip::after {
|
|
387
|
-
--range: calc((50 - (var(--value) / 100 * 10)) * 1%);
|
|
388
|
-
content: counter(high) '% MILK';
|
|
389
|
-
mask: linear-gradient(90deg, hsl(0 0% 100% / 1) var(--range), hsl(0 0% 100% / 0.5) var(--range));
|
|
390
|
-
right: 0.5rem;
|
|
391
|
-
} */
|
|
392
|
-
|
|
393
|
-
.range-low-label {
|
|
394
|
-
--range: calc((70 - (var(--value) / 100 * 10)) * 1%);
|
|
395
|
-
|
|
396
|
-
display: flex;
|
|
397
|
-
gap: 1.2rem;
|
|
398
|
-
color: hsl(24 74% 54%);
|
|
399
|
-
mask: linear-gradient(90deg, hsl(0 0% 100% / 0.6) var(--range), hsl(0 0% 100% / 1) var(--range));
|
|
400
|
-
left: 0.5rem;
|
|
401
|
-
.low-value {
|
|
402
|
-
display: inline-block;
|
|
403
|
-
border: 0.1rem solid white;
|
|
404
|
-
height: 2rem;
|
|
405
|
-
width: 5rem;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
.range-high-label {
|
|
410
|
-
--range: calc((50 - (var(--value) / 100 * 10)) * 1%);
|
|
411
|
-
|
|
412
|
-
display: flex;
|
|
413
|
-
gap: 1.2rem;
|
|
414
|
-
mask: linear-gradient(90deg, hsl(0 0% 100% / 1) var(--range), hsl(0 0% 100% / 0.5) var(--range));
|
|
415
|
-
right: 0.5rem;
|
|
416
|
-
.high-value {
|
|
417
|
-
display: inline-block;
|
|
418
|
-
border: 0.1rem solid white;
|
|
419
|
-
height: 2rem;
|
|
420
|
-
width: 5rem;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
</style>
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="input-range-fancy-with-label" :data-theme="theme" :class="[elementClasses, { error: fieldHasError }]">
|
|
3
|
-
<label class="input-range-fancy-label body-normal-bold" :for="id">{{ label }}</label>
|
|
4
|
-
<template v-if="slots.description">
|
|
5
|
-
<slot name="description"></slot>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<InputRangeFancyCore
|
|
9
|
-
:id
|
|
10
|
-
v-model="modelValue"
|
|
11
|
-
:name
|
|
12
|
-
:range-low-label
|
|
13
|
-
:range-high-label
|
|
14
|
-
:min
|
|
15
|
-
:max
|
|
16
|
-
:step
|
|
17
|
-
:theme
|
|
18
|
-
:required
|
|
19
|
-
:weight
|
|
20
|
-
:field-has-error
|
|
21
|
-
/>
|
|
22
|
-
<InputError
|
|
23
|
-
:id
|
|
24
|
-
:error-message
|
|
25
|
-
:show-error="fieldHasError"
|
|
26
|
-
:is-detached="true"
|
|
27
|
-
:style-class-passthrough="['mbe-20']"
|
|
28
|
-
/>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script setup lang="ts">
|
|
33
|
-
import type { FormUiTheme, FormWeight } from "~/types/forms/types.forms";
|
|
34
|
-
|
|
35
|
-
interface Props {
|
|
36
|
-
id: string;
|
|
37
|
-
name: string;
|
|
38
|
-
label: string;
|
|
39
|
-
rangeLowLabel: string;
|
|
40
|
-
rangeHighLabel: string;
|
|
41
|
-
min: number;
|
|
42
|
-
max: number;
|
|
43
|
-
step?: number;
|
|
44
|
-
placeholder?: string;
|
|
45
|
-
errorMessage: object | string;
|
|
46
|
-
fieldHasError?: boolean;
|
|
47
|
-
required?: boolean;
|
|
48
|
-
theme?: FormUiTheme;
|
|
49
|
-
weight?: FormWeight;
|
|
50
|
-
styleClassPassthrough?: string | string[];
|
|
51
|
-
deepCssClassPassthrough?: string;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
55
|
-
step: 1,
|
|
56
|
-
placeholder: "",
|
|
57
|
-
fieldHasError: false,
|
|
58
|
-
required: false,
|
|
59
|
-
theme: "default",
|
|
60
|
-
weight: "wght-400",
|
|
61
|
-
styleClassPassthrough: () => [],
|
|
62
|
-
deepCssClassPassthrough: "",
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const slots = useSlots();
|
|
66
|
-
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
67
|
-
|
|
68
|
-
const FormUiTheme = computed(() => {
|
|
69
|
-
return props.fieldHasError ? "error" : props.theme;
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
const modelValue = defineModel<number | readonly number[]>();
|
|
73
|
-
</script>
|
|
74
|
-
|
|
75
|
-
<style lang="css">
|
|
76
|
-
@layer components {
|
|
77
|
-
.input-range-fancy-with-label {
|
|
78
|
-
.input-range-fancy-label {
|
|
79
|
-
display: block;
|
|
80
|
-
margin-block: 0.8rem;
|
|
81
|
-
|
|
82
|
-
&:hover {
|
|
83
|
-
cursor: pointer;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.label-description {
|
|
88
|
-
font-family: var(--font-family);
|
|
89
|
-
font-size: 1.6rem;
|
|
90
|
-
margin-top: 1.2rem;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
</style>
|