@onereach/ui-components 2.62.7 → 2.62.8-beta.1934.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.
Files changed (117) hide show
  1. package/dist/v2/{OrInlineInput-8455f9da.js → OrInlineInput-f00cba5e.js} +5 -4
  2. package/dist/v2/{OrInlineTextarea-1127e512.js → OrInlineTextarea-75de33d0.js} +5 -4
  3. package/dist/v2/OrSegmentedControl-17df63b8.js +236 -0
  4. package/dist/v2/{OrTabs-b4a9740b.js → OrTabs-f2a60b41.js} +1 -1
  5. package/dist/v2/components/index.d.ts +1 -0
  6. package/dist/v2/components/or-segmented-control-v3/OrSegmentedControl.stories3.d.ts +12 -0
  7. package/dist/v2/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +77 -0
  8. package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +47 -0
  9. package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +3 -0
  10. package/dist/v2/components/or-segmented-control-v3/index.d.ts +3 -0
  11. package/dist/v2/components/or-segmented-control-v3/props.d.ts +4 -0
  12. package/dist/v2/components/or-segmented-control-v3/styles.d.ts +3 -0
  13. package/dist/v2/components/or-segmented-control-v3/types.d.ts +4 -0
  14. package/dist/v2/index.js +4 -3
  15. package/dist/v2/index2.js +4 -3
  16. package/dist/v2/index34.js +1 -1
  17. package/dist/v2/index36.js +1 -1
  18. package/dist/v2/index63.js +2 -16
  19. package/dist/v2/index64.js +15 -24
  20. package/dist/v2/index65.js +26 -4
  21. package/dist/v2/index66.js +2 -1
  22. package/dist/v2/index67.js +3 -4
  23. package/dist/v2/index68.js +3 -4
  24. package/dist/v2/index69.js +3 -10
  25. package/dist/v2/index70.js +3 -6
  26. package/dist/v2/index71.js +13 -2
  27. package/dist/v2/index72.js +4 -6
  28. package/dist/v2/index73.js +6 -4
  29. package/dist/v2/index74.js +2 -1
  30. package/dist/v2/index75.js +3 -3
  31. package/dist/v2/index76.js +3 -4
  32. package/dist/v2/index77.js +4 -15
  33. package/dist/v2/index78.js +14 -11
  34. package/dist/v2/index79.js +11 -13
  35. package/dist/v2/index80.js +14 -2
  36. package/dist/v2/index81.js +2 -2
  37. package/dist/v2/index82.js +2 -3
  38. package/dist/v2/index83.js +1 -6
  39. package/dist/v2/index84.js +7 -20
  40. package/dist/v2/index85.js +12 -9
  41. package/dist/v2/index86.js +18 -1
  42. package/dist/v2/index87.js +2 -18
  43. package/dist/v2/index88.js +18 -2
  44. package/dist/v2/index89.js +2 -10
  45. package/dist/v2/index90.js +9 -11
  46. package/dist/v2/index91.js +12 -1
  47. package/dist/v2/index92.js +1 -6
  48. package/dist/v2/index93.js +5 -1
  49. package/dist/v2/index94.js +3 -0
  50. package/dist/v3/{OrInlineInput-a080b0a3.js → OrInlineInput-bac4abdd.js} +3 -2
  51. package/dist/v3/{OrInlineTextarea-08767485.js → OrInlineTextarea-d1ec1bba.js} +3 -2
  52. package/dist/v3/OrSegmentedControl-2bbc0f22.js +184 -0
  53. package/dist/v3/{OrTabs-194ca950.js → OrTabs-ac0be933.js} +1 -1
  54. package/dist/v3/components/index.d.ts +1 -0
  55. package/dist/v3/components/or-segmented-control-v3/OrSegmentedControl.stories3.d.ts +12 -0
  56. package/dist/v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +77 -0
  57. package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +47 -0
  58. package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +3 -0
  59. package/dist/v3/components/or-segmented-control-v3/index.d.ts +3 -0
  60. package/dist/v3/components/or-segmented-control-v3/props.d.ts +4 -0
  61. package/dist/v3/components/or-segmented-control-v3/styles.d.ts +3 -0
  62. package/dist/v3/components/or-segmented-control-v3/types.d.ts +4 -0
  63. package/dist/v3/index.js +4 -3
  64. package/dist/v3/index2.js +4 -3
  65. package/dist/v3/index34.js +1 -1
  66. package/dist/v3/index36.js +1 -1
  67. package/dist/v3/index63.js +2 -15
  68. package/dist/v3/index64.js +13 -22
  69. package/dist/v3/index65.js +24 -3
  70. package/dist/v3/index66.js +2 -1
  71. package/dist/v3/index67.js +3 -4
  72. package/dist/v3/index68.js +3 -4
  73. package/dist/v3/index69.js +3 -9
  74. package/dist/v3/index70.js +3 -4
  75. package/dist/v3/index71.js +10 -2
  76. package/dist/v3/index72.js +3 -5
  77. package/dist/v3/index73.js +5 -3
  78. package/dist/v3/index74.js +2 -1
  79. package/dist/v3/index75.js +3 -3
  80. package/dist/v3/index76.js +3 -4
  81. package/dist/v3/index77.js +4 -14
  82. package/dist/v3/index78.js +13 -10
  83. package/dist/v3/index79.js +10 -12
  84. package/dist/v3/index80.js +13 -1
  85. package/dist/v3/index81.js +1 -1
  86. package/dist/v3/index82.js +1 -3
  87. package/dist/v3/index83.js +1 -6
  88. package/dist/v3/index84.js +6 -16
  89. package/dist/v3/index85.js +12 -9
  90. package/dist/v3/index86.js +15 -1
  91. package/dist/v3/index87.js +2 -17
  92. package/dist/v3/index88.js +17 -2
  93. package/dist/v3/index89.js +2 -8
  94. package/dist/v3/index90.js +6 -9
  95. package/dist/v3/index91.js +11 -1
  96. package/dist/v3/index92.js +1 -6
  97. package/dist/v3/index93.js +5 -1
  98. package/dist/v3/index94.js +3 -0
  99. package/package.json +2 -3
  100. package/src/components/index.ts +1 -0
  101. package/src/components/or-checkbox-v3/OrCheckbox.stories3.ts +1 -1
  102. package/src/components/or-inline-input-v3/OrInlineInput.vue +2 -2
  103. package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +2 -2
  104. package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
  105. package/src/components/or-segmented-control-v3/OrSegmentedControl.docs.mdx +7 -0
  106. package/src/components/or-segmented-control-v3/OrSegmentedControl.stories3.ts +106 -0
  107. package/src/components/or-segmented-control-v3/OrSegmentedControl.vue +107 -0
  108. package/src/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue +64 -0
  109. package/src/components/or-segmented-control-v3/components/or-segmented-control-item/styles.ts +50 -0
  110. package/src/components/or-segmented-control-v3/index.ts +3 -0
  111. package/src/components/or-segmented-control-v3/props.ts +4 -0
  112. package/src/components/or-segmented-control-v3/styles.ts +24 -0
  113. package/src/components/or-segmented-control-v3/types.ts +4 -0
  114. package/src/components/or-switch-v3/OrSwitch.stories3.ts +1 -1
  115. package/src/components/or-tabs-v3/OrTabs.stories3.ts +9 -4
  116. package/src/components/or-tabs-v3/OrTabs.vue +1 -1
  117. package/src/hooks/useClassAttribute.ts +1 -1
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div
3
+ ref="root"
4
+ v-bind="$attrs"
5
+ :class="rootStyles"
6
+ :selected="selected ? '' : null"
7
+ :disabled="disabled ? '' : null"
8
+ @click="$emit('click', $event)"
9
+ >
10
+ <div :class="['truncate']">
11
+ <slot />
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script lang="ts">
17
+ import { computed, defineComponent, PropType, ref } from 'vue-demi';
18
+ import { useClassAttribute } from '../../../../hooks';
19
+ import { SegmentedControlSize } from '../../props';
20
+ import { SegmentedControlItemRoot, SegmentedControlItemRootSizes } from './styles';
21
+
22
+ export default defineComponent({
23
+ name: 'OrSegmentedControlItem',
24
+
25
+ inheritAttrs: false,
26
+
27
+ props: {
28
+ size: {
29
+ type: String as PropType<SegmentedControlSize>,
30
+ required: true,
31
+ },
32
+
33
+ selected: {
34
+ type: Boolean,
35
+ default: false,
36
+ },
37
+
38
+ disabled: {
39
+ type: Boolean,
40
+ default: false,
41
+ },
42
+ },
43
+
44
+ setup(props) {
45
+ // Refs
46
+ const root = ref<HTMLElement>();
47
+
48
+ // Styles
49
+ const classAttribute = useClassAttribute();
50
+
51
+ const rootStyles = computed(() => [
52
+ 'or-segmented-control-item',
53
+ ...SegmentedControlItemRoot,
54
+ ...SegmentedControlItemRootSizes[props.size],
55
+ classAttribute.value,
56
+ ]);
57
+
58
+ return {
59
+ root,
60
+ rootStyles,
61
+ };
62
+ },
63
+ });
64
+ </script>
@@ -0,0 +1,50 @@
1
+ import { SegmentedControlSize } from '../../props';
2
+
3
+ export const SegmentedControlItemRoot: string[] = [
4
+ // Layout
5
+ 'flex',
6
+ 'items-center',
7
+ 'justify-center',
8
+
9
+ // Shape
10
+ 'rounded-md',
11
+
12
+ // Interactivity
13
+ 'interactivity-auto',
14
+
15
+ // Theme
16
+ 'theme-foreground-default',
17
+ 'dark:theme-foreground-default-dark',
18
+
19
+ // Theme (selected)
20
+ 'selected:theme-background-default',
21
+ 'dark:selected:theme-background-default-dark',
22
+
23
+ // Theme (selected, enabled)
24
+ 'selected:enabled:shadow-card',
25
+ 'dark:selected:enabled:shadow-card-dark',
26
+ ];
27
+
28
+ export const SegmentedControlItemRootSizes: Record<SegmentedControlSize, string[]> = {
29
+ 'm': [
30
+ // Box
31
+ 'h-[44px] md:h-[36px]',
32
+
33
+ // Spacing
34
+ 'px-sm+ md:px-sm+',
35
+
36
+ // Typography
37
+ 'typography-body-2-regular',
38
+ ],
39
+
40
+ 's': [
41
+ // Box
42
+ 'h-[36px] md:h-[32px]',
43
+
44
+ // Spacing
45
+ 'px-sm+ md:px-sm',
46
+
47
+ // Typography
48
+ 'typography-caption-regular',
49
+ ],
50
+ };
@@ -0,0 +1,3 @@
1
+ export { default as OrSegmentedControlV3 } from './OrSegmentedControl.vue';
2
+ export * from './props';
3
+ export * from './types';
@@ -0,0 +1,4 @@
1
+ export enum SegmentedControlSize {
2
+ M = 'm',
3
+ S = 's',
4
+ }
@@ -0,0 +1,24 @@
1
+ import { SegmentedControlSize } from './props';
2
+
3
+ export const SegmentedControlRoot: string[] = [
4
+ // Layout
5
+ 'grid',
6
+ 'grid-flow-col',
7
+ 'auto-cols-fr',
8
+
9
+ // Shape
10
+ 'rounded-md',
11
+
12
+ // Spacing
13
+ 'px-[2px]',
14
+ 'py-[2px]',
15
+
16
+ // Theme
17
+ 'theme-background-surface-variant',
18
+ 'dark:theme-background-surface-variant-dark',
19
+ ];
20
+
21
+ export const SegmentedControlRootSizes: Record<SegmentedControlSize, string[]> = {
22
+ 'm': [],
23
+ 's': [],
24
+ };
@@ -0,0 +1,4 @@
1
+ export interface SegmentedControlOption {
2
+ value: string;
3
+ label: string;
4
+ }
@@ -27,7 +27,7 @@ export default {
27
27
  },
28
28
 
29
29
  value: { // TODO: Remove Vue 2 fallback
30
- control: { type: 'object' },
30
+ table: { disable: true },
31
31
  },
32
32
 
33
33
  inputValue: { // TODO: Rename to `value` after complete migration to Vue 3
@@ -1,6 +1,6 @@
1
1
  import { action } from '@storybook/addon-actions';
2
2
  import { Meta, StoryFn } from '@storybook/vue3';
3
- import { ref } from 'vue-demi';
3
+ import { ref, watch } from 'vue-demi';
4
4
  import OrTabsDocs from './OrTabs.docs.mdx';
5
5
  import OrTabs from './OrTabs.vue';
6
6
  import { TabsVariant } from './props';
@@ -63,11 +63,16 @@ const Template: StoryFn<typeof OrTabs> = (args) => ({
63
63
 
64
64
  setup() {
65
65
  // State
66
- const value = ref<string>();
66
+ const model = ref<string>();
67
+
68
+ // Effects
69
+ watch(model, (value) => {
70
+ console.debug(value);
71
+ });
67
72
 
68
73
  return {
69
74
  args,
70
- value,
75
+ model,
71
76
  onUpdateModelValue: action('update:modelValue'),
72
77
  onInput: action('input'),
73
78
  };
@@ -75,7 +80,7 @@ const Template: StoryFn<typeof OrTabs> = (args) => ({
75
80
 
76
81
  template: `
77
82
  <OrTabs
78
- v-model="value"
83
+ v-model="model"
79
84
  v-bind="args"
80
85
  @update:modelValue="onUpdateModelValue"
81
86
  @input="onInput"
@@ -8,7 +8,7 @@
8
8
  <OrTab
9
9
  v-for="tab in tabs.normal"
10
10
  :key="tab.value"
11
- :selected="proxyModelValue === tab.value"
11
+ :selected="tab.value === proxyModelValue"
12
12
  @click.stop="proxyModelValue = tab.value"
13
13
  >
14
14
  {{ tab.label }}
@@ -8,7 +8,7 @@ export function useClassAttribute(): UseClassAttributeReturn {
8
8
 
9
9
  // Functions
10
10
  function composeClass(): UnwrapRef<UseClassAttributeReturn> {
11
- const { staticClass = '', class: classProperty } = (currentInstance?.vnode as VNode).data ?? {};
11
+ const { staticClass = '', class: classProperty } = (currentInstance?.vnode as unknown as VNode).data ?? {};
12
12
 
13
13
  if (!classProperty) {
14
14
  return staticClass || undefined;