@teammodlr/ui-kit 2.1.49 → 2.1.51

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 (82) hide show
  1. package/lib/components/avatar/Avatar.vue.d.ts +1 -1
  2. package/lib/components/badge/style/Badge.css.d.ts +2 -2
  3. package/lib/components/button/Button.vue.d.ts +4 -4
  4. package/lib/components/button/style/Button.css.d.ts +3 -3
  5. package/lib/components/checkbox/Checkbox.vue.d.ts +4 -4
  6. package/lib/components/configprovider/ConfigProvider.vue.d.ts +12 -11
  7. package/lib/components/confirm/ConfirmProvider.vue.d.ts +10 -10
  8. package/lib/components/dropdown/DropdownItem.vue.d.ts +2 -2
  9. package/lib/components/dropdown/style/Dropdown.css.d.ts +1 -1
  10. package/lib/components/input/Input.vue.d.ts +6 -6
  11. package/lib/components/link/Link.vue.d.ts +2 -2
  12. package/lib/components/messageprovider/Message.vue.d.ts +2 -2
  13. package/lib/components/messageprovider/MessageProvider.vue.d.ts +5 -5
  14. package/lib/components/messageprovider/style/Message.css.d.ts +1 -1
  15. package/lib/components/modal/Modal.vue.d.ts +1 -1
  16. package/lib/components/radio/Radio.vue.d.ts +6 -6
  17. package/lib/components/radiobutton/RadioButton.vue.d.ts +4 -4
  18. package/lib/components/renderer/renderer.d.ts +1 -1
  19. package/lib/components/select/Select.vue.d.ts +21 -20
  20. package/lib/components/switch/Switch.vue.d.ts +4 -4
  21. package/lib/components/tab/Tab.vue.d.ts +4 -6
  22. package/lib/components/tab/TabGroup.vue.d.ts +17 -3
  23. package/lib/components/tab/style/Tab.css.d.ts +7 -0
  24. package/lib/components/tab/style/index.d.ts +1 -0
  25. package/lib/components/table/Table.vue.d.ts +2 -2
  26. package/lib/components/textarea/Textarea.vue.d.ts +5 -5
  27. package/lib/composables/useInput.d.ts +1 -1
  28. package/lib/index.cjs.js +10 -13
  29. package/lib/index.es.js +2386 -2432
  30. package/lib/install.d.ts +1 -1
  31. package/lib/style.css +1 -1
  32. package/package.json +75 -89
  33. package/src/components/avatar/examples/index.stories.ts +25 -25
  34. package/src/components/avatargroup/examples/index.stories.ts +19 -19
  35. package/src/components/badge/examples/index.stories.ts +19 -19
  36. package/src/components/breadcrumb/examples/index.stories.ts +16 -16
  37. package/src/components/button/examples/index.stories.ts +37 -37
  38. package/src/components/buttongroup/examples/index.stories.ts +17 -17
  39. package/src/components/checkbox/examples/index.stories.ts +16 -16
  40. package/src/components/colorpicker/examples/index.stories.ts +12 -12
  41. package/src/components/configprovider/ConfigProvider.vue +38 -38
  42. package/src/components/confirm/ConfirmProvider.vue +82 -82
  43. package/src/components/confirm/examples/index.stories.ts +26 -26
  44. package/src/components/dialog/examples/index.stories.ts +14 -14
  45. package/src/components/dropdown/examples/index.stories.ts +26 -26
  46. package/src/components/form/examples/index.stories.ts +23 -23
  47. package/src/components/image/examples/index.stories.ts +10 -10
  48. package/src/components/input/examples/index.stories.ts +26 -26
  49. package/src/components/link/examples/index.stories.ts +15 -15
  50. package/src/components/messageprovider/examples/index.stories.ts +26 -26
  51. package/src/components/modal/examples/index.stories.ts +16 -16
  52. package/src/components/pagination/examples/index.stories.ts +11 -11
  53. package/src/components/radio/examples/index.stories.ts +16 -16
  54. package/src/components/radiobuttongroup/examples/index.stories.ts +18 -18
  55. package/src/components/renderer/examlpes/index.stories.ts +14 -14
  56. package/src/components/select/Select.vue +755 -755
  57. package/src/components/select/examples/basic.vue +26 -26
  58. package/src/components/select/examples/index.stories.ts +16 -16
  59. package/src/components/select/types.ts +27 -27
  60. package/src/components/skeleton/examples/index.stories.ts +13 -13
  61. package/src/components/switch/examples/index.stories.ts +15 -15
  62. package/src/components/switch/style/Switch.css.ts +135 -135
  63. package/src/components/tab/Tab.vue +85 -98
  64. package/src/components/tab/TabGroup.vue +96 -90
  65. package/src/components/tab/examples/index.stories.ts +21 -10
  66. package/src/components/tab/style/Tab.css.ts +137 -0
  67. package/src/components/tab/style/index.ts +1 -0
  68. package/src/components/table/examples/index.stories.ts +17 -17
  69. package/src/components/tag/examples/index.stories.ts +16 -16
  70. package/src/components/textarea/examples/index.stories.ts +14 -14
  71. package/src/components/tooltip/examples/index.stories.ts +17 -17
  72. package/src/components/transfer/examples/index.stories.ts +12 -12
  73. package/src/components/tree/examples/index.stories.ts +12 -12
  74. package/src/components/virtualscroll/examples/index.stories.ts +11 -11
  75. package/src/composables/useCachedUid.ts +15 -15
  76. package/src/composables/useInput.ts +151 -151
  77. package/src/examples/cards/cards.stories.ts +9 -9
  78. package/src/examples/modal/modal.stories.ts +9 -9
  79. package/src/types/props.ts +21 -21
  80. package/src/utils/call.ts +34 -34
  81. package/src/utils/injection.ts +45 -45
  82. package/src/components/tab/Tab.css +0 -113
@@ -1,90 +1,96 @@
1
- <template>
2
- <div
3
- :class="computedWrapperClasses"
4
- >
5
- <div
6
- ref="wrapperRef"
7
-
8
- >
9
- <ul
10
- ref="tabsRef"
11
- :class="computedTabsClasses"
12
- >
13
- <slot />
14
- </ul>
15
- </div>
16
- <div ref="tabsContentRef" class="m-tab-group__content"></div>
17
- </div>
18
- </template>
19
-
20
- <script lang="ts">
21
- import type { Size } from '../../types/props';
22
- import { computed, defineComponent, provide, reactive, ref, watchEffect, type PropType } from 'vue';
23
-
24
- export default defineComponent({
25
- name: "TabGroup",
26
- props: {
27
- modelValue: {
28
- type: [String, Number],
29
- },
30
- size: {
31
- type: String as PropType<Size>,
32
- default: 'md'
33
- },
34
- vertical: {
35
- type: Boolean,
36
- default: false
37
- }
38
- },
39
- emit: [
40
- 'update:modelValue'
41
- ],
42
- setup(props, { emit }) {
43
- const wrapperRef = ref<HTMLElement>();
44
- const tabsContentRef = ref<HTMLElement>();
45
- const contentRef = ref<HTMLElement>();
46
- const active = ref();
47
-
48
- watchEffect(() => {
49
- active.value = props.modelValue;
50
- });
51
-
52
- const state = reactive({
53
- active: computed(() => active.value)
54
- });
55
-
56
- const computedWrapperClasses = computed(() => {
57
- return {
58
- 'm-tab-group': true,
59
- 'm-tab-group--vertical': props.vertical,
60
- [`m-tab-group--${props.size}`]: true
61
- }
62
- });
63
-
64
- const computedTabsClasses = computed(() => {
65
- return {
66
- 'm-tab-group__tabs': true,
67
- }
68
- });
69
-
70
- function selectTab(tab: string | number) {
71
- active.value = tab;
72
- emit('update:modelValue', tab);
73
- }
74
-
75
- provide("tabs", {
76
- tabsContentRef,
77
- selectTab,
78
- state
79
- })
80
-
81
- return {
82
- wrapperRef,
83
- tabsContentRef,
84
- contentRef,
85
- computedWrapperClasses,
86
- computedTabsClasses
87
- }
88
- }
89
- })
90
- </script>
1
+ <template>
2
+ <div :class="computedTabsWrapperClasses">
3
+ <div ref="wrapperRef">
4
+ <ul ref="tabsRef" :class="computedTabsClasses">
5
+ <slot />
6
+ </ul>
7
+ </div>
8
+ <div ref="tabsContentRef" :class="computedTabContentClasses"></div>
9
+ </div>
10
+ </template>
11
+
12
+ <script lang="ts">
13
+ import type { Size } from '../../types/props';
14
+ import { computed, defineComponent, provide, reactive, ref, watchEffect, type PropType } from 'vue';
15
+ import { tabs, tabContent } from './style';
16
+ export default defineComponent({
17
+ name: "TabGroup",
18
+ props: {
19
+ modelValue: {
20
+ type: [String, Number],
21
+ },
22
+ size: {
23
+ type: String as PropType<Size>,
24
+ default: 'md'
25
+ },
26
+ vertical: {
27
+ type: Boolean,
28
+ default: false
29
+ },
30
+ type: {
31
+ type: String as PropType<'base' | 'card'>,
32
+ default: 'base',
33
+ validator: (value: string) => ['base', 'card'].includes(value)
34
+ }
35
+ },
36
+ emit: [
37
+ 'update:modelValue'
38
+ ],
39
+ setup(props, { emit }) {
40
+ const wrapperRef = ref<HTMLElement>();
41
+ const tabsContentRef = ref<HTMLElement>();
42
+ const contentRef = ref<HTMLElement>();
43
+ const active = ref();
44
+
45
+ watchEffect(() => {
46
+ active.value = props.modelValue;
47
+ });
48
+
49
+ const state = reactive({
50
+ active: computed(() => active.value),
51
+ type: computed(() => props.type)
52
+ });
53
+
54
+ const computedTabsWrapperClasses = computed(() => {
55
+ return {
56
+ 'm-tab-group': true,
57
+ 'm-tab-group--vertical': props.vertical
58
+ }
59
+ });
60
+
61
+ const computedTabsClasses = computed(() => {
62
+ return {
63
+ [tabs[props.type as keyof typeof tabs]]: true,
64
+ 'm-tab-group--vertical': props.vertical,
65
+ [`m-tab-group--${props.size}`]: true
66
+ }
67
+ });
68
+
69
+ const computedTabContentClasses = computed(() => {
70
+ return {
71
+ [tabContent]: true
72
+ }
73
+ })
74
+
75
+ function selectTab(tab: string | number) {
76
+ active.value = tab;
77
+ emit('update:modelValue', tab);
78
+ }
79
+
80
+ provide("tabs", {
81
+ tabsContentRef,
82
+ selectTab,
83
+ state
84
+ })
85
+
86
+ return {
87
+ wrapperRef,
88
+ tabsContentRef,
89
+ contentRef,
90
+ computedTabsWrapperClasses,
91
+ computedTabsClasses,
92
+ computedTabContentClasses
93
+ }
94
+ }
95
+ })
96
+ </script>
@@ -1,19 +1,30 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3';
1
2
  import MTabGroup from '../TabGroup.vue';
2
3
  import MTab from '../Tab.vue';
3
4
  import { MTabsBasic, MTabsVertical } from './index';
4
-
5
5
  import { createStory, sizeArgType } from '../../../__storybook__';
6
6
 
7
- export default {
8
- component: MTabGroup,
9
- subcomponents: {
10
- MTab
11
- },
7
+
8
+ const meta: Meta<typeof MTabGroup> = {
12
9
  title: 'Components/Tabs',
10
+ component: MTabGroup,
11
+ subcomponents: { MTab },
13
12
  argTypes: {
14
- ...sizeArgType()
13
+ size: sizeArgType,
14
+ type: {
15
+ options: [
16
+ 'base',
17
+ 'card',
18
+ ],
19
+ control: {
20
+ type: 'select',
21
+ default: 'base'
22
+ }
23
+ }
15
24
  }
16
- };
25
+ }
17
26
 
18
- export const Basic = createStory(MTabsBasic);
19
- export const Vertical = createStory(MTabsVertical);
27
+ export default meta;
28
+ type Story = StoryObj<typeof MTabGroup>;
29
+ export const Default = createStory(MTabsBasic) as Story;
30
+ // export const Vertical = createStory(MTabsVertical);
@@ -0,0 +1,137 @@
1
+ import {
2
+ createVar,
3
+ style,
4
+ styleVariants
5
+ } from '@vanilla-extract/css';
6
+ import { themeVars } from '../../../styles/theme.css';
7
+
8
+ const sizes = {
9
+ xs: '14px',
10
+ sm: '16px',
11
+ md: '18px',
12
+ lg: '20px',
13
+ xl: '22px'
14
+ };
15
+
16
+ const vars = {
17
+ tabsGap: createVar(),
18
+ tabsBackground: createVar(),
19
+ tabsPadding: createVar(),
20
+ tabsBorder: createVar(),
21
+
22
+ tabBackground: createVar(),
23
+ tabColor: createVar(),
24
+ tabBorder: createVar(),
25
+ tabFontSize: createVar(),
26
+ tabFontWeight: createVar(),
27
+ tabPadding: createVar(),
28
+ tabBorderRadius: createVar()
29
+ }
30
+
31
+ export const tabWrapper = style({
32
+ display: 'flex',
33
+ flexDirection: 'column',
34
+ });
35
+
36
+ const baseTabs = style({
37
+ vars: {
38
+ [vars.tabsGap]: '24px',
39
+ [vars.tabsBackground]: 'transparent',
40
+ [vars.tabsPadding]: '0',
41
+ [vars.tabsBorder]: 'none',
42
+ },
43
+ listStyle: 'none',
44
+ margin: 0,
45
+ display: 'flex',
46
+ gap: vars.tabsGap,
47
+ backgroundColor: vars.tabsBackground,
48
+ padding: vars.tabsPadding,
49
+ border: vars.tabsBorder,
50
+ flexWrap: 'nowrap',
51
+ flexShrink: 0,
52
+ flexGrow: 0
53
+ });
54
+
55
+ export const tabs = styleVariants({
56
+ base: [baseTabs],
57
+ card: [baseTabs, {
58
+ vars: {
59
+ [vars.tabsGap]: '6px'
60
+ }
61
+ }]
62
+ });
63
+
64
+ export const baseButton = style({
65
+ vars: {
66
+ [vars.tabBackground]: 'transparent',
67
+ [vars.tabBorder]: 'none',
68
+ [vars.tabFontSize]: '14px',
69
+ [vars.tabFontWeight]: '600',
70
+ [vars.tabColor]: themeVars.color.gray[500],
71
+ [vars.tabPadding]: '6px 0',
72
+ [vars.tabBorderRadius]: '4px'
73
+ },
74
+ verticalAlign: 'bottom',
75
+ cursor: 'pointer',
76
+ display: 'inline-flex',
77
+ alignItems: 'center',
78
+ fontWeight: vars.tabFontWeight,
79
+ color: vars.tabColor,
80
+ padding: vars.tabPadding,
81
+ backgroundClip: 'padding-box',
82
+ backgroundColor: vars.tabBackground,
83
+ borderRadius: vars.tabBorderRadius,
84
+ transition: 'all .2s ease',
85
+ border: 'none',
86
+ fontSize: vars.tabFontSize,
87
+ selectors: {
88
+ '&:hover': {
89
+ vars: {
90
+ color: themeVars.color.blue[400],
91
+ },
92
+ }
93
+ }
94
+ });
95
+
96
+ export const tabButton = styleVariants({
97
+ base: [baseButton, {
98
+ vars: {
99
+ [vars.tabBorderRadius]: '0',
100
+ }
101
+ }],
102
+ card: [baseButton, {
103
+ vars: {
104
+ [vars.tabPadding]: '10px 16px',
105
+ [vars.tabBorderRadius]: `${themeVars.rounded.default} ${themeVars.rounded.default} 0 0`,
106
+ [vars.tabBackground]: themeVars.color.gray[150],
107
+ [vars.tabColor]: themeVars.color.gray[600],
108
+ },
109
+ border: `1px solid ${themeVars.color.gray[300]}`,
110
+ borderBottom: 'none',
111
+ transition: 'all .2s ease',
112
+ }]
113
+ });
114
+
115
+ export const tabButtonActive = styleVariants({
116
+ base: [baseButton, {
117
+ color: themeVars.color.blue[500],
118
+ border: 'none',
119
+ boxShadow: `inset 0 -2px ${themeVars.color.blue[500]}`,
120
+ }],
121
+ card: [baseButton, {
122
+ color: themeVars.color.blue[500],
123
+ backgroundColor: '#0000',
124
+ }]
125
+ });
126
+
127
+ export const tabLabel = style({
128
+ display: 'flex',
129
+ alignItems: 'center',
130
+ zIndex: 1,
131
+ })
132
+
133
+ export const tabContent = style({
134
+ padding: '12px 0 0 0',
135
+ width: '100%',
136
+ transition: 'color .2s ease, background-color .2s ease',
137
+ })
@@ -0,0 +1 @@
1
+ export * from './Tab.css';
@@ -1,17 +1,17 @@
1
- import MTable from '../Table.vue';
2
- import MButton from '../../button/Button.vue';
3
- import { MTableBasic, MTableEmpty, MTableSelected } from './index';
4
-
5
- import { createStory } from '../../../__storybook__';
6
-
7
- export default {
8
- component: MTable,
9
- subcomponents: {
10
- MButton
11
- },
12
- title: 'Components/Table'
13
- };
14
-
15
- export const Basic = createStory(MTableBasic);
16
- export const Empty = createStory(MTableEmpty);
17
- export const Selected = createStory(MTableSelected);
1
+ import MTable from '../Table.vue';
2
+ import MButton from '../../button/Button.vue';
3
+ import { MTableBasic, MTableEmpty, MTableSelected } from './index';
4
+
5
+ import { createStory } from '../../../__storybook__';
6
+
7
+ export default {
8
+ component: MTable,
9
+ subcomponents: {
10
+ MButton
11
+ },
12
+ title: 'Components/Table'
13
+ };
14
+
15
+ export const Basic = createStory(MTableBasic);
16
+ export const Empty = createStory(MTableEmpty);
17
+ export const Selected = createStory(MTableSelected);
@@ -1,16 +1,16 @@
1
- import MTag from '../Tag.vue';
2
-
3
- import { MTagBasic } from './index';
4
-
5
- import { colorArgType, createStory, sizeArgType } from '../../../__storybook__';
6
-
7
- export default {
8
- component: MTag,
9
- title: 'Components/Tag',
10
- argTypes: {
11
- ...colorArgType(),
12
- ...sizeArgType()
13
- }
14
- };
15
-
16
- export const Basic = createStory(MTagBasic);
1
+ import MTag from '../Tag.vue';
2
+
3
+ import { MTagBasic } from './index';
4
+
5
+ import { colorArgType, createStory, sizeArgType } from '../../../__storybook__';
6
+
7
+ export default {
8
+ component: MTag,
9
+ title: 'Components/Tag',
10
+ argTypes: {
11
+ ...colorArgType(),
12
+ ...sizeArgType()
13
+ }
14
+ };
15
+
16
+ export const Basic = createStory(MTagBasic);
@@ -1,14 +1,14 @@
1
- import MTextarea from '../Textarea.vue';
2
- import { MTextareaBasic } from './index';
3
-
4
- import { createStory, sizeArgType } from '../../../__storybook__';
5
-
6
- export default {
7
- component: MTextarea,
8
- title: 'Components/Textarea',
9
- argTypes: {
10
- ...sizeArgType()
11
- }
12
- };
13
-
14
- export const Basic = createStory(MTextareaBasic);
1
+ import MTextarea from '../Textarea.vue';
2
+ import { MTextareaBasic } from './index';
3
+
4
+ import { createStory, sizeArgType } from '../../../__storybook__';
5
+
6
+ export default {
7
+ component: MTextarea,
8
+ title: 'Components/Textarea',
9
+ argTypes: {
10
+ ...sizeArgType()
11
+ }
12
+ };
13
+
14
+ export const Basic = createStory(MTextareaBasic);
@@ -1,17 +1,17 @@
1
- import MTooltip from '../Tooltip.vue';
2
- import MButton from '@/components/button/Button.vue';
3
- import { MTooltipBasic, MTooltipPlacement } from './index';
4
-
5
- import { createStory, popperPositionArgType } from '../../../__storybook__';
6
-
7
- export default {
8
- component: MTooltip,
9
- subcomponents: { MButton },
10
- title: 'Components/Tooltip',
11
- argTypes: {
12
- ...popperPositionArgType()
13
- }
14
- };
15
-
16
- export const Basic = createStory(MTooltipBasic);
17
- export const Placement = createStory(MTooltipPlacement);
1
+ import MTooltip from '../Tooltip.vue';
2
+ import MButton from '@/components/button/Button.vue';
3
+ import { MTooltipBasic, MTooltipPlacement } from './index';
4
+
5
+ import { createStory, popperPositionArgType } from '../../../__storybook__';
6
+
7
+ export default {
8
+ component: MTooltip,
9
+ subcomponents: { MButton },
10
+ title: 'Components/Tooltip',
11
+ argTypes: {
12
+ ...popperPositionArgType()
13
+ }
14
+ };
15
+
16
+ export const Basic = createStory(MTooltipBasic);
17
+ export const Placement = createStory(MTooltipPlacement);
@@ -1,12 +1,12 @@
1
- import MTransfer from '../Transfer.vue';
2
-
3
- import { MTransferBasic } from './index';
4
-
5
- import { createStory } from '../../../__storybook__';
6
-
7
- export default {
8
- component: MTransfer,
9
- title: 'Components/Transfer'
10
- };
11
-
12
- export const Basic = createStory(MTransferBasic);
1
+ import MTransfer from '../Transfer.vue';
2
+
3
+ import { MTransferBasic } from './index';
4
+
5
+ import { createStory } from '../../../__storybook__';
6
+
7
+ export default {
8
+ component: MTransfer,
9
+ title: 'Components/Transfer'
10
+ };
11
+
12
+ export const Basic = createStory(MTransferBasic);
@@ -1,12 +1,12 @@
1
- import MTree from '../Tree.vue';
2
-
3
- import { MTreeBasic } from './index';
4
-
5
- import { createStory } from '../../../__storybook__';
6
-
7
- export default {
8
- component: MTree,
9
- title: 'Components/Tree'
10
- };
11
-
12
- export const Basic = createStory(MTreeBasic);
1
+ import MTree from '../Tree.vue';
2
+
3
+ import { MTreeBasic } from './index';
4
+
5
+ import { createStory } from '../../../__storybook__';
6
+
7
+ export default {
8
+ component: MTree,
9
+ title: 'Components/Tree'
10
+ };
11
+
12
+ export const Basic = createStory(MTreeBasic);
@@ -1,11 +1,11 @@
1
- import MVirtualScroll from '../VirtualScroll.vue';
2
- import { MVirtualScrollBasic } from './index';
3
-
4
- import { createStory } from '../../../__storybook__';
5
-
6
- export default {
7
- component: MVirtualScroll,
8
- title: 'Components/VirtualScroll'
9
- };
10
-
11
- export const Basic = createStory(MVirtualScrollBasic);
1
+ import MVirtualScroll from '../VirtualScroll.vue';
2
+ import { MVirtualScrollBasic } from './index';
3
+
4
+ import { createStory } from '../../../__storybook__';
5
+
6
+ export default {
7
+ component: MVirtualScroll,
8
+ title: 'Components/VirtualScroll'
9
+ };
10
+
11
+ export const Basic = createStory(MVirtualScrollBasic);
@@ -1,15 +1,15 @@
1
- import { injectConfigProviderContext } from '../components/configprovider/ConfigProvider.vue';
2
-
3
- let count = 0
4
-
5
- export function useId(deterministicId?: string | null | undefined, prefix = 'ui') {
6
- if (deterministicId) {
7
- return deterministicId;
8
- }
9
- const { useId } = injectConfigProviderContext({ useId: undefined })
10
- if (useId && typeof useId === 'function') {
11
- return `${prefix}-${useId()}`;
12
- }
13
-
14
- return `${prefix}-${count++}`;
15
- }
1
+ import { injectConfigProviderContext } from '../components/configprovider/ConfigProvider.vue';
2
+
3
+ let count = 0
4
+
5
+ export function useId(deterministicId?: string | null | undefined, prefix = 'ui') {
6
+ if (deterministicId) {
7
+ return deterministicId;
8
+ }
9
+ const { useId } = injectConfigProviderContext({ useId: undefined })
10
+ if (useId && typeof useId === 'function') {
11
+ return `${prefix}-${useId()}`;
12
+ }
13
+
14
+ return `${prefix}-${count++}`;
15
+ }