@onereach/ui-components 21.3.2 → 21.4.0-beta.5370.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.
@@ -23,10 +23,8 @@ declare const _default: import("vue").DefineComponent<{
23
23
  root: import("vue").Ref<HTMLElement | undefined>;
24
24
  rootStyles: import("vue").ComputedRef<string[]>;
25
25
  starStyles: import("vue").ComputedRef<string[]>;
26
- starSize: import("vue").ComputedRef<(index: number) => "inherit" | "xl" | "l">;
27
26
  model: import("@onereach/ui-components-common/hooks").UseProxyModelValueReturn<number>;
28
27
  draft: import("vue").Ref<number>;
29
- isMobile: import("vue").ComputedRef<boolean>;
30
28
  hoverIndex: boolean[];
31
29
  onMouseEnter: (event: MouseEvent, index: number) => void;
32
30
  onMouseMove: (event: MouseEvent, index: number) => void;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, computed, inject, toRef, watch, reactive, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, createVNode } from 'vue';
2
- import { n as ne, r as re } from '../OrAutocompleteV3-961163d0.js';
2
+ import { r as re } from '../OrAutocompleteV3-961163d0.js';
3
3
  import { OrIconV3 as script$1 } from '../or-icon-v3/index.js';
4
4
  import '@vueuse/core';
5
5
  import '@onereach/styles/screens.json';
@@ -41,7 +41,7 @@ const RatingVariants = {
41
41
  'layout-row'],
42
42
  [RatingVariant.Fitted]: [
43
43
  // Layout
44
- 'layout-row md:justify-between']
44
+ 'layout-row justify-between']
45
45
  };
46
46
  const RatingStar = [
47
47
  // Layout
@@ -49,14 +49,11 @@ const RatingStar = [
49
49
  // Interactivity
50
50
  'interactivity-click',
51
51
  // Box
52
- 'w-[32px] md:w-[24px]', 'h-[32px] md:h-[24px]',
52
+ 'w-[28px] md:w-[24px]', 'h-[28px] md:h-[24px]',
53
53
  // Theme (activated)
54
54
  'activated:text-warning-hover', 'dark:activated:text-warning-hover-dark',
55
55
  // Theme (disabled)
56
56
  'disabled:text-disabled', 'dark:disabled:text-disabled-dark'];
57
- const RatingStarMobile = [
58
- // Typography;
59
- 'text-[32px]'];
60
57
 
61
58
  const RATING_LENGTH = Symbol();
62
59
  var script = defineComponent({
@@ -91,11 +88,8 @@ var script = defineComponent({
91
88
  setup(props, context) {
92
89
  // Refs & Styles
93
90
  const root = ref();
94
- const {
95
- isMobile
96
- } = ne();
97
91
  const rootStyles = computed(() => ['or-rating-v3', ...Rating, ...RatingVariants[props.variant]]);
98
- const starStyles = computed(() => [...RatingStar, ...(props.readonly ? ['interactivity-none'] : []), ...(isMobile.value ? RatingStarMobile : [])]);
92
+ const starStyles = computed(() => [...RatingStar, ...(props.readonly ? ['interactivity-none'] : [])]);
99
93
  // Options
100
94
  const length = inject(RATING_LENGTH, 5);
101
95
  // State
@@ -109,17 +103,6 @@ var script = defineComponent({
109
103
  immediate: true
110
104
  });
111
105
  const hoverIndex = reactive(Array(length).fill(false));
112
- const starSize = computed(() => {
113
- return index => {
114
- if (props.variant === 'fitted' || isMobile.value) {
115
- return 'inherit';
116
- }
117
- if (hoverIndex[index]) {
118
- return 'xl';
119
- }
120
- return 'l';
121
- };
122
- });
123
106
  // Handlers
124
107
  function onMouseEnter(event, index) {
125
108
  hoverIndex[index] = true;
@@ -139,10 +122,8 @@ var script = defineComponent({
139
122
  root,
140
123
  rootStyles,
141
124
  starStyles,
142
- starSize,
143
125
  model,
144
126
  draft,
145
- isMobile,
146
127
  hoverIndex,
147
128
  onMouseEnter,
148
129
  onMouseMove,
@@ -177,7 +158,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
177
158
  }, [createVNode(_component_OrIcon, {
178
159
  icon: _ctx.draft - value + 1 === 0.5 ? 'star_half' : 'star',
179
160
  variant: value <= _ctx.draft ? 'filled' : 'outlined',
180
- size: _ctx.starSize(value - 1)
161
+ size: _ctx.variant === 'fitted' ? 'inherit' : _ctx.hoverIndex[value - 1] ? 'xl' : 'l'
181
162
  }, null, 8 /* PROPS */, ["icon", "variant", "size"])], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_2);
182
163
  }), 128 /* KEYED_FRAGMENT */))], 10 /* CLASS, PROPS */, _hoisted_1);
183
164
  }
@@ -2,4 +2,3 @@ import { RatingVariant } from './types';
2
2
  export declare const Rating: string[];
3
3
  export declare const RatingVariants: Record<RatingVariant, string[]>;
4
4
  export declare const RatingStar: string[];
5
- export declare const RatingStarMobile: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "21.3.2",
3
+ "version": "21.4.0-beta.5370.0",
4
4
  "description": "Vue components library for v3",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -45,8 +45,8 @@
45
45
  "@codemirror/view": "^6",
46
46
  "@floating-ui/dom": "1.5.3",
47
47
  "@lezer/highlight": "*",
48
- "@onereach/styles": "^21.3.2",
49
- "@onereach/ui-components-common": "^21.3.2",
48
+ "@onereach/styles": "^21.3.1",
49
+ "@onereach/ui-components-common": "^21.4.0-beta.5370.0",
50
50
  "@splidejs/splide": "4.0.6",
51
51
  "@tiptap/core": "2.0.3",
52
52
  "@tiptap/extension-blockquote": "2.0.3",
@@ -102,6 +102,5 @@
102
102
  "publishConfig": {
103
103
  "access": "public"
104
104
  },
105
- "npmUnpacked": "4.15.2",
106
- "gitHead": "fa5876d40691fa509d8575963492da0c2cce65d0"
105
+ "npmUnpacked": "4.15.2"
107
106
  }