@onereach/ui-components 2.62.7-beta.1928.0 → 2.62.7-beta.1930.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/v2/OrCardCollection-5d5046f1.js +227 -0
- package/dist/v2/{OrConfirm-24e2a1a2.js → OrConfirm-edc537b3.js} +1 -1
- package/dist/v2/{OrInlineInput-8455f9da.js → OrInlineInput-73ec1b85.js} +5 -5
- package/dist/v2/{OrInlineTextarea-1127e512.js → OrInlineTextarea-1858a348.js} +5 -5
- package/dist/v2/{OrInput-24028f23.js → OrInput-655bed71.js} +5 -5
- package/dist/v2/{OrSearch-978a3a6e.js → OrSearch-287a08a9.js} +1 -1
- package/dist/v2/{OrSelect-c6d0a69e.js → OrSelect-1a353817.js} +3 -3
- package/dist/v2/OrSortHeader-a6004b24.js +133 -0
- package/dist/v2/{OrTextarea-8773d494.js → OrTextarea-cc70afc9.js} +5 -5
- package/dist/v2/components/index.d.ts +2 -1
- package/dist/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +17 -0
- package/dist/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +98 -0
- package/dist/v2/components/or-card-collection-v3/index.d.ts +3 -0
- package/dist/v2/components/or-card-collection-v3/props.d.ts +4 -0
- package/dist/v2/components/or-card-collection-v3/styles.d.ts +6 -0
- package/dist/v2/components/or-card-collection-v3/types.d.ts +7 -0
- package/dist/v2/components/{or-segmented-control-v3/OrSegmentedControl.stories3.d.ts → or-sort-header-v3/OrSortHeader.stories3.d.ts} +1 -1
- package/dist/{v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts → v2/components/or-sort-header-v3/OrSortHeader.vue.d.ts} +25 -45
- package/dist/v2/components/or-sort-header-v3/index.d.ts +2 -0
- package/dist/v2/components/or-sort-header-v3/styles.d.ts +1 -0
- package/dist/v2/components/or-sort-header-v3/types.d.ts +4 -0
- package/dist/v2/index.js +9 -8
- package/dist/v2/index11.js +20 -1
- package/dist/v2/index12.js +3 -12
- package/dist/v2/index13.js +3 -2
- package/dist/v2/index14.js +11 -5
- package/dist/v2/index15.js +5 -14
- package/dist/v2/index16.js +4 -19
- package/dist/v2/index17.js +28 -4
- package/dist/v2/index18.js +3 -7
- package/dist/v2/index19.js +5 -23
- package/dist/v2/index2.js +9 -8
- package/dist/v2/index20.js +25 -21
- package/dist/v2/index21.js +21 -18
- package/dist/v2/index22.js +20 -2
- package/dist/v2/index23.js +2 -4
- package/dist/v2/index24.js +2 -1
- package/dist/v2/index25.js +1 -2
- package/dist/v2/index26.js +2 -2
- package/dist/v2/index27.js +4 -7
- package/dist/v2/index28.js +6 -2
- package/dist/v2/index29.js +3 -3
- package/dist/v2/index30.js +3 -10
- package/dist/v2/index31.js +9 -12
- package/dist/v2/index32.js +11 -1
- package/dist/v2/index33.js +1 -1
- package/dist/v2/index34.js +1 -16
- package/dist/v2/index35.js +17 -17
- package/dist/v2/index36.js +17 -17
- package/dist/v2/index37.js +16 -1
- package/dist/v2/index38.js +1 -17
- package/dist/v2/index39.js +18 -22
- package/dist/v2/index40.js +22 -2
- package/dist/v2/index41.js +3 -3
- package/dist/v2/index42.js +1 -1
- package/dist/v2/index43.js +3 -20
- package/dist/v2/index44.js +1 -7
- package/dist/v2/index45.js +24 -1
- package/dist/v2/index46.js +3 -3
- package/dist/v2/index47.js +1 -2
- package/dist/v2/index48.js +2 -9
- package/dist/v2/index49.js +10 -17
- package/dist/v2/index50.js +17 -13
- package/dist/v2/index51.js +13 -14
- package/dist/v2/index52.js +14 -13
- package/dist/v2/index53.js +12 -15
- package/dist/v2/index54.js +16 -1
- package/dist/v2/index55.js +2 -6
- package/dist/v2/index56.js +1 -5
- package/dist/v2/index57.js +10 -3
- package/dist/v2/index58.js +2 -4
- package/dist/v2/index59.js +5 -3
- package/dist/v2/index60.js +2 -1
- package/dist/v2/index61.js +2 -5
- package/dist/v2/index62.js +3 -18
- package/dist/v2/index63.js +19 -2
- package/dist/v2/index65.js +2 -2
- package/dist/v2/index71.js +4 -15
- package/dist/v2/index72.js +13 -2
- package/dist/v2/index73.js +4 -6
- package/dist/v2/index74.js +6 -4
- package/dist/v2/index75.js +2 -1
- package/dist/v2/index76.js +3 -3
- package/dist/v2/index77.js +3 -4
- package/dist/v2/index78.js +4 -15
- package/dist/v2/index79.js +14 -11
- package/dist/v2/index80.js +11 -13
- package/dist/v2/index81.js +14 -2
- package/dist/v2/index82.js +2 -2
- package/dist/v2/index83.js +2 -3
- package/dist/v2/index84.js +1 -6
- package/dist/v2/index85.js +7 -20
- package/dist/v2/index86.js +12 -9
- package/dist/v2/index87.js +18 -1
- package/dist/v2/index88.js +2 -18
- package/dist/v2/index89.js +18 -2
- package/dist/v2/index90.js +2 -10
- package/dist/v2/index91.js +9 -11
- package/dist/v2/index92.js +12 -1
- package/dist/v2/index93.js +1 -6
- package/dist/v2/index94.js +5 -1
- package/dist/v2/index95.js +3 -0
- package/dist/v3/OrCardCollection-c6f3ac23.js +198 -0
- package/dist/v3/{OrConfirm-371630a4.js → OrConfirm-0bafcc7b.js} +1 -1
- package/dist/v3/{OrInlineInput-a080b0a3.js → OrInlineInput-dc71bbcb.js} +5 -3
- package/dist/v3/{OrInlineTextarea-08767485.js → OrInlineTextarea-bdebb784.js} +5 -3
- package/dist/v3/{OrInput-256d2530.js → OrInput-db4813b4.js} +5 -3
- package/dist/v3/{OrSearch-375eab55.js → OrSearch-0c29f499.js} +1 -1
- package/dist/v3/{OrSelect-52cfb10d.js → OrSelect-323a87b4.js} +6 -4
- package/dist/v3/OrSortHeader-5eba50cd.js +104 -0
- package/dist/v3/{OrTextarea-09aa33dc.js → OrTextarea-98895b2a.js} +6 -4
- package/dist/v3/components/index.d.ts +2 -1
- package/dist/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +17 -0
- package/dist/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +98 -0
- package/dist/v3/components/or-card-collection-v3/index.d.ts +3 -0
- package/dist/v3/components/or-card-collection-v3/props.d.ts +4 -0
- package/dist/v3/components/or-card-collection-v3/styles.d.ts +6 -0
- package/dist/v3/components/or-card-collection-v3/types.d.ts +7 -0
- package/dist/v3/components/{or-segmented-control-v3/OrSegmentedControl.stories3.d.ts → or-sort-header-v3/OrSortHeader.stories3.d.ts} +1 -1
- package/dist/{v2/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts → v3/components/or-sort-header-v3/OrSortHeader.vue.d.ts} +25 -45
- package/dist/v3/components/or-sort-header-v3/index.d.ts +2 -0
- package/dist/v3/components/or-sort-header-v3/styles.d.ts +1 -0
- package/dist/v3/components/or-sort-header-v3/types.d.ts +4 -0
- package/dist/v3/index.js +9 -8
- package/dist/v3/index11.js +19 -1
- package/dist/v3/index12.js +3 -11
- package/dist/v3/index13.js +3 -2
- package/dist/v3/index14.js +9 -4
- package/dist/v3/index15.js +4 -11
- package/dist/v3/index16.js +3 -17
- package/dist/v3/index17.js +25 -4
- package/dist/v3/index18.js +3 -6
- package/dist/v3/index19.js +5 -20
- package/dist/v3/index2.js +9 -8
- package/dist/v3/index20.js +21 -20
- package/dist/v3/index21.js +20 -15
- package/dist/v3/index22.js +16 -1
- package/dist/v3/index23.js +2 -4
- package/dist/v3/index24.js +2 -1
- package/dist/v3/index25.js +1 -2
- package/dist/v3/index26.js +2 -2
- package/dist/v3/index27.js +4 -6
- package/dist/v3/index28.js +5 -2
- package/dist/v3/index29.js +3 -3
- package/dist/v3/index30.js +3 -9
- package/dist/v3/index31.js +8 -11
- package/dist/v3/index32.js +10 -1
- package/dist/v3/index33.js +1 -1
- package/dist/v3/index34.js +1 -15
- package/dist/v3/index35.js +16 -14
- package/dist/v3/index36.js +14 -16
- package/dist/v3/index37.js +16 -2
- package/dist/v3/index38.js +2 -17
- package/dist/v3/index39.js +17 -17
- package/dist/v3/index40.js +16 -1
- package/dist/v3/index41.js +3 -3
- package/dist/v3/index42.js +1 -1
- package/dist/v3/index43.js +3 -16
- package/dist/v3/index44.js +1 -7
- package/dist/v3/index45.js +20 -1
- package/dist/v3/index46.js +3 -3
- package/dist/v3/index47.js +1 -2
- package/dist/v3/index48.js +2 -8
- package/dist/v3/index49.js +9 -14
- package/dist/v3/index50.js +14 -12
- package/dist/v3/index51.js +12 -11
- package/dist/v3/index52.js +11 -12
- package/dist/v3/index53.js +11 -11
- package/dist/v3/index54.js +12 -1
- package/dist/v3/index55.js +2 -5
- package/dist/v3/index56.js +1 -5
- package/dist/v3/index57.js +9 -3
- package/dist/v3/index58.js +2 -4
- package/dist/v3/index59.js +5 -3
- package/dist/v3/index60.js +2 -1
- package/dist/v3/index61.js +1 -4
- package/dist/v3/index62.js +3 -17
- package/dist/v3/index63.js +18 -2
- package/dist/v3/index65.js +2 -2
- package/dist/v3/index71.js +4 -12
- package/dist/v3/index72.js +10 -2
- package/dist/v3/index73.js +3 -5
- package/dist/v3/index74.js +5 -3
- package/dist/v3/index75.js +2 -1
- package/dist/v3/index76.js +3 -3
- package/dist/v3/index77.js +3 -4
- package/dist/v3/index78.js +4 -14
- package/dist/v3/index79.js +13 -10
- package/dist/v3/index80.js +10 -12
- package/dist/v3/index81.js +13 -1
- package/dist/v3/index82.js +1 -1
- package/dist/v3/index83.js +1 -3
- package/dist/v3/index84.js +1 -6
- package/dist/v3/index85.js +6 -16
- package/dist/v3/index86.js +12 -9
- package/dist/v3/index87.js +15 -1
- package/dist/v3/index88.js +2 -17
- package/dist/v3/index89.js +17 -2
- package/dist/v3/index90.js +2 -8
- package/dist/v3/index91.js +6 -9
- package/dist/v3/index92.js +11 -1
- package/dist/v3/index93.js +1 -6
- package/dist/v3/index94.js +5 -1
- package/dist/v3/index95.js +3 -0
- package/package.json +1 -1
- package/src/components/index.ts +2 -1
- package/src/components/or-card-collection-v3/OrCardCollection.docs.mdx +3 -0
- package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +162 -0
- package/src/components/or-card-collection-v3/OrCardCollection.vue +210 -0
- package/src/components/or-card-collection-v3/index.ts +3 -0
- package/src/components/or-card-collection-v3/props.ts +4 -0
- package/src/components/or-card-collection-v3/styles.ts +53 -0
- package/src/components/or-card-collection-v3/types.ts +8 -0
- package/src/components/or-checkbox-v3/OrCheckbox.stories3.ts +1 -1
- package/src/components/or-inline-input-v3/OrInlineInput.vue +12 -10
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +12 -10
- package/src/components/or-input-v3/OrInput.vue +12 -10
- package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
- package/src/components/or-select-v3/OrSelect.vue +5 -3
- package/src/components/or-sort-header-v3/OrSortHeader.docs.mdx +3 -0
- package/src/components/or-sort-header-v3/OrSortHeader.stories3.ts +132 -0
- package/src/components/{or-segmented-control-v3/OrSegmentedControl.vue → or-sort-header-v3/OrSortHeader.vue} +36 -34
- package/src/components/or-sort-header-v3/index.ts +2 -0
- package/src/components/or-sort-header-v3/styles.ts +23 -0
- package/src/components/or-sort-header-v3/types.ts +4 -0
- package/src/components/or-switch-v3/OrSwitch.stories3.ts +1 -1
- package/src/components/or-textarea-v3/OrTextarea.vue +12 -10
- package/dist/v2/OrSegmentedControl-58b5db14.js +0 -231
- package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +0 -47
- package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +0 -3
- package/dist/v2/components/or-segmented-control-v3/index.d.ts +0 -3
- package/dist/v2/components/or-segmented-control-v3/props.d.ts +0 -4
- package/dist/v2/components/or-segmented-control-v3/styles.d.ts +0 -3
- package/dist/v2/components/or-segmented-control-v3/types.d.ts +0 -4
- package/dist/v3/OrSegmentedControl-e45af169.js +0 -183
- package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +0 -47
- package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +0 -3
- package/dist/v3/components/or-segmented-control-v3/index.d.ts +0 -3
- package/dist/v3/components/or-segmented-control-v3/props.d.ts +0 -4
- package/dist/v3/components/or-segmented-control-v3/styles.d.ts +0 -3
- package/dist/v3/components/or-segmented-control-v3/types.d.ts +0 -4
- package/src/components/or-segmented-control-v3/OrSegmentedControl.docs.mdx +0 -7
- package/src/components/or-segmented-control-v3/OrSegmentedControl.stories3.ts +0 -118
- package/src/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue +0 -63
- package/src/components/or-segmented-control-v3/components/or-segmented-control-item/styles.ts +0 -50
- package/src/components/or-segmented-control-v3/index.ts +0 -3
- package/src/components/or-segmented-control-v3/props.ts +0 -4
- package/src/components/or-segmented-control-v3/styles.ts +0 -24
- package/src/components/or-segmented-control-v3/types.ts +0 -4
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed } from 'vue-demi';
|
|
2
|
-
import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
|
|
3
|
-
import '@vueuse/core';
|
|
4
|
-
import { openBlock, createElementBlock, mergeProps, createElementVNode, renderSlot, normalizeClass, resolveComponent, Fragment, renderList, createBlock, withModifiers, withCtx, createTextVNode, toDisplayString } from 'vue';
|
|
5
|
-
|
|
6
|
-
const SegmentedControlItemRoot = [
|
|
7
|
-
// Layout
|
|
8
|
-
'flex', 'items-center', 'justify-center',
|
|
9
|
-
// Shape
|
|
10
|
-
'rounded-md',
|
|
11
|
-
// Interactivity
|
|
12
|
-
'interactivity-auto',
|
|
13
|
-
// Theme
|
|
14
|
-
'theme-foreground-default', 'dark:theme-foreground-default-dark',
|
|
15
|
-
// Theme (selected)
|
|
16
|
-
'selected:theme-background-default', 'dark:selected:theme-background-default-dark',
|
|
17
|
-
// Theme (selected, enabled)
|
|
18
|
-
'selected:enabled:shadow-card', 'dark:selected:enabled:shadow-card-dark'];
|
|
19
|
-
const SegmentedControlItemRootSizes = {
|
|
20
|
-
'm': [
|
|
21
|
-
// Box
|
|
22
|
-
'h-[44px] md:h-[36px]',
|
|
23
|
-
// Spacing
|
|
24
|
-
'px-sm+ md:px-sm+',
|
|
25
|
-
// Typography
|
|
26
|
-
'typography-body-2-regular'],
|
|
27
|
-
's': [
|
|
28
|
-
// Box
|
|
29
|
-
'h-[36px] md:h-[32px]',
|
|
30
|
-
// Spacing
|
|
31
|
-
'px-sm+ md:px-sm',
|
|
32
|
-
// Typography
|
|
33
|
-
'typography-caption-regular']
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
var script$1 = defineComponent({
|
|
37
|
-
name: 'OrSegmentedControlItem',
|
|
38
|
-
inheritAttrs: false,
|
|
39
|
-
props: {
|
|
40
|
-
size: {
|
|
41
|
-
type: String,
|
|
42
|
-
required: true
|
|
43
|
-
},
|
|
44
|
-
selected: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: false
|
|
47
|
-
},
|
|
48
|
-
disabled: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: false
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
setup(props) {
|
|
54
|
-
// Refs
|
|
55
|
-
const root = ref();
|
|
56
|
-
// Styles
|
|
57
|
-
const classAttribute = useClassAttribute();
|
|
58
|
-
const rootStyles = computed(() => ['or-segmented-control-item', ...SegmentedControlItemRoot, ...SegmentedControlItemRootSizes[props.size], classAttribute.value]);
|
|
59
|
-
return {
|
|
60
|
-
root,
|
|
61
|
-
rootStyles
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const _hoisted_1 = ["selected", "disabled"];
|
|
67
|
-
const _hoisted_2 = {
|
|
68
|
-
class: /*#__PURE__*/normalizeClass(['truncate'])
|
|
69
|
-
};
|
|
70
|
-
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
71
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
72
|
-
ref: "root"
|
|
73
|
-
}, _ctx.$attrs, {
|
|
74
|
-
class: _ctx.rootStyles,
|
|
75
|
-
selected: _ctx.selected ? '' : null,
|
|
76
|
-
disabled: _ctx.disabled ? '' : null
|
|
77
|
-
}), [createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "default")])], 16 /* FULL_PROPS */, _hoisted_1);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
script$1.render = render$1;
|
|
81
|
-
script$1.__file = "src/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue";
|
|
82
|
-
|
|
83
|
-
var SegmentedControlSize;
|
|
84
|
-
(function (SegmentedControlSize) {
|
|
85
|
-
SegmentedControlSize["M"] = "m";
|
|
86
|
-
SegmentedControlSize["S"] = "s";
|
|
87
|
-
})(SegmentedControlSize || (SegmentedControlSize = {}));
|
|
88
|
-
|
|
89
|
-
const SegmentedControlRoot = [
|
|
90
|
-
// Layout
|
|
91
|
-
'grid', 'grid-flow-col', 'auto-cols-fr',
|
|
92
|
-
// Shape
|
|
93
|
-
'rounded-md',
|
|
94
|
-
// Spacing
|
|
95
|
-
'px-[2px]', 'py-[2px]',
|
|
96
|
-
// Theme
|
|
97
|
-
'theme-background-surface-variant', 'dark:theme-background-surface-variant-dark'];
|
|
98
|
-
const SegmentedControlRootSizes = {
|
|
99
|
-
'm': [],
|
|
100
|
-
's': []
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
var script = defineComponent({
|
|
104
|
-
name: 'OrSegmentedControl',
|
|
105
|
-
components: {
|
|
106
|
-
OrSegmentedControlItem: script$1
|
|
107
|
-
},
|
|
108
|
-
inheritAttrs: false,
|
|
109
|
-
props: {
|
|
110
|
-
options: {
|
|
111
|
-
type: Array,
|
|
112
|
-
default: []
|
|
113
|
-
},
|
|
114
|
-
modelValue: {
|
|
115
|
-
type: String,
|
|
116
|
-
default: undefined
|
|
117
|
-
},
|
|
118
|
-
value: {
|
|
119
|
-
type: String,
|
|
120
|
-
default: undefined
|
|
121
|
-
},
|
|
122
|
-
size: {
|
|
123
|
-
type: String,
|
|
124
|
-
default: SegmentedControlSize.M
|
|
125
|
-
},
|
|
126
|
-
disabled: {
|
|
127
|
-
type: Boolean,
|
|
128
|
-
default: false
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
emits: ['update:modelValue', 'input', 'focus', 'blur'],
|
|
132
|
-
expose: ['root'],
|
|
133
|
-
setup(props, context) {
|
|
134
|
-
// Refs
|
|
135
|
-
const root = ref();
|
|
136
|
-
// Styles
|
|
137
|
-
const classAttribute = useClassAttribute();
|
|
138
|
-
const rootStyles = computed(() => ['or-segmented-control', ...SegmentedControlRoot, ...SegmentedControlRootSizes[props.size], classAttribute.value]);
|
|
139
|
-
// State
|
|
140
|
-
const proxyModelValue = computed({
|
|
141
|
-
get: () => {
|
|
142
|
-
var _a;
|
|
143
|
-
return (_a = props.modelValue) !== null && _a !== void 0 ? _a : props.value; // TODO: Remove Vue 2 fallback
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
set: value => {
|
|
147
|
-
context.emit('input', value);
|
|
148
|
-
context.emit('update:modelValue', value);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
return {
|
|
152
|
-
root,
|
|
153
|
-
rootStyles,
|
|
154
|
-
proxyModelValue
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
160
|
-
const _component_OrSegmentedControlItem = resolveComponent("OrSegmentedControlItem");
|
|
161
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
162
|
-
ref: "root"
|
|
163
|
-
}, _ctx.$attrs, {
|
|
164
|
-
class: _ctx.rootStyles
|
|
165
|
-
}), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, option => {
|
|
166
|
-
return openBlock(), createBlock(_component_OrSegmentedControlItem, {
|
|
167
|
-
key: option.value,
|
|
168
|
-
size: _ctx.size,
|
|
169
|
-
selected: option.value === _ctx.proxyModelValue,
|
|
170
|
-
disabled: _ctx.disabled,
|
|
171
|
-
onClick: withModifiers($event => _ctx.proxyModelValue = option.value, ["stop"])
|
|
172
|
-
}, {
|
|
173
|
-
default: withCtx(() => [createTextVNode(toDisplayString(option.label), 1 /* TEXT */)]),
|
|
174
|
-
|
|
175
|
-
_: 2 /* DYNAMIC */
|
|
176
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["size", "selected", "disabled", "onClick"]);
|
|
177
|
-
}), 128 /* KEYED_FRAGMENT */))], 16 /* FULL_PROPS */);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
script.render = render;
|
|
181
|
-
script.__file = "src/components/or-segmented-control-v3/OrSegmentedControl.vue";
|
|
182
|
-
|
|
183
|
-
export { SegmentedControlSize as S, script as s };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { PropType } from 'vue-demi';
|
|
2
|
-
import { SegmentedControlSize } from '../../props';
|
|
3
|
-
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
|
-
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
5
|
-
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
6
|
-
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
7
|
-
size: {
|
|
8
|
-
type: PropType<SegmentedControlSize>;
|
|
9
|
-
required: true;
|
|
10
|
-
};
|
|
11
|
-
selected: {
|
|
12
|
-
type: BooleanConstructor;
|
|
13
|
-
default: boolean;
|
|
14
|
-
};
|
|
15
|
-
disabled: {
|
|
16
|
-
type: BooleanConstructor;
|
|
17
|
-
default: boolean;
|
|
18
|
-
};
|
|
19
|
-
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
20
|
-
size: {
|
|
21
|
-
type: PropType<SegmentedControlSize>;
|
|
22
|
-
required: true;
|
|
23
|
-
};
|
|
24
|
-
selected: {
|
|
25
|
-
type: BooleanConstructor;
|
|
26
|
-
default: boolean;
|
|
27
|
-
};
|
|
28
|
-
disabled: {
|
|
29
|
-
type: BooleanConstructor;
|
|
30
|
-
default: boolean;
|
|
31
|
-
};
|
|
32
|
-
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
33
|
-
size: SegmentedControlSize;
|
|
34
|
-
selected: boolean;
|
|
35
|
-
disabled: boolean;
|
|
36
|
-
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
37
|
-
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
38
|
-
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
39
|
-
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
|
|
40
|
-
size: SegmentedControlSize;
|
|
41
|
-
selected: boolean;
|
|
42
|
-
disabled: boolean;
|
|
43
|
-
} & {}, {
|
|
44
|
-
selected: boolean;
|
|
45
|
-
disabled: boolean;
|
|
46
|
-
}, true>);
|
|
47
|
-
export default _default;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
-
import { ref, watch } from 'vue-demi';
|
|
4
|
-
import OrSegmentedControlDocs from './OrSegmentedControl.docs.mdx';
|
|
5
|
-
import OrSegmentedControl from './OrSegmentedControl.vue';
|
|
6
|
-
import { SegmentedControlSize } from './props';
|
|
7
|
-
import { SegmentedControlOption } from './types';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: 'Components/Forms/Segmented Control',
|
|
11
|
-
component: OrSegmentedControl,
|
|
12
|
-
|
|
13
|
-
argTypes: {
|
|
14
|
-
// Props
|
|
15
|
-
options: {
|
|
16
|
-
control: { type: 'object' },
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
modelValue: {
|
|
20
|
-
control: { type: 'text' },
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
value: { // TODO: Remove Vue 2 fallback
|
|
24
|
-
table: { disable: true },
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
size: {
|
|
28
|
-
control: { type: 'select' },
|
|
29
|
-
options: Object.values(SegmentedControlSize),
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
disabled: {
|
|
33
|
-
control: { type: 'boolean' },
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
// Events
|
|
37
|
-
'update:modelValue': {
|
|
38
|
-
table: { disable: true },
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
input: {
|
|
42
|
-
table: { disable: true },
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
focus: {
|
|
46
|
-
table: { disable: true },
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
blur: {
|
|
50
|
-
table: { disable: true },
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
parameters: {
|
|
55
|
-
layout: 'centered',
|
|
56
|
-
|
|
57
|
-
docs: {
|
|
58
|
-
page: OrSegmentedControlDocs,
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
design: {
|
|
62
|
-
type: 'figma',
|
|
63
|
-
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=410%3A2097&t=7N93DAotOYMOX2kx-1',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
} as Meta<typeof OrSegmentedControl>;
|
|
67
|
-
|
|
68
|
-
const Template: StoryFn<typeof OrSegmentedControl> = (args) => ({
|
|
69
|
-
components: {
|
|
70
|
-
OrSegmentedControl,
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
setup() {
|
|
74
|
-
// State
|
|
75
|
-
const model = ref<string>();
|
|
76
|
-
|
|
77
|
-
// Effects
|
|
78
|
-
watch(model, (value) => {
|
|
79
|
-
console.debug(value);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
return {
|
|
83
|
-
args,
|
|
84
|
-
model,
|
|
85
|
-
onUpdateModelValue: action('update:modelValue'),
|
|
86
|
-
onInput: action('input'),
|
|
87
|
-
onFocus: action('focus'),
|
|
88
|
-
onBlur: action('blur'),
|
|
89
|
-
};
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
template: `
|
|
93
|
-
<OrSegmentedControl
|
|
94
|
-
v-model="model"
|
|
95
|
-
v-bind="args"
|
|
96
|
-
@update:modelValue="onUpdateModelValue"
|
|
97
|
-
@input="onInput"
|
|
98
|
-
@focus="onFocus"
|
|
99
|
-
@blur="onBlur"
|
|
100
|
-
/>
|
|
101
|
-
`,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
export const Base = Template.bind({});
|
|
105
|
-
|
|
106
|
-
Base.args = {
|
|
107
|
-
// Props
|
|
108
|
-
options: Array.from<string, SegmentedControlOption>([
|
|
109
|
-
'Alfa',
|
|
110
|
-
'Bravo',
|
|
111
|
-
'Charlie',
|
|
112
|
-
'Delta',
|
|
113
|
-
'Echo',
|
|
114
|
-
], (item) => ({
|
|
115
|
-
value: item.toLowerCase(),
|
|
116
|
-
label: item,
|
|
117
|
-
})),
|
|
118
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="root"
|
|
4
|
-
v-bind="$attrs"
|
|
5
|
-
:class="rootStyles"
|
|
6
|
-
:selected="selected ? '' : null"
|
|
7
|
-
:disabled="disabled ? '' : null"
|
|
8
|
-
>
|
|
9
|
-
<div :class="['truncate']">
|
|
10
|
-
<slot />
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script lang="ts">
|
|
16
|
-
import { computed, defineComponent, PropType, ref } from 'vue-demi';
|
|
17
|
-
import { useClassAttribute } from '../../../../hooks';
|
|
18
|
-
import { SegmentedControlSize } from '../../props';
|
|
19
|
-
import { SegmentedControlItemRoot, SegmentedControlItemRootSizes } from './styles';
|
|
20
|
-
|
|
21
|
-
export default defineComponent({
|
|
22
|
-
name: 'OrSegmentedControlItem',
|
|
23
|
-
|
|
24
|
-
inheritAttrs: false,
|
|
25
|
-
|
|
26
|
-
props: {
|
|
27
|
-
size: {
|
|
28
|
-
type: String as PropType<SegmentedControlSize>,
|
|
29
|
-
required: true,
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
selected: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: false,
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
disabled: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: false,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
setup(props) {
|
|
44
|
-
// Refs
|
|
45
|
-
const root = ref<HTMLElement>();
|
|
46
|
-
|
|
47
|
-
// Styles
|
|
48
|
-
const classAttribute = useClassAttribute();
|
|
49
|
-
|
|
50
|
-
const rootStyles = computed(() => [
|
|
51
|
-
'or-segmented-control-item',
|
|
52
|
-
...SegmentedControlItemRoot,
|
|
53
|
-
...SegmentedControlItemRootSizes[props.size],
|
|
54
|
-
classAttribute.value,
|
|
55
|
-
]);
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
root,
|
|
59
|
-
rootStyles,
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
</script>
|
package/src/components/or-segmented-control-v3/components/or-segmented-control-item/styles.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
};
|